[SCM] Worms style game branch, master, updated. debian/0.9.18-0.3-8-g5d29a54

Luca Bruno lucab at debian.org
Sun May 26 21:55:18 UTC 2013


The following commit has been merged in the master branch:
commit 285290714ef7302fb177c2faf90f87030d9753bb
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Tue Feb 12 09:35:13 2013 +0100

    Imported Upstream version 0.9.18

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74e8167..8df0976 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,9 +4,9 @@ project(hedgewars)
 #initialise cmake environment
 cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
 FOREACH(policy CMP0003 CMP0012)
-	IF(POLICY ${policy})
-		CMAKE_POLICY(SET ${policy} NEW)
-	ENDIF()
+    IF(POLICY ${policy})
+        CMAKE_POLICY(SET ${policy} NEW)
+    ENDIF()
 ENDFOREACH()
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
 
@@ -15,189 +15,245 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
 set(version_suffix "") #UNSET THIS VARIABLE AT RELEASE TIME
 set(HGCHANGED "")
 IF(version_suffix MATCHES "-dev")
-	set(HW_DEV true)
-	IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.hg)
-		FIND_PROGRAM(HGCOMMAND hg)
-		IF(HGCOMMAND)
-			exec_program(${HGCOMMAND}
-				     ARGS identify -in ${CMAKE_CURRENT_SOURCE_DIR}
-				     OUTPUT_VARIABLE version_suffix
-				     )
-			STRING(REGEX REPLACE "[^+]" "" HGCHANGED ${version_suffix})
-			STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3-\\1" version_suffix ${version_suffix})
-			IF (HGCHANGED)
-				MESSAGE(STATUS "Building revision ${version_suffix} (SOURCE CODE MODIFIED)")
-			ELSE()
-				MESSAGE(STATUS "Building revision ${version_suffix}")
-			ENDIF()
-			set(version_suffix "-${version_suffix}")
-		ENDIF()
-	ENDIF()
+    set(HW_DEV true)
+    set(default_build_type "DEBUG")
+    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.hg)
+        FIND_PROGRAM(HGCOMMAND hg)
+        IF(HGCOMMAND)
+            exec_program(${HGCOMMAND}
+                     ARGS identify -in ${CMAKE_CURRENT_SOURCE_DIR}
+                     OUTPUT_VARIABLE version_suffix
+                     )
+            STRING(REGEX REPLACE "[^+]" "" HGCHANGED ${version_suffix})
+            STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3-\\1" version_suffix ${version_suffix})
+            IF (HGCHANGED)
+                MESSAGE(STATUS "Building revision ${version_suffix} (SOURCE CODE MODIFIED)")
+            ELSE()
+                MESSAGE(STATUS "Building revision ${version_suffix}")
+            ENDIF()
+            set(version_suffix "-${version_suffix}")
+        ENDIF()
+    ENDIF()
 ELSE()
-	set(HW_DEV false)
+    set(HW_DEV false)
+    set(default_build_type "RELEASE")
 ENDIF()
 
 
 #versioning
 set(CPACK_PACKAGE_VERSION_MAJOR 0)
 set(CPACK_PACKAGE_VERSION_MINOR 9)
-set(CPACK_PACKAGE_VERSION_PATCH 17${version_suffix})
-set(HEDGEWARS_PROTO_VER 41)
+set(CPACK_PACKAGE_VERSION_PATCH 18${version_suffix})
+set(HEDGEWARS_PROTO_VER 43)
 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 
 
-#set some safe values
-IF(NOT WITH_SERVER)
-	SET(WITH_SERVER 0)
-ENDIF(NOT WITH_SERVER)
-IF(NOT BUILD_ENGINE_LIBRARY)
-	SET(BUILD_ENGINE_LIBRARY 0)
-ENDIF(NOT BUILD_ENGINE_LIBRARY)
-set(target_dir "bin")
+#set some default values
+option(NOSERVER "Disable gameServer build [default: auto]" OFF)
+option(NOPNG "Disable screenshoot compression [default: auto]" OFF)
+option(NOVIDEOREC "Disable video recording [default: auto]" OFF)
+
+option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF)
+option(ANDROID "Enable Android build [default: off]" OFF)
+
+option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
+option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
 
 
 #bundle .app setup
+if(APPLE OR CROSSAPPLE)
+    #paths for creating the bundle
+    set(bundle_name Hedgewars.app)
+    set(frameworks_dir ${bundle_name}/Contents/Frameworks/)
+    set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/)
+    set(DATA_INSTALL_DIR "../Resources/")
+    set(target_dir ".")
+    set(minimum_macosx_version "10.6")
+else()
+    set(target_dir "bin")
+endif()
+
 if(APPLE)
-	set(CMAKE_FIND_FRAMEWORK "FIRST")
-
-	#paths for creating the bundle
-	set(bundle_name Hedgewars.app)
-	set(frameworks_dir ${bundle_name}/Contents/Frameworks/)
-	set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/)
-	set(DATA_INSTALL_DIR "../Resources/")
-	set(target_dir ".")
-
-	#what system are we building for
-	set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET})
-
-	#detect on which system are we
-	EXEC_PROGRAM("/usr/bin/sw_vers" ARGS "-productVersion" OUTPUT_VARIABLE current_macosx_version)
-	STRING(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version})
-
-	#if nothing is set, we deploy only for the current system
-	if(NOT minimum_macosx_version)
-		set(minimum_macosx_version ${current_macosx_version})
-	endif()
-
-	#who uses them anyway?
-	if (minimum_macosx_version LESS "10.4")
-		message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4")
-	endif()
-
-	#this variable needs to be set for frapascal universal binary
-	if(NOT CMAKE_OSX_ARCHITECTURES)
-		if(current_macosx_version LESS "10.6")
-			if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
-				set(CMAKE_OSX_ARCHITECTURES "ppc7400")
-			else()
-				set(CMAKE_OSX_ARCHITECTURES "i386")
-			endif()
-		else()
-			set(CMAKE_OSX_ARCHITECTURES "x86_64")
-		endif()
-	endif()
-
-	#be sure to select ppc-compatible toolchains just in case
-	if(minimum_macosx_version LESS "10.6")
-		set(CMAKE_C_COMPILER "gcc-4.0")
-		set(CMAKE_CXX_COMPILER "g++-4.0")
-	endif()
-
-	if(minimum_macosx_version MATCHES "10.4")
-		set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
-		#workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2)
-		if(current_macosx_version MATCHES "10.4")
-			find_package(SDL_mixer REQUIRED)
-			set(pascal_compiler_flags_cmn "-k-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg" "-k-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod" ${pascal_compiler_flags_cmn})
-			set(CMAKE_C_FLAGS "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg -dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
-		endif()
-	else()
-		STRING(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version})
-		set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/")
-	endif()
-
-	#add user framework directory
-	set(pascal_compiler_flags_cmn "-Ff~/Library/Frameworks" ${pascal_compiler_flags_cmn})
-	#set deployment target
-	set(pascal_compiler_flags_cmn "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_compiler_flags_cmn})
-	#link with liblua.a (which requires readline)
-	set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn})
-	#link with libsdlmain.a (when building an executable)
-	if(NOT BUILD_ENGINE_LIBRARY)
-		set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/libSDLmain.a" ${pascal_compiler_flags_cmn})
-	endif()
-
-	message(STATUS "Build system: Mac OS X ${current_macosx_version} with GCC:${CMAKE_C_COMPILER}")
-	message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s):${CMAKE_OSX_ARCHITECTURES}")
+    set(CMAKE_FIND_FRAMEWORK "FIRST")
+
+    #what system are we building for
+    set(minimum_macosx_version $ENV{MACOSX_DEPLOYMENT_TARGET})
+
+    #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version
+    find_program(sw_vers sw_vers)
+    if(sw_vers)
+        exec_program(${sw_vers} ARGS "-productVersion" OUTPUT_VARIABLE current_macosx_version)
+        string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version})
+        else()
+        if(NOT minimum_macosx_version)
+            message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set")
+        else()
+            set(current_macosx_version ${minimum_macosx_version})
+        endif()
+    endif()
+
+    #if nothing is set, we deploy only for the current system
+    if(NOT minimum_macosx_version)
+        set(minimum_macosx_version ${current_macosx_version})
+    endif()
+
+    #lower systems don't have enough processing power anyways
+    if (minimum_macosx_version LESS "10.4")
+        message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4")
+    endif()
+
+    #workaround for http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html#SDL_mixer (Update 2)
+    if(current_macosx_version MATCHES "10.4")
+        find_package(SDL_mixer REQUIRED)
+        set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg")
+        set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
+        set(pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}" ${pascal_flags})
+        set(CMAKE_C_FLAGS "${DYLIB_SMPEG}" "${DYLIB_MIKMOD}" ${CMAKE_C_FLAGS})
+    endif()
+
+    #CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking
+    if(NOT CMAKE_OSX_ARCHITECTURES)
+        if(current_macosx_version LESS "10.6")
+            if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc*")
+                set(CMAKE_OSX_ARCHITECTURES "ppc7400")
+            else()
+                set(CMAKE_OSX_ARCHITECTURES "i386")
+            endif()
+        else()
+            set(CMAKE_OSX_ARCHITECTURES "x86_64")
+        endif()
+    endif()
+
+    #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on
+    #we need to provide the correct one when host and target differ
+    if(NOT ${minimum_macosx_version} MATCHES ${current_macosx_version})
+        if(minimum_macosx_version MATCHES "10.4")
+            set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
+            set(CMAKE_C_COMPILER "gcc-4.0")
+            set(CMAKE_CXX_COMPILER "g++-4.0")
+        else()
+            string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version})
+            set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/")
+        endif()
+    endif()
+
+    #add user framework directory, other paths can be passed via FPFLAGS
+    set(pascal_flags "-Ff~/Library/Frameworks" ${pascal_flags})
+    #set deployment target
+    set(pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_flags})
+
+    message(STATUS "Build system: Mac OS X ${current_macosx_version} with GCC:${CMAKE_C_COMPILER}")
+    message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s):${CMAKE_OSX_ARCHITECTURES}")
 endif(APPLE)
 
 
-#build Debug only when explicitally set
-if (NOT CMAKE_BUILD_TYPE)
-	set (CMAKE_BUILD_TYPE RELEASE CACHE STRING "Choose the type of build, options are: Debug Release." FORCE)
-endif (NOT CMAKE_BUILD_TYPE)
+#when build type is not specified, assume Debug/Release according to build version information
+if (CMAKE_BUILD_TYPE)
+    string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+    if ( NOT( (CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "DEBUG") ) )
+        set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Only 'Debug' or 'Release' options are allowed." FORCE)
+        message (STATUS "Unknown build type, using default (${default_build_type})")
+    endif ()
+else (CMAKE_BUILD_TYPE)
+    set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Choose the build type, options are: Debug Release." FORCE)
+endif (CMAKE_BUILD_TYPE)
 
-if(CMAKE_BUILD_TYPE MATCHES DEBUG OR CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "debug")
-	message(STATUS "Building Debug")
-	set(Optz false)
-else()
-	message(STATUS "Building Release")
-	set(Optz true)
-endif()
 
-
-#set default flags values for all the project
+#set default flags values for all projects
 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}")
-set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
+set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}")
 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
 
-set(pascal_compiler_flags_cmn "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn})
+#parse additional parameters
+if(FPFLAGS OR GHFLAGS)
+    math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}")
+    if(cmake_version LESS "020800")
+        message(STATUS "FPFLAGS and GHFLAGS are available only when using CMake >= 2.8")
+    else()
+        separate_arguments(fpflags_parsed UNIX_COMMAND ${FPFLAGS})
+        separate_arguments(ghflags_parsed UNIX_COMMAND ${GHFLAGS})
+    endif()
+endif()
+
+set(pascal_flags ${fpflags_parsed} "-vm4079,4080,4081" "-B" "-FE../bin" "-Cs2000000" "-vewnq" "-dDEBUGFILE" ${pascal_flags})
+set(haskell_flags "-O2" ${ghflags_parsed} ${haskell_flags})
 
-if(Optz)
-#	set(pascal_compiler_flags_cmn "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_compiler_flags_cmn})
-	set(pascal_compiler_flags_cmn "-O2" "-Xs" "-Si" ${pascal_compiler_flags_cmn})
-	set(haskell_compiler_flags_cmn "-O2" "-w" "-fno-warn-unused-do-bind")
-else(Optz)
-#	set(pascal_compiler_flags_cmn "-O-" "-g" "-gh" "-gl" "-dDEBUGFILE" ${pascal_compiler_flags_cmn})
-	set(pascal_compiler_flags_cmn "-O-" "-g" "-gl" "-dDEBUGFILE" ${pascal_compiler_flags_cmn})
-	set(haskell_compiler_flags_cmn "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind")
-endif(Optz)
+#get BUILD_TYPE and enable/disable optimisation
+if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
+    message(STATUS "Building Debug flavour")
+    set(pascal_flags "-O-" "-g" "-gl" "-gv" ${pascal_flags})
+    set(haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_flags})
+else()
+    message(STATUS "Building Release flavour")
+#    set(pascal_flags "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_flags})
+    set(pascal_flags "-Os" "-Ooregvar" "-Xs" "-Si" ${pascal_flags})
+    set(haskell_flags "-w" "-fno-warn-unused-do-bind" ${haskell_flags})
+endif()
 
 
+#finish setting paths
 if(DEFINED DATA_INSTALL_DIR)
-	set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
+    set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
 else()
-	set(SHAREPATH share/hedgewars/)
+    set(SHAREPATH share/hedgewars/)
 endif()
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
+
+
+#server discovery
+if(NOT NOSERVER)
+    if(GHC)
+        set(ghc_executable ${GHC})
+    else()
+        find_program(ghc_executable ghc)
+    endif()
+
+    if(ghc_executable)
+        set(HAVE_NETSERVER true)
+        add_subdirectory(gameServer)
+        message(STATUS "Found GHC: ${ghc_executable}")
+    else()
+        message(STATUS "Could NOT find GHC, server will not be built")
+        set(HAVE_NETSERVER false)
+    endif()
+else()
+    message(STATUS "Server will not be built per user request")
+    set(HAVE_NETSERVER false)
+endif()
 
 
-if(WITH_SERVER)
-	find_program(ghc_executable ghc)
+#lua discovery
+find_package(Lua)
+if(LUA_FOUND)
+    message(STATUS "Found LUA: ${LUA_DEFAULT}")
+else()
+    message(STATUS "LUA will be provided by the bundled sources")
+    add_subdirectory(misc/liblua)
+    #linking with liblua.a requires system readline -- this works everywhere, right?
+    set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags})
+endif()
 
-	if(ghc_executable)
-		set(HAVE_NETSERVER true)
-		add_subdirectory(gameServer)
-	else()
-		message(STATUS "No GHC executable found, server will *not* be built")
-		set(HAVE_NETSERVER false)
-	endif()
-else(WITH_SERVER)
-	set(HAVE_NETSERVER false)
-endif(WITH_SERVER)
 
-add_subdirectory(misc/liblua)
+#main engine
 add_subdirectory(hedgewars)
 
-if(NOT BUILD_ENGINE_LIBRARY)
-	add_subdirectory(bin)
-	add_subdirectory(misc/quazip)
-	add_subdirectory(QTfrontend)
-	add_subdirectory(share)
-	add_subdirectory(tools)
+#Android related build scripts
+if(ANDROID)
+    #run cmake -DANDROID=1 to enable this
+    add_subdirectory(project_files/Android-build)
+endif()
+
+#TODO: when ANDROID, BUILD_ENGINE_LIBRARY should be set
+if(NOT (BUILD_ENGINE_LIBRARY OR ANDROID))
+    add_subdirectory(bin)
+    add_subdirectory(misc/quazip)
+    add_subdirectory(QTfrontend)
+    add_subdirectory(share)
+    add_subdirectory(tools)
 endif()
 
 
@@ -212,74 +268,74 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${HEDGEWARS_VERSION}")
 
 if(WIN32 AND NOT UNIX)
-	set(CPACK_NSIS_DISPLAY_NAME "Hedgewars")
-	set(CPACK_NSIS_HELP_LINK "http://www.hedgewars.org/")
-	set(CPACK_NSIS_URL_INFO_ABOUT "http://www.hedgewars.org/")
-	set(CPACK_NSIS_CONTACT "unC0Rr at gmail.com")
-	set(CPACK_NSIS_MODIFY_PATH OFF)
-	set(CPACK_GENERATOR "ZIP;NSIS")
-	set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "hedgewars")
+    set(CPACK_NSIS_DISPLAY_NAME "Hedgewars")
+    set(CPACK_NSIS_HELP_LINK "http://www.hedgewars.org/")
+    set(CPACK_NSIS_URL_INFO_ABOUT "http://www.hedgewars.org/")
+    set(CPACK_NSIS_CONTACT "unC0Rr at gmail.com")
+    set(CPACK_NSIS_MODIFY_PATH OFF)
+    set(CPACK_GENERATOR "ZIP;NSIS")
+    set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "hedgewars")
 else(WIN32 AND NOT UNIX)
-	set(CPACK_STRIP_FILES "bin/hedgewars;bin/hwengine")
+    set(CPACK_STRIP_FILES "bin/hedgewars;bin/hwengine")
 endif(WIN32 AND NOT UNIX)
 
 set(CPACK_SOURCE_IGNORE_FILES
-	"~"
-	"\\\\.hg"
-	"\\\\.svn"
-	"\\\\.exe$"
-	"\\\\.a$"
-	"\\\\.dll$"
-	"\\\\.xcf$"
-	"\\\\.cxx$"
-	"\\\\.db$"
-	"\\\\.dof$"
-	"\\\\.layout$"
-	"\\\\.zip$"
-	"\\\\.gz$"
-	"\\\\.bz2$"
-	"\\\\.tmp$"
-	"\\\\.core$"
-	"\\\\.sh$"
-	"\\\\.sifz$"
-	"\\\\.svg$"
-	"\\\\.svgz$"
-	"\\\\.ppu$"
-	"\\\\.psd$"
-	"\\\\.o$"
-	"Makefile"
-	"Doxyfile"
-	"CMakeFiles"
-	"debug"
-	"release$"
-	"Debug$"
-	"Release$"
-	"proto\\\\.inc$"
-	"hwconsts\\\\.cpp$"
-	"playlist\\\\.inc$"
-	"CPack"
-	"cmake_install\\\\.cmake$"
-	"config\\\\.inc$"
-	"hwengine\\\\.desktop$"
-	"CMakeCache\\\\.txt$"
-#	"^${CMAKE_CURRENT_SOURCE_DIR}/misc/libopenalbridge"
-#	"^${CMAKE_CURRENT_SOURCE_DIR}/misc/libfreetype"
-#	"^${CMAKE_CURRENT_SOURCE_DIR}/misc/liblua"
-#	"^${CMAKE_CURRENT_SOURCE_DIR}/misc/libtremor"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/project_files/HedgewarsMobile/"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/bin/[a-z]"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/tools/templates"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/doc"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/templates"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/Graphics"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/realtest"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/tmp"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/utils"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Maps/test"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Themes/ethereal"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.txt"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt"
-	"^${CMAKE_CURRENT_SOURCE_DIR}/hedgewars\\\\."
+    "~"
+    "\\\\.hg"
+    "\\\\.svn"
+    "\\\\.exe$"
+    "\\\\.a$"
+    "\\\\.dll$"
+    "\\\\.xcf$"
+    "\\\\.cxx$"
+    "\\\\.db$"
+    "\\\\.dof$"
+    "\\\\.layout$"
+    "\\\\.zip$"
+    "\\\\.gz$"
+    "\\\\.bz2$"
+    "\\\\.tmp$"
+    "\\\\.core$"
+    "\\\\.sh$"
+    "\\\\.sifz$"
+    "\\\\.svg$"
+    "\\\\.svgz$"
+    "\\\\.ppu$"
+    "\\\\.psd$"
+    "\\\\.o$"
+    "Makefile"
+    "Doxyfile"
+    "CMakeFiles"
+    "debug"
+    "release$"
+    "Debug$"
+    "Release$"
+    "proto\\\\.inc$"
+    "hwconsts\\\\.cpp$"
+    "playlist\\\\.inc$"
+    "CPack"
+    "cmake_install\\\\.cmake$"
+    "config\\\\.inc$"
+    "hwengine\\\\.desktop$"
+    "CMakeCache\\\\.txt$"
+#    "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libopenalbridge"
+#    "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libfreetype"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/misc/liblua"
+#    "^${CMAKE_CURRENT_SOURCE_DIR}/misc/libtremor"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/project_files/HedgewarsMobile/"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/bin/[a-z]"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/tools/templates"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/doc"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/templates"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/Graphics"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/realtest"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/tmp"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/utils"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Maps/test"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/share/hedgewars/Data/Themes/ethereal"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.txt"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt"
+    "^${CMAKE_CURRENT_SOURCE_DIR}/hedgewars\\\\."
 )
 
 include(CPack)
diff --git a/CREDITS b/CREDITS
index f787268..9f57606 100644
--- a/CREDITS
+++ b/CREDITS
@@ -18,6 +18,12 @@ EXTENDED CREDITS LIST
 - hillis -> AkuAku (2010)
 - Lortinak -> OldMan (2010), ShortHair (2010)
 - chujoii -> BrainSlug (2010), Dragon (2010), Ladle (2010), Laminaria (2010), Pantsu (2010), Pig (2010), Plunger (2010), SauceBoat (2010), ShaggyYeti (2010), SleepWalker (2010), SunWukong (2010), Teapot (2010), Teacup (2010), Zombi (2010)
+- Randy Broda -> Cyclops (2011), Soldier (2011)
+
+==========
+= GRAVESTONES
+==========
+- Randy Broda -> Dragonball (2012)
 
 ==========
 = MAPS
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 945859e..76ae3ed 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,6 +1,34 @@
 + features
 * bugfixes
 
+0.9.17 -> 0.9.18:
+
+ + 'A Classic Fairytale' Campaign
+ + Video recorder (requires ffmpeg)
+ + Cleaver weapon
+ + AI is now aware of drowning and fall damage
+ + AI learned how to use Sniper Rifle and Cake
+ + Variable pen width and eraser for drawn maps
+ + Several trainings and missions
+ + Allow setting custom local palette of teams colors
+ + Hide eliminated teams from teams healths widget
+ + Server doesn't delete room till last player quits it
+ + PNG screenshots
+ + Show bot level on CPU flag
+ + Objects now have density value assigned which impacts their behavior on explosions, throwing from rope and drowning
+ + Improve AI skills at Desert Eagel, Whip, Firepunch, Baseball Bat, Hammer, Cluster Bomb, Watermelon and walking
+ + Individual hedgehogs healths in team health bar
+ + Drill rocket wouldn't explode in your face if you stand close to wall
+ + Ability to rope into a portal, allow RC plane to go through portals
+ + Many small frontend improvements: get rid of "save" buttons, descriptions, allow to use network proxy, etc
+ + Reduce amount of memory needed for engine to store land data
+ + Countless other small fixes and improvements
+ + Detect desyncs early
+ * Fix cake getting stuck in barrels, crates and hedgehogs
+ * Fix all knowns bugs which caused network game hang when players close engine or quit
+ * Fix drill strike bug when drill's timer gets ridiculously high value instead of explosion
+ * Fix some crashes, freezes and memory leaks in frontend and engine
+ 
 0.9.16 -> 0.9.17:
  + New theme, Cave
  + New voicepack, Hillbilly
diff --git a/INSTALL b/INSTALL
index 131a74f..1ce0fde 100644
--- a/INSTALL
+++ b/INSTALL
@@ -18,9 +18,9 @@ For server:
 $ cmake .
 or
 $ cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="install_prefix" \
--DDATA_INSTALL_DIR="data_dir" .
+-DDATA_INSTALL_DIR="data_dir" -DNOSERVER=1 .
 
-add -DWITH_SERVER=1 to compile net server; if you have Qt installed but it is
+add -DNOSERVER=0 to compile net server; if you have Qt installed but it is
 not found you can set it up with -DQT_QMAKE_EXECUTABLE="path_to_qmake"
 
 2. Compile:
diff --git a/QTfrontend/CMakeLists.txt b/QTfrontend/CMakeLists.txt
index 68df2ac..5a4216c 100644
--- a/QTfrontend/CMakeLists.txt
+++ b/QTfrontend/CMakeLists.txt
@@ -11,7 +11,9 @@ set(QT_USE_QTOPENGL FALSE)
 set(QT_USE_QTMAIN TRUE)
 
 find_package(Qt4 REQUIRED)
-include(${QT_USE_FILE})
+if (NOT CROSSAPPLE)
+    include(${QT_USE_FILE})
+endif()
 
 # Check if we need zlib
 check_library_exists("${QT_QTCORE_LIBRARY}" inflateInit2_ ${QT_LIBRARY_DIR} QT_PROVIDES_ZLIB_FUNCTIONS)
@@ -26,6 +28,9 @@ endif()
 # Configure for SDL
 find_package(SDL REQUIRED)
 find_package(SDL_mixer REQUIRED)
+if(NOT NOVIDEOREC)
+    find_package(FFMPEG)
+endif()
 
 include_directories(.)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/model)
@@ -37,6 +42,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util)
 include_directories(${SDL_INCLUDE_DIR})
 include_directories(${SDLMIXER_INCLUDE_DIR})
+include_directories(${FFMPEG_INCLUDE_DIR})
 include_directories(${CMAKE_SOURCE_DIR}/misc/quazip)
 if(UNIX)
     # HACK: in freebsd cannot find iconv.h included via SDL.h
@@ -47,7 +53,7 @@ endif(UNIX)
 if(WIN32 AND NOT UNIX)
     set(HEDGEWARS_BINDIR ".")
     set(HEDGEWARS_DATADIR "../share/")
-        add_definitions(-DUSE_XFIRE)
+    add_definitions(-DUSE_XFIRE)
 else()
     set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX})
     if(DEFINED DATA_INSTALL_DIR)
@@ -69,6 +75,10 @@ file(GLOB ModelCpp model/*.cpp)
 file(GLOB_RECURSE UIcpp ui/*.cpp)
 file(GLOB UtilCpp util/*.cpp)
 
+if(${FFMPEG_FOUND})
+    add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS)
+endif()
+
 set(hwfr_src
     ${ModelCpp}
     ${NetCpp}
@@ -83,6 +93,7 @@ set(hwfr_src
     hwform.cpp
     main.cpp
     team.cpp
+    campaign.cpp
     ui_hwform.cpp
     ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp
     )
@@ -119,6 +130,8 @@ set(hwfr_moc_hdrs
     HWApplication.h
     hwform.h
     team.h
+    util/DataManager.h
+    util/LibavInteraction.h
     )
 
 set(hwfr_hdrs
@@ -130,6 +143,7 @@ set(hwfr_hdrs
     KB.h
     hwconsts.h
     sdlkeys.h
+    campaign.h
     )
 
 set(hwfr_rez hedgewars.qrc)
@@ -139,7 +153,7 @@ qt4_add_resources(hwfr_rez_src ${hwfr_rez})
 qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
 
 
-if(APPLE)
+if(APPLE OR CROSSAPPLE)
     set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m)
     set(HW_LINK_LIBS IOKit ${HW_LINK_LIBS})
 
@@ -167,6 +181,7 @@ set(HW_LINK_LIBS
     ${QT_LIBRARIES}
     ${SDL_LIBRARY}
     ${SDLMIXER_LIBRARY}
+    ${FFMPEG_LIBRARIES}
     ${HW_LINK_LIBS}
     )
 
@@ -185,7 +200,11 @@ if(WIN32 AND NOT UNIX)
 endif()
 
 
-target_link_libraries(hedgewars ${HW_LINK_LIBS})
+if (CROSSAPPLE)
+    add_dependencies(hedgewars quazip)
+else()
+    target_link_libraries(hedgewars ${HW_LINK_LIBS})
+endif()
 
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
diff --git a/QTfrontend/CocoaInitializer.h b/QTfrontend/CocoaInitializer.h
index 5d38c15..81f25f3 100644
--- a/QTfrontend/CocoaInitializer.h
+++ b/QTfrontend/CocoaInitializer.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/CocoaInitializer.mm b/QTfrontend/CocoaInitializer.mm
index 5740de9..a1f6bcc 100644
--- a/QTfrontend/CocoaInitializer.mm
+++ b/QTfrontend/CocoaInitializer.mm
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/HWApplication.cpp b/QTfrontend/HWApplication.cpp
index a0eb2d4..c3a7c67 100644
--- a/QTfrontend/HWApplication.cpp
+++ b/QTfrontend/HWApplication.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,15 +22,17 @@
 #include "hwform.h"
 
 HWApplication::HWApplication(int &argc,  char **argv):
-     QApplication(argc, argv)
+    QApplication(argc, argv)
 {
 
 }
 
-bool HWApplication::event(QEvent *event) {
+bool HWApplication::event(QEvent *event)
+{
     QFileOpenEvent *openEvent;
 
-    switch (event->type()) {
+    switch (event->type())
+    {
         case QEvent::FileOpen:
             openEvent = (QFileOpenEvent *)event;
             if (form) form->PlayDemoQuick(openEvent->file());
diff --git a/QTfrontend/HWApplication.h b/QTfrontend/HWApplication.h
index f1be1cb..5ddc24e 100644
--- a/QTfrontend/HWApplication.h
+++ b/QTfrontend/HWApplication.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -35,14 +35,14 @@ class HWForm;
  */
 class HWApplication : public QApplication
 {
-    Q_OBJECT
-public:
-    HWApplication(int &argc, char **argv);
-    ~HWApplication() {};
+        Q_OBJECT
+    public:
+        HWApplication(int &argc, char **argv);
+        ~HWApplication() {};
 
-    HWForm *form;
-protected:
-    bool event(QEvent *);
+        HWForm *form;
+    protected:
+        bool event(QEvent *);
 };
 
 #endif
diff --git a/QTfrontend/InstallController.cpp b/QTfrontend/InstallController.cpp
index 453171c..25210ee 100644
--- a/QTfrontend/InstallController.cpp
+++ b/QTfrontend/InstallController.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/InstallController.h b/QTfrontend/InstallController.h
index 60fd8cd..970874c 100644
--- a/QTfrontend/InstallController.h
+++ b/QTfrontend/InstallController.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/KB.h b/QTfrontend/KB.h
index 211d006..0026ca9 100644
--- a/QTfrontend/KB.h
+++ b/QTfrontend/KB.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,9 +26,9 @@ const ulong KBmsgsCount = 1;
 const QString KBMessages[KBmsgsCount] =
 {
     QT_TRANSLATE_NOOP("KB", "SDL_ttf returned error while rendering text, "
-                            "most propably it is related to the bug "
-                            "in freetype2. It's recommended to update your "
-                            "freetype lib.")
+    "most propably it is related to the bug "
+    "in freetype2. It's recommended to update your "
+    "freetype lib.")
 };
 
 #endif // KB_H
diff --git a/QTfrontend/M3InstallController.h b/QTfrontend/M3InstallController.h
index 1712570..262f7df 100644
--- a/QTfrontend/M3InstallController.h
+++ b/QTfrontend/M3InstallController.h
@@ -42,7 +42,9 @@ typedef unsigned int NSUInteger;
 //#endif
 
 
- at interface M3InstallController : NSObject {
+ at interface M3InstallController :
+NSObject
+{
     NSAlert *alert;
 }
 
diff --git a/QTfrontend/M3InstallController.m b/QTfrontend/M3InstallController.m
index 740b4af..22dae74 100644
--- a/QTfrontend/M3InstallController.m
+++ b/QTfrontend/M3InstallController.m
@@ -36,7 +36,7 @@
 @implementation M3InstallController
 
 - (id) init {
-	if (self = [super init]) {
+        if ((self = [super init])) {
 		NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
 		NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName];
 		NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName];
diff --git a/QTfrontend/M3Panel.h b/QTfrontend/M3Panel.h
index d499449..09580ab 100644
--- a/QTfrontend/M3Panel.h
+++ b/QTfrontend/M3Panel.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/M3Panel.mm b/QTfrontend/M3Panel.mm
index 70c4147..672b0e3 100644
--- a/QTfrontend/M3Panel.mm
+++ b/QTfrontend/M3Panel.mm
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/NSWorkspace_RBAdditions.h b/QTfrontend/NSWorkspace_RBAdditions.h
index d95e962..7e47af8 100644
--- a/QTfrontend/NSWorkspace_RBAdditions.h
+++ b/QTfrontend/NSWorkspace_RBAdditions.h
@@ -32,6 +32,7 @@ extern NSString* NSWorkspace_RBserverURL;
 //- NSWorkspace_RBimagefilepath: should be present for disk images only. Shows the path of the disk image file.
 //- NSWorkspace_RBserverURL: should be present for remote volumes only. Shows the server URL.
 
-- (NSDictionary*)propertiesForPath:(NSString*)path;
+- (NSDictionary*)propertiesForPath:
+(NSString*)path;
 
 @end
diff --git a/QTfrontend/NSWorkspace_RBAdditions.m b/QTfrontend/NSWorkspace_RBAdditions.m
index e6a46bf..abbfa8c 100644
--- a/QTfrontend/NSWorkspace_RBAdditions.m
+++ b/QTfrontend/NSWorkspace_RBAdditions.m
@@ -9,6 +9,7 @@
 #import "NSWorkspace_RBAdditions.h"
 #include <IOKit/IOKitLib.h>
 #include <sys/mount.h>
+#include <mach/mach.h>
 
 NSString* NSWorkspace_RBfstypename = @"NSWorkspace_RBfstypename";
 NSString* NSWorkspace_RBmntonname = @"NSWorkspace_RBmntonname";
@@ -66,14 +67,14 @@ static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictiona
 				partition = [props objectForKey:@"Content"];
 			} else if (IOObjectConformsTo(nextParent,"IODiskImageBlockStorageDeviceOutKernel")) {
 				NSData* data = nil;
-				if (data = [[props objectForKey:@"Protocol Characteristics"] objectForKey:@"Virtual Interface Location Path"]) {
+                                if ((data = [[props objectForKey:@"Protocol Characteristics"] objectForKey:@"Virtual Interface Location Path"])) {
 					image = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
 				}
 			} else if (IOObjectConformsTo(nextParent,"IOHDIXHDDriveInKernel")) {
 				image = [props objectForKey:@"KDIURLPath"];
 			}
 			NSDictionary* subdict;
-			if (subdict = [props objectForKey:@"Protocol Characteristics"]) {
+                        if ((subdict = [props objectForKey:@"Protocol Characteristics"])) {
 				connection = [subdict objectForKey:@"Physical Interconnect"];
 			} else {
 				connection = [props objectForKey:@"Physical Interconnect"];
@@ -88,21 +89,21 @@ static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictiona
 				[dict setObject:image forKey:NSWorkspace_RBimagefilepath];
 			}
 			NSString* value;
-			if (subdict = [props objectForKey:@"Device Characteristics"]) {
-				if (value = [subdict objectForKey:@"Product Name"]) {
+                        if ((subdict = [props objectForKey:@"Device Characteristics"])) {
+                                if ((value = [subdict objectForKey:@"Product Name"])) {
 					result = AddPart(result,value);
 				}
-				if (value = [subdict objectForKey:@"Product Revision Level"]) {
+                                if ((value = [subdict objectForKey:@"Product Revision Level"])) {
 					result = AddPart(result,value);
 				}
-				if (value = [subdict objectForKey:@"Vendor Name"]) {
+                                if ((value = [subdict objectForKey:@"Vendor Name"])) {
 					result = AddPart(result,value);
 				}
 			}
-			if (value = [props objectForKey:@"USB Serial Number"]) {
+                        if ((value = [props objectForKey:@"USB Serial Number"])) {
 				result = AddPart(result,value);
 			}
-			if (value = [props objectForKey:@"USB Vendor Name"]) {
+                        if ((value = [props objectForKey:@"USB Vendor Name"])) {
 				result = AddPart(result,value);
 			}
 			NSString* cls = [(NSString*)IOObjectCopyClass(nextParent) autorelease];
@@ -124,6 +125,7 @@ static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictiona
 
 // This formats the (partially undocumented) AFPXMountInfo info into a string.
 
+/*
 static NSString* FormatAFPURL(AFPXVolMountInfoPtr mountInfo,NSString** devdesc) {
 	UInt8* work = ((UInt8*)mountInfo)+mountInfo->serverNameOffset;
 	if (devdesc) {
@@ -162,6 +164,7 @@ static NSString* FormatAFPURL(AFPXVolMountInfoPtr mountInfo,NSString** devdesc)
 	}
 	return [NSString stringWithFormat:@"afp://%@/%@",dns?:(ip?:@""),volname];
 }
+*/
 
 @implementation NSWorkspace (NSWorkspace_RBAdditions)
 
diff --git a/QTfrontend/SparkleAutoUpdater.h b/QTfrontend/SparkleAutoUpdater.h
index 3e15b6a..43987cc 100644
--- a/QTfrontend/SparkleAutoUpdater.h
+++ b/QTfrontend/SparkleAutoUpdater.h
@@ -12,10 +12,11 @@
 class SparkleAutoUpdater : public AutoUpdater
 {
     public:
-        SparkleAutoUpdater(const QString& url);
+        SparkleAutoUpdater();
         ~SparkleAutoUpdater();
 
         void checkForUpdates();
+        void checkForUpdatesNow();
 
     private:
         class Private;
diff --git a/QTfrontend/SparkleAutoUpdater.mm b/QTfrontend/SparkleAutoUpdater.mm
index 2cae9c8..a5d1712 100644
--- a/QTfrontend/SparkleAutoUpdater.mm
+++ b/QTfrontend/SparkleAutoUpdater.mm
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,15 +29,12 @@ class SparkleAutoUpdater::Private
         SUUpdater* updater;
 };
 
-SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
+SparkleAutoUpdater::SparkleAutoUpdater()
 {
     d = new Private;
 
     d->updater = [SUUpdater sharedUpdater];
     [d->updater retain];
-
-    NSURL* url = [NSURL URLWithString:[NSString stringWithUTF8String:aUrl.toUtf8().data()]];
-    [d->updater setFeedURL:url];
 }
 
 SparkleAutoUpdater::~SparkleAutoUpdater()
@@ -50,3 +47,8 @@ void SparkleAutoUpdater::checkForUpdates()
 {
     [d->updater checkForUpdatesInBackground];
 }
+
+void SparkleAutoUpdater::checkForUpdatesNow()
+{
+    [d->updater checkForUpdates:NULL];
+}
diff --git a/QTfrontend/achievements.cpp b/QTfrontend/achievements.cpp
index a15bd33..7f916b2 100644
--- a/QTfrontend/achievements.cpp
+++ b/QTfrontend/achievements.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,7 +21,8 @@
 #include "achievements.h"
 
 // TODO: use some structs instead?
-const char achievements[][6][256] = {
+const char achievements[][6][256] =
+{
     // 6 array members each: id, caption, description, image, required number, attributes
     /*
     {"rounds1",  QT_TRANSLATE_NOOP("achievements", "No complete Newbie!"),  QT_TRANSLATE_NOOP("achievements", "Manage to survive %1 games playing on the official server, no matter if it's a draw or win."), "nonewb",     "1", ""},
diff --git a/QTfrontend/achievements.h b/QTfrontend/achievements.h
index 619bc7f..4f113d2 100644
--- a/QTfrontend/achievements.h
+++ b/QTfrontend/achievements.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/binds.cpp b/QTfrontend/binds.cpp
index a826a42..76f6678 100644
--- a/QTfrontend/binds.cpp
+++ b/QTfrontend/binds.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,49 +20,51 @@
 
 const BindAction cbinds[BINDS_NUMBER] =
 {
-    {"+up", "up",   QT_TRANSLATE_NOOP("binds", "up"),   QT_TRANSLATE_NOOP("binds (categories)", "Basic controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Move your hogs and aim:")},
-    {"+left",   "left", QT_TRANSLATE_NOOP("binds", "left"), NULL, NULL},
-    {"+right",  "right",    QT_TRANSLATE_NOOP("binds", "right"),    NULL, NULL},
-    {"+down",   "down", QT_TRANSLATE_NOOP("binds", "down"), NULL, NULL},
-    {"+precise",    "left_shift",   QT_TRANSLATE_NOOP("binds", "precise aim"),  NULL, NULL},
-    {"ljump",   "return",   QT_TRANSLATE_NOOP("binds", "long jump"),    NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Traverse gaps and obstacles by jumping:")},
-    {"hjump",   "backspace",    QT_TRANSLATE_NOOP("binds", "high jump"),    NULL, NULL},
-    {"+attack", "space",    QT_TRANSLATE_NOOP("binds", "attack"),   NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Fire your selected weapon or trigger an utility item:")},
-    {"put", "mousel",   QT_TRANSLATE_NOOP("binds", "put"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Pick a weapon or a target location under the cursor:")},
-    {"switch",  "tab",  QT_TRANSLATE_NOOP("binds", "switch"),   NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Switch your currently active hog (if possible):")},
-    {"ammomenu",    "mouser",   QT_TRANSLATE_NOOP("binds", "ammo menu"),    QT_TRANSLATE_NOOP("binds (categories)", "Weapon controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Pick a weapon or utility item:")},
-    {"slot 1",  "f1",   QT_TRANSLATE_NOOP("binds", "slot 1"),   NULL, NULL},
-    {"slot 2",  "f2",   QT_TRANSLATE_NOOP("binds", "slot 2"),   NULL, NULL},
-    {"slot 3",  "f3",   QT_TRANSLATE_NOOP("binds", "slot 3"),   NULL, NULL},
-    {"slot 4",  "f4",   QT_TRANSLATE_NOOP("binds", "slot 4"),   NULL, NULL},
-    {"slot 5",  "f5",   QT_TRANSLATE_NOOP("binds", "slot 5"),   NULL, NULL},
-    {"slot 6",  "f6",   QT_TRANSLATE_NOOP("binds", "slot 6"),   NULL, NULL},
-    {"slot 7",  "f7",   QT_TRANSLATE_NOOP("binds", "slot 7"),   NULL, NULL},
-    {"slot 8",  "f8",   QT_TRANSLATE_NOOP("binds", "slot 8"),   NULL, NULL},
-    {"slot 9",  "f9",   QT_TRANSLATE_NOOP("binds", "slot 9"),   NULL, NULL},
-    {"slot :",  "f10",  QT_TRANSLATE_NOOP("binds", "slot 10"),  NULL, NULL},
-    {"timer 1", "1",    QT_TRANSLATE_NOOP("binds", "timer 1 sec"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Set the timer on bombs and timed weapons:")},
-    {"timer 2", "2",    QT_TRANSLATE_NOOP("binds", "timer 2 sec"),  NULL, NULL},
-    {"timer 3", "3",    QT_TRANSLATE_NOOP("binds", "timer 3 sec"),  NULL, NULL},
-    {"timer 4", "4",    QT_TRANSLATE_NOOP("binds", "timer 4 sec"),  NULL, NULL},
-    {"timer 5", "5",    QT_TRANSLATE_NOOP("binds", "timer 5 sec"),  NULL, NULL},
-    {"findhh",  "h",    QT_TRANSLATE_NOOP("binds", "find hedgehog"),    QT_TRANSLATE_NOOP("binds (categories)", "Camera and cursor controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Move the camera to the active hog:")},
-    {"+cur_u",  "[8]", QT_TRANSLATE_NOOP("binds", "up"),   NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Move the cursor or camera without using the mouse:")},
-    {"+cur_l",  "[4]", QT_TRANSLATE_NOOP("binds", "left"), NULL, NULL},
-    {"+cur_r",  "[6]", QT_TRANSLATE_NOOP("binds", "right"),    NULL, NULL},
-    {"+cur_d",  "[2]", QT_TRANSLATE_NOOP("binds", "down"), NULL, NULL},
-//  {"+cur_m",  "", QT_TRANSLATE_NOOP("binds", "movement key modifier"),    NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Specify a modifier key to move camera and cursor using your default hog movement keys:")},
-    {"zoomin",  "wheeldown",    QT_TRANSLATE_NOOP("binds", "zoom in"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Modify the camera's zoom level:")},
-    {"zoomout", "wheelup",  QT_TRANSLATE_NOOP("binds", "zoom out"), NULL, NULL},
-    {"zoomreset",   "mousem",   QT_TRANSLATE_NOOP("binds", "reset zoom"),   NULL, NULL},
-    {"chat",    "t",    QT_TRANSLATE_NOOP("binds", "chat"), QT_TRANSLATE_NOOP("binds (categories)", "Other"), QT_TRANSLATE_NOOP("binds (descriptions)", "Talk to your team or all participants:")},
-    {"history", "`",    QT_TRANSLATE_NOOP("binds", "chat history"), NULL, NULL},
-    {"pause",   "p",    QT_TRANSLATE_NOOP("binds", "pause"),    NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Pause, continue or leave your game:")},
-    {"quit",    "escape",   QT_TRANSLATE_NOOP("binds", "quit"), NULL, NULL},
-    {"confirm", "y",    QT_TRANSLATE_NOOP("binds", "confirmation"), NULL, NULL},
-    {"+voldown",    "9",    QT_TRANSLATE_NOOP("binds", "volume down"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Modify the game's volume while playing:")},
-    {"+volup",  "0",    QT_TRANSLATE_NOOP("binds", "volume up"),    NULL, NULL},
-    {"fullscr", "f12",  QT_TRANSLATE_NOOP("binds", "change mode"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle fullscreen mode:")},
-    {"capture", "c",    QT_TRANSLATE_NOOP("binds", "capture"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Take a screenshot:")},
-    {"rotmask", "delete",   QT_TRANSLATE_NOOP("binds", "hedgehogs\ninfo"),  NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle labels above hedgehogs:")}
+    {"+up",       "up",         QT_TRANSLATE_NOOP("binds", "up"),              QT_TRANSLATE_NOOP("binds (categories)", "Basic controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Move your hogs and aim:")},
+    {"+left",     "left",       QT_TRANSLATE_NOOP("binds", "left"),            NULL, NULL},
+    {"+right",    "right",      QT_TRANSLATE_NOOP("binds", "right"),           NULL, NULL},
+    {"+down",     "down",       QT_TRANSLATE_NOOP("binds", "down"),            NULL, NULL},
+    {"+precise",  "left_shift", QT_TRANSLATE_NOOP("binds", "precise aim"),     NULL, NULL},
+    {"ljump",     "return",     QT_TRANSLATE_NOOP("binds", "long jump"),       NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Traverse gaps and obstacles by jumping:")},
+    {"hjump",     "backspace",  QT_TRANSLATE_NOOP("binds", "high jump"),       NULL, NULL},
+    {"+attack",   "space",      QT_TRANSLATE_NOOP("binds", "attack"),          NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Fire your selected weapon or trigger an utility item:")},
+    {"put",       "mousel",     QT_TRANSLATE_NOOP("binds", "put"),             NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Pick a weapon or a target location under the cursor:")},
+    {"switch",    "tab",        QT_TRANSLATE_NOOP("binds", "switch"),          NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Switch your currently active hog (if possible):")},
+    {"ammomenu",  "mouser",     QT_TRANSLATE_NOOP("binds", "ammo menu"),       QT_TRANSLATE_NOOP("binds (categories)", "Weapon controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Pick a weapon or utility item:")},
+    {"slot 1",    "f1",         QT_TRANSLATE_NOOP("binds", "slot 1"),          NULL, NULL},
+    {"slot 2",    "f2",         QT_TRANSLATE_NOOP("binds", "slot 2"),          NULL, NULL},
+    {"slot 3",    "f3",         QT_TRANSLATE_NOOP("binds", "slot 3"),          NULL, NULL},
+    {"slot 4",    "f4",         QT_TRANSLATE_NOOP("binds", "slot 4"),          NULL, NULL},
+    {"slot 5",    "f5",         QT_TRANSLATE_NOOP("binds", "slot 5"),          NULL, NULL},
+    {"slot 6",    "f6",         QT_TRANSLATE_NOOP("binds", "slot 6"),          NULL, NULL},
+    {"slot 7",    "f7",         QT_TRANSLATE_NOOP("binds", "slot 7"),          NULL, NULL},
+    {"slot 8",    "f8",         QT_TRANSLATE_NOOP("binds", "slot 8"),          NULL, NULL},
+    {"slot 9",    "f9",         QT_TRANSLATE_NOOP("binds", "slot 9"),          NULL, NULL},
+    {"slot :",    "f10",        QT_TRANSLATE_NOOP("binds", "slot 10"),         NULL, NULL},
+    {"timer 1",   "1",          QT_TRANSLATE_NOOP("binds", "timer 1 sec"),     NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Set the timer on bombs and timed weapons:")},
+    {"timer 2",   "2",          QT_TRANSLATE_NOOP("binds", "timer 2 sec"),     NULL, NULL},
+    {"timer 3",   "3",          QT_TRANSLATE_NOOP("binds", "timer 3 sec"),     NULL, NULL},
+    {"timer 4",   "4",          QT_TRANSLATE_NOOP("binds", "timer 4 sec"),     NULL, NULL},
+    {"timer 5",   "5",          QT_TRANSLATE_NOOP("binds", "timer 5 sec"),     NULL, NULL},
+    {"findhh",    "h",          QT_TRANSLATE_NOOP("binds", "find hedgehog"),   QT_TRANSLATE_NOOP("binds (categories)", "Camera and cursor controls"), QT_TRANSLATE_NOOP("binds (descriptions)", "Move the camera to the active hog:")},
+    {"+cur_u",    "[8]",        QT_TRANSLATE_NOOP("binds", "up"),              NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Move the cursor or camera without using the mouse:")},
+    {"+cur_l",    "[4]",        QT_TRANSLATE_NOOP("binds", "left"),            NULL, NULL},
+    {"+cur_r",    "[6]",        QT_TRANSLATE_NOOP("binds", "right"),           NULL, NULL},
+    {"+cur_d",    "[2]",        QT_TRANSLATE_NOOP("binds", "down"),            NULL, NULL},
+//  {"+cur_m",    "",           QT_TRANSLATE_NOOP("binds", "movement key modifier"),    NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Specify a modifier key to move camera and cursor using your default hog movement keys:")},
+    {"zoomin",    "wheelup",    QT_TRANSLATE_NOOP("binds", "zoom in"),         NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Modify the camera's zoom level:")},
+    {"zoomout",   "wheeldown",  QT_TRANSLATE_NOOP("binds", "zoom out"),        NULL, NULL},
+    {"zoomreset", "mousem",     QT_TRANSLATE_NOOP("binds", "reset zoom"),      NULL, NULL},
+    {"chat",      "t",          QT_TRANSLATE_NOOP("binds", "chat"),            QT_TRANSLATE_NOOP("binds (categories)", "Other"), QT_TRANSLATE_NOOP("binds (descriptions)", "Talk to your team or all participants:")},
+    {"history",   "`",          QT_TRANSLATE_NOOP("binds", "chat history"),    NULL, NULL},
+    {"pause",     "p",          QT_TRANSLATE_NOOP("binds", "pause"),           NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Pause, continue or leave your game:")},
+    {"quit",      "escape",     QT_TRANSLATE_NOOP("binds", "quit"),            NULL, NULL},
+    {"confirm",   "y",          QT_TRANSLATE_NOOP("binds", "confirmation"),    NULL, NULL},
+    {"+voldown",  "9",          QT_TRANSLATE_NOOP("binds", "volume down"),     NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Modify the game's volume while playing:")},
+    {"+volup",    "0",          QT_TRANSLATE_NOOP("binds", "volume up"),       NULL, NULL},
+    {"mute",      "8",          QT_TRANSLATE_NOOP("binds", "mute audio"),      NULL, NULL},
+    {"fullscr",   "f12",        QT_TRANSLATE_NOOP("binds", "change mode"),     NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle fullscreen mode:")},
+    {"capture",   "c",          QT_TRANSLATE_NOOP("binds", "capture"),         NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Take a screenshot:")},
+    {"rotmask",   "delete",     QT_TRANSLATE_NOOP("binds", "hedgehogs\ninfo"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle labels above hedgehogs:")},
+    {"record",    "r",          QT_TRANSLATE_NOOP("binds", "record"),          NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Record video:")}
 };
diff --git a/QTfrontend/binds.h b/QTfrontend/binds.h
index 9fd5241..162bb8e 100644
--- a/QTfrontend/binds.h
+++ b/QTfrontend/binds.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,7 +21,7 @@
 
 #include <QString>
 
-#define BINDS_NUMBER 44
+#define BINDS_NUMBER 46
 
 struct BindAction
 {
diff --git a/QTfrontend/campaign.cpp b/QTfrontend/campaign.cpp
new file mode 100644
index 0000000..ad1fa68
--- /dev/null
+++ b/QTfrontend/campaign.cpp
@@ -0,0 +1,90 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QDir>
+#include <QFile>
+#include <QTextStream>
+#include <QPushButton>
+#include <QListWidget>
+#include <QStackedLayout>
+#include <QLineEdit>
+#include <QLabel>
+#include <QRadioButton>
+#include <QSpinBox>
+#include <QCloseEvent>
+#include <QCheckBox>
+#include <QTextBrowser>
+#include <QAction>
+#include <QTimer>
+#include <QScrollBar>
+#include <QDataWidgetMapper>
+#include <QTableView>
+#include <QCryptographicHash>
+#include <QSignalMapper>
+#include <QShortcut>
+#include <QDesktopServices>
+#include <QInputDialog>
+#include <QPropertyAnimation>
+#include <QSettings>
+
+#include "campaign.h"
+#include "gameuiconfig.h"
+#include "hwconsts.h"
+#include "gamecfgwidget.h"
+#include "bgwidget.h"
+#include "mouseoverfilter.h"
+#include "tcpBase.h"
+
+#include "DataManager.h"
+
+extern QString campaign, campaignTeam;
+
+QStringList getCampMissionList(QString & campaign)
+{
+    QSettings campfile(DataManager::instance().findFileForRead("Missions/Campaign/" + campaign + "/campaign.ini"), QSettings::IniFormat, 0);
+    campfile.setIniCodec("UTF-8");
+    unsigned int mNum = campfile.value("MissionNum", 0).toInt();
+    
+    QStringList missionList;
+    for (unsigned int i = 0; i < mNum; i++)
+    {
+      missionList += campfile.value(QString("Mission %1/Name").arg(i + 1)).toString();
+    }
+    return missionList;
+}
+  
+unsigned int getCampProgress(QString & teamName, QString & campName)
+{
+    QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0);
+    teamfile.setIniCodec("UTF-8");
+    return teamfile.value("Campaign " + campName + "/Progress", 0).toInt();
+}
+
+QString getCampaignScript(QString campaign, unsigned int mNum)
+{
+    QSettings campfile(DataManager::instance().findFileForRead("Missions/Campaign/" + campaign + "/campaign.ini"), QSettings::IniFormat, 0);
+    campfile.setIniCodec("UTF-8");
+    return campfile.value(QString("Mission %1/Script").arg(mNum)).toString();
+}
+
+
+    
+
+
+
+    
diff --git a/QTfrontend/campaign.h b/QTfrontend/campaign.h
new file mode 100644
index 0000000..181a95c
--- /dev/null
+++ b/QTfrontend/campaign.h
@@ -0,0 +1,42 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef CAMPAIGN_H
+#define CAMPAIGN_H
+
+#include <QMainWindow>
+#include <QStack>
+#include <QTime>
+#include <QPointer>
+#include <QPropertyAnimation>
+#include <QUrl>
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QNetworkAccessManager>
+
+#include "netserver.h"
+#include "game.h"
+#include "ui_hwform.h"
+#include "SDLInteraction.h"
+#include "bgwidget.h"
+
+QStringList getCampMissionList(QString & campaign);
+unsigned int getCampProgress(QString & teamName, QString & campName);
+QString getCampaignScript(QString campaign, unsigned int mNum);
+
+#endif
diff --git a/QTfrontend/drawmapscene.cpp b/QTfrontend/drawmapscene.cpp
index 483b5d9..713a3d0 100644
--- a/QTfrontend/drawmapscene.cpp
+++ b/QTfrontend/drawmapscene.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,19 +31,28 @@ template <class T> T sqr(const T & x)
 DrawMapScene::DrawMapScene(QObject *parent) :
     QGraphicsScene(parent),
     m_pen(Qt::yellow),
-    m_brush(Qt::yellow)
+    m_brush(Qt::yellow),
+    m_cursor(new QGraphicsEllipseItem(-0.5, -0.5, 1, 1))
 {
     setSceneRect(0, 0, 4096, 2048);
 
     QLinearGradient gradient(0, 0, 0, 2048);
     gradient.setColorAt(0, QColor(60, 60, 155));
     gradient.setColorAt(1, QColor(155, 155, 60));
-    setBackgroundBrush(QBrush(gradient));
 
-    m_pen.setWidth(67);
+    m_eraser = QBrush(gradient);
+    setBackgroundBrush(m_eraser);
+    m_isErasing = false;
+
+    m_pen.setWidth(76);
     m_pen.setJoinStyle(Qt::RoundJoin);
     m_pen.setCapStyle(Qt::RoundCap);
     m_currPath = 0;
+
+    m_isCursorShown = false;
+    m_cursor->setPen(QPen(Qt::green));
+    m_cursor->setZValue(1);
+    m_cursor->setScale(m_pen.width());
 }
 
 void DrawMapScene::mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent)
@@ -58,15 +67,20 @@ void DrawMapScene::mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent)
             QPointF pos = mouseEvent->scenePos();
             path.setElementPositionAt(c - 1, pos.x(), pos.y());
 
-        } else
+        }
+        else
         {
             path.lineTo(mouseEvent->scenePos());
-            paths.first().append(mouseEvent->scenePos().toPoint());
+            paths.first().points.append(mouseEvent->scenePos().toPoint());
         }
         m_currPath->setPath(path);
 
         emit pathChanged();
     }
+
+    if(!m_isCursorShown)
+        showCursor();
+    m_cursor->setPos(mouseEvent->scenePos());
 }
 
 void DrawMapScene::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
@@ -78,7 +92,12 @@ void DrawMapScene::mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent)
     p += QPointF(0.01, 0.01);
     path.moveTo(p);
     path.lineTo(mouseEvent->scenePos());
-    paths.prepend(QList<QPoint>() << mouseEvent->scenePos().toPoint());
+
+    PathParams params;
+    params.width = serializePenWidth(m_pen.width());
+    params.erasing = m_isErasing;
+    params.points = QList<QPoint>() << mouseEvent->scenePos().toPoint();
+    paths.prepend(params);
     m_currPath->setPath(path);
 
     emit pathChanged();
@@ -90,7 +109,7 @@ void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
     {
         QPainterPath path = m_currPath->path();
         path.lineTo(mouseEvent->scenePos());
-        paths.first().append(mouseEvent->scenePos().toPoint());
+        paths.first().points.append(mouseEvent->scenePos().toPoint());
         m_currPath->setPath(path);
 
         simplifyLast();
@@ -99,8 +118,44 @@ void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
     }
 }
 
+void DrawMapScene::wheelEvent(QGraphicsSceneWheelEvent * wheelEvent)
+{
+    if(wheelEvent->delta() > 0 && m_pen.width() < 516)
+        m_pen.setWidth(m_pen.width() + 10);
+    else if(wheelEvent->delta() < 0 && m_pen.width() >= 16)
+        m_pen.setWidth(m_pen.width() - 10);
+
+    m_cursor->setScale(m_pen.width());
+
+    if(m_currPath)
+    {
+        m_currPath->setPen(m_pen);
+        paths.first().width = serializePenWidth(m_pen.width());
+    }
+}
+
+void DrawMapScene::showCursor()
+{
+    if(!m_isCursorShown)
+        addItem(m_cursor);
+
+    m_isCursorShown = true;
+}
+
+void DrawMapScene::hideCursor()
+{
+    if(m_isCursorShown)
+        removeItem(m_cursor);
+
+    m_isCursorShown = false;
+}
+
 void DrawMapScene::undo()
 {
+    // cursor is a part of items()
+    if(m_isCursorShown)
+        return;
+
     if(items().size())
     {
         removeItem(items().first());
@@ -120,6 +175,10 @@ void DrawMapScene::undo()
 
 void DrawMapScene::clearMap()
 {
+    // cursor is a part of items()
+    if(m_isCursorShown)
+        return;
+
     // don't clear if already cleared
     if(!items().size())
         return;
@@ -127,7 +186,8 @@ void DrawMapScene::clearMap()
     oldItems.clear();
 
     // do this since clear() would _destroy_ all items
-    while(items().size()) {
+    while(items().size())
+    {
         oldItems.push_front(items().first());
         removeItem(items().first());
     }
@@ -139,6 +199,16 @@ void DrawMapScene::clearMap()
     emit pathChanged();
 }
 
+
+void DrawMapScene::setErasing(bool erasing)
+{
+    m_isErasing = erasing;
+    if(erasing)
+        m_pen.setBrush(m_eraser);
+    else
+        m_pen.setBrush(m_brush);
+}
+
 QByteArray DrawMapScene::encode()
 {
     QByteArray b;
@@ -146,13 +216,17 @@ QByteArray DrawMapScene::encode()
     for(int i = paths.size() - 1; i >= 0; --i)
     {
         int cnt = 0;
-        QList<QPoint> points = paths.at(i);
-        foreach(QPoint point, points)
+        PathParams params = paths.at(i);
+        foreach(QPoint point, params.points)
         {
             qint16 px = qToBigEndian((qint16)point.x());
             qint16 py = qToBigEndian((qint16)point.y());
-            quint8 flags = 2;
-            if(!cnt) flags |= 0x80;
+            quint8 flags = 0;
+            if(!cnt)
+            {
+                flags = 0x80 + params.width;
+                if(params.erasing) flags |= 0x40;
+            }
             b.append((const char *)&px, 2);
             b.append((const char *)&py, 2);
             b.append((const char *)&flags, 1);
@@ -167,12 +241,14 @@ QByteArray DrawMapScene::encode()
 
 void DrawMapScene::decode(QByteArray data)
 {
+    bool erasing = m_isErasing;
+
     oldItems.clear();
     oldPaths.clear();
     clear();
     paths.clear();
 
-    QList<QPoint> points;
+    PathParams params;
 
     while(data.size() >= 5)
     {
@@ -183,38 +259,53 @@ void DrawMapScene::decode(QByteArray data)
         quint8 flags = *(quint8 *)data.data();
         data.remove(0, 1);
 
-        if((flags & 0x80) && points.size())
+        if(flags & 0x80)
         {
-            addPath(pointsToPath(points), m_pen);
-            paths.prepend(points);
-
-            points.clear();
+            if(params.points.size())
+            {
+                addPath(pointsToPath(params.points), m_pen);
+
+                paths.prepend(params);
+
+                params.points.clear();
+            }
+
+            quint8 penWidth = flags & 0x3f;
+            m_pen.setWidth(deserializePenWidth(penWidth));
+            params.erasing = flags & 0x40;
+            if(params.erasing)
+                m_pen.setBrush(m_eraser);
+            else
+                m_pen.setBrush(m_brush);
+            params.width = penWidth;
         }
 
-        points.append(QPoint(px, py));
+        params.points.append(QPoint(px, py));
     }
 
-    if(points.size())
+    if(params.points.size())
     {
-        addPath(pointsToPath(points), m_pen);
-        paths.prepend(points);
+        addPath(pointsToPath(params.points), m_pen);
+        paths.prepend(params);
     }
 
     emit pathChanged();
+
+    setErasing(erasing);
 }
 
 void DrawMapScene::simplifyLast()
 {
     if(!paths.size()) return;
 
-    QList<QPoint> points = paths.at(0);
+    QList<QPoint> points = paths.at(0).points;
 
     QPoint prevPoint = points.first();
     int i = 1;
     while(i < points.size())
     {
         if( (i != points.size() - 1)
-            && (sqr(prevPoint.x() - points[i].x()) + sqr(prevPoint.y() - points[i].y()) < 1000)
+                && (sqr(prevPoint.x() - points[i].x()) + sqr(prevPoint.y() - points[i].y()) < 1000)
           )
             points.removeAt(i);
         else
@@ -224,18 +315,27 @@ void DrawMapScene::simplifyLast()
         }
     }
 
-    paths[0] = points;
+    paths[0].points = points;
 
 
     // redraw path
     {
-        QGraphicsPathItem * pathItem = static_cast<QGraphicsPathItem *>(items()[0]);
-        pathItem->setPath(pointsToPath(paths[0]));
+        QGraphicsPathItem * pathItem = static_cast<QGraphicsPathItem *>(items()[m_isCursorShown ? 1 : 0]);
+        pathItem->setPath(pointsToPath(paths[0].points));
     }
 
     emit pathChanged();
 }
 
+int DrawMapScene::pointsCount()
+{
+    int cnt = 0;
+    foreach(PathParams p, paths)
+        cnt += p.points.size();
+
+    return cnt;
+}
+
 QPainterPath DrawMapScene::pointsToPath(const QList<QPoint> points)
 {
     QPainterPath path;
@@ -246,8 +346,18 @@ QPainterPath DrawMapScene::pointsToPath(const QList<QPoint> points)
         path.moveTo(p);
 
         foreach(QPoint p, points)
-            path.lineTo(p);
+        path.lineTo(p);
     }
 
     return path;
 }
+
+quint8 DrawMapScene::serializePenWidth(int width)
+{
+    return (width - 6) / 10;
+}
+
+int DrawMapScene::deserializePenWidth(quint8 width)
+{
+    return width * 10 + 6;
+}
diff --git a/QTfrontend/drawmapscene.h b/QTfrontend/drawmapscene.h
index 973c7d5..dec6e14 100644
--- a/QTfrontend/drawmapscene.h
+++ b/QTfrontend/drawmapscene.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,41 +21,61 @@
 
 #include <QGraphicsScene>
 #include <QPainterPath>
+#include <QGraphicsEllipseItem>
 
 class QGraphicsPathItem;
 
-typedef QList<QList<QPoint> > Paths;
+struct PathParams
+{
+    quint8 width;
+    bool erasing;
+    QList<QPoint> points;
+};
+
+typedef QList<PathParams> Paths;
 
 class DrawMapScene : public QGraphicsScene
 {
-Q_OBJECT
-public:
-    explicit DrawMapScene(QObject *parent = 0);
-
-    QByteArray encode();
-    void decode(QByteArray data);
-
-signals:
-    void pathChanged();
-
-public slots:
-    void undo();
-    void clearMap();
-    void simplifyLast();
-
-private:
-    QPen m_pen;
-    QBrush m_brush;
-    QGraphicsPathItem  * m_currPath;
-    Paths paths;
-    Paths oldPaths;
-    QList<QGraphicsItem *> oldItems;
-
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
-
-    QPainterPath pointsToPath(const QList<QPoint> points);
+        Q_OBJECT
+    public:
+        explicit DrawMapScene(QObject *parent = 0);
+
+        QByteArray encode();
+        void decode(QByteArray data);
+        int pointsCount();
+
+    signals:
+        void pathChanged();
+
+    public slots:
+        void undo();
+        void clearMap();
+        void simplifyLast();
+        void setErasing(bool erasing);
+        void showCursor();
+        void hideCursor();
+
+    private:
+        QPen m_pen;
+        QBrush m_eraser;
+        QBrush m_brush;
+        QGraphicsPathItem  * m_currPath;
+        Paths paths;
+        Paths oldPaths;
+        bool m_isErasing;
+        QList<QGraphicsItem *> oldItems;
+        QGraphicsEllipseItem * m_cursor;
+        bool m_isCursorShown;
+
+        virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent);
+        virtual void mousePressEvent(QGraphicsSceneMouseEvent * mouseEvent);
+        virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent);
+        virtual void wheelEvent(QGraphicsSceneWheelEvent *);
+
+        QPainterPath pointsToPath(const QList<QPoint> points);
+
+        quint8 serializePenWidth(int width);
+        int deserializePenWidth(quint8 width);
 };
 
 #endif // DRAWMAPSCENE_H
diff --git a/QTfrontend/game.cpp b/QTfrontend/game.cpp
index b739e54..f8f70e7 100644
--- a/QTfrontend/game.cpp
+++ b/QTfrontend/game.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,6 +21,7 @@
 #include <QUuid>
 #include <QColor>
 #include <QStringListModel>
+#include <QTextStream>
 
 #include "game.h"
 #include "hwconsts.h"
@@ -29,15 +30,17 @@
 #include "teamselect.h"
 #include "KB.h"
 #include "proto.h"
+#include "campaign.h"
 
 #include <QTextStream>
+#include "ThemeModel.h"
 
-QString training, campaign; // TODO: Cleaner solution?
+QString training, campaign, campaignScript, campaignTeam; // TODO: Cleaner solution?
 
 HWGame::HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget) :
-  TCPBase(true),
-  ammostr(ammo),
-  m_pTeamSelWidget(pTeamSelWidget)
+    TCPBase(true),
+    ammostr(ammo),
+    m_pTeamSelWidget(pTeamSelWidget)
 {
     this->config = config;
     this->gamecfg = gamecfg;
@@ -51,21 +54,22 @@ HWGame::~HWGame()
 
 void HWGame::onClientDisconnect()
 {
-    switch (gameType) {
-        case gtSave:
-            if (gameState == gsInterrupted || gameState == gsHalted)
-                emit HaveRecord(false, demo);
-            else if (gameState == gsFinished)
-                 emit HaveRecord(true, demo);
-            break;
+    switch (gameType)
+    {
         case gtDemo:
+            // for video recording we need demo anyway 
+            emit HaveRecord(rtNeither, demo);
             break;
         case gtNet:
-            emit HaveRecord(true, demo);
+            emit HaveRecord(rtDemo, demo);
             break;
         default:
-            if (gameState == gsInterrupted || gameState == gsHalted) emit HaveRecord(false, demo);
-            else if (gameState == gsFinished) emit HaveRecord(true, demo);
+            if (gameState == gsInterrupted || gameState == gsHalted)
+                emit HaveRecord(rtSave, demo);
+            else if (gameState == gsFinished)
+                emit HaveRecord(rtDemo, demo);
+            else
+                emit HaveRecord(rtNeither, demo);
     }
     SetGameState(gsStopped);
 }
@@ -74,7 +78,8 @@ void HWGame::commonConfig()
 {
     QByteArray buf;
     QString gt;
-    switch (gameType) {
+    switch (gameType)
+    {
         case gtDemo:
             gt = "TD";
             break;
@@ -96,9 +101,9 @@ void HWGame::commonConfig()
             HWProto::addStringToBuffer(buf, QString("eammprob %1").arg(ammostr.mid(cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammdelay %1").arg(ammostr.mid(2 * cAmmoNumber, cAmmoNumber)));
             HWProto::addStringToBuffer(buf, QString("eammreinf %1").arg(ammostr.mid(3 * cAmmoNumber, cAmmoNumber)));
-            if(!gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
+            if(gamecfg->schemeData(15).toBool() || !gamecfg->schemeData(21).toBool()) HWProto::addStringToBuffer(buf, QString("eammstore"));
             HWProto::addStringListToBuffer(buf,
-                team.teamGameConfig(gamecfg->getInitHealth()));
+                                           team.teamGameConfig(gamecfg->getInitHealth()));
             ;
         }
     }
@@ -113,29 +118,32 @@ void HWGame::SendConfig()
 void HWGame::SendQuickConfig()
 {
     QByteArray teamscfg;
+    ThemeModel * themeModel = DataManager::instance().themeModel();
 
     HWProto::addStringToBuffer(teamscfg, "TL");
     HWProto::addStringToBuffer(teamscfg, QString("etheme %1")
-            .arg((themesModel->rowCount() > 0) ? themesModel->index(rand() % themesModel->rowCount()).data().toString() : "steel"));
+                               .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data().toString() : "steel"));
     HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString());
 
+    HWProto::addStringToBuffer(teamscfg, "e$template_filter 2");
+
     HWTeam team1;
     team1.setDifficulty(0);
-    team1.setColor(QColor(colors[0]));
+    team1.setColor(0);
     team1.setNumHedgehogs(4);
     HWNamegen::teamRandomNames(team1,true);
     HWProto::addStringListToBuffer(teamscfg,
-            team1.teamGameConfig(100));
+                                   team1.teamGameConfig(100));
 
     HWTeam team2;
     team2.setDifficulty(4);
-    team2.setColor(QColor(colors[1]));
+    team2.setColor(1);
     team2.setNumHedgehogs(4);
     do
         HWNamegen::teamRandomNames(team2,true);
     while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat));
     HWProto::addStringListToBuffer(teamscfg,
-            team2.teamGameConfig(100));
+                                   team2.teamGameConfig(100));
 
     HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber)));
     HWProto::addStringToBuffer(teamscfg, QString("eammprob %1").arg(cDefaultAmmoStore->mid(cAmmoNumber, cAmmoNumber)));
@@ -150,7 +158,7 @@ void HWGame::SendTrainingConfig()
 {
     QByteArray traincfg;
     HWProto::addStringToBuffer(traincfg, "TL");
-
+    HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString());
     HWProto::addStringToBuffer(traincfg, "escript " + training);
 
     RawSendIPC(traincfg);
@@ -160,8 +168,9 @@ void HWGame::SendCampaignConfig()
 {
     QByteArray campaigncfg;
     HWProto::addStringToBuffer(campaigncfg, "TL");
+    HWProto::addStringToBuffer(campaigncfg, "eseed " + QUuid::createUuid().toString());
 
-    HWProto::addStringToBuffer(campaigncfg, "escript " + campaign);
+    HWProto::addStringToBuffer(campaigncfg, "escript " + campaignScript);
 
     RawSendIPC(campaigncfg);
 }
@@ -173,48 +182,61 @@ void HWGame::SendNetConfig()
 
 void HWGame::ParseMessage(const QByteArray & msg)
 {
-    switch(msg.at(1)) {
-        case '?': {
+    switch(msg.at(1))
+    {
+        case '?':
+        {
             SendIPC("!");
             break;
         }
-        case 'C': {
-            switch (gameType) {
-                case gtLocal: {
+        case 'C':
+        {
+            switch (gameType)
+            {
+                case gtLocal:
+                {
                     SendConfig();
                     break;
                 }
-                case gtQLocal: {
+                case gtQLocal:
+                {
                     SendQuickConfig();
                     break;
                 }
                 case gtSave:
-                case gtDemo: break;
-                case gtNet: {
+                case gtDemo:
+                    break;
+                case gtNet:
+                {
                     SendNetConfig();
                     break;
                 }
-                case gtTraining: {
+                case gtTraining:
+                {
                     SendTrainingConfig();
                     break;
                 }
-                case gtCampaign: {
+                case gtCampaign:
+                {
                     SendCampaignConfig();
                     break;
                 }
             }
             break;
         }
-        case 'E': {
+        case 'E':
+        {
             int size = msg.size();
             emit ErrorMessage(QString("Last two engine messages:\n") + QString().append(msg.mid(2)).left(size - 4));
             return;
         }
-        case 'K': {
+        case 'K':
+        {
             ulong kb = msg.mid(2).toULong();
-            if (kb==1) {
-              qWarning("%s", KBMessages[kb - 1].toLocal8Bit().constData());
-              return;
+            if (kb==1)
+            {
+                qWarning("%s", KBMessages[kb - 1].toLocal8Bit().constData());
+                return;
             }
             if (kb && kb <= KBmsgsCount)
             {
@@ -222,23 +244,28 @@ void HWGame::ParseMessage(const QByteArray & msg)
             }
             return;
         }
-        case 'i': {
+        case 'i':
+        {
             emit GameStats(msg.at(2), QString::fromUtf8(msg.mid(3)));
             break;
         }
-        case 'Q': {
+        case 'Q':
+        {
             SetGameState(gsInterrupted);
             break;
         }
-        case 'q': {
+        case 'q':
+        {
             SetGameState(gsFinished);
             break;
         }
-        case 'H': {
+        case 'H':
+        {
             SetGameState(gsHalted);
             break;
         }
-        case 's': {
+        case 's':
+        {
             int size = msg.size();
             QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
             emit SendChat(msgbody);
@@ -248,13 +275,23 @@ void HWGame::ParseMessage(const QByteArray & msg)
             demo.append(buf);
             break;
         }
-        case 'b': {
+        case 'b':
+        {
             int size = msg.size();
             QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
             emit SendTeamMessage(msgbody);
             break;
         }
-        default: {
+        case 'V':
+        {
+            if (msg.at(2) == '?')
+                sendCampaignVar(msg.right(msg.size() - 3));
+            else if (msg.at(2) == '!')
+                writeCampaignVar(msg.right(msg.size() - 3));
+            break;
+        }
+        default:
+        {
             if (gameType == gtNet && !netSuspend)
             {
                 emit SendNet(msg);
@@ -367,10 +404,12 @@ void HWGame::StartTraining(const QString & file)
     SetGameState(gsStarted);
 }
 
-void HWGame::StartCampaign(const QString & file)
+void HWGame::StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam)
 {
     gameType = gtCampaign;
-    campaign = "Missions/Campaign/" + file + ".lua";
+    campaign = camp;
+    campaignScript = "Missions/Campaign/" + camp + "/" + campScript;
+    campaignTeam = campTeam;
     demo.clear();
     Start();
     SetGameState(gsStarted);
@@ -380,6 +419,10 @@ void HWGame::SetGameState(GameState state)
 {
     gameState = state;
     emit GameStateChanged(state);
+    if (gameType == gtCampaign)
+    {
+      emit CampStateChanged(1);
+    }
 }
 
 void HWGame::abort()
@@ -388,3 +431,29 @@ void HWGame::abort()
     HWProto::addStringToBuffer(buf, QString("efinish"));
     RawSendIPC(buf);
 }
+
+void HWGame::sendCampaignVar(const QByteArray &varToSend)
+{
+    QString varToFind(varToSend);
+    QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
+    teamfile.setIniCodec("UTF-8");
+    QString varValue = teamfile.value("Campaign " + campaign + "/" + varToFind, "").toString();
+    QByteArray command;
+    HWProto::addStringToBuffer(command, "V." + varValue);
+    RawSendIPC(command);
+}
+
+void HWGame::writeCampaignVar(const QByteArray & varVal)
+{
+    int i = varVal.indexOf(" ");
+    if(i < 0)
+        return;
+
+    QString varToWrite = QString::fromUtf8(varVal.left(i));
+    QString varValue = QString::fromUtf8(varVal.mid(i + 1));
+
+    QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
+    teamfile.setIniCodec("UTF-8");
+    teamfile.setValue("Campaign " + campaign + "/" + varToWrite, varValue);
+}
+
diff --git a/QTfrontend/game.h b/QTfrontend/game.h
index 97e6489..24b272b 100644
--- a/QTfrontend/game.h
+++ b/QTfrontend/game.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,7 +29,8 @@ class GameUIConfig;
 class GameCFGWidget;
 class TeamSelWidget;
 
-enum GameState {
+enum GameState
+{
     gsNotStarted = 0,
     gsStarted  = 1,
     gsInterrupted = 2,
@@ -39,68 +40,79 @@ enum GameState {
     gsHalted = 6
 };
 
+enum RecordType
+{
+    rtDemo,
+    rtSave,
+    rtNeither,
+};
+
 bool checkForDir(const QString & dir);
 
 class HWGame : public TCPBase
 {
-    Q_OBJECT
-public:
-    HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget = 0);
-    virtual ~HWGame();
-    void AddTeam(const QString & team);
-    void PlayDemo(const QString & demofilename, bool isSave);
-    void StartLocal();
-    void StartQuick();
-    void StartNet();
-    void StartTraining(const QString & file);
-    void StartCampaign(const QString & file);
-    void abort();
-    GameState gameState;
-    bool netSuspend;
+        Q_OBJECT
+    public:
+        HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget = 0);
+        virtual ~HWGame();
+        void AddTeam(const QString & team);
+        void PlayDemo(const QString & demofilename, bool isSave);
+        void StartLocal();
+        void StartQuick();
+        void StartNet();
+        void StartTraining(const QString & file);
+        void StartCampaign(const QString & camp, const QString & campScript, const QString & campTeam);
+        void abort();
+        GameState gameState;
+        bool netSuspend;
 
- protected:
-    virtual QStringList getArguments();
-    virtual void onClientRead();
-    virtual void onClientDisconnect();
+    protected:
+        virtual QStringList getArguments();
+        virtual void onClientRead();
+        virtual void onClientDisconnect();
 
-signals:
-    void SendNet(const QByteArray & msg);
-    void SendChat(const QString & msg);
-    void SendTeamMessage(const QString & msg);
-    void GameStateChanged(GameState gameState);
-    void GameStats(char type, const QString & info);
-    void HaveRecord(bool isDemo, const QByteArray & record);
-    void ErrorMessage(const QString &);
+    signals:
+        void SendNet(const QByteArray & msg);
+        void SendChat(const QString & msg);
+        void SendTeamMessage(const QString & msg);
+        void GameStateChanged(GameState gameState);
+        void GameStats(char type, const QString & info);
+        void HaveRecord(RecordType type, const QByteArray & record);
+        void ErrorMessage(const QString &);
+        void CampStateChanged(int);
 
-public slots:
-    void FromNet(const QByteArray & msg);
-    void FromNetChat(const QString & msg);
+    public slots:
+        void FromNet(const QByteArray & msg);
+        void FromNetChat(const QString & msg);
 
-private:
-    enum GameType {
-        gtLocal    = 1,
-        gtQLocal   = 2,
-        gtDemo     = 3,
-        gtNet      = 4,
-        gtTraining = 5,
-        gtCampaign = 6,
-        gtSave     = 7,
-    };
-    char msgbuf[MAXMSGCHARS];
-    QString ammostr;
-    GameUIConfig * config;
-    GameCFGWidget * gamecfg;
-    TeamSelWidget* m_pTeamSelWidget;
-    GameType gameType;
+    private:
+        enum GameType
+        {
+            gtLocal    = 1,
+            gtQLocal   = 2,
+            gtDemo     = 3,
+            gtNet      = 4,
+            gtTraining = 5,
+            gtCampaign = 6,
+            gtSave     = 7,
+        };
+        char msgbuf[MAXMSGCHARS];
+        QString ammostr;
+        GameUIConfig * config;
+        GameCFGWidget * gamecfg;
+        TeamSelWidget* m_pTeamSelWidget;
+        GameType gameType;
 
-    void commonConfig();
-    void SendConfig();
-    void SendQuickConfig();
-    void SendNetConfig();
-    void SendTrainingConfig();
-    void SendCampaignConfig();
-    void ParseMessage(const QByteArray & msg);
-    void SetGameState(GameState state);
+        void commonConfig();
+        void SendConfig();
+        void SendQuickConfig();
+        void SendNetConfig();
+        void SendTrainingConfig();
+        void SendCampaignConfig();
+        void ParseMessage(const QByteArray & msg);
+        void SetGameState(GameState state);
+        void sendCampaignVar(const QByteArray & varToSend);
+        void writeCampaignVar(const QByteArray &varVal);
 };
 
 #endif
diff --git a/QTfrontend/gameuiconfig.cpp b/QTfrontend/gameuiconfig.cpp
index 7a13ef1..d4953d0 100644
--- a/QTfrontend/gameuiconfig.cpp
+++ b/QTfrontend/gameuiconfig.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,20 +16,32 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
-#include <QMessageBox>
 #include <QCheckBox>
 #include <QLineEdit>
 #include <QDesktopWidget>
 #include <QInputDialog>
 #include <QCryptographicHash>
+#include <QStandardItemModel>
+#include <QNetworkProxy>
+#include <QNetworkProxyFactory>
 
 #include "gameuiconfig.h"
 #include "hwform.h"
 #include "pageoptions.h"
+#include "pagevideos.h"
 #include "pagenetserver.h"
 #include "hwconsts.h"
 #include "fpsedit.h"
 #include "HWApplication.h"
+#include "DataManager.h"
+
+
+const QNetworkProxy::ProxyType proxyTypesMap[] = {
+    QNetworkProxy::NoProxy
+    , QNetworkProxy::NoProxy // dummy value
+    , QNetworkProxy::Socks5Proxy
+    , QNetworkProxy::HttpProxy};
+
 
 GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
     : QSettings(fileName, QSettings::IniFormat)
@@ -41,13 +53,20 @@ GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
     //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt());
     resizeToConfigValues();
 
+    reloadValues();
+    reloadVideosValues();
+}
+
+void GameUIConfig::reloadValues(void)
+{
     Form->ui.pageOptions->WeaponTooltip->setChecked(value("misc/weaponTooltips", true).toBool());
 
     int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString());
-    if (t < 0) {
+    if (t < 0)
+    {
         if (Form->ui.pageOptions->CBResolution->count() > 1)
             Form->ui.pageOptions->CBResolution->setCurrentIndex(1);
-        else 
+        else
             Form->ui.pageOptions->CBResolution->setCurrentIndex(0);
     }
     else Form->ui.pageOptions->CBResolution->setCurrentIndex(t);
@@ -58,7 +77,7 @@ GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
 
     Form->ui.pageOptions->SLQuality->setValue(value("video/quality", 5).toUInt());
     Form->ui.pageOptions->CBStereoMode->setCurrentIndex(value("video/stereo", 0).toUInt());
-    Form->ui.pageOptions->CBFrontendEffects->setChecked(frontendEffects);
+    Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/effects", true).toBool());
     Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
     Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/sound", true).toBool());
     Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
@@ -67,11 +86,18 @@ GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
 
     QString netNick = value("net/nick", "").toString();
     Form->ui.pageOptions->editNetNick->setText(netNick);
-    
+    bool savePwd = value("net/savepassword",true).toBool();
+    Form->ui.pageOptions->CBSavePassword->setChecked(savePwd);
+
     Form->ui.pageOptions->editNetPassword->installEventFilter(this);
-    
+
     int passLength = value("net/passwordlength", 0).toInt();
     setNetPasswordLength(passLength);
+    if (savePwd == false) {
+        Form->ui.pageOptions->editNetPassword->setEnabled(savePwd);
+        Form->ui.pageOptions->editNetPassword->setText("");
+        setNetPasswordLength(0);        
+    }
 
     delete netHost;
     netHost = new QString(value("net/ip", "").toString());
@@ -87,14 +113,50 @@ GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName)
     Form->ui.pageOptions->CBNameWithDate->setChecked(value("misc/appendTimeToRecords", false).toBool());
 
 #ifdef SPARKLE_ENABLED
-        Form->ui.pageOptions->CBAutoUpdate->setChecked(value("misc/autoUpdate", true).toBool());
+    Form->ui.pageOptions->CBAutoUpdate->setChecked(value("misc/autoUpdate", true).toBool());
 #endif
 
     Form->ui.pageOptions->CBLanguage->setCurrentIndex(Form->ui.pageOptions->CBLanguage->findData(value("misc/locale", "").toString()));
 
+    Form->ui.pageOptions->cbProxyType->setCurrentIndex(value("proxy/type", 0).toInt());
+    Form->ui.pageOptions->leProxy->setText(value("proxy/host", "").toString());
+    Form->ui.pageOptions->sbProxyPort->setValue(value("proxy/port", "8080").toInt());
+    Form->ui.pageOptions->leProxyLogin->setText(value("proxy/login", "").toString());
+    Form->ui.pageOptions->leProxyPassword->setText(value("proxy/password", "").toString());
+
     depth = HWApplication::desktop()->depth();
     if (depth < 16) depth = 16;
     else if (depth > 16) depth = 32;
+
+    { // load colors
+        QStandardItemModel * model = DataManager::instance().colorsModel();
+        for(int i = model->rowCount() - 1; i >= 0; --i)
+            model->item(i)->setData(QColor(value(QString("colors/color%1").arg(i), model->item(i)->data().value<QColor>()).value<QColor>()));
+    }
+}
+
+void GameUIConfig::reloadVideosValues(void)
+{
+    Form->ui.pageVideos->framerateBox->setValue(value("videorec/fps",25).toUInt());
+    Form->ui.pageVideos->bitrateBox->setValue(value("videorec/bitrate",400).toUInt());
+    bool useGameRes = value("videorec/usegameres",true).toBool();
+    if (useGameRes)
+    {
+        QRect res = vid_Resolution();
+        Form->ui.pageVideos->widthEdit->setText(QString::number(res.width()));
+        Form->ui.pageVideos->heightEdit->setText(QString::number(res.height()));
+    }
+    else
+    {
+        Form->ui.pageVideos->widthEdit->setText(value("videorec/width","800").toString());
+        Form->ui.pageVideos->heightEdit->setText(value("videorec/height","600").toString());
+    }
+    Form->ui.pageVideos->checkUseGameRes->setChecked(useGameRes);
+    Form->ui.pageVideos->checkRecordAudio->setChecked(value("videorec/audio",true).toBool());
+    if (!Form->ui.pageVideos->tryCodecs(value("videorec/format","no").toString(),
+                                        value("videorec/videocodec","no").toString(),
+                                        value("videorec/audiocodec","no").toString()))
+        Form->ui.pageVideos->setDefaultCodecs();
 }
 
 QStringList GameUIConfig::GetTeamsList()
@@ -103,16 +165,17 @@ QStringList GameUIConfig::GetTeamsList()
     teamdir.cd(cfgdir->absolutePath() + "/Teams");
     QStringList teamslist = teamdir.entryList(QStringList("*.hwt"),QDir::Files|QDir::Hidden);
     QStringList cleanedList;
-    for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it ) {
-            QString tmpTeamStr=(*it).replace(QRegExp("^(.*)\\.hwt$"), "\\1");
-            cleanedList.push_back(tmpTeamStr);
+    for (QStringList::Iterator it = teamslist.begin(); it != teamslist.end(); ++it )
+    {
+        QString tmpTeamStr=(*it).replace(QRegExp("^(.*)\\.hwt$"), "\\1");
+        cleanedList.push_back(tmpTeamStr);
     }
     return cleanedList;
 }
 
 void GameUIConfig::resizeToConfigValues()
 {
-        Form->resize(value("frontend/width", 800).toUInt(), value("frontend/height", 600).toUInt());
+    Form->resize(value("frontend/width", 800).toUInt(), value("frontend/height", 600).toUInt());
 }
 
 void GameUIConfig::SaveOptions()
@@ -130,11 +193,14 @@ void GameUIConfig::SaveOptions()
     bool ffscr = isFrontendFullscreen();
     setValue("frontend/fullscreen", ffscr);
     emit frontendFullscreen(ffscr);
-    if (!ffscr) {
-      setValue("frontend/width", Form->width());
-      setValue("frontend/height", Form->height());
-    } else {
-      //resizeToConfigValues(); // TODO: why this has been made?
+    if (!ffscr)
+    {
+        setValue("frontend/width", Form->width());
+        setValue("frontend/height", Form->height());
+    }
+    else
+    {
+        //resizeToConfigValues(); // TODO: why this has been made?
     }
 
     setValue("audio/sound", isSoundEnabled());
@@ -144,11 +210,12 @@ void GameUIConfig::SaveOptions()
     setValue("audio/volume", Form->ui.pageOptions->volumeBox->value());
 
     setValue("net/nick", netNick());
-    if (netPasswordIsValid())
+    if (netPasswordIsValid() && Form->ui.pageOptions->CBSavePassword->isChecked())
     {
         setValue("net/passwordhash", netPasswordHash());
         setValue("net/passwordlength", netPasswordLength());
     }
+    setValue("net/savepassword", Form->ui.pageOptions->CBSavePassword->isChecked());
     setValue("net/ip", *netHost);
     setValue("net/port", netPort);
     setValue("net/servername", Form->ui.pageNetServer->leServerDescr->text());
@@ -156,14 +223,67 @@ void GameUIConfig::SaveOptions()
 
     setValue("fps/show", isShowFPSEnabled());
     setValue("fps/limit", Form->ui.pageOptions->fpsedit->value());
-    
+
     setValue("misc/altdamage", isAltDamageEnabled());
     setValue("misc/appendTimeToRecords", appendDateTimeToRecordName());
     setValue("misc/locale", language());
 
 #ifdef SPARKLE_ENABLED
-        setValue("misc/autoUpdate", isAutoUpdateEnabled());
+    setValue("misc/autoUpdate", isAutoUpdateEnabled());
 #endif
+
+    { // setup proxy
+        int proxyType = Form->ui.pageOptions->cbProxyType->currentIndex();
+        setValue("proxy/type", proxyType);
+
+        if(proxyType == PageOptions::Socks5Proxy || proxyType == PageOptions::HTTPProxy)
+        {
+            setValue("proxy/host", Form->ui.pageOptions->leProxy->text());
+            setValue("proxy/port", Form->ui.pageOptions->sbProxyPort->value());
+            setValue("proxy/login", Form->ui.pageOptions->leProxyLogin->text());
+            setValue("proxy/password", Form->ui.pageOptions->leProxyPassword->text());
+        }
+
+        QNetworkProxy proxy;
+
+        if(proxyType == PageOptions::SystemProxy)
+        {
+            // use system proxy settings
+            proxy = QNetworkProxyFactory::systemProxyForQuery().at(0);
+        } else
+        {
+            proxy.setType(proxyTypesMap[proxyType]);
+            proxy.setHostName(Form->ui.pageOptions->leProxy->text());
+            proxy.setPort(Form->ui.pageOptions->sbProxyPort->value());
+            proxy.setUser(Form->ui.pageOptions->leProxyLogin->text());
+            proxy.setPassword(Form->ui.pageOptions->leProxyPassword->text());
+        }
+
+        QNetworkProxy::setApplicationProxy(proxy);
+    }
+
+    { // save colors
+        QStandardItemModel * model = DataManager::instance().colorsModel();
+        for(int i = model->rowCount() - 1; i >= 0; --i)
+            setValue(QString("colors/color%1").arg(i), model->item(i)->data());
+    }
+
+    Form->gameSettings->sync();
+}
+
+void GameUIConfig::SaveVideosOptions()
+{
+    QRect res = rec_Resolution();
+    setValue("videorec/format", AVFormat());
+    setValue("videorec/videocodec", videoCodec());
+    setValue("videorec/audiocodec", audioCodec());
+    setValue("videorec/fps", rec_Framerate());
+    setValue("videorec/bitrate", rec_Bitrate());
+    setValue("videorec/width", res.width());
+    setValue("videorec/height", res.height());
+    setValue("videorec/usegameres", Form->ui.pageVideos->checkUseGameRes->isChecked());
+    setValue("videorec/audio", recordAudio());
+
     Form->gameSettings->sync();
 }
 
@@ -204,47 +324,48 @@ quint32 GameUIConfig::translateQuality()
     quint32 rqClampLess = 0x00000200;  // don't clamp textures
     quint32 rqTooltipsOff = 0x00000400;  // tooltips are not drawn
     quint32 rqDesyncVBlank = 0x00000800;  // don't sync on vblank
-    
+
     quint32 result = (Form->ui.pageOptions->WeaponTooltip->isChecked()) ? rqNone : rqTooltipsOff;
-    
-    switch (Form->ui.pageOptions->SLQuality->value()) {
-      case 5:
-        break;
-      case 4:
-        result |= rqBlurryLand;
-        break;
-      case 3:
-        result |= rqBlurryLand | rqKillFlakes | rqPlainSplash;
-        break;
-      case 2:
-        result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
-                  rqAntiBoom | rqSlowMenu;
-        break;
-      case 1:
-        result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
-                  rqAntiBoom | rqSlowMenu | rqSimpleRope | rqDesyncVBlank;
-        break;
-      case 0:
-        result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
-                  rqAntiBoom | rqSlowMenu | rqSimpleRope | rqDesyncVBlank |
-                  rqNoBackground | rqClampLess;
-        break;
-      default:
-        fprintf(stderr,"unset value from slider");
-        break;
+
+    switch (Form->ui.pageOptions->SLQuality->value())
+    {
+        case 5:
+            break;
+        case 4:
+            result |= rqBlurryLand;
+            break;
+        case 3:
+            result |= rqBlurryLand | rqKillFlakes | rqPlainSplash;
+            break;
+        case 2:
+            result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
+                      rqAntiBoom | rqSlowMenu;
+            break;
+        case 1:
+            result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
+                      rqAntiBoom | rqSlowMenu | rqSimpleRope | rqDesyncVBlank;
+            break;
+        case 0:
+            result |= rqBlurryLand | rqKillFlakes | rqPlainSplash | rq2DWater |
+                      rqAntiBoom | rqSlowMenu | rqSimpleRope | rqDesyncVBlank |
+                      rqNoBackground | rqClampLess;
+            break;
+        default:
+            fprintf(stderr,"unset value from slider");
+            break;
     }
-    
+
     return result;
 }
 
 bool GameUIConfig::isFrontendEffects() const
 {
-  return Form->ui.pageOptions->CBFrontendEffects->isChecked();
+    return Form->ui.pageOptions->CBFrontendEffects->isChecked();
 }
 
 bool GameUIConfig::isFrontendFullscreen() const
 {
-  return Form->ui.pageOptions->CBFrontendFullscreen->isChecked();
+    return Form->ui.pageOptions->CBFrontendFullscreen->isChecked();
 }
 
 bool GameUIConfig::isSoundEnabled()
@@ -314,7 +435,7 @@ void GameUIConfig::updNetNick()
 
 QByteArray GameUIConfig::netPasswordHash()
 {
-    return QCryptographicHash::hash(Form->ui.pageOptions->editNetPassword->text().toLatin1(), QCryptographicHash::Md5).toHex();
+    return QCryptographicHash::hash(Form->ui.pageOptions->editNetPassword->text().toUtf8(), QCryptographicHash::Md5).toHex();
 }
 
 int GameUIConfig::netPasswordLength()
@@ -340,7 +461,7 @@ bool GameUIConfig::eventFilter(QObject *object, QEvent *event)
             }
         }
     }
-    
+
     // Don't filter anything
     return false;
 }
@@ -361,3 +482,43 @@ quint8 GameUIConfig::volume()
 {
     return Form->ui.pageOptions->volumeBox->value() * 128 / 100;
 }
+
+QString GameUIConfig::AVFormat()
+{
+    return Form->ui.pageVideos->format();
+}
+
+QString GameUIConfig::videoCodec()
+{
+    return Form->ui.pageVideos->videoCodec();
+}
+
+QString GameUIConfig::audioCodec()
+{
+    return Form->ui.pageVideos->audioCodec();
+}
+
+QRect GameUIConfig::rec_Resolution()
+{
+    if (Form->ui.pageVideos->checkUseGameRes->isChecked())
+        return vid_Resolution();
+    QRect res(0,0,0,0);
+    res.setWidth(Form->ui.pageVideos->widthEdit->text().toUInt());
+    res.setHeight(Form->ui.pageVideos->heightEdit->text().toUInt());
+    return res;
+}
+
+int GameUIConfig::rec_Framerate()
+{
+    return Form->ui.pageVideos->framerateBox->value();
+}
+
+int GameUIConfig::rec_Bitrate()
+{
+    return Form->ui.pageVideos->bitrateBox->value();
+}
+
+bool GameUIConfig::recordAudio()
+{
+    return Form->ui.pageVideos->checkRecordAudio->isChecked();
+}
diff --git a/QTfrontend/gameuiconfig.h b/QTfrontend/gameuiconfig.h
index 6c45bb4..ac89d35 100644
--- a/QTfrontend/gameuiconfig.h
+++ b/QTfrontend/gameuiconfig.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,52 +29,63 @@ class QSettings;
 
 class GameUIConfig : public QSettings
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    HWForm * Form;
-    GameUIConfig(HWForm * FormWidgets, const QString & fileName);
-    QStringList GetTeamsList();
-    QRect vid_Resolution();
-    bool vid_Fullscreen();
-    quint32 translateQuality();
-    bool isSoundEnabled();
-    bool isFrontendSoundEnabled();
-    QString language();
-    bool isMusicEnabled();
-    bool isFrontendMusicEnabled();
-    bool isShowFPSEnabled();
-    bool isAltDamageEnabled();
-    bool appendDateTimeToRecordName();
-    quint8 volume();
-    quint8 timerInterval();
-    quint8 bitDepth();
-    QString netNick();
-    QByteArray netPasswordHash();
-    int netPasswordLength();
-    void setNetPasswordLength(int passwordLength);
-    bool isReducedQuality() const;
-    bool isFrontendEffects() const;
-    bool isFrontendFullscreen() const;
-    void resizeToConfigValues();
-    quint32 stereoMode() const;
+    public:
+        HWForm * Form;
+        GameUIConfig(HWForm * FormWidgets, const QString & fileName);
+        QStringList GetTeamsList();
+        QRect vid_Resolution();
+        bool vid_Fullscreen();
+        quint32 translateQuality();
+        bool isSoundEnabled();
+        bool isFrontendSoundEnabled();
+        QString language();
+        bool isMusicEnabled();
+        bool isFrontendMusicEnabled();
+        bool isShowFPSEnabled();
+        bool isAltDamageEnabled();
+        bool appendDateTimeToRecordName();
+        quint8 volume();
+        quint8 timerInterval();
+        quint8 bitDepth();
+        QString netNick();
+        QByteArray netPasswordHash();
+        int netPasswordLength();
+        void setNetPasswordLength(int passwordLength);
+        bool isReducedQuality() const;
+        bool isFrontendEffects() const;
+        bool isFrontendFullscreen() const;
+        void resizeToConfigValues();
+        quint32 stereoMode() const;
+
+        QString AVFormat();
+        QString videoCodec();
+        QString audioCodec();
+        QRect rec_Resolution();
+        int rec_Framerate();
+        int rec_Bitrate();
+        bool recordAudio();
 
 #ifdef __APPLE__
 #ifdef SPARKLE_ENABLED
-    bool isAutoUpdateEnabled();
+        bool isAutoUpdateEnabled();
 #endif
 #endif
+        void reloadValues();
+        void reloadVideosValues();
 
- signals:
-    void frontendFullscreen(bool value);
+    signals:
+        void frontendFullscreen(bool value);
 
-public slots:
-    void SaveOptions();
-    void updNetNick();
-private:
-    bool netPasswordIsValid();
-    bool eventFilter(QObject *object, QEvent *event);
-    quint8 depth;
+    public slots:
+        void SaveOptions();
+        void SaveVideosOptions();
+        void updNetNick();
+    private:
+        bool netPasswordIsValid();
+        bool eventFilter(QObject *object, QEvent *event);
+        quint8 depth;
 };
 
 #endif
diff --git a/QTfrontend/hedgewars.qrc b/QTfrontend/hedgewars.qrc
index 518eb02..999976d 100644
--- a/QTfrontend/hedgewars.qrc
+++ b/QTfrontend/hedgewars.qrc
@@ -1,8 +1,11 @@
 <RCC>
     <qresource prefix="/">
         <file alias="Ammos.png">../share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png</file>
-		  <file>res/css/qt.css</file>
-		  <file>res/css/chat.css</file>
+        <file>res/css/qt.css</file>
+        <file>res/css/chat.css</file>
+        <file>res/css/christmas.css</file>
+        <file>res/css/easter.css</file>
+        <file>res/css/birthday.css</file>
         <file>res/hh25x25.png</file>
         <file>res/hh25x25grey.png</file>
         <file>res/ammopic.png</file>
@@ -34,6 +37,9 @@
         <file>res/Multiplayer.png</file>
         <file>res/Trainings.png</file>
         <file>res/Background.png</file>
+        <file>res/BackgroundChristmas.png</file>
+        <file>res/BackgroundEaster.png</file>
+        <file>res/BackgroundBirthday.png</file>
         <file>res/Exit.png</file>
         <file>res/HedgewarsTitle.png</file>
         <file>res/LocalPlay.png</file>
@@ -50,6 +56,7 @@
         <file>res/Load.png</file>
         <file>res/Save.png</file>
         <file>res/Record.png</file>
+        <file>res/Videos.png</file>
         <file>res/weaponsicon.png</file>
         <file>res/teamicon.png</file>
         <file>res/panelbg.png</file>
@@ -95,17 +102,11 @@
         <file>res/iconRope.png</file>
         <file>res/dice.png</file>
         <file>res/Star.png</file>
+        <file>res/Flake.png</file>
+        <file>res/Egg.png</file>
+        <file>res/Confetti.png</file>
         <file>res/file_save.png</file>
         <file>res/file_demo.png</file>
-        <file>res/chat_default.png</file>
-        <file>res/chat_ignore.png</file>
-        <file>res/chat_friend.png</file>
-        <file>res/chat_default_on.png</file>
-        <file>res/chat_ignore_on.png</file>
-        <file>res/chat_friend_on.png</file>
-        <file>res/chat_default_off.png</file>
-        <file>res/chat_ignore_off.png</file>
-        <file>res/chat_friend_off.png</file>
         <file>res/addfriend.png</file>
         <file>res/remfriend.png</file>
         <file>res/ignore.png</file>
@@ -133,5 +134,16 @@
         <file>res/mapMissing.png</file>
         <file>res/mapCustom.png</file>
         <file>res/mapMission.png</file>
+        <file>res/chat/friend.png</file>
+        <file>res/chat/ignore.png</file>
+        <file>res/chat/lamp.png</file>
+        <file>res/chat/hedgehog.png</file>
+        <file>res/chat/hedgehog_gray.png</file>
+        <file>res/chat/roomadmin.png</file>
+        <file>res/chat/roomadmin_gray.png</file>
+        <file>res/chat/serveradmin.png</file>
+        <file>res/chat/serveradmin_gray.png</file>
+        <file>res/chat/lamp_off.png</file>
+        <file>res/chat/ingame.png</file>
     </qresource>
 </RCC>
diff --git a/QTfrontend/hedgewars.qrc.depends b/QTfrontend/hedgewars.qrc.depends
index 518eb02..999976d 100644
--- a/QTfrontend/hedgewars.qrc.depends
+++ b/QTfrontend/hedgewars.qrc.depends
@@ -1,8 +1,11 @@
 <RCC>
     <qresource prefix="/">
         <file alias="Ammos.png">../share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png</file>
-		  <file>res/css/qt.css</file>
-		  <file>res/css/chat.css</file>
+        <file>res/css/qt.css</file>
+        <file>res/css/chat.css</file>
+        <file>res/css/christmas.css</file>
+        <file>res/css/easter.css</file>
+        <file>res/css/birthday.css</file>
         <file>res/hh25x25.png</file>
         <file>res/hh25x25grey.png</file>
         <file>res/ammopic.png</file>
@@ -34,6 +37,9 @@
         <file>res/Multiplayer.png</file>
         <file>res/Trainings.png</file>
         <file>res/Background.png</file>
+        <file>res/BackgroundChristmas.png</file>
+        <file>res/BackgroundEaster.png</file>
+        <file>res/BackgroundBirthday.png</file>
         <file>res/Exit.png</file>
         <file>res/HedgewarsTitle.png</file>
         <file>res/LocalPlay.png</file>
@@ -50,6 +56,7 @@
         <file>res/Load.png</file>
         <file>res/Save.png</file>
         <file>res/Record.png</file>
+        <file>res/Videos.png</file>
         <file>res/weaponsicon.png</file>
         <file>res/teamicon.png</file>
         <file>res/panelbg.png</file>
@@ -95,17 +102,11 @@
         <file>res/iconRope.png</file>
         <file>res/dice.png</file>
         <file>res/Star.png</file>
+        <file>res/Flake.png</file>
+        <file>res/Egg.png</file>
+        <file>res/Confetti.png</file>
         <file>res/file_save.png</file>
         <file>res/file_demo.png</file>
-        <file>res/chat_default.png</file>
-        <file>res/chat_ignore.png</file>
-        <file>res/chat_friend.png</file>
-        <file>res/chat_default_on.png</file>
-        <file>res/chat_ignore_on.png</file>
-        <file>res/chat_friend_on.png</file>
-        <file>res/chat_default_off.png</file>
-        <file>res/chat_ignore_off.png</file>
-        <file>res/chat_friend_off.png</file>
         <file>res/addfriend.png</file>
         <file>res/remfriend.png</file>
         <file>res/ignore.png</file>
@@ -133,5 +134,16 @@
         <file>res/mapMissing.png</file>
         <file>res/mapCustom.png</file>
         <file>res/mapMission.png</file>
+        <file>res/chat/friend.png</file>
+        <file>res/chat/ignore.png</file>
+        <file>res/chat/lamp.png</file>
+        <file>res/chat/hedgehog.png</file>
+        <file>res/chat/hedgehog_gray.png</file>
+        <file>res/chat/roomadmin.png</file>
+        <file>res/chat/roomadmin_gray.png</file>
+        <file>res/chat/serveradmin.png</file>
+        <file>res/chat/serveradmin_gray.png</file>
+        <file>res/chat/lamp_off.png</file>
+        <file>res/chat/ingame.png</file>
     </qresource>
 </RCC>
diff --git a/QTfrontend/hwconsts.cpp.in b/QTfrontend/hwconsts.cpp.in
index bbdacf7..2f20d56 100644
--- a/QTfrontend/hwconsts.cpp.in
+++ b/QTfrontend/hwconsts.cpp.in
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,6 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#include <QStandardItemModel>
+
 #include "hwconsts.h"
 
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
@@ -27,15 +29,11 @@ QDir * bindir = new QDir("${HEDGEWARS_BINDIR}");
 QDir * cfgdir = new QDir();
 QDir * datadir = new QDir();
 
-ThemesModel * themesModel;
-QStringList * mapList;
-QStringList * scriptList;
-
 bool custom_config = false;
 bool custom_data = false;
 
 int cMaxTeams = 8;
-int cMinServerVersion = 0;
+int cMinServerVersion = 1;
 
 QString * cDefaultAmmoStore = new QString( AMMOLINE_DEFAULT_QT AMMOLINE_DEFAULT_PROB
                                            AMMOLINE_DEFAULT_DELAY AMMOLINE_DEFAULT_CRATE );
@@ -71,3 +69,6 @@ quint16 netPort = NETGAME_DEFAULT_PORT;
 
 bool haveServer = ${HAVE_NETSERVER};
 bool isDevBuild = ${HW_DEV};
+
+int season = SEASON_NONE;
+int years_since_foundation = 0;
diff --git a/QTfrontend/hwconsts.h b/QTfrontend/hwconsts.h
index 1ede433..33652f0 100644
--- a/QTfrontend/hwconsts.h
+++ b/QTfrontend/hwconsts.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,7 +22,6 @@
 #include <QStringList>
 #include <QPair>
 
-#include "themesmodel.h"
 
 extern QString * cProtoVer;
 extern QString * cVersionString;
@@ -39,11 +38,7 @@ extern bool custom_data;
 extern int cMaxTeams;
 extern int cMinServerVersion;
 
-class QStringListModel;
-
-extern ThemesModel * themesModel;
-extern QStringList * mapList;
-extern QStringList * scriptList;
+class QStandardItemModel;
 
 extern QString * cDefaultAmmoStore;
 extern int cAmmoNumber;
@@ -56,45 +51,58 @@ extern quint16 netPort;
 
 extern bool haveServer;
 extern bool isDevBuild;
-#endif
-
-#define HEDGEHOGS_PER_TEAM           8
-
-#define AMMOLINE_DEFAULT_QT     "939192942219912103223511100120100000021111010101111101"
-#define AMMOLINE_DEFAULT_PROB   "040504054160065554655446477657666666615551010111541101"
-#define AMMOLINE_DEFAULT_DELAY  "000000000000020550000004000700400000000022000000060000"
-#define AMMOLINE_DEFAULT_CRATE  "131111031211111112311411111111111111121111110111111101"
-
-#define AMMOLINE_CRAZY_QT       "999999999999999999299999999999999929999999990999999209"
-#define AMMOLINE_CRAZY_PROB     "111111011111111111111111111111111111111111110111111101"
-#define AMMOLINE_CRAZY_DELAY    "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CRAZY_CRATE    "131111031211111112311411111111111111121111010111111101"
 
-#define AMMOLINE_PROMODE_QT     "909000900000000000000900000000000000000000000000000000"
-#define AMMOLINE_PROMODE_PROB   "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_DELAY  "000000000000020550000004000700400000000020000000000000"
-#define AMMOLINE_PROMODE_CRATE  "111111111111111111111111111111111111111110010111111101"
+//Current season, SEASON_NONE by default
+extern int season;
+//On the day of hedgewars birthday (Oct 31st) this variable is assigned
+//with number of years past 2004 (foundation of hedgewars)
+//Could be used to implement a text/graphic like "This is the xxth birthday of hedgewars" or similar
+extern int years_since_foundation;
 
-#define AMMOLINE_SHOPPA_QT      "000000990000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_PROB    "444441004424440221011212122242200000000200040001001100"
-#define AMMOLINE_SHOPPA_DELAY   "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_CRATE   "111111111111111111111111111111111111111110110111111100"
-
-#define AMMOLINE_CLEAN_QT       "101000900001000001100000000000000000000000000000100000"
-#define AMMOLINE_CLEAN_PROB     "040504054160065554655446477657666666615551010111541101"
-#define AMMOLINE_CLEAN_DELAY    "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CLEAN_CRATE    "131111031211111112311411111111111111121111110111111101"
-
-#define AMMOLINE_MINES_QT       "000000990009000000030000000000000000000000000000000000"
-#define AMMOLINE_MINES_PROB     "000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_MINES_DELAY    "000000000000020550000004000700400000000020000000060000"
-#define AMMOLINE_MINES_CRATE    "111111111111111111111111111111111111111111110111111101"
+#endif
 
-#define AMMOLINE_PORTALS_QT     "900000900200000000210000000000000011000009000000000000"
-#define AMMOLINE_PORTALS_PROB   "040504054160065554655446477657666666615551010111541101"
-#define AMMOLINE_PORTALS_DELAY  "000000000000020550000004000700400000000020000000060000"
-#define AMMOLINE_PORTALS_CRATE  "131111031211111112311411111111111111121111110111111101"
+#define HEDGEHOGS_PER_TEAM           8
 
+#define AMMOLINE_DEFAULT_QT     "93919294221991210322351110012010000002111101010111110101"
+#define AMMOLINE_DEFAULT_PROB   "04050405416006555465544647765766666661555101011154110101"
+#define AMMOLINE_DEFAULT_DELAY  "00000000000002055000000400070040000000002200000006000000"
+#define AMMOLINE_DEFAULT_CRATE  "13111103121111111231141111111111111112111111011111110101"
+
+#define AMMOLINE_CRAZY_QT       "99999999999999999929999999999999992999999999099999920909"
+#define AMMOLINE_CRAZY_PROB     "11111101111111111111111111111111111111111111011111110101"
+#define AMMOLINE_CRAZY_DELAY    "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CRAZY_CRATE    "13111103121111111231141111111111111112111101011111110101"
+
+#define AMMOLINE_PROMODE_QT     "90900090000000000000090000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_PROB   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_DELAY  "00000000000002055000000400070040000000002000000000000002"
+#define AMMOLINE_PROMODE_CRATE  "11111111111111111111111111111111111111111001011111110101"
+
+#define AMMOLINE_SHOPPA_QT      "00000099000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_PROB    "44444100442444022101121212224220000000020004000100110001"
+#define AMMOLINE_SHOPPA_DELAY   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_CRATE   "11111111111111111111111111111111111111111011011111110001"
+
+#define AMMOLINE_CLEAN_QT       "10100090000100000110000000000000000000000000000010000000"
+#define AMMOLINE_CLEAN_PROB     "04050405416006555465544647765766666661555101011154110101"
+#define AMMOLINE_CLEAN_DELAY    "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CLEAN_CRATE    "13111103121111111231141111111111111112111111011111110101"
+
+#define AMMOLINE_MINES_QT       "00000099000900000003000000000000000000000000000000000000"
+#define AMMOLINE_MINES_PROB     "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_MINES_DELAY    "00000000000002055000000400070040000000002000000006000000"
+#define AMMOLINE_MINES_CRATE    "11111111111111111111111111111111111111111111011111110101"
+
+#define AMMOLINE_PORTALS_QT     "90000090020000000021000000000000001100000900000000000000"
+#define AMMOLINE_PORTALS_PROB   "04050405416006555465544647765766666661555101011154110101"
+#define AMMOLINE_PORTALS_DELAY  "00000000000002055000000400070040000000002000000006000000"
+#define AMMOLINE_PORTALS_CRATE  "13111103121111111231141111111111111112111111011111110101"
+
+//Different seasons; assigned to season (int)
+#define SEASON_NONE 0
+#define SEASON_CHRISTMAS 2
+#define SEASON_HWBDAY 4
+#define SEASON_EASTER 8
 
 #define NETGAME_DEFAULT_PORT 46631
 
@@ -108,7 +116,7 @@ extern bool isDevBuild;
                               0xffcfcfc4, /. pastel gray    ./ \
                               0xffbff000, /. lime           ./ \
                               0xffffef00, /. yellow         ./ \
-                              // add new colors here 
+                              // add new colors here
                               0 }*/
 /*
 #define HW_TEAMCOLOR_ARRAY  { 0xffd12b42, /. red    ./ \
diff --git a/QTfrontend/hwform.cpp b/QTfrontend/hwform.cpp
index d296772..c462b50 100644
--- a/QTfrontend/hwform.cpp
+++ b/QTfrontend/hwform.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -40,10 +40,18 @@
 #include <QShortcut>
 #include <QDesktopServices>
 #include <QInputDialog>
+#include <QPropertyAnimation>
+#include <QSettings>
+
+#if (QT_VERSION >= 0x040600)
+#include <QGraphicsEffect>
+#include <QParallelAnimationGroup>
+#endif
 
 #include "hwform.h"
 #include "game.h"
 #include "team.h"
+#include "campaign.h"
 #include "teamselect.h"
 #include "selectWeapon.h"
 #include "gameuiconfig.h"
@@ -62,12 +70,14 @@
 #include "pagemultiplayer.h"
 #include "pagenet.h"
 #include "pagemain.h"
+#include "pagefeedback.h"
 #include "pagenetserver.h"
 #include "pagedrawmap.h"
 #include "pagenettype.h"
 #include "pagegamestats.h"
 #include "pageplayrecord.h"
 #include "pagedata.h"
+#include "pagevideos.h"
 #include "hwconsts.h"
 #include "newnetclient.h"
 #include "gamecfgwidget.h"
@@ -75,37 +85,45 @@
 #include "netudpserver.h"
 #include "chatwidget.h"
 #include "input_ip.h"
+#include "input_password.h"
 #include "ammoSchemeModel.h"
 #include "bgwidget.h"
 #include "xfire.h"
 #include "drawmapwidget.h"
+#include "mouseoverfilter.h"
+#include "roomslistmodel.h"
+#include "recorder.h"
+#include "playerslistmodel.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #ifdef __APPLE__
 #include "M3Panel.h"
 #ifdef SPARKLE_ENABLED
-#define SPARKLE_APPCAST_URL "http://www.hedgewars.org/download/appcast.xml"
 #include "SparkleAutoUpdater.h"
 #endif
 #endif
 
+
 // I started handing this down to each place it touches, but it was getting ridiculous
 // and this one flag does not warrant a static class
 bool frontendEffects = true;
 QString playerHash;
 
+GameUIConfig* HWForm::config = NULL;
+QSettings* HWForm::gameSettings = NULL;
+
 HWForm::HWForm(QWidget *parent, QString styleSheet)
-  : QMainWindow(parent)
-  , game(0)
-  , pnetserver(0)
-  , pRegisterServer(0)
-  , editedTeam(0)
-  , hwnet(0)
+    : QMainWindow(parent)
+    , game(0)
+    , pnetserver(0)
+    , pRegisterServer(0)
+    , editedTeam(0)
+    , hwnet(0)
 {
     // set music track
     SDLInteraction::instance().setMusicTrack(
-        HWDataManager::instance().findFileForRead("Music/main_theme.ogg")
+        DataManager::instance().findFileForRead("Music/main_theme.ogg")
     );
 
 #ifdef USE_XFIRE
@@ -113,7 +131,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 #endif
     gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
     frontendEffects = gameSettings->value("frontend/effects", true).toBool();
-    playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toLatin1(), QCryptographicHash::Md5).toHex());
+    playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
 
     this->setStyleSheet(styleSheet);
     ui.setupUi(this);
@@ -125,6 +143,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 
     config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini");
 
+    ui.pageVideos->init(config);
 
 #ifdef __APPLE__
     panel = new M3Panel;
@@ -132,7 +151,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 #ifdef SPARKLE_ENABLED
     AutoUpdater* updater;
 
-    updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
+    updater = new SparkleAutoUpdater();
     if (updater && config->isAutoUpdateEnabled())
         updater->checkForUpdates();
 #endif
@@ -141,11 +160,14 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
     connect (hideFrontend, SIGNAL(activated()), this, SLOT(showMinimized()));
 #else
     // ctrl+q closes frontend for consistency
-    QShortcut *closeFrontend = new QShortcut(QKeySequence("Ctrl+Q"), this);
+    QShortcut * closeFrontend = new QShortcut(QKeySequence("Ctrl+Q"), this);
     connect (closeFrontend, SIGNAL(activated()), this, SLOT(close()));
+    //QShortcut * updateData = new QShortcut(QKeySequence("F5"), this);
+    //connect (updateData, SIGNAL(activated()), &DataManager::instance(), SLOT(reload()));
 #endif
 
     UpdateTeamsLists();
+    InitCampaignPage();
     UpdateCampaignPage(0);
     UpdateWeapons();
 
@@ -166,7 +188,12 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 
     connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnSetup, ID_PAGE_SETUP);
-    
+
+#if 0
+    connect(ui.pageMain->BtnFeedback, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageMain->BtnFeedback, ID_PAGE_FEEDBACK);
+#endif
+
     connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE);
 
@@ -176,14 +203,22 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
     connect(ui.pageMain->BtnDataDownload, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnDataDownload, ID_PAGE_DATADOWNLOAD);
 
+
+#ifdef VIDEOREC
+    connect(ui.pageMain->BtnVideos, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageMain->BtnVideos, ID_PAGE_VIDEOS);
+#endif
+
     //connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
     //connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
 
-    connect(ui.pageEditTeam, SIGNAL(teamEdited()), this, SLOT(AfterTeamEdit()));
+    connect(ui.pageFeedback->BtnSend, SIGNAL(clicked()), this, SLOT(SendFeedback()));
+
+    connect(ui.pageEditTeam, SIGNAL(goBack()), this, SLOT(AfterTeamEdit()));
 
     connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame()));
     connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)),
-        ui.pageMultiplayer->BtnStartMPGame, SLOT(setEnabled(bool)));
+            ui.pageMultiplayer->BtnStartMPGame, SLOT(setEnabled(bool)));
     connect(ui.pageMultiplayer, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
     connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToSchemes(int)), this, SLOT(GoToScheme(int)));
     connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToWeapons(int)), this, SLOT(GoToSelectWeaponSet(int)));
@@ -197,8 +232,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
     connect(ui.pageOptions, SIGNAL(newTeamRequested()), this, SLOT(NewTeam()));
     connect(ui.pageOptions, SIGNAL(editTeamRequested(const QString&)), this, SLOT(EditTeam(const QString&)));
     connect(ui.pageOptions, SIGNAL(deleteTeamRequested(const QString&)), this, SLOT(DeleteTeam(const QString&)));
-    connect(ui.pageOptions->btnSave, SIGNAL(clicked()), config, SLOT(SaveOptions()));
-    connect(ui.pageOptions->btnSave, SIGNAL(clicked()), this, SLOT(GoBack()));
+    connect(ui.pageOptions, SIGNAL(goBack()), config, SLOT(SaveOptions()));
     connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles()));
 
     connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
@@ -207,6 +241,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
     connect(ui.pageOptions->SchemeEdit, SIGNAL(clicked()), this, SLOT(GoToEditScheme()));
     connect(ui.pageOptions->SchemeNew, SIGNAL(clicked()), this, SLOT(GoToNewScheme()));
     connect(ui.pageOptions->SchemeDelete, SIGNAL(clicked()), this, SLOT(DeleteScheme()));
+    connect(ui.pageOptions->CBFrontendEffects, SIGNAL(toggled(bool)), this, SLOT(onFrontendEffects(bool)) );
     connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons()));
 
     connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
@@ -218,7 +253,7 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
     connect(ui.pageNetServer->BtnStart, SIGNAL(clicked()), this, SLOT(NetStartServer()));
 
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)),
-        ui.pageNetGame->BtnStart, SLOT(setEnabled(bool)));
+            ui.pageNetGame->BtnStart, SLOT(setEnabled(bool)));
     connect(ui.pageNetGame, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup()));
     connect(ui.pageNetGame->pGameCFG, SIGNAL(goToSchemes(int)), this, SLOT(GoToScheme(int)));
     connect(ui.pageNetGame->pGameCFG, SIGNAL(goToWeapons(int)), this, SLOT(GoToSelectWeaponSet(int)));
@@ -249,12 +284,13 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 
     connect(ui.pageCampaign->BtnStartCampaign, SIGNAL(clicked()), this, SLOT(StartCampaign()));
     connect(ui.pageCampaign->CBTeam, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int)));
+    connect(ui.pageCampaign->CBCampaign, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int)));
 
 
     connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()),
-        ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first
+            ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first
     connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()),
-        this, SLOT(UpdateWeapons())); // executed second
+            this, SLOT(UpdateWeapons())); // executed second
     //connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()),
     //    this, SLOT(GoBack())); // executed third
 
@@ -264,19 +300,35 @@ HWForm::HWForm(QWidget *parent, QString styleSheet)
 
     connect(ui.pageConnecting, SIGNAL(cancelConnection()), this, SLOT(GoBack()));
 
+    connect(ui.pageVideos, SIGNAL(goBack()), config, SLOT(SaveVideosOptions()));
 
     ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini");
     ui.pageScheme->setModel(ammoSchemeModel);
     ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel);
     ui.pageOptions->SchemesName->setModel(ammoSchemeModel);
 
-    wBackground = NULL;
-    if (config->isFrontendEffects()) {
-       wBackground = new BGWidget(this);
-       wBackground->setFixedSize(this->width(), this->height());
-       wBackground->lower();
-       wBackground->init();
-       wBackground->startAnimation();
+    wBackground = new BGWidget(this);
+    wBackground->setFixedSize(this->width(), this->height());
+    wBackground->lower();
+    wBackground->init();
+    wBackground->enabled = config->isFrontendEffects();
+    wBackground->startAnimation();
+
+    //Install all eventFilters :
+
+    MouseOverFilter *filter = new MouseOverFilter();
+    filter->setUi(&ui);
+
+    QList<QWidget *> widgets;
+
+    for (int i=0; i < ui.Pages->count(); i++)
+    {
+        widgets = ui.Pages->widget(i)->findChildren<QWidget *>();
+
+        for (int i=0; i < widgets.size(); i++)
+        {
+            widgets.at(i)->installEventFilter(filter);
+        }
     }
 
     PagesStack.push(ID_PAGE_MAIN);
@@ -293,26 +345,26 @@ void HWForm::updateXfire(void)
         {
             case HWNewNet::Connecting: // Connecting
             case HWNewNet::Connected:
-            xfire_setvalue(XFIRE_STATUS, "Connecting");
-            xfire_setvalue(XFIRE_NICKNAME, "-");
-            xfire_setvalue(XFIRE_ROOM, "-");
+                xfire_setvalue(XFIRE_STATUS, "Connecting");
+                xfire_setvalue(XFIRE_NICKNAME, "-");
+                xfire_setvalue(XFIRE_ROOM, "-");
             case HWNewNet::InLobby: // In lobby
-            xfire_setvalue(XFIRE_STATUS, "Online");
-            xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
-            xfire_setvalue(XFIRE_ROOM, "In game lobby");
-            break;
+                xfire_setvalue(XFIRE_STATUS, "Online");
+                xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
+                xfire_setvalue(XFIRE_ROOM, "In game lobby");
+                break;
             case HWNewNet::InRoom: // In room
-            xfire_setvalue(XFIRE_STATUS, "Online");
-            xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
-            xfire_setvalue(XFIRE_ROOM, (hwnet->getRoom() + " (waiting for players)").toAscii());
-            break;
+                xfire_setvalue(XFIRE_STATUS, "Online");
+                xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
+                xfire_setvalue(XFIRE_ROOM, (hwnet->getRoom() + " (waiting for players)").toAscii());
+                break;
             case HWNewNet::InGame: // In game
-            xfire_setvalue(XFIRE_STATUS, "Online");
-            xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
-            xfire_setvalue(XFIRE_ROOM, (hwnet->getRoom() + " (playing or spectating)").toAscii());
-            break;
+                xfire_setvalue(XFIRE_STATUS, "Online");
+                xfire_setvalue(XFIRE_NICKNAME, hwnet->getNick().toAscii());
+                xfire_setvalue(XFIRE_ROOM, (hwnet->getRoom() + " (playing or spectating)").toAscii());
+                break;
             default:
-            break;
+                break;
         }
     }
     else
@@ -328,17 +380,27 @@ void HWForm::updateXfire(void)
 
 void HWForm::onFrontendFullscreen(bool value)
 {
-  if (value)
-    setWindowState(windowState() | Qt::WindowFullScreen);
-  else {
-    setWindowState(windowState() & static_cast<int>(!Qt::WindowFullScreen));
-  }
+    if (value)
+        setWindowState(windowState() | Qt::WindowFullScreen);
+    else
+    {
+        setWindowState(windowState() & static_cast<int>(!Qt::WindowFullScreen));
+    }
+}
+
+void HWForm::onFrontendEffects(bool value)
+{
+    wBackground->enabled = value;
+    if (value)
+        wBackground->startAnimation();
+    else
+        wBackground->stopAnimation();
 }
 
 /*
 void HWForm::keyReleaseEvent(QKeyEvent *event)
 {
-  if (event->key() == Qt::Key_Escape) 
+  if (event->key() == Qt::Key_Escape)
     this->GoBack();
 }
 */
@@ -366,14 +428,16 @@ void HWForm::UpdateWeapons()
 
     QStringList names = ui.pageSelectWeapon->pWeapons->getWeaponNames();
 
-    for(QVector<QComboBox*>::iterator it = combos.begin(); it != combos.end(); ++it) {
+    for(QVector<QComboBox*>::iterator it = combos.begin(); it != combos.end(); ++it)
+    {
         (*it)->clear();
 
         for(int i = 0; i < names.size(); ++i)
             (*it)->addItem(names[i], ui.pageSelectWeapon->pWeapons->getWeaponsString(names[i]));
 
         int pos = (*it)->findText("Default");
-        if (pos != -1) {
+        if (pos != -1)
+        {
             (*it)->setCurrentIndex(pos);
         }
     }
@@ -382,13 +446,17 @@ void HWForm::UpdateWeapons()
 void HWForm::UpdateTeamsLists(const QStringList* editable_teams)
 {
     QStringList teamslist;
-    if(editable_teams) {
-      teamslist =* editable_teams;
-    } else {
-      teamslist = config->GetTeamsList();
+    if(editable_teams)
+    {
+        teamslist =* editable_teams;
+    }
+    else
+    {
+        teamslist = config->GetTeamsList();
     }
 
-    if(teamslist.empty()) {
+    if(teamslist.empty())
+    {
         HWTeam defaultTeam(tr("DefaultTeam"));
         defaultTeam.saveToFile();
         teamslist.push_back(tr("DefaultTeam"));
@@ -457,6 +525,11 @@ void HWForm::GoToEditScheme()
     GoToPage(ID_PAGE_SCHEME);
 }
 
+void HWForm::GoToVideos()
+{
+    GoToPage(ID_PAGE_VIDEOS);
+}
+
 void HWForm::OnPageShown(quint8 id, quint8 lastid)
 {
 #ifdef USE_XFIRE
@@ -466,7 +539,8 @@ void HWForm::OnPageShown(quint8 id, quint8 lastid)
     {
         ui.pageDataDownload->fetchList();
     }
-    if (id == ID_PAGE_DRAWMAP) {
+    if (id == ID_PAGE_DRAWMAP)
+    {
         DrawMapScene * scene;
         if(lastid == ID_PAGE_MULTIPLAYER)
             scene = ui.pageMultiplayer->gameCFG->pMapContainer->getDrawMapScene();
@@ -476,100 +550,201 @@ void HWForm::OnPageShown(quint8 id, quint8 lastid)
         ui.pageDrawMap->drawMapWidget->setScene(scene);
     }
 
-    if (lastid == ID_PAGE_DRAWMAP) {
+    if (lastid == ID_PAGE_DRAWMAP)
+    {
         if (id == ID_PAGE_MULTIPLAYER)
             ui.pageMultiplayer->gameCFG->pMapContainer->mapDrawingFinished();
         else
             ui.pageNetGame->pGameCFG->pMapContainer->mapDrawingFinished();
     }
 
-    if (id == ID_PAGE_ROOMSLIST) {
-        if (hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills.
+    if (id == ID_PAGE_ROOMSLIST)
+    {
+        if (hwnet && game && game->gameState == gsStarted)   // abnormal exit - kick or room destruction - send kills.
+        {
             game->netSuspend = true;
             ui.pageRoomsList->displayWarning(tr("Game aborted"));
             game->abort();
         }
     }
 
-    if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) {
+    if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME)
+    {
         QStringList tmNames = config->GetTeamsList();
         TeamSelWidget* curTeamSelWidget;
         ui.pageOptions->setTeamOptionsEnabled(false);
 
-        if (id == ID_PAGE_MULTIPLAYER) {
+        if (id == ID_PAGE_MULTIPLAYER)
+        {
             curTeamSelWidget = ui.pageMultiplayer->teamsSelect;
-        } else {
+        }
+        else
+        {
             curTeamSelWidget = ui.pageNetGame->pNetTeamsWidget;
         }
 
         QList<HWTeam> teamsList;
-        for (QStringList::iterator it = tmNames.begin(); it != tmNames.end(); it++) {
+        for (QStringList::iterator it = tmNames.begin(); it != tmNames.end(); it++)
+        {
             HWTeam team(*it);
             team.loadFromFile();
             teamsList.push_back(team);
         }
 
-        if (lastid == ID_PAGE_SETUP || lastid == ID_PAGE_DRAWMAP) { // _TEAM
-            if (editedTeam) {
+        if (lastid == ID_PAGE_SETUP || lastid == ID_PAGE_DRAWMAP)   // _TEAM
+        {
+            if (editedTeam)
+            {
                 curTeamSelWidget->addTeam(*editedTeam);
             }
-        } else if (lastid != ID_PAGE_GAMESTATS
-                && lastid != ID_PAGE_INGAME
-                && lastid != ID_PAGE_SCHEME
-                && lastid != ID_PAGE_SELECTWEAPON) {
-            curTeamSelWidget->resetPlayingTeams(teamsList);
         }
-    } else
-        if (id == ID_PAGE_GAMESTATS) {
-            ui.pageGameStats->renderStats();
+        else if (lastid != ID_PAGE_GAMESTATS
+                 && lastid != ID_PAGE_INGAME
+                 && lastid != ID_PAGE_SCHEME
+                 && lastid != ID_PAGE_SELECTWEAPON)
+        {
+            curTeamSelWidget->resetPlayingTeams(teamsList);
         }
+    }
+    else if (id == ID_PAGE_GAMESTATS)
+    {
+        ui.pageGameStats->renderStats();
+    }
 
-    if (id == ID_PAGE_MAIN) {
+    if (id == ID_PAGE_MAIN)
+    {
         ui.pageOptions->setTeamOptionsEnabled(true);
     }
 
-    // load and save ignore/friends lists
-    if (lastid == ID_PAGE_NETGAME) // leaving a room
-        ui.pageNetGame->pChatWidget->saveLists(ui.pageOptions->editNetNick->text());
-    else if(lastid == ID_PAGE_ROOMSLIST) // leaving the lobby
-        ui.pageRoomsList->chatWidget->saveLists(ui.pageOptions->editNetNick->text());
-
-    if (id == ID_PAGE_NETGAME) // joining a room
-        ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text());
-// joining the lobby 
-    else if (id == ID_PAGE_ROOMSLIST)
-        ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text());
+    if (id == ID_PAGE_SETUP)
+    {
+        config->reloadValues();
+    }
 
+    if (id == ID_PAGE_VIDEOS )
+    {
+        config->reloadVideosValues();
+    }
 }
 
 void HWForm::GoToPage(int id)
 {
+    bool stopAnim = false;
+
     int lastid = ui.Pages->currentIndex();
     PagesStack.push(ui.Pages->currentIndex());
+
     OnPageShown(id, lastid);
     ui.Pages->setCurrentIndex(id);
+
+
+   /* if (id == ID_PAGE_DRAWMAP || id == ID_PAGE_GAMESTATS)
+        stopAnim = true;
+	This were disabled due to broken flake animations.  I believe the more general problems w/ opacity that forced its disable makes blocking these
+	unnecessary.
+   */
+
+#if (QT_VERSION >= 0x040600)
+    if (!stopAnim)
+    {
+        /**Start animation :**/
+        int coeff = 1;
+#ifdef false
+        coeff = 2;
+        QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
+        ui.Pages->widget(id)->setGraphicsEffect(effectNew);
+
+        QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(lastid));
+        ui.Pages->widget(lastid)->setGraphicsEffect(effectLast);
+#endif
+        // no effects, means 0 effect duration :D
+        int duration = config->isFrontendEffects() ? 500 : 0;
+
+        //New page animation
+        animationNewSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos");
+        animationNewSlide->setDuration(duration);
+        animationNewSlide->setStartValue(QPoint(width()/coeff, 0));
+        animationNewSlide->setEndValue(QPoint(0, 0));
+        animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
+
+#ifdef false
+        animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
+        animationNewOpacity->setDuration(duration);
+        animationNewOpacity->setStartValue(0.01);
+        animationNewOpacity->setEndValue(1);
+        animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
+#endif
+
+        //Last page animation
+        ui.Pages->widget(lastid)->setHidden(false);
+
+        animationOldSlide = new QPropertyAnimation(ui.Pages->widget(lastid), "pos");
+        animationOldSlide->setDuration(duration);
+        animationOldSlide->setStartValue(QPoint(0, 0));
+        animationOldSlide->setEndValue(QPoint(-width()/coeff, 0));
+        animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
+
+#ifdef false
+        animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
+        animationOldOpacity->setDuration(duration);
+        animationOldOpacity->setStartValue(1);
+        animationOldOpacity->setEndValue(0.01);
+        animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
+#endif
+
+        // let's hide the old slide after its animation has finished
+        connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide()));
+
+        // start animations
+        animationOldSlide->start(QAbstractAnimation::DeleteWhenStopped);
+        animationNewSlide->start(QAbstractAnimation::DeleteWhenStopped);
+
+    	/* this is for the situation when the animation below is interrupted by a new animation.  For some reason, finished is not being fired */ 	
+    	for(int i=0;i<MAX_PAGE;i++) if (i!=id && i!=lastid) ui.Pages->widget(i)->hide();
+    }
+#endif
 }
 
 void HWForm::GoBack()
 {
+    bool stopAnim = false;
     int curid = ui.Pages->currentIndex();
     if (curid == ID_PAGE_MAIN)
+    {
+        if (!ui.pageVideos->tryQuit(this))
+            return;
+        stopAnim = true;
         exit();
+    }
 
     int id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
     ui.Pages->setCurrentIndex(id);
     OnPageShown(id, curid);
 
     if (id == ID_PAGE_CONNECTING)
+    {
+        stopAnim = true;
         GoBack();
+    }
     if (id == ID_PAGE_NETSERVER)
+    {
+        stopAnim = true;
         GoBack();
+    }
     if ((!hwnet) && (id == ID_PAGE_ROOMSLIST))
+    {
+        stopAnim = true;
         GoBack();
+    }
+    /*if (curid == ID_PAGE_DRAWMAP)
+        stopAnim = true; */
 
     if ((!hwnet) || (!hwnet->isInRoom()))
         if (id == ID_PAGE_NETGAME || id == ID_PAGE_NETGAME)
+        {
+            stopAnim = true;
             GoBack();
+        }
 
     if (curid == ID_PAGE_ROOMSLIST || curid == ID_PAGE_CONNECTING) NetDisconnect();
     if (curid == ID_PAGE_NETGAME && hwnet && hwnet->isInRoom()) hwnet->partRoom();
@@ -578,6 +753,70 @@ void HWForm::GoBack()
 
     if (curid == ID_PAGE_SCHEME)
         ammoSchemeModel->Save();
+
+#if (QT_VERSION >= 0x040600)
+    /**Start animation :**/
+    if (curid != 0 && !stopAnim)
+    {
+        int coeff = 1;
+#ifdef false
+        coeff = 2;
+        QGraphicsOpacityEffect *effectNew = new QGraphicsOpacityEffect(ui.Pages->widget(id));
+        effectNew->setOpacity(1);
+        ui.Pages->widget(id)->setGraphicsEffect(effectNew);
+
+        QGraphicsOpacityEffect *effectLast = new QGraphicsOpacityEffect(ui.Pages->widget(curid));
+        ui.Pages->widget(curid)->setGraphicsEffect(effectLast);
+#endif
+        // no effects, means 0 effect duration :D
+        int duration = config->isFrontendEffects() ? 500 : 0;
+
+        //Last page animation
+        animationOldSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos");
+        animationOldSlide->setDuration(duration);
+        animationOldSlide->setStartValue(QPoint(-width()/coeff, 0));
+        animationOldSlide->setEndValue(QPoint(0, 0));
+        animationOldSlide->setEasingCurve(QEasingCurve::OutExpo);
+
+#ifdef false
+        animationOldOpacity = new QPropertyAnimation(effectLast, "opacity");
+        animationOldOpacity->setDuration(duration);
+        animationOldOpacity->setStartValue(1);
+        animationOldOpacity->setEndValue(0.01);
+        animationOldOpacity->setEasingCurve(QEasingCurve::OutExpo);
+#endif
+        //New page animation
+        ui.Pages->widget(curid)->setHidden(false);
+
+        animationNewSlide = new QPropertyAnimation(ui.Pages->widget(curid), "pos");
+        animationNewSlide->setDuration(duration);
+        animationNewSlide->setStartValue(QPoint(0, 0));
+        animationNewSlide->setEndValue(QPoint(width()/coeff, 0));
+        animationNewSlide->setEasingCurve(QEasingCurve::OutExpo);
+
+#ifdef false
+        animationNewOpacity = new QPropertyAnimation(effectNew, "opacity");
+        animationNewOpacity->setDuration(duration);
+        animationNewOpacity->setStartValue(0.01);
+        animationNewOpacity->setEndValue(1);
+        animationNewOpacity->setEasingCurve(QEasingCurve::OutExpo);
+#endif
+
+        // let's hide the old slide after its animation has finished
+        connect(animationNewSlide, SIGNAL(finished()), ui.Pages->widget(curid), SLOT(hide()));
+
+        // start animations
+        animationOldSlide->start(QAbstractAnimation::DeleteWhenStopped);
+        animationNewSlide->start(QAbstractAnimation::DeleteWhenStopped);
+    }
+#endif
+
+    if (stopAnim)
+        ui.Pages->widget(curid)->hide();
+
+// TODO the whole pages shown and effects stuff should be moved
+// out of hwform.cpp and into a subclass of QStackedLayout
+
 }
 
 void HWForm::OpenSnapshotFolder()
@@ -595,19 +834,19 @@ void HWForm::exit()
 {
 //   if (eggTimer.elapsed() < 3000){
 #ifdef __APPLE__
-        panel->showInstallController();
+    panel->showInstallController();
 #endif
-        close();
+    close();
 // TODO reactivate egg
-/*    }
-    else
-    {
-        QPushButton * btn = findChild<QPushButton *>("imageButt");
-        if (btn)
+    /*    }
+        else
         {
-            btn->setIcon(QIcon(":/res/bonus.png"));
-        }
-    } */
+            QPushButton * btn = findChild<QPushButton *>("imageButt");
+            if (btn)
+            {
+                btn->setIcon(QIcon(":/res/bonus.png"));
+            }
+        } */
 }
 
 void HWForm::IntermediateSetup()
@@ -615,16 +854,19 @@ void HWForm::IntermediateSetup()
     quint8 id=ui.Pages->currentIndex();
     TeamSelWidget* curTeamSelWidget;
 
-    if(id == ID_PAGE_MULTIPLAYER) {
+    if(id == ID_PAGE_MULTIPLAYER)
+    {
         curTeamSelWidget = ui.pageMultiplayer->teamsSelect;
-    } else {
+    }
+    else
+    {
         curTeamSelWidget = ui.pageNetGame->pNetTeamsWidget;
     }
 
     QStringList tmnames;
 
     foreach(HWTeam team, curTeamSelWidget->getNotPlayingTeams())
-        tmnames += team.name();
+    tmnames += team.name();
 
     //UpdateTeamsLists(&tmnames); // FIXME: still need more work if teamname is updated while configuring
     UpdateTeamsLists();
@@ -648,24 +890,35 @@ void HWForm::EditTeam(const QString & teamName)
 void HWForm::AfterTeamEdit()
 {
     UpdateTeamsLists();
-    GoBack();
+    //GoBack();
 }
 
 
 void HWForm::DeleteTeam(const QString & teamName)
 {
-    ui.pageEditTeam->deleteTeam(teamName);
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Teams"), QMessageBox::tr("Really delete this team?"), QMessageBox::Ok | QMessageBox::Cancel);
+    QMessageBox reallyDeleteMsg(this);
+    reallyDeleteMsg.setIcon(QMessageBox::Question);
+    reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Teams - Are you sure?"));
+    reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to delete the team '%1'?").arg(teamName));
+    reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+    reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
 
-    UpdateTeamsLists();
+    if (reallyDeleteMsg.exec() == QMessageBox::Ok)
+    {
+        ui.pageEditTeam->deleteTeam(teamName);
+        UpdateTeamsLists();
+    }
 }
 
 void HWForm::DeleteScheme()
 {
     ui.pageScheme->selectScheme->setCurrentIndex(ui.pageOptions->SchemesName->currentIndex());
-    if (ui.pageOptions->SchemesName->currentIndex() < ammoSchemeModel->numberOfDefaultSchemes) {
-        QMessageBox::warning(0, QMessageBox::tr("Schemes"), QMessageBox::tr("Can not delete default scheme '%1'!").arg(ui.pageOptions->SchemesName->currentText()));
-    } else {
+    if (ui.pageOptions->SchemesName->currentIndex() < ammoSchemeModel->numberOfDefaultSchemes)
+    {
+        ShowErrorMessage(QMessageBox::tr("Cannot delete default scheme '%1'!").arg(ui.pageOptions->SchemesName->currentText()));
+    }
+    else
+    {
         ui.pageScheme->deleteRow();
         ammoSchemeModel->Save();
     }
@@ -688,10 +941,7 @@ void HWForm::PlayDemo()
     QListWidgetItem * curritem = ui.pagePlayDemo->DemosList->currentItem();
     if (!curritem)
     {
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please select record from the list above"),
-                tr("OK"));
+        ShowErrorMessage(QMessageBox::tr("Please select a record from the list"));
         return;
     }
     CreateGame(0, 0, 0);
@@ -719,24 +969,34 @@ void HWForm::NetConnectOfficialServer()
 
 void HWForm::NetPassword(const QString & nick)
 {
-    bool ok = false;
     int passLength = config->value("net/passwordlength", 0).toInt();
     QString hash = config->value("net/passwordhash", "").toString();
 
     // If the password is blank, ask the user to enter one in
     if (passLength == 0)
     {
-        QString password = QInputDialog::getText(this, tr("Password"), tr("Your nickname %1 is\nregistered on Hedgewars.org\nPlease provide your password below\nor pick another nickname in game config:").arg(nick), QLineEdit::Password, passLength==0?NULL:QString(passLength,'\0'), &ok);
-
-        if (!ok) {
+        HWPasswordDialog * hpd = new HWPasswordDialog(this, tr("Your nickname %1 is\nregistered on Hedgewars.org\nPlease provide your password below\nor pick another nickname in game config:").arg(nick));
+        hpd->cbSave->setChecked(config->value("net/savepassword", true).toBool());
+        if (hpd->exec() != QDialog::Accepted)
+        {
             ForcedDisconnect(tr("No password supplied."));
+            delete hpd;
             return;
         }
 
-        hash = QCryptographicHash::hash(password.toLatin1(), QCryptographicHash::Md5).toHex();
-        config->setValue("net/passwordhash", hash);
-        config->setValue("net/passwordlength", password.size());
-        config->setNetPasswordLength(password.size());
+        QString password = hpd->lePassword->text();
+        hash = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Md5).toHex();
+
+        bool save = hpd->cbSave->isChecked();
+        config->setValue("net/savepassword", save);
+        if (save) // user wants to save password
+        {
+            config->setValue("net/passwordhash", hash);
+            config->setValue("net/passwordlength", password.size());
+            config->setNetPasswordLength(password.size());
+        }
+
+        delete hpd;
     }
 
     hwnet->SendPasswordHash(hash);
@@ -745,10 +1005,11 @@ void HWForm::NetPassword(const QString & nick)
 void HWForm::NetNickTaken(const QString & nick)
 {
     bool ok = false;
-    QString newNick = QInputDialog::getText(this, tr("Nickname"), tr("Some one already uses\n your nickname %1\non the server.\nPlease pick another nickname:").arg(nick), QLineEdit::Normal, nick, &ok);
+    QString newNick = QInputDialog::getText(this, tr("Nickname"), tr("Someone already uses your nickname %1 on the server.\nPlease pick another nickname:").arg(nick), QLineEdit::Normal, nick, &ok);
 
-    if (!ok || newNick.isEmpty()) {
-            ForcedDisconnect(tr("No nickname supplied."));
+    if (!ok || newNick.isEmpty())
+    {
+        ForcedDisconnect(tr("No nickname supplied."));
         return;
     }
 
@@ -783,7 +1044,7 @@ void HWForm::NetError(const QString & errmsg)
             ui.pageNetGame->displayError(errmsg);
             break;
         default:
-        ui.pageRoomsList->displayError(errmsg);
+            ui.pageRoomsList->displayError(errmsg);
     }
 }
 
@@ -797,7 +1058,8 @@ void HWForm::NetWarning(const QString & wrnmsg)
 
 void HWForm::_NetConnect(const QString & hostName, quint16 port, QString nick)
 {
-    if(hwnet) {
+    if(hwnet)
+    {
         hwnet->Disconnect();
         delete hwnet;
         hwnet=0;
@@ -808,110 +1070,111 @@ void HWForm::_NetConnect(const QString & hostName, quint16 port, QString nick)
     GoToPage(ID_PAGE_CONNECTING);
 
     connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame()));
-    connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()));
-    connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)));
-    connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)));
-    connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()));
-    connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)));
-    connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)));
-    connect(hwnet, SIGNAL(RemoveNetTeam(const HWTeam&)), this, SLOT(RemoveNetTeam(const HWTeam&)));
-    connect(hwnet, SIGNAL(TeamAccepted(const QString&)), this, SLOT(NetTeamAccepted(const QString&)));
-    connect(hwnet, SIGNAL(AskForPassword(const QString&)), this, SLOT(NetPassword(const QString&)));
-    connect(hwnet, SIGNAL(NickTaken(const QString&)), this, SLOT(NetNickTaken(const QString&)));
-    connect(hwnet, SIGNAL(AuthFailed()), this, SLOT(NetAuthFailed()));
+    connect(hwnet, SIGNAL(connected()), this, SLOT(NetConnected()), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(Error(const QString&)), this, SLOT(NetError(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(Warning(const QString&)), this, SLOT(NetWarning(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter()), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(LeftRoom(const QString&)), this, SLOT(NetLeftRoom(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(RemoveNetTeam(const HWTeam&)), this, SLOT(RemoveNetTeam(const HWTeam&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(TeamAccepted(const QString&)), this, SLOT(NetTeamAccepted(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(AskForPassword(const QString&)), this, SLOT(NetPassword(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(NickTaken(const QString&)), this, SLOT(NetNickTaken(const QString&)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(AuthFailed()), this, SLOT(NetAuthFailed()), Qt::QueuedConnection);
     //connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), hwnet, SLOT(partRoom()));
 
+    ui.pageRoomsList->chatWidget->setUsersModel(hwnet->lobbyPlayersModel());
+    ui.pageNetGame->pChatWidget->setUsersModel(hwnet->roomPlayersModel());
+
 // rooms list page stuff
-    connect(hwnet, SIGNAL(roomsList(const QStringList&)),
-        ui.pageRoomsList, SLOT(setRoomsList(const QStringList&)));
+    ui.pageRoomsList->setModel(hwnet->roomsListModel());
     connect(hwnet, SIGNAL(adminAccess(bool)),
-        ui.pageRoomsList, SLOT(setAdmin(bool)));
+            ui.pageRoomsList, SLOT(setAdmin(bool)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(adminAccess(bool)),
-        ui.pageRoomsList->chatWidget, SLOT(adminAccess(bool)));
+            ui.pageRoomsList->chatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
 
     connect(hwnet, SIGNAL(serverMessage(const QString&)),
-        ui.pageRoomsList->chatWidget, SLOT(onServerMessage(const QString&)));
+            ui.pageRoomsList->chatWidget, SLOT(onServerMessage(const QString&)), Qt::QueuedConnection);
 
     connect(ui.pageRoomsList, SIGNAL(askForCreateRoom(const QString &)),
-        hwnet, SLOT(CreateRoom(const QString&)));
+            hwnet, SLOT(CreateRoom(const QString&)));
     connect(ui.pageRoomsList, SIGNAL(askForJoinRoom(const QString &)),
-        hwnet, SLOT(JoinRoom(const QString&)));
+            hwnet, SLOT(JoinRoom(const QString&)));
 //  connect(ui.pageRoomsList, SIGNAL(askForCreateRoom(const QString &)),
 //      this, SLOT(NetGameMaster()));
 //  connect(ui.pageRoomsList, SIGNAL(askForJoinRoom(const QString &)),
 //      this, SLOT(NetGameSlave()));
     connect(ui.pageRoomsList, SIGNAL(askForRoomList()),
-        hwnet, SLOT(askRoomsList()));
+            hwnet, SLOT(askRoomsList()));
 
 // room status stuff
     connect(hwnet, SIGNAL(roomMaster(bool)),
-        this, SLOT(NetGameChangeStatus(bool)));
+            this, SLOT(NetGameChangeStatus(bool)), Qt::QueuedConnection);
 
 // net page stuff
     connect(hwnet, SIGNAL(chatStringFromNet(const QString&)),
-        ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)));
-    connect(hwnet, SIGNAL(setReadyStatus(const QString &, bool)),
-        ui.pageNetGame->pChatWidget, SLOT(setReadyStatus(const QString &, bool)));
+            ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
+
     connect(hwnet, SIGNAL(chatStringFromMe(const QString&)),
-        ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)));
+            ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(roomMaster(bool)),
-        ui.pageNetGame->pChatWidget, SLOT(adminAccess(bool)));
+            ui.pageNetGame->pChatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
     connect(ui.pageNetGame->pChatWidget, SIGNAL(chatLine(const QString&)),
-        hwnet, SLOT(chatLineToNet(const QString&)));
+            hwnet, SLOT(chatLineToNet(const QString&)));
     connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
     connect(hwnet, SIGNAL(setMyReadyStatus(bool)),
-        ui.pageNetGame, SLOT(setReadyStatus(bool)));
+            ui.pageNetGame, SLOT(setReadyStatus(bool)), Qt::QueuedConnection);
 
 // chat widget actions
     connect(ui.pageNetGame->pChatWidget, SIGNAL(kick(const QString&)),
-        hwnet, SLOT(kickPlayer(const QString&)));
+            hwnet, SLOT(kickPlayer(const QString&)));
     connect(ui.pageNetGame->pChatWidget, SIGNAL(ban(const QString&)),
-        hwnet, SLOT(banPlayer(const QString&)));
+            hwnet, SLOT(banPlayer(const QString&)));
     connect(ui.pageNetGame->pChatWidget, SIGNAL(info(const QString&)),
-        hwnet, SLOT(infoPlayer(const QString&)));
+            hwnet, SLOT(infoPlayer(const QString&)));
     connect(ui.pageNetGame->pChatWidget, SIGNAL(follow(const QString&)),
-        hwnet, SLOT(followPlayer(const QString&)));
+            hwnet, SLOT(followPlayer(const QString&)));
     connect(ui.pageRoomsList->chatWidget, SIGNAL(kick(const QString&)),
-        hwnet, SLOT(kickPlayer(const QString&)));
+            hwnet, SLOT(kickPlayer(const QString&)));
     connect(ui.pageRoomsList->chatWidget, SIGNAL(ban(const QString&)),
-        hwnet, SLOT(banPlayer(const QString&)));
+            hwnet, SLOT(banPlayer(const QString&)));
     connect(ui.pageRoomsList->chatWidget, SIGNAL(info(const QString&)),
-        hwnet, SLOT(infoPlayer(const QString&)));
+            hwnet, SLOT(infoPlayer(const QString&)));
     connect(ui.pageRoomsList->chatWidget, SIGNAL(follow(const QString&)),
-        hwnet, SLOT(followPlayer(const QString&)));
+            hwnet, SLOT(followPlayer(const QString&)));
 
 // chatting
     connect(ui.pageRoomsList->chatWidget, SIGNAL(chatLine(const QString&)),
-        hwnet, SLOT(chatLineToLobby(const QString&)));
+            hwnet, SLOT(chatLineToLobby(const QString&)));
     connect(hwnet, SIGNAL(chatStringLobby(const QString&)),
-        ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)));
+            ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(chatStringLobby(const QString&, const QString&)),
-        ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&, const QString&)));
+            ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&, const QString&)));
     connect(hwnet, SIGNAL(chatStringFromMeLobby(const QString&)),
-        ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)));
+            ui.pageRoomsList->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
 
 // nick list stuff
     connect(hwnet, SIGNAL(nickAdded(const QString&, bool)),
-        ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&, bool)));
+            ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(nickRemoved(const QString&)),
-        ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)));
+            ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(nickAddedLobby(const QString&, bool)),
-        ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)));
+            ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(nickRemovedLobby(const QString&)),
-        ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&)));
+            ui.pageRoomsList->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
 
 // teams selecting stuff
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(hhogsNumChanged(const HWTeam&)),
-        hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
+            hwnet, SLOT(onHedgehogsNumChanged(const HWTeam&)));
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamColorChanged(const HWTeam&)),
-        hwnet, SLOT(onTeamColorChanged(const HWTeam&)));
+            hwnet, SLOT(onTeamColorChanged(const HWTeam&)));
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamWillPlay(HWTeam)), hwnet, SLOT(AddTeam(HWTeam)));
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(acceptRequested(HWTeam)), hwnet, SLOT(AddTeam(HWTeam)));
     connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(teamNotPlaying(const HWTeam&)), hwnet, SLOT(RemoveTeam(const HWTeam&)));
     connect(hwnet, SIGNAL(hhnumChanged(const HWTeam&)),
-        ui.pageNetGame->pNetTeamsWidget, SLOT(changeHHNum(const HWTeam&)));
+            ui.pageNetGame->pNetTeamsWidget, SLOT(changeHHNum(const HWTeam&)), Qt::QueuedConnection);
     connect(hwnet, SIGNAL(teamColorChanged(const HWTeam&)),
-        ui.pageNetGame->pNetTeamsWidget, SLOT(changeTeamColor(const HWTeam&)));
+            ui.pageNetGame->pNetTeamsWidget, SLOT(changeTeamColor(const HWTeam&)), Qt::QueuedConnection);
 
 // admin stuff
     connect(hwnet, SIGNAL(serverMessageNew(const QString&)), ui.pageAdmin, SLOT(serverMessageNew(const QString &)));
@@ -931,12 +1194,13 @@ void HWForm::_NetConnect(const QString & hostName, quint16 port, QString nick)
     connect(ui.pageNetGame->pGameCFG, SIGNAL(paramChanged(const QString &, const QStringList &)), hwnet, SLOT(onParamChanged(const QString &, const QStringList &)));
     connect(hwnet, SIGNAL(configAsked()), ui.pageNetGame->pGameCFG, SLOT(fullNetConfig()));
 
-    while (nick.isEmpty()) {
+    while (nick.isEmpty())
+    {
         nick = QInputDialog::getText(this,
-                 QObject::tr("Nickname"),
-                 QObject::tr("Please enter your nickname"),
-                 QLineEdit::Normal,
-                 QDir::home().dirName());
+                                     QObject::tr("Nickname"),
+                                     QObject::tr("Please enter your nickname"),
+                                     QLineEdit::Normal,
+                                     QDir::home().dirName());
         config->setValue("net/nick",nick);
         config->updNetNick();
     }
@@ -961,6 +1225,7 @@ void HWForm::NetConnect()
         netPort = hpd->sbPort->value();
         NetConnectServer(*netHost, netPort);
     }
+    delete hpd;
 }
 
 void HWForm::NetStartServer()
@@ -968,10 +1233,10 @@ void HWForm::NetStartServer()
     config->SaveOptions();
 
     pnetserver = new HWNetServer;
-    if(!pnetserver->StartServer(ui.pageNetServer->sbPort->value()))
+    if (!pnetserver->StartServer(ui.pageNetServer->sbPort->value()))
     {
-        QMessageBox::critical(0, tr("Error"),
-                tr("Unable to start the server"));
+        ShowErrorMessage(QMessageBox::tr("Unable to start server"));
+
         delete pnetserver;
         pnetserver = 0;
         return;
@@ -980,8 +1245,8 @@ void HWForm::NetStartServer()
     QTimer::singleShot(250, this, SLOT(AsyncNetServerStart()));
 
     pRegisterServer = new HWNetUdpServer(0,
-            ui.pageNetServer->leServerDescr->text(),
-            ui.pageNetServer->sbPort->value());
+                                         ui.pageNetServer->leServerDescr->text(),
+                                         ui.pageNetServer->sbPort->value());
 }
 
 void HWForm::AsyncNetServerStart()
@@ -991,7 +1256,8 @@ void HWForm::AsyncNetServerStart()
 
 void HWForm::NetDisconnect()
 {
-    if(pnetserver) {
+    if(pnetserver)
+    {
         if (pRegisterServer)
         {
             pRegisterServer->unregister();
@@ -1009,13 +1275,20 @@ void HWForm::NetDisconnect()
 
 void HWForm::ForcedDisconnect(const QString & reason)
 {
-    if(pnetserver) return; // we have server - let it care of all things
-    if (hwnet) {
-        QMessageBox::warning(this, QMessageBox::tr("Network"),
-                QMessageBox::tr("Connection to server is lost") + (reason.isEmpty()?"":("\n\n" + HWNewNet::tr("Quit reason: ") + '"' + reason +'"')));
+    if (pnetserver)
+        return; // we have server - let it care of all things
+    if (hwnet)
+    {
+        QString errorStr = QMessageBox::tr("Connection to server is lost") + (reason.isEmpty()?"":("\n\n" + HWNewNet::tr("Quit reason: ") + '"' + reason +'"'));
+        ShowErrorMessage(errorStr);
+    }
 
+    while (ui.Pages->currentIndex() != ID_PAGE_NET
+        && ui.Pages->currentIndex() != ID_PAGE_NETTYPE
+        && ui.Pages->currentIndex() != ID_PAGE_MAIN)
+    {
+        GoBack();
     }
-    if (ui.Pages->currentIndex() != ID_PAGE_NET) GoBack();
 }
 
 void HWForm::NetConnected()
@@ -1043,8 +1316,8 @@ void HWForm::StartMPGame()
 {
     QString ammo;
     ammo = ui.pageMultiplayer->gameCFG->WeaponsName->itemData(
-        ui.pageMultiplayer->gameCFG->WeaponsName->currentIndex()
-        ).toString();
+               ui.pageMultiplayer->gameCFG->WeaponsName->currentIndex()
+           ).toString();
 
     CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
 
@@ -1054,8 +1327,10 @@ void HWForm::StartMPGame()
 void HWForm::GameStateChanged(GameState gameState)
 {
     quint8 id = ui.Pages->currentIndex();
-    switch(gameState) {
-        case gsStarted: {
+    switch(gameState)
+    {
+        case gsStarted:
+        {
             Music(false);
             if (wBackground) wBackground->stopAnimation();
             if (!hwnet || (!hwnet->isRoomChief() || !hwnet->isInRoom())) GoToPage(ID_PAGE_INGAME);
@@ -1069,7 +1344,8 @@ void HWForm::GameStateChanged(GameState gameState)
             setFocusPolicy(Qt::NoFocus);
             break;
         }
-        case gsFinished: {
+        case gsFinished:
+        {
             //setVisible(true);
             setFocusPolicy(Qt::StrongFocus);
             if (id == ID_PAGE_INGAME) GoBack();
@@ -1080,14 +1356,16 @@ void HWForm::GameStateChanged(GameState gameState)
             if (game) game->netSuspend = false;
             break;
         }
-        default: {
+        default:
+        {
             //setVisible(true);
             setFocusPolicy(Qt::StrongFocus);
             quint8 id = ui.Pages->currentIndex();
             if (id == ID_PAGE_INGAME ||
 // was room chief and the game was aborted
-                (hwnet && hwnet->isRoomChief() && hwnet->isInRoom() && 
-                    (gameState == gsInterrupted || gameState == gsStopped || gameState == gsDestroyed || gameState == gsHalted))) {
+                    (hwnet && hwnet->isRoomChief() && hwnet->isInRoom() &&
+                     (gameState == gsInterrupted || gameState == gsStopped || gameState == gsDestroyed || gameState == gsHalted)))
+            {
                 if (id == ID_PAGE_INGAME) GoBack();
                 Music(ui.pageOptions->CBEnableFrontendMusic->isChecked());
                 if (wBackground) wBackground->startAnimation();
@@ -1101,56 +1379,65 @@ void HWForm::GameStateChanged(GameState gameState)
 void HWForm::CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo)
 {
     game = new HWGame(config, gamecfg, ammo, pTeamSelWidget);
+    connect(game, SIGNAL(CampStateChanged(int)), this, SLOT(UpdateCampaignPageProgress(int)));
     connect(game, SIGNAL(GameStateChanged(GameState)), this, SLOT(GameStateChanged(GameState)));
     connect(game, SIGNAL(GameStats(char, const QString &)), ui.pageGameStats, SLOT(GameStats(char, const QString &)));
     connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
-    connect(game, SIGNAL(HaveRecord(bool, const QByteArray &)), this, SLOT(GetRecord(bool, const QByteArray &)));
+    connect(game, SIGNAL(HaveRecord(RecordType, const QByteArray &)), this, SLOT(GetRecord(RecordType, const QByteArray &)));
     m_lastDemo = QByteArray();
 }
 
 void HWForm::ShowErrorMessage(const QString & msg)
 {
-    QMessageBox::warning(this,
-            "Hedgewars",
-            msg);
+    QMessageBox msgMsg(this);
+    msgMsg.setIcon(QMessageBox::Warning);
+    msgMsg.setWindowTitle(QMessageBox::tr("Hedgewars - Error"));
+    msgMsg.setText(msg);
+    msgMsg.setWindowModality(Qt::WindowModal);
+    msgMsg.exec();
 }
 
-void HWForm::GetRecord(bool isDemo, const QByteArray & record)
+void HWForm::GetRecord(RecordType type, const QByteArray & record)
 {
-    QString filename;
-    QByteArray demo = record;
-    QString recordFileName =
+    if (type != rtNeither)
+    {
+        QString filename;
+        QByteArray demo = record;
+        QString recordFileName =
             config->appendDateTimeToRecordName() ?
-                QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm") :
-                "LastRound";
+            QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm") :
+            "LastRound";
 
-    QStringList versionParts = cVersionString->split('-');
-    if ( (versionParts.size() == 2) && (!versionParts[1].isEmpty()) && (versionParts[1].contains(':')) )
-        recordFileName = recordFileName + "_" + versionParts[1].replace(':','-');
-
-    if (isDemo)
-    {
-        demo.replace(QByteArray("\x02TL"), QByteArray("\x02TD"));
-        demo.replace(QByteArray("\x02TN"), QByteArray("\x02TD"));
-        demo.replace(QByteArray("\x02TS"), QByteArray("\x02TD"));
-        filename = cfgdir->absolutePath() + "/Demos/" + recordFileName + "." + *cProtoVer + ".hwd";
-        m_lastDemo = demo;
-    } else
-    {
-        demo.replace(QByteArray("\x02TL"), QByteArray("\x02TS"));
-        demo.replace(QByteArray("\x02TN"), QByteArray("\x02TS"));
-        filename = cfgdir->absolutePath() + "/Saves/" + recordFileName + "." + *cProtoVer + ".hws";
-    }
+        QStringList versionParts = cVersionString->split('-');
+        if ( (versionParts.size() == 2) && (!versionParts[1].isEmpty()) && (versionParts[1].contains(':')) )
+            recordFileName = recordFileName + "_" + versionParts[1].replace(':','-');
 
+        if (type == rtDemo)
+        {
+            demo.replace(QByteArray("\x02TL"), QByteArray("\x02TD"));
+            demo.replace(QByteArray("\x02TN"), QByteArray("\x02TD"));
+            demo.replace(QByteArray("\x02TS"), QByteArray("\x02TD"));
+            filename = cfgdir->absolutePath() + "/Demos/" + recordFileName + "." + *cProtoVer + ".hwd";
+            m_lastDemo = demo;
+        }
+        else
+        {
+            demo.replace(QByteArray("\x02TL"), QByteArray("\x02TS"));
+            demo.replace(QByteArray("\x02TN"), QByteArray("\x02TS"));
+            filename = cfgdir->absolutePath() + "/Saves/" + recordFileName + "." + *cProtoVer + ".hws";
+        }
 
-    QFile demofile(filename);
-    if (!demofile.open(QIODevice::WriteOnly))
-    {
-        ShowErrorMessage(tr("Cannot save record to file %1").arg(filename));
-        return ;
+        QFile demofile(filename);
+        if (!demofile.open(QIODevice::WriteOnly))
+            ShowErrorMessage(tr("Cannot save record to file %1").arg(filename));
+        else
+        {
+            demofile.write(demo);
+            demofile.close();
+        }
     }
-    demofile.write(demo);
-    demofile.close();
+
+    ui.pageVideos->startEncoding(record);
 }
 
 void HWForm::startTraining(const QString & scriptName)
@@ -1164,23 +1451,29 @@ void HWForm::StartCampaign()
 {
     CreateGame(0, 0, 0);
 
-    game->StartCampaign(ui.pageCampaign->CBSelect->itemData(ui.pageCampaign->CBSelect->currentIndex()).toString());
+    QComboBox *combo = ui.pageCampaign->CBMission;
+    QString camp = ui.pageCampaign->CBCampaign->currentText();
+    unsigned int mNum = combo->count() - combo->currentIndex();
+    QString miss = getCampaignScript(camp, mNum);
+    QString campTeam = ui.pageCampaign->CBTeam->currentText();
+
+    game->StartCampaign(camp, miss, campTeam);
 }
 
 void HWForm::CreateNetGame()
 {
     QString ammo;
     ammo = ui.pageNetGame->pGameCFG->WeaponsName->itemData(
-            ui.pageNetGame->pGameCFG->WeaponsName->currentIndex()
-            ).toString();
+               ui.pageNetGame->pGameCFG->WeaponsName->currentIndex()
+           ).toString();
 
     CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo);
 
     connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &)));
     connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &)));
     connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &)));
-    connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
-    connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)));
+    connect(hwnet, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)), Qt::QueuedConnection);
+    connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection);
 
     game->StartNet();
 }
@@ -1191,6 +1484,7 @@ void HWForm::closeEvent(QCloseEvent *event)
     xfire_free();
 #endif
     config->SaveOptions();
+    config->SaveVideosOptions();
     event->accept();
 }
 
@@ -1227,19 +1521,21 @@ void HWForm::NetGameMaster()
         // disconnect connections first to ensure their inexistance and not to connect twice
         ui.pageNetGame->BtnStart->disconnect(hwnet);
         ui.pageNetGame->BtnUpdate->disconnect(hwnet);
-        ui.pageNetGame->setRoomName(hwnet->getRoom());
         ui.pageNetGame->restrictJoins->disconnect(hwnet);
         ui.pageNetGame->restrictTeamAdds->disconnect(hwnet);
+        ui.pageNetGame->disconnect(hwnet, SLOT(updateRoomName(const QString&)));
+
+        ui.pageNetGame->setRoomName(hwnet->getRoom());
+
         connect(ui.pageNetGame->BtnStart, SIGNAL(clicked()), hwnet, SLOT(startGame()));
-        connect(ui.pageNetGame, SIGNAL(askForUpdateRoomName(const QString &)),
-            hwnet, SLOT(updateRoomName(const QString &)));
+        connect(ui.pageNetGame, SIGNAL(askForUpdateRoomName(const QString &)), hwnet, SLOT(updateRoomName(const QString &)));
         connect(ui.pageNetGame->restrictJoins, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictJoins()));
         connect(ui.pageNetGame->restrictTeamAdds, SIGNAL(triggered()), hwnet, SLOT(toggleRestrictTeamAdds()));
         connect(ui.pageNetGame->pGameCFG->GameSchemes->model(),
                 SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
                 ui.pageNetGame->pGameCFG,
                 SLOT(resendSchemeData())
-                );
+               );
     }
 }
 
@@ -1283,47 +1579,76 @@ void HWForm::resizeEvent(QResizeEvent * event)
 {
     int w = event->size().width();
     int h = event->size().height();
-    if (wBackground) {
+    if (wBackground)
+    {
         wBackground->setFixedSize(w, h);
         wBackground->move(0, 0);
     }
 }
 
+void HWForm::InitCampaignPage()
+{
+    ui.pageCampaign->CBCampaign->clear();
+    HWTeam team(ui.pageCampaign->CBTeam->currentText());
+
+    QStringList entries = DataManager::instance().entryList(
+                                  "Missions/Campaign",
+                                  QDir::Dirs,
+                                  QStringList("[^\\.]*")
+                              );
+
+    unsigned int n = entries.count();
+    for(unsigned int i = 0; i < n; i++)
+    {
+        ui.pageCampaign->CBCampaign->addItem(QString(entries[i]), QString(entries[i]));
+    }
+}
+
+
 void HWForm::UpdateCampaignPage(int index)
 {
     Q_UNUSED(index);
 
     HWTeam team(ui.pageCampaign->CBTeam->currentText());
-    ui.pageCampaign->CBSelect->clear();
-
-    QStringList entries = HWDataManager::instance().entryList(
-                                                        "Missions/Campaign",
-                                                        QDir::Files,
-                                                        QStringList("*#*.lua")
-                                                    );
-    
-    unsigned int n = entries.count();
-    for(unsigned int i = 0; (i < n) && (i <= team.campaignProgress()); i++) {
-        ui.pageCampaign->CBSelect->addItem(QString(entries[i]).replace(QRegExp("^(\\d+)#(.+)\\.lua"), QComboBox::tr("Mission") + " \\1: \\2").replace("_", " "), QString(entries[i]).replace(QRegExp("^(.*)\\.lua"), "\\1"));
+    ui.pageCampaign->CBMission->clear();
+
+    QString campaignName = ui.pageCampaign->CBCampaign->currentText();
+    QStringList missionEntries = getCampMissionList(campaignName);
+    QString tName = team.name();
+    unsigned int n = missionEntries.count();
+    unsigned int m = getCampProgress(tName, campaignName);
+
+    for (unsigned int i = qMin(m + 1, n); i > 0; i--)
+    {
+        ui.pageCampaign->CBMission->addItem(QString("Mission %1: ").arg(i) + QString(missionEntries[i-1]), QString(missionEntries[i-1]));
     }
 }
 
+void HWForm::UpdateCampaignPageProgress(int index)
+{
+    Q_UNUSED(index);
+
+    int missionIndex = ui.pageCampaign->CBMission->currentIndex();
+    UpdateCampaignPage(0);
+    ui.pageCampaign->CBMission->setCurrentIndex(missionIndex);
+}
+
 // used for --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
 QString HWForm::getDemoArguments()
 {
     QRect resolution = config->vid_Resolution();
     return QString(QString::number(resolution.width()) + " "
-     + QString::number(resolution.height()) + " "
-     + QString::number(config->bitDepth()) + " " // bpp
-     + QString::number(config->volume()) + " " // sound volume
-     + (config->isMusicEnabled() ? "1" : "0") + " "
-     + (config->isSoundEnabled() ? "1" : "0") + " "
-     + config->language() + ".txt "
-     + (config->vid_Fullscreen() ? "1" : "0") + " "
-     + (config->isShowFPSEnabled() ? "1" : "0") + " "
-     + (config->isAltDamageEnabled() ? "1" : "0") + " "
-     + QString::number(config->timerInterval()) + " "
-     + QString::number(config->translateQuality()));
+                   + QString::number(resolution.height()) + " "
+                   + QString::number(config->bitDepth()) + " " // bpp
+                   + QString::number(config->volume()) + " " // sound volume
+                   + (config->isMusicEnabled() ? "1" : "0") + " "
+                   + (config->isSoundEnabled() ? "1" : "0") + " "
+                   + config->language() + ".txt "
+                   + (config->vid_Fullscreen() ? "1" : "0") + " "
+                   + (config->isShowFPSEnabled() ? "1" : "0") + " "
+                   + (config->isAltDamageEnabled() ? "1" : "0") + " "
+                   + QString::number(config->timerInterval()) + " "
+                   + QString::number(config->translateQuality()));
 }
 
 void HWForm::AssociateFiles()
@@ -1362,8 +1687,17 @@ void HWForm::AssociateFiles()
     // hack to add user's settings to hwengine. might be better at this point to read in the file, append it, and write it out to its new home.  This assumes no spaces in the data dir path
     if (success) success = system(("sed -i 's/^\\(Exec=.*\\) \\([^ ]* %f\\)/\\1 "+cfgdir->absolutePath().replace(" ","\\\\ ").replace("/","\\/")+" \\2 --set-everything "+arguments+"/' "+QDir::home().absolutePath()+"/.local/share/applications/hwengine.desktop").toLocal8Bit().constData())==0;
 #endif
-    if (success) QMessageBox::information(0, "", QMessageBox::tr("All file associations have been set."));
-    else QMessageBox::information(0, "", QMessageBox::tr("File association failed."));
+    if (success)
+    {
+        QMessageBox infoMsg(this);
+        infoMsg.setIcon(QMessageBox::Information);
+        infoMsg.setWindowTitle(QMessageBox::tr("Hedgewars - Success"));
+        infoMsg.setText(QMessageBox::tr("All file associations have been set"));
+        infoMsg.setWindowModality(Qt::WindowModal);
+        infoMsg.exec();
+    }
+    else
+        ShowErrorMessage(QMessageBox::tr("File association failed."));
 }
 
 void HWForm::saveDemoWithCustomName()
@@ -1375,7 +1709,7 @@ void HWForm::saveDemoWithCustomName()
         do
         {
             fileName = QInputDialog::getText(this, tr("Demo name"), tr("Demo name:"));
-            
+
             if(!fileName.isEmpty())
             {
                 QString filePath = cfgdir->absolutePath() + "/Demos/" + fileName + "." + *cProtoVer + ".hwd";
@@ -1389,7 +1723,112 @@ void HWForm::saveDemoWithCustomName()
                     demofile.close();
                 }
             }
-        } while(!fileName.isEmpty() && !ok);
+        }
+        while(!fileName.isEmpty() && !ok);
     }
 }
 
+void HWForm::SendFeedback()
+{
+    //Create Xml representation of google code issue first
+    if (!CreateIssueXml())
+    {
+        ShowErrorMessage(QMessageBox::tr("Please fill out all fields"));
+        return;
+    }
+
+    //Google login using fake account (feedback.hedgewars at gmail.com)
+    nam = new QNetworkAccessManager(this);
+    connect(nam, SIGNAL(finished(QNetworkReply*)),
+            this, SLOT(finishedSlot(QNetworkReply*)));
+
+    QUrl url(QString("https://www.google.com/accounts/ClientLogin?"
+                     "accountType=GOOGLE&Email=feedback.hedgewars at gmail.com&Passwd=hwfeedback&service=code&source=HedgewarsFoundation-Hedgewars-")
+                    + (cVersionString?(*cVersionString):QString("")));
+    nam->get(QNetworkRequest(url));
+
+}
+
+bool HWForm::CreateIssueXml()
+{
+    QString summary = ui.pageFeedback->summary->text();
+    QString description = ui.pageFeedback->description->toPlainText();
+
+    //Check if all necessary information is entered
+    if (summary.isEmpty() || description.isEmpty())
+        return false;
+
+    issueXml =
+        "<?xml version='1.0' encoding='UTF-8'?>"
+        "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:issues='http://code.google.com/p/hedgewars/issues/list'>"
+        "<title>";
+    issueXml.append(summary);
+    issueXml.append("</title><content type='html'>");
+    issueXml.append(description);
+    issueXml.append("</content><author><name>feedback.hedgewars</name></author></entry>");
+
+    return true;
+}
+
+void HWForm::finishedSlot(QNetworkReply* reply)
+{
+    if (reply && reply->error() == QNetworkReply::NoError)
+    {
+        QByteArray array = reply->readAll();
+        QString str(array);
+
+        if (authToken.length() != 0)
+        {
+
+            QMessageBox infoMsg(this);
+            infoMsg.setIcon(QMessageBox::Information);
+            infoMsg.setWindowTitle(QMessageBox::tr("Hedgewars - Success"));
+            infoMsg.setText(QMessageBox::tr("Successfully posted the issue on hedgewars.googlecode.com"));
+            infoMsg.setWindowModality(Qt::WindowModal);
+            infoMsg.exec();
+
+            ui.pageFeedback->summary->clear();
+            ui.pageFeedback->description->clear();
+            authToken = "";
+            return;
+        }
+
+        if (!getAuthToken(str))
+        {
+            ShowErrorMessage(QMessageBox::tr("Error during authentication at google.com"));
+            return;
+        }
+
+        QByteArray body(issueXml.toUtf8());
+        QNetworkRequest header(QUrl("https://code.google.com/feeds/issues/p/hedgewars/issues/full"));
+        header.setRawHeader("Content-Length", QString::number(issueXml.length()).toAscii());
+        header.setRawHeader("Content-Type", "application/atom+xml");
+        header.setRawHeader("Authorization", QString("GoogleLogin auth=%1").arg(authToken).toUtf8());
+        nam->post(header, body);
+
+    }
+    else if (authToken.length() == 0)
+        ShowErrorMessage(QMessageBox::tr("Error during authentication at google.com"));
+    else
+    {
+        ShowErrorMessage(QMessageBox::tr("Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)"));
+        authToken = "";
+    }
+
+}
+
+bool HWForm::getAuthToken(QString str)
+{
+    QRegExp ex("Auth=(.+)");
+
+    if (-1 == ex.indexIn(str))
+        return false;
+
+    authToken = ex.cap(1);
+    authToken.remove(QChar('\n'));
+
+    return true;
+}
+
+
+
diff --git a/QTfrontend/hwform.h b/QTfrontend/hwform.h
index b781d71..dcc3f92 100644
--- a/QTfrontend/hwform.h
+++ b/QTfrontend/hwform.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,6 +23,11 @@
 #include <QStack>
 #include <QTime>
 #include <QPointer>
+#include <QPropertyAnimation>
+#include <QUrl>
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QNetworkAccessManager>
 
 #include "netserver.h"
 #include "game.h"
@@ -50,131 +55,158 @@ extern QString playerHash;
 
 class HWForm : public QMainWindow
 {
-    Q_OBJECT
-
-public:
-    HWForm(QWidget *parent = 0, QString styleSheet = "");
-    Ui_HWForm ui;
-    GameUIConfig * config;
-    QSettings * gameSettings; // Same file GameUIConfig points to but without the baggage.  Needs sync() calls if you want to get GameUIConfig changes though
-    void updateXfire();
-    void PlayDemoQuick(const QString & demofilename);
-    void exit();
-
-private slots:
-    void GoToSaves();
-    void GoToDemos();
-    void GoToNet();
-    void GoToSelectWeapon();
-    void GoToSelectWeaponSet(int index);
-    void GoToSelectNewWeapon();
-    void GoToScheme(int index);
-    void GoToEditScheme();
-    void GoToNewScheme();
-    void GoToPage(int id);
-    void GoBack();
-    void OpenSnapshotFolder();
-    QString getDemoArguments();
-    void AssociateFiles();
-    void btnExitPressed();
-    void IntermediateSetup();
-    void NewTeam();
-    void EditTeam(const QString & teamName);
-    void AfterTeamEdit();
-    void DeleteTeam(const QString & teamName);
-    void DeleteScheme();
-    void DeleteWeaponSet();
-    void SimpleGame();
-    void PlayDemo();
-    void startTraining(const QString&);
-    void StartCampaign();
-    void NetConnect();
-    void NetConnectServer(const QString & host, quint16 port);
-    void NetConnectOfficialServer();
-    void NetStartServer();
-    void NetDisconnect();
-    void NetConnected();
-    void NetError(const QString & errmsg);
-    void NetWarning(const QString & wrnmsg);
-    void NetGameEnter();
-    void NetPassword(const QString & nick);
-    void NetNickTaken(const QString & nick);
-    void NetAuthFailed();
-    void NetTeamAccepted(const QString& team);
-    void AddNetTeam(const HWTeam& team);
-    void RemoveNetTeam(const HWTeam& team);
-    void StartMPGame();
-    void GameStateChanged(GameState gameState);
-    void ForcedDisconnect(const QString & reason);
-    void ShowErrorMessage(const QString &);
-    void GetRecord(bool isDemo, const QByteArray & record);
-    void CreateNetGame();
-    void UpdateWeapons();
-    void onFrontendFullscreen(bool value);
-    void Music(bool checked);
-    void UpdateCampaignPage(int index);
-
-    void NetGameChangeStatus(bool isMaster);
-    void NetGameMaster();
-    void NetGameSlave();
-
-    void AsyncNetServerStart();
-    void NetLeftRoom(const QString & reason);
-    void selectFirstNetScheme();
-    
-    void saveDemoWithCustomName();
-
-private:
-    void _NetConnect(const QString & hostName, quint16 port, QString nick);
-    void UpdateTeamsLists(const QStringList* editable_teams=0);
-    void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo);
-    void closeEvent(QCloseEvent *event);
-    void CustomizePalettes();
-    void resizeEvent(QResizeEvent * event);
-    //void keyReleaseEvent(QKeyEvent *event);
-    
-    enum PageIDs {
-        ID_PAGE_SETUP_TEAM      =  0,
-        ID_PAGE_SETUP           =  1,
-        ID_PAGE_MULTIPLAYER     =  2,
-        ID_PAGE_DEMOS           =  3,
-        ID_PAGE_NET             =  4,
-        ID_PAGE_NETGAME         =  5,
-        ID_PAGE_INFO            =  6,
-        ID_PAGE_MAIN            =  7,
-        ID_PAGE_GAMESTATS       =  8,
-        ID_PAGE_SINGLEPLAYER    =  9,
-        ID_PAGE_TRAINING        = 10,
-        ID_PAGE_SELECTWEAPON    = 11,
-        ID_PAGE_NETSERVER       = 12,
-        ID_PAGE_INGAME          = 13,
-        ID_PAGE_ROOMSLIST       = 14,
-        ID_PAGE_CONNECTING      = 15,
-        ID_PAGE_SCHEME          = 16,
-        ID_PAGE_ADMIN           = 17,
-        ID_PAGE_NETTYPE         = 18,
-        ID_PAGE_CAMPAIGN        = 19,
-        ID_PAGE_DRAWMAP         = 20,
-        ID_PAGE_DATADOWNLOAD    = 21
+        Q_OBJECT
+
+    public:
+        HWForm(QWidget *parent = 0, QString styleSheet = "");
+        Ui_HWForm ui;
+        static GameUIConfig * config;
+        static QSettings * gameSettings; // Same file GameUIConfig points to but without the baggage.  Needs sync() calls if you want to get GameUIConfig changes though
+        void updateXfire();
+        void PlayDemoQuick(const QString & demofilename);
+        void exit();
+        void setButtonDescription(QString desc);
+        void backDescription();
+        void GoToVideos();
+
+    private slots:
+        void GoToSaves();
+        void GoToDemos();
+        void GoToNet();
+        void GoToSelectWeapon();
+        void GoToSelectWeaponSet(int index);
+        void GoToSelectNewWeapon();
+        void GoToScheme(int index);
+        void GoToEditScheme();
+        void GoToNewScheme();
+        void GoToPage(int id);
+        void GoBack();
+        void OpenSnapshotFolder();
+        QString getDemoArguments();
+        void AssociateFiles();
+        void btnExitPressed();
+        void IntermediateSetup();
+        void NewTeam();
+        void EditTeam(const QString & teamName);
+        void AfterTeamEdit();
+        void DeleteTeam(const QString & teamName);
+        void DeleteScheme();
+        void DeleteWeaponSet();
+        void SimpleGame();
+        void PlayDemo();
+        void startTraining(const QString&);
+        void StartCampaign();
+        void NetConnect();
+        void NetConnectServer(const QString & host, quint16 port);
+        void NetConnectOfficialServer();
+        void NetStartServer();
+        void NetDisconnect();
+        void NetConnected();
+        void NetError(const QString & errmsg);
+        void NetWarning(const QString & wrnmsg);
+        void NetGameEnter();
+        void NetPassword(const QString & nick);
+        void NetNickTaken(const QString & nick);
+        void NetAuthFailed();
+        void NetTeamAccepted(const QString& team);
+        void AddNetTeam(const HWTeam& team);
+        void RemoveNetTeam(const HWTeam& team);
+        void StartMPGame();
+        void GameStateChanged(GameState gameState);
+        void ForcedDisconnect(const QString & reason);
+        void ShowErrorMessage(const QString &);
+        void GetRecord(RecordType type, const QByteArray & record);
+        void CreateNetGame();
+        void UpdateWeapons();
+        void onFrontendFullscreen(bool value);
+        void onFrontendEffects(bool value);
+        void Music(bool checked);
+        void UpdateCampaignPage(int index);
+        void UpdateCampaignPageProgress(int index);
+        void InitCampaignPage();
+        //Starts the transmission process for the feedback
+        void SendFeedback();
+        //Make a xml representation of the issue to be created
+        bool CreateIssueXml();
+        //Called the first time when receiving authorization token from google,
+        //second time when receiving the response after posting the issue
+        void finishedSlot(QNetworkReply* reply);
+        //Filter the auth token from the reply from google
+        bool getAuthToken(QString str);
+
+        void NetGameChangeStatus(bool isMaster);
+        void NetGameMaster();
+        void NetGameSlave();
+
+        void AsyncNetServerStart();
+        void NetLeftRoom(const QString & reason);
+        void selectFirstNetScheme();
+
+        void saveDemoWithCustomName();
+
+    private:
+        void _NetConnect(const QString & hostName, quint16 port, QString nick);
+        void UpdateTeamsLists(const QStringList* editable_teams=0);
+        void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo);
+        void closeEvent(QCloseEvent *event);
+        void CustomizePalettes();
+        void resizeEvent(QResizeEvent * event);
+        //void keyReleaseEvent(QKeyEvent *event);
+
+        enum PageIDs
+        {
+            ID_PAGE_SETUP_TEAM     ,
+            ID_PAGE_SETUP          ,
+            ID_PAGE_MULTIPLAYER    ,
+            ID_PAGE_DEMOS          ,
+            ID_PAGE_NET            ,
+            ID_PAGE_NETGAME        ,
+            ID_PAGE_INFO           ,
+            ID_PAGE_MAIN           ,
+            ID_PAGE_GAMESTATS      ,
+            ID_PAGE_SINGLEPLAYER   ,
+            ID_PAGE_TRAINING       ,
+            ID_PAGE_SELECTWEAPON   ,
+            ID_PAGE_NETSERVER      ,
+            ID_PAGE_INGAME         ,
+            ID_PAGE_ROOMSLIST      ,
+            ID_PAGE_CONNECTING     ,
+            ID_PAGE_SCHEME         ,
+            ID_PAGE_ADMIN          ,
+            ID_PAGE_NETTYPE        ,
+            ID_PAGE_CAMPAIGN       ,
+            ID_PAGE_DRAWMAP        ,
+            ID_PAGE_DATADOWNLOAD   ,
+            ID_PAGE_FEEDBACK	   ,
+            ID_PAGE_VIDEOS,
+	    MAX_PAGE
         };
-    QPointer<HWGame> game;
-    QPointer<HWNetServer> pnetserver;
-    QPointer<HWNetRegisterServer> pRegisterServer;
-    QPointer<HWTeam> editedTeam;
-    QPointer<HWNewNet> hwnet;
-    HWNamegen * namegen;
-    AmmoSchemeModel * ammoSchemeModel;
-    QStack<int> PagesStack;
-    QTime eggTimer;
-    BGWidget * wBackground;
-    QSignalMapper * pageSwitchMapper;
-    QByteArray m_lastDemo;
+        QPointer<HWGame> game;
+        QPointer<HWNetServer> pnetserver;
+        QPointer<HWNetRegisterServer> pRegisterServer;
+        QPointer<HWTeam> editedTeam;
+        QPointer<HWNewNet> hwnet;
+        HWNamegen * namegen;
+        AmmoSchemeModel * ammoSchemeModel;
+        QStack<int> PagesStack;
+        QTime eggTimer;
+        BGWidget * wBackground;
+        QSignalMapper * pageSwitchMapper;
+        QByteArray m_lastDemo;
+        QNetworkAccessManager * nam;
+        QString issueXml;
+        QString authToken;
+
+        QPropertyAnimation *animationNewSlide;
+        QPropertyAnimation *animationOldSlide;
+        QPropertyAnimation *animationNewOpacity;
+        QPropertyAnimation *animationOldOpacity;
 
 #ifdef __APPLE__
-    InstallController * panel;
+        InstallController * panel;
 #endif
 
-    void OnPageShown(quint8 id, quint8 lastid=0);
+        void OnPageShown(quint8 id, quint8 lastid=0);
 };
 
 #endif
diff --git a/QTfrontend/main.cpp b/QTfrontend/main.cpp
index 6d09fd0..7a2114a 100644
--- a/QTfrontend/main.cpp
+++ b/QTfrontend/main.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,11 +26,13 @@
 #include <QMap>
 #include <QSettings>
 #include <QStringListModel>
+#include <QDate>
 
 #include "hwform.h"
 #include "hwconsts.h"
+#include "newnetclient.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #ifdef _WIN32
 #include <Shlobj.h>
@@ -39,52 +41,107 @@
 #include "CocoaInitializer.h"
 #endif
 
+
+//Determines the day of easter in year
+//from http://aa.usno.navy.mil/faq/docs/easter.php,adapted to C/C++
+QDate calculateEaster(long year)
+{
+    int c, n, k, i, j, l, m, d;
+
+    c = year/100;
+    n = year - 19*(year/19);
+    k = (c - 17)/25;
+    i = c - c/4 - (c - k)/3 + 19*n + 15;
+    i = i - 30*(i/30);
+    i = i - (i/28)*(1 - (i/28)*(29/(i + 1))*((21 - n)/11));
+    j = year + year/4 + i + 2 - c + c/4;
+    j = j - 7*(j/7);
+    l = i - j;
+    m = 3 + (l + 40)/44;
+    d = l + 28 - 31*(m / 4);
+
+    return QDate(year, m, d);
+}
+
+//Checks season and assigns it to the variable season in "hwconsts.h"
+void checkSeason()
+{
+    QDate date = QDate::currentDate();
+
+    //Christmas?
+    if (date.month() == 12 && date.day() >= 24
+            && date.day() <= 26)
+        season = SEASON_CHRISTMAS;
+    //Hedgewars birthday?
+    else if (date.month() == 10 && date.day() == 31)
+    {
+        season = SEASON_HWBDAY;
+        years_since_foundation = date.year() - 2004;
+    }
+    //Easter?
+    else if (calculateEaster(date.year()) == date)
+        season = SEASON_EASTER;
+    else
+        season = SEASON_NONE;
+}
+
 bool checkForDir(const QString & dir)
 {
     QDir tmpdir;
     if (!tmpdir.exists(dir))
         if (!tmpdir.mkdir(dir))
         {
-            QMessageBox::critical(0,
-                    QObject::tr("Error"),
-                    QObject::tr("Cannot create directory %1").arg(dir),
-                    QObject::tr("OK"));
+            QMessageBox directoryMsg(QApplication::activeWindow());
+            directoryMsg.setIcon(QMessageBox::Warning);
+            directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
+            directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir));
+            directoryMsg.setWindowModality(Qt::WindowModal);
+            directoryMsg.exec();
             return false;
         }
     return true;
 }
 
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
     HWApplication app(argc, argv);
+
     app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
 
     QStringList arguments = app.arguments();
     QMap<QString, QString> parsedArgs;
     {
         QList<QString>::iterator i = arguments.begin();
-        while(i != arguments.end()) {
+        while(i != arguments.end())
+        {
             QString arg = *i;
 
             QRegExp opt("--(\\S+)=(.+)");
-            if(opt.exactMatch(arg)) {
+            if(opt.exactMatch(arg))
+            {
                 parsedArgs[opt.cap(1)] = opt.cap(2);
                 i = arguments.erase(i);
-            } else {
-              ++i;
+            }
+            else
+            {
+                ++i;
             }
         }
     }
 
-    if(parsedArgs.contains("data-dir")) {
+    if(parsedArgs.contains("data-dir"))
+    {
         QFileInfo f(parsedArgs["data-dir"]);
-        if(!f.exists()) {
+        if(!f.exists())
+        {
             qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath();
         }
         *cDataDir = f.absoluteFilePath();
         custom_data = true;
     }
 
-    if(parsedArgs.contains("config-dir")) {
+    if(parsedArgs.contains("config-dir"))
+    {
         QFileInfo f(parsedArgs["config-dir"]);
         *cConfigDir = f.absoluteFilePath();
         custom_config = true;
@@ -98,6 +155,8 @@ int main(int argc, char *argv[]) {
 
     Q_INIT_RESOURCE(hedgewars);
 
+    qRegisterMetaType<HWTeam>("HWTeam");
+
     bindir->cd("bin"); // workaround over NSIS installer
 
     if(cConfigDir->length() == 0)
@@ -140,78 +199,26 @@ int main(int argc, char *argv[]) {
         checkForDir(cfgdir->absolutePath() + "/Screenshots");
         checkForDir(cfgdir->absolutePath() + "/Teams");
         checkForDir(cfgdir->absolutePath() + "/Logs");
+        checkForDir(cfgdir->absolutePath() + "/Videos");
+        checkForDir(cfgdir->absolutePath() + "/VideoTemp");
     }
 
     datadir->cd(bindir->absolutePath());
     datadir->cd(*cDataDir);
-    if(!datadir->cd("hedgewars/Data")) {
-        QMessageBox::critical(0, QMessageBox::tr("Error"),
-            QMessageBox::tr("Failed to open data directory:\n%1\n"
-                    "Please check your installation").
-                    arg(datadir->absolutePath()+"/hedgewars/Data"));
-        return 1;
-    }
-
-    HWDataManager & dataMgr = HWDataManager::instance();
-
+    if(!datadir->cd("hedgewars/Data"))
     {
-        QStringList themes;
-
-        themes.append(dataMgr.entryList(
-                         "Themes",
-                         QDir::AllDirs | QDir::NoDotAndDotDot)
-                     );
-
-        QList<QPair<QIcon, QIcon> > icons;
-
-        themes.sort();
-        for(int i = themes.size() - 1; i >= 0; --i)
-        {
-            QString file = dataMgr.findFileForRead(
-                QString("Themes/%1/icon.png").arg(themes.at(i))
-            );
-
-            if(QFile::exists(file))
-            { // load icon
-                QPair<QIcon, QIcon> ic;
-                ic.first = QIcon(file);
-
-                // load preview icon
-                ic.second = QIcon(
-                    dataMgr.findFileForRead(
-                        QString("Themes/%1/icon at 2x.png").arg(themes.at(i))
-                    )
-                );
-
-                icons.prepend(ic);
-            }
-            else
-            {
-                themes.removeAt(i);
-            }
-        }
-
-        themesModel = new ThemesModel(themes);
-        Q_ASSERT(themes.size() == icons.size());
-        for(int i = 0; i < icons.size(); ++i)
-        {
-            themesModel->setData(themesModel->index(i), icons[i].first, Qt::DecorationRole);
-            themesModel->setData(themesModel->index(i), icons[i].second, Qt::UserRole);
-        }
+        QMessageBox missingMsg(QApplication::activeWindow());
+        missingMsg.setIcon(QMessageBox::Critical);
+        missingMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
+        missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n"
+                                           "Please check your installation!").
+                                            arg(datadir->absolutePath()+"/hedgewars/Data"));
+        missingMsg.setWindowModality(Qt::WindowModal);
+        missingMsg.exec();
+        return 1;
     }
 
-    mapList = new QStringList(dataMgr.entryList(
-                                 QString("Maps"),
-                                 QDir::Dirs | QDir::NoDotAndDotDot
-                                 )
-                             );
- 
-    scriptList = new QStringList(dataMgr.entryList(
-                                     QString("Scripts/Multiplayer"),
-                                     QDir::Files,
-                                     QStringList("*.lua")
-                                     )
-                                 );
+    DataManager & dataMgr = DataManager::instance();
 
     QTranslator Translator;
     {
@@ -244,24 +251,37 @@ int main(int argc, char *argv[]) {
 #endif
 
     QString style = "";
+    QString fname;
+
+    checkSeason();
+    //For each season, there is an extra stylesheet
+    //Todo: change background for easter and birthday
+    //(simply replace res/BackgroundBirthday.png and res/BackgroundEaster.png
+    //with an appropriate background
+    switch (season)
+    {
+        case SEASON_CHRISTMAS :
+            fname = "christmas.css";
+            break;
+        case SEASON_EASTER :
+            fname = "easter.css";
+            break;
+        case SEASON_HWBDAY :
+            fname = "birthday.css";
+            break;
+        default :
+            fname = "qt.css";
+    }
 
     // load external stylesheet if there is any
-    QFile extFile(dataMgr.findFileForRead("css/qt.css"));
+    QFile extFile(dataMgr.findFileForRead("css/" + fname));
 
-    QFile resFile(":/res/css/qt.css");
+    QFile resFile(":/res/css/" + fname);
 
-    QFile & file = (extFile.exists()?extFile:resFile);
+    QFile & file = (extFile.exists() ? extFile : resFile);
 
     if (file.open(QIODevice::ReadOnly | QIODevice::Text))
-    {
-        QTextStream in(&file);
-        while (!in.atEnd())
-        {
-            QString line = in.readLine();
-            if(!line.isEmpty())
-                style.append(line);
-        }
-    }
+        style.append(file.readAll());
 
     app.form = new HWForm(NULL, style);
     app.form->show();
diff --git a/QTfrontend/main.cpp.orig b/QTfrontend/main.cpp.orig
new file mode 100644
index 0000000..67437cf
--- /dev/null
+++ b/QTfrontend/main.cpp.orig
@@ -0,0 +1,289 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include "HWApplication.h"
+
+#include <QTranslator>
+#include <QLocale>
+#include <QMessageBox>
+#include <QPlastiqueStyle>
+#include <QRegExp>
+#include <QMap>
+#include <QSettings>
+#include <QStringListModel>
+#include <QDate>
+
+#include "hwform.h"
+#include "hwconsts.h"
+#include "newnetclient.h"
+
+#include "DataManager.h"
+
+#ifdef _WIN32
+#include <Shlobj.h>
+#endif
+#ifdef __APPLE__
+#include "CocoaInitializer.h"
+#endif
+
+
+//Determines the day of easter in year
+//from http://aa.usno.navy.mil/faq/docs/easter.php,adapted to C/C++
+QDate calculateEaster(long year)
+{
+    int c, n, k, i, j, l, m, d;
+
+    c = year/100;
+    n = year - 19*(year/19);
+    k = (c - 17)/25;
+    i = c - c/4 - (c - k)/3 + 19*n + 15;
+    i = i - 30*(i/30);
+    i = i - (i/28)*(1 - (i/28)*(29/(i + 1))*((21 - n)/11));
+    j = year + year/4 + i + 2 - c + c/4;
+    j = j - 7*(j/7);
+    l = i - j;
+    m = 3 + (l + 40)/44;
+    d = l + 28 - 31*(m / 4);
+
+    return QDate(year, m, d);
+}
+
+//Checks season and assigns it to the variable season in "hwconsts.h"
+void checkSeason()
+{
+    QDate date = QDate::currentDate();
+
+    //Christmas?
+    if (date.month() == 12 && date.day() >= 24
+            && date.day() <= 26)
+        season = SEASON_CHRISTMAS;
+    //Hedgewars birthday?
+    else if (date.month() == 10 && date.day() == 31)
+    {
+        season = SEASON_HWBDAY;
+        years_since_foundation = date.year() - 2004;
+    }
+    //Easter?
+    else if (calculateEaster(date.year()) == date)
+        season = SEASON_EASTER;
+    else
+        season = SEASON_NONE;
+}
+
+bool checkForDir(const QString & dir)
+{
+    QDir tmpdir;
+    if (!tmpdir.exists(dir))
+        if (!tmpdir.mkdir(dir))
+        {
+            QMessageBox directoryMsg(QApplication::activeWindow());
+            directoryMsg.setIcon(QMessageBox::Warning);
+            directoryMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
+            directoryMsg.setText(QMessageBox::tr("Cannot create directory %1").arg(dir));
+            directoryMsg.setWindowModality(Qt::WindowModal);
+            directoryMsg.exec();
+            return false;
+        }
+    return true;
+}
+
+int main(int argc, char *argv[])
+{
+    HWApplication app(argc, argv);
+
+    app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
+
+    QStringList arguments = app.arguments();
+    QMap<QString, QString> parsedArgs;
+    {
+        QList<QString>::iterator i = arguments.begin();
+        while(i != arguments.end())
+        {
+            QString arg = *i;
+
+            QRegExp opt("--(\\S+)=(.+)");
+            if(opt.exactMatch(arg))
+            {
+                parsedArgs[opt.cap(1)] = opt.cap(2);
+                i = arguments.erase(i);
+            }
+            else
+            {
+                ++i;
+            }
+        }
+    }
+
+    if(parsedArgs.contains("data-dir"))
+    {
+        QFileInfo f(parsedArgs["data-dir"]);
+        if(!f.exists())
+        {
+            qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath();
+        }
+        *cDataDir = f.absoluteFilePath();
+        custom_data = true;
+    }
+
+    if(parsedArgs.contains("config-dir"))
+    {
+        QFileInfo f(parsedArgs["config-dir"]);
+        *cConfigDir = f.absoluteFilePath();
+        custom_config = true;
+    }
+
+    app.setStyle(new QPlastiqueStyle);
+
+    QDateTime now = QDateTime::currentDateTime();
+    srand(now.toTime_t());
+    rand();
+
+    Q_INIT_RESOURCE(hedgewars);
+
+    qRegisterMetaType<HWTeam>("HWTeam");
+
+    bindir->cd("bin"); // workaround over NSIS installer
+
+    if(cConfigDir->length() == 0)
+        cfgdir->setPath(cfgdir->homePath());
+    else
+        cfgdir->setPath(*cConfigDir);
+
+    if(cConfigDir->length() == 0)
+    {
+#ifdef __APPLE__
+        checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
+        cfgdir->cd("Library/Application Support/Hedgewars");
+#elif defined _WIN32
+        char path[1024];
+        if(!SHGetFolderPathA(0, CSIDL_PERSONAL, NULL, 0, path))
+        {
+            cfgdir->cd(path);
+            checkForDir(cfgdir->absolutePath() + "/Hedgewars");
+            cfgdir->cd("Hedgewars");
+        }
+        else // couldn't retrieve documents folder? almost impossible, but in case fall back to classic path
+        {
+            checkForDir(cfgdir->absolutePath() + "/.hedgewars_0.9.18");
+            cfgdir->cd(".hedgewars");
+        }
+#else
+        checkForDir(cfgdir->absolutePath() + "/.hedgewars_0.9.18");
+        cfgdir->cd(".hedgewars_0.9.18");
+#endif
+    }
+
+    if (checkForDir(cfgdir->absolutePath()))
+    {
+        // alternative loading/lookup paths
+        checkForDir(cfgdir->absolutePath() + "/Data");
+
+        // config/save paths
+        checkForDir(cfgdir->absolutePath() + "/Demos");
+        checkForDir(cfgdir->absolutePath() + "/Saves");
+        checkForDir(cfgdir->absolutePath() + "/Screenshots");
+        checkForDir(cfgdir->absolutePath() + "/Teams");
+        checkForDir(cfgdir->absolutePath() + "/Logs");
+        checkForDir(cfgdir->absolutePath() + "/Videos");
+        checkForDir(cfgdir->absolutePath() + "/VideoTemp");
+    }
+
+    datadir->cd(bindir->absolutePath());
+    datadir->cd(*cDataDir);
+    if(!datadir->cd("hedgewars/Data"))
+    {
+        QMessageBox missingMsg(QApplication::activeWindow());
+        missingMsg.setIcon(QMessageBox::Critical);
+        missingMsg.setWindowTitle(QMessageBox::tr("Main - Error"));
+        missingMsg.setText(QMessageBox::tr("Failed to open data directory:\n%1\n\n"
+                                           "Please check your installation!").
+                                            arg(datadir->absolutePath()+"/hedgewars/Data"));
+        missingMsg.setWindowModality(Qt::WindowModal);
+        missingMsg.exec();
+        return 1;
+    }
+
+    DataManager & dataMgr = DataManager::instance();
+
+    QTranslator Translator;
+    {
+        QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
+        QString cc = settings.value("misc/locale", QString()).toString();
+        if(cc.isEmpty())
+            cc = QLocale::system().name();
+
+        // load locale file into translator
+        Translator.load(
+            dataMgr.findFileForRead(
+                QString("Locale/hedgewars_" + cc)
+            )
+        );
+        app.installTranslator(&Translator);
+    }
+
+#ifdef _WIN32
+    // Win32 registry setup (used for xfire detection etc. - don't set it if we're running in "portable" mode with a custom config dir)
+    if(!custom_config)
+    {
+        QSettings registry_hklm("HKEY_LOCAL_MACHINE", QSettings::NativeFormat);
+        registry_hklm.setValue("Software/Hedgewars/Frontend", bindir->absolutePath().replace("/", "\\") + "\\hedgewars.exe");
+        registry_hklm.setValue("Software/Hedgewars/Path", bindir->absolutePath().replace("/", "\\"));
+    }
+#endif
+#ifdef __APPLE__
+    // this creates the autoreleasepool that prevents leaking
+    CocoaInitializer initializer;
+#endif
+
+    QString style = "";
+    QString fname;
+
+    checkSeason();
+    //For each season, there is an extra stylesheet
+    //Todo: change background for easter and birthday
+    //(simply replace res/BackgroundBirthday.png and res/BackgroundEaster.png
+    //with an appropriate background
+    switch (season)
+    {
+        case SEASON_CHRISTMAS :
+            fname = "christmas.css";
+            break;
+        case SEASON_EASTER :
+            fname = "easter.css";
+            break;
+        case SEASON_HWBDAY :
+            fname = "birthday.css";
+            break;
+        default :
+            fname = "qt.css";
+    }
+
+    // load external stylesheet if there is any
+    QFile extFile(dataMgr.findFileForRead("css/" + fname));
+
+    QFile resFile(":/res/css/" + fname);
+
+    QFile & file = (extFile.exists() ? extFile : resFile);
+
+    if (file.open(QIODevice::ReadOnly | QIODevice::Text))
+        style.append(file.readAll());
+
+    app.form = new HWForm(NULL, style);
+    app.form->show();
+    return app.exec();
+}
diff --git a/QTfrontend/model/GameStyleModel.cpp b/QTfrontend/model/GameStyleModel.cpp
new file mode 100644
index 0000000..846208b
--- /dev/null
+++ b/QTfrontend/model/GameStyleModel.cpp
@@ -0,0 +1,98 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief GameStyleModel class implementation
+ */
+
+#include <QTextStream>
+
+#include "GameStyleModel.h"
+
+
+void GameStyleModel::loadGameStyles()
+{
+    beginResetModel();
+
+
+    // empty list, so that we can (re)fill it
+    QStandardItemModel::clear();
+
+    QList<QStandardItem * > items;
+    items.append(new QStandardItem("Normal"));
+
+    // define a separator item
+    QStandardItem * separator = new QStandardItem("---");
+    separator->setData(QLatin1String("separator"), Qt::AccessibleDescriptionRole);
+    separator->setFlags(separator->flags() & ~( Qt::ItemIsEnabled | Qt::ItemIsSelectable ) );
+
+    items.append(separator);
+
+
+    QStringList scripts = DataManager::instance().entryList(
+                             QString("Scripts/Multiplayer"),
+                             QDir::Files,
+                             QStringList("*.lua")
+                         );
+
+    foreach(QString script, scripts)
+    {
+        script = script.remove(".lua", Qt::CaseInsensitive);
+
+        QFile scriptCfgFile(DataManager::instance().findFileForRead(
+                            QString("Scripts/Multiplayer/%2.cfg").arg(script)));
+
+        QString name = script;
+        name = name.replace("_", " ");
+
+        QString scheme = "locked";
+        QString weapons = "locked";
+
+        if (scriptCfgFile.exists() && scriptCfgFile.open(QFile::ReadOnly))
+        {
+            QTextStream input(&scriptCfgFile);
+            input >> scheme;
+            input >> weapons;
+            scriptCfgFile.close();
+
+            if (!scheme.isEmpty())
+                scheme.replace("_", " ");
+
+            if (!weapons.isEmpty())
+                weapons.replace("_", " ");
+        }
+
+        QStandardItem * item = new QStandardItem(name);
+
+        item->setData(script, ScriptRole);
+        item->setData(scheme, SchemeRole);
+        item->setData(weapons, WeaponsRole);
+
+        items.append(item);
+    }
+
+    QStandardItemModel::appendColumn(items);
+
+
+    endResetModel();
+}
+
+
+
+
diff --git a/QTfrontend/model/GameStyleModel.h b/QTfrontend/model/GameStyleModel.h
new file mode 100644
index 0000000..af0e13d
--- /dev/null
+++ b/QTfrontend/model/GameStyleModel.h
@@ -0,0 +1,48 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief GameStyleModel class definition
+ */
+
+#ifndef HEDGEWARS_GAMESTYLEMODEL_H
+#define HEDGEWARS_GAMESTYLEMODEL_H
+
+#include <QStandardItemModel>
+#include <QStringList>
+#include <QMap>
+
+#include "DataManager.h"
+
+/**
+ * @brief A model listing available game styles
+ */
+class GameStyleModel : public QStandardItemModel
+{
+        Q_OBJECT
+
+    public:
+        enum DataRoles { ScriptRole = Qt::UserRole+1, SchemeRole, WeaponsRole };
+
+    public slots:
+        /// reloads the themes from the DataManager
+        void loadGameStyles();
+};
+
+#endif // HEDGEWARS_GAMESTYLEMODEL_H
diff --git a/QTfrontend/model/HatModel.cpp b/QTfrontend/model/HatModel.cpp
new file mode 100644
index 0000000..781a4cd
--- /dev/null
+++ b/QTfrontend/model/HatModel.cpp
@@ -0,0 +1,148 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief HatModel class implementation
+ */
+
+#include "HatModel.h"
+
+#include <QDir>
+#include <QPixmap>
+#include <QPainter>
+#include "hwform.h" // player hash
+
+#include "DataManager.h"
+
+HatModel::HatModel(QObject* parent) :
+    QAbstractListModel(parent)
+{
+    hats = QVector<QPair<QString, QIcon> >();
+}
+
+void HatModel::loadHats()
+{
+    // this method resets the contents of this model (important to know for views).
+    beginResetModel();
+
+    // prepare hats Vector
+    hats.clear();
+
+    DataManager & dataMgr = DataManager::instance();
+
+    QPixmap hhpix = QPixmap(
+                        dataMgr.findFileForRead("Graphics/Hedgehog/Idle.png")
+                    ).copy(0, 0, 32, 32);
+
+    // my reserved hats
+    QStringList hatsList = dataMgr.entryList(
+                               "Graphics/Hats/Reserved",
+                               QDir::Files,
+                               QStringList(playerHash+"*.png")
+                           );
+
+    int nReserved = hatsList.size();
+
+    // regular hats
+    hatsList.append(dataMgr.entryList(
+                        "Graphics/Hats",
+                        QDir::Files,
+                        QStringList("*.png")
+                    )
+                   );
+
+
+    int nHats = hatsList.size();
+
+    for (int i = 0; i < nHats; i++)
+    {
+        bool isReserved = (i < nReserved);
+
+        QString str = hatsList.at(i);
+        str = str.remove(QRegExp("\\.png$"));
+        QPixmap pix(
+            dataMgr.findFileForRead(
+                "Graphics/Hats/" + QString(isReserved?"Reserved/":"") + str +
+                ".png"
+            )
+        );
+
+        // rename properly
+        if (isReserved)
+            str = "Reserved "+str.remove(0,32);
+
+        QPixmap tmppix(32, 37);
+        tmppix.fill(QColor(Qt::transparent));
+
+        QPainter painter(&tmppix);
+        painter.drawPixmap(QPoint(0, 5), hhpix);
+        painter.drawPixmap(QPoint(0, 0), pix.copy(0, 0, 32, 32));
+        if(pix.width() > 32)
+            painter.drawPixmap(QPoint(0, 0), pix.copy(32, 0, 32, 32));
+        painter.end();
+
+        if (str == "NoHat")
+            hats.prepend(qMakePair(str, QIcon(tmppix)));
+        else
+            hats.append(qMakePair(str, QIcon(tmppix)));
+    }
+
+
+    endResetModel();
+}
+
+QVariant HatModel::headerData(int section,
+                               Qt::Orientation orientation, int role) const
+{
+    Q_UNUSED(section);
+    Q_UNUSED(orientation);
+    Q_UNUSED(role);
+
+    return QVariant();
+}
+
+int HatModel::rowCount(const QModelIndex &parent) const
+{
+    if (parent.isValid())
+        return 0;
+    else
+        return hats.size();
+}
+
+/*int HatModel::columnCount(const QModelIndex & parent) const
+{
+    if (parent.isValid())
+        return 0;
+    else
+        return 2;
+}
+*/
+QVariant HatModel::data(const QModelIndex &index,
+                         int role) const
+{
+    if (!index.isValid() || index.row() < 0
+            || index.row() >= hats.size()
+            || (role != Qt::DisplayRole && role != Qt::DecorationRole))
+        return QVariant();
+
+    if (role == Qt::DisplayRole)
+        return hats.at(index.row()).first;
+    else // role == Qt::DecorationRole
+        return hats.at(index.row()).second;
+}
diff --git a/QTfrontend/model/HatModel.h b/QTfrontend/model/HatModel.h
new file mode 100644
index 0000000..e97977c
--- /dev/null
+++ b/QTfrontend/model/HatModel.h
@@ -0,0 +1,53 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief HatModel class definition
+ */
+
+#ifndef HEDGEWARS_HATMODEL_H
+#define HEDGEWARS_HATMODEL_H
+
+#include <QAbstractListModel>
+#include <QStringList>
+#include <QVector>
+#include <QPair>
+#include <QIcon>
+
+class HatModel : public QAbstractListModel
+{
+        Q_OBJECT
+
+    public:
+        HatModel(QObject *parent = 0);
+
+        QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+        int rowCount(const QModelIndex & parent) const;
+        //int columnCount(const QModelIndex & parent) const;
+
+    public slots:
+        /// Reloads hats using the DataManager.
+        void loadHats();
+
+        QVariant data(const QModelIndex &index, int role) const;
+    protected:
+        QVector<QPair<QString, QIcon> > hats;
+};
+
+#endif // HEDGEWARS_HATMODEL_H
diff --git a/QTfrontend/model/MapModel.cpp b/QTfrontend/model/MapModel.cpp
new file mode 100644
index 0000000..76a38e8
--- /dev/null
+++ b/QTfrontend/model/MapModel.cpp
@@ -0,0 +1,238 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief MapModel class implementation
+ */
+
+#include "MapModel.h"
+
+
+void MapModel::loadMaps()
+{
+    // this method resets the contents of this model (important to know for views).
+    beginResetModel();
+
+    // we'll need the DataManager a few times, so let's get a reference to it
+    DataManager & datamgr = DataManager::instance();
+
+    // fetch list of available maps
+    QStringList maps =
+        datamgr.entryList("Maps", QDir::AllDirs | QDir::NoDotAndDotDot);
+
+    // empty list, so that we can (re)fill it
+    QStandardItemModel::clear();
+
+    QList<QStandardItem *> genMaps;
+    QList<QStandardItem *> missionMaps;
+    QList<QStandardItem *> staticMaps;
+
+    // add generated/handdrawn maps to list
+    // TODO: icons for these
+
+    genMaps.append(
+        infoToItem(QIcon(), QComboBox::tr("generated map..."), GeneratedMap, "+rnd+"));
+    genMaps.append(
+        infoToItem(QIcon(), QComboBox::tr("generated maze..."), GeneratedMaze, "+maze+"));
+    genMaps.append(
+        infoToItem(QIcon(), QComboBox::tr("hand drawn map..."), HandDrawnMap, "+drawn+"));
+
+    // only 2 map relate files are relevant:
+    // - the cfg file that contains the settings/info of the map
+    // - the lua file - if it exists it's a mission, otherwise it isn't
+    QFile mapLuaFile;
+    QFile mapCfgFile;
+
+    // add mission/static maps to lists
+    foreach (QString map, maps)
+    {
+        mapCfgFile.setFileName(
+            datamgr.findFileForRead(QString("Maps/%1/map.cfg").arg(map)));
+        mapLuaFile.setFileName(
+            datamgr.findFileForRead(QString("Maps/%1/map.lua").arg(map)));
+
+
+        if (mapCfgFile.open(QFile::ReadOnly))
+        {
+            QString caption;
+            QString theme;
+            quint32 limit = 0;
+            QString scheme;
+            QString weapons;
+            // if there is a lua file for this map, then it's a mission
+            bool isMission = mapLuaFile.exists();
+            MapType type = isMission?MissionMap:StaticMap;
+
+            // load map info from file
+            QTextStream input(&mapCfgFile);
+            input >> theme;
+            input >> limit;
+            if (isMission) { // scheme and weapons are only relevant for missions
+                input >> scheme;
+                input >> weapons;
+            }
+            mapCfgFile.close();
+
+            // let's use some semi-sane hedgehog limit, rather than none
+            if (limit == 0)
+                limit = 18;
+
+
+            // the default scheme/weaponset for missions.
+            // if empty we assume the map sets these internally -> locked
+            if (isMission)
+            {
+                if (scheme.isEmpty())
+                    scheme = "locked";
+                else
+                    scheme.replace("_", " ");
+
+                if (weapons.isEmpty())
+                    weapons = "locked";
+                else
+                    weapons.replace("_", " ");
+            }
+
+            // add a mission caption prefix to missions
+            if (isMission)
+            {
+                // TODO: icon
+                caption = QComboBox::tr("Mission") + ": " + map;
+            }
+            else
+                caption = map;
+
+            // we know everything there is about the map, let's get am item for it
+            QStandardItem * item = infoToItem(
+                QIcon(), caption, type, map, theme, limit, scheme, weapons);
+
+            // append item to the list
+            if (isMission)
+                missionMaps.append(item);
+            else
+                staticMaps.append(item);
+        
+        }
+
+    }
+
+
+    // define a separator item
+    QStandardItem separator("---");
+    separator.setData(QLatin1String("separator"), Qt::AccessibleDescriptionRole);
+    separator.setFlags(separator.flags() & ~( Qt::ItemIsEnabled | Qt::ItemIsSelectable ) );
+
+    // create list:
+    // generated+handdrawn maps, 2 saperators, missions, 1 separator, static maps
+    QList<QStandardItem * > items;
+    items.append(genMaps);
+    items.append(separator.clone());
+    items.append(separator.clone());
+    items.append(missionMaps);
+    items.append(separator.clone());
+    items.append(staticMaps);
+
+
+    // create row-index lookup table
+
+    m_mapIndexes.clear();
+
+    int count = items.size();
+
+    for (int i = 0; i < count; i++)
+    {
+        QStandardItem * si = items.at(i);
+        QVariant v = si->data(Qt::UserRole + 1);
+        if (v.canConvert<MapInfo>())
+            m_mapIndexes.insert(v.value<MapInfo>().name, i);
+    }
+
+
+    // store start-index and count of relevant types
+
+    m_typeLoc.insert(GeneratedMap, QPair<int,int>(0, 1));
+    m_typeLoc.insert(GeneratedMaze, QPair<int,int>(1, 1));
+    m_typeLoc.insert(HandDrawnMap, QPair<int,int>(2, 1));
+    // mission maps
+    int startIdx = genMaps.size() + 2; // start after genMaps and 2 separators
+    count = missionMaps.size();
+    m_typeLoc.insert(MissionMap, QPair<int,int>(startIdx, count));
+    // static maps
+    startIdx += count + 1; // start after missions and 2 separators
+    count = staticMaps.size();
+    m_typeLoc.insert(StaticMap, QPair<int,int>(startIdx, count));
+
+    // store list contents in the item model
+    QStandardItemModel::appendColumn(items);
+
+
+    endResetModel();
+}
+
+
+int MapModel::randomMap(MapType type) const
+{
+    // return a random index for this type or -1 if none available
+    QPair<int,int> loc = m_typeLoc.value(type, QPair<int,int>(-1,0));
+
+    int startIdx = loc.first;
+    int count = loc.second;
+
+    if (count < 1)
+        return -1;
+    else
+        return startIdx + (rand() % count);
+}
+
+
+QStandardItem * MapModel::infoToItem(
+    const QIcon & icon,
+    const QString caption,
+    MapType type,
+    QString name,
+    QString theme,
+    quint32 limit,
+    QString scheme,
+    QString weapons)
+const
+{
+    QStandardItem * item = new QStandardItem(icon, caption);
+    MapInfo mapInfo;
+    QVariant qvar(QVariant::UserType);
+
+    mapInfo.type = type;
+    mapInfo.name = name;
+    mapInfo.theme = theme;
+    mapInfo.limit = limit;
+    mapInfo.scheme = scheme;
+    mapInfo.weapons = weapons;
+
+
+    qvar.setValue(mapInfo);
+    item->setData(qvar, Qt::UserRole + 1);
+
+    return item;
+}
+
+
+int MapModel::indexOf(const QString & map) const
+{
+    return m_mapIndexes.value(map, -1);
+}
+
diff --git a/QTfrontend/model/MapModel.h b/QTfrontend/model/MapModel.h
new file mode 100644
index 0000000..70d0025
--- /dev/null
+++ b/QTfrontend/model/MapModel.h
@@ -0,0 +1,120 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief MapModel class definition
+ */
+
+#ifndef HEDGEWARS_MAPMODEL_H
+#define HEDGEWARS_MAPMODEL_H
+
+#include <QStandardItemModel>
+#include <QStringList>
+#include <QTextStream>
+#include <QHash>
+#include <QMap>
+#include <QIcon>
+#include <QComboBox>
+
+#include "DataManager.h"
+
+/**
+ * @brief A model that vertically lists available maps
+ *
+ * @author sheepluva
+ * @since 0.9.18
+ */
+class MapModel : public QStandardItemModel
+{
+        Q_OBJECT
+
+    public:
+        enum MapType {
+            Invalid,
+            GeneratedMap,
+            GeneratedMaze,
+            HandDrawnMap,
+            MissionMap,
+            StaticMap
+        };
+
+        /// a struct for holding the attributes of a map.
+        struct MapInfo
+        {
+            MapType type; ///< The map-type
+            QString name; ///< The internal name.
+            QString theme; ///< The theme to be used. (can be empty)
+            quint32 limit; ///< The maximum allowed number of hedgehogs.
+            QString scheme; ///< Default scheme name or "locked", for mission-maps.
+            QString weapons; ///< Default weaponset name or "locked", for missions-maps.
+        };
+
+        /**
+         * @brief Returns the row-index of the given map.
+         * @param map map of which to get the row-index of.
+         * @return row-index of map or -1 if not available.
+         */
+        int indexOf(const QString & map) const;
+
+        /**
+         * @brief Returns the row-index of a random map with a specified type.
+         * @param type desired type of map.
+         * @return row-index of a map with the desired type, -1 if none found.
+         */
+        int randomMap(MapType type) const;
+
+    public slots:
+        /// Reloads the maps using the DataManager.
+        void loadMaps();
+
+
+    private:
+        /// start-index and map count for each map-type.
+        QMap<MapType, QPair<int,int> > m_typeLoc;
+
+        /// map index lookup table
+        QHash<QString, int> m_mapIndexes;
+
+        /**
+         * @brief Creates a QStandardItem, that holds the map info and item appearance.
+         * The used role for the data is Qt::UserRole + 1.
+         * @param icon the icon to be displayed (can be an empty QIcon()).
+         * @param caption the text to be displayed.
+         * @param type the type of the map.
+         * @param name the internal name of the map.
+         * @param theme the theme of the map (or empty if none).
+         * @param limit the hedgehog limit of the map.
+         * @param scheme mission map: default scheme name or "locked".
+         * @param weapons mission map: default weaponset name or "locked".
+         * @return pointer to item representing the map info: at Qt::UserRole + 1.
+         */
+        QStandardItem * infoToItem(
+            const QIcon & icon,
+            const QString caption,
+            MapType type = Invalid,
+            QString name = "",
+            QString theme = "",
+            quint32 limit = 0,
+            QString scheme = "",
+            QString weapons = "") const;
+};
+
+Q_DECLARE_METATYPE(MapModel::MapInfo)
+
+#endif // HEDGEWARS_MAPMODEL_H
diff --git a/QTfrontend/model/ThemeModel.cpp b/QTfrontend/model/ThemeModel.cpp
new file mode 100644
index 0000000..6a1829c
--- /dev/null
+++ b/QTfrontend/model/ThemeModel.cpp
@@ -0,0 +1,97 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief ThemeModel class implementation
+ */
+
+#include "ThemeModel.h"
+
+ThemeModel::ThemeModel(QObject *parent) :
+    QAbstractListModel(parent)
+{
+    m_data = QList<QMap<int, QVariant> >();
+}
+
+int ThemeModel::rowCount(const QModelIndex &parent) const
+{
+    if(parent.isValid())
+        return 0;
+    else
+        return m_data.size();
+}
+
+
+QVariant ThemeModel::data(const QModelIndex &index, int role) const
+{
+    if(index.column() > 0 || index.row() >= m_data.size())
+        return QVariant();
+    else
+        return m_data.at(index.row()).value(role);
+}
+
+
+void ThemeModel::loadThemes()
+{
+    beginResetModel();
+
+
+    DataManager & datamgr = DataManager::instance();
+
+    QStringList themes =
+        datamgr.entryList("Themes", QDir::AllDirs | QDir::NoDotAndDotDot);
+
+    m_data.clear();
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+    m_data.reserve(themes.size());
+#endif
+
+    foreach (QString theme, themes)
+    {
+        // themes without icon are supposed to be hidden
+        QString iconpath =
+            datamgr.findFileForRead(QString("Themes/%1/icon.png").arg(theme));
+
+        if (!QFile::exists(iconpath))
+            continue;
+
+        QMap<int, QVariant> dataset;
+
+        // set name
+        dataset.insert(Qt::DisplayRole, theme);
+
+        // load and set icon
+        QIcon icon(iconpath);
+        dataset.insert(Qt::DecorationRole, icon);
+
+        // load and set preview icon
+        QIcon preview(datamgr.findFileForRead(QString("Themes/%1/icon at 2x.png").arg(theme)));
+        dataset.insert(Qt::UserRole, preview);
+
+        m_data.append(dataset);
+    }
+
+
+    endResetModel();
+}
+
+
+
+
diff --git a/QTfrontend/model/ThemeModel.h b/QTfrontend/model/ThemeModel.h
new file mode 100644
index 0000000..9db8d9f
--- /dev/null
+++ b/QTfrontend/model/ThemeModel.h
@@ -0,0 +1,57 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief ThemeModel class definition
+ */
+
+#ifndef HEDGEWARS_THEMEMODEL_H
+#define HEDGEWARS_THEMEMODEL_H
+
+#include <QAbstractListModel>
+#include <QStringList>
+#include <QMap>
+#include <QIcon>
+
+#include "DataManager.h"
+
+/**
+ * @brief A model listing available themes
+ */
+class ThemeModel : public QAbstractListModel
+{
+        Q_OBJECT
+
+    public:
+        explicit ThemeModel(QObject *parent = 0);
+
+        int rowCount(const QModelIndex &parent = QModelIndex()) const;
+        QVariant data(const QModelIndex &index, int role) const;
+
+
+    public slots:
+        /// reloads the themes from the DataManager
+        void loadThemes();
+
+
+    private:
+        QList<QMap<int, QVariant> > m_data;
+};
+
+#endif // HEDGEWARS_THEMEMODEL_H
diff --git a/QTfrontend/model/ammoSchemeModel.cpp b/QTfrontend/model/ammoSchemeModel.cpp
index 45740a1..a0f2536 100644
--- a/QTfrontend/model/ammoSchemeModel.cpp
+++ b/QTfrontend/model/ammoSchemeModel.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,562 +23,562 @@
 #include "hwconsts.h"
 
 QList<QVariant> defaultScheme = QList<QVariant>()
-        << QVariant("Default")     // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(45)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(4)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(2)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+                                << QVariant("Default")     // name           0
+                                << QVariant(false)         // fortsmode      1
+                                << QVariant(false)         // team divide    2
+                                << QVariant(false)         // solid land     3
+                                << QVariant(false)         // border         4
+                                << QVariant(false)         // low gravity    5
+                                << QVariant(false)         // laser sight    6
+                                << QVariant(false)         // invulnerable   7
+                                << QVariant(false)         // reset health   8
+                                << QVariant(false)         // vampiric       9
+                                << QVariant(false)         // karma          10
+                                << QVariant(false)         // artillery      11
+                                << QVariant(true)          // random order   12
+                                << QVariant(false)         // king           13
+                                << QVariant(false)         // place hog      14
+                                << QVariant(false)         // shared ammo    15
+                                << QVariant(false)         // disable girders 16
+                                << QVariant(false)         // disable land objects 17
+                                << QVariant(false)         // AI survival    18
+                                << QVariant(false)         // inf. attack    19
+                                << QVariant(false)         // reset weps     20
+                                << QVariant(false)         // per hog ammo   21
+                                << QVariant(false)         // no wind        22
+                                << QVariant(false)         // more wind      23
+                                << QVariant(false)         // tag team       24
+                                << QVariant(false)         // bottom border  25
+                                << QVariant(100)           // damage modfier 26
+                                << QVariant(45)            // turn time      27
+                                << QVariant(100)           // init health    28
+                                << QVariant(15)            // sudden death   29
+                                << QVariant(5)             // case prob      30
+                                << QVariant(3)             // mines time     31
+                                << QVariant(4)             // mines number   32
+                                << QVariant(0)             // mine dud pct   33
+                                << QVariant(2)             // explosives     34
+                                << QVariant(35)            // health case pct 35
+                                << QVariant(25)            // health case amt 36
+                                << QVariant(47)            // water rise amt 37
+                                << QVariant(5)             // health dec amt 38
+                                << QVariant(100)           // rope modfier   39
+                                << QVariant(100)           // get away time  40
+                                ;
 
 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
     QAbstractTableModel(parent),
     fileConfig(fileName, QSettings::IniFormat)
 {
     predefSchemesNames = QStringList()
-        << "Default"
-        << "Pro Mode"
-        << "Shoppa"
-        << "Clean Slate"
-        << "Minefield"
-        << "Barrel Mayhem"
-        << "Tunnel Hogs"
-        << "Fort Mode"
-        << "Timeless"
-        << "Thinking with Portals"
-        << "King Mode"
-        ;
+                         << "Default"
+                         << "Pro Mode"
+                         << "Shoppa"
+                         << "Clean Slate"
+                         << "Minefield"
+                         << "Barrel Mayhem"
+                         << "Tunnel Hogs"
+                         << "Fort Mode"
+                         << "Timeless"
+                         << "Thinking with Portals"
+                         << "King Mode"
+                         ;
 
     numberOfDefaultSchemes = predefSchemesNames.size();
 
     spNames = QStringList()
-        << "name"                //  0
-        << "fortsmode"           //  1
-        << "divteams"            //  2
-        << "solidland"           //  3
-        << "border"              //  4
-        << "lowgrav"             //  5
-        << "laser"               //  6
-        << "invulnerability"     //  7
-        << "resethealth"         //  8
-        << "vampiric"            //  9
-        << "karma"               // 10
-        << "artillery"           // 11
-        << "randomorder"         // 12
-        << "king"                // 13
-        << "placehog"            // 14
-        << "sharedammo"          // 15
-        << "disablegirders"      // 16
-        << "disablelandobjects"  // 17
-        << "aisurvival"          // 18
-        << "infattack"           // 19
-        << "resetweps"           // 20
-        << "perhogammo"          // 21
-        << "disablewind"         // 22
-        << "morewind"            // 23
-        << "tagteam"             // 24
-        << "bottomborder"        // 25
-        << "damagefactor"        // 26
-        << "turntime"            // 27
-        << "health"              // 28
-        << "suddendeath"         // 29
-        << "caseprobability"     // 30
-        << "minestime"           // 31
-        << "minesnum"            // 32
-        << "minedudpct"          // 33
-        << "explosives"          // 34
-        << "healthprobability"   // 35
-        << "healthcaseamount"    // 36
-        << "waterrise"           // 37
-        << "healthdecrease"      // 38
-        << "ropepct"             // 39
-        << "getawaytime"         // 40
-        ;
+              << "name"                //  0
+              << "fortsmode"           //  1
+              << "divteams"            //  2
+              << "solidland"           //  3
+              << "border"              //  4
+              << "lowgrav"             //  5
+              << "laser"               //  6
+              << "invulnerability"     //  7
+              << "resethealth"         //  8
+              << "vampiric"            //  9
+              << "karma"               // 10
+              << "artillery"           // 11
+              << "randomorder"         // 12
+              << "king"                // 13
+              << "placehog"            // 14
+              << "sharedammo"          // 15
+              << "disablegirders"      // 16
+              << "disablelandobjects"  // 17
+              << "aisurvival"          // 18
+              << "infattack"           // 19
+              << "resetweps"           // 20
+              << "perhogammo"          // 21
+              << "disablewind"         // 22
+              << "morewind"            // 23
+              << "tagteam"             // 24
+              << "bottomborder"        // 25
+              << "damagefactor"        // 26
+              << "turntime"            // 27
+              << "health"              // 28
+              << "suddendeath"         // 29
+              << "caseprobability"     // 30
+              << "minestime"           // 31
+              << "minesnum"            // 32
+              << "minedudpct"          // 33
+              << "explosives"          // 34
+              << "healthprobability"   // 35
+              << "healthcaseamount"    // 36
+              << "waterrise"           // 37
+              << "healthdecrease"      // 38
+              << "ropepct"             // 39
+              << "getawaytime"         // 40
+              ;
 
     QList<QVariant> proMode;
     proMode
-        << predefSchemesNames[1]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(true)          // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(15)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(0)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(0)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(2)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[1]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(true)          // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(15)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(0)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(0)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(2)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> shoppa;
     shoppa
-        << predefSchemesNames[2]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(true)          // solid land     3
-        << QVariant(true)          // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(true)          // shared ammo    15
-        << QVariant(true)          // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(true)          // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(30)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(50)            // sudden death   29
-        << QVariant(1)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(0)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(0)             // explosives     34
-        << QVariant(0)             // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[2]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(true)          // solid land     3
+            << QVariant(true)          // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(true)          // shared ammo    15
+            << QVariant(true)          // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(true)          // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(30)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(50)            // sudden death   29
+            << QVariant(1)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(0)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(0)             // explosives     34
+            << QVariant(0)             // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> cleanslate;
     cleanslate
-        << predefSchemesNames[3]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(true)          // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(true)          // inf. attack    19
-        << QVariant(true)          // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(45)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(4)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(2)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[3]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(true)          // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(true)          // inf. attack    19
+            << QVariant(true)          // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(45)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(5)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(4)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(2)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> minefield;
     minefield
-        << predefSchemesNames[4]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(true)          // shared ammo    15
-        << QVariant(true)          // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(30)            // turn time      27
-        << QVariant(50)            // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(0)             // case prob      30
-        << QVariant(0)             // mines time     31
-        << QVariant(80)            // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(0)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[4]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(true)          // shared ammo    15
+            << QVariant(true)          // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(30)            // turn time      27
+            << QVariant(50)            // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(0)             // case prob      30
+            << QVariant(0)             // mines time     31
+            << QVariant(80)            // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(0)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> barrelmayhem;
     barrelmayhem
-        << predefSchemesNames[5]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(true)          // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(30)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(0)             // case prob      30
-        << QVariant(0)             // mines time     31
-        << QVariant(0)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(80)            // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[5]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(true)          // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(30)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(0)             // case prob      30
+            << QVariant(0)             // mines time     31
+            << QVariant(0)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(80)            // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> tunnelhogs;
     tunnelhogs
-        << predefSchemesNames[6]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(true)          // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(true)          // shared ammo    15
-        << QVariant(true)          // disable girders 16
-        << QVariant(true)          // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(30)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(10)            // mines number   32
-        << QVariant(10)            // mine dud pct   33
-        << QVariant(10)            // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[6]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(true)          // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(true)          // shared ammo    15
+            << QVariant(true)          // disable girders 16
+            << QVariant(true)          // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(30)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(5)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(10)            // mines number   32
+            << QVariant(10)            // mine dud pct   33
+            << QVariant(10)            // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> forts;
     forts
-        << predefSchemesNames[7]   // name           0
-        << QVariant(true)          // fortsmode      1
-        << QVariant(true)          // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(true)          // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(45)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(0)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(0)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[7]   // name           0
+            << QVariant(true)          // fortsmode      1
+            << QVariant(true)          // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(true)          // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(45)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(5)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(0)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(0)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> timeless;
     timeless
-        << predefSchemesNames[8]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(true)          // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(9999)          // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(5)             // mines number   32
-        << QVariant(10)            // mine dud pct   33
-        << QVariant(2)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(30)            // health case amt 36
-        << QVariant(0)             // water rise amt 37
-        << QVariant(0)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[8]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(true)          // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(9999)          // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(5)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(5)             // mines number   32
+            << QVariant(10)            // mine dud pct   33
+            << QVariant(2)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(30)            // health case amt 36
+            << QVariant(0)             // water rise amt 37
+            << QVariant(0)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> thinkingportals;
     thinkingportals
-        << predefSchemesNames[9]   // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(true)          // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(false)         // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(45)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(2)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(5)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(5)             // explosives     34
-        << QVariant(25)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[9]   // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(true)          // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(false)         // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(45)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(2)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(5)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(5)             // explosives     34
+            << QVariant(25)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
     QList<QVariant> kingmode;
     kingmode
-        << predefSchemesNames[10]  // name           0
-        << QVariant(false)         // fortsmode      1
-        << QVariant(false)         // team divide    2
-        << QVariant(false)         // solid land     3
-        << QVariant(false)         // border         4
-        << QVariant(false)         // low gravity    5
-        << QVariant(false)         // laser sight    6
-        << QVariant(false)         // invulnerable   7
-        << QVariant(false)         // reset health   8
-        << QVariant(false)         // vampiric       9
-        << QVariant(false)         // karma          10
-        << QVariant(false)         // artillery      11
-        << QVariant(true)          // random order   12
-        << QVariant(true)          // king           13
-        << QVariant(false)         // place hog      14
-        << QVariant(false)         // shared ammo    15
-        << QVariant(false)         // disable girders 16
-        << QVariant(false)         // disable land objects 17
-        << QVariant(false)         // AI survival    18
-        << QVariant(false)         // inf. attack    19
-        << QVariant(false)         // reset weps     20
-        << QVariant(false)         // per hog ammo   21
-        << QVariant(false)         // no wind        22
-        << QVariant(false)         // more wind      23
-        << QVariant(false)         // tag team       24
-        << QVariant(false)         // bottom border  25
-        << QVariant(100)           // damage modfier 26
-        << QVariant(45)            // turn time      27
-        << QVariant(100)           // init health    28
-        << QVariant(15)            // sudden death   29
-        << QVariant(5)             // case prob      30
-        << QVariant(3)             // mines time     31
-        << QVariant(4)             // mines number   32
-        << QVariant(0)             // mine dud pct   33
-        << QVariant(2)             // explosives     34
-        << QVariant(35)            // health case pct 35
-        << QVariant(25)            // health case amt 36
-        << QVariant(47)            // water rise amt 37
-        << QVariant(5)             // health dec amt 38
-        << QVariant(100)           // rope modfier   39
-        << QVariant(100)           // get away time  40
-        ;
+            << predefSchemesNames[10]  // name           0
+            << QVariant(false)         // fortsmode      1
+            << QVariant(false)         // team divide    2
+            << QVariant(false)         // solid land     3
+            << QVariant(false)         // border         4
+            << QVariant(false)         // low gravity    5
+            << QVariant(false)         // laser sight    6
+            << QVariant(false)         // invulnerable   7
+            << QVariant(false)         // reset health   8
+            << QVariant(false)         // vampiric       9
+            << QVariant(false)         // karma          10
+            << QVariant(false)         // artillery      11
+            << QVariant(true)          // random order   12
+            << QVariant(true)          // king           13
+            << QVariant(false)         // place hog      14
+            << QVariant(false)         // shared ammo    15
+            << QVariant(false)         // disable girders 16
+            << QVariant(false)         // disable land objects 17
+            << QVariant(false)         // AI survival    18
+            << QVariant(false)         // inf. attack    19
+            << QVariant(false)         // reset weps     20
+            << QVariant(false)         // per hog ammo   21
+            << QVariant(false)         // no wind        22
+            << QVariant(false)         // more wind      23
+            << QVariant(false)         // tag team       24
+            << QVariant(false)         // bottom border  25
+            << QVariant(100)           // damage modfier 26
+            << QVariant(45)            // turn time      27
+            << QVariant(100)           // init health    28
+            << QVariant(15)            // sudden death   29
+            << QVariant(5)             // case prob      30
+            << QVariant(3)             // mines time     31
+            << QVariant(4)             // mines number   32
+            << QVariant(0)             // mine dud pct   33
+            << QVariant(2)             // explosives     34
+            << QVariant(35)            // health case pct 35
+            << QVariant(25)            // health case amt 36
+            << QVariant(47)            // water rise amt 37
+            << QVariant(5)             // health dec amt 38
+            << QVariant(100)           // rope modfier   39
+            << QVariant(100)           // get away time  40
+            ;
 
 
     schemes.append(defaultScheme);
@@ -595,7 +595,8 @@ AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
 
 
     int size = fileConfig.beginReadArray("schemes");
-    for (int i = 0; i < size; ++i) {
+    for (int i = 0; i < size; ++i)
+    {
         fileConfig.setArrayIndex(i);
 
         if (!predefSchemesNames.contains(fileConfig.value(spNames[0]).toString()))
@@ -649,9 +650,9 @@ Qt::ItemFlags AmmoSchemeModel::flags(const QModelIndex & index) const
 bool AmmoSchemeModel::setData(const QModelIndex & index, const QVariant & value, int role)
 {
     if (!index.isValid() || index.row() < numberOfDefaultSchemes
-        || index.row() >= schemes.size()
-        || index.column() >= defaultScheme.size()
-        || role != Qt::EditRole)
+            || index.row() >= schemes.size()
+            || index.column() >= defaultScheme.size()
+            || role != Qt::EditRole)
         return false;
 
     schemes[index.row()][index.column()] = value;
@@ -687,8 +688,8 @@ bool AmmoSchemeModel::insertRows(int row, int count, const QModelIndex & parent)
 bool AmmoSchemeModel::removeRows(int row, int count, const QModelIndex & parent)
 {
     if(count != 1
-        || row < numberOfDefaultSchemes
-        || row >= schemes.size())
+            || row < numberOfDefaultSchemes
+            || row >= schemes.size())
         return false;
 
     beginRemoveRows(parent, row, row);
@@ -703,10 +704,10 @@ bool AmmoSchemeModel::removeRows(int row, int count, const QModelIndex & parent)
 QVariant AmmoSchemeModel::data(const QModelIndex &index, int role) const
 {
     if (!index.isValid() || index.row() < 0
-        || index.row() >= schemes.size()
-        || index.column() >= defaultScheme.size()
-        || (role != Qt::EditRole && role != Qt::DisplayRole)
-        )
+            || index.row() >= schemes.size()
+            || index.column() >= defaultScheme.size()
+            || (role != Qt::EditRole && role != Qt::DisplayRole)
+       )
         return QVariant();
 
     return schemes[index.row()][index.column()];
@@ -716,7 +717,8 @@ void AmmoSchemeModel::Save()
 {
     fileConfig.beginWriteArray("schemes", schemes.size() - numberOfDefaultSchemes);
 
-    for (int i = 0; i < schemes.size() - numberOfDefaultSchemes; ++i) {
+    for (int i = 0; i < schemes.size() - numberOfDefaultSchemes; ++i)
+    {
         fileConfig.setArrayIndex(i);
 
         QList<QVariant> scheme = schemes[i + numberOfDefaultSchemes];
@@ -762,10 +764,10 @@ int NetAmmoSchemeModel::columnCount(const QModelIndex & parent) const
 QVariant NetAmmoSchemeModel::data(const QModelIndex &index, int role) const
 {
     if (!index.isValid() || index.row() < 0
-        || index.row() > 1
-        || index.column() >= defaultScheme.size()
-        || (role != Qt::EditRole && role != Qt::DisplayRole)
-        )
+            || index.row() > 1
+            || index.column() >= defaultScheme.size()
+            || (role != Qt::EditRole && role != Qt::DisplayRole)
+       )
         return QVariant();
 
     return netScheme[index.column()];
diff --git a/QTfrontend/model/ammoSchemeModel.h b/QTfrontend/model/ammoSchemeModel.h
index 62ad540..d665ad6 100644
--- a/QTfrontend/model/ammoSchemeModel.h
+++ b/QTfrontend/model/ammoSchemeModel.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,54 +26,54 @@
 
 class AmmoSchemeModel : public QAbstractTableModel
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    AmmoSchemeModel(QObject * parent, const QString & fileName);
+    public:
+        AmmoSchemeModel(QObject * parent, const QString & fileName);
 
-    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-    int rowCount(const QModelIndex & parent) const;
-    int columnCount(const QModelIndex & parent) const;
-    Qt::ItemFlags flags(const QModelIndex & index) const;
-    bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
-    bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
-    bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
-    QVariant data(const QModelIndex &index, int role) const;
+        QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+        int rowCount(const QModelIndex & parent) const;
+        int columnCount(const QModelIndex & parent) const;
+        Qt::ItemFlags flags(const QModelIndex & index) const;
+        bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
+        bool insertRows(int row, int count, const QModelIndex & parent = QModelIndex());
+        bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
+        QVariant data(const QModelIndex &index, int role) const;
 
-    int numberOfDefaultSchemes;
-    QStringList predefSchemesNames;
-    QStringList spNames;
+        int numberOfDefaultSchemes;
+        QStringList predefSchemesNames;
+        QStringList spNames;
 
-public slots:
-    void Save();
+    public slots:
+        void Save();
 
-signals:
-    void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
+//    signals:
+//        void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
 
-protected:
-    QList< QList<QVariant> > schemes;
+    protected:
+        QList< QList<QVariant> > schemes;
 
-private:
-    QSettings fileConfig;
+    private:
+        QSettings fileConfig;
 };
 
 class NetAmmoSchemeModel : public QAbstractTableModel
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    NetAmmoSchemeModel(QObject * parent);
+    public:
+        NetAmmoSchemeModel(QObject * parent);
 
-    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-    int rowCount(const QModelIndex & parent) const;
-    int columnCount(const QModelIndex & parent) const;
-    QVariant data(const QModelIndex &index, int role) const;
+        QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+        int rowCount(const QModelIndex & parent) const;
+        int columnCount(const QModelIndex & parent) const;
+        QVariant data(const QModelIndex &index, int role) const;
 
-public slots:
-    void setNetSchemeConfig(QStringList & cfg);
+    public slots:
+        void setNetSchemeConfig(QStringList & cfg);
 
-private:
-    QList<QVariant> netScheme;
+    private:
+        QList<QVariant> netScheme;
 };
 
 #endif // _AMMO_SCHEME_MODEL_INCLUDED
diff --git a/QTfrontend/model/hats.cpp b/QTfrontend/model/hats.cpp
deleted file mode 100644
index f86cb6e..0000000
--- a/QTfrontend/model/hats.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#include <QDir>
-#include <QPixmap>
-#include <QPainter>
-#include "hwconsts.h"
-#include "hwform.h"
-#include "hats.h"
-
-#include "HWDataManager.h"
-
-HatsModel::HatsModel(QObject* parent) :
-  QAbstractListModel(parent)
-{
-    HWDataManager & dataMgr = HWDataManager::instance();
-
-    QPixmap hhpix = QPixmap(
-        dataMgr.findFileForRead("Graphics/Hedgehog/Idle.png")
-    ).copy(0, 0, 32, 32);
-
-    // my reserved hats
-    QStringList hatsList = dataMgr.entryList(
-                                   "Graphics/Hats/Reserved",
-                                   QDir::Files,
-                                   QStringList(playerHash+"*.png")
-                               );
-
-    int nReserved = hatsList.size();
-
-    // regular hats
-    hatsList.append(dataMgr.entryList(
-                                   "Graphics/Hats",
-                                   QDir::Files,
-                                   QStringList("*.png")
-                               )
-                   );
-
-
-    int nHats = hatsList.size();
-
-    for (int i = 0; i < nHats; i++)
-    {
-        bool isReserved = (i < nReserved);
-
-        QString str = hatsList.at(i);
-        str = str.remove(QRegExp("\\.png$"));
-        QPixmap pix(
-            dataMgr.findFileForRead(
-                "Graphics/Hats/" + QString(isReserved?"Reserved/":"") + str + 
-                ".png"
-            )
-        );
-
-        // rename properly
-        if (isReserved)
-            str = "Reserved "+str.remove(0,32);
-
-        QPixmap tmppix(32, 37);
-        tmppix.fill(QColor(Qt::transparent));
-
-        QPainter painter(&tmppix);
-        painter.drawPixmap(QPoint(0, 5), hhpix);
-        painter.drawPixmap(QPoint(0, 0), pix.copy(0, 0, 32, 32));
-        if(pix.width() > 32)
-            painter.drawPixmap(QPoint(0, 0), pix.copy(32, 0, 32, 32));
-        painter.end();
-
-        if (str == "NoHat")
-            hats.prepend(qMakePair(str, QIcon(tmppix)));
-        else
-            hats.append(qMakePair(str, QIcon(tmppix)));
-    }
-}
-
-QVariant HatsModel::headerData(int section,
-            Qt::Orientation orientation, int role) const
-{
-    Q_UNUSED(section);
-    Q_UNUSED(orientation);
-    Q_UNUSED(role);
-
-    return QVariant();
-}
-
-int HatsModel::rowCount(const QModelIndex &parent) const
-{
-    if (parent.isValid())
-        return 0;
-    else
-        return hats.size();
-}
-
-/*int HatsModel::columnCount(const QModelIndex & parent) const
-{
-    if (parent.isValid())
-        return 0;
-    else
-        return 2;
-}
-*/
-QVariant HatsModel::data(const QModelIndex &index,
-                         int role) const
-{
-    if (!index.isValid() || index.row() < 0
-        || index.row() >= hats.size()
-        || (role != Qt::DisplayRole && role != Qt::DecorationRole))
-        return QVariant();
-
-    if (role == Qt::DisplayRole)
-        return hats.at(index.row()).first;
-    else // role == Qt::DecorationRole
-        return hats.at(index.row()).second;
-}
diff --git a/QTfrontend/model/hats.h b/QTfrontend/model/hats.h
deleted file mode 100644
index a9987f2..0000000
--- a/QTfrontend/model/hats.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#ifndef _HATS_INCLUDED
-#define _HATS_INCLUDED
-
-#include <QAbstractListModel>
-#include <QStringList>
-#include <QVector>
-#include <QPair>
-#include <QIcon>
-
-class HatsModel : public QAbstractListModel
-{
-    Q_OBJECT
-
-public:
-    HatsModel(QObject *parent = 0);
-
-    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-    int rowCount(const QModelIndex & parent) const;
-    //int columnCount(const QModelIndex & parent) const;
-
-    QVariant data(const QModelIndex &index, int role) const;
-protected:
-    QVector<QPair<QString, QIcon> > hats;
-};
-
-#endif // _HATS_INCLUDED
diff --git a/QTfrontend/model/netserverslist.cpp b/QTfrontend/model/netserverslist.cpp
index d720d97..a50e9fb 100644
--- a/QTfrontend/model/netserverslist.cpp
+++ b/QTfrontend/model/netserverslist.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,7 +22,7 @@
 #include "netserverslist.h"
 
 HWNetServersModel::HWNetServersModel(QObject* parent) :
-  QAbstractTableModel(parent)
+    QAbstractTableModel(parent)
 {
 
 }
@@ -33,7 +33,7 @@ void HWNetServersModel::updateList()
 }
 
 QVariant HWNetServersModel::headerData(int section,
-            Qt::Orientation orientation, int role) const
+                                       Qt::Orientation orientation, int role) const
 {
     if (role != Qt::DisplayRole)
         return QVariant();
@@ -42,12 +42,17 @@ QVariant HWNetServersModel::headerData(int section,
     {
         switch (section)
         {
-            case 0: return tr("Title");
-            case 1: return tr("IP");
-            case 2: return tr("Port");
-            default: return QVariant();
+            case 0:
+                return tr("Title");
+            case 1:
+                return tr("IP");
+            case 2:
+                return tr("Port");
+            default:
+                return QVariant();
         }
-    } else
+    }
+    else
         return QString("%1").arg(section + 1);
 }
 
diff --git a/QTfrontend/model/netserverslist.h b/QTfrontend/model/netserverslist.h
index fa33b8e..2a21789 100644
--- a/QTfrontend/model/netserverslist.h
+++ b/QTfrontend/model/netserverslist.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,20 +24,20 @@
 
 class HWNetServersModel : public QAbstractTableModel
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    HWNetServersModel(QObject *parent = 0);
+    public:
+        HWNetServersModel(QObject *parent = 0);
 
-    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-    int rowCount(const QModelIndex & parent) const;
-    int columnCount(const QModelIndex & parent) const;
+        QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+        int rowCount(const QModelIndex & parent) const;
+        int columnCount(const QModelIndex & parent) const;
 
-public slots:
-    virtual void updateList();
+    public slots:
+        virtual void updateList();
 
-protected:
-    QList<QStringList> games;
+    protected:
+        QList<QStringList> games;
 };
 
 #endif // _NET_SERVERSLIST_INCLUDED
diff --git a/QTfrontend/model/playerslistmodel.cpp b/QTfrontend/model/playerslistmodel.cpp
new file mode 100644
index 0000000..fab1c5c
--- /dev/null
+++ b/QTfrontend/model/playerslistmodel.cpp
@@ -0,0 +1,393 @@
+#include <QModelIndexList>
+#include <QModelIndex>
+#include <QPainter>
+#include <QFile>
+#include <QTextStream>
+#include <QDebug>
+
+#include "playerslistmodel.h"
+#include "hwconsts.h"
+
+PlayersListModel::PlayersListModel(QObject *parent) :
+    QAbstractListModel(parent)
+{
+
+}
+
+
+int PlayersListModel::rowCount(const QModelIndex &parent) const
+{
+    if(parent.isValid())
+        return 0;
+    else
+        return m_data.size();
+}
+
+
+QVariant PlayersListModel::data(const QModelIndex &index, int role) const
+{
+    if(!index.isValid() || index.row() < 0 || index.row() >= rowCount() || index.column() != 0)
+        return QVariant(QVariant::Invalid);
+
+    return m_data.at(index.row()).value(role);
+}
+
+
+bool PlayersListModel::setData(const QModelIndex &index, const QVariant &value, int role)
+{
+    if(!index.isValid() || index.row() < 0 || index.row() >= rowCount() || index.column() != 0)
+        return false;
+
+    m_data[index.row()].insert(role, value);
+
+    emit dataChanged(index, index);
+
+    return true;
+}
+
+
+bool PlayersListModel::insertRow(int row, const QModelIndex &parent)
+{
+    return insertRows(row, 1, parent);
+}
+
+
+bool PlayersListModel::insertRows(int row, int count, const QModelIndex &parent)
+{
+    if(parent.isValid() || row > rowCount() || row < 0 || count < 1)
+        return false;
+
+    beginInsertRows(parent, row, row + count - 1);
+
+    for(int i = 0; i < count; ++i)
+        m_data.insert(row, DataEntry());
+
+    endInsertRows();
+
+    return true;
+}
+
+
+bool PlayersListModel::removeRows(int row, int count, const QModelIndex &parent)
+{
+    if(parent.isValid() || row + count > rowCount() || row < 0 || count < 1)
+        return false;
+
+    beginRemoveRows(parent, row, row + count - 1);
+
+    for(int i = 0; i < count; ++i)
+        m_data.removeAt(row);
+
+    endRemoveRows();
+
+    return true;
+}
+
+
+void PlayersListModel::addPlayer(const QString & nickname)
+{
+    insertRow(rowCount());
+
+    QModelIndex mi = index(rowCount() - 1);
+    setData(mi, nickname);
+
+    checkFriendIgnore(mi);
+}
+
+
+void PlayersListModel::removePlayer(const QString & nickname)
+{
+    QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
+
+    if(mil.size())
+        removeRow(mil[0].row());
+}
+
+
+void PlayersListModel::playerJoinedRoom(const QString & nickname)
+{
+    QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
+
+    if(mil.size())
+    {
+        setData(mil[0], true, RoomFilterRole);
+        updateIcon(mil[0]);
+        updateSortData(mil[0]);
+    }
+}
+
+
+void PlayersListModel::playerLeftRoom(const QString & nickname)
+{
+    QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
+
+    if(mil.size())
+    {
+        setData(mil[0], false, RoomFilterRole);
+        setData(mil[0], false, RoomAdmin);
+        setData(mil[0], false, Ready);
+        setData(mil[0], false, InGame);
+        updateIcon(mil[0]);
+    }
+}
+
+
+void PlayersListModel::setFlag(const QString &nickname, StateFlag flagType, bool isSet)
+{
+    QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
+
+    if(mil.size())
+    {
+        setData(mil[0], isSet, flagType);
+
+        if(flagType == Friend || flagType == ServerAdmin
+                || flagType == Ignore || flagType == RoomAdmin)
+            updateSortData(mil[0]);
+
+        if(flagType == Friend)
+        {
+            if(isSet)
+                m_friendsSet.insert(nickname.toLower());
+            else
+                m_friendsSet.remove(nickname.toLower());
+
+            saveSet(m_friendsSet, "friends");
+        }
+
+        if(flagType == Ignore)
+        {
+            if(isSet)
+                m_ignoredSet.insert(nickname.toLower());
+            else
+                m_ignoredSet.remove(nickname.toLower());
+
+            saveSet(m_ignoredSet, "ignore");
+        }
+
+        updateIcon(mil[0]);
+    }
+}
+
+
+bool PlayersListModel::isFlagSet(const QString & nickname, StateFlag flagType)
+{
+    QModelIndexList mil = match(index(0), Qt::DisplayRole, nickname, 1, Qt::MatchExactly);
+
+    if(mil.size())
+        return mil[0].data(flagType).toBool();
+    else
+        return false;
+}
+
+void PlayersListModel::resetRoomFlags()
+{
+    for(int i = rowCount() - 1; i >= 0; --i)
+    {
+        QModelIndex mi = index(i);
+
+        if(mi.data(RoomFilterRole).toBool())
+        {
+            setData(mi, false, RoomFilterRole);
+            setData(mi, false, RoomAdmin);
+            setData(mi, false, Ready);
+            setData(mi, false, InGame);
+
+            updateSortData(mi);
+            updateIcon(mi);
+        }
+    }
+}
+
+void PlayersListModel::updateIcon(const QModelIndex & index)
+{
+    quint32 iconNum = 0;
+
+    QList<bool> flags;
+    flags
+        << index.data(Ready).toBool()
+        << index.data(ServerAdmin).toBool()
+        << index.data(RoomAdmin).toBool()
+        << index.data(Registered).toBool()
+        << index.data(Friend).toBool()
+        << index.data(Ignore).toBool()
+        << index.data(InGame).toBool()
+        << index.data(RoomFilterRole).toBool()
+        ;
+
+    for(int i = flags.size() - 1; i >= 0; --i)
+        if(flags[i])
+            iconNum |= 1 << i;
+
+    if(m_icons().contains(iconNum))
+    {
+        setData(index, m_icons().value(iconNum), Qt::DecorationRole);
+    }
+    else
+    {
+        QPixmap result(24, 16);
+        result.fill(Qt::transparent);
+
+        QPainter painter(&result);
+
+        if(index.data(RoomFilterRole).toBool())
+        {
+            if(index.data(InGame).toBool())
+            {
+                painter.drawPixmap(0, 0, 16, 16, QPixmap(":/res/chat/ingame.png"));
+            }
+            else
+            {
+                if(index.data(Ready).toBool())
+                    painter.drawPixmap(0, 0, 16, 16, QPixmap(":/res/chat/lamp.png"));
+                else
+                    painter.drawPixmap(0, 0, 16, 16, QPixmap(":/res/chat/lamp_off.png"));
+            }
+        }
+
+        QString mainIconName(":/res/chat/");
+
+        if(index.data(RoomAdmin).toBool())
+            mainIconName += "roomadmin";
+        else if(index.data(ServerAdmin).toBool())
+            mainIconName += "serveradmin";
+        else
+            mainIconName += "hedgehog";
+
+        if(!index.data(Registered).toBool())
+            mainIconName += "_gray";
+
+        painter.drawPixmap(8, 0, 16, 16, QPixmap(mainIconName + ".png"));
+
+        if(index.data(Ignore).toBool())
+            painter.drawPixmap(8, 0, 16, 16, QPixmap(":/res/chat/ignore.png"));
+        else
+        if(index.data(Friend).toBool())
+            painter.drawPixmap(8, 0, 16, 16, QPixmap(":/res/chat/friend.png"));
+
+        painter.end();
+
+        QIcon icon(result);
+
+        setData(index, icon, Qt::DecorationRole);
+        m_icons().insert(iconNum, icon);
+    }
+
+    if(index.data(Ignore).toBool())
+        setData(index, Qt::gray, Qt::ForegroundRole);
+    else
+    if(index.data(Friend).toBool())
+        setData(index, Qt::green, Qt::ForegroundRole);
+    else
+        setData(index, QBrush(QColor(0xff, 0xcc, 0x00)), Qt::ForegroundRole);
+}
+
+
+QHash<quint32, QIcon> & PlayersListModel::m_icons()
+{
+    static QHash<quint32, QIcon> iconsCache;
+
+    return iconsCache;
+}
+
+
+void PlayersListModel::updateSortData(const QModelIndex & index)
+{
+    QString result = QString("%1%2%3%4%5%6")
+            // room admins go first, then server admins, then friends
+            .arg(1 - index.data(RoomAdmin).toInt())
+            .arg(1 - index.data(ServerAdmin).toInt())
+            .arg(1 - index.data(Friend).toInt())
+            // ignored at bottom
+            .arg(index.data(Ignore).toInt())
+            // keep nicknames starting from non-letter character at bottom within group
+            // assume there are no empty nicks in list
+            .arg(index.data(Qt::DisplayRole).toString().at(0).isLetter() ? 0 : 1)
+            // sort ignoring case
+            .arg(index.data(Qt::DisplayRole).toString().toLower())
+            ;
+
+    setData(index, result, SortRole);
+}
+
+
+void PlayersListModel::setNickname(const QString &nickname)
+{
+    m_nickname = nickname;
+
+    loadSet(m_friendsSet, "friends");
+    loadSet(m_ignoredSet, "ignore");
+
+    for(int i = rowCount() - 1; i >= 0; --i)
+        checkFriendIgnore(index(i));
+}
+
+
+void PlayersListModel::checkFriendIgnore(const QModelIndex &mi)
+{
+    setData(mi, m_friendsSet.contains(mi.data().toString().toLower()), Friend);
+    setData(mi, m_ignoredSet.contains(mi.data().toString().toLower()), Ignore);
+
+    updateIcon(mi);
+    updateSortData(mi);
+}
+
+void PlayersListModel::loadSet(QSet<QString> & set, const QString & suffix)
+{
+    set.clear();
+
+    QString fileName = QString("%1/%2_%3.txt").arg(cfgdir->absolutePath(), m_nickname.toLower(), suffix);
+
+    QFile txt(fileName);
+    if(!txt.open(QIODevice::ReadOnly))
+        return;
+
+    QTextStream stream(&txt);
+    stream.setCodec("UTF-8");
+
+    while(!stream.atEnd())
+    {
+        QString str = stream.readLine();
+        if(str.startsWith(";") || str.isEmpty())
+            continue;
+
+        set.insert(str.trimmed());
+    }
+
+    txt.close();
+}
+
+void PlayersListModel::saveSet(const QSet<QString> & set, const QString & suffix)
+{
+    qDebug("saving set");
+
+    QString fileName = QString("%1/%2_%3.txt").arg(cfgdir->absolutePath(), m_nickname.toLower(), suffix);
+
+    QFile txt(fileName);
+
+    // list empty? => rather have no file for the list than an empty one
+    if (set.isEmpty())
+    {
+        if (txt.exists())
+        {
+            // try to remove file, if successful we're done here.
+            if (txt.remove())
+                return;
+        }
+        else
+            // there is no file
+            return;
+    }
+
+    if(!txt.open(QIODevice::WriteOnly | QIODevice::Truncate))
+        return;
+
+    QTextStream stream(&txt);
+    stream.setCodec("UTF-8");
+
+    stream << "; this list is used by Hedgewars - do not edit it unless you know what you're doing!" << endl;
+
+    foreach(const QString & nick, set.values())
+        stream << nick << endl;
+
+    txt.close();
+}
diff --git a/QTfrontend/model/playerslistmodel.h b/QTfrontend/model/playerslistmodel.h
new file mode 100644
index 0000000..f2d784b
--- /dev/null
+++ b/QTfrontend/model/playerslistmodel.h
@@ -0,0 +1,65 @@
+#ifndef PLAYERSLISTMODEL_H
+#define PLAYERSLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QHash>
+#include <QIcon>
+#include <QModelIndex>
+#include <QSet>
+
+class PlayersListModel : public QAbstractListModel
+{
+    Q_OBJECT
+
+public:
+    enum StateFlag {
+        Ready       = Qt::UserRole,
+        ServerAdmin = Qt::UserRole + 1,
+        RoomAdmin   = Qt::UserRole + 2,
+        Registered  = Qt::UserRole + 3,
+        Friend      = Qt::UserRole + 4,
+        Ignore      = Qt::UserRole + 5,
+        InGame      = Qt::UserRole + 6
+    };
+
+    enum SpecialRoles {
+        SortRole       = Qt::UserRole + 100,
+        RoomFilterRole = Qt::UserRole + 101
+    };
+
+    explicit PlayersListModel(QObject *parent = 0);
+
+    int rowCount(const QModelIndex &parent = QModelIndex()) const;
+
+    QVariant data(const QModelIndex &index, int role) const;
+    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
+    void setFlag(const QString & nickname, StateFlag flagType, bool isSet);
+    bool isFlagSet(const QString & nickname, StateFlag flagType);
+
+    bool insertRow(int row, const QModelIndex &parent = QModelIndex());
+    bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
+    bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
+
+public slots:
+    void addPlayer(const QString & nickname);
+    void removePlayer(const QString & nickname);
+    void playerJoinedRoom(const QString & nickname);
+    void playerLeftRoom(const QString & nickname);
+    void resetRoomFlags();
+    void setNickname(const QString & nickname);
+
+private:
+    QHash<quint32, QIcon> & m_icons();
+    typedef QHash<int, QVariant> DataEntry;
+    QList<DataEntry> m_data;
+    QSet<QString> m_friendsSet, m_ignoredSet;
+    QString m_nickname;
+
+    void updateIcon(const QModelIndex & index);
+    void updateSortData(const QModelIndex & index);
+    void loadSet(QSet<QString> & set, const QString & suffix);
+    void saveSet(const QSet<QString> & set, const QString & suffix);
+    void checkFriendIgnore(const QModelIndex & mi);
+};
+
+#endif // PLAYERSLISTMODEL_H
diff --git a/QTfrontend/model/roomslistmodel.cpp b/QTfrontend/model/roomslistmodel.cpp
new file mode 100644
index 0000000..ffa20e5
--- /dev/null
+++ b/QTfrontend/model/roomslistmodel.cpp
@@ -0,0 +1,264 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief RoomsListModel class implementation
+ */
+
+#include <QBrush>
+#include <QColor>
+#include <QIcon>
+
+#include "roomslistmodel.h"
+#include "MapModel.h"
+
+RoomsListModel::RoomsListModel(QObject *parent) :
+    QAbstractTableModel(parent),
+    c_nColumns(8)
+{
+    m_headerData =
+    QStringList()
+     << tr("In progress")
+     << tr("Room Name")
+     << tr("C")
+     << tr("T")
+     << tr("Owner")
+     << tr("Map")
+     << tr("Rules")
+     << tr("Weapons");
+
+    m_mapModel = DataManager::instance().mapModel();
+}
+
+
+QVariant RoomsListModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    if(orientation == Qt::Vertical || role != Qt::DisplayRole)
+        return QVariant();
+    else
+        return QVariant(m_headerData.at(section));
+}
+
+
+int RoomsListModel::rowCount(const QModelIndex & parent) const
+{
+    if(parent.isValid())
+        return 0;
+    else
+        return m_data.size();
+}
+
+
+int RoomsListModel::columnCount(const QModelIndex & parent) const
+{
+    if(parent.isValid())
+        return 0;
+    else
+        return c_nColumns;
+}
+
+
+QVariant RoomsListModel::data(const QModelIndex &index, int role) const
+{
+    int column = index.column();
+    int row = index.row();
+
+    // invalid index
+    if (!index.isValid())
+        return QVariant();
+
+    // invalid row
+    if ((row < 0) || (row >= m_data.size()))
+        return QVariant();
+
+    // invalid column
+    if ((column < 0) || (column >= c_nColumns))
+        return QVariant();
+
+    // not a role we have data for
+    if (role != Qt::DisplayRole)
+        // only custom-align counters
+        if ((role != Qt::TextAlignmentRole)
+            || ((column != PlayerCountColumn) && (column != TeamCountColumn)))
+                // only decorate name column
+                if ((role != Qt::DecorationRole) || (column != NameColumn))
+                    // only dye map column
+                    if ((role != Qt::ForegroundRole) || (column != MapColumn))
+                        return QVariant();
+
+    // decorate room name based on room state
+    if (role == Qt::DecorationRole)
+    {
+        const QIcon roomBusyIcon(":/res/iconDamage.png");
+        const QIcon roomWaitingIcon(":/res/iconTime.png");
+
+        if (m_data.at(row).at(0).isEmpty())
+            return QVariant(roomWaitingIcon);
+        else
+            return QVariant(roomBusyIcon);
+    }
+
+    QString content = m_data.at(row).at(column);
+
+    if (role == Qt::DisplayRole)
+    {
+        // supply in progress flag as bool
+        if (column == 0)
+            return QVariant(QString(!content.isEmpty()));
+
+        // display room names
+        if (column == 5)
+        {
+            // special names
+            if (content[0] == '+')
+            {
+                if (content == "+rnd+") return tr("Random Map");
+                if (content == "+maze+") return tr("Random Maze");
+                if (content == "+drawn+") return tr("Hand-drawn");
+            }
+
+            // prefix ? if map not available
+            if ((m_mapModel->indexOf(content) < 0))
+                return QString ("? %1").arg(content);
+        }
+
+        return content;
+    }
+
+    // dye map names red if map not available
+    if (role == Qt::ForegroundRole)
+    {
+        if ((m_mapModel->indexOf(content) < 0))
+            return QBrush(QColor("darkred"));
+        else
+            return QVariant();
+    }
+
+    if (role == Qt::TextAlignmentRole)
+    {
+        return (int)(Qt::AlignHCenter | Qt::AlignVCenter);
+    }
+
+    Q_ASSERT(false);
+    return QVariant();
+}
+
+
+void RoomsListModel::setRoomsList(const QStringList & rooms)
+{
+    beginResetModel();
+
+    m_data.clear();
+
+    int nRooms = rooms.size();
+
+    for (int i = 0; i < nRooms; i += c_nColumns)
+    {
+        QStringList l;
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+        l.reserve(c_nColumns);  // small optimisation not supported in old Qt
+#endif
+
+        for (int t = 0; t < c_nColumns; t++)
+        {
+            l.append(rooms[i + t]);
+        }
+
+        m_data.append(roomInfo2RoomRecord(l));
+    }
+
+    endResetModel();
+}
+
+
+void RoomsListModel::addRoom(const QStringList & info)
+{
+    beginInsertRows(QModelIndex(), 0, 0);
+
+    m_data.prepend(roomInfo2RoomRecord(info));
+
+    endInsertRows();
+}
+
+
+int RoomsListModel::rowOfRoom(const QString & name)
+{
+    int size = m_data.size();
+
+    if (size < 1)
+        return -1;
+
+    int i = 0;
+
+    // search for record with matching room name
+    while(m_data[i].at(NameColumn) != name)
+    {
+        i++;
+        if(i >= size)
+            return -1;
+    }
+
+    return i;
+}
+
+
+void RoomsListModel::removeRoom(const QString & name)
+{
+    int i = rowOfRoom(name);
+
+    if (i < 0)
+        return;
+
+    beginRemoveRows(QModelIndex(), i, i);
+
+    m_data.removeAt(i);
+
+    endRemoveRows();
+}
+
+
+void RoomsListModel::updateRoom(const QString & name, const QStringList & info)
+{
+    int i = rowOfRoom(name);
+
+    if (i < 0)
+        return;
+
+    m_data[i] = roomInfo2RoomRecord(info);
+
+    emit dataChanged(index(i, 0), index(i, columnCount(QModelIndex()) - 1));
+}
+
+
+QStringList RoomsListModel::roomInfo2RoomRecord(const QStringList & info)
+{
+    QStringList result;
+
+    result = info;
+
+    // for matters of less memory usage and quicker access store
+    // the boolean string as either "t" or empty
+    if (info[StateColumn].toLower() == "true")
+        result[StateColumn] = "t";
+    else
+        result[StateColumn] = QString();
+
+    return result;
+}
diff --git a/QTfrontend/model/roomslistmodel.h b/QTfrontend/model/roomslistmodel.h
new file mode 100644
index 0000000..b4d701d
--- /dev/null
+++ b/QTfrontend/model/roomslistmodel.h
@@ -0,0 +1,72 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief RoomsListModel class definition
+ */
+
+#ifndef HEDGEWARS_ROOMSLISTMODEL_H
+#define HEDGEWARS_ROOMSLISTMODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+
+#include "DataManager.h"
+
+class RoomsListModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    // if you add a column here, also incr. c_nColumns in constructor
+    // also adjust header in constructor to changes
+    enum Column {
+        StateColumn,
+        NameColumn,
+        PlayerCountColumn,
+        TeamCountColumn,
+        OwnerColumn,
+        MapColumn,
+        SchemeColumn,
+        WeaponsColumn
+    };
+
+    explicit RoomsListModel(QObject *parent = 0);
+
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+    int rowCount(const QModelIndex & parent) const;
+    int columnCount(const QModelIndex & parent) const;
+    QVariant data(const QModelIndex &index, int role) const;
+
+public slots:
+    void setRoomsList(const QStringList & rooms);
+    void addRoom(const QStringList & info);
+    void removeRoom(const QString & name);
+    void updateRoom(const QString & name, const QStringList & info);
+    int rowOfRoom(const QString & name);
+
+private:
+    const int c_nColumns;
+    QList<QStringList> m_data;
+    QStringList m_headerData;
+    MapModel * m_mapModel;
+
+    QStringList roomInfo2RoomRecord(const QStringList & info);
+};
+
+#endif // HEDGEWARS_ROOMSLISTMODEL_H
diff --git a/QTfrontend/model/themesmodel.cpp b/QTfrontend/model/themesmodel.cpp
deleted file mode 100644
index 093483d..0000000
--- a/QTfrontend/model/themesmodel.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-
-#include "themesmodel.h"
-
-ThemesModel::ThemesModel(QStringList themes, QObject *parent) :
-    QAbstractListModel(parent)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
-    m_data.reserve(themes.size());
-#endif
-
-    foreach(QString theme, themes)
-    {
-        m_data.append(QHash<int, QVariant>());
-        m_data.last().insert(Qt::DisplayRole, theme);
-    }
-}
-
-int ThemesModel::rowCount(const QModelIndex &parent) const
-{
-    if(parent.isValid())
-        return 0;
-    else
-        return m_data.size();
-}
-
-QVariant ThemesModel::data(const QModelIndex &index, int role) const
-{
-    if(index.column() > 0 || index.row() >= m_data.size())
-        return QVariant();
-    else
-        return m_data.at(index.row()).value(role);
-}
-
-bool ThemesModel::setData(const QModelIndex &index, const QVariant &value, int role)
-{
-    if(index.column() > 0 || index.row() >= m_data.size())
-        return false;
-    else
-    {
-        m_data[index.row()].insert(role, value);
-
-        return true;
-    }
-
-}
-
-
-
-
diff --git a/QTfrontend/model/themesmodel.h b/QTfrontend/model/themesmodel.h
deleted file mode 100644
index ada316b..0000000
--- a/QTfrontend/model/themesmodel.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef THEMESMODEL_H
-#define THEMESMODEL_H
-
-#include <QAbstractListModel>
-#include <QStringList>
-#include <QHash>
-
-class ThemesModel : public QAbstractListModel
-{
-    Q_OBJECT
-public:
-    explicit ThemesModel(QStringList themes, QObject *parent = 0);
-
-    int rowCount(const QModelIndex &parent = QModelIndex()) const;
-    QVariant data(const QModelIndex &index, int role) const;
-    bool setData(const QModelIndex &index, const QVariant &value,
-                 int role = Qt::EditRole);
-
-signals:
-
-public slots:
-
-private:
-
-    QList<QHash<int, QVariant> > m_data;
-};
-
-#endif // THEMESMODEL_H
diff --git a/QTfrontend/net/hwmap.cpp b/QTfrontend/net/hwmap.cpp
index c55559c..98abf4d 100644
--- a/QTfrontend/net/hwmap.cpp
+++ b/QTfrontend/net/hwmap.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Ulyanov Igor <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,7 +21,7 @@
 #include "hwmap.h"
 
 HWMap::HWMap() :
-  TCPBase(false)
+    TCPBase(false)
 {
 }
 
@@ -84,7 +84,8 @@ void HWMap::SendToClientFirst()
             }
             break;
         }
-        default: ;
+        default:
+            ;
     }
 
     SendIPC("!");
diff --git a/QTfrontend/net/hwmap.h b/QTfrontend/net/hwmap.h
index dbe3f0c..04eb3a3 100644
--- a/QTfrontend/net/hwmap.h
+++ b/QTfrontend/net/hwmap.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -36,30 +36,30 @@ enum MapGenerator
 
 class HWMap : public TCPBase
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  HWMap();
-  virtual ~HWMap();
-  void getImage(const QString & seed, int templateFilter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData);
+    public:
+        HWMap();
+        virtual ~HWMap();
+        void getImage(const QString & seed, int templateFilter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData);
 
- protected:
-  virtual QStringList getArguments();
-  virtual void onClientDisconnect();
-  virtual void SendToClientFirst();
+    protected:
+        virtual QStringList getArguments();
+        virtual void onClientDisconnect();
+        virtual void SendToClientFirst();
 
- signals:
-  void ImageReceived(const QImage newImage);
-  void HHLimitReceived(int hhLimit);
+    signals:
+        void ImageReceived(const QImage newImage);
+        void HHLimitReceived(int hhLimit);
 
- private:
-  QString m_seed;
-  int templateFilter;
-  MapGenerator m_mapgen;
-  int m_maze_size;
-  QByteArray m_drawMapData;
+    private:
+        QString m_seed;
+        int templateFilter;
+        MapGenerator m_mapgen;
+        int m_maze_size;
+        QByteArray m_drawMapData;
 
- private slots:
+    private slots:
 };
 
 #endif // _HWMAP_INCLUDED
diff --git a/QTfrontend/net/netregister.cpp b/QTfrontend/net/netregister.cpp
index e54ec1d..4e73ee6 100644
--- a/QTfrontend/net/netregister.cpp
+++ b/QTfrontend/net/netregister.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -19,7 +19,7 @@
 #include "netregister.h"
 
 HWNetRegisterServer::HWNetRegisterServer(QObject *parent, const QString & descr, quint16 port) :
-  QObject(parent)
+    QObject(parent)
 {
     Q_UNUSED(descr);
     Q_UNUSED(port);
diff --git a/QTfrontend/net/netregister.h b/QTfrontend/net/netregister.h
index 24a0bfb..0f5d6f6 100644
--- a/QTfrontend/net/netregister.h
+++ b/QTfrontend/net/netregister.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,13 +23,13 @@
 
 class HWNetRegisterServer : public QObject
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    HWNetRegisterServer(QObject *parent, const QString & descr, quint16 port);
+    public:
+        HWNetRegisterServer(QObject *parent, const QString & descr, quint16 port);
 
-public slots:
-    virtual void unregister();
+    public slots:
+        virtual void unregister();
 };
 
 #endif // _NET_REGISTER_INCLUDED
diff --git a/QTfrontend/net/netserver.cpp b/QTfrontend/net/netserver.cpp
index c97d969..ca6c0f4 100644
--- a/QTfrontend/net/netserver.cpp
+++ b/QTfrontend/net/netserver.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -17,8 +17,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
-#include <QMessageBox>
-
 #include "hwconsts.h"
 #include "netserver.h"
 
@@ -48,5 +46,5 @@ void HWNetServer::StopServer()
 
 quint16 HWNetServer::getRunningPort() const
 {
-  return ds_port;
+    return ds_port;
 }
diff --git a/QTfrontend/net/netserver.h b/QTfrontend/net/netserver.h
index a3ae886..58d9844 100644
--- a/QTfrontend/net/netserver.h
+++ b/QTfrontend/net/netserver.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,18 +25,18 @@
 
 class HWNetServer : public QObject
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    ~HWNetServer();
-    bool StartServer(quint16 port);
-    void StopServer();
-    QString getRunningHostName() const;
-    quint16 getRunningPort() const;
+    public:
+        ~HWNetServer();
+        bool StartServer(quint16 port);
+        void StopServer();
+        QString getRunningHostName() const;
+        quint16 getRunningPort() const;
 
-private:
-    quint16 ds_port;
-    QProcess process;
+    private:
+        quint16 ds_port;
+        QProcess process;
 };
 
 #endif // _NETSERVER_INCLUDED
diff --git a/QTfrontend/net/netudpserver.cpp b/QTfrontend/net/netudpserver.cpp
index 98c6417..a7b74e5 100644
--- a/QTfrontend/net/netudpserver.cpp
+++ b/QTfrontend/net/netudpserver.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,30 +22,32 @@
 #include "netudpserver.h"
 
 HWNetUdpServer::HWNetUdpServer(QObject *parent, const QString & descr, quint16 port) :
-  HWNetRegisterServer(parent, descr, port),
-  m_descr(descr)
+    HWNetRegisterServer(parent, descr, port),
+    m_descr(descr)
 {
-  pUdpSocket = new QUdpSocket(this);
-  pUdpSocket->bind(46631);
-  connect(pUdpSocket, SIGNAL(readyRead()), this, SLOT(onClientRead()));
+    pUdpSocket = new QUdpSocket(this);
+    pUdpSocket->bind(46631);
+    connect(pUdpSocket, SIGNAL(readyRead()), this, SLOT(onClientRead()));
 }
 
 void HWNetUdpServer::onClientRead()
 {
-  while (pUdpSocket->hasPendingDatagrams()) {
-    QByteArray datagram;
-    datagram.resize(pUdpSocket->pendingDatagramSize());
-    QHostAddress clientAddr;
-    quint16 clientPort;
-    pUdpSocket->readDatagram(datagram.data(), datagram.size(), &clientAddr, &clientPort);
-    if(datagram.startsWith("hedgewars client")) {
-      // send answer to client
-      pUdpSocket->writeDatagram(QString("hedgewars server\n%1").arg(m_descr).toUtf8(), clientAddr, clientPort);
+    while (pUdpSocket->hasPendingDatagrams())
+    {
+        QByteArray datagram;
+        datagram.resize(pUdpSocket->pendingDatagramSize());
+        QHostAddress clientAddr;
+        quint16 clientPort;
+        pUdpSocket->readDatagram(datagram.data(), datagram.size(), &clientAddr, &clientPort);
+        if(datagram.startsWith("hedgewars client"))
+        {
+            // send answer to client
+            pUdpSocket->writeDatagram(QString("hedgewars server\n%1").arg(m_descr).toUtf8(), clientAddr, clientPort);
+        }
     }
-  }
 }
 
 void HWNetUdpServer::unregister()
 {
-  deleteLater();
+    deleteLater();
 }
diff --git a/QTfrontend/net/netudpserver.h b/QTfrontend/net/netudpserver.h
index 6eefe58..af85034 100644
--- a/QTfrontend/net/netudpserver.h
+++ b/QTfrontend/net/netudpserver.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,20 +27,20 @@ class QUdpSocket;
 
 class HWNetUdpServer : public HWNetRegisterServer
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  HWNetUdpServer(QObject *parent, const QString & descr, quint16 port);
+    public:
+        HWNetUdpServer(QObject *parent, const QString & descr, quint16 port);
 
- public slots:
-  void unregister();
+    public slots:
+        void unregister();
 
- private slots:
-  void onClientRead();
+    private slots:
+        void onClientRead();
 
- private:
-  QUdpSocket* pUdpSocket;
-  QString m_descr;
+    private:
+        QUdpSocket* pUdpSocket;
+        QString m_descr;
 };
 
 #endif // _NET_UDPSERVER_INCLUDED
diff --git a/QTfrontend/net/netudpwidget.cpp b/QTfrontend/net/netudpwidget.cpp
index f5a0ecc..77cefb2 100644
--- a/QTfrontend/net/netudpwidget.cpp
+++ b/QTfrontend/net/netudpwidget.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,7 +22,7 @@
 #include "netudpwidget.h"
 
 HWNetUdpModel::HWNetUdpModel(QObject* parent) :
-  HWNetServersModel(parent)
+    HWNetServersModel(parent)
 {
     pUdpSocket = new QUdpSocket(this);
 
@@ -41,7 +41,8 @@ void HWNetUdpModel::updateList()
 
 void HWNetUdpModel::onClientRead()
 {
-    while (pUdpSocket->hasPendingDatagrams()) {
+    while (pUdpSocket->hasPendingDatagrams())
+    {
         QByteArray datagram;
         datagram.resize(pUdpSocket->pendingDatagramSize());
         QHostAddress clientAddr;
@@ -50,7 +51,8 @@ void HWNetUdpModel::onClientRead()
         pUdpSocket->readDatagram(datagram.data(), datagram.size(), &clientAddr, &clientPort);
 
         QString packet = QString::fromUtf8(datagram.data());
-        if(packet.startsWith("hedgewars server")) {
+        if(packet.startsWith("hedgewars server"))
+        {
             QStringList sl;
             sl << packet.remove(0, 17) << clientAddr.toString() << "46631";
             games.append(sl);
@@ -64,9 +66,9 @@ QVariant HWNetUdpModel::data(const QModelIndex &index,
                              int role) const
 {
     if (!index.isValid() || index.row() < 0
-        || index.row() >= games.size()
-        || role != Qt::DisplayRole)
-    return QVariant();
+            || index.row() >= games.size()
+            || role != Qt::DisplayRole)
+        return QVariant();
 
     return games[index.row()][index.column()];
 }
diff --git a/QTfrontend/net/netudpwidget.h b/QTfrontend/net/netudpwidget.h
index b8ec12e..0dedaab 100644
--- a/QTfrontend/net/netudpwidget.h
+++ b/QTfrontend/net/netudpwidget.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,21 +26,21 @@ class QUdpSocket;
 
 class HWNetUdpModel : public HWNetServersModel
 {
-  Q_OBJECT
+        Q_OBJECT
 
-public:
-    HWNetUdpModel(QObject *parent = 0);
+    public:
+        HWNetUdpModel(QObject *parent = 0);
 
-    QVariant data(const QModelIndex &index, int role) const;
+        QVariant data(const QModelIndex &index, int role) const;
 
-public slots:
-    void updateList();
+    public slots:
+        void updateList();
 
-private slots:
-    void onClientRead();
+    private slots:
+        void onClientRead();
 
-private:
-    QUdpSocket* pUdpSocket;
+    private:
+        QUdpSocket* pUdpSocket;
 };
 
 #endif // _NET_UDPWIDGET_INCLUDED
diff --git a/QTfrontend/net/newnetclient.cpp b/QTfrontend/net/newnetclient.cpp
index b83bf92..5f1a83d 100644
--- a/QTfrontend/net/newnetclient.cpp
+++ b/QTfrontend/net/newnetclient.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,21 +20,42 @@
 #include <QDebug>
 #include <QInputDialog>
 #include <QCryptographicHash>
+#include <QSortFilterProxyModel>
 
 #include "hwconsts.h"
 #include "newnetclient.h"
 #include "proto.h"
 #include "game.h"
+#include "roomslistmodel.h"
+#include "playerslistmodel.h"
 
 char delimeter='\n';
 
 HWNewNet::HWNewNet() :
-  isChief(false),
-  m_game_connected(false),
-  loginStep(0),
-  netClientState(Disconnected)
-{
-// socket stuff
+    isChief(false),
+    m_game_connected(false),
+    loginStep(0),
+    netClientState(Disconnected)
+{
+    m_roomsListModel = new RoomsListModel(this);
+
+    m_playersModel = new PlayersListModel(this);
+
+    m_lobbyPlayersModel = new QSortFilterProxyModel(this);
+    m_lobbyPlayersModel->setSourceModel(m_playersModel);
+    m_lobbyPlayersModel->setSortRole(PlayersListModel::SortRole);
+    m_lobbyPlayersModel->setDynamicSortFilter(true);
+    m_lobbyPlayersModel->sort(0);
+
+    m_roomPlayersModel = new QSortFilterProxyModel(this);
+    m_roomPlayersModel->setSourceModel(m_playersModel);
+    m_roomPlayersModel->setSortRole(PlayersListModel::SortRole);
+    m_roomPlayersModel->setDynamicSortFilter(true);
+    m_roomPlayersModel->sort(0);
+    m_roomPlayersModel->setFilterRole(PlayersListModel::RoomFilterRole);
+    m_roomPlayersModel->setFilterFixedString("true");
+
+    // socket stuff
     connect(&NetSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
     connect(&NetSocket, SIGNAL(connected()), this, SLOT(OnConnect()));
     connect(&NetSocket, SIGNAL(disconnected()), this, SLOT(OnDisconnect()));
@@ -100,13 +121,13 @@ void HWNewNet::JoinRoom(const QString & room)
 void HWNewNet::AddTeam(const HWTeam & team)
 {
     QString cmd = QString("ADD_TEAM") + delimeter +
-         team.name() + delimeter +
-         team.color().name() + delimeter +
-         team.grave() + delimeter +
-         team.fort() + delimeter +
-         team.voicepack() + delimeter +
-         team.flag() + delimeter +
-         QString::number(team.difficulty());
+                  team.name() + delimeter +
+                  QString::number(team.color()) + delimeter +
+                  team.grave() + delimeter +
+                  team.fort() + delimeter +
+                  team.voicepack() + delimeter +
+                  team.flag() + delimeter +
+                  QString::number(team.difficulty());
 
     for(int i = 0; i < HEDGEHOGS_PER_TEAM; ++i)
     {
@@ -130,19 +151,19 @@ void HWNewNet::NewNick(const QString & nick)
 
 void HWNewNet::ToggleReady()
 {
-  RawSendNet(QString("TOGGLE_READY"));
+    RawSendNet(QString("TOGGLE_READY"));
 }
 
 void HWNewNet::SendNet(const QByteArray & buf)
 {
-  QString msg = QString(buf.toBase64());
+    QString msg = QString(buf.toBase64());
 
-  RawSendNet(QString("EM%1%2").arg(delimeter).arg(msg));
+    RawSendNet(QString("EM%1%2").arg(delimeter).arg(msg));
 }
 
 void HWNewNet::RawSendNet(const QString & str)
 {
-  RawSendNet(str.toUtf8());
+    RawSendNet(str.toUtf8());
 }
 
 void HWNewNet::RawSendNet(const QByteArray & buf)
@@ -154,14 +175,17 @@ void HWNewNet::RawSendNet(const QByteArray & buf)
 
 void HWNewNet::ClientRead()
 {
-    while (NetSocket.canReadLine()) {
+    while (NetSocket.canReadLine())
+    {
         QString s = QString::fromUtf8(NetSocket.readLine());
         if (s.endsWith('\n')) s.chop(1);
 
-        if (s.size() == 0) {
+        if (s.size() == 0)
+        {
             ParseCmd(cmdbuf);
             cmdbuf.clear();
-        } else
+        }
+        else
             cmdbuf << s;
     }
 }
@@ -182,8 +206,10 @@ void HWNewNet::displayError(QAbstractSocket::SocketError socketError)
 {
     m_game_connected = false;
 
-    switch (socketError) {
+    switch (socketError)
+    {
         case QAbstractSocket::RemoteHostClosedError:
+            emit disconnected(tr("Remote host has closed connection"));
             break;
         case QAbstractSocket::HostNotFoundError:
             emit disconnected(tr("The host was not found. Please check the host name and port settings."));
@@ -193,7 +219,7 @@ void HWNewNet::displayError(QAbstractSocket::SocketError socketError)
             break;
         default:
             emit disconnected(NetSocket.errorString());
-        }
+    }
 }
 
 void HWNewNet::SendPasswordHash(const QString & hash)
@@ -203,7 +229,7 @@ void HWNewNet::SendPasswordHash(const QString & hash)
 
 void HWNewNet::ParseCmd(const QStringList & lst)
 {
-  qDebug() << "Server: " << lst;
+    qDebug() << "Server: " << lst;
 
     if(!lst.size())
     {
@@ -214,13 +240,15 @@ void HWNewNet::ParseCmd(const QStringList & lst)
     if (lst[0] == "NICK")
     {
         mynick = lst[1];
+        m_playersModel->setNickname(mynick);
         return ;
     }
 
     if (lst[0] == "PROTO")
         return ;
 
-    if (lst[0] == "ERROR") {
+    if (lst[0] == "ERROR")
+    {
         if (lst.size() == 2)
             emit Error(lst[1]);
         else
@@ -228,7 +256,8 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "WARNING") {
+    if (lst[0] == "WARNING")
+    {
         if (lst.size() == 2)
             emit Warning(lst[1]);
         else
@@ -236,11 +265,16 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "CONNECTED") {
+    if (lst[0] == "CONNECTED")
+    {
         if(lst.size() < 3 || lst[2].toInt() < cMinServerVersion)
         {
             // TODO: Warn user, disconnect
             qWarning() << "Server too old";
+            RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("Server too old"));
+            Disconnect();
+            emit disconnected(tr("The server is too old. Disconnecting now."));
+            return;
         }
 
         RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
@@ -251,7 +285,8 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "PING") {
+    if (lst[0] == "PING")
+    {
         if (lst.size() > 1)
             RawSendNet(QString("PONG%1%2").arg(delimeter).arg(lst[1]));
         else
@@ -259,14 +294,21 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "ROOMS") {
+    if (lst[0] == "ROOMS")
+    {
+        if(lst.size() % 8 != 1)
+        {
+            qWarning("Net: Malformed ROOMS message");
+            return;
+        }
         QStringList tmp = lst;
         tmp.removeFirst();
-        emit roomsList(tmp);
+        m_roomsListModel->setRoomsList(tmp);
         return;
     }
 
-    if (lst[0] == "SERVER_MESSAGE") {
+    if (lst[0] == "SERVER_MESSAGE")
+    {
         if(lst.size() < 2)
         {
             qWarning("Net: Empty SERVERMESSAGE message");
@@ -276,7 +318,8 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "CHAT") {
+    if (lst[0] == "CHAT")
+    {
         if(lst.size() < 3)
         {
             qWarning("Net: Empty CHAT message");
@@ -289,7 +332,8 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "INFO") {
+    if (lst[0] == "INFO")
+    {
         if(lst.size() < 5)
         {
             qWarning("Net: Malformed INFO message");
@@ -304,7 +348,8 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "SERVER_VARS") {
+    if (lst[0] == "SERVER_VARS")
+    {
         QStringList tmp = lst;
         tmp.removeFirst();
         while (tmp.size() >= 2)
@@ -329,6 +374,7 @@ void HWNewNet::ParseCmd(const QStringList & lst)
 
         QString flags = lst[1];
         bool setFlag = flags[0] == '+';
+        const QStringList nicks = lst.mid(2);
 
         while(flags.size() > 1)
         {
@@ -337,80 +383,75 @@ void HWNewNet::ParseCmd(const QStringList & lst)
 
             switch(c)
             {
-            case 'r':
-                {
-                    for(int i = 2; i < lst.size(); ++i)
-                    {
-                        if (lst[i] == mynick)
-                            emit setMyReadyStatus(setFlag);
-                        emit setReadyStatus(lst[i], setFlag);
-                    }
-                }
+                // flag indicating if a player is ready to start a game
+                case 'r':
+                        foreach (const QString & nick, nicks)
+                        {
+                            if (nick == mynick)
+                            {
+                                if (isChief && !setFlag) ToggleReady();
+                                else emit setMyReadyStatus(setFlag);
+                            }
+                            m_playersModel->setFlag(nick, PlayersListModel::Ready, setFlag);
+                        }
+                        break;
+
+                // flag indicating if a player is a registered user
+                case 'u':
+                        foreach(const QString & nick, nicks)
+                            m_playersModel->setFlag(nick, PlayersListModel::Registered, setFlag);
+                        break;
+
+                case 'g':
+                        foreach(const QString & nick, nicks)
+                            m_playersModel->setFlag(nick, PlayersListModel::InGame, setFlag);
+                        break;
+
+                // flag indicating if a player is the host/master of the room
+                case 'h':
+                        foreach (const QString & nick, nicks)
+                        {
+                            if (nick == mynick)
+                            {
+                                isChief = setFlag;
+                                emit roomMaster(isChief);
+                            }
+
+                            m_playersModel->setFlag(nick, PlayersListModel::RoomAdmin, setFlag);
+                        }
+                        break;
+
+                // flag indicating if a player is admin (if so -> worship them!)
+                case 'a':
+                        foreach (const QString & nick, nicks)
+                        {
+                            if (nick == mynick)
+                                emit adminAccess(setFlag);
+
+                            m_playersModel->setFlag(nick, PlayersListModel::ServerAdmin, setFlag);
+                        }
+                        break;
+
+                default:
+                        qWarning() << "Net: Unknown client-flag: " << c;
             }
         }
 
         return;
     }
 
-    if (lst[0] == "ADD_TEAM") {
-        if(lst.size() != 24)
-        {
-            qWarning("Net: Bad ADDTEAM message");
-            return;
-        }
-        QStringList tmp = lst;
-        tmp.removeFirst();
-        emit AddNetTeam(tmp);
-        return;
-    }
-
-    if (lst[0] == "REMOVE_TEAM") {
-        if(lst.size() != 2)
-        {
-            qWarning("Net: Bad REMOVETEAM message");
-            return;
-        }
-        emit RemoveNetTeam(HWTeam(lst[1]));
-        return;
-    }
-
-    if(lst[0] == "ROOMABANDONED") {
-        netClientState = InLobby;
-        emit LeftRoom(tr("Room destroyed"));
-        return;
-    }
-
-    if(lst[0] == "KICKED") {
+    if(lst[0] == "KICKED")
+    {
         netClientState = InLobby;
+        askRoomsList();
         emit LeftRoom(tr("You got kicked"));
-        return;
-    }
-
-    if(lst[0] == "JOINED") {
-        if(lst.size() < 2)
-        {
-            qWarning("Net: Bad JOINED message");
-            return;
-        }
-
-        for(int i = 1; i < lst.size(); ++i)
-        {
-            if (lst[i] == mynick)
-            {
-                netClientState = InRoom;
-                emit EnteredGame();
-                emit roomMaster(isChief);
-                if (isChief)
-                    emit configAsked();
-            }
+        m_playersModel->resetRoomFlags();
 
-            emit nickAdded(lst[i], isChief && (lst[i] != mynick));
-            emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
-        }
         return;
     }
 
-    if(lst[0] == "LOBBY:JOINED") {
+    if(lst[0] == "LOBBY:JOINED")
+    {
         if(lst.size() < 2)
         {
             qWarning("Net: Bad JOINED message");
@@ -428,35 +469,45 @@ void HWNewNet::ParseCmd(const QStringList & lst)
 
             emit nickAddedLobby(lst[i], false);
             emit chatStringLobby(lst[i], tr("%1 *** %2 has joined").arg('\x03').arg("|nick|"));
+            m_playersModel->addPlayer(lst[i]);
         }
         return;
     }
 
-    if(lst[0] == "LEFT") {
-        if(lst.size() < 2)
-        {
-            qWarning("Net: Bad LEFT message");
-            return;
-        }
-        emit nickRemoved(lst[1]);
-        if (lst.size() < 3)
-            emit chatStringFromNet(tr("%1 *** %2 has left").arg('\x03').arg(lst[1]));
-        else
-            emit chatStringFromNet(tr("%1 *** %2 has left (%3)").arg('\x03').arg(lst[1], lst[2]));
+    if(lst[0] == "ROOM" && lst.size() == 10 && lst[1] == "ADD")
+    {
+        QStringList tmp = lst;
+        tmp.removeFirst();
+        tmp.removeFirst();
+
+        m_roomsListModel->addRoom(tmp);
         return;
     }
 
-    if(lst[0] == "ROOM") {
-        if(lst.size() < 2)
-        {
-            qWarning("Net: Bad ROOM message");
-            return;
-        }
-        RawSendNet(QString("LIST"));
+    if(lst[0] == "ROOM" && lst.size() == 11 && lst[1] == "UPD")
+    {
+        QStringList tmp = lst;
+        tmp.removeFirst();
+        tmp.removeFirst();
+
+        QString roomName = tmp.takeFirst();
+        m_roomsListModel->updateRoom(roomName, tmp);
+
+        // keep track of room name so correct name is displayed when you become room admin
+        if(myroom == roomName)
+            myroom = tmp[1];
+
         return;
     }
 
-    if(lst[0] == "LOBBY:LEFT") {
+    if(lst[0] == "ROOM" && lst.size() == 3 && lst[1] == "DEL")
+    {
+        m_roomsListModel->removeRoom(lst[2]);
+        return;
+    }
+
+    if(lst[0] == "LOBBY:LEFT")
+    {
         if(lst.size() < 2)
         {
             qWarning("Net: Bad LOBBY:LEFT message");
@@ -467,21 +518,20 @@ void HWNewNet::ParseCmd(const QStringList & lst)
             emit chatStringLobby(tr("%1 *** %2 has left").arg('\x03').arg(lst[1]));
         else
             emit chatStringLobby(lst[1], tr("%1 *** %2 has left (%3)").arg('\x03').arg("|nick|", lst[2]));
-        return;
-    }
 
-    if (lst[0] == "RUN_GAME") {
-        netClientState = InGame;
-        emit AskForRunGame();
+        m_playersModel->removePlayer(lst[1]);
+
         return;
     }
 
-    if (lst[0] == "ASKPASSWORD") {
+    if (lst[0] == "ASKPASSWORD")
+    {
         emit AskForPassword(mynick);
         return;
     }
 
-    if (lst[0] == "NOTICE") {
+    if (lst[0] == "NOTICE")
+    {
         if(lst.size() < 2)
         {
             qWarning("Net: Bad NOTICE message");
@@ -501,139 +551,246 @@ void HWNewNet::ParseCmd(const QStringList & lst)
         return;
     }
 
-    if (lst[0] == "TEAM_ACCEPTED") {
-        if (lst.size() != 2)
+    if (lst[0] == "BYE")
+    {
+        if (lst.size() < 2)
         {
-            qWarning("Net: Bad TEAM_ACCEPTED message");
+            qWarning("Net: Bad BYE message");
             return;
         }
-        emit TeamAccepted(lst[1]);
+        if (lst[1] == "Authentication failed")
+        {
+            emit AuthFailed();
+        }
+        m_game_connected = false;
+        Disconnect();
+        emit disconnected(lst[1]);
         return;
     }
 
+    if (lst[0] == "ADMIN_ACCESS")
+    {
+        // obsolete, see +a client flag
+        return;
+    }
 
-    if (lst[0] == "CFG") {
-        if(lst.size() < 3)
+    if(netClientState == InLobby && lst[0] == "JOINED")
+    {
+        if(lst.size() < 2 || lst[1] != mynick)
         {
-            qWarning("Net: Bad CFG message");
+            qWarning("Net: Bad JOINED message");
             return;
         }
-        QStringList tmp = lst;
-        tmp.removeFirst();
-        tmp.removeFirst();
-        if (lst[1] == "SCHEME")
-            emit netSchemeConfig(tmp);
-        else
-            emit paramChanged(lst[1], tmp);
+
+        for(int i = 1; i < lst.size(); ++i)
+        {
+            if (lst[i] == mynick)
+            {
+                netClientState = InRoom;
+                emit EnteredGame();
+                emit roomMaster(isChief);
+                if (isChief)
+                    emit configAsked();
+            }
+
+            emit nickAdded(lst[i], isChief && (lst[i] != mynick));
+            emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
+            m_playersModel->playerJoinedRoom(lst[i]);
+        }
         return;
     }
 
-    if (lst[0] == "HH_NUM") {
-        if (lst.size() != 3)
+    if(netClientState == InRoom || netClientState == InGame)
+    {
+        if (lst[0] == "EM")
         {
-            qWarning("Net: Bad TEAM_ACCEPTED message");
+            if(lst.size() < 2)
+            {
+                qWarning("Net: Bad EM message");
+                return;
+            }
+            for(int i = 1; i < lst.size(); ++i)
+            {
+                QByteArray em = QByteArray::fromBase64(lst[i].toAscii());
+                emit FromNet(em);
+            }
             return;
         }
-        HWTeam tmptm(lst[1]);
-        tmptm.setNumHedgehogs(lst[2].toUInt());
-        emit hhnumChanged(tmptm);
-        return;
-    }
 
-    if (lst[0] == "TEAM_COLOR") {
-        if (lst.size() != 3)
+        if (lst[0] == "ADD_TEAM")
         {
-            qWarning("Net: Bad TEAM_COLOR message");
+            if(lst.size() != 24)
+            {
+                qWarning("Net: Bad ADDTEAM message");
+                return;
+            }
+            QStringList tmp = lst;
+            tmp.removeFirst();
+            emit AddNetTeam(tmp);
             return;
         }
-        HWTeam tmptm(lst[1]);
-        tmptm.setColor(QColor(lst[2]));
-        emit teamColorChanged(tmptm);
-        return;
-    }
 
-    if (lst[0] == "EM") {
-        if(lst.size() < 2)
+        if (lst[0] == "REMOVE_TEAM")
         {
-            qWarning("Net: Bad EM message");
+            if(lst.size() != 2)
+            {
+                qWarning("Net: Bad REMOVETEAM message");
+                return;
+            }
+            emit RemoveNetTeam(HWTeam(lst[1]));
             return;
         }
-        for(int i = 1; i < lst.size(); ++i)
+
+        if(lst[0] == "ROOMABANDONED")
         {
-            QByteArray em = QByteArray::fromBase64(lst[i].toAscii());
-            emit FromNet(em);
+            netClientState = InLobby;
+            m_playersModel->resetRoomFlags();
+            emit LeftRoom(tr("Room destroyed"));
+            return;
         }
-        return;
-    }
 
-    if (lst[0] == "BYE") {
-        if (lst.size() < 2)
+        if (lst[0] == "RUN_GAME")
         {
-            qWarning("Net: Bad BYE message");
+            netClientState = InGame;
+            emit AskForRunGame();
             return;
         }
-        if (lst[1] == "Authentication failed")
+
+        if (lst[0] == "TEAM_ACCEPTED")
         {
-            emit AuthFailed();
+            if (lst.size() != 2)
+            {
+                qWarning("Net: Bad TEAM_ACCEPTED message");
+                return;
+            }
+            emit TeamAccepted(lst[1]);
+            return;
         }
-        m_game_connected = false;
-        Disconnect();
-        emit disconnected(lst[1]);
-        return;
-    }
 
+        if (lst[0] == "CFG")
+        {
+            if(lst.size() < 3)
+            {
+                qWarning("Net: Bad CFG message");
+                return;
+            }
+            QStringList tmp = lst;
+            tmp.removeFirst();
+            tmp.removeFirst();
+            if (lst[1] == "SCHEME")
+                emit netSchemeConfig(tmp);
+            else
+                emit paramChanged(lst[1], tmp);
+            return;
+        }
 
-    if (lst[0] == "ADMIN_ACCESS") {
-        emit adminAccess(true);
-        return;
-    }
+        if (lst[0] == "HH_NUM")
+        {
+            if (lst.size() != 3)
+            {
+                qWarning("Net: Bad TEAM_ACCEPTED message");
+                return;
+            }
+            HWTeam tmptm(lst[1]);
+            tmptm.setNumHedgehogs(lst[2].toUInt());
+            emit hhnumChanged(tmptm);
+            return;
+        }
 
-    if (lst[0] == "ROOM_CONTROL_ACCESS") {
-        if (lst.size() < 2)
+        if (lst[0] == "TEAM_COLOR")
         {
-            qWarning("Net: Bad ROOM_CONTROL_ACCESS message");
+            if (lst.size() != 3)
+            {
+                qWarning("Net: Bad TEAM_COLOR message");
+                return;
+            }
+            HWTeam tmptm(lst[1]);
+            tmptm.setColor(lst[2].toInt());
+            emit teamColorChanged(tmptm);
+            return;
+        }
+
+        if(lst[0] == "JOINED")
+        {
+            if(lst.size() < 2)
+            {
+                qWarning("Net: Bad JOINED message");
+                return;
+            }
+
+            for(int i = 1; i < lst.size(); ++i)
+            {
+                emit nickAdded(lst[i], isChief && (lst[i] != mynick));
+                emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
+                m_playersModel->playerJoinedRoom(lst[i]);
+            }
+            return;
+        }
+
+        if(lst[0] == "LEFT")
+        {
+            if(lst.size() < 2)
+            {
+                qWarning("Net: Bad LEFT message");
+                return;
+            }
+            emit nickRemoved(lst[1]);
+            if (lst.size() < 3)
+                emit chatStringFromNet(tr("%1 *** %2 has left").arg('\x03').arg(lst[1]));
+            else
+                emit chatStringFromNet(tr("%1 *** %2 has left (%3)").arg('\x03').arg(lst[1], lst[2]));
+            m_playersModel->playerLeftRoom(lst[1]);
+            return;
+        }
+
+        // obsolete
+        if (lst[0] == "ROOM_CONTROL_ACCESS")
+        {
+            if (lst.size() < 2)
+            {
+                qWarning("Net: Bad ROOM_CONTROL_ACCESS message");
+                return;
+            }
             return;
         }
-        isChief = (lst[1] != "0");
-        emit roomMaster(isChief);
-        return;
     }
 
-    qWarning() << "Net: Unknown message:" << lst;
+    qWarning() << "Net: Unknown message or wrong state:" << lst;
 }
 
 void HWNewNet::onHedgehogsNumChanged(const HWTeam& team)
 {
     if (isChief)
-    RawSendNet(QString("HH_NUM%1%2%1%3")
-            .arg(delimeter)
-            .arg(team.name())
-            .arg(team.numHedgehogs()));
+        RawSendNet(QString("HH_NUM%1%2%1%3")
+                   .arg(delimeter)
+                   .arg(team.name())
+                   .arg(team.numHedgehogs()));
 }
 
 void HWNewNet::onTeamColorChanged(const HWTeam& team)
 {
     if (isChief)
-    RawSendNet(QString("TEAM_COLOR%1%2%1%3")
-            .arg(delimeter)
-            .arg(team.name())
-            .arg(team.color().name()));
+        RawSendNet(QString("TEAM_COLOR%1%2%1%3")
+                   .arg(delimeter)
+                   .arg(team.name())
+                   .arg(team.color()));
 }
 
 void HWNewNet::onParamChanged(const QString & param, const QStringList & value)
 {
     if (isChief)
         RawSendNet(
-                QString("CFG%1%2%1%3")
-                    .arg(delimeter)
-                    .arg(param)
-                    .arg(value.join(QString(delimeter)))
-                );
+            QString("CFG%1%2%1%3")
+            .arg(delimeter)
+            .arg(param)
+            .arg(value.join(QString(delimeter)))
+        );
 }
 
 void HWNewNet::chatLineToNet(const QString& str)
 {
-    if(str != "") {
+    if(str != "")
+    {
         RawSendNet(QString("CHAT") + delimeter + str);
         emit(chatStringFromMe(HWProto::formatChatMsg(mynick, str)));
     }
@@ -641,7 +798,8 @@ void HWNewNet::chatLineToNet(const QString& str)
 
 void HWNewNet::chatLineToLobby(const QString& str)
 {
-    if(str != "") {
+    if(str != "")
+    {
         RawSendNet(QString("CHAT") + delimeter + str);
         emit chatStringLobby(mynick, HWProto::formatChatMsgForFrontend(str));
     }
@@ -689,8 +847,11 @@ bool HWNewNet::isRoomChief()
 
 void HWNewNet::gameFinished(bool correctly)
 {
-    if (netClientState == InGame) netClientState = InRoom;
-    RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimeter).arg(correctly ? "1" : "0"));
+    if (netClientState == InGame)
+    {
+        netClientState = InRoom;
+        RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimeter).arg(correctly ? "1" : "0"));
+    }
 }
 
 void HWNewNet::banPlayer(const QString & nick)
@@ -710,7 +871,8 @@ void HWNewNet::infoPlayer(const QString & nick)
 
 void HWNewNet::followPlayer(const QString & nick)
 {
-    if (!isInRoom()) {
+    if (!isInRoom())
+    {
         RawSendNet(QString("FOLLOW%1%2").arg(delimeter).arg(nick));
         isChief = false;
     }
@@ -745,6 +907,7 @@ void HWNewNet::clearAccountsCache()
 void HWNewNet::partRoom()
 {
     netClientState = InLobby;
+    m_playersModel->resetRoomFlags();
     RawSendNet(QString("PART"));
 }
 
@@ -784,3 +947,18 @@ void HWNewNet::handleNotice(int n)
         }
     }
 }
+
+RoomsListModel * HWNewNet::roomsListModel()
+{
+    return m_roomsListModel;
+}
+
+QAbstractItemModel *HWNewNet::lobbyPlayersModel()
+{
+    return m_lobbyPlayersModel;
+}
+
+QAbstractItemModel *HWNewNet::roomPlayersModel()
+{
+    return m_roomPlayersModel;
+}
diff --git a/QTfrontend/net/newnetclient.h b/QTfrontend/net/newnetclient.h
index 8724f9a..7428611 100644
--- a/QTfrontend/net/newnetclient.h
+++ b/QTfrontend/net/newnetclient.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,147 +31,159 @@
 class GameUIConfig;
 class GameCFGWidget;
 class TeamSelWidget;
+class RoomsListModel;
+class PlayersListModel;
+class QSortFilterProxyModel;
+class QAbstractItemModel;
 
 extern char delimeter;
 
 class HWNewNet : public QObject
 {
-  Q_OBJECT
-
- public:
-  enum ClientState { Disconnected, Connecting, Connected, InLobby, InRoom, InGame };
-
-  HWNewNet();
-  ~HWNewNet();
-  void Connect(const QString & hostName, quint16 port, const QString & nick);
-  void Disconnect();
-  void SendPasswordHash(const QString & hash);
-  void NewNick(const QString & nick);
-  bool isRoomChief();
-  bool isInRoom();
-  ClientState clientState();
-  QString getNick();
-  QString getRoom();
-  QString getHost();
-
- private:
-  bool isChief;
-  QString mynick;
-  QString myroom;
-  QString myhost;
-  QTcpSocket NetSocket;
-  QString seed;
-  bool m_game_connected;
-
-  template <typename T>
-  void SendCfgStrNet(T a) {
-    QByteArray strmsg;
-    strmsg.append(a);
-    quint8 sz = strmsg.size();
-    QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg;
-    QString _msg = delimeter + QString(enginemsg.toBase64());
-    RawSendNet(_msg);
-  }
-
-  template <typename T>
-  void SendCfgStrLoc(T a) {
-    QByteArray strmsg;
-    strmsg.append(QString(a).toUtf8());
-    quint8 sz = strmsg.size();
-    QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg;
-    emit FromNet(enginemsg);
-  }
-
-  QStringList cmdbuf;
-
-  void RawSendNet(const QString & buf);
-  void RawSendNet(const QByteArray & buf);
-  void ParseCmd(const QStringList & lst);
-  void handleNotice(int n);
-
-  int loginStep;
-  ClientState netClientState;
-
- signals:
-  void AskForRunGame();
-  void connected();
-  void disconnected(const QString & reason);
-  void Error(const QString & errmsg);
-  void Warning(const QString & wrnmsg);
-  void AskForPassword(const QString & nick);
-  void NickTaken(const QString & nick);
-  void AuthFailed();
-  void EnteredGame();
-  void LeftRoom(const QString & reason);
-  void nickAdded(const QString& nick, bool notifyNick);
-  void nickRemoved(const QString& nick);
-  void nickAddedLobby(const QString& nick, bool notifyNick);
-  void nickRemovedLobby(const QString& nick);
-  void FromNet(const QByteArray & buf);
-  void adminAccess(bool);
-  void roomMaster(bool);
-
-  void netSchemeConfig(QStringList &);
-  void paramChanged(const QString & param, const QStringList & value);
-  void configAsked();
-
-  void TeamAccepted(const QString&);
-  void AddNetTeam(const HWTeam&);
-  void RemoveNetTeam(const HWTeam&);
-  void hhnumChanged(const HWTeam&);
-  void teamColorChanged(const HWTeam&);
-  void chatStringLobby(const QString&);
-  void chatStringLobby(const QString&, const QString&);
-  void chatStringFromNet(const QString&);
-  void chatStringFromMe(const QString&);
-  void chatStringFromMeLobby(const QString&);
-
-  void roomsList(const QStringList&);
-  void serverMessage(const QString &);
-  void serverMessageNew(const QString &);
-  void serverMessageOld(const QString &);
-  void latestProtocolVar(int);
-
-  void setReadyStatus(const QString & nick, bool isReady);
-  void setMyReadyStatus(bool isReady);
-
- public slots:
-  void ToggleReady();
-  void chatLineToNet(const QString& str);
-  void chatLineToLobby(const QString& str);
-  void SendTeamMessage(const QString& str);
-  void SendNet(const QByteArray & buf);
-  void AddTeam(const HWTeam & team);
-  void RemoveTeam(const HWTeam& team);
-  void onHedgehogsNumChanged(const HWTeam& team);
-  void onTeamColorChanged(const HWTeam& team);
-  void onParamChanged(const QString & param, const QStringList & value);
-
-  void setServerMessageNew(const QString &);
-  void setServerMessageOld(const QString &);
-  void setLatestProtocolVar(int proto);
-  void askServerVars();
-
-  void JoinRoom(const QString & room);
-  void CreateRoom(const QString & room);
-  void updateRoomName(const QString &);
-  void askRoomsList();
-  void gameFinished(bool correcly);
-  void banPlayer(const QString &);
-  void kickPlayer(const QString &);
-  void infoPlayer(const QString &);
-  void followPlayer(const QString &);
-  void startGame();
-  void toggleRestrictJoins();
-  void toggleRestrictTeamAdds();
-  void partRoom();
-  void clearAccountsCache();
-
- private slots:
-  void ClientRead();
-  void OnConnect();
-  void OnDisconnect();
-  void displayError(QAbstractSocket::SocketError socketError); 
+        Q_OBJECT
+
+    public:
+        enum ClientState { Disconnected, Connecting, Connected, InLobby, InRoom, InGame };
+
+        HWNewNet();
+        ~HWNewNet();
+        void Connect(const QString & hostName, quint16 port, const QString & nick);
+        void Disconnect();
+        void SendPasswordHash(const QString & hash);
+        void NewNick(const QString & nick);
+        bool isRoomChief();
+        bool isInRoom();
+        ClientState clientState();
+        QString getNick();
+        QString getRoom();
+        QString getHost();
+        RoomsListModel * roomsListModel();
+        QAbstractItemModel * lobbyPlayersModel();
+        QAbstractItemModel * roomPlayersModel();
+
+    private:
+        bool isChief;
+        QString mynick;
+        QString myroom;
+        QString myhost;
+        QTcpSocket NetSocket;
+        QString seed;
+        bool m_game_connected;
+        RoomsListModel * m_roomsListModel;
+        PlayersListModel * m_playersModel;
+        QSortFilterProxyModel * m_lobbyPlayersModel;
+        QSortFilterProxyModel * m_roomPlayersModel;
+
+        template <typename T>
+        void SendCfgStrNet(T a)
+        {
+            QByteArray strmsg;
+            strmsg.append(a);
+            quint8 sz = strmsg.size();
+            QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg;
+            QString _msg = delimeter + QString(enginemsg.toBase64());
+            RawSendNet(_msg);
+        }
+
+        template <typename T>
+        void SendCfgStrLoc(T a)
+        {
+            QByteArray strmsg;
+            strmsg.append(QString(a).toUtf8());
+            quint8 sz = strmsg.size();
+            QByteArray enginemsg = QByteArray((char *)&sz, 1) + strmsg;
+            emit FromNet(enginemsg);
+        }
+
+        QStringList cmdbuf;
+
+        void RawSendNet(const QString & buf);
+        void RawSendNet(const QByteArray & buf);
+        void ParseCmd(const QStringList & lst);
+        void handleNotice(int n);
+
+        int loginStep;
+        ClientState netClientState;
+
+    signals:
+        void AskForRunGame();
+        void connected();
+        void disconnected(const QString & reason);
+        void Error(const QString & errmsg);
+        void Warning(const QString & wrnmsg);
+        void AskForPassword(const QString & nick);
+        void NickTaken(const QString & nick);
+        void AuthFailed();
+        void EnteredGame();
+        void LeftRoom(const QString & reason);
+        void nickAdded(const QString& nick, bool notifyNick);
+        void nickRemoved(const QString& nick);
+        void nickAddedLobby(const QString& nick, bool notifyNick);
+        void nickRemovedLobby(const QString& nick);
+        void FromNet(const QByteArray & buf);
+        void adminAccess(bool);
+        void roomMaster(bool);
+
+        void netSchemeConfig(QStringList &);
+        void paramChanged(const QString & param, const QStringList & value);
+        void configAsked();
+
+        void TeamAccepted(const QString&);
+        void AddNetTeam(const HWTeam&);
+        void RemoveNetTeam(const HWTeam&);
+        void hhnumChanged(const HWTeam&);
+        void teamColorChanged(const HWTeam&);
+        void chatStringLobby(const QString&);
+        void chatStringLobby(const QString&, const QString&);
+        void chatStringFromNet(const QString&);
+        void chatStringFromMe(const QString&);
+        void chatStringFromMeLobby(const QString&);
+
+        void roomsList(const QStringList&);
+        void serverMessage(const QString &);
+        void serverMessageNew(const QString &);
+        void serverMessageOld(const QString &);
+        void latestProtocolVar(int);
+
+        void setMyReadyStatus(bool isReady);
+
+    public slots:
+        void ToggleReady();
+        void chatLineToNet(const QString& str);
+        void chatLineToLobby(const QString& str);
+        void SendTeamMessage(const QString& str);
+        void SendNet(const QByteArray & buf);
+        void AddTeam(const HWTeam & team);
+        void RemoveTeam(const HWTeam& team);
+        void onHedgehogsNumChanged(const HWTeam& team);
+        void onTeamColorChanged(const HWTeam& team);
+        void onParamChanged(const QString & param, const QStringList & value);
+
+        void setServerMessageNew(const QString &);
+        void setServerMessageOld(const QString &);
+        void setLatestProtocolVar(int proto);
+        void askServerVars();
+
+        void JoinRoom(const QString & room);
+        void CreateRoom(const QString & room);
+        void updateRoomName(const QString &);
+        void askRoomsList();
+        void gameFinished(bool correcly);
+        void banPlayer(const QString &);
+        void kickPlayer(const QString &);
+        void infoPlayer(const QString &);
+        void followPlayer(const QString &);
+        void startGame();
+        void toggleRestrictJoins();
+        void toggleRestrictTeamAdds();
+        void partRoom();
+        void clearAccountsCache();
+
+    private slots:
+        void ClientRead();
+        void OnConnect();
+        void OnDisconnect();
+        void displayError(QAbstractSocket::SocketError socketError);
 };
 
 #endif // _NEW_NETCLIENT_INCLUDED
diff --git a/QTfrontend/net/proto.cpp b/QTfrontend/net/proto.cpp
index c638b5f..dc090cd 100644
--- a/QTfrontend/net/proto.cpp
+++ b/QTfrontend/net/proto.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/net/proto.h b/QTfrontend/net/proto.h
index c7fe07f..edcf67a 100644
--- a/QTfrontend/net/proto.h
+++ b/QTfrontend/net/proto.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,15 +26,15 @@
 
 class HWProto : public QObject
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    HWProto();
-    static QByteArray & addStringToBuffer(QByteArray & buf, const QString & string);
-    static QByteArray & addByteArrayToBuffer(QByteArray & buf, const QByteArray & msg);
-    static QByteArray & addStringListToBuffer(QByteArray & buf, const QStringList & strList);
-    static QString formatChatMsg(const QString & nick, const QString & msg);
-    static QString formatChatMsgForFrontend(const QString & msg);
+    public:
+        HWProto();
+        static QByteArray & addStringToBuffer(QByteArray & buf, const QString & string);
+        static QByteArray & addByteArrayToBuffer(QByteArray & buf, const QByteArray & msg);
+        static QByteArray & addStringListToBuffer(QByteArray & buf, const QStringList & strList);
+        static QString formatChatMsg(const QString & nick, const QString & msg);
+        static QString formatChatMsgForFrontend(const QString & msg);
 };
 
 #endif // _PROTO_H
diff --git a/QTfrontend/net/recorder.cpp b/QTfrontend/net/recorder.cpp
new file mode 100644
index 0000000..7fd07b6
--- /dev/null
+++ b/QTfrontend/net/recorder.cpp
@@ -0,0 +1,130 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QString>
+#include <QByteArray>
+
+#include "recorder.h"
+#include "gameuiconfig.h"
+#include "hwconsts.h"
+#include "game.h"
+#include "LibavInteraction.h"
+
+// Encoding is memory expensive process, so we need to limit maximum number
+// of simultaneous encoders.
+static const int maxRecorders = 3;
+static int numRecorders = 0;
+
+static QList<HWRecorder*> queue;
+
+HWRecorder::HWRecorder(GameUIConfig * config, const QString &prefix) :
+    TCPBase(false)
+{
+    this->config = config;
+    this->prefix = prefix;
+    finished = false;
+    name = prefix + "." + LibavInteraction::instance().getExtension(config->AVFormat());
+}
+
+HWRecorder::~HWRecorder()
+{
+    emit encodingFinished(finished);
+    if (queue.empty())
+        numRecorders--;
+    else
+        queue.takeFirst()->Start();
+}
+
+void HWRecorder::onClientDisconnect()
+{
+}
+
+void HWRecorder::onClientRead()
+{
+    quint8 msglen;
+    quint32 bufsize;
+    while (!readbuffer.isEmpty() && ((bufsize = readbuffer.size()) > 0) &&
+            ((msglen = readbuffer.data()[0]) < bufsize))
+    {
+        QByteArray msg = readbuffer.left(msglen + 1);
+        readbuffer.remove(0, msglen + 1);
+        switch (msg.at(1))
+        {
+        case '?':
+            SendIPC("!");
+            break;
+        case 'p':
+            emit onProgress((quint8(msg.at(2))*256.0 + quint8(msg.at(3)))*0.0001);
+            break;
+        case 'v':
+            finished = true;
+            break;
+        }
+    }
+}
+
+void HWRecorder::EncodeVideo(const QByteArray & record)
+{
+    toSendBuf = record;
+    toSendBuf.replace(QByteArray("\x02TD"), QByteArray("\x02TV"));
+    toSendBuf.replace(QByteArray("\x02TL"), QByteArray("\x02TV"));
+    toSendBuf.replace(QByteArray("\x02TN"), QByteArray("\x02TV"));
+    toSendBuf.replace(QByteArray("\x02TS"), QByteArray("\x02TV"));
+
+    if (numRecorders < maxRecorders)
+    {
+        numRecorders++;
+        Start(); // run engine
+    }
+    else
+        queue.push_back(this);
+}
+
+QStringList HWRecorder::getArguments()
+{
+    QStringList arguments;
+    QRect resolution = config->rec_Resolution();
+    arguments << cfgdir->absolutePath();
+    arguments << QString::number(resolution.width());
+    arguments << QString::number(resolution.height());
+    arguments << "32"; // bpp
+    arguments << QString("%1").arg(ipc_port);
+    arguments << "0"; // fullscreen
+    arguments << "0"; // sound
+    arguments << "0"; // music
+    arguments << "0"; // sound volume
+    arguments << QString::number(config->timerInterval());
+    arguments << datadir->absolutePath();
+    arguments << "0"; // fps
+    arguments << (config->isAltDamageEnabled() ? "1" : "0");
+    arguments << config->netNick().toUtf8().toBase64();
+    arguments << QString::number(config->translateQuality());
+    arguments << QString::number(config->stereoMode());
+    arguments << HWGame::tr("en.txt");
+    arguments << QString::number(config->rec_Framerate()); // framerate numerator
+    arguments << "1";  // framerate denominator
+    arguments << prefix;
+    arguments << config->AVFormat();
+    arguments << config->videoCodec();
+// Could use a field to use quality instead. maybe quality could override bitrate - or just pass (and set) both. 
+// The library does support using both at once after all.
+    arguments << QString::number(config->rec_Bitrate()*1024);
+    arguments << (config->recordAudio() ? config->audioCodec() : "no");
+
+    return arguments;
+}
diff --git a/QTfrontend/net/recorder.h b/QTfrontend/net/recorder.h
new file mode 100644
index 0000000..c577dab
--- /dev/null
+++ b/QTfrontend/net/recorder.h
@@ -0,0 +1,58 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef RECORDER_H
+#define RECORDER_H
+
+#include <QString>
+#include <QByteArray>
+
+#include "tcpBase.h"
+
+class GameUIConfig;
+class VideoItem;
+
+class HWRecorder : public TCPBase
+{
+        Q_OBJECT
+    public:
+        HWRecorder(GameUIConfig * config, const QString & prefix);
+        virtual ~HWRecorder();
+
+        void EncodeVideo(const QByteArray & record);
+
+        VideoItem * item; // used by pagevideos
+        QString name;
+        QString prefix;
+
+    protected:
+        // virtuals from TCPBase
+        virtual QStringList getArguments();
+        virtual void onClientRead();
+        virtual void onClientDisconnect();
+
+    signals:
+        void onProgress(float progress); // 0 < progress < 1
+        void encodingFinished(bool success);
+
+    private:
+        bool finished;
+        GameUIConfig * config;
+};
+
+#endif // RECORDER_H
diff --git a/QTfrontend/net/tcpBase.cpp b/QTfrontend/net/tcpBase.cpp
index b434403..ec73912 100644
--- a/QTfrontend/net/tcpBase.cpp
+++ b/QTfrontend/net/tcpBase.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,7 +21,7 @@
 
 #include <QMessageBox>
 #include <QList>
-
+#include <QApplication>
 #include <QImage>
 
 #include "hwconsts.h"
@@ -31,99 +31,124 @@ QPointer<QTcpServer> TCPBase::IPCServer(0);
 
 TCPBase::~TCPBase()
 {
+    if (IPCSocket)
+        IPCSocket->deleteLater();
 }
 
 TCPBase::TCPBase(bool demoMode) :
-  m_isDemoMode(demoMode),
-  IPCSocket(0)
+    m_isDemoMode(demoMode),
+    IPCSocket(0)
 {
-  if(!IPCServer) {
-    IPCServer = new QTcpServer(0);
-    IPCServer->setMaxPendingConnections(1);
-    if (!IPCServer->listen(QHostAddress::LocalHost)) {
-      QMessageBox::critical(0, tr("Error"),
-                tr("Unable to start the server: %1.")
-                .arg(IPCServer->errorString()));
-      exit(0); // FIXME - should be graceful exit here
+    if(!IPCServer)
+    {
+        IPCServer = new QTcpServer(0);
+        IPCServer->setMaxPendingConnections(1);
+        if (!IPCServer->listen(QHostAddress::LocalHost))
+        {
+            QMessageBox deniedMsg(QApplication::activeWindow());
+            deniedMsg.setIcon(QMessageBox::Critical);
+            deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error"));
+            deniedMsg.setText(QMessageBox::tr("Unable to start the server: %1.").arg(IPCServer->errorString()));
+            deniedMsg.setWindowModality(Qt::WindowModal);
+            deniedMsg.exec();
+
+            exit(0); // FIXME - should be graceful exit here (lower Critical -> Warning above when implemented)
+        }
     }
-  }
-  ipc_port=IPCServer->serverPort();
+    ipc_port=IPCServer->serverPort();
 }
 
 void TCPBase::NewConnection()
 {
-  if(IPCSocket) {
-    // connection should be already finished
-    return;
-  }
-  disconnect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
-  IPCSocket = IPCServer->nextPendingConnection();
-  if(!IPCSocket) return;
-  connect(IPCSocket, SIGNAL(disconnected()), this, SLOT(ClientDisconnect()));
-  connect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
-  SendToClientFirst();
+    if(IPCSocket)
+    {
+        // connection should be already finished
+        return;
+    }
+    disconnect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
+    IPCSocket = IPCServer->nextPendingConnection();
+    if(!IPCSocket) return;
+    connect(IPCSocket, SIGNAL(disconnected()), this, SLOT(ClientDisconnect()));
+    connect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
+    SendToClientFirst();
+
+    if(srvsList.size()==1) srvsList.pop_front();
+    emit isReadyNow();
 }
 
 void TCPBase::RealStart()
 {
-  connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
-  IPCSocket = 0;
-
-  QProcess * process;
-  process = new QProcess;
-  connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
-  QStringList arguments=getArguments();
-
-  // redirect everything written on stdout/stderr
-  if(isDevBuild)
-    process->setProcessChannelMode(QProcess::ForwardedChannels);
-  process->start(bindir->absolutePath() + "/hwengine", arguments);
+    connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
+    IPCSocket = 0;
+
+    QProcess * process;
+    process = new QProcess;
+    connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
+    QStringList arguments=getArguments();
+
+    // redirect everything written on stdout/stderr
+    if(isDevBuild)
+        process->setProcessChannelMode(QProcess::ForwardedChannels);
+    process->start(bindir->absolutePath() + "/hwengine", arguments);
 }
 
 void TCPBase::ClientDisconnect()
 {
-  disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
-  onClientDisconnect();
+    disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
+    onClientDisconnect();
+
+ /*   if(srvsList.size()==1) srvsList.pop_front();
+    emit isReadyNow();*/
+    IPCSocket->deleteLater();
+
+    // make sure this object is not in the server list anymore
+    srvsList.removeOne(this);
 
-  if(srvsList.size()==1) srvsList.pop_front();
-  emit isReadyNow();
-  IPCSocket->deleteLater();
-  deleteLater();
+    deleteLater();
 }
 
 void TCPBase::ClientRead()
 {
-  QByteArray readed=IPCSocket->readAll();
-  if(readed.isEmpty()) return;
-  readbuffer.append(readed);
-  onClientRead();
+    QByteArray readed=IPCSocket->readAll();
+    if(readed.isEmpty()) return;
+    readbuffer.append(readed);
+    onClientRead();
 }
 
 void TCPBase::StartProcessError(QProcess::ProcessError error)
 {
-  QMessageBox::critical(0, tr("Error"),
-            tr("Unable to run engine: %1 (")
-            .arg(error) + bindir->absolutePath() + "/hwengine)");
+    QMessageBox deniedMsg(QApplication::activeWindow());
+    deniedMsg.setIcon(QMessageBox::Critical);
+    deniedMsg.setWindowTitle(QMessageBox::tr("TCP - Error"));
+    deniedMsg.setText(QMessageBox::tr("Unable to run engine at ") + bindir->absolutePath() + "/hwengine\n" +
+                      QMessageBox::tr("Error code: %1").arg(error));
+    deniedMsg.setWindowModality(Qt::WindowModal);
+    deniedMsg.exec();
+
+    ClientDisconnect();
 }
 
 void TCPBase::tcpServerReady()
 {
-  disconnect(srvsList.takeFirst(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
+    disconnect(srvsList.takeFirst(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
 
-  RealStart();
+    RealStart();
 }
 
 void TCPBase::Start()
 {
-  if(srvsList.isEmpty()) {
-    srvsList.push_back(this);
-  } else {
-    connect(srvsList.back(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
-    srvsList.push_back(this);
-    return;
-  }
-
-  RealStart();
+    if(srvsList.isEmpty())
+    {
+        srvsList.push_back(this);
+    }
+    else
+    {
+        connect(srvsList.back(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
+        srvsList.push_back(this);
+        return;
+    }
+
+    RealStart();
 }
 
 void TCPBase::onClientRead()
@@ -150,7 +175,8 @@ void TCPBase::RawSendIPC(const QByteArray & buf)
     if (!IPCSocket)
     {
         toSendBuf += buf;
-    } else
+    }
+    else
     {
         if (toSendBuf.size() > 0)
         {
@@ -158,9 +184,10 @@ void TCPBase::RawSendIPC(const QByteArray & buf)
             if(m_isDemoMode) demo.append(toSendBuf);
             toSendBuf.clear();
         }
-        if(!buf.isEmpty()) {
-          IPCSocket->write(buf);
-          if(m_isDemoMode) demo.append(buf);
+        if(!buf.isEmpty())
+        {
+            IPCSocket->write(buf);
+            if(m_isDemoMode) demo.append(buf);
         }
     }
 }
diff --git a/QTfrontend/net/tcpBase.h b/QTfrontend/net/tcpBase.h
index 875ccf5..3837006 100644
--- a/QTfrontend/net/tcpBase.h
+++ b/QTfrontend/net/tcpBase.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -35,47 +35,47 @@
 
 class TCPBase : public QObject
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  TCPBase(bool demoMode);
-  virtual ~TCPBase();
+    public:
+        TCPBase(bool demoMode);
+        virtual ~TCPBase();
 
- signals:
-  void isReadyNow();
+    signals:
+        void isReadyNow();
 
- protected:
-  quint16 ipc_port;
+    protected:
+        quint16 ipc_port;
 
-  void Start();
+        void Start();
 
-  QByteArray readbuffer;
+        QByteArray readbuffer;
 
-  QByteArray toSendBuf;
-  QByteArray demo;
+        QByteArray toSendBuf;
+        QByteArray demo;
 
-  void SendIPC(const QByteArray & buf);
-  void RawSendIPC(const QByteArray & buf);
+        void SendIPC(const QByteArray & buf);
+        void RawSendIPC(const QByteArray & buf);
 
-  virtual QStringList getArguments()=0;
-  virtual void onClientRead();
-  virtual void onClientDisconnect();
-  virtual void SendToClientFirst();
+        virtual QStringList getArguments()=0;
+        virtual void onClientRead();
+        virtual void onClientDisconnect();
+        virtual void SendToClientFirst();
 
- private:
-  static QPointer<QTcpServer> IPCServer;
+    private:
+        static QPointer<QTcpServer> IPCServer;
 
-  bool m_isDemoMode;
-  void RealStart();
-  QPointer<QTcpSocket> IPCSocket;
+        bool m_isDemoMode;
+        void RealStart();
+        QPointer<QTcpSocket> IPCSocket;
 
- private slots:
-  void NewConnection();
-  void ClientDisconnect();
-  void ClientRead();
-  void StartProcessError(QProcess::ProcessError error);
+    private slots:
+        void NewConnection();
+        void ClientDisconnect();
+        void ClientRead();
+        void StartProcessError(QProcess::ProcessError error);
 
-  void tcpServerReady();
+        void tcpServerReady();
 };
 
 #endif // _TCPBASE_INCLUDED
diff --git a/QTfrontend/res/BackgroundBirthday.png b/QTfrontend/res/BackgroundBirthday.png
new file mode 100644
index 0000000..19f8576
Binary files /dev/null and b/QTfrontend/res/BackgroundBirthday.png differ
diff --git a/QTfrontend/res/BackgroundChristmas.png b/QTfrontend/res/BackgroundChristmas.png
new file mode 100644
index 0000000..a87ed32
Binary files /dev/null and b/QTfrontend/res/BackgroundChristmas.png differ
diff --git a/QTfrontend/res/Background.png b/QTfrontend/res/BackgroundEaster.png
similarity index 100%
copy from QTfrontend/res/Background.png
copy to QTfrontend/res/BackgroundEaster.png
diff --git a/QTfrontend/res/Star.png b/QTfrontend/res/Confetti.png
similarity index 100%
copy from QTfrontend/res/Star.png
copy to QTfrontend/res/Confetti.png
diff --git a/QTfrontend/res/Star.png b/QTfrontend/res/Egg.png
similarity index 100%
copy from QTfrontend/res/Star.png
copy to QTfrontend/res/Egg.png
diff --git a/share/hedgewars/Data/Themes/Christmas/Snowball.png b/QTfrontend/res/Flake.png
similarity index 100%
copy from share/hedgewars/Data/Themes/Christmas/Snowball.png
copy to QTfrontend/res/Flake.png
diff --git a/QTfrontend/res/Videos.png b/QTfrontend/res/Videos.png
new file mode 100644
index 0000000..7af6860
Binary files /dev/null and b/QTfrontend/res/Videos.png differ
diff --git a/QTfrontend/res/chat/friend.png b/QTfrontend/res/chat/friend.png
new file mode 100644
index 0000000..1786227
Binary files /dev/null and b/QTfrontend/res/chat/friend.png differ
diff --git a/QTfrontend/res/chat/hedgehog.png b/QTfrontend/res/chat/hedgehog.png
new file mode 100644
index 0000000..fdf9993
Binary files /dev/null and b/QTfrontend/res/chat/hedgehog.png differ
diff --git a/QTfrontend/res/chat/hedgehog_gray.png b/QTfrontend/res/chat/hedgehog_gray.png
new file mode 100644
index 0000000..e2946f4
Binary files /dev/null and b/QTfrontend/res/chat/hedgehog_gray.png differ
diff --git a/QTfrontend/res/chat/ignore.png b/QTfrontend/res/chat/ignore.png
new file mode 100644
index 0000000..fc8209c
Binary files /dev/null and b/QTfrontend/res/chat/ignore.png differ
diff --git a/QTfrontend/res/chat/ingame.png b/QTfrontend/res/chat/ingame.png
new file mode 100644
index 0000000..4aaba31
Binary files /dev/null and b/QTfrontend/res/chat/ingame.png differ
diff --git a/QTfrontend/res/chat/lamp.png b/QTfrontend/res/chat/lamp.png
new file mode 100644
index 0000000..5b38d70
Binary files /dev/null and b/QTfrontend/res/chat/lamp.png differ
diff --git a/QTfrontend/res/chat_default_off.png b/QTfrontend/res/chat/lamp_off.png
similarity index 100%
rename from QTfrontend/res/chat_default_off.png
rename to QTfrontend/res/chat/lamp_off.png
diff --git a/QTfrontend/res/chat/roomadmin.png b/QTfrontend/res/chat/roomadmin.png
new file mode 100644
index 0000000..e027359
Binary files /dev/null and b/QTfrontend/res/chat/roomadmin.png differ
diff --git a/QTfrontend/res/chat/roomadmin_gray.png b/QTfrontend/res/chat/roomadmin_gray.png
new file mode 100644
index 0000000..0a34d12
Binary files /dev/null and b/QTfrontend/res/chat/roomadmin_gray.png differ
diff --git a/QTfrontend/res/chat/serveradmin.png b/QTfrontend/res/chat/serveradmin.png
new file mode 100644
index 0000000..5186c86
Binary files /dev/null and b/QTfrontend/res/chat/serveradmin.png differ
diff --git a/QTfrontend/res/chat/serveradmin_gray.png b/QTfrontend/res/chat/serveradmin_gray.png
new file mode 100644
index 0000000..7f4cb08
Binary files /dev/null and b/QTfrontend/res/chat/serveradmin_gray.png differ
diff --git a/QTfrontend/res/chat_default.png b/QTfrontend/res/chat_default.png
deleted file mode 100644
index 55281e5..0000000
Binary files a/QTfrontend/res/chat_default.png and /dev/null differ
diff --git a/QTfrontend/res/chat_default_on.png b/QTfrontend/res/chat_default_on.png
deleted file mode 100644
index d5edb8a..0000000
Binary files a/QTfrontend/res/chat_default_on.png and /dev/null differ
diff --git a/QTfrontend/res/chat_friend.png b/QTfrontend/res/chat_friend.png
deleted file mode 100644
index b26c7aa..0000000
Binary files a/QTfrontend/res/chat_friend.png and /dev/null differ
diff --git a/QTfrontend/res/chat_friend_off.png b/QTfrontend/res/chat_friend_off.png
deleted file mode 100644
index 45fed0e..0000000
Binary files a/QTfrontend/res/chat_friend_off.png and /dev/null differ
diff --git a/QTfrontend/res/chat_friend_on.png b/QTfrontend/res/chat_friend_on.png
deleted file mode 100644
index 5c8451c..0000000
Binary files a/QTfrontend/res/chat_friend_on.png and /dev/null differ
diff --git a/QTfrontend/res/chat_ignore.png b/QTfrontend/res/chat_ignore.png
deleted file mode 100644
index ca1cc04..0000000
Binary files a/QTfrontend/res/chat_ignore.png and /dev/null differ
diff --git a/QTfrontend/res/chat_ignore_off.png b/QTfrontend/res/chat_ignore_off.png
deleted file mode 100644
index e567c75..0000000
Binary files a/QTfrontend/res/chat_ignore_off.png and /dev/null differ
diff --git a/QTfrontend/res/chat_ignore_on.png b/QTfrontend/res/chat_ignore_on.png
deleted file mode 100644
index 887b521..0000000
Binary files a/QTfrontend/res/chat_ignore_on.png and /dev/null differ
diff --git a/QTfrontend/res/css/birthday.css b/QTfrontend/res/css/birthday.css
new file mode 100644
index 0000000..a8e462c
--- /dev/null
+++ b/QTfrontend/res/css/birthday.css
@@ -0,0 +1,248 @@
+/******************************************************************************
+ *
+ * CSS-like definition of Qt frontend appearance
+ *
+ ******************************************************************************
+ *
+ * see http://doc.qt.nokia.com/4.5/stylesheet.html
+ *
+ ******************************************************************************
+ *
+ * This file can be stored at different locations, but it will be read only
+ * once, based on first file found in this order:
+ *
+ *    <userdir>/Data/css/birthday.css
+ *    <datadir>/css/birthday.css
+ *    <internal default style-sheet> (:/res/css/birthday.css)
+ *
+ *****************************************************************************/
+
+HWForm,QDialog {
+background-image: url(":/res/BackgroundBirthday.png");
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #100308;
+}
+
+* {
+color: #ffcc00;
+selection-background-color: #ffcc00;
+selection-color: #00351d;
+}
+
+a { color:#c8c8ff; }
+
+QLineEdit, QListWidget, QListView, QTableView, QTextBrowser, QSpinBox, QComboBox,
+QComboBox QAbstractItemView, QPlainTextEdit, QMenu::item {
+background-color: rgba(20, 20, 20, 70%);
+}
+
+QComboBox::separator {
+border: solid; border-width: 3px; border-color: #ffcc00;
+}
+
+QPushButton, QListWidget, QListView, QTableView, QLineEdit, QHeaderView,
+QTextBrowser, QSpinBox, QToolBox, QComboBox, QPlainTextEdit,
+QComboBox QAbstractItemView, IconedGroupBox,
+.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget,
+QTabWidget::pane, QTabBar::tab {
+border: solid;
+border-width: 3px;
+border-color: #ffcc00;
+}
+
+QPushButton:hover, QLineEdit:hover, QListWidget:hover, QListView:hover,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget, QListView,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, QListView, QTableView,
+QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView,
+IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget,
+SelWeaponWidget, QCheckBox, QRadioButton, QPushButton, QPlainTextEdit {
+font: bold 13px;
+}
+SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected {
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #000000;
+}
+.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget {
+background-position: bottom center;
+background-repeat: repeat-x;
+border-radius: 16px;
+background-color: rgba(20, 20, 20, 70%);
+padding: 6px;
+}
+/*  Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well
+IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit,
+IconedGroupBox QSpinBox {
+border-radius: 0;
+}
+IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */
+IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{
+background-color: #130f2c;
+}
+
+
+QPushButton {
+border-radius: 8px;
+background-origin: margin;
+background-position: top left;
+background-color: rgba(18, 42, 5, 70%);
+}
+
+QPushButton:pressed{
+border-color: white;
+}
+
+QPushButton:focus {
+outline: none;
+}
+
+
+QHeaderView {
+border-radius: 0;
+border-width: 0;
+border-bottom-width: 3px;
+background-color: #00351d;
+}
+QTableView {
+alternate-background-color: #2f213a;
+gridline-color: transparent;
+}
+
+QTabBar::tab {
+border-bottom-width: 0;
+border-radius: 0;
+border-top-left-radius: 6px;
+border-top-right-radius: 6px;
+padding: 3px;
+}
+QTabBar::tab:!selected {
+color: #0d0544;
+background-color: #ffcc00;
+}
+QSpinBox::up-button{
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QSpinBox::up-arrow {
+image: url(":/res/spin_up.png");
+}
+
+QSpinBox::down-arrow {
+image: url(":/res/spin_down.png");
+}
+
+QSpinBox::down-button {
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QComboBox {
+border-radius: 10px;
+padding: 3px;
+}
+QComboBox:pressed{
+border-color: white;
+}
+QComboBox::drop-down{
+border: transparent;
+width: 25px;
+}
+QComboBox::down-arrow {
+image: url(":/res/dropdown.png");
+}
+
+VertScrArea {
+background-position: bottom center;
+background-repeat: repeat-x;
+}
+
+IconedGroupBox {
+border-radius: 16px;
+padding: 2px;
+}
+
+QGroupBox::title{
+subcontrol-origin: margin;
+subcontrol-position: top left;
+text-align: left;
+left: 15px;
+top: -4px;
+}
+
+QCheckBox::indicator:checked{
+image: url(":/res/checked.png");
+}
+QCheckBox::indicator:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+.QWidget{
+background: transparent;
+}
+
+QTabWidget::pane {
+border-top-width: 2px;
+}
+
+QMenu{
+background-color: #ffcc00;
+margin: 3px;
+}
+QMenu::item {
+background-color: #0d0544;
+border: 1px solid transparent;
+font: bold;
+padding: 2px 25px 2px 20px;
+}
+QMenu::item:selected {
+background-color: #2d2564;
+}
+QMenu::indicator {
+width: 16px;
+height: 16px;
+}
+QMenu::indicator:non-exclusive:checked{
+image: url(":/res/checked.png");
+}
+QMenu::indicator:non-exclusive:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+QToolTip{
+background-color: #0d0544;
+border: 1px solid #ffcc00;
+}
+
+:disabled{
+color: #a0a0a0;
+}
+SquareLabel, ItemNum {
+background-color: #000000;
+}
+
+QSlider::groove::horizontal {
+height: 2px;
+margin: 2px 0px;
+background-color: #ffcc00;
+}
+
+QSlider::handle::horizontal {
+border: 0px;
+margin: -2px 0px;
+border-radius: 3px;
+background-color: #ffcc00;
+width: 8px;
+}
+
diff --git a/QTfrontend/res/css/christmas.css b/QTfrontend/res/css/christmas.css
new file mode 100644
index 0000000..b136728
--- /dev/null
+++ b/QTfrontend/res/css/christmas.css
@@ -0,0 +1,248 @@
+/******************************************************************************
+ *
+ * CSS-like definition of Qt frontend appearance
+ *
+ ******************************************************************************
+ *
+ * see http://doc.qt.nokia.com/4.5/stylesheet.html
+ *
+ ******************************************************************************
+ *
+ * This file can be stored at different locations, but it will be read only
+ * once, based on first file found in this order:
+ *
+ *    <userdir>/Data/css/christmas.css
+ *    <datadir>/css/christmas.css
+ *    <internal default style-sheet> (:/res/css/christmas.css)
+ *
+ *****************************************************************************/
+
+HWForm,QDialog {
+background-image: url(":/res/BackgroundChristmas.png");
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #141250;
+}
+
+* {
+color: #ffcc00;
+selection-background-color: #ffcc00;
+selection-color: #00351d;
+}
+
+a { color:#c8c8ff; }
+
+QLineEdit, QListWidget, QListView, QTableView, QTextBrowser, QSpinBox, QComboBox,
+QComboBox QAbstractItemView, QPlainTextEdit, QMenu::item {
+background-color: rgba(13, 5, 68, 70%);
+}
+
+QComboBox::separator {
+border: solid; border-width: 3px; border-color: #ffcc00;
+}
+
+QPushButton, QListWidget, QListView, QTableView, QLineEdit, QHeaderView,
+QTextBrowser, QSpinBox, QToolBox, QComboBox, QPlainTextEdit,
+QComboBox QAbstractItemView, IconedGroupBox,
+.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget,
+QTabWidget::pane, QTabBar::tab {
+border: solid;
+border-width: 3px;
+border-color: #ffcc00;
+}
+
+QPushButton:hover, QLineEdit:hover, QListWidget:hover, QListView:hover,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget, QListView,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, QListView, QTableView,
+QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView,
+IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget,
+SelWeaponWidget, QCheckBox, QRadioButton, QPushButton, QPlainTextEdit {
+font: bold 13px;
+}
+SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected {
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #000000;
+}
+.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget {
+background-position: bottom center;
+background-repeat: repeat-x;
+border-radius: 16px;
+background-color: rgba(13, 5, 68, 70%);
+padding: 6px;
+}
+/*  Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well
+IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit,
+IconedGroupBox QSpinBox {
+border-radius: 0;
+}
+IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */
+IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{
+background-color: #130f2c;
+}
+
+
+QPushButton {
+border-radius: 8px;
+background-origin: margin;
+background-position: top left;
+background-color: rgba(18, 42, 5, 70%);
+}
+
+QPushButton:pressed{
+border-color: white;
+}
+
+QPushButton:focus {
+outline: none;
+}
+
+
+QHeaderView {
+border-radius: 0;
+border-width: 0;
+border-bottom-width: 3px;
+background-color: #00351d;
+}
+QTableView {
+alternate-background-color: #2f213a;
+gridline-color: transparent;
+}
+
+QTabBar::tab {
+border-bottom-width: 0;
+border-radius: 0;
+border-top-left-radius: 6px;
+border-top-right-radius: 6px;
+padding: 3px;
+}
+QTabBar::tab:!selected {
+color: #0d0544;
+background-color: #ffcc00;
+}
+QSpinBox::up-button{
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QSpinBox::up-arrow {
+image: url(":/res/spin_up.png");
+}
+
+QSpinBox::down-arrow {
+image: url(":/res/spin_down.png");
+}
+
+QSpinBox::down-button {
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QComboBox {
+border-radius: 10px;
+padding: 3px;
+}
+QComboBox:pressed{
+border-color: white;
+}
+QComboBox::drop-down{
+border: transparent;
+width: 25px;
+}
+QComboBox::down-arrow {
+image: url(":/res/dropdown.png");
+}
+
+VertScrArea {
+background-position: bottom center;
+background-repeat: repeat-x;
+}
+
+IconedGroupBox {
+border-radius: 16px;
+padding: 2px;
+}
+
+QGroupBox::title{
+subcontrol-origin: margin;
+subcontrol-position: top left;
+text-align: left;
+left: 15px;
+top: -4px;
+}
+
+QCheckBox::indicator:checked{
+image: url(":/res/checked.png");
+}
+QCheckBox::indicator:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+.QWidget{
+background: transparent;
+}
+
+QTabWidget::pane {
+border-top-width: 2px;
+}
+
+QMenu{
+background-color: #ffcc00;
+margin: 3px;
+}
+QMenu::item {
+background-color: #0d0544;
+border: 1px solid transparent;
+font: bold;
+padding: 2px 25px 2px 20px;
+}
+QMenu::item:selected {
+background-color: #2d2564;
+}
+QMenu::indicator {
+width: 16px;
+height: 16px;
+}
+QMenu::indicator:non-exclusive:checked{
+image: url(":/res/checked.png");
+}
+QMenu::indicator:non-exclusive:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+QToolTip{
+background-color: #0d0544;
+border: 1px solid #ffcc00;
+}
+
+:disabled{
+color: #a0a0a0;
+}
+SquareLabel, ItemNum {
+background-color: #000000;
+}
+
+QSlider::groove::horizontal {
+height: 2px;
+margin: 2px 0px;
+background-color: #ffcc00;
+}
+
+QSlider::handle::horizontal {
+border: 0px;
+margin: -2px 0px;
+border-radius: 3px;
+background-color: #ffcc00;
+width: 8px;
+}
+
diff --git a/QTfrontend/res/css/easter.css b/QTfrontend/res/css/easter.css
new file mode 100644
index 0000000..e3c81b9
--- /dev/null
+++ b/QTfrontend/res/css/easter.css
@@ -0,0 +1,248 @@
+/******************************************************************************
+ *
+ * CSS-like definition of Qt frontend appearance
+ *
+ ******************************************************************************
+ *
+ * see http://doc.qt.nokia.com/4.5/stylesheet.html
+ *
+ ******************************************************************************
+ *
+ * This file can be stored at different locations, but it will be read only
+ * once, based on first file found in this order:
+ *
+ *    <userdir>/Data/css/easter.css
+ *    <datadir>/css/easter.css
+ *    <internal default style-sheet> (:/res/css/easter.css)
+ *
+ *****************************************************************************/
+
+HWForm,QDialog {
+background-image: url(":/res/BackgroundEaster.png");
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #141250;
+}
+
+* {
+color: #ffcc00;
+selection-background-color: #ffcc00;
+selection-color: #00351d;
+}
+
+a { color:#c8c8ff; }
+
+QLineEdit, QListWidget, QListView, QTableView, QTextBrowser, QSpinBox, QComboBox,
+QComboBox QAbstractItemView, QPlainTextEdit, QMenu::item {
+background-color: rgba(13, 5, 68, 70%);
+}
+
+QComboBox::separator {
+border: solid; border-width: 3px; border-color: #ffcc00;
+}
+
+QPushButton, QListWidget, QListView, QTableView, QLineEdit, QHeaderView,
+QTextBrowser, QSpinBox, QToolBox, QComboBox, QPlainTextEdit,
+QComboBox QAbstractItemView, IconedGroupBox,
+.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget,
+QTabWidget::pane, QTabBar::tab {
+border: solid;
+border-width: 3px;
+border-color: #ffcc00;
+}
+
+QPushButton:hover, QLineEdit:hover, QListWidget:hover, QListView:hover,
+QSpinBox:hover, QToolBox:hover, QComboBox:hover {
+border-color: yellow;
+}
+
+QLineEdit, QListWidget, QListView,QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
+border-radius: 10px;
+}
+
+QLineEdit, QLabel, QHeaderView, QListWidget, QListView, QTableView,
+QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView,
+IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget,
+SelWeaponWidget, QCheckBox, QRadioButton, QPushButton, QPlainTextEdit {
+font: bold 13px;
+}
+SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected {
+background-position: bottom center;
+background-repeat: repeat-x;
+background-color: #000000;
+}
+.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget {
+background-position: bottom center;
+background-repeat: repeat-x;
+border-radius: 16px;
+background-color: rgba(13, 5, 68, 70%);
+padding: 6px;
+}
+/*  Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well
+IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit,
+IconedGroupBox QSpinBox {
+border-radius: 0;
+}
+IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */
+IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{
+background-color: #130f2c;
+}
+
+
+QPushButton {
+border-radius: 8px;
+background-origin: margin;
+background-position: top left;
+background-color: rgba(18, 42, 5, 70%);
+}
+
+QPushButton:pressed{
+border-color: white;
+}
+
+QPushButton:focus {
+outline: none;
+}
+
+
+QHeaderView {
+border-radius: 0;
+border-width: 0;
+border-bottom-width: 3px;
+background-color: #00351d;
+}
+QTableView {
+alternate-background-color: #2f213a;
+gridline-color: transparent;
+}
+
+QTabBar::tab {
+border-bottom-width: 0;
+border-radius: 0;
+border-top-left-radius: 6px;
+border-top-right-radius: 6px;
+padding: 3px;
+}
+QTabBar::tab:!selected {
+color: #0d0544;
+background-color: #ffcc00;
+}
+QSpinBox::up-button{
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QSpinBox::up-arrow {
+image: url(":/res/spin_up.png");
+}
+
+QSpinBox::down-arrow {
+image: url(":/res/spin_down.png");
+}
+
+QSpinBox::down-button {
+background: transparent;
+width: 16px;
+height: 10px;
+}
+
+QComboBox {
+border-radius: 10px;
+padding: 3px;
+}
+QComboBox:pressed{
+border-color: white;
+}
+QComboBox::drop-down{
+border: transparent;
+width: 25px;
+}
+QComboBox::down-arrow {
+image: url(":/res/dropdown.png");
+}
+
+VertScrArea {
+background-position: bottom center;
+background-repeat: repeat-x;
+}
+
+IconedGroupBox {
+border-radius: 16px;
+padding: 2px;
+}
+
+QGroupBox::title{
+subcontrol-origin: margin;
+subcontrol-position: top left;
+text-align: left;
+left: 15px;
+top: -4px;
+}
+
+QCheckBox::indicator:checked{
+image: url(":/res/checked.png");
+}
+QCheckBox::indicator:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+.QWidget{
+background: transparent;
+}
+
+QTabWidget::pane {
+border-top-width: 2px;
+}
+
+QMenu{
+background-color: #ffcc00;
+margin: 3px;
+}
+QMenu::item {
+background-color: #0d0544;
+border: 1px solid transparent;
+font: bold;
+padding: 2px 25px 2px 20px;
+}
+QMenu::item:selected {
+background-color: #2d2564;
+}
+QMenu::indicator {
+width: 16px;
+height: 16px;
+}
+QMenu::indicator:non-exclusive:checked{
+image: url(":/res/checked.png");
+}
+QMenu::indicator:non-exclusive:unchecked{
+image: url(":/res/unchecked.png");
+}
+
+QToolTip{
+background-color: #0d0544;
+border: 1px solid #ffcc00;
+}
+
+:disabled{
+color: #a0a0a0;
+}
+SquareLabel, ItemNum {
+background-color: #000000;
+}
+
+QSlider::groove::horizontal {
+height: 2px;
+margin: 2px 0px;
+background-color: #ffcc00;
+}
+
+QSlider::handle::horizontal {
+border: 0px;
+margin: -2px 0px;
+border-radius: 3px;
+background-color: #ffcc00;
+width: 8px;
+}
+
diff --git a/QTfrontend/res/css/qt.css b/QTfrontend/res/css/qt.css
index e20e6d2..460b1e4 100644
--- a/QTfrontend/res/css/qt.css
+++ b/QTfrontend/res/css/qt.css
@@ -32,8 +32,8 @@ selection-color: #00351d;
 
 a { color:#c8c8ff; }
 
-QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox,
-QComboBox QAbstractItemView, QMenu::item {
+QLineEdit, QListWidget, QListView, QTableView, QTextBrowser, QSpinBox, QComboBox,
+QComboBox QAbstractItemView, QPlainTextEdit, QMenu::item {
 background-color: rgba(13, 5, 68, 70%);
 }
 
@@ -41,8 +41,8 @@ QComboBox::separator {
 border: solid; border-width: 3px; border-color: #ffcc00;
 }
 
-QPushButton, QListWidget, QTableView, QLineEdit, QHeaderView,
-QTextBrowser, QSpinBox, QToolBox, QComboBox,
+QPushButton, QListWidget, QListView, QTableView, QLineEdit, QHeaderView,
+QTextBrowser, QSpinBox, QToolBox, QComboBox, QPlainTextEdit,
 QComboBox QAbstractItemView, IconedGroupBox,
 .QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget,
 QTabWidget::pane, QTabBar::tab {
@@ -51,20 +51,20 @@ border-width: 3px;
 border-color: #ffcc00;
 }
 
-QPushButton:hover, QLineEdit:hover, QListWidget:hover,
+QPushButton:hover, QLineEdit:hover, QListWidget:hover, QListView:hover,
 QSpinBox:hover, QToolBox:hover, QComboBox:hover {
 border-color: yellow;
 }
 
-QLineEdit, QListWidget,QTableView, QTextBrowser,
-QSpinBox, QToolBox {
+QLineEdit, QListWidget, QListView, QTableView, QTextBrowser,
+QSpinBox, QToolBox, QPlainTextEdit {
 border-radius: 10px;
 }
 
-QLineEdit, QLabel, QHeaderView, QListWidget, QTableView,
+QLineEdit, QLabel, QHeaderView, QListWidget, QListView, QTableView,
 QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView,
 IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget,
-SelWeaponWidget, QCheckBox, QRadioButton, QPushButton {
+SelWeaponWidget, QCheckBox, QRadioButton, QPushButton, QPlainTextEdit {
 font: bold 13px;
 }
 SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected {
@@ -116,17 +116,18 @@ QTableView {
 alternate-background-color: #2f213a;
 gridline-color: transparent;
 }
-
+QTabWidget::pane { top: -2px; }
 QTabBar::tab {
-border-bottom-width: 0;
 border-radius: 0;
 border-top-left-radius: 6px;
 border-top-right-radius: 6px;
 padding: 3px;
+background-color: #00351d;
+color: #ffcc00;
 }
-QTabBar::tab:!selected {
-color: #0d0544;
-background-color: #ffcc00;
+QTabBar::tab:selected {
+border-bottom-color: #0d0544;
+border-bottom-width: 0;
 }
 QSpinBox::up-button{
 background: transparent;
diff --git a/QTfrontend/sdlkeys.h b/QTfrontend/sdlkeys.h
index b4928fd..79dd65f 100644
--- a/QTfrontend/sdlkeys.h
+++ b/QTfrontend/sdlkeys.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,7 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
-char sdlkeys[1024][2][128] = {
+char sdlkeys[1024][2][128] =
+{
     {"mousel", QT_TRANSLATE_NOOP("binds (keys)", "Mouse: Left button")},
     {"mousem", QT_TRANSLATE_NOOP("binds (keys)", "Mouse: Middle button")},
     {"mouser", QT_TRANSLATE_NOOP("binds (keys)", "Mouse: Right button")},
@@ -145,11 +146,12 @@ char sdlkeys[1024][2][128] = {
     {"left_alt", QT_TRANSLATE_NOOP("binds (keys)", "Left alt")},
     {"right_meta", QT_TRANSLATE_NOOP("binds (keys)", "Right meta")},
     {"left_meta", QT_TRANSLATE_NOOP("binds (keys)", "Left meta")}
-    };
+};
 
 // button name definitions for Microsoft's XBox360 controller
 // don't modify button order!
-char xb360buttons[][128] = {
+char xb360buttons[][128] =
+{
     QT_TRANSLATE_NOOP("binds (keys)", "A button"),
     QT_TRANSLATE_NOOP("binds (keys)", "B button"),
     QT_TRANSLATE_NOOP("binds (keys)", "X button"),
@@ -164,7 +166,8 @@ char xb360buttons[][128] = {
 
 // axis name definitions for Microsoft's XBox360 controller
 // don't modify axis order!
-char xbox360axes[][128] = {
+char xbox360axes[][128] =
+{
     QT_TRANSLATE_NOOP("binds (keys)", "Left stick (Right)"),
     QT_TRANSLATE_NOOP("binds (keys)", "Left stick (Left)"),
     QT_TRANSLATE_NOOP("binds (keys)", "Left stick (Down)"),
diff --git a/QTfrontend/team.cpp b/QTfrontend/team.cpp
index 9df7f1d..b16880a 100644
--- a/QTfrontend/team.cpp
+++ b/QTfrontend/team.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,10 +22,11 @@
 #include <QLineEdit>
 #include <QCryptographicHash>
 #include <QSettings>
+#include <QStandardItemModel>
 
 #include "team.h"
 #include "hwform.h"
-#include "hats.h"
+#include "DataManager.h"
 
 HWTeam::HWTeam(const QString & teamname) :
     QObject(0)
@@ -37,6 +38,7 @@ HWTeam::HWTeam(const QString & teamname) :
     OldTeamName = m_name;
     for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
+        m_hedgehogs.append(HWHog());
         m_hedgehogs[i].Name = (QLineEdit::tr("hedgehog %1").arg(i+1));
         m_hedgehogs[i].Hat = "NoHat";
     }
@@ -46,12 +48,14 @@ HWTeam::HWTeam(const QString & teamname) :
     m_flag = "hedgewars";
     for(int i = 0; i < BINDS_NUMBER; i++)
     {
+        m_binds.append(BindAction());
         m_binds[i].action = cbinds[i].action;
         m_binds[i].strbind = cbinds[i].strbind;
     }
     m_rounds = 0;
     m_wins = 0;
     m_campaignProgress = 0;
+    m_color = 0;
 }
 
 HWTeam::HWTeam(const QStringList& strLst) :
@@ -70,6 +74,7 @@ HWTeam::HWTeam(const QStringList& strLst) :
     m_difficulty = strLst[6].toUInt();
     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
+        m_hedgehogs.append(HWHog());
         m_hedgehogs[i].Name=strLst[i * 2 + 7];
         m_hedgehogs[i].Hat=strLst[i * 2 + 8];
 // Somehow claymore managed an empty hat.  Until we figure out how, this should avoid a repeat
@@ -79,17 +84,19 @@ HWTeam::HWTeam(const QStringList& strLst) :
     m_rounds = 0;
     m_wins = 0;
     m_campaignProgress = 0;
+    m_color = 0;
 }
 
 HWTeam::HWTeam() :
     QObject(0)
-  , m_difficulty(0)
-  , m_numHedgehogs(4)
-  , m_isNetTeam(false)
+    , m_difficulty(0)
+    , m_numHedgehogs(4)
+    , m_isNetTeam(false)
 {
     m_name = QString("Team");
     for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
+        m_hedgehogs.append(HWHog());
         m_hedgehogs[i].Name.sprintf("hedgehog %d", i);
         m_hedgehogs[i].Hat = "NoHat";
     }
@@ -101,32 +108,34 @@ HWTeam::HWTeam() :
 
     for(int i = 0; i < BINDS_NUMBER; i++)
     {
+        m_binds.append(BindAction());
         m_binds[i].action = cbinds[i].action;
         m_binds[i].strbind = cbinds[i].strbind;
     }
     m_rounds = 0;
     m_wins = 0;
     m_campaignProgress = 0;
+    m_color = 0;
 }
 
 HWTeam::HWTeam(const HWTeam & other) :
-        QObject(0)
-        , OldTeamName(other.OldTeamName)
-        , m_name(other.m_name)
-        , m_grave(other.m_grave)
-        , m_fort(other.m_fort)
-        , m_flag(other.m_flag)
-        , m_voicepack(other.m_voicepack)
-        , m_hedgehogs(other.m_hedgehogs)
-        , m_difficulty(other.m_difficulty)
-        , m_binds(other.m_binds)
-        , m_numHedgehogs(other.m_numHedgehogs)
-        , m_color(other.m_color)
-        , m_isNetTeam(other.m_isNetTeam)
-        , m_owner(other.m_owner)
-        , m_campaignProgress(other.m_campaignProgress)
-        , m_rounds(other.m_rounds)
-        , m_wins(other.m_wins)
+    QObject(0)
+    , OldTeamName(other.OldTeamName)
+    , m_name(other.m_name)
+    , m_grave(other.m_grave)
+    , m_fort(other.m_fort)
+    , m_flag(other.m_flag)
+    , m_voicepack(other.m_voicepack)
+    , m_hedgehogs(other.m_hedgehogs)
+    , m_difficulty(other.m_difficulty)
+    , m_binds(other.m_binds)
+    , m_numHedgehogs(other.m_numHedgehogs)
+    , m_color(other.m_color)
+    , m_isNetTeam(other.m_isNetTeam)
+    , m_owner(other.m_owner)
+    , m_campaignProgress(other.m_campaignProgress)
+    , m_rounds(other.m_rounds)
+    , m_wins(other.m_wins)
 //      , AchievementProgress(other.AchievementProgress)
 {
 
@@ -142,9 +151,9 @@ HWTeam & HWTeam::operator = (const HWTeam & other)
         m_fort = other.m_fort;
         m_flag = other.m_flag;
         m_voicepack = other.m_voicepack;
-//        m_hedgehogs = other.m_hedgehogs;
+        m_hedgehogs = other.m_hedgehogs;
         m_difficulty = other.m_difficulty;
-//        m_binds = other.m_binds;
+        m_binds = other.m_binds;
         m_numHedgehogs = other.m_numHedgehogs;
         m_color = other.m_color;
         m_isNetTeam = other.m_isNetTeam;
@@ -152,6 +161,7 @@ HWTeam & HWTeam::operator = (const HWTeam & other)
         m_campaignProgress = other.m_campaignProgress;
         m_rounds = other.m_rounds;
         m_wins = other.m_wins;
+        m_color = other.m_color;
     }
 
     return *this;
@@ -249,10 +259,10 @@ QStringList HWTeam::teamGameConfig(quint32 InitHealth) const
     QStringList sl;
     if (m_isNetTeam)
     {
-        sl.push_back(QString("eaddteam %3 %1 %2").arg(m_color.rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toLatin1(), QCryptographicHash::Md5).toHex())));
+        sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toUtf8(), QCryptographicHash::Md5).toHex())));
         sl.push_back("erdriven");
     }
-    else sl.push_back(QString("eaddteam %3 %1 %2").arg(m_color.rgb() & 0xffffff).arg(m_name).arg(playerHash));
+    else sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash));
 
     sl.push_back(QString("egrave " + m_grave));
     sl.push_back(QString("efort " + m_fort));
@@ -266,28 +276,30 @@ QStringList HWTeam::teamGameConfig(quint32 InitHealth) const
 
     for (int t = 0; t < m_numHedgehogs; t++)
     {
-      sl.push_back(QString("eaddhh %1 %2 %3")
-               .arg(QString::number(m_difficulty),
-                QString::number(InitHealth),
-                m_hedgehogs[t].Name));
-      sl.push_back(QString("ehat %1")
-               .arg(m_hedgehogs[t].Hat));
+        sl.push_back(QString("eaddhh %1 %2 %3")
+                     .arg(QString::number(m_difficulty),
+                          QString::number(InitHealth),
+                          m_hedgehogs[t].Name));
+        sl.push_back(QString("ehat %1")
+                     .arg(m_hedgehogs[t].Hat));
     }
     return sl;
 }
 
 bool HWTeam::isNetTeam() const
 {
-  return m_isNetTeam;
+    return m_isNetTeam;
 }
 
 
-bool HWTeam::operator==(const HWTeam& t1) const {
-  return m_name==t1.m_name;
+bool HWTeam::operator==(const HWTeam& t1) const
+{
+    return m_name==t1.m_name;
 }
 
-bool HWTeam::operator<(const HWTeam& t1) const {
-  return m_name<t1.m_name; // if names are equal - test if it is net team
+bool HWTeam::operator<(const HWTeam& t1) const
+{
+    return m_name<t1.m_name; // if names are equal - test if it is net team
 }
 
 
@@ -295,58 +307,135 @@ bool HWTeam::operator<(const HWTeam& t1) const {
 
 
 // name
-QString HWTeam::name() const { return m_name; }
-   void HWTeam::setName(const QString & name) { m_name = name; }
+QString HWTeam::name() const
+{
+    return m_name;
+}
+void HWTeam::setName(const QString & name)
+{
+    m_name = name;
+}
 
 // single hedgehog
-const HWHog & HWTeam::hedgehog(unsigned int idx) const { return m_hedgehogs[idx]; }
-         void HWTeam::setHedgehog(unsigned int idx, HWHog hh) { m_hedgehogs[idx] = hh; }
+const HWHog & HWTeam::hedgehog(unsigned int idx) const
+{
+    return m_hedgehogs[idx];
+}
+void HWTeam::setHedgehog(unsigned int idx, HWHog hh)
+{
+    m_hedgehogs[idx] = hh;
+}
 
 // owner
-QString HWTeam::owner() const { return m_owner; }
+QString HWTeam::owner() const
+{
+    return m_owner;
+}
 
 
 
 // difficulty
-unsigned int HWTeam::difficulty() const { return m_difficulty; }
-        void HWTeam::setDifficulty(unsigned int level) { m_difficulty = level; }
+unsigned int HWTeam::difficulty() const
+{
+    return m_difficulty;
+}
+void HWTeam::setDifficulty(unsigned int level)
+{
+    m_difficulty = level;
+}
 
 // color
-QColor HWTeam::color() const { return m_color; }
-  void HWTeam::setColor(const QColor & color) { m_color = color; }
+int HWTeam::color() const
+{
+    return m_color;
+}
+
+QColor HWTeam::qcolor() const
+{
+    return DataManager::instance().colorsModel()->item(m_color)->data().value<QColor>();
+}
+
+void HWTeam::setColor(int color)
+{
+    m_color = color % DataManager::instance().colorsModel()->rowCount();
+}
 
 
 // binds
-QString HWTeam::keyBind(unsigned int idx) const { return m_binds[idx].strbind; }
-   void HWTeam::bindKey(unsigned int idx, const QString & key) { m_binds[idx].strbind = key; }
+QString HWTeam::keyBind(unsigned int idx) const
+{
+    return m_binds[idx].strbind;
+}
+void HWTeam::bindKey(unsigned int idx, const QString & key)
+{
+    m_binds[idx].strbind = key;
+}
 
 // flag
-void    HWTeam::setFlag(const QString & flag) { m_flag = flag; }
-QString HWTeam::flag() const { return m_flag; }
+void    HWTeam::setFlag(const QString & flag)
+{
+    m_flag = flag;
+}
+QString HWTeam::flag() const
+{
+    return m_flag;
+}
 
 // fort
-void    HWTeam::setFort(const QString & fort) { m_fort = fort; }
-QString HWTeam::fort() const { return m_fort; }
+void    HWTeam::setFort(const QString & fort)
+{
+    m_fort = fort;
+}
+QString HWTeam::fort() const
+{
+    return m_fort;
+}
 
 // grave
-void HWTeam::setGrave(const QString & grave) { m_grave = grave; }
-QString HWTeam::grave() const { return m_grave; }
+void HWTeam::setGrave(const QString & grave)
+{
+    m_grave = grave;
+}
+QString HWTeam::grave() const
+{
+    return m_grave;
+}
 
 // voicepack - getter/setter
-void HWTeam::setVoicepack(const QString & voicepack) { m_voicepack = voicepack; }
-QString HWTeam::voicepack() const { return m_voicepack; }
+void HWTeam::setVoicepack(const QString & voicepack)
+{
+    m_voicepack = voicepack;
+}
+QString HWTeam::voicepack() const
+{
+    return m_voicepack;
+}
 
 
 // campaignProgress - getter
-unsigned int HWTeam::campaignProgress() const { return m_campaignProgress; };
+unsigned int HWTeam::campaignProgress() const
+{
+    return m_campaignProgress;
+};
 
 // amount of hedgehogs
-unsigned char HWTeam::numHedgehogs() const { return m_numHedgehogs; }
-         void HWTeam::setNumHedgehogs(unsigned char num) { m_numHedgehogs = num; }
+unsigned char HWTeam::numHedgehogs() const
+{
+    return m_numHedgehogs;
+}
+void HWTeam::setNumHedgehogs(unsigned char num)
+{
+    m_numHedgehogs = num;
+}
 
 
 
 // rounds+wins - incrementors
-void HWTeam::incRounds() { m_rounds++; }
-void HWTeam::incWins() { m_wins++; }
-
+void HWTeam::incRounds()
+{
+    m_rounds++;
+}
+void HWTeam::incWins()
+{
+    m_wins++;
+}
diff --git a/QTfrontend/team.h b/QTfrontend/team.h
index 18ed7bd..8ef848f 100644
--- a/QTfrontend/team.h
+++ b/QTfrontend/team.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at gmail.com>
  * Copyright (c) 2007 Igor Ulyanov <iulyanov at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -44,7 +44,7 @@ struct HWHog
 // class representing a team
 class HWTeam : public QObject
 {
-    Q_OBJECT
+        Q_OBJECT
 
     public:
 
@@ -62,23 +62,23 @@ class HWTeam : public QObject
         bool fileExists();
 
         // attribute getters
-         unsigned int campaignProgress() const;
-               QColor color() const;
-         unsigned int difficulty() const;
-              QString flag() const;
-              QString fort() const;
-              QString grave() const;
+        unsigned int campaignProgress() const;
+        int color() const;
+        QColor qcolor() const;
+        unsigned int difficulty() const;
+        QString flag() const;
+        QString fort() const;
+        QString grave() const;
         const HWHog & hedgehog(unsigned int idx) const;
-                 bool isNetTeam() const;
-              QString keyBind(unsigned int idx) const;
-              QString name() const;
+        bool isNetTeam() const;
+        QString keyBind(unsigned int idx) const;
+        QString name() const;
         unsigned char numHedgehogs() const;
-              QString owner() const;
-              QString voicepack() const;
+        QString owner() const;
+        QString voicepack() const;
 
         // attribute setters
         void bindKey(unsigned int idx, const QString & key);
-        void setColor(const QColor & color);
         void setDifficulty(unsigned int level);
         void setFlag(const QString & flag);
         void setFort(const QString & fort);
@@ -100,6 +100,8 @@ class HWTeam : public QObject
         bool operator < (const HWTeam& t1) const;
         HWTeam & operator = (const HWTeam & other);
 
+public slots:
+        void setColor(int color);
 
     private:
 
@@ -111,13 +113,13 @@ class HWTeam : public QObject
         QString m_fort;
         QString m_flag;
         QString m_voicepack;
-        HWHog m_hedgehogs[HEDGEHOGS_PER_TEAM];
+        QList<HWHog> m_hedgehogs;
         quint8 m_difficulty;
-        BindAction m_binds[BINDS_NUMBER];
+        QList<BindAction> m_binds;
 
         // class members that contain info for the current game setup
         quint8 m_numHedgehogs;
-        QColor m_color;
+        int m_color;
         bool m_isNetTeam;
         QString m_owner;
 
diff --git a/QTfrontend/ui/dialog/ask_quit.cpp b/QTfrontend/ui/dialog/ask_quit.cpp
new file mode 100644
index 0000000..80f4010
--- /dev/null
+++ b/QTfrontend/ui/dialog/ask_quit.cpp
@@ -0,0 +1,81 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QVBoxLayout>
+#include <QLabel>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QTimer>
+
+#include "hwform.h"
+#include "ask_quit.h"
+#include "pagevideos.h"
+
+HWAskQuitDialog::HWAskQuitDialog(QWidget* parent, HWForm * form) : QDialog(parent)
+{
+    this->form = form;
+
+    setWindowTitle(tr("Do you really want to quit?"));
+
+    QVBoxLayout * layout = new QVBoxLayout(this);
+
+    QLabel * lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("There are videos that are currently being processed.\n"
+                                "Exiting now will abort them.\n"
+                                "Do you really want to quit?"));
+    layout->addWidget(lbLabel);
+
+    lbList = new QLabel(this);
+    layout->addWidget(lbList);
+    updateList();
+
+    QDialogButtonBox* dbbButtons = new QDialogButtonBox(this);
+    QPushButton * pbYes = dbbButtons->addButton(QDialogButtonBox::Yes);
+    QPushButton * pbNo  = dbbButtons->addButton(QDialogButtonBox::No);
+    QPushButton * pbMore = dbbButtons->addButton(QPushButton::tr("More info"), QDialogButtonBox::HelpRole);
+    layout->addWidget(dbbButtons);
+
+    connect(pbYes,  SIGNAL(clicked()), this, SLOT(accept()));
+    connect(pbNo,   SIGNAL(clicked()), this, SLOT(reject()));
+    connect(pbMore, SIGNAL(clicked()), this, SLOT(goToPageVideos()));
+
+    // update list periodically
+    QTimer * timer = new QTimer(this);
+    connect(timer, SIGNAL(timeout()), this, SLOT(updateList()));
+    timer->start(200);
+
+    this->setWindowModality(Qt::WindowModal);
+}
+
+void HWAskQuitDialog::goToPageVideos()
+{
+    reject();
+    form->GoToVideos();
+}
+
+void HWAskQuitDialog::updateList()
+{
+    QString text = form->ui.pageVideos->getVideosInProgress();
+    if (text.isEmpty())
+    {
+        // automatically exit when everything is finished
+        accept();
+        return;
+    }
+    lbList->setText(text);
+}
diff --git a/QTfrontend/ui/dialog/ask_quit.h b/QTfrontend/ui/dialog/ask_quit.h
new file mode 100644
index 0000000..856b9d5
--- /dev/null
+++ b/QTfrontend/ui/dialog/ask_quit.h
@@ -0,0 +1,45 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef ASK_QUIT_H
+#define ASK_QUIT_H
+
+#include <QDialog>
+
+class QLabel;
+class HWForm;
+class PageVideos;
+
+class HWAskQuitDialog : public QDialog
+{
+        Q_OBJECT
+
+    public:
+        HWAskQuitDialog(QWidget* parent, HWForm *form);
+
+    private slots:
+        void goToPageVideos();
+        void updateList();
+
+    private:
+        HWForm * form;
+        QLabel * lbList;
+};
+
+
+#endif // INPUT_PASSWORD_H
diff --git a/QTfrontend/ui/dialog/input_ip.cpp b/QTfrontend/ui/dialog/input_ip.cpp
index df422f1..aacb01e 100644
--- a/QTfrontend/ui/dialog/input_ip.cpp
+++ b/QTfrontend/ui/dialog/input_ip.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -60,6 +60,8 @@ HWHostPortDialog::HWHostPortDialog(QWidget* parent) : QDialog(parent)
     connect(pbOK, SIGNAL(clicked()), this, SLOT(accept()));
     connect(pbCancel, SIGNAL(clicked()), this, SLOT(reject()));
     connect(pbDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort()));
+
+    this->setWindowModality(Qt::WindowModal);
 }
 
 void HWHostPortDialog::setDefaultPort()
diff --git a/QTfrontend/ui/dialog/input_ip.h b/QTfrontend/ui/dialog/input_ip.h
index 5b1874c..9e1eaac 100644
--- a/QTfrontend/ui/dialog/input_ip.h
+++ b/QTfrontend/ui/dialog/input_ip.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,20 +29,20 @@ class QPushButton;
 
 class HWHostPortDialog : public QDialog
 {
-    Q_OBJECT
-public:
-    HWHostPortDialog(QWidget* parent = 0);
+        Q_OBJECT
+    public:
+        HWHostPortDialog(QWidget* parent = 0);
 
-    QLineEdit* leHost;
-    QSpinBox* sbPort;
+        QLineEdit* leHost;
+        QSpinBox* sbPort;
 
-private:
-    QPushButton* pbOK;
-    QPushButton* pbCancel;
-    QPushButton * pbDefault;
+    private:
+        QPushButton* pbOK;
+        QPushButton* pbCancel;
+        QPushButton * pbDefault;
 
-private slots:
-    void setDefaultPort();
+    private slots:
+        void setDefaultPort();
 };
 
 
diff --git a/QTfrontend/ui/dialog/input_password.cpp b/QTfrontend/ui/dialog/input_password.cpp
new file mode 100644
index 0000000..2eafcc0
--- /dev/null
+++ b/QTfrontend/ui/dialog/input_password.cpp
@@ -0,0 +1,55 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QLineEdit>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QCheckBox>
+#include <QLabel>
+
+#include "input_password.h"
+
+HWPasswordDialog::HWPasswordDialog(QWidget* parent, const QString & label) : QDialog(parent)
+{
+    setWindowTitle(tr("Password"));
+
+    QGridLayout * layout = new QGridLayout(this);
+
+    QLabel * lbLabel = new QLabel(this);
+    lbLabel->setText(label);
+    layout->addWidget(lbLabel, 0, 0);
+
+    lePassword = new QLineEdit(this);
+    lePassword->setEchoMode(QLineEdit::Password);
+    layout->addWidget(lePassword, 1, 0);
+
+    cbSave = new QCheckBox(this);
+    cbSave->setText(QCheckBox::tr("Save password"));
+    layout->addWidget(cbSave, 2, 0);
+
+    QDialogButtonBox* dbbButtons = new QDialogButtonBox(this);
+    QPushButton * pbOK = dbbButtons->addButton(QDialogButtonBox::Ok);
+    QPushButton * pbCancel = dbbButtons->addButton(QDialogButtonBox::Cancel);
+    layout->addWidget(dbbButtons, 3, 0);
+
+    connect(pbOK, SIGNAL(clicked()), this, SLOT(accept()));
+    connect(pbCancel, SIGNAL(clicked()), this, SLOT(reject()));
+
+    this->setWindowModality(Qt::WindowModal);
+}
diff --git a/QTfrontend/ui/dialog/input_password.h b/QTfrontend/ui/dialog/input_password.h
new file mode 100644
index 0000000..70db544
--- /dev/null
+++ b/QTfrontend/ui/dialog/input_password.h
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef INPUT_PASSWORD_H
+#define INPUT_PASSWORD_H
+
+#include <QDialog>
+
+class QLineEdit;
+class QCheckBox;
+
+class HWPasswordDialog : public QDialog
+{
+        Q_OBJECT
+    public:
+        HWPasswordDialog(QWidget* parent, const QString & label);
+
+        QLineEdit* lePassword;
+        QCheckBox* cbSave;
+};
+
+
+#endif // INPUT_PASSWORD_H
diff --git a/QTfrontend/ui/dialog/upload_video.cpp b/QTfrontend/ui/dialog/upload_video.cpp
new file mode 100644
index 0000000..eaa40bd
--- /dev/null
+++ b/QTfrontend/ui/dialog/upload_video.cpp
@@ -0,0 +1,312 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QLineEdit>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QCheckBox>
+#include <QLabel>
+#include <QFrame>
+#include <QPlainTextEdit>
+#include <QSslError>
+#include <QUrl>
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QMessageBox>
+#include <QRegExp>
+#include <QRegExpValidator>
+
+#include "upload_video.h"
+#include "hwconsts.h"
+
+// User-agent string used in http requests.
+// Don't make it a global varibale - crash on linux because of cVersionString
+#define USER_AGENT ("Hedgewars-QtFrontend/" + *cVersionString).toAscii()
+
+// This is developer key obtained from http://code.google.com/apis/youtube/dashboard/
+// If you are reusing this code outside Hedgewars, don't use this developer key,
+// obtain you own at http://code.google.com/apis/youtube/dashboard/
+static const QByteArray devKey = "AI39si5pKjxR0XgNIlmrEFF-LyYD31rps4g2O5dZTxLgD0fvJ2rHxrMrNFY8FYTZrzeI3VlaFVQLKfFnSBugvdZmy8vFzRDefQ";
+
+HWUploadVideoDialog::HWUploadVideoDialog(QWidget* parent, const QString &filename, QNetworkAccessManager* netManager) : QDialog(parent)
+{
+    this->filename = filename;
+    this->netManager = netManager;
+
+    setWindowTitle(tr("Upload video"));
+
+    // Google requires us to display this, see https://developers.google.com/youtube/terms
+    QString GoogleNotice =
+        "<p>By clicking 'upload,' you certify that you own all rights to the content or that "
+        "you are authorized by the owner to make the content publicly available on YouTube, "
+        "and that it otherwise complies with the YouTube Terms of Service located at "
+        "<a href=\"http://www.youtube.com/t/terms\" style=\"color: white;\">http://www.youtube.com/t/terms</a>.</p>";
+
+    // youtube doesn't understand this characters, even when they are properly escaped
+    // (either with CDATA or with &lt or &gt)
+    QRegExp rx("[^<>]*");
+
+    int row = 0;
+
+    QGridLayout * layout = new QGridLayout(this);
+    layout->setColumnStretch(0, 1);
+    layout->setColumnStretch(1, 2);
+
+    QLabel * lbLabel = new QLabel(this);
+    lbLabel->setWordWrap(true);
+    lbLabel->setText(QLabel::tr(
+                         "Please provide either the YouTube account name "
+                         "or the email address associated with the Google Account."));
+    layout->addWidget(lbLabel, row++, 0, 1, 2);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("Account name (or email): "));
+    layout->addWidget(lbLabel, row, 0);
+
+    leAccount = new QLineEdit(this);
+    layout->addWidget(leAccount, row++, 1);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("Password: "));
+    layout->addWidget(lbLabel, row, 0);
+
+    lePassword = new QLineEdit(this);
+    lePassword->setEchoMode(QLineEdit::Password);
+    layout->addWidget(lePassword, row++, 1);
+
+    cbSave = new QCheckBox(this);
+    cbSave->setText(QCheckBox::tr("Save account name and password"));
+    layout->addWidget(cbSave, row++, 0, 1, 2);
+
+    QFrame * hr = new QFrame(this);
+    hr->setFrameStyle(QFrame::HLine);
+    hr->setLineWidth(3);
+    hr->setFixedHeight(10);
+    layout->addWidget(hr, row++, 0, 1, 2);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("Video title: "));
+    layout->addWidget(lbLabel, row, 0);
+
+    leTitle = new QLineEdit(this);
+    leTitle->setText(filename);
+    leTitle->setValidator(new QRegExpValidator(rx, leTitle));
+    layout->addWidget(leTitle, row++, 1);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("Video description: "));
+    layout->addWidget(lbLabel, row++, 0, 1, 2);
+
+    teDescription = new QPlainTextEdit(this);
+    layout->addWidget(teDescription, row++, 0, 1, 2);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setText(QLabel::tr("Tags (comma separated): "));
+    layout->addWidget(lbLabel, row, 0);
+
+    leTags = new QLineEdit(this);
+    leTags->setText("hedgewars");
+    leTags->setMaxLength(500);
+    leTags->setValidator(new QRegExpValidator(rx, leTags));
+    layout->addWidget(leTags, row++, 1);
+
+    cbPrivate = new QCheckBox(this);
+    cbPrivate->setText(QCheckBox::tr("Video is private"));
+    layout->addWidget(cbPrivate, row++, 0, 1, 2);
+
+    hr = new QFrame(this);
+        hr->setFrameStyle(QFrame::HLine);
+        hr->setLineWidth(3);
+        hr->setFixedHeight(10);
+        layout->addWidget(hr, row++, 0, 1, 2);
+
+    lbLabel = new QLabel(this);
+    lbLabel->setWordWrap(true);
+    lbLabel->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
+    lbLabel->setTextFormat(Qt::RichText);
+    lbLabel->setOpenExternalLinks(true);
+    lbLabel->setText(GoogleNotice);
+    layout->addWidget(lbLabel, row++, 0, 1, 2);
+
+    QDialogButtonBox* dbbButtons = new QDialogButtonBox(this);
+    btnUpload = dbbButtons->addButton(tr("Upload"), QDialogButtonBox::ActionRole);
+    QPushButton * pbCancel = dbbButtons->addButton(QDialogButtonBox::Cancel);
+    layout->addWidget(dbbButtons, row++, 0, 1, 2);
+
+   /* hr = new QFrame(this);
+        hr->setFrameStyle(QFrame::HLine);
+        hr->setLineWidth(3);
+        hr->setFixedHeight(10);
+        layout->addWidget(hr, row++, 0, 1, 2);*/
+
+    connect(btnUpload, SIGNAL(clicked()), this, SLOT(upload()));
+    connect(pbCancel, SIGNAL(clicked()), this, SLOT(reject()));
+
+    this->setWindowModality(Qt::WindowModal);
+}
+
+void HWUploadVideoDialog::showEvent(QShowEvent * event)
+{
+    QDialog::showEvent(event);
+
+    // set width to the same value as height (otherwise dialog has too small width)
+    QSize s = size();
+    QPoint p = pos();
+    resize(s.height(), s.height());
+    move(p.x() - (s.height() - s.width())/2, p.y());
+}
+
+void HWUploadVideoDialog::setEditable(bool editable)
+{
+    leTitle->setEnabled(editable);
+    leAccount->setEnabled(editable);
+    lePassword->setEnabled(editable);
+    btnUpload->setEnabled(editable);
+}
+
+void HWUploadVideoDialog::upload()
+{
+    setEditable(false);
+
+    // Documentation is at https://developers.google.com/youtube/2.0/developers_guide_protocol_clientlogin#ClientLogin_Authentication
+    QNetworkRequest request;
+    request.setUrl(QUrl("https://www.google.com/accounts/ClientLogin"));
+    request.setRawHeader("User-Agent", USER_AGENT);
+    request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
+
+    QString account(QUrl::toPercentEncoding(leAccount->text()));
+    QString pass(QUrl::toPercentEncoding(lePassword->text()));
+    QByteArray data = QString("Email=%1&Passwd=%2&service=youtube&source=Hedgewars").arg(account).arg(pass).toAscii();
+
+    QNetworkReply *reply = netManager->post(request, data);
+    connect(reply, SIGNAL(finished()), this, SLOT(authFinished()));
+}
+
+static QString XmlEscape(const QString& str)
+{
+    QString str2 = str;
+    // youtube doesn't understand this characters, even when they are properly escaped
+    // (either with CDATA or with < >)
+    str2.replace('<', ' ').replace('>', ' ');
+    return "<![CDATA[" + str2.replace("]]>", "]]]]><![CDATA[>") + "]]>";
+}
+
+void HWUploadVideoDialog::authFinished()
+{
+    QNetworkReply *reply = (QNetworkReply*)sender();
+    reply->deleteLater();
+
+    int HttpCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+
+    QByteArray answer = reply->readAll();
+    QString authToken = "";
+    QList<QByteArray> lines = answer.split('\n');
+    foreach (const QByteArray& line, lines)
+    {
+        QString str(line);
+        if (!str.startsWith("Auth=", Qt::CaseInsensitive))
+            continue;
+        str.remove(0, 5);
+        authToken = str;
+        break;
+    }
+    if (authToken.isEmpty())
+    {
+        QString errorStr = QMessageBox::tr("Error while authenticating at google.com:\n");
+        if (HttpCode == 403)
+            errorStr += QMessageBox::tr("Login or password is incorrect");
+        else
+            errorStr += reply->errorString();
+
+        QMessageBox deniedMsg(this);
+        deniedMsg.setIcon(QMessageBox::Warning);
+        deniedMsg.setWindowTitle(QMessageBox::tr("Video upload - Error"));
+        deniedMsg.setText(errorStr);
+        deniedMsg.setWindowModality(Qt::WindowModal);
+        deniedMsg.exec();
+
+        setEditable(true);
+        return;
+    }
+
+    QByteArray auth = ("GoogleLogin auth=" + authToken).toAscii();
+
+    // We have authenticated, now we can send metadata and start upload
+    // Documentation is here: https://developers.google.com/youtube/2.0/developers_guide_protocol_resumable_uploads#Resumable_uploads
+    QByteArray body =
+            "<?xml version=\"1.0\"?>"
+            "<entry xmlns=\"http://www.w3.org/2005/Atom\" "
+                "xmlns:media=\"http://search.yahoo.com/mrss/\" "
+                "xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">"
+                "<media:group>"
+                  //  "<yt:incomplete/>"
+                    "<media:category "
+                        "scheme=\"http://gdata.youtube.com/schemas/2007/categories.cat\">Games"
+                    "</media:category>"
+                    "<media:title type=\"plain\">"
+                        + XmlEscape(leTitle->text()).toUtf8() +
+                    "</media:title>"
+                    "<media:description type=\"plain\">"
+                        + XmlEscape(teDescription->toPlainText()).toUtf8() +
+                    "</media:description>"
+                    "<media:keywords type=\"plain\">"
+                        + XmlEscape(leTags->text()).toUtf8() +
+                    "</media:keywords>"
+                    + (cbPrivate->isChecked()? "<yt:private/>" : "") +
+                "</media:group>"
+            "</entry>";
+
+    QNetworkRequest request;
+    request.setUrl(QUrl("http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads"));
+    request.setRawHeader("User-Agent", USER_AGENT);
+    request.setRawHeader("Authorization", auth);
+    request.setRawHeader("GData-Version", "2");
+    request.setRawHeader("X-GData-Key", "key=" + devKey);
+    request.setRawHeader("Slug", filename.toUtf8());
+    request.setRawHeader("Content-Type", "application/atom+xml; charset=UTF-8");
+
+    reply = netManager->post(request, body);
+    connect(reply, SIGNAL(finished()), this, SLOT(startUpload()));
+}
+
+void HWUploadVideoDialog::startUpload()
+{
+    QNetworkReply *reply = (QNetworkReply*)sender();
+    reply->deleteLater();
+
+    location = QString::fromAscii(reply->rawHeader("Location"));
+    if (location.isEmpty())
+    {
+        QString errorStr = QMessageBox::tr("Error while sending metadata to youtube.com:\n");
+        errorStr += reply->errorString();
+
+        QMessageBox deniedMsg(this);
+        deniedMsg.setIcon(QMessageBox::Warning);
+        deniedMsg.setWindowTitle(QMessageBox::tr("Video upload - Error"));
+        deniedMsg.setText(errorStr);
+        deniedMsg.setWindowModality(Qt::WindowModal);
+        deniedMsg.exec();
+
+        setEditable(true);
+        return;
+    }
+
+    accept();
+}
diff --git a/QTfrontend/ui/dialog/upload_video.h b/QTfrontend/ui/dialog/upload_video.h
new file mode 100644
index 0000000..8803f1c
--- /dev/null
+++ b/QTfrontend/ui/dialog/upload_video.h
@@ -0,0 +1,65 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef UPLOAD_VIDEO_H
+#define UPLOAD_VIDEO_H
+
+#include <QDialog>
+
+class QLineEdit;
+class QCheckBox;
+class QPlainTextEdit;
+class QLabel;
+class QNetworkAccessManager;
+
+class HWUploadVideoDialog : public QDialog
+{
+        Q_OBJECT
+    public:
+    HWUploadVideoDialog(QWidget* parent, const QString& filename, QNetworkAccessManager* netManager);
+
+        QLineEdit* leAccount;
+        QLineEdit* lePassword;
+        QCheckBox* cbSave;
+
+        QLineEdit* leTitle;
+        QPlainTextEdit* teDescription;
+        QLineEdit* leTags;
+        QCheckBox* cbPrivate;
+
+        QPushButton* btnUpload;
+
+        QString location;
+
+    private:
+        QNetworkAccessManager* netManager;
+        QString filename;
+
+        void setEditable(bool editable);
+
+    protected:
+        // virtual from QWidget
+        void showEvent(QShowEvent * event);
+
+    private slots:
+        void upload();
+        void authFinished();
+        void startUpload();
+};
+
+#endif // UPLOAD_VIDEO_H
diff --git a/QTfrontend/ui/mouseoverfilter.cpp b/QTfrontend/ui/mouseoverfilter.cpp
new file mode 100644
index 0000000..03c0277
--- /dev/null
+++ b/QTfrontend/ui/mouseoverfilter.cpp
@@ -0,0 +1,68 @@
+
+#include <QEvent>
+#include <QWidget>
+#include <QStackedLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QCheckBox>
+
+#include "mouseoverfilter.h"
+#include "ui/page/AbstractPage.h"
+#include "ui_hwform.h"
+#include "hwform.h"
+#include "gameuiconfig.h"
+#include "DataManager.h"
+#include "SDLInteraction.h"
+
+MouseOverFilter::MouseOverFilter(QObject *parent) :
+    QObject(parent)
+{
+}
+
+bool MouseOverFilter::eventFilter( QObject *dist, QEvent *event )
+{
+    if (event->type() == QEvent::Enter)
+    {
+        QWidget * widget = dynamic_cast<QWidget*>(dist);
+
+        abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget());
+
+        if (widget->whatsThis() != NULL)
+            abstractpage->setButtonDescription(widget->whatsThis());
+        else if (widget->toolTip() != NULL)
+            abstractpage->setButtonDescription(widget->toolTip());
+
+        // play a sound when mouse hovers certain ui elements
+        QPushButton * button = dynamic_cast<QPushButton*>(dist);
+        QLineEdit * textfield = dynamic_cast<QLineEdit*>(dist);
+        QCheckBox * checkbox = dynamic_cast<QCheckBox*>(dist);
+        QComboBox * droplist = dynamic_cast<QComboBox*>(dist);
+        QSlider * slider = dynamic_cast<QSlider*>(dist);
+        QTabWidget * tab = dynamic_cast<QTabWidget*>(dist);
+        if (HWForm::config->isFrontendSoundEnabled() && (button || textfield || checkbox || droplist || slider || tab))
+        {
+            DataManager & dataMgr = DataManager::instance();
+            SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/steps.ogg"));
+        }
+
+        return true;
+    }
+    else if (event->type() == QEvent::Leave)
+    {
+        abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget());
+
+        if (abstractpage->getDefautDescription() != NULL)
+        {
+            abstractpage->setButtonDescription( * abstractpage->getDefautDescription());
+        }
+        else
+            abstractpage->setButtonDescription("");
+    }
+
+    return false;
+}
+
+void MouseOverFilter::setUi(Ui_HWForm *uiForm)
+{
+    ui = uiForm;
+}
diff --git a/QTfrontend/ui/mouseoverfilter.h b/QTfrontend/ui/mouseoverfilter.h
new file mode 100644
index 0000000..e1cb064
--- /dev/null
+++ b/QTfrontend/ui/mouseoverfilter.h
@@ -0,0 +1,27 @@
+#ifndef MOUSEOVERFILTER_H
+#define MOUSEOVERFILTER_H
+
+#include <QObject>
+
+#include "ui_hwform.h"
+#include "ui/page/AbstractPage.h"
+
+class MouseOverFilter : public QObject
+{
+        Q_OBJECT
+    public:
+        explicit MouseOverFilter(QObject *parent = 0);
+        void setUi(Ui_HWForm *uiForm);
+    protected:
+        bool eventFilter( QObject *dist, QEvent *event );
+    signals:
+
+    public slots:
+
+    private:
+        Ui_HWForm *ui;
+        AbstractPage* abstractpage;
+
+};
+
+#endif // MOUSEOVERFILTER_H
diff --git a/QTfrontend/ui/page/AbstractPage.cpp b/QTfrontend/ui/page/AbstractPage.cpp
index f440378..b19ffbe 100644
--- a/QTfrontend/ui/page/AbstractPage.cpp
+++ b/QTfrontend/ui/page/AbstractPage.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,10 +22,16 @@
  */
 
 #include "AbstractPage.h"
+#include <QLabel>
+#include <QSize>
+#include <QFontMetricsF>
+
+#include "qpushbuttonwithsound.h"
 
 AbstractPage::AbstractPage(QWidget* parent)
 {
     Q_UNUSED(parent);
+    defautDesc = new QString();
 
     font14 = new QFont("MS Shell Dlg", 14);
 }
@@ -42,24 +48,33 @@ void AbstractPage::initPage()
 
     // add back/exit button
     btnBack = formattedButton(":/res/Exit.png", true);
+    btnBack->setWhatsThis(tr("Go back"));
     pageLayout->addWidget(btnBack, 1, 0, 1, 1, Qt::AlignLeft | Qt::AlignBottom);
 
     // add body layout as defined by the subclass
-    pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 2);
+    pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 3);
+
+    descLabel = new QLabel();
+    descLabel->setAlignment(Qt::AlignCenter);
+    descLabel->setWordWrap(true);
+    descLabel->setOpenExternalLinks(true);
+    descLabel->setFixedHeight(50);
+    descLabel->setStyleSheet("font-size: 16px");
+    pageLayout->addWidget(descLabel, 1, 1);
 
     // add footer layout
     QLayout * fld = footerLayoutDefinition();
     if (fld != NULL)
-        pageLayout->addLayout(fld, 1, 1);
+        pageLayout->addLayout(fld, 1, 2);
 
     // connect signals
     connect(btnBack, SIGNAL(clicked()), this, SIGNAL(goBack()));
     connectSignals();
 }
 
-QPushButton * AbstractPage::formattedButton(const QString & name, bool hasIcon)
+QPushButtonWithSound * AbstractPage::formattedButton(const QString & name, bool hasIcon)
 {
-    QPushButton * btn = new QPushButton(this);
+    QPushButtonWithSound * btn = new QPushButtonWithSound(this);
 
     if (hasIcon)
     {
@@ -78,17 +93,45 @@ QPushButton * AbstractPage::formattedButton(const QString & name, bool hasIcon)
     }
     return btn;
 }
+QPushButton* AbstractPage::formattedSoundlessButton(const QString & name, bool hasIcon)
+{
+    QPushButton* btn = new QPushButton(this);
 
-QPushButton * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon)
+    if (hasIcon)
+    {
+        const QIcon& lp=QIcon(name);
+        QSize sz = lp.actualSize(QSize(65535, 65535));
+        btn->setIcon(lp);
+        btn->setFixedSize(sz);
+        btn->setIconSize(sz);
+        btn->setFlat(true);
+        btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+    }
+    else
+    {
+        btn->setFont(*font14);
+        btn->setText(name);
+    }
+    return btn;
+}
+
+QPushButtonWithSound * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon)
 {
-    QPushButton * btn = formattedButton(name, hasIcon);
+    QPushButtonWithSound * btn = formattedButton(name, hasIcon);
     grid->addWidget(btn, row, column, rowSpan, columnSpan);
     return btn;
 }
 
-QPushButton * AbstractPage::addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon)
+QPushButtonWithSound * AbstractPage::addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon)
 {
-    QPushButton * btn = formattedButton(name, hasIcon);
+    QPushButtonWithSound * btn = formattedButton(name, hasIcon);
+    box->addWidget(btn, where);
+    return btn;
+}
+
+QPushButton* AbstractPage::addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon)
+{
+    QPushButton* btn = formattedSoundlessButton(name, hasIcon);
     box->addWidget(btn, where);
     return btn;
 }
@@ -97,3 +140,19 @@ void AbstractPage::setBackButtonVisible(bool visible)
 {
     btnBack->setVisible(visible);
 }
+
+void AbstractPage::setButtonDescription(QString desc)
+{
+    descLabel->setText(desc);
+}
+
+void AbstractPage::setDefautDescription(QString text)
+{
+    *defautDesc = text;
+    descLabel->setText(text);
+}
+
+QString * AbstractPage::getDefautDescription()
+{
+    return defautDesc;
+}
diff --git a/QTfrontend/ui/page/AbstractPage.h b/QTfrontend/ui/page/AbstractPage.h
index b9bbc98..a9d1566 100644
--- a/QTfrontend/ui/page/AbstractPage.h
+++ b/QTfrontend/ui/page/AbstractPage.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,13 +25,13 @@
 #define ABSTRACTPAGE_H
 
 #include <QWidget>
-#include <QPushButton>
+#include <qpushbuttonwithsound.h>
 #include <QFont>
 #include <QGridLayout>
 #include <QComboBox>
 #include <QSignalMapper>
 
-class QPushButton;
+class QPushButtonWithSound;
 class QGroupBox;
 class QComboBox;
 class QLabel;
@@ -54,7 +54,28 @@ class QGridlayout;
 
 class AbstractPage : public QWidget
 {
-    Q_OBJECT
+        Q_OBJECT
+
+    public:
+
+        /**
+        * @brief Changes the desc text (should not be called manualy)
+        *
+        * @param desc the description of the widget focused
+        */
+        void setButtonDescription(QString desc);
+
+        /**
+        * @brief Changes the desc defaut text
+        *
+        * @param text the defaut desc
+        */
+        void setDefautDescription(QString text);
+
+        /**
+        * @brief Get the desc defaut text
+        */
+        QString * getDefautDescription();
 
     signals:
         /**
@@ -91,7 +112,10 @@ class AbstractPage : public QWidget
          *
          * Use it to define layout (not behavior) of the page's footer.
          */
-        virtual QLayout * footerLayoutDefinition() { return NULL; };
+        virtual QLayout * footerLayoutDefinition()
+        {
+            return NULL;
+        };
 
         /**
          * @brief Used during page construction.
@@ -113,7 +137,8 @@ class AbstractPage : public QWidget
          *
          * @return the button.
          */
-        QPushButton * formattedButton(const QString & name, bool hasIcon = false);
+        QPushButtonWithSound * formattedButton(const QString & name, bool hasIcon = false);
+        QPushButton * formattedSoundlessButton(const QString & name, bool hasIcon = false);
 
         /**
          * @brief Creates a default formatted button and adds it to a
@@ -129,7 +154,7 @@ class AbstractPage : public QWidget
          *
          * @return the button.
          */
-        QPushButton * addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false);
+        QPushButtonWithSound * addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan = 1, int columnSpan = 1, bool hasIcon = false);
 
         /**
          * @brief Creates a default formatted button and adds it to a
@@ -142,7 +167,8 @@ class AbstractPage : public QWidget
          *
          * @return the button.
          */
-        QPushButton * addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false);
+        QPushButtonWithSound * addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false);
+        QPushButton* addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon = false);
 
         /**
          * @brief Changes visibility of the back-button.
@@ -153,9 +179,10 @@ class AbstractPage : public QWidget
 
         QFont * font14; ///< used font
 
-    private:
+        QLabel * descLabel; ///< text description
+        QString * defautDesc;
 
-        QPushButton * btnBack; ///< back button
+        QPushButtonWithSound * btnBack; ///< back button
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageadmin.cpp b/QTfrontend/ui/page/pageadmin.cpp
index b2703a4..c3cd710 100644
--- a/QTfrontend/ui/page/pageadmin.cpp
+++ b/QTfrontend/ui/page/pageadmin.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -32,7 +32,7 @@ QLayout * PageAdmin::bodyLayoutDefinition()
 
     // 0
     pbAsk = addButton(tr("Fetch data"), pageLayout, 0, 0, 1, 3);
-    
+
     // 1
     QLabel * lblSMN = new QLabel(this);
     lblSMN->setText(tr("Server message for latest version:"));
@@ -66,10 +66,10 @@ QLayout * PageAdmin::bodyLayoutDefinition()
     tb->setOpenExternalLinks(true);
     tb->document()->setDefaultStyleSheet(HWChatWidget::styleSheet());
     pageLayout->addWidget(tb, 4, 1, 1, 2);
-    
+
     // 5
     pbClearAccountsCache = addButton(tr("Clear Accounts Cache"), pageLayout, 5, 0);
-    
+
     // 6
     pbSetSM = addButton(tr("Set data"), pageLayout, 6, 0, 1, 3);
 
@@ -79,8 +79,8 @@ QLayout * PageAdmin::bodyLayoutDefinition()
 void PageAdmin::connectSignals()
 {
     connect(pbAsk, SIGNAL(clicked()), this, SIGNAL(askServerVars()));
-    connect(leServerMessageNew, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
-    connect(leServerMessageOld, SIGNAL(textEdited(const QString &)), tb, SLOT(setHtml(const QString &)));
+    connect(leServerMessageNew, SIGNAL(textChanged(QString)), tb, SLOT(setHtml(const QString &)));
+    connect(leServerMessageOld, SIGNAL(textChanged(QString)), tb, SLOT(setHtml(const QString &)));
     connect(pbClearAccountsCache, SIGNAL(clicked()), this, SIGNAL(clearAccountsCache()));
     connect(pbSetSM, SIGNAL(clicked()), this, SLOT(smChanged()));
 }
diff --git a/QTfrontend/ui/page/pageadmin.h b/QTfrontend/ui/page/pageadmin.h
index e0cafac..28e52c6 100644
--- a/QTfrontend/ui/page/pageadmin.h
+++ b/QTfrontend/ui/page/pageadmin.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,38 +23,38 @@
 
 class PageAdmin : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageAdmin(QWidget* parent = 0);
-
-public slots:
-    void serverMessageNew(const QString & str);
-    void serverMessageOld(const QString & str);
-    void protocol(int proto);
-
-signals:
-    void setServerMessageNew(const QString & str);
-    void setServerMessageOld(const QString & str);
-    void setProtocol(int proto);
-    void askServerVars();
-    void clearAccountsCache();
-
-protected:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
-
-private:
-    QLineEdit * leServerMessageNew;
-    QLineEdit * leServerMessageOld;
-    QPushButton * pbSetSM;
-    QPushButton * pbAsk;
-    QSpinBox * sbProtocol;
-    QTextBrowser * tb;
-    QPushButton * pbClearAccountsCache;
-
-private slots:
-    void smChanged();
+        Q_OBJECT
+
+    public:
+        PageAdmin(QWidget* parent = 0);
+
+    public slots:
+        void serverMessageNew(const QString & str);
+        void serverMessageOld(const QString & str);
+        void protocol(int proto);
+
+    signals:
+        void setServerMessageNew(const QString & str);
+        void setServerMessageOld(const QString & str);
+        void setProtocol(int proto);
+        void askServerVars();
+        void clearAccountsCache();
+
+    protected:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
+
+    private:
+        QLineEdit * leServerMessageNew;
+        QLineEdit * leServerMessageOld;
+        QPushButton * pbSetSM;
+        QPushButton * pbAsk;
+        QSpinBox * sbProtocol;
+        QTextBrowser * tb;
+        QPushButton * pbClearAccountsCache;
+
+    private slots:
+        void smChanged();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagecampaign.cpp b/QTfrontend/ui/page/pagecampaign.cpp
index 49461a2..eb7192a 100644
--- a/QTfrontend/ui/page/pagecampaign.cpp
+++ b/QTfrontend/ui/page/pagecampaign.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,12 +31,14 @@ QLayout * PageCampaign::bodyLayoutDefinition()
     pageLayout->setRowStretch(0, 1);
     pageLayout->setRowStretch(3, 1);
 
-    CBSelect = new QComboBox(this);
     CBTeam = new QComboBox(this);
+    CBMission = new QComboBox(this);
+    CBCampaign = new QComboBox(this);
 
     pageLayout->addWidget(CBTeam, 1, 1);
-    pageLayout->addWidget(CBSelect, 2, 1);
-    
+    pageLayout->addWidget(CBCampaign, 2, 1);
+    pageLayout->addWidget(CBMission, 3, 1);
+
     BtnStartCampaign = new QPushButton(this);
     BtnStartCampaign->setFont(*font14);
     BtnStartCampaign->setText(QPushButton::tr("Go!"));
diff --git a/QTfrontend/ui/page/pagecampaign.h b/QTfrontend/ui/page/pagecampaign.h
index e915a59..c12551f 100644
--- a/QTfrontend/ui/page/pagecampaign.h
+++ b/QTfrontend/ui/page/pagecampaign.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,17 +23,18 @@
 
 class PageCampaign : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageCampaign(QWidget* parent = 0);
+    public:
+        PageCampaign(QWidget* parent = 0);
 
-    QPushButton *BtnStartCampaign;
-    QComboBox   *CBSelect;
-    QComboBox   *CBTeam;
+        QPushButton *BtnStartCampaign;
+        QComboBox   *CBMission;
+        QComboBox   *CBCampaign;
+        QComboBox   *CBTeam;
 
-protected:
-    QLayout * bodyLayoutDefinition();
+    protected:
+        QLayout * bodyLayoutDefinition();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageconnecting.cpp b/QTfrontend/ui/page/pageconnecting.cpp
index 18ca3d6..d82f45d 100644
--- a/QTfrontend/ui/page/pageconnecting.cpp
+++ b/QTfrontend/ui/page/pageconnecting.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/page/pageconnecting.h b/QTfrontend/ui/page/pageconnecting.h
index 80e7867..3eb445d 100644
--- a/QTfrontend/ui/page/pageconnecting.h
+++ b/QTfrontend/ui/page/pageconnecting.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,17 +23,17 @@
 
 class PageConnecting : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageConnecting(QWidget* parent = 0);
+    public:
+        PageConnecting(QWidget* parent = 0);
 
-signals:
-    void cancelConnection();
+    signals:
+        void cancelConnection();
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagedata.cpp b/QTfrontend/ui/page/pagedata.cpp
index b3c1c5f..4f4057e 100644
--- a/QTfrontend/ui/page/pagedata.cpp
+++ b/QTfrontend/ui/page/pagedata.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -30,6 +30,7 @@
 #include "pagedata.h"
 #include "databrowser.h"
 #include "hwconsts.h"
+#include "DataManager.h"
 
 #include "quazip.h"
 #include "quazipfile.h"
@@ -52,6 +53,7 @@ QLayout * PageDataDownload::bodyLayoutDefinition()
 void PageDataDownload::connectSignals()
 {
     connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&)));
+    connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave()));
 }
 
 PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent)
@@ -60,6 +62,8 @@ PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent)
 
     web->setOpenLinks(false);
 //    fetchList();
+
+    m_contentDownloaded = false;
 }
 
 void PageDataDownload::request(const QUrl &url)
@@ -86,7 +90,8 @@ void PageDataDownload::request(const QUrl &url)
         QProgressBar *progressBar = new QProgressBar(this);
         progressBarsLayout->addWidget(progressBar);
         progressBars.insert(reply, progressBar);
-    } else
+    }
+    else
     {
         qWarning() << "Page Request" << url.toString();
 
@@ -166,8 +171,8 @@ bool PageDataDownload::extractDataPack(QByteArray * buf)
     zip.setIoDevice(&buffer);
     if(!zip.open(QuaZip::mdUnzip))
     {
-      qWarning("testRead(): zip.open(): %d", zip.getZipError());
-      return false;
+        qWarning("testRead(): zip.open(): %d", zip.getZipError());
+        return false;
     }
 
     QuaZipFile file(&zip);
@@ -190,7 +195,8 @@ bool PageDataDownload::extractDataPack(QByteArray * buf)
         {
             QFileInfo fi(filePath);
             QDir().mkpath(fi.filePath());
-        } else
+        }
+        else
         {
             qDebug() << "Extracting" << filePath;
             QFile out(filePath);
@@ -204,20 +210,25 @@ bool PageDataDownload::extractDataPack(QByteArray * buf)
 
             out.close();
 
-            if(file.getZipError() != UNZ_OK) {
+            if(file.getZipError() != UNZ_OK)
+            {
                 qWarning("file.getFileName(): %d", file.getZipError());
                 return false;
             }
 
-            if(!file.atEnd()) {
+            if(!file.atEnd())
+            {
                 qWarning("read all but not EOF");
                 return false;
             }
+
+            m_contentDownloaded = true;
         }
 
         file.close();
 
-        if(file.getZipError()!=UNZ_OK) {
+        if(file.getZipError()!=UNZ_OK)
+        {
             qWarning("file.close(): %d", file.getZipError());
             return false;
         }
@@ -227,3 +238,13 @@ bool PageDataDownload::extractDataPack(QByteArray * buf)
 
     return true;
 }
+
+
+void PageDataDownload::onPageLeave()
+{
+    if (m_contentDownloaded)
+    {
+        m_contentDownloaded = false;
+        //DataManager::instance().reload();
+    }
+}
diff --git a/QTfrontend/ui/page/pagedata.h b/QTfrontend/ui/page/pagedata.h
index 589e8a1..fd59988 100644
--- a/QTfrontend/ui/page/pagedata.h
+++ b/QTfrontend/ui/page/pagedata.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,31 +29,35 @@ class QVBoxLayout;
 
 class PageDataDownload : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageDataDownload(QWidget* parent = 0);
+    public:
+        PageDataDownload(QWidget* parent = 0);
 
-public slots:
-    void fetchList();
+    public slots:
+        void fetchList();
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 
-private:
-    DataBrowser *web;
-    QHash<QNetworkReply*, QProgressBar *> progressBars;
-    QVBoxLayout *progressBarsLayout;
+    private:
+        DataBrowser *web;
+        QHash<QNetworkReply*, QProgressBar *> progressBars;
+        QVBoxLayout *progressBarsLayout;
 
-    bool extractDataPack(QByteArray * buf);
+        bool m_contentDownloaded; ///< true if something was downloaded since last page leave
 
-private slots:
-    void request(const QUrl &url);
+        bool extractDataPack(QByteArray * buf);
 
-    void pageDownloaded();
-    void fileDownloaded();
-    void downloadProgress(qint64, qint64);
+    private slots:
+        void request(const QUrl &url);
+
+        void pageDownloaded();
+        void fileDownloaded();
+        void downloadProgress(qint64, qint64);
+
+        void onPageLeave();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagedrawmap.cpp b/QTfrontend/ui/page/pagedrawmap.cpp
index 381d1a6..86d105b 100644
--- a/QTfrontend/ui/page/pagedrawmap.cpp
+++ b/QTfrontend/ui/page/pagedrawmap.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -19,6 +19,7 @@
 #include <QGridLayout>
 #include <QPushButton>
 #include <QFileDialog>
+#include <QCheckBox>
 
 #include "pagedrawmap.h"
 #include "drawmapwidget.h"
@@ -28,19 +29,22 @@ QLayout * PageDrawMap::bodyLayoutDefinition()
 {
     QGridLayout * pageLayout = new QGridLayout();
 
-    pbUndo = addButton(tr("Undo"), pageLayout, 0, 0);
-    pbClear = addButton(tr("Clear"), pageLayout, 1, 0);
-    pbLoad = addButton(tr("Load"), pageLayout, 2, 0);
-    pbSave = addButton(tr("Save"), pageLayout, 3, 0);
+    cbEraser = new QCheckBox(tr("Eraser"), this);
+    pageLayout->addWidget(cbEraser, 0, 0);
+    pbUndo = addButton(tr("Undo"), pageLayout, 1, 0);
+    pbClear = addButton(tr("Clear"), pageLayout, 2, 0);
+    pbLoad = addButton(tr("Load"), pageLayout, 3, 0);
+    pbSave = addButton(tr("Save"), pageLayout, 4, 0);
 
     drawMapWidget = new DrawMapWidget(this);
-    pageLayout->addWidget(drawMapWidget, 0, 1, 5, 1);
+    pageLayout->addWidget(drawMapWidget, 0, 1, 6, 1);
 
     return pageLayout;
 }
 
 void PageDrawMap::connectSignals()
 {
+    connect(cbEraser, SIGNAL(toggled(bool)), drawMapWidget, SLOT(setErasing(bool)));
     connect(pbUndo, SIGNAL(clicked()), drawMapWidget, SLOT(undo()));
     connect(pbClear, SIGNAL(clicked()), drawMapWidget, SLOT(clear()));
     connect(pbLoad, SIGNAL(clicked()), this, SLOT(load()));
@@ -62,7 +66,7 @@ void PageDrawMap::load()
 
 void PageDrawMap::save()
 {
-    QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save drawn map"), ".", tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
+    QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save drawn map"), "./map.hwmap", tr("Drawn Maps") + " (*.hwmap);;" + tr("All files") + " (*)");
 
     if(!fileName.isEmpty())
         drawMapWidget->save(fileName);
diff --git a/QTfrontend/ui/page/pagedrawmap.h b/QTfrontend/ui/page/pagedrawmap.h
index bc22ae0..c971fab 100644
--- a/QTfrontend/ui/page/pagedrawmap.h
+++ b/QTfrontend/ui/page/pagedrawmap.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,26 +25,27 @@ class DrawMapWidget;
 
 class PageDrawMap : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageDrawMap(QWidget* parent = 0);
+    public:
+        PageDrawMap(QWidget* parent = 0);
 
-    DrawMapWidget * drawMapWidget;
+        DrawMapWidget * drawMapWidget;
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 
-private:
-    QPushButton * pbUndo;
-    QPushButton * pbClear;
-    QPushButton * pbLoad;
-    QPushButton * pbSave;
+    private:
+        QPushButton * pbUndo;
+        QPushButton * pbClear;
+        QPushButton * pbLoad;
+        QPushButton * pbSave;
+        QCheckBox * cbEraser;
 
-private slots:
-    void load();
-    void save();
+    private slots:
+        void load();
+        void save();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageeditteam.cpp b/QTfrontend/ui/page/pageeditteam.cpp
index 1e5e1b6..787921e 100644
--- a/QTfrontend/ui/page/pageeditteam.cpp
+++ b/QTfrontend/ui/page/pageeditteam.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,13 +26,13 @@
 #include <QGroupBox>
 #include <QToolBox>
 #include <QMessageBox>
-
-#include "sdlkeys.h"
+#include <QStandardItemModel>
+#include <QDebug>
 #include "SquareLabel.h"
-#include "hats.h"
 #include "HWApplication.h"
 
-#include "HWDataManager.h"
+#include "DataManager.h"
+#include "HatModel.h"
 
 #include "pageeditteam.h"
 
@@ -61,11 +61,12 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
     GBoxHedgehogs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     QGridLayout * GBHLayout = new QGridLayout(GBoxHedgehogs);
 
-    HatsModel * hatsModel = new HatsModel(GBoxHedgehogs);
+    HatModel * hatModel = DataManager::instance().hatModel();
+
     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
         HHHats[i] = new QComboBox(GBoxHedgehogs);
-        HHHats[i]->setModel(hatsModel);
+        HHHats[i]->setModel(hatModel);
         HHHats[i]->setIconSize(QSize(32, 37));
         //HHHats[i]->setSizeAdjustPolicy(QComboBox::AdjustToContents);
         //HHHats[i]->setModelColumn(1);
@@ -114,9 +115,9 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
     CBTeamLvl->addItem(QIcon(":/res/botlevels/0.png"), QComboBox::tr("Human"));
     for(int i = 5; i > 0; i--)
         CBTeamLvl->addItem(
-                QIcon(QString(":/res/botlevels/%1.png").arg(6 - i)),
-                QString("%1 %2").arg(QComboBox::tr("Level")).arg(i)
-                );
+            QIcon(QString(":/res/botlevels/%1.png").arg(6 - i)),
+            QString("%1 %2").arg(QComboBox::tr("Level")).arg(i)
+        );
     GBTLayout->addWidget(CBTeamLvl, 1, 1);
 
     CBGrave = new QComboBox(GBoxTeam);
@@ -133,7 +134,7 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
     CBVoicepack = new QComboBox(GBoxTeam);
 
     hbox->addWidget(CBVoicepack, 100);
-    btnTestSound = addButton(":/res/PlaySound.png", hbox, 1, true);
+    btnTestSound = addSoundlessButton(":/res/PlaySound.png", hbox, 1, true);
     hbox->setStretchFactor(btnTestSound, 1);
 
     GBTLayout->addLayout(hbox, 4, 1);
@@ -170,7 +171,8 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
     QWidget * curW = NULL;
     QGridLayout * pagelayout = NULL;
     QLabel* l = NULL;
-    while (i < BINDS_NUMBER) {
+    while (i < BINDS_NUMBER)
+    {
         if(cbinds[i].category != NULL)
         {
             if(curW != NULL)
@@ -195,9 +197,9 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
         l->setText(HWApplication::translate("binds", cbinds[i].name));
         l->setAlignment(Qt::AlignRight);
         pagelayout->addWidget(l, num, 0);
+
         CBBind[i] = new QComboBox(curW);
-        for(int j = 0; sdlkeys[j][1][0] != '\0'; j++)
-            CBBind[i]->addItem(HWApplication::translate("binds (keys)", sdlkeys[j][1]).contains(": ") ? HWApplication::translate("binds (keys)", sdlkeys[j][1]) : HWApplication::translate("binds (keys)", "Keyboard") + QString(": ") + HWApplication::translate("binds (keys)", sdlkeys[j][1]), sdlkeys[j][0]);
+        CBBind[i]->setModel(DataManager::instance().bindsModel());
         pagelayout->addWidget(CBBind[i++], num++, 1);
     }
 
@@ -206,18 +208,12 @@ QLayout * PageEditTeam::bodyLayoutDefinition()
 
 QLayout * PageEditTeam::footerLayoutDefinition()
 {
-    QHBoxLayout * bottomLayout = new QHBoxLayout();
-
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);;
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-
-    return bottomLayout;
+    return NULL;
 }
 
 void PageEditTeam::connectSignals()
 {
-    connect(btnSave, SIGNAL(clicked()), this, SLOT(saveTeam()));
+    connect(this, SIGNAL(goBack()), this, SLOT(saveTeam()));
 
     signalMapper1 = new QSignalMapper(this);
     signalMapper2 = new QSignalMapper(this);
@@ -228,21 +224,21 @@ void PageEditTeam::connectSignals()
     for(int i = 0; i < HEDGEHOGS_PER_TEAM; i++)
     {
         connect(HHNameEdit[i], SIGNAL(editingFinished()), signalMapper1, SLOT(map()));
-            signalMapper1->setMapping(HHNameEdit[i], i);
+        signalMapper1->setMapping(HHNameEdit[i], i);
 
         connect(btnRandomHogName[i], SIGNAL(clicked()), signalMapper2, SLOT(map()));
-            signalMapper2->setMapping(btnRandomHogName[i], i);
+        signalMapper2->setMapping(btnRandomHogName[i], i);
     }
 
     connect(btnRandomTeam, SIGNAL(clicked()), this, SLOT(setRandomNames()));
-    
+
     connect(btnTestSound, SIGNAL(clicked()), this, SLOT(testSound()));
 
     connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &)));
 }
 
 PageEditTeam::PageEditTeam(QWidget* parent) :
-  AbstractPage(parent)
+    AbstractPage(parent)
 {
     initPage();
 
@@ -250,13 +246,13 @@ PageEditTeam::PageEditTeam(QWidget* parent) :
 
     m_playerHash = "0000000000000000000000000000000000000000";
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     QStringList list;
 
 
     // voicepacks
-    list = dataMgr.entryList("Sounds/voices", 
+    list = dataMgr.entryList("Sounds/voices",
                              QDir::AllDirs | QDir::NoDotAndDotDot);
 
     CBVoicepack->addItems(list);
@@ -293,6 +289,9 @@ PageEditTeam::PageEditTeam(QWidget* parent) :
     int idx = list.indexOf("cpu.png");
     if (idx >= 0)
         list.removeAt(idx);
+    idx = list.indexOf("cpu_plain.png");
+    if (idx >= 0)
+        list.removeAt(idx);
     idx = list.indexOf("hedgewars.png");
     if (idx >= 0)
         list.removeAt(idx);
@@ -338,32 +337,32 @@ void PageEditTeam::fixHHname(int idx)
 
 void PageEditTeam::CBFort_activated(const QString & fortname)
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
     QPixmap pix(dataMgr.findFileForRead("Forts/" + fortname + "L.png"));
     FortPreview->setPixmap(pix);
 }
 
 void PageEditTeam::testSound()
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText();
 
     QStringList list = dataMgr.entryList(
-            voiceDir,
-            QDir::Files,
-            QStringList() <<
-                "Illgetyou.ogg" <<
-                "Incoming.ogg" <<
-                "Stupid.ogg" <<
-                "Coward.ogg" <<
-                "Firstblood.ogg"
-            );
+                           voiceDir,
+                           QDir::Files,
+                           QStringList() <<
+                           "Illgetyou.ogg" <<
+                           "Incoming.ogg" <<
+                           "Stupid.ogg" <<
+                           "Coward.ogg" <<
+                           "Firstblood.ogg"
+                       );
 
     if (!list.isEmpty())
         SDLInteraction::instance().playSoundFile(
             dataMgr.findFileForRead(voiceDir + "/" +
-                list[rand() % list.size()])
+                                    list[rand() % list.size()])
         );
 }
 
@@ -384,9 +383,14 @@ void PageEditTeam::editTeam(const QString & name, const QString & playerHash)
 
 void PageEditTeam::deleteTeam(const QString & name)
 {
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Teams"), QMessageBox::tr("Really delete this team?"), QMessageBox::Ok | QMessageBox::Cancel, this);
-
-    if (reallyDelete.exec() == QMessageBox::Ok)
+    QMessageBox reallyDeleteMsg(this);
+    reallyDeleteMsg.setIcon(QMessageBox::Question);
+    reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Teams - Are you sure?"));
+    reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to delete the team '%1'?").arg(name));
+    reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+    reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+    if (reallyDeleteMsg.exec() == QMessageBox::Ok)
         HWTeam(name).deleteFile();
 }
 
@@ -427,9 +431,15 @@ void PageEditTeam::loadTeam(const HWTeam & team)
     CBFort->setCurrentIndex(CBFort->findText(team.fort()));
     CBVoicepack->setCurrentIndex(CBVoicepack->findText(team.voicepack()));
 
+    QStandardItemModel * binds = DataManager::instance().bindsModel();
     for(int i = 0; i < BINDS_NUMBER; i++)
     {
-        CBBind[i]->setCurrentIndex(CBBind[i]->findData(team.keyBind(i)));
+        QModelIndexList mdl = binds->match(binds->index(0, 0), Qt::UserRole + 1, team.keyBind(i), 1, Qt::MatchExactly);
+
+        if(mdl.size() == 1)
+            CBBind[i]->setCurrentIndex(mdl[0].row());
+        else
+            qDebug() << "Binds: cannot find" << team.keyBind(i);
     }
 }
 
@@ -455,9 +465,10 @@ HWTeam PageEditTeam::data()
     team.setVoicepack(CBVoicepack->currentText());
     team.setFlag(CBFlag->itemData(CBFlag->currentIndex()).toString());
 
+    QStandardItemModel * binds = DataManager::instance().bindsModel();
     for(int i = 0; i < BINDS_NUMBER; i++)
     {
-        team.bindKey(i,CBBind[i]->itemData(CBBind[i]->currentIndex()).toString());
+        team.bindKey(i, binds->index(CBBind[i]->currentIndex(), 0).data(Qt::UserRole + 1).toString());
     }
 
     return team;
@@ -466,5 +477,4 @@ HWTeam PageEditTeam::data()
 void PageEditTeam::saveTeam()
 {
     data().saveToFile();
-    emit teamEdited();
 }
diff --git a/QTfrontend/ui/page/pageeditteam.h b/QTfrontend/ui/page/pageeditteam.h
index 9803bcd..b44a19d 100644
--- a/QTfrontend/ui/page/pageeditteam.h
+++ b/QTfrontend/ui/page/pageeditteam.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,66 +31,60 @@ class SquareLabel;
 
 class PageEditTeam : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageEditTeam(QWidget* parent);
-
-    void createTeam(const QString & name, const QString & playerHash);
-    void editTeam(const QString & name, const QString & playerHash);
-    void deleteTeam(const QString & name);
-
-signals:
-    void teamEdited();
-
-public slots:
-    void CBFort_activated(const QString & gravename);
-
-private:
-    QSignalMapper* signalMapper1;
-    QSignalMapper* signalMapper2;
-    QGroupBox *GBoxHedgehogs;
-    QGroupBox *GBoxTeam;
-    QGroupBox *GBoxFort;
-    QComboBox *CBFort;
-    SquareLabel *FortPreview;
-    QComboBox *CBGrave;
-    QComboBox *CBFlag;
-    QComboBox *CBTeamLvl;
-    QComboBox *CBVoicepack;
-    QGroupBox *GBoxBinds;
-    QToolBox *BindsBox;
-    QLineEdit * TeamNameEdit;
-    QLineEdit * HHNameEdit[HEDGEHOGS_PER_TEAM];
-    QComboBox * HHHats[HEDGEHOGS_PER_TEAM];
-    QComboBox * CBBind[BINDS_NUMBER];
-    HWTeam data();
-    QString m_playerHash;
-
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
-
-    void loadTeam(const HWTeam & team);
-
-    // page 1
-    QPushButton * btnRandomHogName[HEDGEHOGS_PER_TEAM];
-    QPushButton * btnRandomTeam;
-    QPushButton * btnTestSound;
-
-    // footer
-    QPushButton * btnSave;
-
-private slots:
-    void saveTeam();
-    void setRandomNames();
-
-    void setRandomName(int hh_index);
-    
-    /// Plays a random voice sound of the currently edited team.
-    void testSound();
-
-    void fixHHname(int idx);
+        Q_OBJECT
+
+    public:
+        PageEditTeam(QWidget* parent);
+
+        void createTeam(const QString & name, const QString & playerHash);
+        void editTeam(const QString & name, const QString & playerHash);
+        void deleteTeam(const QString & name);
+
+    public slots:
+        void CBFort_activated(const QString & gravename);
+
+    private:
+        QSignalMapper* signalMapper1;
+        QSignalMapper* signalMapper2;
+        QGroupBox *GBoxHedgehogs;
+        QGroupBox *GBoxTeam;
+        QGroupBox *GBoxFort;
+        QComboBox *CBFort;
+        SquareLabel *FortPreview;
+        QComboBox *CBGrave;
+        QComboBox *CBFlag;
+        QComboBox *CBTeamLvl;
+        QComboBox *CBVoicepack;
+        QGroupBox *GBoxBinds;
+        QToolBox *BindsBox;
+        QLineEdit * TeamNameEdit;
+        QLineEdit * HHNameEdit[HEDGEHOGS_PER_TEAM];
+        QComboBox * HHHats[HEDGEHOGS_PER_TEAM];
+        QComboBox * CBBind[BINDS_NUMBER];
+        HWTeam data();
+        QString m_playerHash;
+
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
+
+        void loadTeam(const HWTeam & team);
+
+        // page 1
+        QPushButton * btnRandomHogName[HEDGEHOGS_PER_TEAM];
+        QPushButton * btnRandomTeam;
+        QPushButton * btnTestSound;
+
+    private slots:
+        void saveTeam();
+        void setRandomNames();
+
+        void setRandomName(int hh_index);
+
+        /// Plays a random voice sound of the currently edited team.
+        void testSound();
+
+        void fixHHname(int idx);
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagefeedback.cpp b/QTfrontend/ui/page/pagefeedback.cpp
new file mode 100644
index 0000000..29fd27c
--- /dev/null
+++ b/QTfrontend/ui/page/pagefeedback.cpp
@@ -0,0 +1,82 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QTextBrowser>
+#include <QLabel>
+
+#include "pagefeedback.h"
+#include "hwconsts.h"
+
+QLayout * PageFeedback::bodyLayoutDefinition()
+{
+    QVBoxLayout * pageLayout = new QVBoxLayout();
+    QHBoxLayout * summaryLayout = new QHBoxLayout();
+
+    info = new QLabel();
+    info->setText(
+        "<style type=\"text/css\">"
+        "a { color: #ffcc00; }"
+        "</style>"
+        "<div align=\"center\"><h1>Please give us a feedback!</h1>"
+        "<h3>We are always happy about suggestions, ideas or bug reports.<h3>"
+        "<h4>The feedback will be posted as a new issue on our Google Code page.<h4>"
+        "</div>"
+    );
+    pageLayout->addWidget(info);
+
+    label_summary = new QLabel();
+    label_summary->setText(QLabel::tr("Summary   "));
+    summaryLayout->addWidget(label_summary);
+    summary = new QLineEdit();
+    summaryLayout->addWidget(summary);
+    pageLayout->addLayout(summaryLayout);
+
+    label_description = new QLabel();
+    label_description->setText(QLabel::tr("Description"));
+    pageLayout->addWidget(label_description, 0, Qt::AlignHCenter);
+    description = new QTextBrowser();
+    description->setReadOnly(false);
+    pageLayout->addWidget(description);
+
+    return pageLayout;
+}
+
+QLayout * PageFeedback::footerLayoutDefinition()
+{
+    QHBoxLayout * bottomLayout = new QHBoxLayout();
+
+    bottomLayout->setStretch(0,1);
+    //TODO: create logo for send button
+    BtnSend = addButton("Send", bottomLayout, 0, false);
+    bottomLayout->insertStretch(0);
+
+    return bottomLayout;
+}
+
+void PageFeedback::connectSignals()
+{
+    //TODO
+}
+
+PageFeedback::PageFeedback(QWidget* parent) : AbstractPage(parent)
+{
+    initPage();
+
+}
diff --git a/QTfrontend/ui/page/pagefeedback.h b/QTfrontend/ui/page/pagefeedback.h
new file mode 100644
index 0000000..6621686
--- /dev/null
+++ b/QTfrontend/ui/page/pagefeedback.h
@@ -0,0 +1,44 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef PAGE_FEEDBACK_H
+#define PAGE_FEEDBACK_H
+
+#include "AbstractPage.h"
+
+class PageFeedback : public AbstractPage
+{
+        Q_OBJECT
+
+    public:
+        PageFeedback(QWidget * parent = 0);
+
+        QPushButton * BtnSend;
+        QLineEdit * summary;
+        QTextBrowser * description;
+        QLabel * info;
+        QLabel * label_summary;
+        QLabel * label_description;
+
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
+};
+
+#endif
diff --git a/QTfrontend/ui/page/pagegamestats.cpp b/QTfrontend/ui/page/pagegamestats.cpp
index 379d564..8903c56 100644
--- a/QTfrontend/ui/page/pagegamestats.cpp
+++ b/QTfrontend/ui/page/pagegamestats.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -62,7 +62,7 @@ QLayout * PageGameStats::bodyLayoutDefinition()
     gbl->addWidget(labelGameStats);
     gb->setLayout(gbl);
     pageLayout->addWidget(gb, 1, 1, 1, 2);
-    
+
     // graph
     graphic = new FitGraphicsView(gb);
     l = new QLabel(this);
@@ -73,7 +73,7 @@ QLayout * PageGameStats::bodyLayoutDefinition()
     gbl->addWidget(graphic);
     graphic->scale(1.0, -1.0);
     graphic->setBackgroundBrush(QBrush(Qt::black));
-    
+
     labelGameWin = new QLabel(this);
     labelGameWin->setTextFormat(Qt::RichText);
     pageLayout->addWidget(labelGameWin, 0, 0, 1, 2);
@@ -140,7 +140,7 @@ void PageGameStats::renderStats()
     while (i != healthPoints.constEnd())
     {
         quint32 c = i.key();
-        QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+        //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
         QVector<quint32> hps = i.value();
 
         QPainterPath path;
@@ -160,38 +160,45 @@ void PageGameStats::renderStats()
 
 void PageGameStats::GameStats(char type, const QString & info)
 {
-    switch(type) {
-        case 'r' : {
+    switch(type)
+    {
+        case 'r' :
+        {
             labelGameWin->setText(QString("<h1 align=\"center\">%1</h1>").arg(info));
             break;
         }
-        case 'D' : {
+        case 'D' :
+        {
             int i = info.indexOf(' ');
             QString message = "<p><img src=\":/res/StatsBestShot.png\"> " + PageGameStats::tr("The best shot award was won by <b>%1</b> with <b>%2</b> pts.").arg(info.mid(i + 1), info.left(i)) + "</p>";
             AddStatText(message);
             break;
         }
-        case 'k' : {
+        case 'k' :
+        {
             int i = info.indexOf(' ');
             int num = info.left(i).toInt();
             QString message = "<p><img src=\":/res/StatsBestKiller.png\"> " + PageGameStats::tr("The best killer is <b>%1</b> with <b>%2</b> kills in a turn.", "", num).arg(info.mid(i + 1), info.left(i)) + "</p>";
             AddStatText(message);
             break;
         }
-        case 'K' : {
+        case 'K' :
+        {
             int num = info.toInt();
             QString message = "<p><img src=\":/res/StatsHedgehogsKilled.png\"> " +  PageGameStats::tr("A total of <b>%1</b> hedgehog(s) were killed during this round.", "", num).arg(num) + "</p>";
             AddStatText(message);
             break;
         }
-        case 'H' : {
+        case 'H' :
+        {
             int i = info.indexOf(' ');
             quint32 clan = info.left(i).toInt();
             quint32 hp = info.mid(i + 1).toUInt();
             healthPoints[clan].append(hp);
             break;
         }
-        case 'T': { // local team stats
+        case 'T':   // local team stats
+        {
             //AddStatText("<p>local team: " + info + "</p>");
             QStringList infol = info.split(":");
             HWTeam team(infol[0]);
@@ -204,9 +211,10 @@ void PageGameStats::GameStats(char type, const QString & info)
                 //team.SaveToFile(); // don't save yet
             }
             break;
-            }
+        }
 
-        case 'P' : {
+        case 'P' :
+        {
             int i = info.indexOf(' ');
             playerPosition++;
             QString color = info.left(i);
@@ -227,17 +235,17 @@ void PageGameStats::GameStats(char type, const QString & info)
             switch (playerPosition)
             {
                 case 1:
-                image = "<img src=\":/res/StatsMedal1.png\">";
-                break;
-            case 2:
-                image = "<img src=\":/res/StatsMedal2.png\">";
-                break;
-            case 3:
-                image = "<img src=\":/res/StatsMedal3.png\">";
-                break;
-            default:
-                image = "<img src=\":/res/StatsMedal4.png\">";
-                break;
+                    image = "<img src=\":/res/StatsMedal1.png\">";
+                    break;
+                case 2:
+                    image = "<img src=\":/res/StatsMedal2.png\">";
+                    break;
+                case 3:
+                    image = "<img src=\":/res/StatsMedal3.png\">";
+                    break;
+                default:
+                    image = "<img src=\":/res/StatsMedal4.png\">";
+                    break;
             }
 
             QString message;
@@ -246,23 +254,26 @@ void PageGameStats::GameStats(char type, const QString & info)
             message = QString("<p><h2>%1 %2. <font color=\"%4\">%3</font> ").arg(image, QString::number(playerPosition), playername, clanColor.name()) + killstring + "</h2></p>";
 
             labelGameRank->setText(labelGameRank->text() + message);
-                break;
+            break;
         }
-        case 's' : {
+        case 's' :
+        {
             int i = info.indexOf(' ');
             int num = info.left(i).toInt();
             QString message = "<p><img src=\":/res/StatsMostSelfDamage.png\"> " + PageGameStats::tr("<b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";
             AddStatText(message);
             break;
         }
-        case 'S' : {
+        case 'S' :
+        {
             int i = info.indexOf(' ');
             int num = info.left(i).toInt();
             QString message = "<p><img src=\":/res/StatsSelfKilled.png\"> " + PageGameStats::tr("<b>%1</b> killed <b>%2</b> of his own hedgehogs.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";
             AddStatText(message);
             break;
         }
-        case 'B' : {
+        case 'B' :
+        {
             int i = info.indexOf(' ');
             int num = info.left(i).toInt();
             QString message = "<p><img src=\":/res/StatsSkipped.png\"> " + PageGameStats::tr("<b>%1</b> was scared and skipped turn <b>%2</b> times.", "", num).arg(info.mid(i + 1)).arg(num) + "</p>";
diff --git a/QTfrontend/ui/page/pagegamestats.h b/QTfrontend/ui/page/pagegamestats.h
index d5f4685..90fa19f 100644
--- a/QTfrontend/ui/page/pagegamestats.h
+++ b/QTfrontend/ui/page/pagegamestats.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,47 +27,47 @@
 
 class FitGraphicsView : public QGraphicsView
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    FitGraphicsView(QWidget* parent = 0);
+    public:
+        FitGraphicsView(QWidget* parent = 0);
 
-protected:
-    void resizeEvent(QResizeEvent * event);
+    protected:
+        void resizeEvent(QResizeEvent * event);
 };
 
 class PageGameStats : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageGameStats(QWidget* parent = 0);
+    public:
+        PageGameStats(QWidget* parent = 0);
 
-    QPushButton *btnSave;
-    QLabel *labelGameStats;
-    QLabel *labelGameWin;
-    QLabel *labelGameRank;
-    FitGraphicsView * graphic;
+        QPushButton *btnSave;
+        QLabel *labelGameStats;
+        QLabel *labelGameWin;
+        QLabel *labelGameRank;
+        FitGraphicsView * graphic;
 
-public slots:
-    void GameStats(char type, const QString & info);
-    void clear();
-    void renderStats();
-    
-signals:
-    void saveDemoRequested();
+    public slots:
+        void GameStats(char type, const QString & info);
+        void clear();
+        void renderStats();
 
-private:
-    void AddStatText(const QString & msg);
+    signals:
+        void saveDemoRequested();
 
-    QMap<quint32, QVector<quint32> > healthPoints;
-    unsigned int playerPosition;
-    quint32 lastColor;
+    private:
+        void AddStatText(const QString & msg);
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+        QMap<quint32, QVector<quint32> > healthPoints;
+        unsigned int playerPosition;
+        quint32 lastColor;
+
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif // STATSPAGE_H
diff --git a/QTfrontend/ui/page/pageinfo.cpp b/QTfrontend/ui/page/pageinfo.cpp
index 88775e1..01448f5 100644
--- a/QTfrontend/ui/page/pageinfo.cpp
+++ b/QTfrontend/ui/page/pageinfo.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -41,6 +41,7 @@ QLayout * PageInfo::footerLayoutDefinition()
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout();
     BtnSnapshots = addButton(":/res/Star.png", bottomLayout, 0, true);
+    BtnSnapshots->setWhatsThis(tr("Open the snapshot folder"));
     bottomLayout->setAlignment(BtnSnapshots, Qt::AlignRight | Qt::AlignVCenter);
     return bottomLayout;
 }
diff --git a/QTfrontend/ui/page/pageinfo.h b/QTfrontend/ui/page/pageinfo.h
index fd420a0..c5f90d8 100644
--- a/QTfrontend/ui/page/pageinfo.h
+++ b/QTfrontend/ui/page/pageinfo.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,18 +25,18 @@ class About;
 
 class PageInfo : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageInfo(QWidget* parent = 0);
+    public:
+        PageInfo(QWidget* parent = 0);
 
-    QPushButton *BtnSnapshots;
-    About *about;
+        QPushButton *BtnSnapshots;
+        About *about;
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageingame.cpp b/QTfrontend/ui/page/pageingame.cpp
index ebaa360..1ec1b65 100644
--- a/QTfrontend/ui/page/pageingame.cpp
+++ b/QTfrontend/ui/page/pageingame.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/page/pageingame.h b/QTfrontend/ui/page/pageingame.h
index b2aecef..ff1f325 100644
--- a/QTfrontend/ui/page/pageingame.h
+++ b/QTfrontend/ui/page/pageingame.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,7 +23,7 @@
 
 class PageInGame : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
     public:
         PageInGame(QWidget * parent = 0);
diff --git a/QTfrontend/ui/page/pagemain.cpp b/QTfrontend/ui/page/pagemain.cpp
index 393efa0..ac88d4c 100644
--- a/QTfrontend/ui/page/pagemain.cpp
+++ b/QTfrontend/ui/page/pagemain.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -15,7 +15,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
- 
+
 #include <QGridLayout>
 #include <QHBoxLayout>
 #include <QPushButton>
@@ -42,21 +42,36 @@ QLayout * PageMain::bodyLayoutDefinition()
     pageLayout->setRowStretch(4, 1);
 
     BtnSinglePlayer = addButton(":/res/LocalPlay.png", pageLayout, 2, 0, 1, 2, true);
-    BtnSinglePlayer->setToolTip(tr("Local Game (Play a game on a single computer)"));
+    BtnSinglePlayer->setToolTip(tr("Local Game"));
+    BtnSinglePlayer->setWhatsThis(tr("Play a game on a single computer"));
     pageLayout->setAlignment(BtnSinglePlayer, Qt::AlignHCenter);
 
     BtnNet = addButton(":/res/NetworkPlay.png", pageLayout, 2, 2, 1, 2, true);
-    BtnNet->setToolTip(tr("Network Game (Play a game across a network)"));
+    BtnNet->setToolTip(tr("Network Game"));
+    BtnNet->setWhatsThis(tr("Play a game across a network"));
     pageLayout->setAlignment(BtnNet, Qt::AlignHCenter);
 
     // button order matters for overlapping (what's on top and what isn't)
     BtnInfo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true);
     BtnInfo->setStyleSheet("border: transparent;background: transparent;");
+    //BtnInfo->setToolTip(tr("Credits")); //tooltip looks horrible with transparent background buttons
+    BtnInfo->setWhatsThis(tr("Read about who is behind the Hedgewars Project"));
     pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter);
 
-    BtnDataDownload = addButton(tr("Downloadable Content"), pageLayout, 4, 0, 1, 4, false);
+#if 0
+    BtnFeedback = addButton("Feedback", pageLayout, 4, 0, 1, 4, false);
+    BtnFeedback->setWhatsThis(tr("Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars"));
+    pageLayout->setAlignment(BtnFeedback, Qt::AlignHCenter);
+#endif
+
+    BtnDataDownload = addButton(tr("Downloadable Content"), pageLayout, 5, 0, 1, 4, false);
+    //BtnDataDownload->setToolTip(tr(Downloadable Content"));
+    BtnDataDownload->setWhatsThis(tr("Access the user created content downloadable from our website"));
     pageLayout->setAlignment(BtnDataDownload, Qt::AlignHCenter);
 
+    // disable exit button sound
+    btnBack->isSoundEnabled = false;
+
     return pageLayout;
 }
 
@@ -67,12 +82,19 @@ QLayout * PageMain::footerLayoutDefinition()
     mainNote = new QLabel(this);
     mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
     mainNote->setWordWrap(true);
-    
+
     bottomLayout->addWidget(mainNote, 0);
     bottomLayout->setStretch(0,1);
 
-    BtnSetup = addButton(":/res/Settings.png", bottomLayout, 1, true);
-    bottomLayout->setStretch(1,0);
+    btnBack->setWhatsThis(tr("Exit game"));
+
+#ifdef VIDEOREC
+    BtnVideos = addButton(":/res/Videos.png", bottomLayout, 1, true);
+    BtnVideos->setWhatsThis(tr("Manage videos recorded from game"));
+#endif
+
+    BtnSetup = addButton(":/res/Settings.png", bottomLayout, 2, true);
+    BtnSetup->setWhatsThis(tr("Edit game preferences"));
 
     return bottomLayout;
 }
@@ -91,72 +113,74 @@ PageMain::PageMain(QWidget* parent) : AbstractPage(parent)
 
     if(!isDevBuild)
     {
-        mainNote->setText(QLabel::tr("Tip: ") + randomTip());
+        setDefautDescription(QLabel::tr("Tip: ") + randomTip());
     }
     else
-        mainNote->setText(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!"));
+    {
+        setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!"));
+    }
 
 }
 
 QString PageMain::randomTip() const
 {
     QStringList Tips;
-        Tips << tr("Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.", "Tips");
-        Tips << tr("Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.", "Tips");
-        Tips << tr("If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!", "Tips");
-        Tips << tr("Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!", "Tips");
-        Tips << tr("If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.", "Tips");
-        Tips << tr("You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.", "Tips");
-        Tips << tr("By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.", "Tips");
-        Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!", "Tips");
-        Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!", "Tips");
-        Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!", "Tips");
-        Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!", "Tips");
-        Tips << tr("From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.", "Tips");
-        Tips << tr("Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!", "Tips");
-        Tips << tr("Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.", "Tips");
-        Tips << tr("Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.", "Tips");
-        Tips << tr("Connect one or more gamepads before starting the game to be able to assign their controls to your teams.", "Tips");
-        Tips << tr("Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.", "Tips").arg("<a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a>");
-        Tips << tr("While playing you should give yourself a short break at least once an hour.", "Tips");
-        Tips << tr("If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.", "Tips");
-        Tips << tr("If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.", "Tips");
-        Tips << tr("We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!", "Tips");
-        Tips << tr("Especially while playing online be polite and always remember there might be some minors playing with or against you as well!", "Tips");
-        Tips << tr("Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!", "Tips");
-        Tips << tr("The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.", "Tips");
-        Tips << tr("You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!", "Tips");
-        Tips << tr("Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.", "Tips");
-        Tips << tr("No hedgehogs were harmed in making this game.", "Tips");
-        Tips << tr("There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.", "Tips");
-        Tips << tr("Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.", "Tips");
-        Tips << tr("Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.", "Tips");
-        Tips << tr("Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.", "Tips");
-        Tips << tr("The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.", "Tips");
-        Tips << tr("The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.", "Tips");
-        Tips << tr("The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.", "Tips");
-        Tips << tr("Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.", "Tips");
-        Tips << tr("The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.", "Tips");
-        Tips << tr("If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.", "Tips");
-        Tips << tr("The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.", "Tips");
-        Tips << tr("The Flame Thrower is a weapon but it can be used for tunnel digging as well.", "Tips");
-        Tips << tr("Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.", "Tips");
-        Tips << tr("Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.", "Tips");
-        Tips << tr("Like Hedgewars? Become a fan on %1 or follow us on %2!", "Tips").arg("<a href=\"http://www.facebook.com/Hedgewars\">Facebook</a>").arg("<a href=\"http://twitter.com/hedgewars\">Twitter</a>");
-        Tips << tr("Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.", "Tips");
-        Tips << tr("Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!", "Tips");
-        // The following tip will require links to app store entries first.
-        //Tips << tr("Want to play Hedgewars any time? Grab the Mobile version for %1 and %2.", "Tips").arg("").arg("");
-        // the ios version is located here: http://itunes.apple.com/us/app/hedgewars/id391234866
-        Tips << tr("Keep your video card drivers up to date to avoid issues playing the game.", "Tips");
-        Tips << tr("You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.", "Tips");
+    Tips << tr("Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.", "Tips");
+    Tips << tr("Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.", "Tips");
+    Tips << tr("If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!", "Tips");
+    Tips << tr("Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!", "Tips");
+    Tips << tr("If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.", "Tips");
+    Tips << tr("You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.", "Tips");
+    Tips << tr("By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.", "Tips");
+    Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!", "Tips");
+    Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!", "Tips");
+    Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!", "Tips");
+    Tips << tr("Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!", "Tips");
+    Tips << tr("From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.", "Tips");
+    Tips << tr("Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!", "Tips");
+    Tips << tr("Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.", "Tips");
+    Tips << tr("Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.", "Tips");
+    Tips << tr("Connect one or more gamepads before starting the game to be able to assign their controls to your teams.", "Tips");
+    Tips << tr("Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.", "Tips").arg("<a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a>");
+    Tips << tr("While playing you should give yourself a short break at least once an hour.", "Tips");
+    Tips << tr("If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.", "Tips");
+    Tips << tr("If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.", "Tips");
+    Tips << tr("We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!", "Tips");
+    Tips << tr("Especially while playing online be polite and always remember there might be some minors playing with or against you as well!", "Tips");
+    Tips << tr("Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!", "Tips");
+    Tips << tr("The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.", "Tips");
+    Tips << tr("You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!", "Tips");
+    Tips << tr("Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.", "Tips");
+    Tips << tr("No hedgehogs were harmed in making this game.", "Tips");
+    Tips << tr("There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.", "Tips");
+    Tips << tr("Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.", "Tips");
+    Tips << tr("Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.", "Tips");
+    Tips << tr("Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.", "Tips");
+    Tips << tr("The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.", "Tips");
+    Tips << tr("The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.", "Tips");
+    Tips << tr("The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.", "Tips");
+    Tips << tr("Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.", "Tips");
+    Tips << tr("The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.", "Tips");
+    Tips << tr("If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.", "Tips");
+    Tips << tr("The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.", "Tips");
+    Tips << tr("The Flame Thrower is a weapon but it can be used for tunnel digging as well.", "Tips");
+    Tips << tr("Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.", "Tips");
+    Tips << tr("Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.", "Tips");
+    Tips << tr("Like Hedgewars? Become a fan on %1 or follow us on %2!", "Tips").arg("<a href=\"http://www.facebook.com/Hedgewars\">Facebook</a>").arg("<a href=\"http://twitter.com/hedgewars\">Twitter</a>");
+    Tips << tr("Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.", "Tips");
+    Tips << tr("Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!", "Tips");
+    // The following tip will require links to app store entries first.
+    //Tips << tr("Want to play Hedgewars any time? Grab the Mobile version for %1 and %2.", "Tips").arg("").arg("");
+    // the ios version is located here: http://itunes.apple.com/us/app/hedgewars/id391234866
+    Tips << tr("Keep your video card drivers up to date to avoid issues playing the game.", "Tips");
+    Tips << tr("You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.", "Tips");
 #ifdef _WIN32
-        Tips << tr("You can find your Hedgewars configuration files under \"My Documents\\Hedgewars\". Create backups or take the files with you, but don't edit them by hand.", "Tips");
+    Tips << tr("You can find your Hedgewars configuration files under \"My Documents\\Hedgewars\". Create backups or take the files with you, but don't edit them by hand.", "Tips");
 #elif defined __APPLE__
-        Tips << tr("You can find your Hedgewars configuration files under \"Library/Application Support/Hedgewars\" in your home directory. Create backups or take the files with you, but don't edit them by hand.", "Tips");
+    Tips << tr("You can find your Hedgewars configuration files under \"Library/Application Support/Hedgewars\" in your home directory. Create backups or take the files with you, but don't edit them by hand.", "Tips");
 #else
-        Tips << tr("You can find your Hedgewars configuration files under \".hedgewars\" in your home directory. Create backups or take the files with you, but don't edit them by hand.", "Tips");
+    Tips << tr("You can find your Hedgewars configuration files under \".hedgewars\" in your home directory. Create backups or take the files with you, but don't edit them by hand.", "Tips");
 #endif
 
-        return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()];
+    return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()];
 }
diff --git a/QTfrontend/ui/page/pagemain.h b/QTfrontend/ui/page/pagemain.h
index 84a7d79..ea579e0 100644
--- a/QTfrontend/ui/page/pagemain.h
+++ b/QTfrontend/ui/page/pagemain.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,24 +23,26 @@
 
 class PageMain : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageMain(QWidget * parent = 0);
-
-    QPushButton * BtnSinglePlayer;
-    QPushButton * BtnNet;
-    QPushButton * BtnSetup;
-    QPushButton * BtnInfo;
-    QPushButton * BtnDataDownload;
-    QLabel * mainNote;
-
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
-
-    QString randomTip() const;
+        Q_OBJECT
+
+    public:
+        PageMain(QWidget * parent = 0);
+
+        QPushButton * BtnSinglePlayer;
+        QPushButton * BtnNet;
+        QPushButton * BtnSetup;
+        QPushButton * BtnFeedback;
+        QPushButton * BtnInfo;
+        QPushButton * BtnDataDownload;
+        QPushButton * BtnVideos;
+        QLabel * mainNote;
+
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
+
+        QString randomTip() const;
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagemultiplayer.cpp b/QTfrontend/ui/page/pagemultiplayer.cpp
index c8ae75b..7e456bc 100644
--- a/QTfrontend/ui/page/pagemultiplayer.cpp
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/page/pagemultiplayer.h b/QTfrontend/ui/page/pagemultiplayer.h
index 8324c3b..b39b195 100644
--- a/QTfrontend/ui/page/pagemultiplayer.h
+++ b/QTfrontend/ui/page/pagemultiplayer.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,24 +26,24 @@ class TeamSelWidget;
 
 class PageMultiplayer : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageMultiplayer(QWidget* parent = 0);
+    public:
+        PageMultiplayer(QWidget* parent = 0);
 
-    GameCFGWidget *gameCFG;
-    TeamSelWidget *teamsSelect;
-    QPushButton *BtnStartMPGame;
+        GameCFGWidget *gameCFG;
+        TeamSelWidget *teamsSelect;
+        QPushButton *BtnStartMPGame;
 
-signals:
-    void SetupClicked();
+    signals:
+        void SetupClicked();
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    QPushButton * btnSetup;
+        QPushButton * btnSetup;
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagenet.cpp b/QTfrontend/ui/page/pagenet.cpp
index 2705e71..3c2179e 100644
--- a/QTfrontend/ui/page/pagenet.cpp
+++ b/QTfrontend/ui/page/pagenet.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -108,7 +108,12 @@ void PageNet::slotConnect()
     QModelIndex mi = tvServersList->currentIndex();
     if(!mi.isValid())
     {
-        QMessageBox::information(this, tr("Error"), tr("Please select server from the list above"));
+        QMessageBox serverMsg(this);
+        serverMsg.setIcon(QMessageBox::Warning);
+        serverMsg.setWindowTitle(QMessageBox::tr("Netgame - Error"));
+        serverMsg.setText(QMessageBox::tr("Please select a server from the list"));
+        serverMsg.setWindowModality(Qt::WindowModal);
+        serverMsg.exec();
         return;
     }
     QString host = model->index(mi.row(), 1).data().toString();
diff --git a/QTfrontend/ui/page/pagenet.h b/QTfrontend/ui/page/pagenet.h
index f60841c..37cf17a 100644
--- a/QTfrontend/ui/page/pagenet.h
+++ b/QTfrontend/ui/page/pagenet.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,33 +23,33 @@
 
 class PageNet : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageNet(QWidget* parent = 0);
+    public:
+        PageNet(QWidget* parent = 0);
 
-    QPushButton* BtnUpdateSList;
-    QTableView * tvServersList;
-    QPushButton * BtnNetConnect;
-    QPushButton * BtnNetSvrStart;
-    QPushButton * BtnSpecifyServer;
+        QPushButton* BtnUpdateSList;
+        QTableView * tvServersList;
+        QPushButton * BtnNetConnect;
+        QPushButton * BtnNetSvrStart;
+        QPushButton * BtnSpecifyServer;
 
-public slots:
-    void updateServersList();
+    public slots:
+        void updateServersList();
 
-signals:
-    void connectClicked(const QString & host, quint16 port);
+    signals:
+        void connectClicked(const QString & host, quint16 port);
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    QGroupBox * ConnGroupBox;
-    QGridLayout * GBClayout;
+        QGroupBox * ConnGroupBox;
+        QGridLayout * GBClayout;
 
-private slots:
-    void slotConnect();
+    private slots:
+        void slotConnect();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagenetgame.cpp b/QTfrontend/ui/page/pagenetgame.cpp
index 508ec5d..4566f6e 100644
--- a/QTfrontend/ui/page/pagenetgame.cpp
+++ b/QTfrontend/ui/page/pagenetgame.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -38,8 +38,8 @@ QLayout * PageNetGame::bodyLayoutDefinition()
 
     // chatwidget
     pChatWidget = new HWChatWidget(this, m_gameSettings, true);
-    pChatWidget->setShowReady(true); // show status bulbs by default
     pChatWidget->setShowFollow(false); // don't show follow in nicks' context menus
+    pChatWidget->setIgnoreListKick(true); // kick ignored players automatically
     pageLayout->addWidget(pChatWidget, 2, 0, 1, 2);
     pageLayout->setRowStretch(1, 100);
     pageLayout->setRowStretch(2, 100);
@@ -67,6 +67,7 @@ QLayout * PageNetGame::footerLayoutDefinition()
     leRoomName->setMinimumWidth(200);
     leRoomName->setMaximumWidth(400);
 
+    //Button to signify whether the player is ready to start playing
     BtnGo = new QPushButton(this);
     BtnGo->setToolTip(QPushButton::tr("Ready"));
     BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
@@ -74,7 +75,6 @@ QLayout * PageNetGame::footerLayoutDefinition()
     BtnGo->setMinimumWidth(50);
     BtnGo->setMinimumHeight(50);
 
-
     bottomLayout->addWidget(leRoomName);
     BtnUpdate = addButton(QAction::tr("Update"), bottomLayout, 1);
 
@@ -152,10 +152,12 @@ void PageNetGame::onUpdateClick()
     else
     {
         leRoomName->clear();
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please enter room name"),
-                tr("OK"));
+        QMessageBox roomMsg(this);
+        roomMsg.setIcon(QMessageBox::Warning);
+        roomMsg.setWindowTitle(QMessageBox::tr("Netgame - Error"));
+        roomMsg.setText(QMessageBox::tr("Please enter room name"));
+        roomMsg.setWindowModality(Qt::WindowModal);
+        roomMsg.exec();
     }
 }
 
diff --git a/QTfrontend/ui/page/pagenetgame.h b/QTfrontend/ui/page/pagenetgame.h
index dc61f7a..128a7f6 100644
--- a/QTfrontend/ui/page/pagenetgame.h
+++ b/QTfrontend/ui/page/pagenetgame.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,53 +29,53 @@ class GameCFGWidget;
 
 class PageNetGame : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageNetGame(QWidget* parent, QSettings * gameSettings);
+    public:
+        PageNetGame(QWidget* parent, QSettings * gameSettings);
 
-    /**
-     * Sets the room name to display.
-     * @param roomName room name to be displayed.
-     */
-    void setRoomName(const QString & roomName);
+        /**
+         * Sets the room name to display.
+         * @param roomName room name to be displayed.
+         */
+        void setRoomName(const QString & roomName);
 
-    void displayError(const QString & message);
-    void displayNotice(const QString & message);
-    void displayWarning(const QString & message);
+        void displayError(const QString & message);
+        void displayNotice(const QString & message);
+        void displayWarning(const QString & message);
 
-    QPushButton *BtnGo;
-    QPushButton *BtnMaster;
-    QPushButton *BtnStart;
-    QPushButton *BtnUpdate;
+        QPushButton *BtnGo;
+        QPushButton *BtnMaster;
+        QPushButton *BtnStart;
+        QPushButton *BtnUpdate;
 
-    QAction * restrictJoins;
-    QAction * restrictTeamAdds;
+        QAction * restrictJoins;
+        QAction * restrictTeamAdds;
 
-    HWChatWidget* pChatWidget;
+        HWChatWidget* pChatWidget;
 
-    TeamSelWidget* pNetTeamsWidget;
-    GameCFGWidget* pGameCFG;
+        TeamSelWidget* pNetTeamsWidget;
+        GameCFGWidget* pGameCFG;
 
-public slots:
-    void setReadyStatus(bool isReady);
-    void setUser(const QString & nickname);
-    void onUpdateClick();
-    void setMasterMode(bool isMaster);
+    public slots:
+        void setReadyStatus(bool isReady);
+        void setUser(const QString & nickname);
+        void onUpdateClick();
+        void setMasterMode(bool isMaster);
 
-signals:
-    void SetupClicked();
-    void askForUpdateRoomName(const QString &);
+    signals:
+        void SetupClicked();
+        void askForUpdateRoomName(const QString &);
 
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-    QSettings * m_gameSettings;
+        QSettings * m_gameSettings;
 
-    HistoryLineEdit * leRoomName;
-    QPushButton * btnSetup;
+        HistoryLineEdit * leRoomName;
+        QPushButton * btnSetup;
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagenetserver.cpp b/QTfrontend/ui/page/pagenetserver.cpp
index 89bdb92..e7a11fa 100644
--- a/QTfrontend/ui/page/pagenetserver.cpp
+++ b/QTfrontend/ui/page/pagenetserver.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/page/pagenetserver.h b/QTfrontend/ui/page/pagenetserver.h
index 0b3c932..63e66ac 100644
--- a/QTfrontend/ui/page/pagenetserver.h
+++ b/QTfrontend/ui/page/pagenetserver.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,25 +23,25 @@
 
 class PageNetServer : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageNetServer(QWidget* parent = 0);
+    public:
+        PageNetServer(QWidget* parent = 0);
 
-    QPushButton *BtnStart;
-    QPushButton *BtnDefault;
-    QLabel *labelSD;
-    QLineEdit *leServerDescr;
-    QLabel *labelPort;
-    QSpinBox *sbPort;
+        QPushButton *BtnStart;
+        QPushButton *BtnDefault;
+        QLabel *labelSD;
+        QLineEdit *leServerDescr;
+        QLabel *labelPort;
+        QSpinBox *sbPort;
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-private slots:
-    void setDefaultPort();
+    private slots:
+        void setDefaultPort();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagenettype.cpp b/QTfrontend/ui/page/pagenettype.cpp
index 3f43705..8133f27 100644
--- a/QTfrontend/ui/page/pagenettype.cpp
+++ b/QTfrontend/ui/page/pagenettype.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -33,7 +33,9 @@ QLayout * PageNetType::bodyLayoutDefinition()
     pageLayout->setColumnStretch(3, 10);
 
     BtnLAN = addButton(tr("LAN game"), pageLayout, 1, 2);
+    BtnLAN->setWhatsThis(tr("Join or host your own game server in a Local Area Network."));
     BtnOfficialServer = addButton(tr("Official server"), pageLayout, 2, 2);
+    BtnOfficialServer->setWhatsThis(tr("Join hundreds of players online!"));
 
     // hack: temporary deactivated - requires server modifications that aren't backward compatible (yet)
     //BtnOfficialServer->setEnabled(false);
diff --git a/QTfrontend/ui/page/pagenettype.h b/QTfrontend/ui/page/pagenettype.h
index 5b53a62..dfce272 100644
--- a/QTfrontend/ui/page/pagenettype.h
+++ b/QTfrontend/ui/page/pagenettype.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,16 +23,16 @@
 
 class PageNetType : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageNetType(QWidget* parent = 0);
+    public:
+        PageNetType(QWidget* parent = 0);
 
-    QPushButton * BtnLAN;
-    QPushButton * BtnOfficialServer;
+        QPushButton * BtnLAN;
+        QPushButton * BtnOfficialServer;
 
-protected:
-    QLayout * bodyLayoutDefinition();
+    protected:
+        QLayout * bodyLayoutDefinition();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageoptions.cpp b/QTfrontend/ui/page/pageoptions.cpp
index a60d208..cf7a55c 100644
--- a/QTfrontend/ui/page/pageoptions.cpp
+++ b/QTfrontend/ui/page/pageoptions.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,36 +28,37 @@
 #include <QTextBrowser>
 #include <QTableWidget>
 #include <QSlider>
+#include <QSignalMapper>
+#include <QColorDialog>
+#include <QStandardItemModel>
 
 #include "pageoptions.h"
 #include "hwconsts.h"
 #include "fpsedit.h"
 #include "igbox.h"
+#include "DataManager.h"
 
 // TODO cleanup
 QLayout * PageOptions::bodyLayoutDefinition()
 {
-    QGridLayout * pageLayout = new QGridLayout();
-    pageLayout->setColumnStretch(0, 100);
-    pageLayout->setColumnStretch(1, 100);
-    pageLayout->setColumnStretch(2, 100);
-    pageLayout->setRowStretch(0, 0);
-    //pageLayout->setRowStretch(1, 100);
-    pageLayout->setRowStretch(2, 0);
-    pageLayout->setContentsMargins(7, 7, 7, 0);
-    pageLayout->setSpacing(0);
-
-
-    QGroupBox * gbTwoBoxes = new QGroupBox(this);
-    pageLayout->addWidget(gbTwoBoxes, 0, 0, 1, 3);
-    QGridLayout * gbTBLayout = new QGridLayout(gbTwoBoxes);
-    gbTBLayout->setMargin(0);
-    gbTBLayout->setSpacing(0);
-    gbTBLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
-
-    QPixmap pmNew(":/res/new.png");
-    QPixmap pmEdit(":/res/edit.png");
-    QPixmap pmDelete(":/res/delete.png");
+    QVBoxLayout * pageLayout = new QVBoxLayout();
+
+    QTabWidget * tabs = new QTabWidget(this);
+    pageLayout->addWidget(tabs);
+    QWidget * page1 = new QWidget(this);
+    QWidget * page2 = new QWidget(this);
+    tabs->addTab(page1, tr("General"));
+    tabs->addTab(page2, tr("Advanced"));
+
+    { // page 1
+        QGridLayout * page1Layout = new QGridLayout(page1);
+        //gbTBLayout->setMargin(0);
+        page1Layout->setSpacing(0);
+        page1Layout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+
+        QPixmap pmNew(":/res/new.png");
+        QPixmap pmEdit(":/res/edit.png");
+        QPixmap pmDelete(":/res/delete.png");
 
         {
             teamsBox = new IconedGroupBox(this);
@@ -102,12 +103,12 @@ QLayout * PageOptions::bodyLayoutDefinition()
             LblNoEditTeam->setVisible(false);
             GBTlayout->addWidget(LblNoEditTeam, 0, 0);
 
-            gbTBLayout->addWidget(teamsBox, 0, 0);
+            page1Layout->addWidget(teamsBox, 0, 0);
         }
 
         {
             IconedGroupBox* groupWeapons = new IconedGroupBox(this);
-            
+
             //groupWeapons->setContentTopPadding(0);
             //groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
             groupWeapons->setIcon(QIcon(":/res/weaponsicon.png"));
@@ -123,21 +124,21 @@ QLayout * PageOptions::bodyLayoutDefinition()
             WeaponsLayout->addWidget(SchemesName, 1, 1);
 
             SchemeNew = new QPushButton(groupWeapons);
-            SchemeNew->setToolTip(tr("New scheme"));
+            SchemeNew->setWhatsThis(tr("New scheme"));
             SchemeNew->setIconSize(pmNew.size());
             SchemeNew->setIcon(pmNew);
             SchemeNew->setMaximumWidth(pmNew.width() + 6);
             WeaponsLayout->addWidget(SchemeNew, 1, 2);
 
             SchemeEdit = new QPushButton(groupWeapons);
-            SchemeEdit->setToolTip(tr("Edit scheme"));
+            SchemeEdit->setWhatsThis(tr("Edit scheme"));
             SchemeEdit->setIconSize(pmEdit.size());
             SchemeEdit->setIcon(pmEdit);
             SchemeEdit->setMaximumWidth(pmEdit.width() + 6);
             WeaponsLayout->addWidget(SchemeEdit, 1, 3);
 
             SchemeDelete = new QPushButton(groupWeapons);
-            SchemeDelete->setToolTip(tr("Delete scheme"));
+            SchemeDelete->setWhatsThis(tr("Delete scheme"));
             SchemeDelete->setIconSize(pmDelete.size());
             SchemeDelete->setIcon(pmDelete);
             SchemeDelete->setMaximumWidth(pmDelete.width() + 6);
@@ -151,64 +152,44 @@ QLayout * PageOptions::bodyLayoutDefinition()
             WeaponsLayout->addWidget(WeaponsName, 2, 1);
 
             WeaponNew = new QPushButton(groupWeapons);
-            WeaponNew->setToolTip(tr("New weapon set"));
+            WeaponNew->setWhatsThis(tr("New weapon set"));
             WeaponNew->setIconSize(pmNew.size());
             WeaponNew->setIcon(pmNew);
             WeaponNew->setMaximumWidth(pmNew.width() + 6);
             WeaponsLayout->addWidget(WeaponNew, 2, 2);
 
             WeaponEdit = new QPushButton(groupWeapons);
-            WeaponEdit->setToolTip(tr("Edit weapon set"));
+            WeaponEdit->setWhatsThis(tr("Edit weapon set"));
             WeaponEdit->setIconSize(pmEdit.size());
             WeaponEdit->setIcon(pmEdit);
             WeaponEdit->setMaximumWidth(pmEdit.width() + 6);
             WeaponsLayout->addWidget(WeaponEdit, 2, 3);
 
             WeaponDelete = new QPushButton(groupWeapons);
-            WeaponDelete->setToolTip(tr("Delete weapon set"));
+            WeaponDelete->setWhatsThis(tr("Delete weapon set"));
             WeaponDelete->setIconSize(pmDelete.size());
             WeaponDelete->setIcon(pmDelete);
             WeaponDelete->setMaximumWidth(pmDelete.width() + 6);
             WeaponsLayout->addWidget(WeaponDelete, 2, 4);
 
-            WeaponTooltip = new QCheckBox(this);
-            WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
-            WeaponsLayout->addWidget(WeaponTooltip, 3, 0, 1, 4);
-
-            gbTBLayout->addWidget(groupWeapons, 1, 0);
+            page1Layout->addWidget(groupWeapons, 1, 0);
         }
 
         {
             IconedGroupBox* groupMisc = new IconedGroupBox(this);
             //groupMisc->setContentTopPadding(0);
-            groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+            //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
             groupMisc->setIcon(QIcon(":/res/miscicon.png"));
             //groupMisc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
             groupMisc->setTitle(QGroupBox::tr("Misc"));
             QGridLayout * MiscLayout = new QGridLayout(groupMisc);
 
-            labelNN = new QLabel(groupMisc);
-            labelNN->setText(QLabel::tr("Net nick"));
-            MiscLayout->addWidget(labelNN, 0, 0);
-
-            editNetNick = new QLineEdit(groupMisc);
-            editNetNick->setMaxLength(20);
-            editNetNick->setText(QLineEdit::tr("unnamed"));
-            connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick()));
-            MiscLayout->addWidget(editNetNick, 0, 1);
-            
-            labelNetPassword = new QLabel(groupMisc);
-            labelNetPassword->setText(QLabel::tr("Password"));
-            MiscLayout->addWidget(labelNetPassword, 1, 0);
-            
-            editNetPassword = new QLineEdit(groupMisc);
-            editNetPassword->setEchoMode(QLineEdit::Password);
-            MiscLayout->addWidget(editNetPassword, 1, 1);
-
+            // Label for "Language"
             QLabel *labelLanguage = new QLabel(groupMisc);
             labelLanguage->setText(QLabel::tr("Locale") + " *");
-            MiscLayout->addWidget(labelLanguage, 2, 0);
+            MiscLayout->addWidget(labelLanguage, 0, 0);
 
+            // List of installed languages
             CBLanguage = new QComboBox(groupMisc);
             QDir tmpdir;
             tmpdir.cd(cfgdir->absolutePath());
@@ -233,29 +214,35 @@ QLayout * PageOptions::bodyLayoutDefinition()
                 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
             }
 
-            MiscLayout->addWidget(CBLanguage, 2, 1);
+            MiscLayout->addWidget(CBLanguage, 0, 1);
 
-            CBAltDamage = new QCheckBox(groupMisc);
-            CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
-            MiscLayout->addWidget(CBAltDamage, 3, 0, 1, 2);
+            // Label and field for net nick
+            labelNN = new QLabel(groupMisc);
+            labelNN->setText(QLabel::tr("Nickname"));
+            MiscLayout->addWidget(labelNN, 1, 0);
 
-            CBNameWithDate = new QCheckBox(groupMisc);
-            CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
-            MiscLayout->addWidget(CBNameWithDate, 4, 0, 1, 2);
+            editNetNick = new QLineEdit(groupMisc);
+            editNetNick->setMaxLength(20);
+            editNetNick->setText(QLineEdit::tr("anonymous"));
+            MiscLayout->addWidget(editNetNick, 1, 1);
 
-            BtnAssociateFiles = new QPushButton(groupMisc);
-            BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
-            BtnAssociateFiles->setEnabled(!custom_data && !custom_config);
-            MiscLayout->addWidget(BtnAssociateFiles, 5, 0, 1, 2);
+            // checkbox and field for password
+            CBSavePassword = new QCheckBox(groupMisc);
+            CBSavePassword->setText(QCheckBox::tr("Save password"));
+            MiscLayout->addWidget(CBSavePassword, 2, 0);
+
+            editNetPassword = new QLineEdit(groupMisc);
+            editNetPassword->setEchoMode(QLineEdit::Password);
+            MiscLayout->addWidget(editNetPassword, 2, 1);
 
-#ifdef __APPLE__
-#ifdef SPARKLE_ENABLED
+    #ifdef __APPLE__
+    #ifdef SPARKLE_ENABLED
             CBAutoUpdate = new QCheckBox(groupMisc);
             CBAutoUpdate->setText(QCheckBox::tr("Check for updates at startup"));
-            MiscLayout->addWidget(CBAutoUpdate, 6, 0, 1, 3);
-#endif
-#endif
-            gbTBLayout->addWidget(groupMisc, 2, 0);
+            MiscLayout->addWidget(CBAutoUpdate, 7, 0, 1, 3);
+    #endif
+    #endif
+            page1Layout->addWidget(groupMisc, 2, 0);
         }
 
         {
@@ -275,7 +262,7 @@ QLayout * PageOptions::bodyLayoutDefinition()
             GBAlayout->addWidget(CBFrontendFullscreen);
 
             CBFrontendEffects = new QCheckBox(AGGroupBox);
-            CBFrontendEffects->setText(QCheckBox::tr("Frontend effects") + " *");
+            CBFrontendEffects->setText(QCheckBox::tr("Frontend effects"));
             GBAlayout->addWidget(CBFrontendEffects);
 
             CBEnableFrontendSound = new QCheckBox(AGGroupBox);
@@ -302,13 +289,13 @@ QLayout * PageOptions::bodyLayoutDefinition()
 
             CBFullscreen = new QCheckBox(AGGroupBox);
             CBFullscreen->setText(QCheckBox::tr("Fullscreen"));
-            GBAlayout->addWidget(CBFullscreen);
+            GBAreslayout->addWidget(CBFullscreen);
 
             QLabel * quality = new QLabel(AGGroupBox);
             quality->setText(QLabel::tr("Quality"));
             quality->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
             GBAqualayout->addWidget(quality);
-            
+
             SLQuality = new QSlider(Qt::Horizontal, AGGroupBox);
             SLQuality->setTickPosition(QSlider::TicksBelow);
             SLQuality->setMaximum(5);
@@ -338,7 +325,6 @@ QLayout * PageOptions::bodyLayoutDefinition()
             CBStereoMode->addItem(QComboBox::tr("Blue/Red grayscale"));
             CBStereoMode->addItem(QComboBox::tr("Red/Green grayscale"));
             CBStereoMode->addItem(QComboBox::tr("Green/Red grayscale"));
-            connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int)));
 
             GBAstereolayout->addWidget(CBStereoMode);
             GBAlayout->addLayout(GBAstereolayout);
@@ -349,23 +335,25 @@ QLayout * PageOptions::bodyLayoutDefinition()
             hr->setFixedHeight(10);
             GBAlayout->addWidget(hr);
 
-            QHBoxLayout * GBAvollayout = new QHBoxLayout(0);
+            QGridLayout * GBAvollayout = new QGridLayout();
             QLabel * vol = new QLabel(AGGroupBox);
             vol->setText(QLabel::tr("Initial sound volume"));
-            GBAvollayout->addWidget(vol);
+            GBAvollayout->addWidget(vol, 0, 0, 1, 2);
             GBAlayout->addLayout(GBAvollayout);
             volumeBox = new QSpinBox(AGGroupBox);
             volumeBox->setRange(0, 100);
             volumeBox->setSingleStep(5);
-            GBAvollayout->addWidget(volumeBox);
+            GBAvollayout->addWidget(volumeBox, 0, 2);
 
             CBEnableSound = new QCheckBox(AGGroupBox);
             CBEnableSound->setText(QCheckBox::tr("Enable sound"));
-            GBAlayout->addWidget(CBEnableSound);
+            GBAvollayout->addWidget(CBEnableSound, 1, 0, 1, 1);
 
             CBEnableMusic = new QCheckBox(AGGroupBox);
             CBEnableMusic->setText(QCheckBox::tr("Enable music"));
-            GBAlayout->addWidget(CBEnableMusic);
+            GBAvollayout->addWidget(CBEnableMusic, 1, 1, 1, 2);
+
+            GBAvollayout->setSizeConstraint(QLayout::SetMinimumSize);
 
             hr = new QFrame(AGGroupBox);
             hr->setFrameStyle(QFrame::HLine);
@@ -373,32 +361,138 @@ QLayout * PageOptions::bodyLayoutDefinition()
             hr->setFixedHeight(10);
             GBAlayout->addWidget(hr);
 
+            CBAltDamage = new QCheckBox(AGGroupBox);
+            CBAltDamage->setText(QCheckBox::tr("Alternative damage show"));
+            GBAlayout->addWidget(CBAltDamage);
+
+            page1Layout->addWidget(AGGroupBox, 0, 1, 3, 1);
+        }
+
+        page1Layout->addWidget(new QWidget(this), 3, 0);
+
+    }
+
+    { // page 2
+        QGridLayout * page2Layout = new QGridLayout(page2);
+
+        {
+            IconedGroupBox * gbColors = new IconedGroupBox(this);
+            gbColors->setIcon(QIcon(":/res/lightbulb_on.png"));
+            gbColors->setTitle(QGroupBox::tr("Custom colors"));
+            page2Layout->addWidget(gbColors, 0, 0);
+            QGridLayout * gbCLayout = new QGridLayout(gbColors);
+
+            QSignalMapper * mapper = new QSignalMapper(this);
+
+            QStandardItemModel * model = DataManager::instance().colorsModel();
+
+            connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(onColorModelDataChanged(QModelIndex,QModelIndex)));
+            for(int i = 0; i < model->rowCount(); ++i)
+            {
+                QPushButton * btn = new QPushButton(this);
+                btn->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+                gbCLayout->addWidget(btn, i / 3, i % 3);
+                btn->setStyleSheet(QString("background: %1").arg(model->item(i)->data().value<QColor>().name()));
+                m_colorButtons.append(btn);
+                connect(btn, SIGNAL(clicked()), mapper, SLOT(map()));
+                mapper->setMapping(btn, i);
+            }
+
+            connect(mapper, SIGNAL(mapped(int)), this, SLOT(colorButtonClicked(int)));
+
+            QPushButton * btn = new QPushButton(this);
+            gbCLayout->addWidget(btn, (model->rowCount() - 1) / 3 + 1, 0, 1, 3);
+            btn->setText(tr("Reset to default colors"));
+            connect(btn, SIGNAL(clicked()), &DataManager::instance(), SLOT(resetColors()));
+        }
+
+        {
+            IconedGroupBox * gbMisc = new IconedGroupBox(this);
+            gbMisc->setIcon(QIcon(":/res/Settings.png"));
+            gbMisc->setTitle(QGroupBox::tr("Miscellaneous"));
+            page2Layout->addWidget(gbMisc, 0, 1);
+            QVBoxLayout * gbCLayout = new QVBoxLayout(gbMisc);
+
             QHBoxLayout * GBAfpslayout = new QHBoxLayout(0);
             QLabel * maxfps = new QLabel(AGGroupBox);
             maxfps->setText(QLabel::tr("FPS limit"));
             GBAfpslayout->addWidget(maxfps);
-            GBAlayout->addLayout(GBAfpslayout);
             fpsedit = new FPSEdit(AGGroupBox);
             GBAfpslayout->addWidget(fpsedit);
 
             CBShowFPS = new QCheckBox(AGGroupBox);
             CBShowFPS->setText(QCheckBox::tr("Show FPS"));
-            GBAlayout->addWidget(CBShowFPS);
+            GBAfpslayout->addWidget(CBShowFPS);
 
-            hr = new QFrame(AGGroupBox);
-            hr->setFrameStyle(QFrame::HLine);
-            hr->setLineWidth(3);
-            hr->setFixedHeight(10);
-            GBAlayout->addWidget(hr);
+            gbCLayout->addLayout(GBAfpslayout);
+
+
+            WeaponTooltip = new QCheckBox(this);
+            WeaponTooltip->setText(QCheckBox::tr("Show ammo menu tooltips"));
+            gbCLayout->addWidget(WeaponTooltip);
+
+
+            CBNameWithDate = new QCheckBox(this);
+            CBNameWithDate->setText(QCheckBox::tr("Append date and time to record file name"));
+            gbCLayout->addWidget(CBNameWithDate);
+
+            BtnAssociateFiles = new QPushButton(this);
+            BtnAssociateFiles->setText(QPushButton::tr("Associate file extensions"));
+            BtnAssociateFiles->setVisible(!custom_data && !custom_config);
+            gbCLayout->addWidget(BtnAssociateFiles);
+        }
+
+        {
+            IconedGroupBox * gbProxy = new IconedGroupBox(this);
+            gbProxy->setIcon(QIcon(":/res/Settings.png"));
+            gbProxy->setTitle(QGroupBox::tr("Proxy settings"));
+            page2Layout->addWidget(gbProxy, 1, 0);
+            QGridLayout * gbLayout = new QGridLayout(gbProxy);
+
+            QStringList sl;
+            sl
+                    << tr("Proxy host")
+                    << tr("Proxy port")
+                    << tr("Proxy login")
+                    << tr("Proxy password")
+                       ;
+            for(int i = 0; i < sl.size(); ++i)
+            {
+                QLabel * l = new QLabel(gbProxy);
+                l->setText(sl[i]);
+                gbLayout->addWidget(l, i + 1, 0);
+            }
+
+            cbProxyType = new QComboBox(gbProxy);
+            cbProxyType->addItems(QStringList()
+                                  << tr("No proxy")
+                                  << tr("System proxy settings")
+                                  << tr("Socks5 proxy")
+                                  << tr("HTTP proxy"));
+            gbLayout->addWidget(cbProxyType, 0, 1);
+
+            leProxy = new QLineEdit(gbProxy);
+            gbLayout->addWidget(leProxy, 1, 1);
+
+            sbProxyPort = new QSpinBox(gbProxy);
+            sbProxyPort->setMaximum(65535);
+            gbLayout->addWidget(sbProxyPort, 2, 1);
+
+            leProxyLogin = new QLineEdit(gbProxy);
+            gbLayout->addWidget(leProxyLogin, 3, 1);
+
+            leProxyPassword = new QLineEdit(gbProxy);
+            leProxyPassword->setEchoMode(QLineEdit::Password);
+            gbLayout->addWidget(leProxyPassword, 4, 1);
 
-            QLabel *restartNote = new QLabel(this);
-            restartNote->setText(QString("* ") + QLabel::tr("Restart game to apply"));
-            restartNote->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
-            GBAlayout->addWidget(restartNote);
 
-            gbTBLayout->addWidget(AGGroupBox, 0, 1, 3, 1);
+            connect(cbProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(onProxyTypeChanged()));
+            onProxyTypeChanged();
         }
 
+        page2Layout->addWidget(new QWidget(this), 2, 0);
+    }
+
     previousQuality = this->SLQuality->value();
     previousResolutionIndex = this->CBResolution->currentIndex();
     previousFullscreenValue = this->CBFullscreen->isChecked();
@@ -408,18 +502,17 @@ QLayout * PageOptions::bodyLayoutDefinition()
 
 QLayout * PageOptions::footerLayoutDefinition()
 {
-    QHBoxLayout * bottomLayout = new QHBoxLayout();
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-    return bottomLayout;
+    return NULL;
 }
 
 void PageOptions::connectSignals()
 {
+    connect(SLQuality, SIGNAL(valueChanged(int)), this, SLOT(setQuality(int)));
     connect(CBResolution, SIGNAL(currentIndexChanged(int)), this, SLOT(setResolution(int)));
     connect(CBFullscreen, SIGNAL(stateChanged(int)), this, SLOT(setFullscreen(int)));
-    connect(SLQuality, SIGNAL(valueChanged(int)), this, SLOT(setQuality(int)));
+    connect(CBStereoMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceFullscreen(int)));
+    connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick()));
+    connect(CBSavePassword, SIGNAL(stateChanged(int)), this, SLOT(savePwdChanged(int)));
 }
 
 PageOptions::PageOptions(QWidget* parent) : AbstractPage(parent)
@@ -431,13 +524,16 @@ void PageOptions::forceFullscreen(int index)
 {
     bool forced = (index == 7 || index == 8 || index == 9);
 
-    if (index != 0) {
+    if (index != 0)
+    {
         this->SLQuality->setValue(this->SLQuality->maximum());
         this->SLQuality->setEnabled(false);
         this->CBFullscreen->setEnabled(!forced);
         this->CBFullscreen->setChecked(forced ? true : previousFullscreenValue);
         this->CBResolution->setCurrentIndex(forced ? 0 : previousResolutionIndex);
-    } else {
+    }
+    else
+    {
         this->SLQuality->setEnabled(true);
         this->CBFullscreen->setEnabled(true);
         this->SLQuality->setValue(previousQuality);
@@ -478,6 +574,14 @@ void PageOptions::trimNetNick()
     editNetNick->setText(editNetNick->text().trimmed());
 }
 
+void PageOptions::savePwdChanged(int state) {
+    if (state == 0) {
+        editNetPassword->setEnabled(false);
+        editNetPassword->setText("");
+    } else
+        editNetPassword->setEnabled(true);
+}
+
 void PageOptions::requestEditSelectedTeam()
 {
     emit editTeamRequested(CBTeamName->currentText());
@@ -496,3 +600,37 @@ void PageOptions::setTeamOptionsEnabled(bool enabled)
     CBTeamName->setVisible(enabled);
     LblNoEditTeam->setVisible(!enabled);
 }
+
+void PageOptions::colorButtonClicked(int i)
+{
+    if(i < 0 || i >= m_colorButtons.size())
+        return;
+
+    QPalette p = m_colorButtons[i]->palette();
+    QColor c = QColorDialog::getColor(p.color(QPalette::Button));
+
+    if(c.isValid())
+    {
+        DataManager::instance().colorsModel()->item(i)->setData(c);
+        m_colorButtons[i]->setStyleSheet(QString("background: %1").arg(c.name()));
+    }
+}
+
+void PageOptions::onColorModelDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight)
+{
+    Q_UNUSED(bottomRight);
+
+    QStandardItemModel * model = DataManager::instance().colorsModel();
+
+    m_colorButtons[topLeft.row()]->setStyleSheet(QString("background: %1").arg(model->item(topLeft.row())->data().value<QColor>().name()));
+}
+
+void PageOptions::onProxyTypeChanged()
+{
+    bool b = cbProxyType->currentIndex() != NoProxy && cbProxyType->currentIndex() != SystemProxy ;
+
+    sbProxyPort->setEnabled(b);
+    leProxy->setEnabled(b);
+    leProxyLogin->setEnabled(b);
+    leProxyPassword->setEnabled(b);
+}
diff --git a/QTfrontend/ui/page/pageoptions.h b/QTfrontend/ui/page/pageoptions.h
index 6104d49..68cbe51 100644
--- a/QTfrontend/ui/page/pageoptions.h
+++ b/QTfrontend/ui/page/pageoptions.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,84 +23,101 @@
 
 class FPSEdit;
 class IconedGroupBox;
+class QSignalMapper;
 
 class PageOptions : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageOptions(QWidget* parent = 0);
-
-    QCheckBox *WeaponTooltip;
-    QPushButton *WeaponNew;
-    QPushButton *WeaponEdit;
-    QPushButton *WeaponDelete;
-    QComboBox *WeaponsName;
-    QPushButton *SchemeNew;
-    QPushButton *SchemeEdit;
-    QPushButton *SchemeDelete;
-    QComboBox *SchemesName;
-
-    QComboBox *CBLanguage;
-
-    IconedGroupBox *teamsBox;;
-    QPushButton *BtnAssociateFiles;
-    QComboBox *CBTeamName;
-    IconedGroupBox *AGGroupBox;
-    QComboBox *CBResolution;
-    QComboBox *CBStereoMode;
-    QCheckBox *CBEnableSound;
-    QCheckBox *CBEnableFrontendSound;
-    QCheckBox *CBEnableMusic;
-    QCheckBox *CBEnableFrontendMusic;
-    QCheckBox *CBFullscreen;
-    QCheckBox *CBFrontendFullscreen;
-    QCheckBox *CBShowFPS;
-    QCheckBox *CBAltDamage;
-    QCheckBox *CBNameWithDate;
+        Q_OBJECT
+
+    public:
+        enum ProxyTypes {
+            NoProxy      = 0,
+            SystemProxy  = 1,
+            Socks5Proxy  = 2,
+            HTTPProxy    = 3
+        };
+
+        PageOptions(QWidget* parent = 0);
+
+        QCheckBox *WeaponTooltip;
+        QPushButton *WeaponNew;
+        QPushButton *WeaponEdit;
+        QPushButton *WeaponDelete;
+        QComboBox *WeaponsName;
+        QPushButton *SchemeNew;
+        QPushButton *SchemeEdit;
+        QPushButton *SchemeDelete;
+        QComboBox *SchemesName;
+
+        QComboBox *CBLanguage;
+
+        IconedGroupBox *teamsBox;
+        QPushButton *BtnAssociateFiles;
+        QComboBox *CBTeamName;
+        IconedGroupBox *AGGroupBox;
+        QComboBox *CBResolution;
+        QComboBox *CBStereoMode;
+        QCheckBox *CBEnableSound;
+        QCheckBox *CBEnableFrontendSound;
+        QCheckBox *CBEnableMusic;
+        QCheckBox *CBEnableFrontendMusic;
+        QCheckBox *CBFullscreen;
+        QCheckBox *CBFrontendFullscreen;
+        QCheckBox *CBShowFPS;
+        QCheckBox *CBSavePassword;
+        QCheckBox *CBAltDamage;
+        QCheckBox *CBNameWithDate;
 #ifdef __APPLE__
-    QCheckBox *CBAutoUpdate;
+        QCheckBox *CBAutoUpdate;
 #endif
 
-    FPSEdit *fpsedit;
-    QPushButton *btnSave;
-    QLabel *labelNN;
-    QLabel *labelNetPassword;
-    QSpinBox * volumeBox;
-    QLineEdit *editNetNick;
-    QLineEdit *editNetPassword;
-    QSlider *SLQuality;
-    QCheckBox *CBFrontendEffects;
-
-    void setTeamOptionsEnabled(bool enabled);
-
-signals:
-    void newTeamRequested();
-    void editTeamRequested(const QString & teamName);
-    void deleteTeamRequested(const QString & teamName);
-
-
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
-
-    bool previousFullscreenValue;
-    int previousResolutionIndex;
-    int previousQuality;
-    QLabel *LblNoEditTeam;
-    QPushButton *BtnNewTeam;
-    QPushButton *BtnEditTeam;
-    QPushButton *BtnDeleteTeam;
-
-private slots:
-    void forceFullscreen(int index);
-    void setFullscreen(int state);
-    void setResolution(int state);
-    void setQuality(int value);
-    void trimNetNick();
-    void requestEditSelectedTeam();
-    void requestDeleteSelectedTeam();
+        FPSEdit *fpsedit;
+        QLabel *labelNN;
+        QSpinBox * volumeBox;
+        QLineEdit *editNetNick;
+        QLineEdit *editNetPassword;
+        QSlider *SLQuality;
+        QCheckBox *CBFrontendEffects;
+        QComboBox * cbProxyType;
+        QSpinBox * sbProxyPort;
+        QLineEdit * leProxy;
+        QLineEdit * leProxyLogin;
+        QLineEdit * leProxyPassword;
+
+        void setTeamOptionsEnabled(bool enabled);
+
+    signals:
+        void newTeamRequested();
+        void editTeamRequested(const QString & teamName);
+        void deleteTeamRequested(const QString & teamName);
+
+
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
+
+        bool previousFullscreenValue;
+        int previousResolutionIndex;
+        int previousQuality;
+        QLabel *LblNoEditTeam;
+        QPushButton *BtnNewTeam;
+        QPushButton *BtnEditTeam;
+        QPushButton *BtnDeleteTeam;
+        QList<QPushButton *> m_colorButtons;
+
+    private slots:
+        void forceFullscreen(int index);
+        void setFullscreen(int state);
+        void setResolution(int state);
+        void setQuality(int value);
+        void trimNetNick();
+        void requestEditSelectedTeam();
+        void requestDeleteSelectedTeam();
+        void savePwdChanged(int state);
+        void colorButtonClicked(int i);
+        void onColorModelDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
+        void onProxyTypeChanged();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageplayrecord.cpp b/QTfrontend/ui/page/pageplayrecord.cpp
index 299899d..20f5e4e 100644
--- a/QTfrontend/ui/page/pageplayrecord.cpp
+++ b/QTfrontend/ui/page/pageplayrecord.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,6 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#include "pageplayrecord.h"
+
 #include <QFont>
 #include <QGridLayout>
 #include <QPushButton>
@@ -26,12 +28,13 @@
 #include <QInputDialog>
 
 #include "hwconsts.h"
-#include "pageplayrecord.h"
+
+#include "DataManager.h"
 
 QLayout * PagePlayDemo::bodyLayoutDefinition()
 {
     QGridLayout * pageLayout = new QGridLayout();
-    
+
     pageLayout->setColumnStretch(0, 1);
     pageLayout->setColumnStretch(1, 2);
     pageLayout->setColumnStretch(2, 1);
@@ -61,6 +64,7 @@ void PagePlayDemo::connectSignals()
 {
     connect(BtnRenameRecord, SIGNAL(clicked()), this, SLOT(renameRecord()));
     connect(BtnRemoveRecord, SIGNAL(clicked()), this, SLOT(removeRecord()));
+    connect(&DataManager::instance(), SIGNAL(updated()), this, SLOT(refresh()));
 }
 
 PagePlayDemo::PagePlayDemo(QWidget* parent) : AbstractPage(parent)
@@ -81,7 +85,8 @@ void PagePlayDemo::FillFromDir(RecordType rectype)
         dir.cd("Demos");
         extension = "hwd";
         BtnPlayDemo->setText(QPushButton::tr("Play demo"));
-    } else
+    }
+    else
     {
         dir.cd("Saves");
         extension = "hws";
@@ -102,15 +107,25 @@ void PagePlayDemo::FillFromDir(RecordType rectype)
     }
 }
 
+
+void PagePlayDemo::refresh()
+{
+    if (this->isVisible())
+        FillFromDir(recType);
+}
+
+
 void PagePlayDemo::renameRecord()
 {
     QListWidgetItem * curritem = DemosList->currentItem();
     if (!curritem)
     {
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please select record from the list"),
-                tr("OK"));
+        QMessageBox recordMsg(this);
+        recordMsg.setIcon(QMessageBox::Warning);
+        recordMsg.setWindowTitle(QMessageBox::tr("Record Play - Error"));
+        recordMsg.setText(QMessageBox::tr("Please select record from the list"));
+        recordMsg.setWindowModality(Qt::WindowModal);
+        recordMsg.exec();
         return ;
     }
     QFile rfile(curritem->data(Qt::UserRole).toString());
@@ -124,14 +139,21 @@ void PagePlayDemo::renameRecord()
     if(ok && newname.size())
     {
         QString newfullname = QString("%1/%2.%3.%4")
-                                      .arg(finfo.absolutePath())
-                                      .arg(newname)
-                                      .arg(*cProtoVer)
-                                      .arg(finfo.suffix());
+                              .arg(finfo.absolutePath())
+                              .arg(newname)
+                              .arg(*cProtoVer)
+                              .arg(finfo.suffix());
 
         ok = rfile.rename(newfullname);
         if(!ok)
-            QMessageBox::critical(this, tr("Error"), tr("Cannot rename to") + newfullname);
+        {
+            QMessageBox renameMsg(this);
+            renameMsg.setIcon(QMessageBox::Warning);
+            renameMsg.setWindowTitle(QMessageBox::tr("Record Play - Error"));
+            renameMsg.setText(QMessageBox::tr("Cannot rename to ") + newfullname);
+            renameMsg.setWindowModality(Qt::WindowModal);
+            renameMsg.exec();
+        }
         else
             FillFromDir(recType);
     }
@@ -142,10 +164,12 @@ void PagePlayDemo::removeRecord()
     QListWidgetItem * curritem = DemosList->currentItem();
     if (!curritem)
     {
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please select record from the list"),
-                tr("OK"));
+        QMessageBox recordMsg(this);
+        recordMsg.setIcon(QMessageBox::Warning);
+        recordMsg.setWindowTitle(QMessageBox::tr("Record Play - Error"));
+        recordMsg.setText(QMessageBox::tr("Please select record from the list"));
+        recordMsg.setWindowModality(Qt::WindowModal);
+        recordMsg.exec();
         return ;
     }
     QFile rfile(curritem->data(Qt::UserRole).toString());
@@ -154,9 +178,20 @@ void PagePlayDemo::removeRecord()
 
     ok = rfile.remove();
     if(!ok)
-        QMessageBox::critical(this, tr("Error"), tr("Cannot delete file"));
+    {
+        QMessageBox removeMsg(this);
+        removeMsg.setIcon(QMessageBox::Warning);
+        removeMsg.setWindowTitle(QMessageBox::tr("Record Play - Error"));
+        removeMsg.setText(QMessageBox::tr("Cannot delete file ") + rfile.fileName());
+        removeMsg.setWindowModality(Qt::WindowModal);
+        removeMsg.exec();
+    }
     else
-        FillFromDir(recType);
+    {
+        int i = DemosList->row(curritem);
+        delete curritem;
+        DemosList->setCurrentRow(i < DemosList->count() ? i : DemosList->count() - 1);
+    }
 }
 
 bool PagePlayDemo::isSave()
diff --git a/QTfrontend/ui/page/pageplayrecord.h b/QTfrontend/ui/page/pageplayrecord.h
index e2bb8a3..f1bffcc 100644
--- a/QTfrontend/ui/page/pageplayrecord.h
+++ b/QTfrontend/ui/page/pageplayrecord.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,33 +28,37 @@ class QListWidget;
 
 class PagePlayDemo : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    enum RecordType {
-        RT_Demo,
-        RT_Save
-    };
+    public:
+        enum RecordType
+        {
+            RT_Demo,
+            RT_Save
+        };
 
-    PagePlayDemo(QWidget* parent = 0);
+        PagePlayDemo(QWidget* parent = 0);
 
-    void FillFromDir(RecordType rectype);
-    bool isSave();
+        void FillFromDir(RecordType rectype);
+        bool isSave();
 
-    QPushButton *BtnPlayDemo;
-    QPushButton *BtnRenameRecord;
-    QPushButton *BtnRemoveRecord;
-    QListWidget *DemosList;
+        QPushButton *BtnPlayDemo;
+        QPushButton *BtnRenameRecord;
+        QPushButton *BtnRemoveRecord;
+        QListWidget *DemosList;
 
-private:
-    QLayout * bodyLayoutDefinition();
-    void connectSignals();
+    public slots:
+        void refresh();
 
-    RecordType recType;
+    private:
+        QLayout * bodyLayoutDefinition();
+        void connectSignals();
 
-private slots:
-    void renameRecord();
-    void removeRecord();
+        RecordType recType;
+
+    private slots:
+        void renameRecord();
+        void removeRecord();
 };
 
 
diff --git a/QTfrontend/ui/page/pageroomslist.cpp b/QTfrontend/ui/page/pageroomslist.cpp
index dba4fd2..7724eb3 100644
--- a/QTfrontend/ui/page/pageroomslist.cpp
+++ b/QTfrontend/ui/page/pageroomslist.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,7 +24,11 @@
 #include <QLineEdit>
 #include <QMessageBox>
 #include <QHeaderView>
-#include <QTableWidget>
+#include <QTableView>
+
+#include <QSortFilterProxyModel>
+
+#include "roomslistmodel.h"
 
 #include "ammoSchemeModel.h"
 #include "pageroomslist.h"
@@ -44,7 +48,7 @@ QLayout * PageRoomsList::bodyLayoutDefinition()
     newRoomLayout->addWidget(roomName);
     pageLayout->addLayout(newRoomLayout, 0, 0, 1, 2);
 
-    roomsList = new QTableWidget(this);
+    roomsList = new QTableView(this);
     roomsList->setSelectionBehavior(QAbstractItemView::SelectRows);
     roomsList->verticalHeader()->setVisible(false);
     roomsList->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
@@ -61,7 +65,7 @@ QLayout * PageRoomsList::bodyLayoutDefinition()
 
     filterLayout->addWidget(stateLabel);
     filterLayout->addWidget(CBState);
-    filterLayout->addSpacing(30);
+    filterLayout->addStretch(1);
 
     QLabel * ruleLabel = new QLabel(this);
     ruleLabel->setText(tr("Rules:"));
@@ -69,7 +73,7 @@ QLayout * PageRoomsList::bodyLayoutDefinition()
 
     filterLayout->addWidget(ruleLabel);
     filterLayout->addWidget(CBRules);
-    filterLayout->addSpacing(30);
+    filterLayout->addStretch(1);
 
     QLabel * weaponLabel = new QLabel(this);
     weaponLabel->setText(tr("Weapons:"));
@@ -77,14 +81,17 @@ QLayout * PageRoomsList::bodyLayoutDefinition()
 
     filterLayout->addWidget(weaponLabel);
     filterLayout->addWidget(CBWeapons);
-    filterLayout->addSpacing(30);
+    filterLayout->addStretch(1);
 
     QLabel * searchLabel = new QLabel(this);
     searchLabel->setText(tr("Search:"));
     searchText = new QLineEdit(this);
     searchText->setMaxLength(60);
+    searchText->setMinimumWidth(100);
+    searchText->setMaximumWidth(360);
     filterLayout->addWidget(searchLabel);
     filterLayout->addWidget(searchText);
+    filterLayout->setStretchFactor(searchText, 2);
 
     pageLayout->addLayout(filterLayout, 4, 0, 1, 2);
 
@@ -94,7 +101,6 @@ QLayout * PageRoomsList::bodyLayoutDefinition()
 
     BtnCreate = addButton(tr("Create"), pageLayout, 0, 2);
     BtnJoin = addButton(tr("Join"), pageLayout, 1, 2);
-    BtnRefresh = addButton(tr("Refresh"), pageLayout, 3, 2);
     BtnClear = addButton(tr("Clear"), pageLayout, 4, 2);
 
     // strech all but the buttons column
@@ -136,22 +142,30 @@ void PageRoomsList::connectSignals()
 
     connect(BtnCreate, SIGNAL(clicked()), this, SLOT(onCreateClick()));
     connect(BtnJoin, SIGNAL(clicked()), this, SLOT(onJoinClick()));
-    connect(BtnRefresh, SIGNAL(clicked()), this, SLOT(onRefreshClick()));
     connect(BtnClear, SIGNAL(clicked()), this, SLOT(onClearClick()));
     connect(roomsList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(onJoinClick()));
-    connect(CBState, SIGNAL(currentIndexChanged (int)), this, SLOT(onRefreshClick()));
-    connect(CBRules, SIGNAL(currentIndexChanged (int)), this, SLOT(onRefreshClick()));
-    connect(CBWeapons, SIGNAL(currentIndexChanged (int)), this, SLOT(onRefreshClick()));
-    connect(searchText, SIGNAL(textChanged (const QString &)), this, SLOT(onRefreshClick()));
+    connect(CBState, SIGNAL(currentIndexChanged (int)), this, SLOT(onFilterChanged()));
+    connect(CBRules, SIGNAL(currentIndexChanged (int)), this, SLOT(onFilterChanged()));
+    connect(CBWeapons, SIGNAL(currentIndexChanged (int)), this, SLOT(onFilterChanged()));
+    connect(searchText, SIGNAL(textChanged (const QString &)), this, SLOT(onFilterChanged()));
     connect(this, SIGNAL(askJoinConfirmation (const QString &)), this, SLOT(onJoinConfirmation(const QString &)), Qt::QueuedConnection);
+
+    // sorting
+    connect(roomsList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)),
+            this, SLOT(onSortIndicatorChanged(int, Qt::SortOrder)));
 }
 
 
 PageRoomsList::PageRoomsList(QWidget* parent, QSettings * gameSettings) :
-  AbstractPage(parent)
+    AbstractPage(parent)
 {
     m_gameSettings = gameSettings;
 
+    roomsModel = NULL;
+    stateFilteredModel = NULL;
+    schemeFilteredModel = NULL;
+    weaponsFilteredModel = NULL;
+
     initPage();
 
     // not the most elegant solution but it works
@@ -160,12 +174,11 @@ PageRoomsList::PageRoomsList(QWidget* parent, QSettings * gameSettings) :
         CBRules->addItem(ammoSchemeModel->predefSchemesNames.at(i).toAscii().constData());
 
     CBWeapons->addItem(QComboBox::tr("Any"));
-    for (int i = 0; i < cDefaultAmmos.count(); i++) {
+    for (int i = 0; i < cDefaultAmmos.count(); i++)
+    {
         QPair<QString,QString> ammo = cDefaultAmmos.at(i);
         CBWeapons->addItem(ammo.first.toAscii().constData());
     }
-
-    gameInLobby = false;
 }
 
 
@@ -191,6 +204,7 @@ void PageRoomsList::setAdmin(bool flag)
     BtnAdmin->setVisible(flag);
 }
 
+/*
 void PageRoomsList::setRoomsList(const QStringList & list)
 {
     QBrush red(QColor(255, 0, 0));
@@ -199,24 +213,17 @@ void PageRoomsList::setRoomsList(const QStringList & list)
     QBrush green(QColor(0, 255, 0));
 
     listFromServer = list;
-    
+
     QString selection = "";
-    
+
     if(QTableWidgetItem *item = roomsList->item(roomsList->currentRow(), 0))
         selection = item->text();
-    
+
     roomsList->clear();
     roomsList->setColumnCount(7);
     roomsList->setHorizontalHeaderLabels(
-            QStringList() <<
-            QTableWidget::tr("Room Name") <<
-            QTableWidget::tr("C") <<
-            QTableWidget::tr("T") <<
-            QTableWidget::tr("Owner") <<
-            QTableWidget::tr("Map") <<
-            QTableWidget::tr("Rules") <<
-            QTableWidget::tr("Weapons")
-            );
+
+    );
 
     // set minimum sizes
 //  roomsList->horizontalHeader()->resizeSection(0, 200);
@@ -240,52 +247,79 @@ void PageRoomsList::setRoomsList(const QStringList & list)
     {
         // if we are joining a game
         // TODO: Should NOT be done here
-        if (gameInLobby) {
-            if (gameInLobbyName == list[i + 1]) {
+        if (gameInLobby)
+        {
+            if (gameInLobbyName == list[i + 1])
+            {
                 gameCanBeJoined = list[i].compare("True");
             }
         }
-        
+
         // check filter settings
-        #define NO_FILTER_MATCH roomsList->setRowCount(roomsList->rowCount() - 1); --r; continue
-        
-        if (list[i].compare("True") && CBState->currentIndex() == 2) { NO_FILTER_MATCH; }
-        if (list[i].compare("False") && CBState->currentIndex() == 1) { NO_FILTER_MATCH; }
-        if (CBRules->currentIndex() != 0 && list[i + 6].compare(CBRules->currentText())) { NO_FILTER_MATCH; }
-        if (CBWeapons->currentIndex() != 0 && list[i + 7].compare(CBWeapons->currentText())) { NO_FILTER_MATCH; }
+#define NO_FILTER_MATCH roomsList->setRowCount(roomsList->rowCount() - 1); --r; continue
+
+        if (list[i].compare("True") && CBState->currentIndex() == 2)
+        {
+            NO_FILTER_MATCH;
+        }
+        if (list[i].compare("False") && CBState->currentIndex() == 1)
+        {
+            NO_FILTER_MATCH;
+        }
+        if (CBRules->currentIndex() != 0 && list[i + 6].compare(CBRules->currentText()))
+        {
+            NO_FILTER_MATCH;
+        }
+        if (CBWeapons->currentIndex() != 0 && list[i + 7].compare(CBWeapons->currentText()))
+        {
+            NO_FILTER_MATCH;
+        }
         bool found = list[i + 1].contains(searchText->text(), Qt::CaseInsensitive);
-        if (!found) {
-            for (int a = 4; a <= 7; ++a) {
+        if (!found)
+        {
+            for (int a = 4; a <= 7; ++a)
+            {
                 QString compString = list[i + a];
-                if (a == 5 && compString == "+rnd+") {
+                if (a == 5 && compString == "+rnd+")
+                {
                     compString = "Random Map";
-                } else if (a == 5 && compString == "+maze+") {
+                }
+                else if (a == 5 && compString == "+maze+")
+                {
                     compString = "Random Maze";
-                } else if (a == 5 && compString == "+drawn+") {
+                }
+                else if (a == 5 && compString == "+drawn+")
+                {
                     compString = "Drawn Map";
                 }
-                if (compString.contains(searchText->text(), Qt::CaseInsensitive)) {
+                if (compString.contains(searchText->text(), Qt::CaseInsensitive))
+                {
                     found = true;
                     break;
                 }
             }
         }
-        if (!searchText->text().isEmpty() && !found) { NO_FILTER_MATCH; }
-        
+        if (!searchText->text().isEmpty() && !found)
+        {
+            NO_FILTER_MATCH;
+        }
+
         QTableWidgetItem * item;
         item = new QTableWidgetItem(list[i + 1]); // room name
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-        
+
         // pick appropriate room icon and tooltip (game in progress yes/no; later maybe locked rooms etc.)
         if(list[i].compare("True"))
         {
             item->setIcon(QIcon(":/res/iconTime.png"));// game is in lobby
-            item->setToolTip(tr("This game is in lobby.\nYou may join and start playing once the game starts."));
+            item->setToolTip(tr("Waiting..."));
+            item->setWhatsThis(tr("This game is in lobby: you may join and start playing once the game starts."));
         }
         else
         {
             item->setIcon(QIcon(":/res/iconDamage.png"));// game has started
-            item->setToolTip(tr("This game is in progress.\nYou may join and spectate now but you'll have to wait for the game to end to start playing."));
+            item->setToolTip(tr("In progress..."));
+            item->setWhatsThis(tr("This game is in progress: you may join and spectate now but you'll have to wait for the game to end to start playing."));
         }
 
         roomsList->setItem(r, 0, item);
@@ -293,13 +327,13 @@ void PageRoomsList::setRoomsList(const QStringList & list)
         item = new QTableWidgetItem(list[i + 2]); // number of clients
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
         item->setTextAlignment(Qt::AlignCenter);
-        item->setToolTip(tr("There are %1 clients connected to this room.", "", list[i + 2].toInt()).arg(list[i + 2]));
+        item->setWhatsThis(tr("There are %1 clients connected to this room.", "", list[i + 2].toInt()).arg(list[i + 2]));
         roomsList->setItem(r, 1, item);
 
         item = new QTableWidgetItem(list[i + 3]); // number of teams
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
         item->setTextAlignment(Qt::AlignCenter);
-        item->setToolTip(tr("There are %1 teams participating in this room.", "", list[i + 3].toInt()).arg(list[i + 3]));
+        item->setWhatsThis(tr("There are %1 teams participating in this room.", "", list[i + 3].toInt()).arg(list[i + 3]));
         //Should we highlight "full" games? Might get misinterpreted
         //if(list[i + 3].toInt() >= cMaxTeams)
         //    item->setForeground(red);
@@ -307,7 +341,7 @@ void PageRoomsList::setRoomsList(const QStringList & list)
 
         item = new QTableWidgetItem(list[i + 4].left(15)); // name of host
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-        item->setToolTip(tr("%1 is the host. He may adjust settings and start the game.").arg(list[i + 4]));
+        item->setWhatsThis(tr("%1 is the host. He may adjust settings and start the game.").arg(list[i + 4]));
         roomsList->setItem(r, 3, item);
 
         if(list[i + 5] == "+rnd+")
@@ -325,7 +359,7 @@ void PageRoomsList::setRoomsList(const QStringList & list)
         else
         {
             item = new QTableWidgetItem(list[i + 5]); // selected map
-            
+
             // check to see if we've got this map
             // not perfect but a start
             if(!mapList->contains(list[i + 5]))
@@ -335,24 +369,24 @@ void PageRoomsList::setRoomsList(const QStringList & list)
             }
             else
             {
-               // todo: mission icon?
+                // todo: mission icon?
 // FIXME - need real icons. Disabling until then
 //               item->setIcon(QIcon(":/res/mapCustom.png"));
             }
         }
-        
+
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-        item->setToolTip(tr("Games may be played on precreated or randomized maps."));
+        item->setWhatsThis(tr("Games may be played on precreated or randomized maps."));
         roomsList->setItem(r, 4, item);
 
         item = new QTableWidgetItem(list[i + 6].left(24)); // selected game scheme
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-        item->setToolTip(tr("The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism."));
+        item->setWhatsThis(tr("The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism."));
         roomsList->setItem(r, 5, item);
 
         item = new QTableWidgetItem(list[i + 7].left(24)); // selected weapon scheme
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-        item->setToolTip(tr("The Weapon Scheme defines available weapons and their ammunition count."));
+        item->setWhatsThis(tr("The Weapon Scheme defines available weapons and their ammunition count."));
         roomsList->setItem(r, 6, item);
 
         if(!list[i + 1].compare(selection) && !selection.isEmpty())
@@ -368,54 +402,60 @@ void PageRoomsList::setRoomsList(const QStringList & list)
     roomsList->horizontalHeader()->setResizeMode(6, QHeaderView::ResizeToContents);
 
     // TODO: Should NOT be done here
-    if (gameInLobby) {
+    if (gameInLobby)
+    {
         gameInLobby = false;
-        if (gameCanBeJoined) {
+        if (gameCanBeJoined)
+        {
             emit askForJoinRoom(gameInLobbyName);
-        } else {
+        }
+        else
+        {
             emit askJoinConfirmation(gameInLobbyName);
         }
     }
 
 //  roomsList->resizeColumnsToContents();
 }
+*/
 
 void PageRoomsList::onCreateClick()
 {
     if (roomName->text().size())
         emit askForCreateRoom(roomName->text());
     else
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please enter room name"),
-                tr("OK"));
+    {
+        QMessageBox roomNameMsg(this);
+        roomNameMsg.setIcon(QMessageBox::Warning);
+        roomNameMsg.setWindowTitle(QMessageBox::tr("Room Name - Error"));
+        roomNameMsg.setText(QMessageBox::tr("Please enter room name"));
+        roomNameMsg.setWindowModality(Qt::WindowModal);
+        roomNameMsg.exec();
+    }
 }
 
 void PageRoomsList::onJoinClick()
 {
-    QTableWidgetItem * curritem = roomsList->item(roomsList->currentRow(), 0);
-    if (!curritem)
+    QModelIndexList mdl = roomsList->selectionModel()->selectedRows();
+
+    if(mdl.size() != 1)
     {
-        QMessageBox::critical(this,
-                tr("Error"),
-                tr("Please select room from the list"),
-                tr("OK"));
+        QMessageBox roomNameMsg(this);
+        roomNameMsg.setIcon(QMessageBox::Warning);
+        roomNameMsg.setWindowTitle(QMessageBox::tr("Room Name - Error"));
+        roomNameMsg.setText(QMessageBox::tr("Please select room from the list"));
+        roomNameMsg.setWindowModality(Qt::WindowModal);
+        roomNameMsg.exec();
         return;
     }
 
-    for (int i = 0; i < listFromServer.size(); i += 8) {
-        if (listFromServer[i + 1] == curritem->data(Qt::DisplayRole).toString()) {
-            gameInLobby = listFromServer[i].compare("True");
-            break;
-        }
-    }
-    
-    if (gameInLobby) {
-        gameInLobbyName = curritem->data(Qt::DisplayRole).toString();
-        emit askForRoomList();
-    } else {
-        emit askForJoinRoom(curritem->data(Qt::DisplayRole).toString());
-    }
+    bool gameInLobby = roomsList->model()->index(mdl[0].row(), 0).data().toString().compare("True");
+    QString roomName = roomsList->model()->index(mdl[0].row(), 1).data().toString();
+
+    if (!gameInLobby)
+        emit askJoinConfirmation(roomName);
+    else
+        emit askForJoinRoom(roomName);
 }
 
 void PageRoomsList::onRefreshClick()
@@ -433,10 +473,15 @@ void PageRoomsList::onClearClick()
 
 void PageRoomsList::onJoinConfirmation(const QString & room)
 {
-    if (QMessageBox::warning(this,
-        tr("Warning"),
-        tr("The game you are trying to join has started.\nDo you still want to join the room?"),
-        QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
+
+    QMessageBox reallyJoinMsg(this);
+    reallyJoinMsg.setIcon(QMessageBox::Question);
+    reallyJoinMsg.setWindowTitle(QMessageBox::tr("Room Name - Are you sure?"));
+    reallyJoinMsg.setText(QMessageBox::tr("The game you are trying to join has started.\nDo you still want to join the room?"));
+    reallyJoinMsg.setWindowModality(Qt::WindowModal);
+    reallyJoinMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+    if (reallyJoinMsg.exec() == QMessageBox::Ok)
     {
         emit askForJoinRoom(room);
     }
@@ -451,3 +496,133 @@ void PageRoomsList::setUser(const QString & nickname)
 {
     chatWidget->setUser(nickname);
 }
+
+void PageRoomsList::setModel(RoomsListModel * model)
+{
+    // filter chain:
+    // model -> stateFilteredModel -> schemeFilteredModel ->
+    // -> weaponsFilteredModel -> roomsModel (search filter+sorting)
+
+    if (roomsModel == NULL)
+    {
+        roomsModel = new QSortFilterProxyModel(this);
+        roomsModel->setDynamicSortFilter(true);
+        roomsModel->setSortCaseSensitivity(Qt::CaseInsensitive);
+        roomsModel->sort(RoomsListModel::StateColumn, Qt::AscendingOrder);
+
+        stateFilteredModel = new QSortFilterProxyModel(this);
+        schemeFilteredModel = new QSortFilterProxyModel(this);
+        weaponsFilteredModel = new QSortFilterProxyModel(this);
+
+        stateFilteredModel->setDynamicSortFilter(true);
+        schemeFilteredModel->setDynamicSortFilter(true);
+        weaponsFilteredModel->setDynamicSortFilter(true);
+
+        roomsModel->setFilterKeyColumn(-1); // search in all columns
+        stateFilteredModel->setFilterKeyColumn(RoomsListModel::StateColumn);
+        schemeFilteredModel->setFilterKeyColumn(RoomsListModel::SchemeColumn);
+        weaponsFilteredModel->setFilterKeyColumn(RoomsListModel::WeaponsColumn);
+
+        roomsModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+        schemeFilteredModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+        weaponsFilteredModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+
+        schemeFilteredModel->setSourceModel(stateFilteredModel);
+        weaponsFilteredModel->setSourceModel(schemeFilteredModel);
+        roomsModel->setSourceModel(weaponsFilteredModel);
+
+        // let the table view display the last model in the filter chain
+        roomsList->setModel(roomsModel);
+    }
+
+    stateFilteredModel->setSourceModel(model);
+
+    roomsList->hideColumn(RoomsListModel::StateColumn);
+
+    QHeaderView * h = roomsList->horizontalHeader();
+
+    h->setSortIndicatorShown(true);
+    h->setSortIndicator(RoomsListModel::StateColumn, Qt::AscendingOrder);
+    h->setResizeMode(RoomsListModel::NameColumn, QHeaderView::Stretch);
+
+    if (!restoreHeaderState())
+    {
+        h->resizeSection(RoomsListModel::PlayerCountColumn, 32);
+        h->resizeSection(RoomsListModel::TeamCountColumn, 32);
+        h->resizeSection(RoomsListModel::OwnerColumn, 100);
+        h->resizeSection(RoomsListModel::MapColumn, 100);
+        h->resizeSection(RoomsListModel::SchemeColumn, 100);
+        h->resizeSection(RoomsListModel::WeaponsColumn, 100);
+    }
+
+
+    // save header state on change
+    connect(roomsList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)),
+            this, SLOT(saveHeaderState()));
+    connect(roomsList->horizontalHeader(), SIGNAL(sectionResized(int, int, int)),
+            this, SLOT(saveHeaderState()));
+}
+
+
+void PageRoomsList::onSortIndicatorChanged(int logicalIndex, Qt::SortOrder order)
+{
+    if (roomsModel == NULL)
+        return;
+
+    if (logicalIndex == 0)
+    {
+        roomsModel->sort(0, Qt::AscendingOrder);
+        return;
+    }
+
+    // three state sorting: asc -> dsc -> default (by room state)
+    if ((order == Qt::AscendingOrder) && (logicalIndex == roomsModel->sortColumn()))
+        roomsList->horizontalHeader()->setSortIndicator(
+            RoomsListModel::StateColumn, Qt::AscendingOrder);
+    else
+        roomsModel->sort(logicalIndex, order);
+}
+
+
+void PageRoomsList::onFilterChanged()
+{
+    if (roomsModel == NULL)
+        return;
+
+    roomsModel->setFilterWildcard(QString("*%1*").arg(searchText->text()));
+
+    int stateIdx = CBState->currentIndex();
+    // any = 0, in lobby/false = 1, in progress/true = 2
+
+    if (stateIdx == 0)
+        stateFilteredModel->setFilterWildcard("*"); // "any"
+    else
+        stateFilteredModel->setFilterFixedString(QString(stateIdx == 2));
+
+    if (CBRules->currentIndex() == 0)
+        schemeFilteredModel->setFilterWildcard("*"); // "any"
+    else
+        schemeFilteredModel->setFilterWildcard(
+            QString("*%1*").arg(CBRules->currentText()));
+
+    if (CBWeapons->currentIndex() == 0)
+        weaponsFilteredModel->setFilterWildcard("*"); // "any"
+    else
+        weaponsFilteredModel->setFilterWildcard(
+            QString("*%1*").arg(CBWeapons->currentText()));
+}
+
+
+bool PageRoomsList::restoreHeaderState()
+{
+    if (!m_gameSettings->contains("frontend/roomslist_header"))
+        return false;
+    return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
+        (m_gameSettings->value("frontend/roomslist_header").toString().toAscii())));
+}
+
+void PageRoomsList::saveHeaderState()
+{
+    m_gameSettings->setValue("frontend/roomslist_header",
+        QString(roomsList->horizontalHeader()->saveState().toBase64()));
+}
diff --git a/QTfrontend/ui/page/pageroomslist.h b/QTfrontend/ui/page/pageroomslist.h
index ae6a7ba..80f28dd 100644
--- a/QTfrontend/ui/page/pageroomslist.h
+++ b/QTfrontend/ui/page/pageroomslist.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,63 +23,71 @@
 
 class HWChatWidget;
 class AmmoSchemeModel;
+class QTableView;
+class RoomsListModel;
+class QSortFilterProxyModel;
 
 class PageRoomsList : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageRoomsList(QWidget* parent, QSettings * config);
-    void displayError(const QString & message);
-    void displayNotice(const QString & message);
-    void displayWarning(const QString & message);
+    public:
+        PageRoomsList(QWidget* parent, QSettings * config);
+        void displayError(const QString & message);
+        void displayNotice(const QString & message);
+        void displayWarning(const QString & message);
 
-    QLineEdit * roomName;
-    QLineEdit * searchText;
-    QTableWidget * roomsList;
-    QPushButton * BtnCreate;
-    QPushButton * BtnJoin;
-    QPushButton * BtnRefresh;
-    QPushButton * BtnAdmin;
-    QPushButton * BtnClear;
-    QComboBox * CBState;
-    QComboBox * CBRules;
-    QComboBox * CBWeapons;
-    HWChatWidget * chatWidget;
-    QLabel * lblCount;
+        QLineEdit * roomName;
+        QLineEdit * searchText;
+        QTableView * roomsList;
+        QPushButton * BtnCreate;
+        QPushButton * BtnJoin;
+        QPushButton * BtnAdmin;
+        QPushButton * BtnClear;
+        QComboBox * CBState;
+        QComboBox * CBRules;
+        QComboBox * CBWeapons;
+        HWChatWidget * chatWidget;
+        QLabel * lblCount;
 
-public slots:
-    void setAdmin(bool);
-    void setRoomsList(const QStringList & list);
-    void setUser(const QString & nickname);
-    void updateNickCounter(int cnt);
+        void setModel(RoomsListModel * model);
 
-signals:
-    void askForCreateRoom(const QString &);
-    void askForJoinRoom(const QString &);
-    void askForRoomList();
-    void askJoinConfirmation(const QString &);
+    public slots:
+        void setAdmin(bool);
+        void setUser(const QString & nickname);
+        void updateNickCounter(int cnt);
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    signals:
+        void askForCreateRoom(const QString &);
+        void askForJoinRoom(const QString &);
+        void askForRoomList();
+        void askJoinConfirmation(const QString &);
 
-private slots:
-    void onCreateClick();
-    void onJoinClick();
-    void onRefreshClick();
-    void onClearClick();
-    void onJoinConfirmation(const QString &);
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-private:
-    QSettings * m_gameSettings;
+    private slots:
+        void onCreateClick();
+        void onJoinClick();
+        void onRefreshClick();
+        void onClearClick();
+        void onJoinConfirmation(const QString &);
+        void onSortIndicatorChanged(int logicalIndex, Qt::SortOrder order);
+        void onFilterChanged();
+        void saveHeaderState();
 
-    bool gameInLobby;
-    QString gameInLobbyName;
-    QStringList listFromServer;
-    AmmoSchemeModel * ammoSchemeModel;
+    private:
+        QSettings * m_gameSettings;
+        QSortFilterProxyModel * roomsModel;
+        QSortFilterProxyModel * stateFilteredModel;
+        QSortFilterProxyModel * schemeFilteredModel;
+        QSortFilterProxyModel * weaponsFilteredModel;
 
+        AmmoSchemeModel * ammoSchemeModel;
+
+        bool restoreHeaderState();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagescheme.cpp b/QTfrontend/ui/page/pagescheme.cpp
index b1b27e0..56d371a 100644
--- a/QTfrontend/ui/page/pagescheme.cpp
+++ b/QTfrontend/ui/page/pagescheme.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -50,11 +50,11 @@ QLayout * PageScheme::bodyLayoutDefinition()
 
     // TODO name stuff and put CSS into main style sheet
     gbGameModes->setStyleSheet(".QGroupBox {"
-            "background-color: #130f2c; background-image:url();"
-            "}");
+                               "background-color: #130f2c; background-image:url();"
+                               "}");
     gbBasicSettings->setStyleSheet(".QGroupBox {"
-            "background-color: #130f2c; background-image:url();"
-            "}");
+                                   "background-color: #130f2c; background-image:url();"
+                                   "}");
 
     gbGameModes->setSizePolicy(sp);
     gbBasicSettings->setSizePolicy(sp);
@@ -68,103 +68,128 @@ QLayout * PageScheme::bodyLayoutDefinition()
     // Left
 
     TBW_mode_Forts = new ToggleButtonWidget(gbGameModes, ":/res/btnForts at 2x.png");
-    TBW_mode_Forts->setToolTip("<b>" + ToggleButtonWidget::tr("Fort Mode") + "</b>:<br />" + tr("Defend your fort and destroy the opponents, two team colours max!"));
+    TBW_mode_Forts->setToolTip("<b>" + ToggleButtonWidget::tr("Fort Mode") + "</b>");
+    TBW_mode_Forts->setWhatsThis(tr("Defend your fort and destroy the opponents, two team colours max!"));
     glGMLayout->addWidget(TBW_mode_Forts,0,0,1,1);
 
     TBW_teamsDivide = new ToggleButtonWidget(gbGameModes, ":/res/btnTeamsDivide at 2x.png");
-    TBW_teamsDivide->setToolTip("<b>" + ToggleButtonWidget::tr("Divide Teams") + "</b>:<br />" + tr("Teams will start on opposite sides of the terrain, two team colours max!"));
+    TBW_teamsDivide->setToolTip("<b>" + ToggleButtonWidget::tr("Divide Teams") + "</b>");
+    TBW_teamsDivide->setWhatsThis(tr("Teams will start on opposite sides of the terrain, two team colours max!"));
     glGMLayout->addWidget(TBW_teamsDivide,0,1,1,1);
 
     TBW_solid = new ToggleButtonWidget(gbGameModes, ":/res/btnSolid at 2x.png");
-    TBW_solid->setToolTip("<b>" + ToggleButtonWidget::tr("Solid Land") + "</b>:<br />" + tr("Land can not be destroyed!"));
+    TBW_solid->setToolTip("<b>" + ToggleButtonWidget::tr("Solid Land") + "</b>");
+    TBW_solid->setWhatsThis(tr("Land can not be destroyed!"));
     glGMLayout->addWidget(TBW_solid,0,2,1,1);
 
     TBW_border = new ToggleButtonWidget(gbGameModes, ":/res/btnBorder at 2x.png");
-    TBW_border->setToolTip("<b>" + ToggleButtonWidget::tr("Add Border") + "</b>:<br />" + tr("Add an indestructible border around the terrain"));
+    TBW_border->setToolTip("<b>" + ToggleButtonWidget::tr("Add Border") + "</b>");
+    TBW_border->setWhatsThis(tr("Add an indestructible border around the terrain"));
     glGMLayout->addWidget(TBW_border,0,3,1,1);
 
     TBW_lowGravity = new ToggleButtonWidget(gbGameModes, ":/res/btnLowGravity at 2x.png");
-    TBW_lowGravity->setToolTip("<b>" + ToggleButtonWidget::tr("Low Gravity") + "</b>:<br />" + tr("Lower gravity"));
+    TBW_lowGravity->setToolTip("<b>" + ToggleButtonWidget::tr("Low Gravity") + "</b>");
+    TBW_lowGravity->setWhatsThis(tr("Lower gravity"));
     glGMLayout->addWidget(TBW_lowGravity,0,4,1,1);
 
     TBW_laserSight = new ToggleButtonWidget(gbGameModes, ":/res/btnLaserSight at 2x.png");
-    TBW_laserSight->setToolTip("<b>" + ToggleButtonWidget::tr("Laser Sight") + "</b>:<br />" + tr("Assisted aiming with laser sight"));
+    TBW_laserSight->setToolTip("<b>" + ToggleButtonWidget::tr("Laser Sight") + "</b>");
+    TBW_laserSight->setWhatsThis(tr("Assisted aiming with laser sight"));
     glGMLayout->addWidget(TBW_laserSight,1,0,1,1);
 
     TBW_invulnerable = new ToggleButtonWidget(gbGameModes, ":/res/btnInvulnerable at 2x.png");
-    TBW_invulnerable->setToolTip("<b>" + ToggleButtonWidget::tr("Invulnerable") + "</b>:<br />" + tr("All hogs have a personal forcefield"));
+    TBW_invulnerable->setToolTip("<b>" + ToggleButtonWidget::tr("Invulnerable") + "</b>");
+    TBW_invulnerable->setWhatsThis(tr("All hogs have a personal forcefield"));
     glGMLayout->addWidget(TBW_invulnerable,1,1,1,1);
 
     TBW_resethealth = new ToggleButtonWidget(gbGameModes, ":/res/btnResetHealth at 2x.png");
-    TBW_resethealth->setToolTip("<b>" + ToggleButtonWidget::tr("Reset Health") + "</b>:<br />" + tr("All (living) hedgehogs are fully restored at the end of turn"));
+    TBW_resethealth->setToolTip("<b>" + ToggleButtonWidget::tr("Reset Health") + "</b>");
+    TBW_resethealth->setWhatsThis(tr("All (living) hedgehogs are fully restored at the end of turn"));
     glGMLayout->addWidget(TBW_resethealth,1,2,1,1);
 
     TBW_vampiric = new ToggleButtonWidget(gbGameModes, ":/res/btnVampiric at 2x.png");
-    TBW_vampiric->setToolTip("<b>" + ToggleButtonWidget::tr("Vampirism") + "</b>:<br />" + tr("Gain 80% of the damage you do back in health"));
+    TBW_vampiric->setToolTip("<b>" + ToggleButtonWidget::tr("Vampirism") + "</b>");
+    TBW_vampiric->setWhatsThis(tr("Gain 80% of the damage you do back in health"));
     glGMLayout->addWidget(TBW_vampiric,1,3,1,1);
 
     TBW_karma = new ToggleButtonWidget(gbGameModes, ":/res/btnKarma at 2x.png");
-    TBW_karma->setToolTip("<b>" + ToggleButtonWidget::tr("Karma") + "</b>:<br />" + tr("Share your opponents pain, share their damage"));
+    TBW_karma->setToolTip("<b>" + ToggleButtonWidget::tr("Karma") + "</b>");
+    TBW_karma->setWhatsThis(tr("Share your opponents pain, share their damage"));
     glGMLayout->addWidget(TBW_karma,1,4,1,1);
 
     TBW_artillery = new ToggleButtonWidget(gbGameModes, ":/res/btnArtillery at 2x.png");
-    TBW_artillery->setToolTip("<b>" + ToggleButtonWidget::tr("Artillery") + "</b>:<br />" + tr("Your hogs are unable to move, put your artillery skills to the test"));
+    TBW_artillery->setToolTip("<b>" + ToggleButtonWidget::tr("Artillery") + "</b>");
+    TBW_artillery->setWhatsThis(tr("Your hogs are unable to move, put your artillery skills to the test"));
     glGMLayout->addWidget(TBW_artillery,2,0,1,1);
 
     TBW_randomorder = new ToggleButtonWidget(gbGameModes, ":/res/btnRandomOrder at 2x.png");
-    TBW_randomorder->setToolTip("<b>" + ToggleButtonWidget::tr("Random Order") + "</b>:<br />" + tr("Order of play is random instead of in room order."));
+    TBW_randomorder->setToolTip("<b>" + ToggleButtonWidget::tr("Random Order") + "</b>");
+    TBW_randomorder->setWhatsThis(tr("Order of play is random instead of in room order."));
     glGMLayout->addWidget(TBW_randomorder,2,1,1,1);
 
     TBW_king = new ToggleButtonWidget(gbGameModes, ":/res/btnKing at 2x.png");
-    TBW_king->setToolTip("<b>" + ToggleButtonWidget::tr("King") + "</b>:<br />" + tr("Play with a King. If he dies, your side dies."));
+    TBW_king->setToolTip("<b>" + ToggleButtonWidget::tr("King") + "</b>");
+    TBW_king->setWhatsThis(tr("Play with a King. If he dies, your side dies."));
     glGMLayout->addWidget(TBW_king,2,2,1,1);
 
     TBW_placehog = new ToggleButtonWidget(gbGameModes, ":/res/btnPlaceHog at 2x.png");
-    TBW_placehog->setToolTip("<b>" + ToggleButtonWidget::tr("Place Hedgehogs") + "</b>:<br />" + tr("Take turns placing your hedgehogs before the start of play."));
+    TBW_placehog->setToolTip("<b>" + ToggleButtonWidget::tr("Place Hedgehogs") + "</b>");
+    TBW_placehog->setWhatsThis(tr("Take turns placing your hedgehogs before the start of play."));
     glGMLayout->addWidget(TBW_placehog,2,3,1,1);
 
     TBW_sharedammo = new ToggleButtonWidget(gbGameModes, ":/res/btnSharedAmmo at 2x.png");
-    TBW_sharedammo->setToolTip("<b>" + ToggleButtonWidget::tr("Clan Shares Ammo") + "</b>:<br />" + tr("Ammo is shared between all teams that share a colour."));
+    TBW_sharedammo->setToolTip("<b>" + ToggleButtonWidget::tr("Clan Shares Ammo") + "</b>");
+    TBW_sharedammo->setWhatsThis(tr("Ammo is shared between all teams that share a colour."));
     glGMLayout->addWidget(TBW_sharedammo,2,4,1,1);
 
     TBW_disablegirders = new ToggleButtonWidget(gbGameModes, ":/res/btnDisableGirders at 2x.png");
-    TBW_disablegirders->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Girders") + "</b>:<br />" + tr("Disable girders when generating random maps."));
+    TBW_disablegirders->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Girders") + "</b>");
+    TBW_disablegirders->setWhatsThis(tr("Disable girders when generating random maps."));
     glGMLayout->addWidget(TBW_disablegirders,3,0,1,1);
 
     TBW_disablelandobjects = new ToggleButtonWidget(gbGameModes, ":/res/btnDisableLandObjects at 2x.png");
-    TBW_disablelandobjects->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Land Objects") + "</b>:<br />" + tr("Disable land objects when generating random maps."));
+    TBW_disablelandobjects->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Land Objects") + "</b>");
+    TBW_disablelandobjects->setWhatsThis(tr("Disable land objects when generating random maps."));
     glGMLayout->addWidget(TBW_disablelandobjects,3,1,1,1);
 
     TBW_aisurvival = new ToggleButtonWidget(gbGameModes, ":/res/btnAISurvival at 2x.png");
-    TBW_aisurvival->setToolTip("<b>" + ToggleButtonWidget::tr("AI Survival Mode") + "</b>:<br />" + tr("AI respawns on death."));
+    TBW_aisurvival->setToolTip("<b>" + ToggleButtonWidget::tr("AI Survival Mode") + "</b>");
+    TBW_aisurvival->setWhatsThis(tr("AI respawns on death."));
     glGMLayout->addWidget(TBW_aisurvival,3,2,1,1);
 
     TBW_infattack = new ToggleButtonWidget(gbGameModes, ":/res/btnInfAttack at 2x.png");
-    TBW_infattack->setToolTip("<b>" + ToggleButtonWidget::tr("Unlimited Attacks") + "</b>:<br />" + tr("Attacking does not end your turn."));
+    TBW_infattack->setToolTip("<b>" + ToggleButtonWidget::tr("Unlimited Attacks") + "</b>");
+    TBW_infattack->setWhatsThis(tr("Attacking does not end your turn."));
     glGMLayout->addWidget(TBW_infattack,3,3,1,1);
 
     TBW_resetweps = new ToggleButtonWidget(gbGameModes, ":/res/btnResetWeps at 2x.png");
-    TBW_resetweps->setToolTip("<b>" + ToggleButtonWidget::tr("Reset Weapons") + "</b>:<br />" + tr("Weapons are reset to starting values each turn."));
+    TBW_resetweps->setToolTip("<b>" + ToggleButtonWidget::tr("Reset Weapons") + "</b>");
+    TBW_resetweps->setWhatsThis(tr("Weapons are reset to starting values each turn."));
     glGMLayout->addWidget(TBW_resetweps,3,4,1,1);
 
     TBW_perhogammo = new ToggleButtonWidget(gbGameModes, ":/res/btnPerHogAmmo at 2x.png");
-    TBW_perhogammo->setToolTip("<b>" + ToggleButtonWidget::tr("Per Hedgehog Ammo") + "</b>:<br />" + tr("Each hedgehog has its own ammo. It does not share with the team."));
+    TBW_perhogammo->setToolTip("<b>" + ToggleButtonWidget::tr("Per Hedgehog Ammo") + "</b>");
+    TBW_perhogammo->setWhatsThis(tr("Each hedgehog has its own ammo. It does not share with the team."));
     glGMLayout->addWidget(TBW_perhogammo,4,0,1,1);
 
     TBW_nowind = new ToggleButtonWidget(gbGameModes, ":/res/btnNoWind at 2x.png");
-    TBW_nowind->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Wind") + "</b>:<br />" + tr("You will not have to worry about wind anymore."));
+    TBW_nowind->setToolTip("<b>" + ToggleButtonWidget::tr("Disable Wind") + "</b>");
+    TBW_nowind->setWhatsThis(tr("You will not have to worry about wind anymore."));
     glGMLayout->addWidget(TBW_nowind,4,1,1,1);
 
     TBW_morewind = new ToggleButtonWidget(gbGameModes, ":/res/btnMoreWind at 2x.png");
-    TBW_morewind->setToolTip("<b>" + ToggleButtonWidget::tr("More Wind") + "</b>:<br />" + tr("Wind will affect almost everything."));
+    TBW_morewind->setToolTip("<b>" + ToggleButtonWidget::tr("More Wind") + "</b>");
+    TBW_morewind->setWhatsThis(tr("Wind will affect almost everything."));
     glGMLayout->addWidget(TBW_morewind,4,2,1,1);
 
     TBW_tagteam = new ToggleButtonWidget(gbGameModes, ":/res/btnTagTeam at 2x.png");
-    TBW_tagteam->setToolTip("<b>" + ToggleButtonWidget::tr("Tag Team") + "</b>:<br />" + tr("Teams in each clan take successive turns sharing their turn time."));
+    TBW_tagteam->setToolTip("<b>" + ToggleButtonWidget::tr("Tag Team") + "</b>");
+    TBW_tagteam->setWhatsThis(tr("Teams in each clan take successive turns sharing their turn time."));
     glGMLayout->addWidget(TBW_tagteam,4,3,1,1);
 
     TBW_bottomborder = new ToggleButtonWidget(gbGameModes, ":/res/btnBottomBorder at 2x.png");
-    TBW_bottomborder->setToolTip("<b>" + ToggleButtonWidget::tr("Add Bottom Border") + "</b>:<br />" + tr("Add an indestructible border along the bottom"));
+    TBW_bottomborder->setToolTip("<b>" + ToggleButtonWidget::tr("Add Bottom Border") + "</b>");
+    TBW_bottomborder->setWhatsThis(tr("Add an indestructible border along the bottom"));
     glGMLayout->addWidget(TBW_bottomborder,4,4,1,1);
 
 
@@ -381,7 +406,7 @@ QLayout * PageScheme::bodyLayoutDefinition()
     SB_GetAwayTime->setValue(100);
     SB_GetAwayTime->setSingleStep(25);
     glBSLayout->addWidget(SB_GetAwayTime,14,2,1,1);
- 
+
     l = new QLabel(gbBasicSettings);
     l->setText(QLabel::tr("Scheme Name:"));
 
@@ -470,7 +495,7 @@ void PageScheme::setModel(QAbstractItemModel * model)
     mapper->addMapping(SB_WaterRise, 37);
     mapper->addMapping(SB_HealthDecrease, 38);
     mapper->addMapping(SB_RopeModifier, 39);
-	mapper->addMapping(SB_GetAwayTime, 40);
+    mapper->addMapping(SB_GetAwayTime, 40);
 
     mapper->toFirst();
 }
@@ -491,11 +516,30 @@ void PageScheme::copyRow()
 
 void PageScheme::deleteRow()
 {
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Schemes"), QMessageBox::tr("Really delete this game scheme?"), QMessageBox::Ok | QMessageBox::Cancel);
-
-    if (reallyDelete.exec() == QMessageBox::Ok) {
-        QAbstractItemModel * model = mapper->model();
-        model->removeRow(selectScheme->currentIndex());
+    int numberOfDefaultSchemes = ((AmmoSchemeModel*)mapper->model())->numberOfDefaultSchemes;
+    if (selectScheme->currentIndex() < numberOfDefaultSchemes)
+    {
+        QMessageBox deniedMsg(this);
+        deniedMsg.setIcon(QMessageBox::Warning);
+        deniedMsg.setWindowTitle(QMessageBox::tr("Schemes - Warning"));
+        deniedMsg.setText(QMessageBox::tr("Cannot delete default scheme '%1'!").arg(selectScheme->currentText()));
+        deniedMsg.setWindowModality(Qt::WindowModal);
+        deniedMsg.exec();
+    }
+    else
+    {
+        QMessageBox reallyDeleteMsg(this);
+        reallyDeleteMsg.setIcon(QMessageBox::Question);
+        reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Schemes - Are you sure?"));
+        reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to delete the game scheme '%1'?").arg(selectScheme->currentText()));
+        reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+        reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+        if (reallyDeleteMsg.exec() == QMessageBox::Ok)
+        {
+            QAbstractItemModel * model = mapper->model();
+            model->removeRow(selectScheme->currentIndex());
+        }
     }
 }
 
diff --git a/QTfrontend/ui/page/pagescheme.h b/QTfrontend/ui/page/pagescheme.h
index d2bb74d..615f5cf 100644
--- a/QTfrontend/ui/page/pagescheme.h
+++ b/QTfrontend/ui/page/pagescheme.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,79 +26,78 @@ class FreqSpinBox;
 
 class PageScheme : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageScheme(QWidget* parent = 0);
+    public:
+        PageScheme(QWidget* parent = 0);
 
-    QPushButton * BtnCopy;
-    QPushButton * BtnNew;
-    QPushButton * BtnDelete;
-    QPushButton * btnSave;
-    QComboBox * selectScheme;
+        QPushButton * BtnCopy;
+        QPushButton * BtnNew;
+        QPushButton * BtnDelete;
+        QComboBox * selectScheme;
 
-    void setModel(QAbstractItemModel * model);
+        void setModel(QAbstractItemModel * model);
 
-public slots:
-    void newRow();
-    void copyRow();
-    void deleteRow();
+    public slots:
+        void newRow();
+        void copyRow();
+        void deleteRow();
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
-private:
-    QDataWidgetMapper * mapper;
-    ToggleButtonWidget * TBW_mode_Forts;
-    ToggleButtonWidget * TBW_teamsDivide;
-    ToggleButtonWidget * TBW_solid;
-    ToggleButtonWidget * TBW_border;
-    ToggleButtonWidget * TBW_lowGravity;
-    ToggleButtonWidget * TBW_laserSight;
-    ToggleButtonWidget * TBW_invulnerable;
-    ToggleButtonWidget * TBW_resethealth;
-    ToggleButtonWidget * TBW_vampiric;
-    ToggleButtonWidget * TBW_karma;
-    ToggleButtonWidget * TBW_artillery;
-    ToggleButtonWidget * TBW_randomorder;
-    ToggleButtonWidget * TBW_king;
-    ToggleButtonWidget * TBW_placehog;
-    ToggleButtonWidget * TBW_sharedammo;
-    ToggleButtonWidget * TBW_disablegirders;
-    ToggleButtonWidget * TBW_disablelandobjects;
-    ToggleButtonWidget * TBW_aisurvival;
-    ToggleButtonWidget * TBW_infattack;
-    ToggleButtonWidget * TBW_resetweps;
-    ToggleButtonWidget * TBW_perhogammo;
-    ToggleButtonWidget * TBW_nowind;
-    ToggleButtonWidget * TBW_morewind;
-    ToggleButtonWidget * TBW_tagteam;
-    ToggleButtonWidget * TBW_bottomborder;
+    private:
+        QDataWidgetMapper * mapper;
+        ToggleButtonWidget * TBW_mode_Forts;
+        ToggleButtonWidget * TBW_teamsDivide;
+        ToggleButtonWidget * TBW_solid;
+        ToggleButtonWidget * TBW_border;
+        ToggleButtonWidget * TBW_lowGravity;
+        ToggleButtonWidget * TBW_laserSight;
+        ToggleButtonWidget * TBW_invulnerable;
+        ToggleButtonWidget * TBW_resethealth;
+        ToggleButtonWidget * TBW_vampiric;
+        ToggleButtonWidget * TBW_karma;
+        ToggleButtonWidget * TBW_artillery;
+        ToggleButtonWidget * TBW_randomorder;
+        ToggleButtonWidget * TBW_king;
+        ToggleButtonWidget * TBW_placehog;
+        ToggleButtonWidget * TBW_sharedammo;
+        ToggleButtonWidget * TBW_disablegirders;
+        ToggleButtonWidget * TBW_disablelandobjects;
+        ToggleButtonWidget * TBW_aisurvival;
+        ToggleButtonWidget * TBW_infattack;
+        ToggleButtonWidget * TBW_resetweps;
+        ToggleButtonWidget * TBW_perhogammo;
+        ToggleButtonWidget * TBW_nowind;
+        ToggleButtonWidget * TBW_morewind;
+        ToggleButtonWidget * TBW_tagteam;
+        ToggleButtonWidget * TBW_bottomborder;
 
-    QSpinBox * SB_DamageModifier;
-    QSpinBox * SB_TurnTime;
-    QSpinBox * SB_InitHealth;
-    QSpinBox * SB_SuddenDeath;
-    QSpinBox * SB_WaterRise;
-    QSpinBox * SB_HealthDecrease;
-    FreqSpinBox * SB_CaseProb;
-    QSpinBox * SB_HealthCrates;
-    QSpinBox * SB_CrateHealth;
-    QSpinBox * SB_MinesTime;
-    QSpinBox * SB_Mines;
-    QSpinBox * SB_MineDuds;
-    QSpinBox * SB_Explosives;
-    QSpinBox * SB_RopeModifier;
-    QSpinBox * SB_GetAwayTime;
-    QLineEdit * LE_name;
+        QSpinBox * SB_DamageModifier;
+        QSpinBox * SB_TurnTime;
+        QSpinBox * SB_InitHealth;
+        QSpinBox * SB_SuddenDeath;
+        QSpinBox * SB_WaterRise;
+        QSpinBox * SB_HealthDecrease;
+        FreqSpinBox * SB_CaseProb;
+        QSpinBox * SB_HealthCrates;
+        QSpinBox * SB_CrateHealth;
+        QSpinBox * SB_MinesTime;
+        QSpinBox * SB_Mines;
+        QSpinBox * SB_MineDuds;
+        QSpinBox * SB_Explosives;
+        QSpinBox * SB_RopeModifier;
+        QSpinBox * SB_GetAwayTime;
+        QLineEdit * LE_name;
 
-    QGroupBox * gbGameModes;
-    QGroupBox * gbBasicSettings;
+        QGroupBox * gbGameModes;
+        QGroupBox * gbBasicSettings;
 
-private slots:
-    void schemeSelected(int);
+    private slots:
+        void schemeSelected(int);
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pageselectweapon.cpp b/QTfrontend/ui/page/pageselectweapon.cpp
index c4019d0..9a4524a 100644
--- a/QTfrontend/ui/page/pageselectweapon.cpp
+++ b/QTfrontend/ui/page/pageselectweapon.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -53,17 +53,13 @@ QLayout * PageSelectWeapon::footerLayoutDefinition()
     bottomLayout->setColumnStretch(1,1);
     bottomLayout->setColumnStretch(2,1);
 
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, 3, 2, 1, true);
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-
     return bottomLayout;
 }
 
 void PageSelectWeapon::connectSignals()
 {
     connect(BtnDefault, SIGNAL(clicked()), pWeapons, SLOT(setDefault()));
-    connect(btnSave, SIGNAL(clicked()), pWeapons, SLOT(save()));
+    connect(this, SIGNAL(goBack()), pWeapons, SLOT(save()));
     connect(BtnNew, SIGNAL(clicked()), pWeapons, SLOT(newWeaponsName()));
     connect(BtnCopy, SIGNAL(clicked()), pWeapons, SLOT(copy()));
     connect(selectWeaponSet, SIGNAL(currentIndexChanged(const QString&)), pWeapons, SLOT(setWeaponsName(const QString&)));
diff --git a/QTfrontend/ui/page/pageselectweapon.h b/QTfrontend/ui/page/pageselectweapon.h
index ed49861..f0372c8 100644
--- a/QTfrontend/ui/page/pageselectweapon.h
+++ b/QTfrontend/ui/page/pageselectweapon.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,23 +25,22 @@ class SelWeaponWidget;
 
 class PageSelectWeapon : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageSelectWeapon(QWidget* parent = 0);
-
-    QPushButton *btnSave;
-    QPushButton *BtnDefault;
-    QPushButton *BtnDelete;
-    QPushButton *BtnNew;
-    QPushButton *BtnCopy;
-    SelWeaponWidget* pWeapons;
-    QComboBox* selectWeaponSet;
-
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+        Q_OBJECT
+
+    public:
+        PageSelectWeapon(QWidget* parent = 0);
+
+        QPushButton *BtnDefault;
+        QPushButton *BtnDelete;
+        QPushButton *BtnNew;
+        QPushButton *BtnCopy;
+        SelWeaponWidget* pWeapons;
+        QComboBox* selectWeaponSet;
+
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagesingleplayer.cpp b/QTfrontend/ui/page/pagesingleplayer.cpp
index 88f9eb5..f8dfdb3 100644
--- a/QTfrontend/ui/page/pagesingleplayer.cpp
+++ b/QTfrontend/ui/page/pagesingleplayer.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -36,19 +36,23 @@ QLayout * PageSinglePlayer::bodyLayoutDefinition()
 
     topLine->addStretch();
     BtnSimpleGamePage = addButton(":/res/SimpleGame.png", topLine, 0, true);
-    BtnSimpleGamePage->setToolTip(tr("Simple Game (a quick game against the computer, settings are chosen for you)"));
+    BtnSimpleGamePage->setToolTip(tr("Simple Game"));
+    BtnSimpleGamePage->setWhatsThis(tr("Play a quick game against the computer with random settings"));
     topLine->addSpacing(60);
     BtnMultiplayer = addButton(":/res/Multiplayer.png", topLine, 1, true);
-    BtnMultiplayer->setToolTip(tr("Multiplayer (play a hotseat game against your friends, or AI teams)"));
+    BtnMultiplayer->setToolTip(tr("Multiplayer"));
+    BtnMultiplayer->setWhatsThis(tr("Play a hotseat game against your friends, or AI teams"));
     topLine->addStretch();
 
 
     BtnCampaignPage = addButton(":/res/Campaign.png", middleLine, 0, true);
-    BtnCampaignPage->setToolTip(tr("Campaign Mode (...)"));
-    BtnCampaignPage->setVisible(false);
+    BtnCampaignPage->setToolTip(tr("Campaign Mode"));
+    BtnCampaignPage->setWhatsThis(tr("Campaign Mode"));
+    BtnCampaignPage->setVisible(true);
 
     BtnTrainPage = addButton(":/res/Trainings.png", middleLine, 1, true);
-    BtnTrainPage->setToolTip(tr("Training Mode (Practice your skills in a range of training missions)"));
+    BtnTrainPage->setToolTip(tr("Training Mode"));
+    BtnTrainPage->setWhatsThis(tr("Practice your skills in a range of training missions"));
 
     return vLayout;
 }
@@ -59,10 +63,12 @@ QLayout * PageSinglePlayer::footerLayoutDefinition()
     bottomLine->addStretch();
 
     BtnDemos = addButton(":/res/Record.png", bottomLine, 1, true);
-    BtnDemos->setToolTip(tr("Demos (Watch recorded demos)"));
+    BtnDemos->setToolTip(tr("Demos"));
+    BtnDemos->setWhatsThis(tr("Watch recorded demos"));
     BtnLoad = addButton(":/res/Load.png", bottomLine, 2, true);
     BtnLoad->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    BtnLoad->setToolTip(tr("Load (Load a previously saved game)"));
+    BtnLoad->setToolTip(tr("Load"));
+    BtnLoad->setWhatsThis(tr("Load a previously saved game"));
 
     bottomLine->setStretch(1,0);
     bottomLine->setStretch(2,0);
diff --git a/QTfrontend/ui/page/pagesingleplayer.h b/QTfrontend/ui/page/pagesingleplayer.h
index c97b086..cd73c8b 100644
--- a/QTfrontend/ui/page/pagesingleplayer.h
+++ b/QTfrontend/ui/page/pagesingleplayer.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,23 +25,23 @@ class GameCFGWidget;
 
 class PageSinglePlayer : public AbstractPage
 {
-    Q_OBJECT
-
-public:
-    PageSinglePlayer(QWidget* parent = 0);
-
-    QPushButton *BtnSimpleGamePage;
-    QPushButton *BtnTrainPage;
-    QPushButton *BtnCampaignPage;
-    QPushButton *BtnMultiplayer;
-    QPushButton *BtnLoad;
-    QPushButton *BtnDemos;
-    GameCFGWidget *gameCFG;
-
-private:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+        Q_OBJECT
+
+    public:
+        PageSinglePlayer(QWidget* parent = 0);
+
+        QPushButton *BtnSimpleGamePage;
+        QPushButton *BtnTrainPage;
+        QPushButton *BtnCampaignPage;
+        QPushButton *BtnMultiplayer;
+        QPushButton *BtnLoad;
+        QPushButton *BtnDemos;
+        GameCFGWidget *gameCFG;
+
+    private:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 };
 
 #endif
diff --git a/QTfrontend/ui/page/pagetraining.cpp b/QTfrontend/ui/page/pagetraining.cpp
index ea6bf9b..6b66241 100644
--- a/QTfrontend/ui/page/pagetraining.cpp
+++ b/QTfrontend/ui/page/pagetraining.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,7 +28,7 @@
 #include <QSettings>
 
 #include "hwconsts.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #include "pagetraining.h"
 
@@ -40,7 +40,6 @@ QLayout * PageTraining::bodyLayoutDefinition()
 
     // declare start button, caption and description
     btnPreview = formattedButton(":/res/Trainings.png", true);
-    btnPreview->setToolTip(QPushButton::tr("Go!"));
 
     // make both rows equal height
     pageLayout->setRowStretch(0, 1);
@@ -76,6 +75,7 @@ QLayout * PageTraining::bodyLayoutDefinition()
 
     // mission list
     lstMissions = new QListWidget(this);
+    lstMissions->setWhatsThis(tr("Pick the mission or training to play"));
     pageLayout->addWidget(lstMissions, 1, 0, 1, 2); // span 2 columns
 
     // let's not make the list use more space than needed
@@ -90,6 +90,7 @@ QLayout * PageTraining::footerLayoutDefinition()
     QBoxLayout * bottomLayout = new QVBoxLayout();
 
     btnStart = formattedButton(QPushButton::tr("Go!"));
+    btnStart->setWhatsThis(tr("Start fighting"));
     btnStart->setFixedWidth(140);
 
     bottomLayout->addWidget(btnStart);
@@ -114,7 +115,7 @@ PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
 {
     initPage();
 
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     // get locale
     QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini",
@@ -125,12 +126,12 @@ PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
         loc = QLocale::system().name();
 
     QString infoFile = dataMgr.findFileForRead(
-                            QString("Locale/missions_" + loc + ".txt"));
+                           QString("Locale/missions_" + loc + ".txt"));
 
     // if file is non-existant try with language only
     if (!QFile::exists(infoFile))
         infoFile = dataMgr.findFileForRead(QString(
-                "Locale/missions_" + loc.remove(QRegExp("_.*$")) + ".txt"));
+                                               "Locale/missions_" + loc.remove(QRegExp("_.*$")) + ".txt"));
 
     // fallback if file for current locale is non-existant
     if (!QFile::exists(infoFile))
@@ -145,7 +146,7 @@ PageTraining::PageTraining(QWidget* parent) : AbstractPage(parent)
     QStringList missionList = dataMgr.entryList(
                                   "Missions/Training",
                                   QDir::Files, QStringList("*.lua")).
-                                  replaceInStrings(QRegExp("\\.lua$"), "");
+                              replaceInStrings(QRegExp("\\.lua$"), "");
 
     // scripts to lost - TODO: model?
     foreach (const QString & mission, missionList)
@@ -185,15 +186,15 @@ void PageTraining::startSelected()
 
 void PageTraining::updateInfo()
 {
-    HWDataManager & dataMgr = HWDataManager::instance();
+    DataManager & dataMgr = DataManager::instance();
 
     if (lstMissions->currentItem())
     {
         // TODO also use .pngs in userdata folder
         QString thumbFile = dataMgr.findFileForRead(
-                    "Graphics/Missions/Training/" +
-                    lstMissions->currentItem()->data(Qt::UserRole).toString() +
-                    "@2x.png");
+                                "Graphics/Missions/Training/" +
+                                lstMissions->currentItem()->data(Qt::UserRole).toString() +
+                                "@2x.png");
 
         if (QFile::exists(thumbFile))
             btnPreview->setIcon(QIcon(thumbFile));
@@ -201,13 +202,13 @@ void PageTraining::updateInfo()
             btnPreview->setIcon(QIcon(":/res/Trainings.png"));
 
         QString realName = lstMissions->currentItem()->data(
-                           Qt::UserRole).toString();
+                               Qt::UserRole).toString();
 
-        QString caption = m_info->value(realName + ".name", 
-                          lstMissions->currentItem()->text()).toString();
+        QString caption = m_info->value(realName + ".name",
+                                        lstMissions->currentItem()->text()).toString();
 
         QString description = m_info->value(realName + ".desc",
-                              tr("No description available")).toString();
+                                            tr("No description available")).toString();
 
         lblCaption->setText("<h2>" + caption +"</h2>");
         lblDescription->setText(description);
diff --git a/QTfrontend/ui/page/pagetraining.h b/QTfrontend/ui/page/pagetraining.h
index 8d892ef..9f37275 100644
--- a/QTfrontend/ui/page/pagetraining.h
+++ b/QTfrontend/ui/page/pagetraining.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,34 +23,34 @@
 
 class PageTraining : public AbstractPage
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    PageTraining(QWidget* parent = 0);
+    public:
+        PageTraining(QWidget* parent = 0);
 
 
-signals:
-    void startMission(const QString & scriptName);
+    signals:
+        void startMission(const QString & scriptName);
 
 
-protected:
-    QLayout * bodyLayoutDefinition();
-    QLayout * footerLayoutDefinition();
-    void connectSignals();
+    protected:
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
 
 
-private:
-    QPushButton * btnPreview;
-    QPushButton * btnStart;
-    QLabel * lblCaption;
-    QLabel * lblDescription;
-    QListWidget * lstMissions;
-    QSettings * m_info;
+    private:
+        QPushButton * btnPreview;
+        QPushButton * btnStart;
+        QLabel * lblCaption;
+        QLabel * lblDescription;
+        QListWidget * lstMissions;
+        QSettings * m_info;
 
 
-private slots:
-    void startSelected();
-    void updateInfo();
+    private slots:
+        void startSelected();
+        void updateInfo();
 
 };
 
diff --git a/QTfrontend/ui/page/pagevideos.cpp b/QTfrontend/ui/page/pagevideos.cpp
new file mode 100644
index 0000000..c6be006
--- /dev/null
+++ b/QTfrontend/ui/page/pagevideos.cpp
@@ -0,0 +1,1171 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QGridLayout>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QTableWidget>
+#include <QDir>
+#include <QProgressBar>
+#include <QStringList>
+#include <QDesktopServices>
+#include <QUrl>
+#include <QList>
+#include <QMessageBox>
+#include <QHeaderView>
+#include <QKeyEvent>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QFileSystemWatcher>
+#include <QDateTime>
+#include <QRegExp>
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QXmlStreamReader>
+
+#include "hwconsts.h"
+#include "pagevideos.h"
+#include "igbox.h"
+#include "LibavInteraction.h"
+#include "gameuiconfig.h"
+#include "recorder.h"
+#include "ask_quit.h"
+#include "upload_video.h"
+
+static const QSize ThumbnailSize(350, 350*3/5);
+
+// columns in table with list of video files
+enum VideosColumns
+{
+    vcName,
+    vcSize,
+    vcProgress, // either encoding or uploading
+
+    vcNumColumns,
+};
+
+// this class is used for items in first column in file-table
+class VideoItem : public QTableWidgetItem
+{
+    // note: QTableWidgetItem is not Q_OBJECT
+
+    public:
+        VideoItem(const QString& name);
+        ~VideoItem();
+
+        QString name;
+        QString prefix; // original filename without extension
+        QString desc;   // description (duration, resolution, etc...)
+        QString uploadUrl; // http://youtu.be/???????
+        HWRecorder    * pRecorder; // non NULL if file is being encoded
+        QNetworkReply * pUploading; // non NULL if file is being uploaded
+        bool seen; // used when updating directory
+        float lastSizeUpdate;
+        float progress;
+
+        bool ready()
+        { return !pRecorder; }
+
+        QString path()
+        { return cfgdir->absoluteFilePath("Videos/" + name);  }
+};
+
+VideoItem::VideoItem(const QString& name)
+: QTableWidgetItem(name, UserType)
+{
+    this->name = name;
+    pRecorder = NULL;
+    pUploading = NULL;
+    lastSizeUpdate = 0;
+    progress = 0;
+}
+
+VideoItem::~VideoItem()
+{}
+
+QLayout * PageVideos::bodyLayoutDefinition()
+{
+    QGridLayout * pPageLayout = new QGridLayout();
+    pPageLayout->setColumnStretch(0, 1);
+    pPageLayout->setColumnStretch(1, 2);
+    pPageLayout->setRowStretch(0, 1);
+    pPageLayout->setRowStretch(1, 1);
+
+    // options
+    {
+        IconedGroupBox* pOptionsGroup = new IconedGroupBox(this);
+        pOptionsGroup->setIcon(QIcon(":/res/Settings.png")); // FIXME
+        pOptionsGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+        pOptionsGroup->setTitle(QGroupBox::tr("Video recording options"));
+        QGridLayout * pOptLayout = new QGridLayout(pOptionsGroup);
+
+        // label for format
+        QLabel *labelFormat = new QLabel(pOptionsGroup);
+        labelFormat->setText(QLabel::tr("Format"));
+        pOptLayout->addWidget(labelFormat, 0, 0);
+
+        // list of supported formats
+        comboAVFormats = new QComboBox(pOptionsGroup);
+        pOptLayout->addWidget(comboAVFormats, 0, 1, 1, 4);
+        LibavInteraction::instance().fillFormats(comboAVFormats);
+
+        // separator
+        QFrame * hr = new QFrame(pOptionsGroup);
+        hr->setFrameStyle(QFrame::HLine);
+        hr->setLineWidth(3);
+        hr->setFixedHeight(10);
+        pOptLayout->addWidget(hr, 1, 0, 1, 5);
+
+        // label for audio codec
+        QLabel *labelACodec = new QLabel(pOptionsGroup);
+        labelACodec->setText(QLabel::tr("Audio codec"));
+        pOptLayout->addWidget(labelACodec, 2, 0);
+
+        // list of supported audio codecs
+        comboAudioCodecs = new QComboBox(pOptionsGroup);
+        pOptLayout->addWidget(comboAudioCodecs, 2, 1, 1, 3);
+
+        // checkbox 'record audio'
+        checkRecordAudio = new QCheckBox(pOptionsGroup);
+        checkRecordAudio->setText(QCheckBox::tr("Record audio"));
+        pOptLayout->addWidget(checkRecordAudio, 2, 4);
+
+        // separator
+        hr = new QFrame(pOptionsGroup);
+        hr->setFrameStyle(QFrame::HLine);
+        hr->setLineWidth(3);
+        hr->setFixedHeight(10);
+        pOptLayout->addWidget(hr, 3, 0, 1, 5);
+
+        // label for video codec
+        QLabel *labelVCodec = new QLabel(pOptionsGroup);
+        labelVCodec->setText(QLabel::tr("Video codec"));
+        pOptLayout->addWidget(labelVCodec, 4, 0);
+
+        // list of supported video codecs
+        comboVideoCodecs = new QComboBox(pOptionsGroup);
+        pOptLayout->addWidget(comboVideoCodecs, 4, 1, 1, 4);
+
+        // label for resolution
+        QLabel *labelRes = new QLabel(pOptionsGroup);
+        labelRes->setText(QLabel::tr("Resolution"));
+        pOptLayout->addWidget(labelRes, 5, 0);
+
+        // width
+        widthEdit = new QLineEdit(pOptionsGroup);
+        widthEdit->setValidator(new QIntValidator(this));
+        pOptLayout->addWidget(widthEdit, 5, 1);
+
+        // x
+        QLabel *labelX = new QLabel(pOptionsGroup);
+        labelX->setText("X");
+        pOptLayout->addWidget(labelX, 5, 2);
+
+        // height
+        heightEdit = new QLineEdit(pOptionsGroup);
+        heightEdit->setValidator(new QIntValidator(pOptionsGroup));
+        pOptLayout->addWidget(heightEdit, 5, 3);
+
+        // checkbox 'use game resolution'
+        checkUseGameRes = new QCheckBox(pOptionsGroup);
+        checkUseGameRes->setText(QCheckBox::tr("Use game resolution"));
+        pOptLayout->addWidget(checkUseGameRes, 5, 4);
+
+        // label for framerate
+        QLabel *labelFramerate = new QLabel(pOptionsGroup);
+        labelFramerate->setText(QLabel::tr("Framerate"));
+        pOptLayout->addWidget(labelFramerate, 6, 0);
+
+        // framerate
+        framerateBox = new QSpinBox(pOptionsGroup);
+        framerateBox->setRange(1, 200);
+        framerateBox->setSingleStep(1);
+        pOptLayout->addWidget(framerateBox, 6, 1);
+
+        // label for Bitrate
+        QLabel *labelBitrate = new QLabel(pOptionsGroup);
+        labelBitrate->setText(QLabel::tr("Bitrate (Kbps)"));
+        pOptLayout->addWidget(labelBitrate, 6, 2);
+
+        // bitrate
+        bitrateBox = new QSpinBox(pOptionsGroup);
+        bitrateBox->setRange(100, 5000);
+        bitrateBox->setSingleStep(100);
+        pOptLayout->addWidget(bitrateBox, 6, 3);
+
+        // button 'set default options'
+        btnDefaults = new QPushButton(pOptionsGroup);
+        btnDefaults->setText(QPushButton::tr("Set default options"));
+        btnDefaults->setWhatsThis(QPushButton::tr("Restore default coding parameters"));
+        pOptLayout->addWidget(btnDefaults, 7, 0, 1, 5);
+
+        pPageLayout->addWidget(pOptionsGroup, 1, 0);
+    }
+
+    // list of videos
+    {
+        IconedGroupBox* pTableGroup = new IconedGroupBox(this);
+        pTableGroup->setIcon(QIcon(":/res/graphicsicon.png")); // FIXME
+        pTableGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+        pTableGroup->setTitle(QGroupBox::tr("Videos"));
+
+        QStringList columns;
+        columns << tr("Name");
+        columns << tr("Size");
+        columns << "";
+
+        filesTable = new QTableWidget(pTableGroup);
+        filesTable->setColumnCount(vcNumColumns);
+        filesTable->setHorizontalHeaderLabels(columns);
+        filesTable->setSelectionBehavior(QAbstractItemView::SelectRows);
+        filesTable->setSelectionMode(QAbstractItemView::SingleSelection);
+        filesTable->setEditTriggers(QAbstractItemView::SelectedClicked);
+        filesTable->verticalHeader()->hide();
+        filesTable->setMinimumWidth(400);
+
+        QHeaderView * header = filesTable->horizontalHeader();
+        header->setResizeMode(vcName, QHeaderView::ResizeToContents);
+        header->setResizeMode(vcSize, QHeaderView::Fixed);
+        header->resizeSection(vcSize, 100);
+        header->setStretchLastSection(true);
+
+        btnOpenDir = new QPushButton(QPushButton::tr("Open videos directory"), pTableGroup);
+        btnOpenDir->setWhatsThis(QPushButton::tr("Open the video directory in your system"));
+
+        QVBoxLayout *box = new QVBoxLayout(pTableGroup);
+        box->addWidget(filesTable);
+        box->addWidget(btnOpenDir);
+
+        pPageLayout->addWidget(pTableGroup, 0, 1, 2, 1);
+    }
+
+    // description
+    {
+        IconedGroupBox* pDescGroup = new IconedGroupBox(this);
+        pDescGroup->setIcon(QIcon(":/res/graphicsicon.png")); // FIXME
+        pDescGroup->setTitle(QGroupBox::tr("Description"));
+
+        QVBoxLayout* pDescLayout = new QVBoxLayout(pDescGroup);
+        QHBoxLayout* pTopDescLayout = new QHBoxLayout(0);    // picture and text
+        QHBoxLayout* pBottomDescLayout = new QHBoxLayout(0); // buttons
+
+        // label with thumbnail picture
+        labelThumbnail = new QLabel(pDescGroup);
+        labelThumbnail->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+        labelThumbnail->setMaximumSize(ThumbnailSize);
+        labelThumbnail->setStyleSheet(
+                    "QFrame {"
+                    "border: solid;"
+                    "border-width: 3px;"
+                    "border-color: #ffcc00;"
+                    "border-radius: 4px;"
+                    "}" );
+        clearThumbnail();
+        pTopDescLayout->addWidget(labelThumbnail, 2);
+
+        // label with file description
+        labelDesc = new QLabel(pDescGroup);
+        labelDesc->setAlignment(Qt::AlignLeft | Qt::AlignTop);
+        labelDesc->setTextInteractionFlags(Qt::TextSelectableByMouse |
+                                           Qt::TextSelectableByKeyboard	|
+                                           Qt::LinksAccessibleByMouse |
+                                           Qt::LinksAccessibleByKeyboard);
+        labelDesc->setTextFormat(Qt::RichText);
+        labelDesc->setOpenExternalLinks(true);
+        pTopDescLayout->addWidget(labelDesc, 1);
+
+        // buttons: play and delete
+        btnPlay = new QPushButton(QPushButton::tr("Play"), pDescGroup);
+        btnPlay->setEnabled(false);
+        btnPlay->setWhatsThis(QPushButton::tr("Play this video"));
+        pBottomDescLayout->addWidget(btnPlay);
+        btnDelete = new QPushButton(QPushButton::tr("Delete"), pDescGroup);
+        btnDelete->setEnabled(false);
+        btnDelete->setWhatsThis(QPushButton::tr("Delete this video"));
+        pBottomDescLayout->addWidget(btnDelete);
+        btnToYouTube = new QPushButton(QPushButton::tr("Upload to YouTube"), pDescGroup);
+        btnToYouTube->setEnabled(false);
+        btnToYouTube->setWhatsThis(QPushButton::tr("Upload this video to your Youtube account"));
+        pBottomDescLayout->addWidget(btnToYouTube);
+
+        pDescLayout->addStretch(1);
+        pDescLayout->addLayout(pTopDescLayout, 0);
+        pDescLayout->addStretch(1);
+        pDescLayout->addLayout(pBottomDescLayout, 0);
+
+        pPageLayout->addWidget(pDescGroup, 0, 0);
+    }
+
+    return pPageLayout;
+}
+
+QLayout * PageVideos::footerLayoutDefinition()
+{
+    return NULL;
+}
+
+void PageVideos::connectSignals()
+{
+    connect(checkUseGameRes, SIGNAL(stateChanged(int)), this, SLOT(changeUseGameRes(int)));
+    connect(checkRecordAudio, SIGNAL(stateChanged(int)), this, SLOT(changeRecordAudio(int)));
+    connect(comboAVFormats, SIGNAL(currentIndexChanged(int)), this, SLOT(changeAVFormat(int)));
+    connect(btnDefaults, SIGNAL(clicked()), this, SLOT(setDefaultOptions()));
+    connect(filesTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellDoubleClicked(int, int)));
+    connect(filesTable, SIGNAL(cellChanged(int,int)), this, SLOT(cellChanged(int, int)));
+    connect(filesTable, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(currentCellChanged()));
+    connect(btnPlay,   SIGNAL(clicked()), this, SLOT(playSelectedFile()));
+    connect(btnDelete, SIGNAL(clicked()), this, SLOT(deleteSelectedFiles()));
+    connect(btnToYouTube, SIGNAL(clicked()), this, SLOT(uploadToYouTube()));
+    connect(btnOpenDir, SIGNAL(clicked()), this, SLOT(openVideosDirectory()));
+}
+
+PageVideos::PageVideos(QWidget* parent) : AbstractPage(parent),
+    config(0), netManager(0)
+{
+    nameChangedFromCode = false;
+    numRecorders = 0;
+    numUploads = 0;
+    initPage();
+}
+
+void PageVideos::init(GameUIConfig * config)
+{
+    this->config = config;
+
+    QString path = cfgdir->absolutePath() + "/Videos";
+    QFileSystemWatcher * pWatcher = new QFileSystemWatcher(this);
+    pWatcher->addPath(path);
+    connect(pWatcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(updateFileList(const QString &)));
+    updateFileList(path);
+
+    startEncoding(); // this is for videos recorded from demos which were executed directly (without frontend)
+}
+
+// user changed file format, we need to update list of codecs
+void PageVideos::changeAVFormat(int index)
+{
+    // remember selected codecs
+    QString prevVCodec = videoCodec();
+    QString prevACodec = audioCodec();
+
+    // clear lists of codecs
+    comboVideoCodecs->clear();
+    comboAudioCodecs->clear();
+
+    // get list of codecs for specified format
+    LibavInteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
+
+    // disable audio if there is no audio codec
+    if (comboAudioCodecs->count() == 0)
+    {
+        checkRecordAudio->setChecked(false);
+        checkRecordAudio->setEnabled(false);
+    }
+    else
+        checkRecordAudio->setEnabled(true);
+
+    // restore selected codecs if possible
+    int iVCodec = comboVideoCodecs->findData(prevVCodec);
+    if (iVCodec != -1)
+        comboVideoCodecs->setCurrentIndex(iVCodec);
+    int iACodec = comboAudioCodecs->findData(prevACodec);
+    if (iACodec != -1)
+        comboAudioCodecs->setCurrentIndex(iACodec);
+}
+
+// user switched checkbox 'use game resolution'
+void PageVideos::changeUseGameRes(int state)
+{
+    if (state && config)
+    {
+        // set resolution to game resolution
+        QRect resolution = config->vid_Resolution();
+        widthEdit->setText(QString::number(resolution.width()));
+        heightEdit->setText(QString::number(resolution.height()));
+    }
+    widthEdit->setEnabled(!state);
+    heightEdit->setEnabled(!state);
+}
+
+// user switched checkbox 'record audio'
+void PageVideos::changeRecordAudio(int state)
+{
+    comboAudioCodecs->setEnabled(!!state);
+}
+
+void PageVideos::setDefaultCodecs()
+{
+    // VLC should be able to handle any of these configurations
+    // Quicktime X only opens the first one
+    // Windows Media Player TODO
+    if (tryCodecs("mp4", "libx264", "aac"))
+        return;
+    if (tryCodecs("mp4", "libx264", "libfaac"))
+        return;
+    if (tryCodecs("mp4", "libx264", "libmp3lame"))
+        return;
+    if (tryCodecs("mp4", "libx264", "mp2"))
+        return;
+    if (tryCodecs("avi", "libxvid", "libmp3lame"))
+        return;
+    if (tryCodecs("avi", "libxvid", "ac3_fixed"))
+        return;
+    if (tryCodecs("avi", "libxvid", "mp2"))
+        return;
+    if (tryCodecs("avi", "mpeg4", "libmp3lame"))
+        return;
+    if (tryCodecs("avi", "mpeg4", "ac3_fixed"))
+        return;
+    if (tryCodecs("avi", "mpeg4", "mp2"))
+        return;
+
+    // this shouldn't happen, just in case
+    if (tryCodecs("ogg", "libtheora", "libvorbis"))
+        return;
+    tryCodecs("ogg", "libtheora", "flac");
+}
+
+void PageVideos::setDefaultOptions()
+{
+    framerateBox->setValue(30);
+    bitrateBox->setValue(1000);
+    checkRecordAudio->setChecked(true);
+    checkUseGameRes->setChecked(true);
+    setDefaultCodecs();
+}
+
+bool PageVideos::tryCodecs(const QString & format, const QString & vcodec, const QString & acodec)
+{
+    // first we should change format
+    int iFormat = comboAVFormats->findData(format);
+    if (iFormat == -1)
+        return false;
+    comboAVFormats->setCurrentIndex(iFormat);
+    // format was changed, so lists of codecs were automatically updated to codecs supported by this format
+
+    // try to find video codec
+    int iVCodec = comboVideoCodecs->findData(vcodec);
+    if (iVCodec == -1)
+        return false;
+    comboVideoCodecs->setCurrentIndex(iVCodec);
+
+    // try to find audio codec
+    int iACodec = comboAudioCodecs->findData(acodec);
+    if (iACodec == -1 && checkRecordAudio->isChecked())
+        return false;
+    if (iACodec != -1)
+        comboAudioCodecs->setCurrentIndex(iACodec);
+
+    return true;
+}
+
+// get file size as string
+static QString FileSizeStr(const QString & path)
+{
+    quint64 size = QFileInfo(path).size();
+
+    quint64 KiB = 1024;
+    quint64 MiB = 1024*KiB;
+    quint64 GiB = 1024*MiB;
+    QString sizeStr;
+    if (size >= GiB)
+        return QString("%1 GiB").arg(QString::number(float(size)/GiB, 'f', 2));
+    if (size >= MiB)
+        return QString("%1 MiB").arg(QString::number(float(size)/MiB, 'f', 2));
+     if (size >= KiB)
+        return QString("%1 KiB").arg(QString::number(float(size)/KiB, 'f', 2));
+    return PageVideos::tr("%1 bytes", "", size).arg(QString::number(size));
+}
+
+// set file size in file list in specified row
+void PageVideos::updateSize(int row)
+{
+    VideoItem * item = nameItem(row);
+    QString path = item->ready()? item->path() : cfgdir->absoluteFilePath("VideoTemp/" + item->pRecorder->name);
+    filesTable->item(row, vcSize)->setText(FileSizeStr(path));
+}
+
+// There is a button 'Open videos dir', so it is possible that user will open
+// this dir and rename/delete some files there, so we should handle this.
+void PageVideos::updateFileList(const QString & path)
+{
+    // mark all files as non seen
+    int numRows = filesTable->rowCount();
+    for (int i = 0; i < numRows; i++)
+        nameItem(i)->seen = false;
+
+    QStringList files = QDir(path).entryList(QDir::Files);
+    foreach (const QString & name, files)
+    {
+        int row = -1;
+        foreach (QTableWidgetItem * item, filesTable->findItems(name, Qt::MatchExactly))
+        {
+            if (item->type() != QTableWidgetItem::UserType || !((VideoItem*)item)->ready())
+                continue;
+            row = item->row();
+            break;
+        }
+        if (row == -1)
+            row = appendRow(name);
+        VideoItem * item = nameItem(row);
+        item->seen = true;
+        item->desc = "";
+        updateSize(row);
+    }
+
+    // remove all non seen files
+    for (int i = 0; i < filesTable->rowCount();)
+    {
+        VideoItem * item = nameItem(i);
+        if (item->ready() && !item->seen)
+            filesTable->removeRow(i);
+        else
+            i++;
+    }
+}
+
+void PageVideos::addRecorder(HWRecorder* pRecorder)
+{
+    int row = appendRow(pRecorder->name);
+    VideoItem * item = nameItem(row);
+    item->pRecorder = pRecorder;
+    pRecorder->item = item;
+
+    // add progress bar
+    QProgressBar * progressBar = new QProgressBar(filesTable);
+    progressBar->setMinimum(0);
+    progressBar->setMaximum(10000);
+    progressBar->setValue(0);
+    connect(pRecorder, SIGNAL(onProgress(float)), this, SLOT(updateProgress(float)));
+    connect(pRecorder, SIGNAL(encodingFinished(bool)), this, SLOT(encodingFinished(bool)));
+    filesTable->setCellWidget(row, vcProgress, progressBar);
+
+    numRecorders++;
+}
+
+void PageVideos::setProgress(int row, VideoItem* item, float value)
+{
+    QProgressBar * progressBar = (QProgressBar*)filesTable->cellWidget(row, vcProgress);
+    progressBar->setValue(value*10000);
+    progressBar->setFormat(QString("%1%").arg(value*100, 0, 'f', 2));
+    item->progress = value;
+}
+
+void PageVideos::updateProgress(float value)
+{
+    HWRecorder * pRecorder = (HWRecorder*)sender();
+    VideoItem * item = pRecorder->item;
+    int row = filesTable->row(item);
+
+    // update file size every percent
+    if (value - item->lastSizeUpdate > 0.01)
+    {
+        updateSize(row);
+        item->lastSizeUpdate = value;
+    }
+
+    setProgress(row, item, value);
+}
+
+void PageVideos::encodingFinished(bool success)
+{
+    numRecorders--;
+
+    HWRecorder * pRecorder = (HWRecorder*)sender();
+    VideoItem * item = (VideoItem*)pRecorder->item;
+    int row = filesTable->row(item);
+
+    if (success)
+    {
+        // move file to destination
+        success = cfgdir->rename("VideoTemp/" + pRecorder->name, "Videos/" + item->name);
+        if (!success)
+        {
+            // unable to rename for some reason (maybe user entered incorrect name);
+            // try to use temp name instead.
+            success = cfgdir->rename("VideoTemp/" + pRecorder->name, "Videos/" + pRecorder->name);
+            if (success)
+                setName(item, pRecorder->name);
+        }
+    }
+
+    if (!success)
+    {
+        filesTable->removeRow(row);
+        return;
+    }
+
+    filesTable->setCellWidget(row, vcProgress, NULL); // remove progress bar
+    item->pRecorder = NULL;
+    updateSize(row);
+    updateDescription();
+}
+
+void PageVideos::cellDoubleClicked(int row, int column)
+{
+    Q_UNUSED(column);
+
+    play(row);
+}
+
+void PageVideos::cellChanged(int row, int column)
+{
+    // user can only edit name
+    if (column != vcName || nameChangedFromCode)
+        return;
+
+    // user has edited filename, so we should rename the file
+    VideoItem * item = nameItem(row);
+    QString oldName = item->name;
+    QString newName = item->text();
+    if (!newName.contains('.')) // user forgot an extension
+    {
+        // restore old extension
+        int pt = oldName.lastIndexOf('.');
+        if (pt != -1)
+        {
+            newName += oldName.right(oldName.length() - pt);
+            setName(item, newName);
+        }
+    }
+#ifdef Q_WS_WIN
+    // there is a bug in qt, QDir::rename() doesn't fail on such names but damages files
+    if (newName.contains(QRegExp("[\"*:<>?\\/|]")))
+    {
+        setName(item, oldName);
+        return;
+    }
+#endif
+    if (item->ready() && !cfgdir->rename("Videos/" + oldName, "Videos/" + newName))
+    {
+        // unable to rename for some reason (maybe user entered incorrect name),
+        // therefore restore old name in cell
+        setName(item, oldName);
+        return;
+    }
+    item->name = newName;
+    updateDescription();
+}
+
+void PageVideos::setName(VideoItem * item, const QString & newName)
+{
+    nameChangedFromCode = true;
+    item->setText(newName);
+    nameChangedFromCode = false;
+    item->name = newName;
+}
+
+int PageVideos::appendRow(const QString & name)
+{
+    int row = filesTable->rowCount();
+    filesTable->setRowCount(row+1);
+
+    // add 'name' item
+    QTableWidgetItem * item = new VideoItem(name);
+    item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
+    nameChangedFromCode = true;
+    filesTable->setItem(row, vcName, item);
+    nameChangedFromCode = false;
+
+    // add 'size' item
+    item = new QTableWidgetItem();
+    item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
+    item->setTextAlignment(Qt::AlignRight);
+    filesTable->setItem(row, vcSize, item);
+
+    // add 'progress' item
+    item = new QTableWidgetItem();
+    item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
+    filesTable->setItem(row, vcProgress, item);
+
+    return row;
+}
+
+VideoItem* PageVideos::nameItem(int row)
+{
+    return (VideoItem*)filesTable->item(row, vcName);
+}
+
+void PageVideos::clearThumbnail()
+{
+    // add empty (transparent) image for proper sizing
+    QPixmap pic(ThumbnailSize);
+    pic.fill(QColor(0,0,0,0));
+    labelThumbnail->setPixmap(pic);
+}
+
+void PageVideos::updateDescription()
+{
+    VideoItem * item = nameItem(filesTable->currentRow());
+    if (!item)
+    {
+        // nothing is selected => clear description and return
+        labelDesc->clear();
+        clearThumbnail();
+        btnPlay->setEnabled(false);
+        btnDelete->setEnabled(false);
+        btnToYouTube->setEnabled(false);
+        return;
+    }
+
+    btnPlay->setEnabled(item->ready());
+    btnToYouTube->setEnabled(item->ready());
+    btnDelete->setEnabled(true);
+    btnDelete->setText(item->ready()? QPushButton::tr("Delete") :  QPushButton::tr("Cancel"));
+    btnToYouTube->setText(item->pUploading? QPushButton::tr("Cancel uploading") :  QPushButton::tr("Upload to YouTube"));
+
+    // construct string with desctiption of this file to display it
+    QString desc = item->name + "\n\n";
+
+    if (!item->ready())
+        desc += tr("(in progress...)");
+    else
+    {
+        QString path = item->path();
+        desc += tr("Date: ") + QFileInfo(path).created().toString(Qt::DefaultLocaleLongDate) + '\n';
+        desc += tr("Size: ") + FileSizeStr(path) + '\n';
+        if (item->desc.isEmpty())
+        {
+            // Extract description from file;
+            // It will contain duration, resolution, etc and also comment added by hwengine.
+            item->desc = LibavInteraction::instance().getFileInfo(path);
+
+            // extract prefix (original name) from description (it is enclosed in prefix[???]prefix)
+            int prefixBegin = item->desc.indexOf("prefix[");
+            int prefixEnd   = item->desc.indexOf("]prefix");
+            if (prefixBegin != -1 && prefixEnd != -1)
+            {
+                item->prefix = item->desc.mid(prefixBegin + 7, prefixEnd - (prefixBegin + 7));
+                item->desc.remove(prefixBegin, prefixEnd + 7 - prefixBegin);
+            }
+        }
+        desc += item->desc + '\n';
+    }
+
+    if (item->prefix.isEmpty())
+    {
+        // try to extract prefix from file name instead
+        if (item->ready())
+            item->prefix = item->name;
+        else
+            item->prefix = item->pRecorder->name;
+
+        // remove extension
+        int pt = item->prefix.lastIndexOf('.');
+        if (pt != -1)
+            item->prefix.truncate(pt);
+    }
+
+    if (item->ready() && item->uploadUrl.isEmpty())
+    {
+        // try to load url from file
+        QFile * file = new QFile(cfgdir->absoluteFilePath("VideoTemp/" + item->prefix + "-url.txt"), this);
+        if (!file->open(QIODevice::ReadOnly))
+            item->uploadUrl = "no";
+        else
+        {
+            QByteArray data = file->readAll();
+            file->close();
+            item->uploadUrl = QString::fromUtf8(data.data());
+        }
+    }
+    if (item->uploadUrl != "no")
+        desc += QString("<a href=\"%1\" style=\"color: white;\">%1</a>").arg(item->uploadUrl);
+    desc.replace("\n", "<br/>");
+
+    labelDesc->setText(desc);
+
+    if (!item->prefix.isEmpty())
+    {
+        QString thumbName = cfgdir->absoluteFilePath("VideoTemp/" + item->prefix);
+        QPixmap pic;
+        if (pic.load(thumbName + ".png") || pic.load(thumbName + ".bmp"))
+        {
+            if (pic.height()*ThumbnailSize.width() > pic.width()*ThumbnailSize.height())
+                pic = pic.scaledToWidth(ThumbnailSize.width());
+            else
+                pic = pic.scaledToHeight(ThumbnailSize.height());
+            labelThumbnail->setPixmap(pic);
+        }
+        else
+            clearThumbnail();
+    }
+}
+
+// user selected another cell, so we should change description
+void PageVideos::currentCellChanged()
+{
+    updateDescription();
+}
+
+// open video file in external media player
+void PageVideos::play(int row)
+{
+    VideoItem * item = nameItem(row);
+    if (item && item->ready())
+        QDesktopServices::openUrl(QUrl("file:///" + QDir::toNativeSeparators(item->path())));
+}
+
+void PageVideos::playSelectedFile()
+{
+    int index = filesTable->currentRow();
+    if (index != -1)
+        play(index);
+}
+
+void PageVideos::deleteSelectedFiles()
+{
+    int index = filesTable->currentRow();
+    if (index == -1)
+        return;
+
+    VideoItem * item = nameItem(index);
+    if (!item)
+        return;
+
+    // ask user if (s)he is serious
+    QMessageBox reallyDeleteMsg(this);
+    reallyDeleteMsg.setIcon(QMessageBox::Question);
+    reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Videos - Are you sure?"));
+    reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to delete the video '%1'?").arg(item->name));
+    reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+    reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+    if (reallyDeleteMsg.exec() != QMessageBox::Ok)
+        return;
+
+    // remove
+    if (!item->ready())
+        item->pRecorder->deleteLater();
+    else
+    {
+        cfgdir->remove("Videos/" + item->name);
+        // we have no idea whether screenshot is going to be bmp or png so let's delete both
+        cfgdir->remove("VideoTemp/" + item->prefix + ".png");
+        cfgdir->remove("VideoTemp/" + item->prefix + ".bmp");
+    }
+
+// this code is for removing several files when multiple selection is enabled
+#if 0
+    QList<QTableWidgetItem*> items = filesTable->selectedItems();
+    int num = items.size() / vcNumColumns;
+    if (num == 0)
+        return;
+
+    // ask user if (s)he is serious
+    QMessageBox reallyDeleteMsg(this);
+    reallyDeleteMsg.setIcon(QMessageBox::Question);
+    reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Videos - Are you sure?"));
+    reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to remove %1 file(s)?", "", num).arg(num));
+    reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+    reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+    if (reallyDeleteMsg.exec() != QMessageBox::Ok)
+        return;
+
+    // remove
+    foreach (QTableWidgetItem * witem, items)
+    {
+        if (witem->type() != QTableWidgetItem::UserType)
+            continue;
+        VideoItem * item = (VideoItem*)witem;
+        if (!item->ready())
+            item->pRecorder->deleteLater();
+        else
+            cfgdir->remove("Videos/" + item->name);
+    }
+#endif
+}
+
+void PageVideos::keyPressEvent(QKeyEvent * pEvent)
+{
+    if (filesTable->hasFocus())
+    {
+        if (pEvent->key() == Qt::Key_Delete)
+        {
+            deleteSelectedFiles();
+            return;
+        }
+        if (pEvent->key() == Qt::Key_Enter) // doesn't work
+        {
+            playSelectedFile();
+            return;
+        }
+    }
+    AbstractPage::keyPressEvent(pEvent);
+}
+
+void PageVideos::openVideosDirectory()
+{
+    QString path = QDir::toNativeSeparators(cfgdir->absolutePath() + "/Videos");
+    QDesktopServices::openUrl(QUrl("file:///" + path));
+}
+
+// clear VideoTemp directory (except for thumbnails and upload links)
+void PageVideos::clearTemp()
+{
+    QDir temp(cfgdir->absolutePath() + "/VideoTemp");
+    QStringList files = temp.entryList(QDir::Files);
+    foreach (const QString& file, files)
+    {
+        if (!file.endsWith(".bmp") && !file.endsWith(".png") && !file.endsWith("-url.txt"))
+            temp.remove(file);
+    }
+}
+
+bool PageVideos::tryQuit(HWForm * form)
+{
+    bool quit = true;
+    if (numRecorders != 0 || numUploads != 0)
+    {
+        // ask user what to do - abort or wait
+        HWAskQuitDialog * askd = new HWAskQuitDialog(this, form);
+        askd->deleteLater();
+        quit = askd->exec();
+    }
+    if (quit)
+        clearTemp();
+    return quit;
+}
+
+// returns multi-line string with list of videos in progress
+/* it will look like this:
+foo.avi (15.21% - encoding)
+bar.avi (18.21% - uploading)
+*/
+QString PageVideos::getVideosInProgress()
+{
+    QString list = "";
+    int count = filesTable->rowCount();
+    for (int i = 0; i < count; i++)
+    {
+        VideoItem * item = nameItem(i);
+        QString process;
+        if (!item->ready())
+            process = tr("encoding");
+        else if (item->pUploading)
+            process = tr("uploading");
+        else
+            continue;
+        float progress = 100*item->progress;
+        if (progress > 99.99)
+            progress = 99.99; // displaying 100% may be confusing
+        list += item->name + " (" + QString::number(progress, 'f', 2) + "% - " + process + ")\n";
+    }
+    return list;
+}
+
+void PageVideos::startEncoding(const QByteArray & record)
+{
+    QDir videoTempDir(cfgdir->absolutePath() + "/VideoTemp/");
+    QStringList files = videoTempDir.entryList(QStringList("*.txtout"), QDir::Files);
+    foreach (const QString & str, files)
+    {
+        QString prefix = str;
+        prefix.chop(7); // remove ".txtout"
+        videoTempDir.rename(prefix + ".txtout", prefix + ".txtin"); // rename this file to not open it twice
+
+        HWRecorder* pRecorder = new HWRecorder(config, prefix);
+
+        if (!record.isEmpty())
+            pRecorder->EncodeVideo(record);
+        else
+        {
+            // this is for videos recorded from demos which were executed directly (without frontend)
+            QFile demofile(videoTempDir.absoluteFilePath(prefix + ".hwd"));
+            if (!demofile.open(QIODevice::ReadOnly))
+                continue;
+            QByteArray demo = demofile.readAll();
+            if (demo.isEmpty())
+                continue;
+            pRecorder->EncodeVideo(demo);
+        }
+        addRecorder(pRecorder);
+    }
+}
+
+VideoItem * PageVideos::itemFromReply(QNetworkReply* reply, int & row)
+{
+    VideoItem * item = NULL;
+    int count = filesTable->rowCount();
+    // find corresponding item (maybe there is a better way to implement this?)
+    for (int i = 0; i < count; i++)
+    {
+        item = nameItem(i);
+        if (item->pUploading == reply)
+        {
+            row = i;
+            break;
+        }
+    }
+    return item;
+}
+
+void PageVideos::uploadProgress(qint64 bytesSent, qint64 bytesTotal)
+{
+    QNetworkReply* reply = (QNetworkReply*)sender();
+    int row;
+    VideoItem * item = itemFromReply(reply, row);
+    setProgress(row, item, bytesSent*1.0/bytesTotal);
+}
+
+void PageVideos::uploadFinished()
+{
+    QNetworkReply* reply = (QNetworkReply*)sender();
+    reply->deleteLater();
+
+    int row;
+    VideoItem * item = itemFromReply(reply, row);
+    if (!item)
+        return;
+
+    item->pUploading = NULL;
+
+    // extract video id from reply
+    QString videoid;
+    QXmlStreamReader xml(reply);
+    while (!xml.atEnd())
+    {
+        xml.readNext();
+        if (xml.qualifiedName() == "yt:videoid")
+        {
+            videoid = xml.readElementText();
+            break;
+        }
+    }
+
+    if (!videoid.isEmpty())
+    {
+        item->uploadUrl = "http://youtu.be/" + videoid;
+        updateDescription();
+
+        // save url in file
+        QFile * file = new QFile(cfgdir->absoluteFilePath("VideoTemp/" + item->prefix + "-url.txt"), this);
+        if (file->open(QIODevice::WriteOnly))
+        {
+            file->write(item->uploadUrl.toUtf8());
+            file->close();
+        }
+    }
+
+    filesTable->setCellWidget(row, vcProgress, NULL); // remove progress bar
+    numUploads--;
+}
+
+// this will protect saved youtube password from those who cannot read source code
+static QString protectPass(QString str)
+{
+    QByteArray array = str.toUtf8();
+    for (int i = 0; i < array.size(); i++)
+        array[i] = array[i] ^ 0xC4 ^ i;
+    array = array.toBase64();
+    return QString::fromAscii(array.data());
+}
+
+static QString unprotectPass(QString str)
+{
+    QByteArray array = QByteArray::fromBase64(str.toAscii());
+    for (int i = 0; i < array.size(); i++)
+        array[i] = array[i] ^ 0xC4 ^ i;
+    return QString::fromUtf8(array);
+}
+
+void PageVideos::uploadToYouTube()
+{
+    int row = filesTable->currentRow();
+    VideoItem * item = nameItem(row);
+
+    if (item->pUploading)
+    {
+        // ask user if (s)he is serious
+        QMessageBox reallyStopMsg(this);
+        reallyStopMsg.setIcon(QMessageBox::Question);
+        reallyStopMsg.setWindowTitle(QMessageBox::tr("Videos - Are you sure?"));
+        reallyStopMsg.setText(QMessageBox::tr("Do you really want to cancel uploading %1?").arg(item->name));
+        reallyStopMsg.setWindowModality(Qt::WindowModal);
+        reallyStopMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+
+        if (reallyStopMsg.exec() != QMessageBox::Ok)
+            return;
+        item->pUploading->deleteLater();
+        filesTable->setCellWidget(row, vcProgress, NULL); // remove progress bar
+        numUploads--;
+        return;
+    }
+
+    if (!netManager)
+        netManager = new QNetworkAccessManager(this);
+
+    HWUploadVideoDialog* dlg = new HWUploadVideoDialog(this, item->name, netManager);
+    dlg->deleteLater();
+    if (config->value("youtube/save").toBool())
+    {
+        dlg->cbSave->setChecked(true);
+        dlg->leAccount->setText(config->value("youtube/name").toString());
+        dlg->lePassword->setText(unprotectPass(config->value("youtube/pswd").toString()));
+    }
+
+    bool result = dlg->exec();
+
+    if (dlg->cbSave->isChecked())
+    {
+        config->setValue("youtube/save", true);
+        config->setValue("youtube/name", dlg->leAccount->text());
+        config->setValue("youtube/pswd", protectPass(dlg->lePassword->text()));
+    }
+    else
+    {
+        config->setValue("youtube/save", false);
+        config->setValue("youtube/name", "");
+        config->setValue("youtube/pswd", "");
+    }
+
+    if (!result)
+        return;
+
+    QNetworkRequest request(QUrl(dlg->location));
+    request.setRawHeader("Content-Type", "application/octet-stream");
+
+    QFile * file = new QFile(item->path(), this);
+    if (!file->open(QIODevice::ReadOnly))
+        return;
+
+    // add progress bar
+    QProgressBar * progressBar = new QProgressBar(filesTable);
+    progressBar->setMinimum(0);
+    progressBar->setMaximum(10000);
+    progressBar->setValue(0);
+    // make it different from progress-bar used during encoding (use blue color)
+    progressBar->setStyleSheet("* {color: #00ccff; selection-background-color: #00ccff;}" );
+    filesTable->setCellWidget(row, vcProgress, progressBar);
+
+    QNetworkReply* reply = netManager->put(request, file);
+    file->setParent(reply); // automatically close file when needed
+    item->pUploading = reply;
+    connect(reply, SIGNAL(uploadProgress(qint64, qint64)), this, SLOT(uploadProgress(qint64, qint64)));
+    connect(reply, SIGNAL(finished()), this, SLOT(uploadFinished()));
+    numUploads++;
+
+    updateDescription();
+}
diff --git a/QTfrontend/ui/page/pagevideos.h b/QTfrontend/ui/page/pagevideos.h
new file mode 100644
index 0000000..ef35318
--- /dev/null
+++ b/QTfrontend/ui/page/pagevideos.h
@@ -0,0 +1,126 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef PAGE_VIDEOS_H
+#define PAGE_VIDEOS_H
+
+#include "AbstractPage.h"
+
+class QNetworkAccessManager;
+class QNetworkReply;
+class GameUIConfig;
+class HWRecorder;
+class VideoItem;
+class HWForm;
+
+class PageVideos : public AbstractPage
+{
+        Q_OBJECT
+
+    public:
+        PageVideos(QWidget* parent = 0);
+
+        QSpinBox  *framerateBox;
+        QSpinBox  *bitrateBox;
+        QLineEdit *widthEdit;
+        QLineEdit *heightEdit;
+        QCheckBox *checkUseGameRes;
+        QCheckBox *checkRecordAudio;
+
+        QString format()
+        { return comboAVFormats->itemData(comboAVFormats->currentIndex()).toString(); }
+
+        QString videoCodec()
+        { return comboVideoCodecs->itemData(comboVideoCodecs->currentIndex()).toString(); }
+
+        QString audioCodec()
+        { return comboAudioCodecs->itemData(comboAudioCodecs->currentIndex()).toString(); }
+
+        void setDefaultCodecs();
+        bool tryCodecs(const QString & format, const QString & vcodec, const QString & acodec);
+        void addRecorder(HWRecorder* pRecorder);
+        bool tryQuit(HWForm *form);
+        QString getVideosInProgress(); // get multi-line string with list of videos in progress
+        void startEncoding(const QByteArray & record = QByteArray());
+        void init(GameUIConfig * config);
+
+    private:
+        // virtuals from AbstractPage
+        QLayout * bodyLayoutDefinition();
+        QLayout * footerLayoutDefinition();
+        void connectSignals();
+
+        // virtual from QWidget
+        void keyPressEvent(QKeyEvent * pEvent);
+
+        void setName(VideoItem * item, const QString & newName);
+        void updateSize(int row);
+        int appendRow(const QString & name);
+        VideoItem* nameItem(int row);
+        void play(int row);
+        void updateDescription();
+        void clearTemp();
+        void clearThumbnail();
+        void setProgress(int row, VideoItem* item, float value);
+        VideoItem * itemFromReply(QNetworkReply* reply, int & row);
+
+        GameUIConfig * config;
+        QNetworkAccessManager* netManager;
+
+        // options group
+        QComboBox *comboAVFormats;
+        QComboBox *comboVideoCodecs;
+        QComboBox *comboAudioCodecs;
+        QPushButton *btnDefaults;
+
+        // file list group
+        QTableWidget *filesTable;
+        QPushButton *btnOpenDir;
+
+        // description group
+        QPushButton *btnPlay, *btnDelete, *btnToYouTube;
+        QLabel *labelDesc;
+        QLabel *labelThumbnail;
+
+        // this flag is used to distinguish if cell was changed from code or by user
+        // (in signal cellChanged)
+        bool nameChangedFromCode;
+
+        int numRecorders, numUploads;
+
+    private slots:
+        void changeAVFormat(int index);
+        void changeUseGameRes(int state);
+        void changeRecordAudio(int state);
+        void setDefaultOptions();
+        void encodingFinished(bool success);
+        void updateProgress(float value);
+        void cellDoubleClicked(int row, int column);
+        void cellChanged(int row, int column);
+        void currentCellChanged();
+        void playSelectedFile();
+        void deleteSelectedFiles();
+        void openVideosDirectory();
+        void updateFileList(const QString & path);
+        void uploadToYouTube();
+        void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
+        void uploadFinished();
+};
+
+#endif // PAGE_VIDEOS_H
diff --git a/QTfrontend/ui/qaspectratiolayout.cpp b/QTfrontend/ui/qaspectratiolayout.cpp
index 8af1110..c89ce8f 100644
--- a/QTfrontend/ui/qaspectratiolayout.cpp
+++ b/QTfrontend/ui/qaspectratiolayout.cpp
@@ -4,116 +4,141 @@
 
 #include "qaspectratiolayout.h"
 
-QAspectRatioLayout::QAspectRatioLayout(QWidget* parent, int spacing) : QLayout(parent) {
-        init(spacing);
+QAspectRatioLayout::QAspectRatioLayout(QWidget* parent, int spacing) : QLayout(parent)
+{
+    init(spacing);
 }
 
-QAspectRatioLayout::QAspectRatioLayout(int spacing) {
-        init(spacing);
+QAspectRatioLayout::QAspectRatioLayout(int spacing)
+{
+    init(spacing);
 }
 
-QAspectRatioLayout::~QAspectRatioLayout() {
-        delete item;
-        delete lastReceivedRect;
-        delete _geometry;
+QAspectRatioLayout::~QAspectRatioLayout()
+{
+    delete item;
+    delete lastReceivedRect;
+    delete _geometry;
 }
 
-void QAspectRatioLayout::init(int spacing) {
-        item = 0;
-        lastReceivedRect = new QRect(0, 0, 0, 0);
-        _geometry = new QRect(0, 0, 0, 0);
-        setSpacing(spacing);
+void QAspectRatioLayout::init(int spacing)
+{
+    item = 0;
+    lastReceivedRect = new QRect(0, 0, 0, 0);
+    _geometry = new QRect(0, 0, 0, 0);
+    setSpacing(spacing);
 }
 
 
 /* Adds item if place isn't already taken. */
-void QAspectRatioLayout::add(QLayoutItem* item) {
-        if(!hasItem()) {
-                replaceItem(item);
-        }
+void QAspectRatioLayout::add(QLayoutItem* item)
+{
+    if(!hasItem())
+    {
+        replaceItem(item);
+    }
 }
 
 /* Adds item if place isn't already taken. */
-void QAspectRatioLayout::addItem(QLayoutItem* item) {
-        if(!hasItem()) {
-                replaceItem(item);
-        }
+void QAspectRatioLayout::addItem(QLayoutItem* item)
+{
+    if(!hasItem())
+    {
+        replaceItem(item);
+    }
 }
 
 /* Adds widget if place isn't already taken. */
-void QAspectRatioLayout::addWidget(QWidget* widget) {
-        if(!hasItem()) {
-                replaceItem(new QWidgetItem(widget));
-        }
+void QAspectRatioLayout::addWidget(QWidget* widget)
+{
+    if(!hasItem())
+    {
+        replaceItem(new QWidgetItem(widget));
+    }
 }
 
 /* Returns the item pointer and dereferences it here. */
-QLayoutItem* QAspectRatioLayout::take() {
-        QLayoutItem* item = 0;
-        if(this->hasItem()) {
-                item = this->item;
-                this->item = 0;
-        }
-        return item;
+QLayoutItem* QAspectRatioLayout::take()
+{
+    QLayoutItem* item = 0;
+    if(this->hasItem())
+    {
+        item = this->item;
+        this->item = 0;
+    }
+    return item;
 }
 
 /* Returns the item pointer and dereferences it here. */
-QLayoutItem* QAspectRatioLayout::takeAt(int index) {
-        if(index != 0) {
-                return 0;
-        }
-        return this->take();
+QLayoutItem* QAspectRatioLayout::takeAt(int index)
+{
+    if(index != 0)
+    {
+        return 0;
+    }
+    return this->take();
 }
 
 /* Returns the item pointer. */
-QLayoutItem* QAspectRatioLayout::itemAt(int index) const {
-        if(index != 0) {
-                return 0;
-        }
-        if(hasItem()) {
-                return this->item;
-        }
+QLayoutItem* QAspectRatioLayout::itemAt(int index) const
+{
+    if(index != 0)
+    {
         return 0;
+    }
+    if(hasItem())
+    {
+        return this->item;
+    }
+    return 0;
 }
 
 /* Checks if we have an item. */
-bool QAspectRatioLayout::hasItem() const {
-        return this->item != 0;
+bool QAspectRatioLayout::hasItem() const
+{
+    return this->item != 0;
 }
 
 /* Returns the count of items which can be either 0 or 1. */
-int QAspectRatioLayout::count() const {
-        int returnValue = 0;
-        if(hasItem()) {
-                returnValue = 1;
-        }
-        return returnValue;
+int QAspectRatioLayout::count() const
+{
+    int returnValue = 0;
+    if(hasItem())
+    {
+        returnValue = 1;
+    }
+    return returnValue;
 }
 
 /* Replaces the item with the new and returns the old. */
-QLayoutItem* QAspectRatioLayout::replaceItem(QLayoutItem* item) {
-        QLayoutItem* old = 0;
-        if(this->hasItem()) {
-                old = this->item;
-        }
-        this->item = item;
-        setGeometry(*this->_geometry);
-        return old;
+QLayoutItem* QAspectRatioLayout::replaceItem(QLayoutItem* item)
+{
+    QLayoutItem* old = 0;
+    if(this->hasItem())
+    {
+        old = this->item;
+    }
+    this->item = item;
+    setGeometry(*this->_geometry);
+    return old;
 }
 
 /* Tells which way layout expands. */
-Qt::Orientations QAspectRatioLayout::expandingDirections() const {
-        return Qt::Horizontal | Qt::Vertical;
+Qt::Orientations QAspectRatioLayout::expandingDirections() const
+{
+    return Qt::Horizontal | Qt::Vertical;
 }
 
 /* Tells which size is preferred. */
-QSize QAspectRatioLayout::sizeHint() const {
-        return this->item->minimumSize();
+QSize QAspectRatioLayout::sizeHint() const
+{
+    return this->item->minimumSize();
 }
 
 /* Tells minimum size. */
-QSize QAspectRatioLayout::minimumSize() const {
-        return this->item->minimumSize();
+QSize QAspectRatioLayout::minimumSize() const
+{
+    return this->item->minimumSize();
 }
 
 /*
@@ -121,86 +146,99 @@ QSize QAspectRatioLayout::minimumSize() const {
  * It isn't since width isn't enough to calculate
  * proper size.
  */
-bool QAspectRatioLayout::hasHeightForWidth() const {
-        return false;
+bool QAspectRatioLayout::hasHeightForWidth() const
+{
+    return false;
 }
 
 /* Replaces lastReceivedRect. */
-void QAspectRatioLayout::setLastReceivedRect(const QRect& rect) {
-        QRect* oldRect = this->lastReceivedRect;
-        this->lastReceivedRect = new QRect(rect.topLeft(), rect.size());
-        delete oldRect;
+void QAspectRatioLayout::setLastReceivedRect(const QRect& rect)
+{
+    QRect* oldRect = this->lastReceivedRect;
+    this->lastReceivedRect = new QRect(rect.topLeft(), rect.size());
+    delete oldRect;
 }
 
 /* Returns geometry */
-QRect QAspectRatioLayout::geometry() {
-        return QRect(*this->_geometry);
+QRect QAspectRatioLayout::geometry()
+{
+    return QRect(*this->_geometry);
 }
 
 /* Sets geometry to given size. */
-void QAspectRatioLayout::setGeometry(const QRect& rect) {
-        /*
-         * We check if the item is set and
-         * if size is the same previously received.
-         * If either is false nothing is done.
-         */
-        if(!this->hasItem() ||
-           areRectsEqual(*this->lastReceivedRect, rect)) {
-                return;
-        }
-        /* Replace the last received rectangle. */
-        setLastReceivedRect(rect);
-        /* Calculate proper size for the item relative to the received size. */
-        QSize properSize = calculateProperSize(rect.size());
-        /* Calculate center location in the rect and with item size. */
-        QPoint properLocation = calculateCenterLocation(rect.size(), properSize);
-        /* Set items geometry */
-        this->item->setGeometry(QRect(properLocation, properSize));
-        QRect* oldRect = this->_geometry;
-        /* Cache the calculated geometry. */
-        this->_geometry = new QRect(properLocation, properSize);
-        delete oldRect;
-        /* Super classes setGeometry */
-        QLayout::setGeometry(*this->_geometry);
+void QAspectRatioLayout::setGeometry(const QRect& rect)
+{
+    /*
+     * We check if the item is set and
+     * if size is the same previously received.
+     * If either is false nothing is done.
+     */
+    if(!this->hasItem() ||
+            areRectsEqual(*this->lastReceivedRect, rect))
+    {
+        return;
+    }
+    /* Replace the last received rectangle. */
+    setLastReceivedRect(rect);
+    /* Calculate proper size for the item relative to the received size. */
+    QSize properSize = calculateProperSize(rect.size());
+    /* Calculate center location in the rect and with item size. */
+    QPoint properLocation = calculateCenterLocation(rect.size(), properSize);
+    /* Set items geometry */
+    this->item->setGeometry(QRect(properLocation, properSize));
+    QRect* oldRect = this->_geometry;
+    /* Cache the calculated geometry. */
+    this->_geometry = new QRect(properLocation, properSize);
+    delete oldRect;
+    /* Super classes setGeometry */
+    QLayout::setGeometry(*this->_geometry);
 }
 
 /* Takes the shortest side and creates QSize
  * with the shortest side as width and height. */
-QSize QAspectRatioLayout::calculateProperSize(QSize from) const {
-        QSize properSize;
-        if(from.height() * 2 < from.width()) {
-                properSize.setHeight(from.height() - this->margin());
-                properSize.setWidth(from.height() * 2 - this->margin());
-        }
-        else {
-                properSize.setWidth(from.width() - this->margin());
-                properSize.setHeight(from.width() / 2 - this->margin());
-        }
-        return properSize;
+QSize QAspectRatioLayout::calculateProperSize(QSize from) const
+{
+    QSize properSize;
+    if(from.height() * 2 < from.width())
+    {
+        properSize.setHeight(from.height() - this->margin());
+        properSize.setWidth(from.height() * 2 - this->margin());
+    }
+    else
+    {
+        properSize.setWidth(from.width() - this->margin());
+        properSize.setHeight(from.width() / 2 - this->margin());
+    }
+    return properSize;
 }
 
 /* Calculates center location from the given height and width for item size. */
 QPoint QAspectRatioLayout::calculateCenterLocation(QSize from,
-                                                   QSize itemSize) const {
-        QPoint centerLocation;
-        if((from.width() - itemSize.width()) > 0) {
-                centerLocation.setX((from.width() - itemSize.width())/2);
-        }
-        if((from.height() - itemSize.height()) > 0) {
-                centerLocation.setY((from.height() - itemSize.height())/2);
-        }
-        return centerLocation;
+        QSize itemSize) const
+{
+    QPoint centerLocation;
+    if((from.width() - itemSize.width()) > 0)
+    {
+        centerLocation.setX((from.width() - itemSize.width())/2);
+    }
+    if((from.height() - itemSize.height()) > 0)
+    {
+        centerLocation.setY((from.height() - itemSize.height())/2);
+    }
+    return centerLocation;
 }
 
 /* Compares if two QRects are equal. */
 bool QAspectRatioLayout::areRectsEqual(const QRect& a,
-                                       const QRect& b) const {
-        bool result = false;
-        if(a.x() == b.x() &&
-           a.y() == b.y() &&
-           a.height() == b.height() &&
-           a.width() == b.width()) {
-                result = true;
-        }
-        return result;
+                                       const QRect& b) const
+{
+    bool result = false;
+    if(a.x() == b.x() &&
+            a.y() == b.y() &&
+            a.height() == b.height() &&
+            a.width() == b.width())
+    {
+        result = true;
+    }
+    return result;
 }
diff --git a/QTfrontend/ui/qaspectratiolayout.h b/QTfrontend/ui/qaspectratiolayout.h
index c73525e..c2440a5 100644
--- a/QTfrontend/ui/qaspectratiolayout.h
+++ b/QTfrontend/ui/qaspectratiolayout.h
@@ -16,7 +16,7 @@ class QAspectRatioLayout : public QLayout
 {
         Q_OBJECT
 
-public:
+    public:
         QAspectRatioLayout(QWidget* parent, int spacing =-1);
         QAspectRatioLayout(int spacing = -1);
         ~QAspectRatioLayout();
@@ -24,7 +24,7 @@ public:
         /* Convenience method */
         virtual void add(QLayoutItem* item);
 
-/* http://doc.trolltech.com/qlayout.html#addItem */
+        /* http://doc.trolltech.com/qlayout.html#addItem */
         virtual void addItem(QLayoutItem* item);
         /* http://doc.trolltech.com/qlayout.html#addWidget */
         virtual void addWidget(QWidget* widget);
@@ -42,7 +42,7 @@ public:
         virtual QLayoutItem* take();
         virtual bool hasItem() const;
 
-/* http://doc.trolltech.com/qlayout.html#expandingDirections */
+        /* http://doc.trolltech.com/qlayout.html#expandingDirections */
         virtual Qt::Orientations expandingDirections() const;
 
         /*
@@ -60,7 +60,7 @@ public:
         /* http://doc.trolltech.com/qlayoutitem.html#hasHeightForWidth */
         virtual bool hasHeightForWidth() const;
 
-private:
+    private:
         /* Saves the last received rect. */
         void setLastReceivedRect(const QRect& rect);
         /* Used to initialize the object. */
diff --git a/QTfrontend/ui/widget/FreqSpinBox.cpp b/QTfrontend/ui/widget/FreqSpinBox.cpp
index fa8a7ec..64202d0 100644
--- a/QTfrontend/ui/widget/FreqSpinBox.cpp
+++ b/QTfrontend/ui/widget/FreqSpinBox.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/widget/FreqSpinBox.h b/QTfrontend/ui/widget/FreqSpinBox.h
index 2ac810e..6bd7a84 100644
--- a/QTfrontend/ui/widget/FreqSpinBox.h
+++ b/QTfrontend/ui/widget/FreqSpinBox.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -35,23 +35,23 @@
  */
 class FreqSpinBox : public QSpinBox
 {
-    Q_OBJECT
-
-public:
-    /**
-     * @brief Class constructor.
-     * @param parent parent widget.
-     */
-    FreqSpinBox(QWidget * parent);
-
-protected:
-    /**
-     * Returns it's value as localized frequency.
-     * 'Never', 'Every Turn', 'Every 2 Turns', etc.
-     * @param value integer value to be representing as string.
-     * @return the turn frequence-like string representation.
-     */
-    QString textFromValue(int value) const;
+        Q_OBJECT
+
+    public:
+        /**
+         * @brief Class constructor.
+         * @param parent parent widget.
+         */
+        FreqSpinBox(QWidget * parent);
+
+    protected:
+        /**
+         * Returns it's value as localized frequency.
+         * 'Never', 'Every Turn', 'Every 2 Turns', etc.
+         * @param value integer value to be representing as string.
+         * @return the turn frequence-like string representation.
+         */
+        QString textFromValue(int value) const;
 };
 
 
diff --git a/QTfrontend/ui/widget/HistoryLineEdit.cpp b/QTfrontend/ui/widget/HistoryLineEdit.cpp
index 446c034..3280c4b 100644
--- a/QTfrontend/ui/widget/HistoryLineEdit.cpp
+++ b/QTfrontend/ui/widget/HistoryLineEdit.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,7 +27,7 @@
 #include "HistoryLineEdit.h"
 
 HistoryLineEdit::HistoryLineEdit(QWidget * parent, int maxHistorySize)
-: QLineEdit(parent)
+    : QLineEdit(parent)
 {
     m_curHistEntryIdx = 0;
     m_maxHistorySize = maxHistorySize;
@@ -80,10 +80,10 @@ void HistoryLineEdit::navigateHistory(bool isGoingUp)
 {
     // save possible changes to new entry
     if ((m_curHistEntryIdx >= m_history->size() ||
-        (text() != m_history->at(m_curHistEntryIdx))))
-        {
-            rememberCurrentText();
-        }
+            (text() != m_history->at(m_curHistEntryIdx))))
+    {
+        rememberCurrentText();
+    }
 
     if (isGoingUp)
         m_curHistEntryIdx--;
diff --git a/QTfrontend/ui/widget/HistoryLineEdit.h b/QTfrontend/ui/widget/HistoryLineEdit.h
index cf1244a..3b8f365 100644
--- a/QTfrontend/ui/widget/HistoryLineEdit.h
+++ b/QTfrontend/ui/widget/HistoryLineEdit.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -38,72 +38,72 @@ class QLineEdit;
 /**
  * @brief <code>QLineEdit</code> that features a history of previous contents,
  *        re-selectable using the arrow keys.
- * 
+ *
  * @author sheepluva
  * @since 0.9.17
  */
 class HistoryLineEdit : public QLineEdit
 {
- Q_OBJECT
-
-public:
-    /**
-    * @brief Class constructor.
-    * @param parent parent QWidget.
-    * @param maxHistorySize maximum amount of history entries kept.
-    */
-    HistoryLineEdit(QWidget * parent = 0, int maxHistorySize = 64);
-
-    /**
-    * @brief Class destructor.
-    */
-    ~HistoryLineEdit();
-
-    /**
-     * @brief Appends current text to history (if not only whitespaces);
-     */
-    void rememberCurrentText();
-
-    /**
-     * @brief Forget all history.
-     */
-    void reset();
-
-
-public slots:
-    /**
-     * @brief Clears the contents.
-     */
-    void clear();
-
-
-protected:
-    /**
-     * @brief Overrides method of parent class.
-     * Arrow keys are used for navigating the history.
-     *
-     * All other keys are forwarded to the parent's method.
-     * 
-     * @param event the key event.
-     */
-    virtual void keyPressEvent(QKeyEvent * event);
-
-
-private:
-    int m_maxHistorySize; ///< the maximum allowed size for the history
-    int m_curHistEntryIdx; ///< the index of the displayed used entry
-
-    QStringList * m_history; ///< history of previous inputs
-
-    /**
-     * @brief Navigates content history in the desired direction.
-     *
-     * Note: no wrap-around on purpose (so that holding down/up will get the
-     * the user to the respective end rather than into an endless cycle :P)
-     * 
-     * @param isGoingUp true: next older entry, false: next more recent entry.
-     */
-    void navigateHistory(bool isGoingUp);
+        Q_OBJECT
+
+    public:
+        /**
+        * @brief Class constructor.
+        * @param parent parent QWidget.
+        * @param maxHistorySize maximum amount of history entries kept.
+        */
+        HistoryLineEdit(QWidget * parent = 0, int maxHistorySize = 64);
+
+        /**
+        * @brief Class destructor.
+        */
+        ~HistoryLineEdit();
+
+        /**
+         * @brief Appends current text to history (if not only whitespaces);
+         */
+        void rememberCurrentText();
+
+        /**
+         * @brief Forget all history.
+         */
+        void reset();
+
+
+    public slots:
+        /**
+         * @brief Clears the contents.
+         */
+        void clear();
+
+
+    protected:
+        /**
+         * @brief Overrides method of parent class.
+         * Arrow keys are used for navigating the history.
+         *
+         * All other keys are forwarded to the parent's method.
+         *
+         * @param event the key event.
+         */
+        virtual void keyPressEvent(QKeyEvent * event);
+
+
+    private:
+        int m_maxHistorySize; ///< the maximum allowed size for the history
+        int m_curHistEntryIdx; ///< the index of the displayed used entry
+
+        QStringList * m_history; ///< history of previous inputs
+
+        /**
+         * @brief Navigates content history in the desired direction.
+         *
+         * Note: no wrap-around on purpose (so that holding down/up will get the
+         * the user to the respective end rather than into an endless cycle :P)
+         *
+         * @param isGoingUp true: next older entry, false: next more recent entry.
+         */
+        void navigateHistory(bool isGoingUp);
 };
 
 
diff --git a/QTfrontend/ui/widget/SmartLineEdit.cpp b/QTfrontend/ui/widget/SmartLineEdit.cpp
index c2a1679..70002f1 100644
--- a/QTfrontend/ui/widget/SmartLineEdit.cpp
+++ b/QTfrontend/ui/widget/SmartLineEdit.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,7 +25,7 @@
 #include "SmartLineEdit.h"
 
 SmartLineEdit::SmartLineEdit(QWidget * parent, int maxHistorySize)
-: HistoryLineEdit(parent, maxHistorySize)
+    : HistoryLineEdit(parent, maxHistorySize)
 {
     m_whitespace = QRegExp("\\s");
 
diff --git a/QTfrontend/ui/widget/SmartLineEdit.h b/QTfrontend/ui/widget/SmartLineEdit.h
index f8fee78..05bcfe6 100644
--- a/QTfrontend/ui/widget/SmartLineEdit.h
+++ b/QTfrontend/ui/widget/SmartLineEdit.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -45,108 +45,108 @@
  *   <li>A Keyword can either be a command (if first word) or
  *       a nickname (completed regardless of position in text).</li>
  * </ul>
- * 
+ *
  * @author sheepluva
  * @since 0.9.17
  */
 class SmartLineEdit : public HistoryLineEdit
 {
- Q_OBJECT
-
-public:
-    /**
-    * @brief Class constructor.
-    * @param parent parent QWidget.
-    * @param maxHistorySize maximum amount of history entries kept.
-    */
-    SmartLineEdit(QWidget * parent = 0, int maxHistorySize = 64);
-
-    /**
-    * @brief Class destructor.
-    */
-    ~SmartLineEdit();
-
-    /**
-     * @brief Adds commands to the auto-completion feature.
-     * @param commands list of commands to be added.
-     */
-    void addCommands(const QStringList & commands);
-
-    /**
-     * @brief Adds a single nickname to the auto-completion feature.
-     * @param nickname name to be added.
-     */
-    void addNickname(const QString & nickname);
-
-    /**
-     * @brief Removes commands from the auto-completion feature.
-     * @param commands list of commands to be removed.
-     */
-    void removeCommands(const QStringList & commands);
-
-    /**
-     * @brief Removes a single nickname from the auto-completion feature.
-     * @param nickname name to be removed.
-     */
-    void removeNickname(const QString & nickname);
-
-    /**
-     * @brief Forget all keywords and input history.
-     */
-    void reset();
-
-
-protected:
-    /**
-     * @brief Overrides method of parent class.
-     * Forward pressed TAB to parent class' method (for focus handling etc)
-     * only if line is empty.
-     * 
-     * @param event the event.
-     * @return returns true if the event was recognized.
-     */
-    virtual bool event(QEvent * event);
-
-    /**
-     * @brief Overrides method of parent class.
-     * Autocompletes if TAB is reported as pressed key in the key event,
-     * ESC leads to the contents being cleared.
-     * 
-     * Other keys are forwarded to parent method.
-     *
-     * @param event the key event.
-     */
-    virtual void keyPressEvent(QKeyEvent * event);
-
-
-private:
-    QRegExp m_whitespace; ///< regexp that matches a whitespace
-
-    QStringList * m_cmds;  ///< list of recognized commands
-    QStringList * m_nicks; ///< list of recognized nicknames
-
-    /// recognized nicknames, sorted case-insensitive
-    QMap<QString, QString> * m_sorted_nicks;
-
-    // these variables contain information about the last replacement
-    // they get reset whenever cursor is moved or text is changed
-
-    QString m_beforeMatch; ///< the string that was just matched
-    bool m_hasJustMatched; ///< whether this widget just did an auto-completion
-    QString m_prefix; ///< prefix of the text replacement this widget just did
-    QString m_postfix; ///< postfix of the text replacement this widget just did
-
-    /**
-     * @brief Autocompletes the contents based on the known commands and/or names.
-     */
-    void autoComplete();
-
-
-private slots:
-    /**
-     * @brief Resets the information about the last match and text replacement.
-     */
-    void resetAutoCompletionStatus();
+        Q_OBJECT
+
+    public:
+        /**
+        * @brief Class constructor.
+        * @param parent parent QWidget.
+        * @param maxHistorySize maximum amount of history entries kept.
+        */
+        SmartLineEdit(QWidget * parent = 0, int maxHistorySize = 64);
+
+        /**
+        * @brief Class destructor.
+        */
+        ~SmartLineEdit();
+
+        /**
+         * @brief Adds commands to the auto-completion feature.
+         * @param commands list of commands to be added.
+         */
+        void addCommands(const QStringList & commands);
+
+        /**
+         * @brief Adds a single nickname to the auto-completion feature.
+         * @param nickname name to be added.
+         */
+        void addNickname(const QString & nickname);
+
+        /**
+         * @brief Removes commands from the auto-completion feature.
+         * @param commands list of commands to be removed.
+         */
+        void removeCommands(const QStringList & commands);
+
+        /**
+         * @brief Removes a single nickname from the auto-completion feature.
+         * @param nickname name to be removed.
+         */
+        void removeNickname(const QString & nickname);
+
+        /**
+         * @brief Forget all keywords and input history.
+         */
+        void reset();
+
+
+    protected:
+        /**
+         * @brief Overrides method of parent class.
+         * Forward pressed TAB to parent class' method (for focus handling etc)
+         * only if line is empty.
+         *
+         * @param event the event.
+         * @return returns true if the event was recognized.
+         */
+        virtual bool event(QEvent * event);
+
+        /**
+         * @brief Overrides method of parent class.
+         * Autocompletes if TAB is reported as pressed key in the key event,
+         * ESC leads to the contents being cleared.
+         *
+         * Other keys are forwarded to parent method.
+         *
+         * @param event the key event.
+         */
+        virtual void keyPressEvent(QKeyEvent * event);
+
+
+    private:
+        QRegExp m_whitespace; ///< regexp that matches a whitespace
+
+        QStringList * m_cmds;  ///< list of recognized commands
+        QStringList * m_nicks; ///< list of recognized nicknames
+
+        /// recognized nicknames, sorted case-insensitive
+        QMap<QString, QString> * m_sorted_nicks;
+
+        // these variables contain information about the last replacement
+        // they get reset whenever cursor is moved or text is changed
+
+        QString m_beforeMatch; ///< the string that was just matched
+        bool m_hasJustMatched; ///< whether this widget just did an auto-completion
+        QString m_prefix; ///< prefix of the text replacement this widget just did
+        QString m_postfix; ///< postfix of the text replacement this widget just did
+
+        /**
+         * @brief Autocompletes the contents based on the known commands and/or names.
+         */
+        void autoComplete();
+
+
+    private slots:
+        /**
+         * @brief Resets the information about the last match and text replacement.
+         */
+        void resetAutoCompletionStatus();
 };
 
 
diff --git a/QTfrontend/ui/widget/SquareLabel.cpp b/QTfrontend/ui/widget/SquareLabel.cpp
index 3250b27..183eaba 100644
--- a/QTfrontend/ui/widget/SquareLabel.cpp
+++ b/QTfrontend/ui/widget/SquareLabel.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,7 +24,7 @@
 SquareLabel::SquareLabel(QWidget * parent) :
     QWidget(parent)
 {
-    if(frontendEffects) setAttribute(Qt::WA_PaintOnScreen, true);
+    //if(frontendEffects) setAttribute(Qt::WA_PaintOnScreen, true);
 }
 
 void SquareLabel::paintEvent(QPaintEvent * event)
@@ -33,10 +33,13 @@ void SquareLabel::paintEvent(QPaintEvent * event)
 
     QPainter painter(this);
     int pixsize;
-    if (width() > height()) {
+    if (width() > height())
+    {
         pixsize = height();
         painter.translate((width() - pixsize) / 2, 0);
-    } else {
+    }
+    else
+    {
         pixsize = width();
         painter.translate(0, (height() - pixsize) / 2);
     }
diff --git a/QTfrontend/ui/widget/SquareLabel.h b/QTfrontend/ui/widget/SquareLabel.h
index e4eecb0..5cb8538 100644
--- a/QTfrontend/ui/widget/SquareLabel.h
+++ b/QTfrontend/ui/widget/SquareLabel.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,17 +24,17 @@
 
 class SquareLabel : public QWidget
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    SquareLabel(QWidget * parent = 0);
+    public:
+        SquareLabel(QWidget * parent = 0);
 
-    void setPixmap(const QPixmap & pixmap);
-protected:
-    virtual void paintEvent(QPaintEvent * event);
+        void setPixmap(const QPixmap & pixmap);
+    protected:
+        virtual void paintEvent(QPaintEvent * event);
 
-private:
-    QPixmap pixmap;
+    private:
+        QPixmap pixmap;
 
 };
 
diff --git a/QTfrontend/ui/widget/about.cpp b/QTfrontend/ui/widget/about.cpp
index 4315c4b..37a1e9d 100644
--- a/QTfrontend/ui/widget/about.cpp
+++ b/QTfrontend/ui/widget/about.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,7 +27,7 @@
 #include "about.h"
 
 About::About(QWidget * parent) :
-  QWidget(parent)
+    QWidget(parent)
 {
     QGridLayout *mainLayout = new QGridLayout(this);
 
@@ -45,16 +45,16 @@ About::About(QWidget * parent) :
     QLabel *lbl1 = new QLabel(this);
     lbl1->setOpenExternalLinks(true);
     lbl1->setText(
-            "<style type=\"text/css\">"
-            "a { color: #ffcc00; }"
+        "<style type=\"text/css\">"
+        "a { color: #ffcc00; }"
 //            "a:hover { color: yellow; }"
-            "</style>"
-            "<div align=\"center\"><h1>Hedgewars</h1>"
-            "<h3>" + QLabel::tr("Version") + " " + *cVersionString + "</h3>"
-            "<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p><br>" +
-            QLabel::tr("This program is distributed under the GNU General Public License v2") +
-            "</div>"
-            );
+        "</style>"
+        "<div align=\"center\"><h1>Hedgewars</h1>"
+        "<h3>" + QLabel::tr("Version") + " " + *cVersionString + "</h3>"
+        "<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p><br>" +
+        QLabel::tr("This program is distributed under the GNU General Public License v2") +
+        "</div>"
+    );
     lbl1->setWordWrap(true);
     mainLayout->addWidget(lbl1, 0, 1);
 
@@ -62,33 +62,37 @@ About::About(QWidget * parent) :
 
     lbl2->setOpenExternalLinks(true);
     lbl2->setText(
-            "<style type=\"text/css\">"
-            "a { color: #ffcc00; }"
+        "<style type=\"text/css\">"
+        "a { color: #ffcc00; }"
 //            "a:hover { color: yellow; }"
-            "</style>" +
-            QString("<h2>") +
-            QLabel::tr("Developers:") +
-            "</h2><p>"
-            "Engine, frontend, net server: Andrey Korotaev <<a href=\"mailto:unC0Rr at gmail.com\">unC0Rr at gmail.com</a>><br>"
-            "Many frontend improvements: Igor Ulyanov <<a href=\"mailto:disinbox at gmail.com\">disinbox at gmail.com</a>><br>"
-            "Many engine and frontend improvements: Derek Pomery <<a href=\"mailto:nemo at m8y.org\">nemo at m8y.org</a>><br>"
-            "Drill rocket, Ballgun, RC Plane weapons: Martin Boze <<a href=\"mailto:afffect at gmail.com\">afffect at gmail.com</a>><br>"
-            "Mine number and time game settings: David A. Cuadrado <<a href=\"mailto:krawek at gmail.com\">krawek at gmail.com</a>><br>"
-            "Frontend improvements: Martin Minarik <<a href=\"mailto:ttsmj at pokec.sk\">ttsmj at pokec.sk</a>><br>"
-            "Frontend improvements: Kristian Lehmann <<a href=\"mailto:email at thexception.net\">email at thexception.net</a>><br>"
-            "Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara <<a href=\"mailto:vittorio.giovara at gmail.com\">vittorio.giovara at gmail.com</a>><br>"
-            "Many engine and frontend improvements (and bugs): Richard Karolyi <<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>><br>"
-            "Gamepad and Lua integration: Mario Liebisch <<a href=\"mailto:mario.liebisch at gmail.com\">mario.liebisch at gmail.com</a>><br>"
-            "Many engine improvements and graphics: Carlos Vives <<a href=\"mailto:mail at carlosvives.es\">mail at carlosvives.es</a>><br>"
-            "Maze maps: Henning Kühn <<a href=\"mailto:prg at cooco.de\">prg at cooco.de</a>><br>"
-            "Engine and frontend improvements: Henrik Rostedt <<a href=\"mailto:henrik.rostedt at gmail.com\">henrik.rostedt at gmail.com</a>><br>"
-            "Lua game modes and missions: John Lambert <<a href=\"mailto:redgrinner at gmail.com\">redgrinner at gmail.com</a>><br>"
-            "Frontend improvements: Mayur Pawashe <<a href=\"mailto:zorgiepoo at gmail.com\">zorgiepoo at gmail.com</a>><br>"
-            "Android port: Richard Deurwaarder <<a href=\"mailto:xeli at xelification.com\">xeli at xelification.com</a>><br>"
-            "</p><h2>" +
-
-            QLabel::tr("Art:") + "</h2>"
-            + QString::fromUtf8(
+        "</style>" +
+        QString("<h2>") +
+        QLabel::tr("Developers:") +
+        "</h2><p>"
+        "Engine, frontend, net server: Andrey Korotaev <<a href=\"mailto:unC0Rr at gmail.com\">unC0Rr at gmail.com</a>><br>"
+        "Many frontend improvements: Igor Ulyanov <<a href=\"mailto:disinbox at gmail.com\">disinbox at gmail.com</a>><br>"
+        "Many engine and frontend improvements: Derek Pomery <<a href=\"mailto:nemo at m8y.org\">nemo at m8y.org</a>><br>"
+        "Drill rocket, Ballgun, RC Plane weapons: Martin Boze <<a href=\"mailto:afffect at gmail.com\">afffect at gmail.com</a>><br>"
+        "Mine number and time game settings: David A. Cuadrado <<a href=\"mailto:krawek at gmail.com\">krawek at gmail.com</a>><br>"
+        "Frontend improvements: Martin Minarik <<a href=\"mailto:ttsmj at pokec.sk\">ttsmj at pokec.sk</a>><br>"
+        "Frontend improvements: Kristian Lehmann <<a href=\"mailto:email at thexception.net\">email at thexception.net</a>><br>"
+        "Mac OS X/iPhone port, OpenGL-ES conversion: Vittorio Giovara <<a href=\"mailto:vittorio.giovara at gmail.com\">vittorio.giovara at gmail.com</a>><br>"
+        "Many engine and frontend improvements (and bugs): Richard Karolyi <<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>><br>"
+        "Gamepad and Lua integration: Mario Liebisch <<a href=\"mailto:mario.liebisch at gmail.com\">mario.liebisch at gmail.com</a>><br>"
+        "Many engine improvements and graphics: Carlos Vives <<a href=\"mailto:mail at carlosvives.es\">mail at carlosvives.es</a>><br>"
+        "Maze maps: Henning Kühn <<a href=\"mailto:prg at cooco.de\">prg at cooco.de</a>><br>"
+        "Engine and frontend improvements: Henrik Rostedt <<a href=\"mailto:henrik.rostedt at gmail.com\">henrik.rostedt at gmail.com</a>><br>"
+        "Lua game modes and missions: John Lambert <<a href=\"mailto:redgrinner at gmail.com\">redgrinner at gmail.com</a>><br>"
+        "Frontend improvements: Mayur Pawashe <<a href=\"mailto:zorgiepoo at gmail.com\">zorgiepoo at gmail.com</a>><br>"
+        "Android port: Richard Deurwaarder <<a href=\"mailto:xeli at xelification.com\">xeli at xelification.com</a>><br>"
+        "Android netplay, portability abstraction: Simeon Maxein <<a href=\"mailto:smaxein at googlemail.com\">smaxein at googlemail.com</a>><br>"
+        "WebGL port, some pas2c and GLES2 work: Meng Xiangyun <<a href=\"mailto:xymengxy at gmail.com\">xymengxy at gmail.com</a>><br>"
+        "Video recording: Stepan Podoskin <<a href=\"mailto:stepik-777 at mail.ru\">stepik-777 at mail.ru</a>><br>"
+        "Campaign support, first campaign: Szabolcs Orbàn <<a href=\"mailto:szabibibi at gmail.com\">szabibibi at gmail.com</a>><br>"
+        "</p><h2>" +
+
+        QLabel::tr("Art:") + "</h2>"
+        + QString::fromUtf8(
             "<p>John Dum <<a href=\"mailto:fizzy at gmail.com\">fizzy at gmail.com</a>>"
             "<br>"
             "Joshua Frese <<a href=\"mailto:joshfrese at gmail.com\">joshfrese at gmail.com</a>>"
@@ -105,30 +109,30 @@ About::About(QWidget * parent) :
             "<br>"
             "Hats: Trey Perry <<a href=\"mailto:tx.perry.j at gmail.com\">tx.perry.j at gmail.com</a>>"
             "</p><h2>") +
-            QLabel::tr("Sounds:") + "</h2>"
-            "Hedgehogs voice: Stephen Alexander <<a href=\"mailto:ArmagonNo1 at gmail.com\">ArmagonNo1 at gmail.com</a>>"
-            "<br>"
-            "John Dum <<a href=\"mailto:fizzy at gmail.com\">fizzy at gmail.com</a>>"
-            "<br>"
-            "Jonatan Nilsson <<a href=\"mailto:jonatanfan at gmail.com\">jonatanfan at gmail.com</a>>"
-            "<br>"
-            "Daniel Martin <<a href=\"mailto:elhombresinremedio at gmail.com\">elhombresinremedio at gmail.com</a>>"
-            "</p><h2>" +
-
-            QLabel::tr("Translations:") + "</h2><p>"
-            + QString::fromUtf8(
+        QLabel::tr("Sounds:") + "</h2>"
+        "Hedgehogs voice: Stephen Alexander <<a href=\"mailto:ArmagonNo1 at gmail.com\">ArmagonNo1 at gmail.com</a>>"
+        "<br>"
+        "John Dum <<a href=\"mailto:fizzy at gmail.com\">fizzy at gmail.com</a>>"
+        "<br>"
+        "Jonatan Nilsson <<a href=\"mailto:jonatanfan at gmail.com\">jonatanfan at gmail.com</a>>"
+        "<br>"
+        "Daniel Martin <<a href=\"mailto:elhombresinremedio at gmail.com\">elhombresinremedio at gmail.com</a>>"
+        "</p><h2>" +
+
+        QLabel::tr("Translations:") + "</h2><p>"
+        + QString::fromUtf8(
             "Brazilian Portuguese: Romulo Fernandes Machado <<a href=\"mailto:abra185 at gmail.com\">abra185 at gmail.com</a>><br>"
             "Bulgarian: Svetoslav Stefanov<br>"
             "Czech: Petr Řezáček <<a href=\"mailto:rezacek at gmail.com\">rezacek at gmail.com</a>><br>"
             "Chinese: Jie Luo <<a href=\"mailto:lililjlj at gmail.com\">lililjlj at gmail.com</a>><br>"
             "English: Andrey Korotaev <<a href=\"mailto:unC0Rr at gmail.com\">unC0Rr at gmail.com</a>><br>"
             "Finnish: Nina Kuisma <<a href=\"mailto:ninnnu at gmail.com\">ninnnu at gmail.com</a>><br>"
-            "French: Antoine Turmel <<a href=\"mailto:geekshadow at gmail.com\">geekshadow at gmail.com</a>><br>"
+            "French: Antoine Turmel <<a href=\"mailto:geekshadow at gmail.com\">geekshadow at gmail.com</a>>, Clement Woitrain <<a href=\"mailto:sphrixclement at gmail.com\">sphrixclement at gmail.com</a>><br>"
             "German: Peter Hüwe <<a href=\"mailto:PeterHuewe at gmx.de\">PeterHuewe at gmx.de</a>>, Mario Liebisch <<a href=\"mailto:mario.liebisch at gmail.com\">mario.liebisch at gmail.com</a>>, Richard Karolyi <<a href=\"mailto:sheepluva@" "ercatec.net\">sheepluva@" "ercatec.net</a>><br>"
             "Greek: <<a href=\"mailto:talos_kriti at yahoo.gr\">talos_kriti at yahoo.gr</a>><br>"
             "Italian: Luca Bonora <<a href=\"mailto:bonora.luca at gmail.com\">bonora.luca at gmail.com</a>>, Marco Bresciani<br>"
             "Japanese: ADAM Etienne <<a href=\"mailto:etienne.adam at gmail.com\">etienne.adam at gmail.com</a>><br>"
-            "Korean: Anthony Bellew <<a href=\"mailto:webmaster at anthonybellew.com\">webmaster at anthonybellew.com</a>><br>"
+            "Korean: Anthony Bellew <<a href=\"mailto:anthonyreflected at gmail.com\">anthonyreflected at gmail.com</a>><br>"
             "Lithuanian: Lukas Urbonas <<a href=\"mailto:lukasu08 at gmail.com\">lukasu08 at gmail.com</a>><br>"
             "Polish: Maciej Mroziński <<a href=\"mailto:mynick2 at o2.pl\">mynick2 at o2.pl</a>>, Wojciech Latkowski <<a href=\"mailto:magik17l at gmail.com\">magik17l at gmail.com</a>>, Piotr Mitana, Maciej Górny<br>"
             "Portuguese: Fábio Canário <<a href=\"mailto:inufabie at gmail.com\">inufabie at gmail.com</a>><br>"
@@ -139,13 +143,13 @@ About::About(QWidget * parent) :
             "Ukrainian: Eugene V. Lyubimkin <<a href=\"mailto:jackyf.devel at gmail.com\">jackyf.devel at gmail.com</a>>, Igor Paliychuk <<a href=\"mailto:mansonigor at gmail.com\">mansonigor at gmail.com</a>>, Eugene Sakara <<a href=\"mailto:eresid at gmail.com\">eresid at gmail.com</a>>"
             "</p><h2>") +
 
-            QLabel::tr("Special thanks:") + "</h2><p>"
-            "Aleksey Andreev <<a href=\"mailto:blaknayabr at gmail.com\">blaknayabr at gmail.com</a>><br>"
-            "Aleksander Rudalev <<a href=\"mailto:alexv at pomorsu.ru\">alexv at pomorsu.ru</a>><br>"
-            "Natasha Korotaeva <<a href=\"mailto:layout at pisem.net\">layout at pisem.net</a>><br>"
-            "Adam Higerd (aka ahigerd at FreeNode)"
-            "</p>"
-            );
+        QLabel::tr("Special thanks:") + "</h2><p>"
+        "Aleksey Andreev <<a href=\"mailto:blaknayabr at gmail.com\">blaknayabr at gmail.com</a>><br>"
+        "Aleksander Rudalev <<a href=\"mailto:alexv at pomorsu.ru\">alexv at pomorsu.ru</a>><br>"
+        "Natasha Korotaeva <<a href=\"mailto:layout at pisem.net\">layout at pisem.net</a>><br>"
+        "Adam Higerd (aka ahigerd at FreeNode)"
+        "</p>"
+    );
     mainLayout->addWidget(lbl2, 1, 1);
 
     setAcceptDrops(true);
diff --git a/QTfrontend/ui/widget/about.h b/QTfrontend/ui/widget/about.h
index 117e4f3..80ef9b3 100644
--- a/QTfrontend/ui/widget/about.h
+++ b/QTfrontend/ui/widget/about.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,17 +26,17 @@
 
 class About : public QWidget
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    About(QWidget * parent = 0);
+    public:
+        About(QWidget * parent = 0);
 
-protected:
-    virtual void dragEnterEvent(QDragEnterEvent * event);
-    virtual void dropEvent(QDropEvent * event);
+    protected:
+        virtual void dragEnterEvent(QDragEnterEvent * event);
+        virtual void dropEvent(QDropEvent * event);
 
-private:
-    QTextBrowser * lbl2;
+    private:
+        QTextBrowser * lbl2;
 };
 
 #endif // _ABOUT_H
diff --git a/QTfrontend/ui/widget/bgwidget.cpp b/QTfrontend/ui/widget/bgwidget.cpp
index 86375bd..c23cad2 100644
--- a/QTfrontend/ui/widget/bgwidget.cpp
+++ b/QTfrontend/ui/widget/bgwidget.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email at thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -18,6 +18,7 @@
  */
 
 #include "bgwidget.h"
+#include "hwconsts.h"
 
 SpritePosition::SpritePosition(QWidget * parent, int sw, int sh)
 {
@@ -82,10 +83,31 @@ void SpritePosition::init()
     fX = qrand() % (wParent->width() + 1);
 }
 
-BGWidget::BGWidget(QWidget * parent) : QWidget(parent)
+BGWidget::BGWidget(QWidget * parent) : QWidget(parent), enabled(false)
 {
     setAttribute(Qt::WA_NoSystemBackground, true);
-    sprite.load(":/res/Star.png");
+
+    QString fname;
+
+    //For each season, there is a replacement for the star (Star.png)
+    //Todo: change element for easter and birthday
+    //Simply replace Confetti.png and Egg.png with an appropriate graphic)
+    switch (season)
+    {
+        case SEASON_CHRISTMAS :
+            fname = "Flake.png";
+            break;
+        case SEASON_EASTER :
+            fname = "Egg.png";
+            break;
+        case SEASON_HWBDAY :
+            fname = "Confetti.png";
+            break;
+        default :
+            fname = "Star.png";
+    }
+
+    sprite.load(":/res/" + fname);
 
     setAutoFillBackground(false);
 
@@ -100,7 +122,7 @@ BGWidget::BGWidget(QWidget * parent) : QWidget(parent)
 
         QPainter p;
         p.begin(rotatedSprites[i]);
-    //  p.setRenderHint(QPainter::Antialiasing);
+        //  p.setRenderHint(QPainter::Antialiasing);
         p.setRenderHint(QPainter::SmoothPixmapTransform);
         p.translate(translate.x(), translate.y());
         p.rotate(4 * i);
@@ -123,6 +145,8 @@ BGWidget::~BGWidget()
 void BGWidget::paintEvent(QPaintEvent *event)
 {
     Q_UNUSED(event);
+    if (!enabled)
+        return;
 
     QPainter p;
 
@@ -139,6 +163,9 @@ void BGWidget::paintEvent(QPaintEvent *event)
 
 void BGWidget::animate()
 {
+    if (!enabled)
+        return;
+
     for (int i = 0; i < SPRITE_MAX; i++)
     {
         QPoint oldPos = spritePositions[i]->pos();
@@ -159,6 +186,7 @@ void BGWidget::startAnimation()
 void BGWidget::stopAnimation()
 {
     timerAnimation->stop();
+    repaint();
 }
 
 void BGWidget::init()
diff --git a/QTfrontend/ui/widget/bgwidget.h b/QTfrontend/ui/widget/bgwidget.h
index 234a126..f3b49be 100644
--- a/QTfrontend/ui/widget/bgwidget.h
+++ b/QTfrontend/ui/widget/bgwidget.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email at thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -34,44 +34,46 @@
 
 class SpritePosition
 {
-public:
-    SpritePosition(QWidget * parent, int sw, int sh);
-    ~SpritePosition();
-private:
-    float fX;
-    float fY;
-    float fXMov;
-    float fYMov;
-    int iAngle;
-    QWidget * wParent;
-    int iSpriteHeight;
-    int iSpriteWidth;
-public:
-    void move();
-    void reset();
-    QPoint pos();
-    int getAngle();
-    void init();
+    public:
+        SpritePosition(QWidget * parent, int sw, int sh);
+        ~SpritePosition();
+    private:
+        float fX;
+        float fY;
+        float fXMov;
+        float fYMov;
+        int iAngle;
+        QWidget * wParent;
+        int iSpriteHeight;
+        int iSpriteWidth;
+    public:
+        void move();
+        void reset();
+        QPoint pos();
+        int getAngle();
+        void init();
 };
 
 class BGWidget : public QWidget
 {
-    Q_OBJECT
-public:
-    BGWidget(QWidget * parent);
-    ~BGWidget();
-    void startAnimation();
-    void stopAnimation();
-    void init();
-private:
-    QImage sprite;
-    QTimer * timerAnimation;
-    SpritePosition * spritePositions[SPRITE_MAX];
-    QImage * rotatedSprites[360];
-protected:
-    void paintEvent(QPaintEvent * event);
-private slots:
-    void animate();
+        Q_OBJECT
+    public:
+        BGWidget(QWidget * parent);
+        ~BGWidget();
+        void startAnimation();
+        void stopAnimation();
+        void init();
+        bool enabled;
+
+    private:
+        QImage sprite;
+        QTimer * timerAnimation;
+        SpritePosition * spritePositions[SPRITE_MAX];
+        QImage * rotatedSprites[360];
+    protected:
+        void paintEvent(QPaintEvent * event);
+    private slots:
+        void animate();
 };
 
 #endif // BGWIDGET_H
diff --git a/QTfrontend/ui/widget/chatwidget.cpp b/QTfrontend/ui/widget/chatwidget.cpp
index f75619b..9c91e11 100644
--- a/QTfrontend/ui/widget/chatwidget.cpp
+++ b/QTfrontend/ui/widget/chatwidget.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -19,88 +19,26 @@
 
 #include <QDesktopServices>
 #include <QTextBrowser>
-#include <QLineEdit>
 #include <QAction>
-#include <QTextDocument>
 #include <QFile>
-#include <QList>
-#include <QSettings>
 #include <QTextStream>
 #include <QMenu>
 #include <QCursor>
-#include <QScrollBar>
 #include <QItemSelectionModel>
-#include <QStringList>
 #include <QDateTime>
 #include <QTime>
+#include <QListView>
+#include <QModelIndexList>
+#include <QSortFilterProxyModel>
+#include <QMenu>
 
-#include <QMessageBox>
-
-
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "hwconsts.h"
 #include "gameuiconfig.h"
+#include "playerslistmodel.h"
 
 #include "chatwidget.h"
 
-ListWidgetNickItem::ListWidgetNickItem(const QString& nick, bool isFriend, bool isIgnored) : QListWidgetItem(nick)
-{
-    this->aFriend = isFriend;
-    this->isIgnored = isIgnored;
-}
-
-void ListWidgetNickItem::setFriend(bool isFriend)
-{
-    this->aFriend = isFriend;
-}
-
-void ListWidgetNickItem::setIgnored(bool isIgnored)
-{
-    this->isIgnored = isIgnored;
-}
-
-bool ListWidgetNickItem::isFriend()
-{
-    return aFriend;
-}
-
-bool ListWidgetNickItem::ignored()
-{
-    return isIgnored;
-}
-
-bool ListWidgetNickItem::operator< (const QListWidgetItem & other) const
-{
-    // case in-sensitive comparison of the associated strings
-    // chars that are no letters are sorted at the end of the list
-
-    ListWidgetNickItem otherNick = const_cast<ListWidgetNickItem &>(dynamic_cast<const ListWidgetNickItem &>(other));
-
-    // ignored always down
-    if (isIgnored != otherNick.ignored())
-        return !isIgnored;
-
-    // friends always up
-    if (aFriend != otherNick.isFriend())
-        return aFriend;
-
-    QString txt1 = text().toLower();
-    QString txt2 = other.text().toLower();
-
-    bool firstIsShorter = (txt1.size() < txt2.size());
-    int len = firstIsShorter?txt1.size():txt2.size();
-
-    for (int i = 0; i < len; i++)
-    {
-        if (txt1[i] == txt2[i])
-            continue;
-        if (txt1[i].isLetter() != txt2[i].isLetter())
-            return txt1[i].isLetter();
-        return (txt1[i] < txt2[i]);
-    }
-
-    return firstIsShorter;
-}
 
 QString * HWChatWidget::s_styleSheet = NULL;
 QStringList * HWChatWidget::s_displayNone = NULL;
@@ -126,7 +64,7 @@ void HWChatWidget::setStyleSheet(const QString & styleSheet)
     if (orgStyleSheet.isEmpty())
     {
         // load external stylesheet if there is any
-        QFile extFile(HWDataManager::instance().findFileForRead("css/chat.css"));
+        QFile extFile(DataManager::instance().findFileForRead("css/chat.css"));
 
         QFile resFile(":/res/css/chat.css");
 
@@ -175,11 +113,11 @@ void HWChatWidget::setStyleSheet(const QString & styleSheet)
     QRegExp nohierarchy("^.[^ .]+$");
 
     QStringList victims = QString(style).
-                                remove(displayed). // remove visible stuff
-                                trimmed().
-                                split(split). // get a list of the names
-                                filter(nohierarchy). // only direct class names
-                                replaceInStrings(QRegExp("^."),""); // crop .
+                          remove(displayed). // remove visible stuff
+                          trimmed().
+                          split(split). // get a list of the names
+                          filter(nohierarchy). // only direct class names
+                          replaceInStrings(QRegExp("^."),""); // crop .
 
 
     if (victims.contains("timestamp"))
@@ -240,21 +178,29 @@ void HWChatWidget::displayWarning(const QString & message)
 
 
 HWChatWidget::HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify) :
-  QWidget(parent),
-  mainLayout(this)
+    QWidget(parent),
+    mainLayout(this)
 {
     this->gameSettings = gameSettings;
     this->notify = notify;
+
+    m_isAdmin = false;
+    m_autoKickEnabled = false;
+
     if(gameSettings->value("frontend/sound", true).toBool())
     {
-        if (notify)
-            m_helloSound = HWDataManager::instance().findFileForRead(
-                            "Sounds/voices/Classic/Hello.ogg");
+        QStringList vpList =
+             QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
+
+        foreach (QString vp, vpList)
+        {
+            m_helloSounds.append(DataManager::instance().findFileForRead(
+                               QString("Sounds/voices/%1/Hello.ogg").arg(vp)));
+        }
 
-        m_hilightSound = HWDataManager::instance().findFileForRead(
-                        "Sounds/beep.ogg");
+        m_hilightSound = DataManager::instance().findFileForRead(
+                             "Sounds/beep.ogg");
 
-        //m_hilightSound = m_helloSound;//"Sounds/beep.ogg";
     }
 
     mainLayout.setSpacing(1);
@@ -278,19 +224,22 @@ HWChatWidget::HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notif
     chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     chatText->setOpenLinks(false);
     connect(chatText, SIGNAL(anchorClicked(const QUrl&)),
-        this, SLOT(linkClicked(const QUrl&)));
+            this, SLOT(linkClicked(const QUrl&)));
     mainLayout.addWidget(chatText, 0, 0, 2, 1);
 
-    chatNicks = new QListWidget(this);
+    chatNicks = new QListView(this);
+    chatNicks->setIconSize(QSize(24, 16));
+    chatNicks->setSelectionMode(QAbstractItemView::SingleSelection);
+    chatNicks->setEditTriggers(QAbstractItemView::NoEditTriggers);
     chatNicks->setMinimumHeight(10);
     chatNicks->setMinimumWidth(10);
-    chatNicks->setSortingEnabled(true);
     chatNicks->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-    chatNicks->setContextMenuPolicy(Qt::ActionsContextMenu);
-    connect(chatNicks, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
-        this, SLOT(chatNickDoubleClicked(QListWidgetItem *)));
-    connect(chatNicks, SIGNAL(currentRowChanged(int)),
-        this, SLOT(chatNickSelected(int)));
+    chatNicks->setContextMenuPolicy(Qt::CustomContextMenu);
+
+    connect(chatNicks, SIGNAL(doubleClicked(QModelIndex)),
+            this, SLOT(chatNickDoubleClicked(QModelIndex)));
+
+    connect(chatNicks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(nicksContextMenuRequested(QPoint)));
 
     mainLayout.addWidget(chatNicks, 0, 1, 3, 1);
 
@@ -325,10 +274,12 @@ HWChatWidget::HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notif
     chatNicks->insertAction(0, acInfo);
     chatNicks->insertAction(0, acIgnore);
 
-    showReady = false;
     setShowFollow(true);
 
     setAcceptDrops(true);
+
+    m_nicksMenu = new QMenu(this);
+
     clear();
 }
 
@@ -341,149 +292,41 @@ void HWChatWidget::linkClicked(const QUrl & link)
     {
         // decode nick
         QString nick = QString::fromUtf8(QByteArray::fromBase64(link.encodedQuery()));
-        QList<QListWidgetItem *> items = chatNicks->findItems(nick, Qt::MatchExactly);
+        QModelIndexList mil = chatNicks->model()->match(chatNicks->model()->index(0, 0), Qt::DisplayRole, nick);
 
-        bool isOffline = (items.size() < 1);
-
-        QMenu * popup = new QMenu(this);
+        bool isOffline = (mil.size() < 1);
 
         if (isOffline)
         {
             m_clickedNick = nick;
-            chatNickSelected(0); // update friend and ignore entry
-            chatNicks->setCurrentItem(NULL, QItemSelectionModel::Clear);
+            chatNicks->selectionModel()->clearSelection();
         }
         else
         {
-            // selecting an item will automatically scroll there, so let's save old position
-            QScrollBar * scrollBar = chatNicks->verticalScrollBar();
-            int oldScrollPos = scrollBar->sliderPosition();
-            // select the nick which we want to see the actions for
-            chatNicks->setCurrentItem(items[0], QItemSelectionModel::Clear);
-            // selecting an item will automatically scroll there, so let's save old position
-            scrollBar->setSliderPosition(oldScrollPos);
+            chatNicks->selectionModel()->select(mil[0], QItemSelectionModel::ClearAndSelect);
         }
 
-        // load actions
-        QList<QAction *> actions = chatNicks->actions();
-
-        foreach(QAction * action, actions)
-        {
-            if ((!isOffline) || (action->data().toBool()))
-                popup->addAction(action);
-        }
-
-        // display menu popup at mouse cursor position
-        popup->popup(QCursor::pos());
+        nicksContextMenuRequested(chatNicks->mapFromGlobal(QCursor::pos()));
     }
 }
 
 void HWChatWidget::setShowFollow(bool enabled)
 {
-    if (enabled) {
+    if (enabled)
+    {
         if (!(chatNicks->actions().contains(acFollow)))
             chatNicks->insertAction(acFriend, acFollow);
     }
-    else {
-        if (chatNicks->actions().contains(acFollow))
-            chatNicks->removeAction(acFollow);
-    }
-}
-
-void HWChatWidget::loadList(QStringList & list, const QString & file)
-{
-    list.clear();
-    QFile txt(cfgdir->absolutePath() + "/" + file);
-    if(!txt.open(QIODevice::ReadOnly))
-        return;
-    QTextStream stream(&txt);
-    stream.setCodec("UTF-8");
-
-    while(!stream.atEnd())
-    {
-        QString str = stream.readLine();
-        if(str.startsWith(";") || str.length() == 0)
-            continue;
-        list << str.trimmed();
-    }
-    //readd once we require newer Qt than 4.4
-    //list.removeDuplicates();
-    txt.close();
-}
-
-void HWChatWidget::saveList(QStringList & list, const QString & file)
-{
-    QFile txt(cfgdir->absolutePath() + "/" + file);
-
-    // list empty? => rather have no file for the list than an empty one
-    if (list.isEmpty())
-    {
-        if (txt.exists())
-        {
-            // try to remove file, if successful we're done here.
-            if (txt.remove())
-                return;
-        }
-        else
-            // there is no file
-            return;
-    }
-
-    if(!txt.open(QIODevice::WriteOnly | QIODevice::Truncate))
-        return;
-    QTextStream stream(&txt);
-    stream.setCodec("UTF-8");
-
-    stream << "; this list is used by Hedgewars - do not edit it unless you know what you're doing!" << endl;
-    for(int i = 0; i < list.size(); i++)
-        stream << list[i] << endl;
-    txt.close();
-}
-
-void HWChatWidget::updateNickItem(QListWidgetItem *nickItem)
-{
-    QString nick = nickItem->text();
-    ListWidgetNickItem * item = dynamic_cast<ListWidgetNickItem*>(nickItem);
-
-    item->setFriend(friendsList.contains(nick, Qt::CaseInsensitive));
-    item->setIgnored(ignoreList.contains(nick, Qt::CaseInsensitive));
-
-    if(item->ignored())
-    {
-        item->setIcon(QIcon(showReady ? (item->data(Qt::UserRole).toBool() ? ":/res/chat_ignore_on.png" : ":/res/chat_ignore_off.png") : ":/res/chat_ignore.png"));
-        item->setForeground(Qt::gray);
-    }
-    else if(item->isFriend())
-    {
-        item->setIcon(QIcon(showReady ? (item->data(Qt::UserRole).toBool() ? ":/res/chat_friend_on.png" : ":/res/chat_friend_off.png") : ":/res/chat_friend.png"));
-        item->setForeground(Qt::green);
-    }
     else
     {
-        item->setIcon(QIcon(showReady ? (item->data(Qt::UserRole).toBool() ? ":/res/chat_default_on.png" : ":/res/chat_default_off.png") : ":/res/chat_default.png"));
-        item->setForeground(QBrush(QColor(0xff, 0xcc, 0x00)));
+        if (chatNicks->actions().contains(acFollow))
+            chatNicks->removeAction(acFollow);
     }
 }
 
-void HWChatWidget::updateNickItems()
-{
-    for(int i = 0; i < chatNicks->count(); i++)
-        updateNickItem(chatNicks->item(i));
-
-    chatNicks->sortItems();
-}
-
-void HWChatWidget::loadLists(const QString & nick)
+void HWChatWidget::setIgnoreListKick(bool enabled)
 {
-    loadList(ignoreList, nick.toLower() + "_ignore.txt");
-    loadList(friendsList, nick.toLower() + "_friends.txt");
-    updateNickItems();
-}
-
-void HWChatWidget::saveLists(const QString & nick)
-{
-    saveList(ignoreList, nick.toLower() + "_ignore.txt");
-    saveList(friendsList, nick.toLower() + "_friends.txt");
+    m_autoKickEnabled = enabled;
 }
 
 
@@ -510,7 +353,7 @@ QString HWChatWidget::linkedNick(const QString & nickname)
 {
     if (nickname != m_userNick)
         return QString("<a href=\"hwnick://?%1\" class=\"nick\">%2</a>").arg(
-               QString(nickname.toUtf8().toBase64())).arg(Qt::escape(nickname));
+                   QString(nickname.toUtf8().toBase64())).arg(Qt::escape(nickname));
 
     // unlinked nick (if own one)
     return QString("<span class=\"nick\">%1</span>").arg(Qt::escape(nickname));
@@ -526,16 +369,24 @@ const QRegExp HWChatWidget::URLREGEXP = QRegExp("(http://)?(www\\.)?(hedgewars\\
 
 void HWChatWidget::onChatString(const QString& nick, const QString& str)
 {
-    bool isFriend = false;
+    QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
+    if(!playersSortFilterModel)
+        return;
+
+    PlayersListModel * players = qobject_cast<PlayersListModel *>(playersSortFilterModel->sourceModel());
 
-    if (!nick.isEmpty()) {
+    if(!players)
+        return;
+
+    if (!nick.isEmpty())
+    {
         // don't show chat lines that are from ignored nicks
-        if (ignoreList.contains(nick, Qt::CaseInsensitive))
+        if (players->isFlagSet(nick, PlayersListModel::Ignore))
             return;
-        // friends will get special treatment, of course
-        isFriend = friendsList.contains(nick, Qt::CaseInsensitive);
     }
 
+    bool isFriend = (!nick.isEmpty()) && players->isFlagSet(nick, PlayersListModel::Friend);
+
     QString formattedStr = Qt::escape(str.mid(1));
     // make hedgewars.org urls actual links
     formattedStr = formattedStr.replace(URLREGEXP, "<a href=\"http://\\3\">\\3</a>");
@@ -564,7 +415,7 @@ void HWChatWidget::onChatString(const QString& nick, const QString& str)
     bool isHL = false;
 
     if ((c != 3) && (!nick.isEmpty()) &&
-        (nick != m_userNick) && (!m_userNick.isEmpty()))
+            (nick != m_userNick) && (!m_userNick.isEmpty()))
     {
         QString lcStr = str.toLower();
 
@@ -623,20 +474,35 @@ void HWChatWidget::onServerMessage(const QString& str)
     chatText->moveCursor(QTextCursor::End);
 }
 
+
 void HWChatWidget::nickAdded(const QString & nick, bool notifyNick)
 {
-    bool isIgnored = ignoreList.contains(nick, Qt::CaseInsensitive);
-    QListWidgetItem * item = new ListWidgetNickItem(nick, friendsList.contains(nick, Qt::CaseInsensitive), isIgnored);
-    updateNickItem(item);
-    chatNicks->addItem(item);
+    QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
+    if(!playersSortFilterModel)
+        return;
+
+    PlayersListModel * players = qobject_cast<PlayersListModel *>(playersSortFilterModel->sourceModel());
+
+    if(!players)
+        return;
+
+    bool isIgnored = players->isFlagSet(nick, PlayersListModel::Ignore);
+
+    if (isIgnored && m_isAdmin && m_autoKickEnabled)
+    {
+        emit kick(nick);
+        return;
+    }
 
     if ((!isIgnored) && (nick != m_userNick)) // don't auto-complete own name
         chatEditLine->addNickname(nick);
 
-    emit nickCountUpdate(chatNicks->count());
+    emit nickCountUpdate(chatNicks->model()->rowCount());
 
-    if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool()) {
-       SDLInteraction::instance().playSoundFile(m_helloSound);
+    if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool())
+    {
+        SDLInteraction::instance().playSoundFile(
+                            m_helloSounds.at(rand() % m_helloSounds.size()));
     }
 }
 
@@ -644,10 +510,7 @@ void HWChatWidget::nickRemoved(const QString& nick)
 {
     chatEditLine->removeNickname(nick);
 
-    foreach(QListWidgetItem * item, chatNicks->findItems(nick, Qt::MatchExactly))
-        chatNicks->takeItem(chatNicks->row(item));
-
-    emit nickCountUpdate(chatNicks->count());
+    emit nickCountUpdate(chatNicks->model()->rowCount());
 }
 
 void HWChatWidget::clear()
@@ -661,7 +524,7 @@ void HWChatWidget::clear()
 
     chatText->clear();
     chatStrings.clear();
-    chatNicks->clear();
+    //chatNicks->clear();
 
     // clear and re compile regexp for highlighting
     m_highlights.clear();
@@ -669,9 +532,9 @@ void HWChatWidget::clear()
     QString hlRegExp("^(.* )?%1[^-a-z0-9_]*( .*)?$");
     QRegExp whitespace("\\s");
 
-    m_highlights.append(QRegExp(hlRegExp.arg(m_userNick)));
+    m_highlights.append(QRegExp(hlRegExp.arg(m_userNick.toLower())));
 
-    QFile file(cfgdir->absolutePath() + "/" + m_userNick + "_highlight.txt");
+    QFile file(cfgdir->absolutePath() + "/" + m_userNick.toLower() + "_highlight.txt");
 
     if (file.exists() && (file.open(QIODevice::ReadOnly | QIODevice::Text)))
     {
@@ -683,7 +546,7 @@ void HWChatWidget::clear()
             foreach (QString word, list)
             {
                 m_highlights.append(QRegExp(
-                                hlRegExp.arg(QRegExp::escape(word.toLower()))));
+                                        hlRegExp.arg(QRegExp::escape(word.toLower()))));
             }
         }
 
@@ -691,7 +554,7 @@ void HWChatWidget::clear()
             file.close();
     }
 
-    QFile file2(cfgdir->absolutePath() + "/" + m_userNick + "_hlregexp.txt");
+    QFile file2(cfgdir->absolutePath() + "/" + m_userNick.toLower() + "_hlregexp.txt");
 
     if (file2.exists() && (file2.open(QIODevice::ReadOnly | QIODevice::Text)))
     {
@@ -708,184 +571,135 @@ void HWChatWidget::clear()
 
 void HWChatWidget::onKick()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    if (curritem)
-    {
-        displayNotice(tr("Kicking %1 ...").arg(Qt::escape(curritem->text())));
-        emit kick(curritem->text());
-    }
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    if(mil.size())
+        emit kick(mil[0].data().toString());
 }
 
 void HWChatWidget::onBan()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    if (curritem)
-        emit ban(curritem->text());
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    if(mil.size())
+        emit ban(mil[0].data().toString());
 }
 
 void HWChatWidget::onInfo()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    if (curritem)
-        emit info(curritem->text());
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    if(mil.size())
+        emit info(mil[0].data().toString());
 }
 
 void HWChatWidget::onFollow()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    if (curritem)
-        emit follow(curritem->text());
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    if(mil.size())
+        emit follow(mil[0].data().toString());
 }
 
 void HWChatWidget::onIgnore()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    QString nick = "";
-    if(curritem != NULL)
-        nick = curritem->text();
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    QString nick;
+    if(mil.size())
+        nick = mil[0].data().toString();
     else
         nick = m_clickedNick;
 
-    if(ignoreList.contains(nick, Qt::CaseInsensitive)) // already on list - remove him
+    QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
+    if(!playersSortFilterModel)
+        return;
+
+    PlayersListModel * players = qobject_cast<PlayersListModel *>(playersSortFilterModel->sourceModel());
+
+    if(!players)
+        return;
+
+    if(players->isFlagSet(nick, PlayersListModel::Ignore))
     {
-        ignoreList.removeAll(nick.toLower());
+        players->setFlag(nick, PlayersListModel::Ignore, false);
         chatEditLine->addNickname(nick);
         displayNotice(tr("%1 has been removed from your ignore list").arg(linkedNick(nick)));
     }
     else // not on list - add
     {
         // don't consider ignored people friends
-        if(friendsList.contains(nick, Qt::CaseInsensitive))
+        if(players->isFlagSet(nick, PlayersListModel::Friend))
             emit onFriend();
 
-        // scroll down on first ignore added so that people see where that nick went to
-        if (ignoreList.isEmpty())
-            chatNicks->scrollToBottom();
-
-        ignoreList << nick.toLower();
+        players->setFlag(nick, PlayersListModel::Ignore, true);
         chatEditLine->removeNickname(nick);
         displayNotice(tr("%1 has been added to your ignore list").arg(linkedNick(nick)));
     }
 
-    if(curritem != NULL)
-    {
-        updateNickItem(curritem); // update icon/sort order/etc
-        chatNicks->sortItems();
-        chatNickSelected(0); // update context menu
-    }
+    if(mil.size())
+        chatNicks->scrollTo(chatNicks->selectionModel()->selectedRows()[0]);
 }
 
 void HWChatWidget::onFriend()
 {
-    QListWidgetItem * curritem = chatNicks->currentItem();
-    QString nick = "";
-    if(curritem != NULL)
-        nick = curritem->text();
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    QString nick;
+    if(mil.size())
+        nick = mil[0].data().toString();
     else
         nick = m_clickedNick;
 
-    if(friendsList.contains(nick, Qt::CaseInsensitive)) // already on list - remove him
+    QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
+    if(!playersSortFilterModel)
+        return;
+
+    PlayersListModel * players = qobject_cast<PlayersListModel *>(playersSortFilterModel->sourceModel());
+
+    if(!players)
+        return;
+
+    if(players->isFlagSet(nick, PlayersListModel::Friend))
     {
-        friendsList.removeAll(nick.toLower());
+        players->setFlag(nick, PlayersListModel::Friend, false);
+        chatEditLine->removeNickname(nick);
         displayNotice(tr("%1 has been removed from your friends list").arg(linkedNick(nick)));
     }
     else // not on list - add
     {
-        // don't ignore the new friend
-        if(ignoreList.contains(nick, Qt::CaseInsensitive))
+        if(players->isFlagSet(nick, PlayersListModel::Ignore))
             emit onIgnore();
 
-        // scroll up on first friend added so that people see where that nick went to
-        if (friendsList.isEmpty())
-            chatNicks->scrollToTop();
-
-        friendsList << nick.toLower();
+        players->setFlag(nick, PlayersListModel::Friend, true);
+        chatEditLine->addNickname(nick);
         displayNotice(tr("%1 has been added to your friends list").arg(linkedNick(nick)));
     }
 
-    if(curritem != NULL)
-    {
-        updateNickItem(curritem); // update icon/sort order/etc
-        chatNicks->sortItems();
-        chatNickSelected(0); // update context menu
-    }
+    if(mil.size())
+        chatNicks->scrollTo(chatNicks->selectionModel()->selectedRows()[0]);
 }
 
-void HWChatWidget::chatNickDoubleClicked(QListWidgetItem * item)
+void HWChatWidget::chatNickDoubleClicked(const QModelIndex &index)
 {
-    if (item != NULL)
-        m_clickedNick = item->text();
-    else
-        m_clickedNick = "";
+    m_clickedNick = index.data().toString();
+
     QList<QAction *> actions = chatNicks->actions();
     actions.first()->activate(QAction::Trigger);
 }
 
-void HWChatWidget::chatNickSelected(int index)
-{
-    Q_UNUSED(index);
-
-    QListWidgetItem* item = chatNicks->currentItem();
-    QString nick = "";
-    if (item != NULL)
-        nick = item->text();
-    else
-        nick = m_clickedNick;
-
-    // update context menu labels according to possible action
-    if(ignoreList.contains(nick, Qt::CaseInsensitive))
-    {
-        acIgnore->setText(QAction::tr("Unignore"));
-        acIgnore->setIcon(QIcon(":/res/unignore.png"));
-    }
-    else
-    {
-        acIgnore->setText(QAction::tr("Ignore"));
-        acIgnore->setIcon(QIcon(":/res/ignore.png"));
-    }
-
-    if(friendsList.contains(nick, Qt::CaseInsensitive))
-    {
-        acFriend->setText(QAction::tr("Remove friend"));
-        acFriend->setIcon(QIcon(":/res/remfriend.png"));
-    }
-    else
-    {
-        acFriend->setText(QAction::tr("Add friend"));
-        acFriend->setIcon(QIcon(":/res/addfriend.png"));
-    }
-}
-
-void HWChatWidget::setShowReady(bool s)
-{
-    showReady = s;
-}
-
-void HWChatWidget::setReadyStatus(const QString & nick, bool isReady)
-{
-    QList<QListWidgetItem *> items = chatNicks->findItems(nick, Qt::MatchExactly);
-    if (items.size() != 1)
-    {
-        qWarning("Bug: cannot find user in chat");
-        return;
-    }
-
-    items[0]->setData(Qt::UserRole, isReady); // bulb status
-    updateNickItem(items[0]);
-
-    // ensure we're still showing the status bulbs
-    showReady = true;
-}
 
 void HWChatWidget::adminAccess(bool b)
 {
     chatNicks->removeAction(acKick);
     chatNicks->removeAction(acBan);
 
+    m_isAdmin = b;
+
     if(b)
     {
         chatNicks->insertAction(0, acKick);
-//      chatNicks->insertAction(0, acBan);
+        chatNicks->insertAction(0, acBan);
     }
 }
 
@@ -949,7 +763,7 @@ void HWChatWidget::discardStyleSheet()
 void HWChatWidget::saveStyleSheet()
 {
     QString dest =
-        HWDataManager::instance().findFileForWrite("css/chat.css");
+        DataManager::instance().findFileForWrite("css/chat.css");
 
     QFile file(dest);
     if (file.open(QIODevice::WriteOnly | QIODevice::Text))
@@ -1006,3 +820,75 @@ void HWChatWidget::setUser(const QString & nickname)
     nickRemoved(nickname);
     clear();
 }
+
+
+void HWChatWidget::setUsersModel(QAbstractItemModel *model)
+{
+    chatNicks->selectionModel()->deleteLater();
+
+    chatNicks->setModel(model);
+    chatNicks->setModelColumn(0);
+}
+
+void HWChatWidget::nicksContextMenuRequested(const QPoint &pos)
+{
+    QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+    QString nick;
+
+    if(mil.size())
+        nick = mil[0].data().toString();
+    else
+        nick = m_clickedNick;
+
+    QSortFilterProxyModel * playersSortFilterModel = qobject_cast<QSortFilterProxyModel *>(chatNicks->model());
+    if(!playersSortFilterModel)
+        return;
+
+    PlayersListModel * players = qobject_cast<PlayersListModel *>(playersSortFilterModel->sourceModel());
+
+    if(!players)
+        return;
+
+    bool isSelf = (nick == m_userNick);
+
+    acFollow->setVisible(!isSelf);
+
+    // update context menu labels according to possible action
+    if(players->isFlagSet(nick, PlayersListModel::Ignore))
+    {
+        acIgnore->setText(QAction::tr("Unignore"));
+        acIgnore->setIcon(QIcon(":/res/unignore.png"));
+    }
+    else
+    {
+        acIgnore->setText(QAction::tr("Ignore"));
+        acIgnore->setIcon(QIcon(":/res/ignore.png"));
+        acIgnore->setVisible(!isSelf);
+    }
+
+    if(players->isFlagSet(nick, PlayersListModel::Friend))
+    {
+        acFriend->setText(QAction::tr("Remove friend"));
+        acFriend->setIcon(QIcon(":/res/remfriend.png"));
+    }
+    else
+    {
+        acFriend->setText(QAction::tr("Add friend"));
+        acFriend->setIcon(QIcon(":/res/addfriend.png"));
+        acFriend->setVisible(!isSelf);
+    }
+
+    if (m_isAdmin)
+    {
+        acKick->setVisible(!isSelf);
+        acBan->setVisible(!isSelf);
+    }
+
+    m_nicksMenu->clear();
+
+    foreach(QAction * action, chatNicks->actions())
+        m_nicksMenu->addAction(action);
+
+    m_nicksMenu->popup(chatNicks->mapToGlobal(pos));
+}
diff --git a/QTfrontend/ui/widget/chatwidget.h b/QTfrontend/ui/widget/chatwidget.h
index dcc97b8..bdc168c 100644
--- a/QTfrontend/ui/widget/chatwidget.h
+++ b/QTfrontend/ui/widget/chatwidget.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,39 +21,24 @@
 #define _CHAT_WIDGET_INCLUDED
 
 #include <QWidget>
-#include <QListWidget>
 #include <QString>
 #include <QGridLayout>
 #include <QList>
 #include <QPair>
 #include <QRegExp>
+#include <QHash>
+#include <QListWidgetItem>
 
 #include "SDLInteraction.h"
 
 #include "SmartLineEdit.h"
 
-class ListWidgetNickItem;
 class QTextBrowser;
 class QLineEdit;
-class QListWidget;
+class QListView;
 class QSettings;
-
-/// Class for custom nickname sorting
-class ListWidgetNickItem : public QListWidgetItem
-{
-public:
-  ListWidgetNickItem(const QString& nick, bool isFriend, bool isIgnored);
-  bool operator<(const QListWidgetItem & other) const;
-  void setFriend(bool isFriend);
-  void setIgnored(bool isIgnored);
-  bool isFriend();
-  bool ignored();
-
-private:
-  bool aFriend;
-  bool isIgnored;
-};
-
+class QAbstractItemModel;
+class QMenu;
 
 /**
  * @brief Chat widget.
@@ -66,94 +51,89 @@ private:
 
 class HWChatWidget : public QWidget
 {
-  Q_OBJECT
-
- public:
-  HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify);
-  void loadLists(const QString & nick);
-  void saveLists(const QString & nick);
-  void setShowReady(bool s);
-  void setShowFollow(bool enabled);
-  QStringList ignoreList, friendsList;
-  static const QString & styleSheet();
-  void displayError(const QString & message);
-  void displayNotice(const QString & message);
-  void displayWarning(const QString & message);
-  void setUser(const QString & nickname);
-
-protected:
-    virtual void dragEnterEvent(QDragEnterEvent * event);
-    virtual void dropEvent(QDropEvent * event);
-
-private:
-  static QString * s_styleSheet;
-  static QStringList * s_displayNone;
-  static bool s_isTimeStamped;
-  static QString s_tsFormat;
-  static const QRegExp URLREGEXP;
-
-  static void setStyleSheet(const QString & styleSheet = "");
-
-  void loadList(QStringList & list, const QString & file);
-  void saveList(QStringList & list, const QString & file);
-  void updateNickItem(QListWidgetItem *item);
-  void updateNickItems();
-  void addLine(const QString & cssClass, QString line, bool isHighlight = false);
-  bool parseCommand(const QString & line);
-  void discardStyleSheet();
-  void saveStyleSheet();
-  QString linkedNick(const QString & nickname);
-
- public slots:
-  void onChatString(const QString& str);
-  void onChatString(const QString& nick, const QString& str);
-  void onServerMessage(const QString& str);
-  void nickAdded(const QString& nick, bool notifyNick);
-  void nickRemoved(const QString& nick);
-  void clear();
-  void setReadyStatus(const QString & nick, bool isReady);
-  void adminAccess(bool);
-
- signals:
-  void chatLine(const QString& str);
-  void kick(const QString & str);
-  void ban(const QString & str);
-  void info(const QString & str);
-  void follow(const QString &);
-  void nickCountUpdate(int cnt);
-
- private:
-  QGridLayout mainLayout;
-  QTextBrowser* chatText;
-  QStringList chatStrings;
-  QListWidget* chatNicks;
-  SmartLineEdit* chatEditLine;
-  QAction * acInfo;
-  QAction * acKick;
-  QAction * acBan;
-  QAction * acFollow;
-  QAction * acIgnore;
-  QAction * acFriend;
-  QSettings * gameSettings;
-  QString m_helloSound;
-  QString m_hilightSound;
-  QString m_userNick;
-  QString m_clickedNick;
-  QList<QRegExp> m_highlights; ///< regular expressions used for highlighting
-  bool notify;
-  bool showReady;
-
- private slots:
-  void returnPressed();
-  void onBan();
-  void onKick();
-  void onInfo();
-  void onFollow();
-  void onIgnore();
-  void onFriend();
-  void chatNickDoubleClicked(QListWidgetItem * item);
-  void chatNickSelected(int index);
-  void linkClicked(const QUrl & link);
+        Q_OBJECT
+
+    public:
+        HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify);
+        void setIgnoreListKick(bool enabled); ///< automatically kick people on ignore list (if possible)
+        void setShowFollow(bool enabled);
+        static const QString & styleSheet();
+        void displayError(const QString & message);
+        void displayNotice(const QString & message);
+        void displayWarning(const QString & message);
+        void setUser(const QString & nickname);
+        void setUsersModel(QAbstractItemModel * model);
+
+    protected:
+        virtual void dragEnterEvent(QDragEnterEvent * event);
+        virtual void dropEvent(QDropEvent * event);
+
+    private:
+        static QString * s_styleSheet;
+        static QStringList * s_displayNone;
+        static bool s_isTimeStamped;
+        static QString s_tsFormat;
+        static const QRegExp URLREGEXP;
+
+        static void setStyleSheet(const QString & styleSheet = "");
+
+        void addLine(const QString & cssClass, QString line, bool isHighlight = false);
+        bool parseCommand(const QString & line);
+        void discardStyleSheet();
+        void saveStyleSheet();
+        QString linkedNick(const QString & nickname);
+
+    public slots:
+        void onChatString(const QString& str);
+        void onChatString(const QString& nick, const QString& str);
+        void onServerMessage(const QString& str);
+        void nickAdded(const QString& nick, bool notifyNick);
+        void nickRemoved(const QString& nick);
+        void clear();
+        void adminAccess(bool);
+
+    signals:
+        void chatLine(const QString& str);
+        void kick(const QString & str);
+        void ban(const QString & str);
+        void info(const QString & str);
+        void follow(const QString &);
+        void nickCountUpdate(int cnt);
+
+    private:
+        bool m_isAdmin;
+        QGridLayout mainLayout;
+        QTextBrowser* chatText;
+        QStringList chatStrings;
+        QListView* chatNicks;
+        SmartLineEdit* chatEditLine;
+        QAction * acInfo;
+        QAction * acKick;
+        QAction * acBan;
+        QAction * acFollow;
+        QAction * acIgnore;
+        QAction * acFriend;
+        QSettings * gameSettings;
+        QMenu * m_nicksMenu;
+        QStringList m_helloSounds;
+        QString m_hilightSound;
+        QString m_userNick;
+        QString m_clickedNick;
+        QList<QRegExp> m_highlights; ///< regular expressions used for highlighting
+        bool notify;
+        bool m_autoKickEnabled;
+
+    private slots:
+        void returnPressed();
+        void onBan();
+        void onKick();
+        void onInfo();
+        void onFollow();
+        void onIgnore();
+        void onFriend();
+        void chatNickDoubleClicked(const QModelIndex & index);
+        void linkClicked(const QUrl & link);
+        void nicksContextMenuRequested(const QPoint & pos);
 };
 
 #endif // _CHAT_WIDGET_INCLUDED
diff --git a/QTfrontend/ui/widget/colorwidget.cpp b/QTfrontend/ui/widget/colorwidget.cpp
new file mode 100644
index 0000000..5929109
--- /dev/null
+++ b/QTfrontend/ui/widget/colorwidget.cpp
@@ -0,0 +1,84 @@
+#include <QStandardItemModel>
+#include <QMouseEvent>
+#include <QWheelEvent>
+#include <QColor>
+
+#include "colorwidget.h"
+#include "hwconsts.h"
+
+ColorWidget::ColorWidget(QStandardItemModel *colorsModel, QWidget *parent) :
+    QFrame(parent)
+{
+    m_colorsModel = colorsModel;
+
+    setColor(0);
+    setAutoFillBackground(true);
+
+    connect(m_colorsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(dataChanged(QModelIndex,QModelIndex)));
+}
+
+ColorWidget::~ColorWidget()
+{
+
+}
+
+void ColorWidget::setColor(int color)
+{
+    Q_ASSERT_X(color >= 0 && color < m_colorsModel->rowCount(), "ColorWidget::setColor", "Color index out of range");
+
+    m_color = color;
+
+    QStandardItem * item = m_colorsModel->item(m_color);
+
+    setStyleSheet(QString("border: 2px solid orange; border-radius: 8px; background: %1").arg(item->data().value<QColor>().name()));
+    /*
+    QPalette p = palette();
+    p.setColor(QPalette::Window, item->data().value<QColor>());
+    setPalette(p);
+    */
+
+    emit colorChanged(m_color);
+}
+
+int ColorWidget::getColor()
+{
+    return m_color;
+}
+
+void ColorWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
+{
+    if(m_color >= topLeft.row() && m_color <= bottomRight.row())
+        setColor(m_color);
+}
+
+void ColorWidget::mousePressEvent(QMouseEvent * event)
+{
+    switch(event->button())
+    {
+        case Qt::LeftButton:
+            nextColor();
+            break;
+        case Qt::RightButton:
+            previousColor();
+            break;
+        default:;
+    }
+}
+
+void ColorWidget::wheelEvent(QWheelEvent *event)
+{
+    if(event->delta() > 0)
+        previousColor();
+    else
+        nextColor();
+}
+
+void ColorWidget::nextColor()
+{
+    setColor((m_color + 1) % m_colorsModel->rowCount());
+}
+
+void ColorWidget::previousColor()
+{
+    setColor((m_color + m_colorsModel->rowCount() - 1) % m_colorsModel->rowCount());
+}
diff --git a/QTfrontend/ui/widget/colorwidget.h b/QTfrontend/ui/widget/colorwidget.h
new file mode 100644
index 0000000..4d2acb4
--- /dev/null
+++ b/QTfrontend/ui/widget/colorwidget.h
@@ -0,0 +1,42 @@
+#ifndef COLORWIDGET_H
+#define COLORWIDGET_H
+
+#include <QFrame>
+#include <QModelIndex>
+
+namespace Ui {
+class ColorWidget;
+}
+
+class QStandardItemModel;
+
+class ColorWidget : public QFrame
+{
+    Q_OBJECT
+    
+public:
+    explicit ColorWidget(QStandardItemModel *colorsModel, QWidget *parent = 0);
+    ~ColorWidget();
+
+    void setColors(QStandardItemModel * colorsModel);
+    void setColor(int color);
+    int getColor();
+
+signals:
+    void colorChanged(int color);
+    
+private:
+    int m_color;
+    QStandardItemModel * m_colorsModel;
+
+private slots:
+    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+
+protected:
+    void mousePressEvent(QMouseEvent * event);
+    void wheelEvent(QWheelEvent * event);
+    void nextColor();
+    void previousColor();
+};
+
+#endif // COLORWIDGET_H
diff --git a/QTfrontend/ui/widget/databrowser.cpp b/QTfrontend/ui/widget/databrowser.cpp
index bf860c0..6ac4f2e 100644
--- a/QTfrontend/ui/widget/databrowser.cpp
+++ b/QTfrontend/ui/widget/databrowser.cpp
@@ -1,3 +1,26 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataBrowser class implementation
+ */
+
 #include <QNetworkAccessManager>
 #include <QNetworkRequest>
 #include <QNetworkReply>
@@ -24,19 +47,18 @@ QVariant DataBrowser::loadResource(int type, const QUrl & name)
         {
             return resources.take(name.toString());
         }
-        else
-            if(!requestedResources.contains(name.toString()))
-            {
-                qDebug() << "Requesting resource" << name.toString();
-                requestedResources.insert(name.toString());
-
-                QNetworkRequest newRequest(QUrl("http://www.hedgewars.org" + name.toString()));
-                newRequest.setAttribute(typeAttribute, type);
-                newRequest.setAttribute(urlAttribute, name);
-
-                QNetworkReply *reply = manager->get(newRequest);
-                connect(reply, SIGNAL(finished()), this, SLOT(resourceDownloaded()));
-            }
+        else if(!requestedResources.contains(name.toString()))
+        {
+            qDebug() << "Requesting resource" << name.toString();
+            requestedResources.insert(name.toString());
+
+            QNetworkRequest newRequest(QUrl("http://www.hedgewars.org" + name.toString()));
+            newRequest.setAttribute(typeAttribute, type);
+            newRequest.setAttribute(urlAttribute, name);
+
+            QNetworkReply *reply = manager->get(newRequest);
+            connect(reply, SIGNAL(finished()), this, SLOT(resourceDownloaded()));
+        }
     }
 
     return QVariant();
diff --git a/QTfrontend/ui/widget/databrowser.h b/QTfrontend/ui/widget/databrowser.h
index 153c86e..8068f5e 100644
--- a/QTfrontend/ui/widget/databrowser.h
+++ b/QTfrontend/ui/widget/databrowser.h
@@ -1,5 +1,28 @@
-#ifndef DATABROWSER_H
-#define DATABROWSER_H
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataBrowser class definition
+ */
+
+#ifndef HEDGEWARS_DATABROWSER_H
+#define HEDGEWARS_DATABROWSER_H
 
 #include <QTextBrowser>
 #include <QSet>
@@ -8,26 +31,26 @@ class QNetworkAccessManager;
 
 class DataBrowser : public QTextBrowser
 {
-    Q_OBJECT
-public:
-    explicit DataBrowser(QWidget *parent = 0);
+        Q_OBJECT
+    public:
+        explicit DataBrowser(QWidget *parent = 0);
 
-signals:
+    signals:
 
-public slots:
+    public slots:
 
-private:
-    QNetworkAccessManager *manager;
-    
-    // hash and set of QString instead of QUrl to support Qt versions 
-    // older than 4.7 (those have no support for qHash(const QUrl &))
-    QHash<QString, QByteArray> resources;
-    QSet<QString> requestedResources;
+    private:
+        QNetworkAccessManager *manager;
 
-    QVariant loadResource(int type, const QUrl & name);
+        // hash and set of QString instead of QUrl to support Qt versions
+        // older than 4.7 (those have no support for qHash(const QUrl &))
+        QHash<QString, QByteArray> resources;
+        QSet<QString> requestedResources;
 
-private slots:
-    void resourceDownloaded();
+        QVariant loadResource(int type, const QUrl & name);
+
+    private slots:
+        void resourceDownloaded();
 };
 
-#endif // DATABROWSER_H
+#endif // HEDGEWARS_DATABROWSER_H
diff --git a/QTfrontend/ui/widget/drawmapwidget.cpp b/QTfrontend/ui/widget/drawmapwidget.cpp
index 376e325..ce5bbf9 100644
--- a/QTfrontend/ui/widget/drawmapwidget.cpp
+++ b/QTfrontend/ui/widget/drawmapwidget.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -19,6 +19,7 @@
 #include <QFile>
 #include <QMessageBox>
 #include <QEvent>
+#include <QDebug>
 
 #include "drawmapwidget.h"
 
@@ -39,19 +40,22 @@ DrawMapWidget::~DrawMapWidget()
 void DrawMapWidget::changeEvent(QEvent *e)
 {
     QWidget::changeEvent(e);
-    switch (e->type()) {
-    case QEvent::LanguageChange:
-        ui->retranslateUi(this);
-        break;
-    default:
-        break;
+    switch (e->type())
+    {
+        case QEvent::LanguageChange:
+            ui->retranslateUi(this);
+            break;
+        default:
+            break;
     }
 }
 
 void DrawMapWidget::setScene(DrawMapScene * scene)
 {
-    ui->graphicsView->setScene(scene);
     m_scene = scene;
+
+    ui->graphicsView->setScene(scene);
+    connect(scene, SIGNAL(pathChanged()), this, SLOT(pathChanged()));
 }
 
 void DrawMapWidget::resizeEvent(QResizeEvent * event)
@@ -79,6 +83,11 @@ void DrawMapWidget::clear()
     if(m_scene) m_scene->clearMap();
 }
 
+void DrawMapWidget::setErasing(bool erasing)
+{
+    if(m_scene) m_scene->setErasing(erasing);
+}
+
 void DrawMapWidget::save(const QString & fileName)
 {
     if(m_scene)
@@ -86,7 +95,14 @@ void DrawMapWidget::save(const QString & fileName)
         QFile file(fileName);
 
         if(!file.open(QIODevice::WriteOnly))
-            QMessageBox::warning(this, tr("File error"), tr("Cannot open file '%1' for writing").arg(fileName));
+        {
+            QMessageBox errorMsg(this);
+            errorMsg.setIcon(QMessageBox::Warning);
+            errorMsg.setWindowTitle(QMessageBox::tr("File error"));
+            errorMsg.setText(QMessageBox::tr("Cannot open '%1' for writing").arg(fileName));
+            errorMsg.setWindowModality(Qt::WindowModal);
+            errorMsg.exec();
+        }
         else
             file.write(qCompress(m_scene->encode()).toBase64());
     }
@@ -99,8 +115,65 @@ void DrawMapWidget::load(const QString & fileName)
         QFile f(fileName);
 
         if(!f.open(QIODevice::ReadOnly))
-            QMessageBox::warning(this, tr("File error"), tr("Cannot read file '%1'").arg(fileName));
+        {
+            QMessageBox errorMsg(this);
+            errorMsg.setIcon(QMessageBox::Warning);
+            errorMsg.setWindowTitle(QMessageBox::tr("File error"));
+            errorMsg.setText(QMessageBox::tr("Cannot open '%1' for reading").arg(fileName));
+            errorMsg.setWindowModality(Qt::WindowModal);
+            errorMsg.exec();
+        }
         else
             m_scene->decode(qUncompress(QByteArray::fromBase64(f.readAll())));
     }
 }
+
+void DrawMapWidget::pathChanged()
+{
+    ui->lblPoints->setNum(m_scene->pointsCount());
+}
+
+
+
+DrawMapView::DrawMapView(QWidget *parent) :
+    QGraphicsView(parent)
+{
+   setMouseTracking(true);
+
+    m_scene = 0;
+}
+
+
+DrawMapView::~DrawMapView()
+{
+
+}
+
+void DrawMapView::setScene(DrawMapScene *scene)
+{
+    m_scene = scene;
+
+    QGraphicsView::setScene(scene);
+}
+
+// Why don't I ever recieve this event?
+void DrawMapView::enterEvent(QEvent *event)
+{
+    if(m_scene)
+        m_scene->showCursor();
+
+    QGraphicsView::enterEvent(event);
+}
+
+void DrawMapView::leaveEvent(QEvent *event)
+{
+    if(m_scene)
+        m_scene->hideCursor();
+
+    QGraphicsView::leaveEvent(event);
+}
+
+bool DrawMapView::viewportEvent(QEvent *event)
+{
+    return QGraphicsView::viewportEvent(event);
+}
diff --git a/QTfrontend/ui/widget/drawmapwidget.h b/QTfrontend/ui/widget/drawmapwidget.h
index eb377d0..767337a 100644
--- a/QTfrontend/ui/widget/drawmapwidget.h
+++ b/QTfrontend/ui/widget/drawmapwidget.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,33 +23,61 @@
 #include <QHBoxLayout>
 #include <QPushButton>
 #include <QGraphicsView>
+#include <QLabel>
 
 #include "qaspectratiolayout.h"
 #include "drawmapscene.h"
 
-namespace Ui {
+
+class DrawMapView : public QGraphicsView
+{
+    Q_OBJECT
+
+public:
+    explicit DrawMapView(QWidget *parent = 0);
+    ~DrawMapView();
+
+    void setScene(DrawMapScene *scene);
+
+protected:
+    void enterEvent(QEvent * event);
+    void leaveEvent(QEvent * event);
+    bool viewportEvent(QEvent * event);
+
+private:
+    DrawMapScene * m_scene;
+};
+
+namespace Ui
+{
     class Ui_DrawMapWidget
     {
-    public:
-        QGraphicsView *graphicsView;
+        public:
+            DrawMapView *graphicsView;
+            QLabel * lblPoints;
 
-        void setupUi(QWidget *drawMapWidget)
-        {
-            QAspectRatioLayout * arLayout = new QAspectRatioLayout(drawMapWidget);
-            arLayout->setMargin(0);
+            void setupUi(QWidget *drawMapWidget)
+            {
+                QVBoxLayout * vbox = new QVBoxLayout(drawMapWidget);
+                vbox->setMargin(0);
+                lblPoints = new QLabel("0", drawMapWidget);
+                vbox->addWidget(lblPoints);
+                QAspectRatioLayout * arLayout = new QAspectRatioLayout();
+                arLayout->setMargin(0);
+                vbox->addLayout(arLayout);
 
-            graphicsView = new QGraphicsView(drawMapWidget);
-            arLayout->addWidget(graphicsView);
+                graphicsView = new DrawMapView(drawMapWidget);
+                arLayout->addWidget(graphicsView);
 
-            retranslateUi(drawMapWidget);
+                retranslateUi(drawMapWidget);
 
-            QMetaObject::connectSlotsByName(drawMapWidget);
-        } // setupUi
+                QMetaObject::connectSlotsByName(drawMapWidget);
+            } // setupUi
 
-        void retranslateUi(QWidget *drawMapWidget)
-        {
-            Q_UNUSED(drawMapWidget);
-        } // retranslateUi
+            void retranslateUi(QWidget *drawMapWidget)
+            {
+                Q_UNUSED(drawMapWidget);
+            } // retranslateUi
 
     };
 
@@ -58,29 +86,33 @@ namespace Ui {
 
 class DrawMapWidget : public QWidget
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    explicit DrawMapWidget(QWidget *parent = 0);
-    ~DrawMapWidget();
+    public:
+        explicit DrawMapWidget(QWidget *parent = 0);
+        ~DrawMapWidget();
 
-    void setScene(DrawMapScene * scene);
+        void setScene(DrawMapScene * scene);
 
-public slots:
-    void undo();
-    void clear();
-    void save(const QString & fileName);
-    void load(const QString & fileName);
+    public slots:
+        void undo();
+        void clear();
+        void setErasing(bool erasing);
+        void save(const QString & fileName);
+        void load(const QString & fileName);
 
-protected:
-    void changeEvent(QEvent *e);
-    virtual void resizeEvent(QResizeEvent * event);
-    virtual void showEvent(QShowEvent * event);
+    protected:
+        void changeEvent(QEvent *e);
+        virtual void resizeEvent(QResizeEvent * event);
+        virtual void showEvent(QShowEvent * event);
 
-private:
-    Ui::DrawMapWidget *ui;
+    private:
+        Ui::DrawMapWidget *ui;
 
-    DrawMapScene * m_scene;
+        DrawMapScene * m_scene;
+
+    private slots:
+        void pathChanged();
 };
 
 #endif // DRAWMAPWIDGET_H
diff --git a/QTfrontend/ui/widget/fpsedit.cpp b/QTfrontend/ui/widget/fpsedit.cpp
index 87f2621..c6fad53 100644
--- a/QTfrontend/ui/widget/fpsedit.cpp
+++ b/QTfrontend/ui/widget/fpsedit.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/widget/fpsedit.h b/QTfrontend/ui/widget/fpsedit.h
index 3a4a5c2..7429b4c 100644
--- a/QTfrontend/ui/widget/fpsedit.h
+++ b/QTfrontend/ui/widget/fpsedit.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,13 +23,13 @@
 
 class FPSEdit : public QSpinBox
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    FPSEdit(QWidget * parent = 0);
+    public:
+        FPSEdit(QWidget * parent = 0);
 
-protected:
-     QString textFromValue (int value) const;
+    protected:
+        QString textFromValue (int value) const;
 };
 
 #endif // _FPSEDIT_H
diff --git a/QTfrontend/ui/widget/frameTeam.cpp b/QTfrontend/ui/widget/frameTeam.cpp
index 740bf63..1af51e0 100644
--- a/QTfrontend/ui/widget/frameTeam.cpp
+++ b/QTfrontend/ui/widget/frameTeam.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,13 +20,15 @@
 #include <QResizeEvent>
 #include <QCoreApplication>
 #include <QPalette>
+#include <QStandardItemModel>
 
 #include "frameTeam.h"
 #include "teamselhelper.h"
 #include "hwconsts.h"
+#include "DataManager.h"
 
 FrameTeams::FrameTeams(QWidget* parent) :
-  QFrame(parent), maxHedgehogsPerGame(48), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
+    QFrame(parent), maxHedgehogsPerGame(48), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
 {
     QPalette newPalette = palette();
     newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
@@ -36,17 +38,15 @@ FrameTeams::FrameTeams(QWidget* parent) :
     mainLayout.setSpacing(1);
     mainLayout.setContentsMargins(4, 4, 4, 4);
 
-    int i = 0;
-    while(colors[i] != 0)
-        availableColors.push_back(QColor(colors[i++]));
-
     resetColors();
+    this->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
 }
 
 void FrameTeams::setInteractivity(bool interactive)
 {
     nonInteractive = !interactive;
-    for(tmapTeamToWidget::iterator it=teamToWidget.begin(); it!=teamToWidget.end(); ++it) {
+    for(tmapTeamToWidget::iterator it=teamToWidget.begin(); it!=teamToWidget.end(); ++it)
+    {
         TeamShowWidget* pts = dynamic_cast<TeamShowWidget*>(it.value());
         if(!pts) throw;
         pts->setInteractivity(interactive);
@@ -55,74 +55,82 @@ void FrameTeams::setInteractivity(bool interactive)
 
 void FrameTeams::resetColors()
 {
-  currentColor=availableColors.end() - 1; // ensure next color is the first one
+    currentColor = DataManager::instance().colorsModel()->rowCount() - 1; // ensure next color is the first one
 }
 
-QColor FrameTeams::getNextColor() const
+int FrameTeams::getNextColor()
 {
-  QList<QColor>::ConstIterator nextColor=currentColor;
-  ++nextColor;
-  if (nextColor==availableColors.end()) nextColor=availableColors.begin();
-  return *nextColor;
+    currentColor = (currentColor + 1) % DataManager::instance().colorsModel()->rowCount();
+    return currentColor;
 }
 
 void FrameTeams::addTeam(HWTeam team, bool willPlay)
 {
-  TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this);
-  if(nonInteractive) pTeamShowWidget->setInteractivity(false);
+    TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this);
+    if(nonInteractive) pTeamShowWidget->setInteractivity(false);
 //  int hght=teamToWidget.empty() ? 0 : teamToWidget.begin()->second->size().height();
-  mainLayout.addWidget(pTeamShowWidget);
-  teamToWidget.insert(team, pTeamShowWidget);
-  QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
-  QCoreApplication::postEvent(parentWidget(), pevent);
+    mainLayout.addWidget(pTeamShowWidget);
+    teamToWidget.insert(team, pTeamShowWidget);
+    QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
+    QCoreApplication::postEvent(parentWidget(), pevent);
 }
 
 void FrameTeams::removeTeam(HWTeam team)
 {
-  tmapTeamToWidget::iterator it=teamToWidget.find(team);
-  if(it==teamToWidget.end()) return;
-  mainLayout.removeWidget(it.value());
-  it.value()->deleteLater();
-  teamToWidget.erase(it);
+    tmapTeamToWidget::iterator it=teamToWidget.find(team);
+    if(it==teamToWidget.end()) return;
+    mainLayout.removeWidget(it.value());
+    it.value()->deleteLater();
+    teamToWidget.erase(it);
+    QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
+    QCoreApplication::postEvent(parentWidget(), pevent);
 }
 
 void FrameTeams::resetTeams()
 {
-  for(tmapTeamToWidget::iterator it=teamToWidget.begin(); it!=teamToWidget.end(); ) {
-    mainLayout.removeWidget(it.value());
-    it.value()->deleteLater();
-    teamToWidget.erase(it++);
-  }
+    for(tmapTeamToWidget::iterator it=teamToWidget.begin(); it!=teamToWidget.end(); )
+    {
+        mainLayout.removeWidget(it.value());
+        it.value()->deleteLater();
+        teamToWidget.erase(it++);
+    }
+    QResizeEvent* pevent=new QResizeEvent(parentWidget()->size(), parentWidget()->size());
+    QCoreApplication::postEvent(parentWidget(), pevent);
 }
 
 void FrameTeams::setHHNum(const HWTeam& team)
 {
-  TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team));
-  if(!pTeamShowWidget) return;
-  pTeamShowWidget->setHHNum(team.numHedgehogs());
+    TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team));
+    if(!pTeamShowWidget) return;
+    pTeamShowWidget->setHHNum(team.numHedgehogs());
 }
 
 void FrameTeams::setTeamColor(const HWTeam& team)
 {
-  TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team));
-  if(!pTeamShowWidget) return;
-  pTeamShowWidget->changeTeamColor(team.color());
+    TeamShowWidget* pTeamShowWidget = dynamic_cast<TeamShowWidget*>(getTeamWidget(team));
+    if(!pTeamShowWidget) return;
+    pTeamShowWidget->changeTeamColor(team.color());
 }
 
 QWidget* FrameTeams::getTeamWidget(HWTeam team)
 {
 //qDebug() << "FrameTeams::getTeamWidget getNetID() = " << team.getNetID();
-  tmapTeamToWidget::iterator it=teamToWidget.find(team);
-  QWidget* ret = it!=teamToWidget.end() ? it.value() : 0;
-  return ret;
+    tmapTeamToWidget::iterator it=teamToWidget.find(team);
+    QWidget* ret = it!=teamToWidget.end() ? it.value() : 0;
+    return ret;
 }
 
 bool FrameTeams::isFullTeams() const
 {
-  return overallHedgehogs==maxHedgehogsPerGame;
+    return overallHedgehogs==maxHedgehogsPerGame;
 }
 
 void FrameTeams::emitTeamColorChanged(const HWTeam& team)
 {
-  emit teamColorChanged(team);
+    emit teamColorChanged(team);
+}
+
+QSize FrameTeams::sizeHint() const
+{
+    return QSize(-1, teamToWidget.size() * 39 + 9);
 }
diff --git a/QTfrontend/ui/widget/frameTeam.h b/QTfrontend/ui/widget/frameTeam.h
index a9d4f53..85e5897 100644
--- a/QTfrontend/ui/widget/frameTeam.h
+++ b/QTfrontend/ui/widget/frameTeam.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,41 +28,41 @@
 
 class FrameTeams : public QFrame
 {
-  Q_OBJECT
+        Q_OBJECT
 
- friend class CHedgehogerWidget;
- friend class TeamShowWidget;
+        friend class CHedgehogerWidget;
+        friend class TeamShowWidget;
 
- public:
-  FrameTeams(QWidget* parent=0);
-  QWidget* getTeamWidget(HWTeam team);
-  bool isFullTeams() const;
-  void resetColors();
-  void resetTeams();
-  void setHHNum(const HWTeam& team);
-  void setTeamColor(const HWTeam& team);
-  void setInteractivity(bool interactive);
-  QColor getNextColor() const;
+    public:
+        FrameTeams(QWidget* parent=0);
+        QWidget* getTeamWidget(HWTeam team);
+        bool isFullTeams() const;
+        void resetColors();
+        void resetTeams();
+        void setHHNum(const HWTeam& team);
+        void setTeamColor(const HWTeam& team);
+        void setInteractivity(bool interactive);
+        int getNextColor();
+        QSize sizeHint() const;
 
- signals:
-  void teamColorChanged(const HWTeam&);
+    signals:
+        void teamColorChanged(const HWTeam&);
 
- public slots:
-  void addTeam(HWTeam team, bool willPlay);
-  void removeTeam(HWTeam team);
+    public slots:
+        void addTeam(HWTeam team, bool willPlay);
+        void removeTeam(HWTeam team);
 
- private:
-  const int maxHedgehogsPerGame;
-  int overallHedgehogs;
-  QList<QColor> availableColors;
-  QList<QColor>::Iterator currentColor;
+    private:
+        const int maxHedgehogsPerGame;
+        int overallHedgehogs;
+        int currentColor;
 
-  void emitTeamColorChanged(const HWTeam& team);
+        void emitTeamColorChanged(const HWTeam& team);
 
-  QVBoxLayout mainLayout;
-  typedef QMap<HWTeam, QWidget*> tmapTeamToWidget;
-  tmapTeamToWidget teamToWidget;
-  bool nonInteractive;
+        QVBoxLayout mainLayout;
+        typedef QMap<HWTeam, QWidget*> tmapTeamToWidget;
+        tmapTeamToWidget teamToWidget;
+        bool nonInteractive;
 };
 
 #endif // _FRAME_TAM_INCLUDED
diff --git a/QTfrontend/ui/widget/gamecfgwidget.cpp b/QTfrontend/ui/widget/gamecfgwidget.cpp
index 3ed6427..f465fe3 100644
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,15 +28,16 @@
 
 #include "gamecfgwidget.h"
 #include "igbox.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 #include "hwconsts.h"
 #include "ammoSchemeModel.h"
 #include "proto.h"
+#include "GameStyleModel.h"
 
 GameCFGWidget::GameCFGWidget(QWidget* parent) :
-  QGroupBox(parent)
-  , mainLayout(this)
-  , seedRegexp("\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}")
+    QGroupBox(parent)
+    , mainLayout(this)
+    , seedRegexp("\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}")
 {
     mainLayout.setMargin(0);
 //  mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
@@ -56,39 +57,8 @@ GameCFGWidget::GameCFGWidget(QWidget* parent) :
     Scripts = new QComboBox(GBoxOptions);
     GBoxOptionsLayout->addWidget(Scripts, 1, 1);
 
-    Scripts->addItem("Normal");
-    Scripts->insertSeparator(1);
-
-    for (int i = 0; i < scriptList->size(); ++i) {
-        QString script = (*scriptList)[i].remove(".lua", Qt::CaseInsensitive);
-        QList<QVariant> scriptInfo;
-        scriptInfo.push_back(script);
-        QFile scriptCfgFile(HWDataManager::instance().findFileForRead(
-            QString("Scripts/Multiplayer/%2.cfg").arg(script)));
-        if (scriptCfgFile.exists() && scriptCfgFile.open(QFile::ReadOnly)) {
-            QString scheme;
-            QString weapons;
-            QTextStream input(&scriptCfgFile);
-            input >> scheme;
-            input >> weapons;
-            if (scheme.isEmpty())
-                scheme = "locked";
-            scheme.replace("_", " ");
-            if (weapons.isEmpty())
-                weapons = "locked";
-            weapons.replace("_", " ");
-            scriptInfo.push_back(scheme);
-            scriptInfo.push_back(weapons);
-            scriptCfgFile.close();
-        }
-        else
-        {
-            scriptInfo.push_back("locked");
-            scriptInfo.push_back("locked");
-        }
-        Scripts->addItem(script.replace("_", " "), scriptInfo);
-    }
-
+    Scripts->setModel(DataManager::instance().gameStyleModel());
+    m_curScript = Scripts->currentText();
     connect(Scripts, SIGNAL(currentIndexChanged(int)), this, SLOT(scriptChanged(int)));
 
     QWidget *SchemeWidget = new QWidget(GBoxOptions);
@@ -104,7 +74,7 @@ GameCFGWidget::GameCFGWidget(QWidget* parent) :
     SchemeWidgetLayout->addWidget(new QLabel(QLabel::tr("Scheme"), SchemeWidget), 0, 0);
 
     QPixmap pmEdit(":/res/edit.png");
-    
+
     QPushButton * goToSchemePage = new QPushButton(SchemeWidget);
     goToSchemePage->setToolTip(tr("Edit schemes"));
     goToSchemePage->setIconSize(pmEdit.size());
@@ -144,6 +114,8 @@ GameCFGWidget::GameCFGWidget(QWidget* parent) :
     connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
     connect(pMapContainer, SIGNAL(drawMapRequested()), this, SIGNAL(goToDrawMap()));
     connect(pMapContainer, SIGNAL(drawnMapChanged(const QByteArray &)), this, SLOT(onDrawnMapChanged(const QByteArray &)));
+
+    connect(&DataManager::instance(), SIGNAL(updated()), this, SLOT(updateModelViews()));
 }
 
 void GameCFGWidget::jumpToSchemes()
@@ -228,6 +200,10 @@ QByteArray GameCFGWidget::getFullConfig() const
 {
     QList<QByteArray> bcfg;
     int mapgen = pMapContainer->get_mapgen();
+    if (Scripts->currentIndex() > 0)
+    {
+        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex(), GameStyleModel::ScriptRole).toString()).toUtf8();
+    }
 
     QString currentMap = pMapContainer->getCurrentMap();
     if (currentMap.size() > 0)
@@ -240,11 +216,6 @@ QByteArray GameCFGWidget::getFullConfig() const
     }
     bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8();
 
-    if (Scripts->currentIndex() > 0)
-    {
-        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
-    }
-
     bcfg << QString("eseed " + pMapContainer->getCurrentSeed()).toUtf8();
     bcfg << QString("e$gmflags %1").arg(getGameFlags()).toUtf8();
     bcfg << QString("e$damagepct %1").arg(schemeData(26).toInt()).toUtf8();
@@ -283,13 +254,14 @@ QByteArray GameCFGWidget::getFullConfig() const
             }
             break;
         }
-        default: ;
+        default:
+            ;
     }
 
     QByteArray result;
 
     foreach(QByteArray ba, bcfg)
-        HWProto::addByteArrayToBuffer(result, ba);
+    HWProto::addByteArrayToBuffer(result, ba);
 
     return result;
 }
@@ -298,13 +270,23 @@ void GameCFGWidget::setNetAmmo(const QString& name, const QString& ammo)
 {
     bool illegal = ammo.size() != cDefaultAmmoStore->size();
     if (illegal)
-        QMessageBox::critical(this, tr("Error"), tr("Illegal ammo scheme"));
+    {
+        QMessageBox illegalMsg(this);
+        illegalMsg.setIcon(QMessageBox::Warning);
+        illegalMsg.setWindowTitle(QMessageBox::tr("Error"));
+        illegalMsg.setText(QMessageBox::tr("Cannot use the ammo '%1'!").arg(name));
+        illegalMsg.setWindowModality(Qt::WindowModal);
+        illegalMsg.exec();
+    }
 
     int pos = WeaponsName->findText(name);
-    if ((pos == -1) || illegal) { // prevent from overriding schemes with bad ones
+    if ((pos == -1) || illegal)   // prevent from overriding schemes with bad ones
+    {
         WeaponsName->addItem(name, ammo);
         WeaponsName->setCurrentIndex(WeaponsName->count() - 1);
-    } else {
+    }
+    else
+    {
         WeaponsName->setItemData(pos, ammo);
         WeaponsName->setCurrentIndex(pos);
     }
@@ -335,38 +317,47 @@ void GameCFGWidget::setParam(const QString & param, const QStringList & slValue)
     if (slValue.size() == 1)
     {
         QString value = slValue[0];
-        if (param == "MAP") {
+        if (param == "MAP")
+        {
             pMapContainer->setMap(value);
             return;
         }
-        if (param == "SEED") {
+        if (param == "SEED")
+        {
             pMapContainer->setSeed(value);
-            if (!seedRegexp.exactMatch(value)) {
+            if (!seedRegexp.exactMatch(value))
+            {
                 pMapContainer->seedEdit->setVisible(true);
-                }
+            }
             return;
         }
-        if (param == "THEME") {
+        if (param == "THEME")
+        {
             pMapContainer->setTheme(value);
             return;
         }
-        if (param == "TEMPLATE") {
+        if (param == "TEMPLATE")
+        {
             pMapContainer->setTemplateFilter(value.toUInt());
             return;
         }
-        if (param == "MAPGEN") {
+        if (param == "MAPGEN")
+        {
             pMapContainer->setMapgen((MapGenerator)value.toUInt());
             return;
         }
-        if (param == "MAZE_SIZE") {
+        if (param == "MAZE_SIZE")
+        {
             pMapContainer->setMazeSize(value.toUInt());
             return;
         }
-        if (param == "SCRIPT") {
+        if (param == "SCRIPT")
+        {
             Scripts->setCurrentIndex(Scripts->findText(value));
             return;
         }
-        if (param == "DRAWNMAP") {
+        if (param == "DRAWNMAP")
+        {
             pMapContainer->setDrawnMapData(qUncompress(QByteArray::fromBase64(slValue[0].toLatin1())));
             return;
         }
@@ -374,7 +365,8 @@ void GameCFGWidget::setParam(const QString & param, const QStringList & slValue)
 
     if (slValue.size() == 2)
     {
-        if (param == "AMMO") {
+        if (param == "AMMO")
+        {
             setNetAmmo(slValue[0], slValue[1]);
             return;
         }
@@ -389,12 +381,12 @@ void GameCFGWidget::setParam(const QString & param, const QStringList & slValue)
                 pMapContainer->seedEdit->setVisible(true);
 
             pMapContainer->setAllMapParameters(
-                    slValue[0],
-                    (MapGenerator)slValue[1].toUInt(),
-                    slValue[2].toUInt(),
-                    seed,
-                    slValue[4].toUInt()
-                    );
+                slValue[0],
+                (MapGenerator)slValue[1].toUInt(),
+                slValue[2].toUInt(),
+                seed,
+                slValue[4].toUInt()
+            );
             return;
         }
     }
@@ -404,7 +396,8 @@ void GameCFGWidget::setParam(const QString & param, const QStringList & slValue)
 
 void GameCFGWidget::ammoChanged(int index)
 {
-    if (index >= 0) {
+    if (index >= 0)
+    {
         emit paramChanged(
             "AMMO",
             QStringList() << WeaponsName->itemText(index) << WeaponsName->itemData(index).toString()
@@ -487,28 +480,34 @@ void GameCFGWidget::schemeChanged(int index)
     for(int i = 0; i < size; ++i)
         sl << schemeData(i).toString();
 
-    emit paramChanged("SCHEME", sl);
+    if (sl.size()!=1) emit paramChanged("SCHEME", sl);  // this is a stupid hack for the fact that SCHEME is being sent once, empty. Still need to find out why.
 
-    if (isEnabled() && bindEntries->isEnabled() && bindEntries->isChecked()) {
+    if (isEnabled() && bindEntries->isEnabled() && bindEntries->isChecked())
+    {
         QString schemeName = GameSchemes->itemText(index);
-        for (int i = 0; i < WeaponsName->count(); i++) {
-             QString weapName = WeaponsName->itemText(i);
-             int res = QString::compare(weapName, schemeName, Qt::CaseSensitive);
-             if (0 == res) {
-                 WeaponsName->setCurrentIndex(i);
-                 emit ammoChanged(i);
-                 break;
-             }
+        for (int i = 0; i < WeaponsName->count(); i++)
+        {
+            QString weapName = WeaponsName->itemText(i);
+            int res = QString::compare(weapName, schemeName, Qt::CaseSensitive);
+            if (0 == res)
+            {
+                WeaponsName->setCurrentIndex(i);
+                emit ammoChanged(i);
+                break;
+            }
         }
     }
 }
 
 void GameCFGWidget::scriptChanged(int index)
 {
+    const QString & name = Scripts->itemText(index);
+    m_curScript = name;
+
     if(isEnabled() && index > 0)
     {
-        QString scheme = Scripts->itemData(Scripts->currentIndex()).toList()[1].toString();
-        QString weapons = Scripts->itemData(Scripts->currentIndex()).toList()[2].toString();
+        QString scheme = Scripts->itemData(index, GameStyleModel::SchemeRole).toString();
+        QString weapons = Scripts->itemData(index, GameStyleModel::WeaponsRole).toString();
 
         if (scheme == "locked")
         {
@@ -551,7 +550,7 @@ void GameCFGWidget::scriptChanged(int index)
         WeaponsName->setEnabled(true);
         bindEntries->setEnabled(true);
     }
-    emit paramChanged("SCRIPT", QStringList(Scripts->itemText(index)));
+    emit paramChanged("SCRIPT", QStringList(name));
 }
 
 void GameCFGWidget::mapgenChanged(MapGenerator m)
@@ -573,3 +572,17 @@ void GameCFGWidget::onDrawnMapChanged(const QByteArray & data)
 {
     emit paramChanged("DRAWNMAP", QStringList(qCompress(data, 9).toBase64()));
 }
+
+
+void GameCFGWidget::updateModelViews()
+{
+    // restore game-style selection
+    if (!m_curScript.isEmpty())
+    {
+        int idx = Scripts->findText(m_curScript);
+        if (idx >= 0)
+            Scripts->setCurrentIndex(idx);
+        else
+            Scripts->setCurrentIndex(0);
+    }
+}
diff --git a/QTfrontend/ui/widget/gamecfgwidget.h b/QTfrontend/ui/widget/gamecfgwidget.h
index 00be344..ab5aa5b 100644
--- a/QTfrontend/ui/widget/gamecfgwidget.h
+++ b/QTfrontend/ui/widget/gamecfgwidget.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -34,53 +34,55 @@ class QTableView;
 
 class GameCFGWidget : public QGroupBox
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    GameCFGWidget(QWidget* parent);
-    quint32 getGameFlags() const;
-    quint32 getInitHealth() const;
-    QByteArray getFullConfig() const;
-    QComboBox * Scripts;
-    QComboBox * GameSchemes;
-    QComboBox * WeaponsName;
-    HWMapContainer* pMapContainer;
-    QTableView * tv;
-    QVariant schemeData(int column) const;
+    public:
+        GameCFGWidget(QWidget* parent);
+        quint32 getGameFlags() const;
+        quint32 getInitHealth() const;
+        QByteArray getFullConfig() const;
+        QComboBox * Scripts;
+        QComboBox * GameSchemes;
+        QComboBox * WeaponsName;
+        HWMapContainer* pMapContainer;
+        QTableView * tv;
+        QVariant schemeData(int column) const;
 
-public slots:
-    void setParam(const QString & param, const QStringList & value);
-    void fullNetConfig();
-    void resendSchemeData();
+    public slots:
+        void setParam(const QString & param, const QStringList & value);
+        void fullNetConfig();
+        void resendSchemeData();
 
-signals:
-    void paramChanged(const QString & param, const QStringList & value);
-    void goToSchemes(int);
-    void goToWeapons(int);
-    void goToDrawMap();
+    signals:
+        void paramChanged(const QString & param, const QStringList & value);
+        void goToSchemes(int);
+        void goToWeapons(int);
+        void goToDrawMap();
 
-private slots:
-    void ammoChanged(int index);
-    void mapChanged(const QString &);
-    void templateFilterChanged(int);
-    void seedChanged(const QString &);
-    void themeChanged(const QString &);
-    void schemeChanged(int);
-    void scriptChanged(int);
-    void jumpToSchemes();
-    void jumpToWeapons();
-    void mapgenChanged(MapGenerator m);
-    void maze_sizeChanged(int s);
-    void onDrawnMapChanged(const QByteArray & data);
+    private slots:
+        void ammoChanged(int index);
+        void mapChanged(const QString &);
+        void templateFilterChanged(int);
+        void seedChanged(const QString &);
+        void themeChanged(const QString &);
+        void schemeChanged(int);
+        void scriptChanged(int);
+        void jumpToSchemes();
+        void jumpToWeapons();
+        void mapgenChanged(MapGenerator m);
+        void maze_sizeChanged(int s);
+        void onDrawnMapChanged(const QByteArray & data);
+        void updateModelViews();
 
-private:
-    QGridLayout mainLayout;
-    QCheckBox * bindEntries;
-    QString curNetAmmoName;
-    QString curNetAmmo;
-    QRegExp seedRegexp;
+    private:
+        QGridLayout mainLayout;
+        QCheckBox * bindEntries;
+        QString curNetAmmoName;
+        QString curNetAmmo;
+        QRegExp seedRegexp;
+        QString m_curScript;
 
-    void setNetAmmo(const QString& name, const QString& ammo);
+        void setNetAmmo(const QString& name, const QString& ammo);
 
 };
 
diff --git a/QTfrontend/ui/widget/hedgehogerWidget.cpp b/QTfrontend/ui/widget/hedgehogerWidget.cpp
index 2479be8..6d78ffa 100644
--- a/QTfrontend/ui/widget/hedgehogerWidget.cpp
+++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Ulyanov Igor <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -19,58 +19,93 @@
 
 #include "hedgehogerWidget.h"
 
+#include <QPainter>
+
 #include "frameTeam.h"
 
 CHedgehogerWidget::CHedgehogerWidget(const QImage& im, const QImage& img, QWidget * parent) :
     ItemNum(im, img, parent, 1)
 {
-  // TODO: maxHedgehogsPerGame doesn't reset properly and won't match map limits for now
-  /*if(parent) {
-    pOurFrameTeams = dynamic_cast<FrameTeams*>(parent->parentWidget());
-  }
-  if(pOurFrameTeams->overallHedgehogs + 4 > pOurFrameTeams->maxHedgehogsPerGame) {
-    numItems = pOurFrameTeams->maxHedgehogsPerGame - pOurFrameTeams->overallHedgehogs;
-  } else numItems = 4;
-  pOurFrameTeams->overallHedgehogs += numItems;*/
+    // TODO: maxHedgehogsPerGame doesn't reset properly and won't match map limits for now
+    /*if(parent) {
+      pOurFrameTeams = dynamic_cast<FrameTeams*>(parent->parentWidget());
+    }
+    if(pOurFrameTeams->overallHedgehogs + 4 > pOurFrameTeams->maxHedgehogsPerGame) {
+      numItems = pOurFrameTeams->maxHedgehogsPerGame - pOurFrameTeams->overallHedgehogs;
+    } else numItems = 4;
+    pOurFrameTeams->overallHedgehogs += numItems;*/
+
+    this->setMinimumWidth(48);
 }
 
 void CHedgehogerWidget::incItems()
 {
-  //if (pOurFrameTeams->overallHedgehogs < pOurFrameTeams->maxHedgehogsPerGame) {
+    //if (pOurFrameTeams->overallHedgehogs < pOurFrameTeams->maxHedgehogsPerGame) {
     numItems++;
     //pOurFrameTeams->overallHedgehogs++;
     emit hedgehogsNumChanged();
-  //}
+    //}
 }
 
 void CHedgehogerWidget::decItems()
 {
-  numItems--;
-  //pOurFrameTeams->overallHedgehogs--;
-  emit hedgehogsNumChanged();
+    numItems--;
+    //pOurFrameTeams->overallHedgehogs--;
+    emit hedgehogsNumChanged();
 }
 
 CHedgehogerWidget::~CHedgehogerWidget()
 {
-  // TODO: not called?
-  //pOurFrameTeams->overallHedgehogs-=numItems;
+    // TODO: not called?
+    //pOurFrameTeams->overallHedgehogs-=numItems;
 }
 
 void CHedgehogerWidget::setNonInteractive()
 {
-  nonInteractive=true;
+    nonInteractive=true;
 }
 
 void CHedgehogerWidget::setHHNum(unsigned int num)
 {
-  /*unsigned int diff = num - numItems;
-  numItems += diff;
-  pOurFrameTeams->overallHedgehogs += diff;*/
-  numItems = num;
-  repaint();
+    /*unsigned int diff = num - numItems;
+    numItems += diff;
+    pOurFrameTeams->overallHedgehogs += diff;*/
+    numItems = num;
+    repaint();
 }
 
 unsigned char CHedgehogerWidget::getHedgehogsNum() const
 {
-  return numItems;
+    return numItems;
+}
+
+void CHedgehogerWidget::paintEvent(QPaintEvent* event)
+{
+    Q_UNUSED(event);
+
+    if (this->width() >= 11 * numItems + 26)
+        ItemNum::paintEvent(event);
+    else
+    {
+        int width = this->width() - 38;
+        QPainter painter(this);
+
+        for(int i=0; i<numItems; i++)
+        {
+            QRect target((i * width) / (numItems -1), i % 2, 25, 35);
+            if (enabled)
+            {
+                painter.drawImage(target, m_im);
+            }
+            else
+            {
+                painter.drawImage(target, m_img);
+            }
+        }
+    }
+
+    QPainter painter(this);
+    painter.setFont(QFont("MS Shell Dlg", 10, QFont::Bold));
+    painter.drawText(this->width() - 12, 23, QString::number(numItems));
+
 }
diff --git a/QTfrontend/ui/widget/hedgehogerWidget.h b/QTfrontend/ui/widget/hedgehogerWidget.h
index 0bd02db..29daae4 100644
--- a/QTfrontend/ui/widget/hedgehogerWidget.h
+++ b/QTfrontend/ui/widget/hedgehogerWidget.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Ulyanov Igor <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,25 +26,27 @@ class FrameTeams;
 
 class CHedgehogerWidget : public ItemNum
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  CHedgehogerWidget(const QImage& im, const QImage& img, QWidget * parent);
-  virtual ~CHedgehogerWidget();
-  unsigned char getHedgehogsNum() const;
-  void setHHNum (unsigned int num);
-  void setNonInteractive();
+    public:
+        CHedgehogerWidget(const QImage& im, const QImage& img, QWidget * parent);
+        virtual ~CHedgehogerWidget();
+        unsigned char getHedgehogsNum() const;
+        void setHHNum (unsigned int num);
+        void setNonInteractive();
 
- signals:
-  void hedgehogsNumChanged();
+    signals:
+        void hedgehogsNumChanged();
 
- protected:
-  virtual void incItems();
-  virtual void decItems();
+    protected:
+        virtual void incItems();
+        virtual void decItems();
 
- private:
-  CHedgehogerWidget();
-  FrameTeams* pOurFrameTeams;
+        virtual void paintEvent(QPaintEvent* event);
+
+    private:
+        CHedgehogerWidget();
+        FrameTeams* pOurFrameTeams;
 };
 
 #endif // _HEDGEHOGER_WIDGET
diff --git a/QTfrontend/ui/widget/igbox.cpp b/QTfrontend/ui/widget/igbox.cpp
index 8573f2b..fbdbfbc 100644
--- a/QTfrontend/ui/widget/igbox.cpp
+++ b/QTfrontend/ui/widget/igbox.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,27 +29,27 @@ IconedGroupBox::IconedGroupBox(QWidget * parent)
 // Has issues with border-radius on children
 //    setAttribute(Qt::WA_PaintOnScreen, true);
     titleLeftPadding = 49;
-    contentTopPadding = 15;
+    contentTopPadding = 5;
 }
 
 void IconedGroupBox::setIcon(const QIcon & icon)
 {
     if (this->icon.isNull())
         setStyleSheet(QString(
-            "IconedGroupBox{"
-                "margin-top: 46px;"
-                "margin-left: 12px;"
-                "padding: %1px 2px 5px 2px;"
-                "}"
-            "IconedGroupBox::title{"
-                "subcontrol-origin: margin;"
-                "subcontrol-position: top left;"
-                "padding-left: %2px;"
-                "padding-top: %1px;"
-                "text-align: left;"
-                "}"
-                ).arg(contentTopPadding).arg(titleLeftPadding)
-        );
+                          "IconedGroupBox{"
+                          "margin-top: 46px;"
+                          "margin-left: 12px;"
+                          "padding: %1px 2px 5px 2px;"
+                          "}"
+                          "IconedGroupBox::title{"
+                          "subcontrol-origin: margin;"
+                          "subcontrol-position: top left;"
+                          "padding-left: %2px;"
+                          "padding-top: 15px;"
+                          "text-align: left;"
+                          "}"
+                      ).arg(contentTopPadding).arg(titleLeftPadding)
+                     );
 
     this->icon = icon;
     repaint();
diff --git a/QTfrontend/ui/widget/igbox.h b/QTfrontend/ui/widget/igbox.h
index c3bff75..3feaf7f 100644
--- a/QTfrontend/ui/widget/igbox.h
+++ b/QTfrontend/ui/widget/igbox.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,21 +24,21 @@
 
 class IconedGroupBox : public QGroupBox
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    IconedGroupBox(QWidget * parent = 0);
+    public:
+        IconedGroupBox(QWidget * parent = 0);
 
-    void setIcon(const QIcon & icon);
-    void setTitleTextPadding(int px);
-    void setContentTopPadding(int px);
-protected:
-    virtual void paintEvent(QPaintEvent * event);
+        void setIcon(const QIcon & icon);
+        void setTitleTextPadding(int px);
+        void setContentTopPadding(int px);
+    protected:
+        virtual void paintEvent(QPaintEvent * event);
 
-private:
-    QIcon icon;
-    int titleLeftPadding;
-    int contentTopPadding;
+    private:
+        QIcon icon;
+        int titleLeftPadding;
+        int contentTopPadding;
 };
 
 #endif // _IGBOX_H
diff --git a/QTfrontend/ui/widget/itemNum.cpp b/QTfrontend/ui/widget/itemNum.cpp
index 439bf67..0f60640 100644
--- a/QTfrontend/ui/widget/itemNum.cpp
+++ b/QTfrontend/ui/widget/itemNum.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov at gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov at 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
@@ -23,11 +23,11 @@
 #include <QPainter>
 
 ItemNum::ItemNum(const QImage& im, const QImage& img, QWidget * parent, unsigned char min, unsigned char max) :
-  QFrame(parent), m_im(im), m_img(img), infinityState(false), nonInteractive(false), minItems(min), maxItems(max),
-  numItems(min+2 >= max ? min : min+2)
+    QFrame(parent), m_im(im), m_img(img), infinityState(false), nonInteractive(false), minItems(min), maxItems(max),
+    numItems(min+2 >= max ? min : min+2)
 {
     enabled = true;
-    if(frontendEffects) setAttribute(Qt::WA_PaintOnScreen, true);
+    //if(frontendEffects) setAttribute(Qt::WA_PaintOnScreen, true);
 }
 
 ItemNum::~ItemNum()
@@ -36,29 +36,40 @@ ItemNum::~ItemNum()
 
 void ItemNum::mousePressEvent ( QMouseEvent * event )
 {
-  if(nonInteractive) return;
-  if(event->button()==Qt::LeftButton && enabled) {
-    event->accept();
-    if((infinityState && numItems <= maxItems) || (!infinityState && numItems < maxItems)) {
-      incItems();
-    } else {
-      numItems = minItems+1;
-      // appears there's an emit in there
-      decItems();
+    if(nonInteractive) return;
+    if(event->button()==Qt::LeftButton && enabled)
+    {
+        event->accept();
+        if((infinityState && numItems <= maxItems) || (!infinityState && numItems < maxItems))
+        {
+            incItems();
+        }
+        else
+        {
+            numItems = minItems+1;
+            // appears there's an emit in there
+            decItems();
+        }
     }
-  } else if (event->button()==Qt::RightButton && enabled) {
-    event->accept();
-    if(numItems > minItems) {
-      decItems();
-    } else {
-      numItems = maxItems+(infinityState?0:-1);
-      incItems();
+    else if (event->button()==Qt::RightButton && enabled)
+    {
+        event->accept();
+        if(numItems > minItems)
+        {
+            decItems();
+        }
+        else
+        {
+            numItems = maxItems+(infinityState?0:-1);
+            incItems();
+        }
     }
-  } else {
-    event->ignore();
-    return;
-  }
-  repaint();
+    else
+    {
+        event->ignore();
+        return;
+    }
+    repaint();
 }
 void ItemNum::wheelEvent ( QWheelEvent * event )
 {
@@ -86,57 +97,67 @@ void ItemNum::wheelEvent ( QWheelEvent * event )
         if(numItems > minItems)
             decItems();
     }
-  repaint();
+    repaint();
 }
 
 QSize ItemNum::sizeHint () const
 {
-  return QSize((maxItems+1)*12, 32);
+    return QSize((maxItems+1)*12, 32);
 }
 
 void ItemNum::paintEvent(QPaintEvent* event)
 {
-  Q_UNUSED(event);
+    Q_UNUSED(event);
 
-  QPainter painter(this);
+    QPainter painter(this);
 
-  if (numItems==maxItems+1) {
-    QRect target(0, 0, 100, 32);
-    if (enabled) {
-        painter.drawImage(target, QImage(":/res/infinity.png"));
-    } else {
-        painter.drawImage(target, QImage(":/res/infinitygrey.png"));
+    if (numItems==maxItems+1)
+    {
+        QRect target(0, 0, 100, 32);
+        if (enabled)
+        {
+            painter.drawImage(target, QImage(":/res/infinity.png"));
+        }
+        else
+        {
+            painter.drawImage(target, QImage(":/res/infinitygrey.png"));
+        }
     }
-  } else {
-    for(int i=0; i<numItems; i++) {
-      QRect target(11 * i, i % 2, 25, 35);
-      if (enabled) {
-        painter.drawImage(target, m_im);
-      } else {
-        painter.drawImage(target, m_img);
-      }
+    else
+    {
+        for(int i=0; i<numItems; i++)
+        {
+            QRect target(11 * i, i % 2, 25, 35);
+            if (enabled)
+            {
+                painter.drawImage(target, m_im);
+            }
+            else
+            {
+                painter.drawImage(target, m_img);
+            }
+        }
     }
-  }
 }
 
 unsigned char ItemNum::getItemsNum() const
 {
-  return numItems;
+    return numItems;
 }
 
 void ItemNum::setItemsNum(const unsigned char num)
 {
-  numItems=num;
-  repaint();
+    numItems=num;
+    repaint();
 }
 
 void ItemNum::setInfinityState(bool value)
 {
-  infinityState=value;
+    infinityState=value;
 }
 
 void ItemNum::setEnabled(bool value)
 {
-  enabled=value;
-  repaint();
+    enabled=value;
+    repaint();
 }
diff --git a/QTfrontend/ui/widget/itemNum.h b/QTfrontend/ui/widget/itemNum.h
index 9be69af..7b7c1bf 100644
--- a/QTfrontend/ui/widget/itemNum.h
+++ b/QTfrontend/ui/widget/itemNum.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov at gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov at 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
@@ -24,38 +24,37 @@
 
 class ItemNum : public QFrame
 {
-  Q_OBJECT
-
-  public:
-    void setInfinityState(bool value);
-    void setEnabled(bool value);
-    unsigned char getItemsNum() const;
-    void setItemsNum(const unsigned char num);
-
-  private:
-    QImage m_im;
-    QImage m_img;
-    bool infinityState;
-    bool enabled;
-
-  protected:
-    ItemNum(const QImage& im, const QImage& img, QWidget * parent, unsigned char min=2, unsigned char max=8);
-    virtual QSize sizeHint () const;
-    virtual ~ItemNum()=0;
-
-    bool nonInteractive;
-    unsigned char minItems;
-    unsigned char maxItems;
-    unsigned char numItems;
-
-    // from QWidget
-    virtual void mousePressEvent ( QMouseEvent * event );
-    virtual void wheelEvent ( QWheelEvent * event );
-    virtual void paintEvent(QPaintEvent* event);
-
-    // to be implemented in child
-    virtual void incItems()=0;
-    virtual void decItems()=0;
+        Q_OBJECT
+
+    public:
+        void setInfinityState(bool value);
+        void setEnabled(bool value);
+        unsigned char getItemsNum() const;
+        void setItemsNum(const unsigned char num);
+
+    protected:
+        QImage m_im;
+        QImage m_img;
+        bool infinityState;
+        bool enabled;
+
+        ItemNum(const QImage& im, const QImage& img, QWidget * parent, unsigned char min=2, unsigned char max=8);
+        virtual QSize sizeHint () const;
+        virtual ~ItemNum()=0;
+
+        bool nonInteractive;
+        unsigned char minItems;
+        unsigned char maxItems;
+        unsigned char numItems;
+
+        // from QWidget
+        virtual void mousePressEvent ( QMouseEvent * event );
+        virtual void wheelEvent ( QWheelEvent * event );
+        virtual void paintEvent(QPaintEvent* event);
+
+        // to be implemented in child
+        virtual void incItems()=0;
+        virtual void decItems()=0;
 };
 
 #endif // _ITEM_NUM_INCLUDED
diff --git a/QTfrontend/ui/widget/mapContainer.cpp b/QTfrontend/ui/widget/mapContainer.cpp
index 77e5264..96fde84 100644
--- a/QTfrontend/ui/widget/mapContainer.cpp
+++ b/QTfrontend/ui/widget/mapContainer.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Igor Ulyanov <iulyanov at gmail.com>
+ * Copyright (c) 2006-2012 Igor Ulyanov <iulyanov at 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
@@ -29,28 +29,33 @@
 #include <QVBoxLayout>
 #include <QIcon>
 #include <QLineEdit>
-#include <QMessageBox>
 #include <QStringListModel>
 
 #include "hwconsts.h"
 #include "mapContainer.h"
 #include "igbox.h"
 #include "HWApplication.h"
+#include "ThemeModel.h"
 
 HWMapContainer::HWMapContainer(QWidget * parent) :
     QWidget(parent),
     mainLayout(this),
     pMap(0),
-    mapgen(MAPGEN_REGULAR)
+    mapgen(MAPGEN_REGULAR),
+    m_previewSize(256, 128)
 {
     hhSmall.load(":/res/hh_small.png");
     hhLimit = 18;
     templateFilter = 0;
 
+    linearGrad = QLinearGradient(QPoint(128, 0), QPoint(128, 128));
+    linearGrad.setColorAt(1, QColor(0, 0, 192));
+    linearGrad.setColorAt(0, QColor(66, 115, 225));
+
     mainLayout.setContentsMargins(HWApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
-        1,
-        HWApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin),
-        HWApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
+                                  1,
+                                  HWApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin),
+                                  HWApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
 
     QWidget* mapWidget = new QWidget(this);
     mainLayout.addWidget(mapWidget, 0, 0, Qt::AlignHCenter);
@@ -68,99 +73,10 @@ HWMapContainer::HWMapContainer(QWidget * parent) :
 
     chooseMap = new QComboBox(mapWidget);
     chooseMap->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-    chooseMap->addItem(
-// FIXME - need real icons. Disabling until then
-//QIcon(":/res/mapRandom.png"), 
-QComboBox::tr("generated map..."));
-    chooseMap->addItem(
-// FIXME - need real icons. Disabling until then
-//QIcon(":/res/mapMaze.png"), 
-QComboBox::tr("generated maze..."));
-
-    chooseMap->addItem(QComboBox::tr("hand drawn map..."));
-    chooseMap->insertSeparator(chooseMap->count()); // separator between generators and missions
-
-    chooseMap->insertSeparator(chooseMap->count()); // separator between generators and missions
-
-    int missionindex = chooseMap->count();
-    numMissions = 0;
-    QFile mapLuaFile;
-    QFile mapCfgFile;
-    for (int i = 0; i < mapList->size(); ++i) {
-        QString map = (*mapList)[i];
-        mapCfgFile.setFileName(
-                QString("%1/Data/Maps/%2/map.cfg")
-                .arg(cfgdir->absolutePath())
-                .arg(map));
-        if (mapCfgFile.exists()) {
-            mapLuaFile.setFileName(
-                    QString("%1/Data/Maps/%2/map.lua")
-                    .arg(cfgdir->absolutePath())
-                    .arg(map));
-        } else {
-            mapCfgFile.setFileName(
-                    QString("%1/Maps/%2/map.cfg")
-                    .arg(datadir->absolutePath())
-                    .arg(map));
-            mapLuaFile.setFileName(
-                    QString("%1/Maps/%2/map.lua")
-                    .arg(datadir->absolutePath())
-                    .arg(map));
-        }
-
-        if (mapCfgFile.open(QFile::ReadOnly)) {
-            QString theme;
-            quint32 limit = 0;
-            QString scheme;
-            QString weapons;
-            QList<QVariant> mapInfo;
-            bool isMission = mapLuaFile.exists();
-
-            QTextStream input(&mapCfgFile);
-            input >> theme;
-            input >> limit;
-            input >> scheme;
-            input >> weapons;
-            mapInfo.push_back(map);
-            mapInfo.push_back(theme);
-            if (limit)
-                mapInfo.push_back(limit);
-            else
-                mapInfo.push_back(18);
-
-
-            mapInfo.push_back(isMission);
-
-            if (scheme.isEmpty())
-                scheme = "locked";
-            scheme.replace("_", " ");
-
-            if (weapons.isEmpty())
-                weapons = "locked";
-            weapons.replace("_", " ");
-
-            mapInfo.push_back(scheme);
-            mapInfo.push_back(weapons);
-
-            if(isMission)
-            {
-                chooseMap->insertItem(missionindex++, 
-// FIXME - need real icons. Disabling until then
-//QIcon(":/res/mapMission.png"), 
-QComboBox::tr("Mission") + ": " + map, mapInfo);
-                numMissions++;
-            }
-            else
-                chooseMap->addItem(
-// FIXME - need real icons. Disabling until then
-//QIcon(":/res/mapCustom.png"), 
-map, mapInfo);
-            mapCfgFile.close();
-        }
-    }
-    chooseMap->insertSeparator(missionindex); // separator between missions and maps
+    m_mapModel = DataManager::instance().mapModel();
+    chooseMap->setEditable(false);
+    chooseMap->setModel(m_mapModel);
 
-    connect(chooseMap, SIGNAL(activated(int)), this, SLOT(mapChanged(int)));
     mapLayout->addWidget(chooseMap, 1, 1);
 
     QLabel * lblMap = new QLabel(tr("Map"), mapWidget);
@@ -203,14 +119,16 @@ map, mapInfo);
 
     //gbThemes->setStyleSheet("padding: 0px"); // doesn't work - stylesheet is set with icon
     mapLayout->addWidget(gbThemes, 0, 2, 3, 1);
-
+    // disallow row to be collapsed (so it can't get ignored when Qt applies rowSpan of gbThemes)
+    mapLayout->setRowMinimumHeight(2, 13);
     QVBoxLayout * gbTLayout = new QVBoxLayout(gbThemes);
     gbTLayout->setContentsMargins(0, 0, 0 ,0);
     gbTLayout->setSpacing(0);
     lvThemes = new QListView(mapWidget);
     lvThemes->setMinimumHeight(30);
     lvThemes->setFixedWidth(140);
-    lvThemes->setModel(themesModel);
+    m_themeModel = DataManager::instance().themeModel();
+    lvThemes->setModel(m_themeModel);
     lvThemes->setIconSize(QSize(16, 16));
     lvThemes->setEditTriggers(QListView::NoEditTriggers);
 
@@ -218,17 +136,17 @@ map, mapInfo);
 
     // override default style to tighten up theme scroller
     lvThemes->setStyleSheet(QString(
-        "QListView{"
-            "border: solid;"
-            "border-width: 0px;"
-            "border-radius: 0px;"
-            "border-color: transparent;"
-            "background-color: #0d0544;"
-            "color: #ffcc00;"
-            "font: bold 13px;"
-            "}"
-        )
-    );
+                                "QListView{"
+                                "border: solid;"
+                                "border-width: 0px;"
+                                "border-radius: 0px;"
+                                "border-color: transparent;"
+                                "background-color: #0d0544;"
+                                "color: #ffcc00;"
+                                "font: bold 13px;"
+                                "}"
+                            )
+                           );
 
     gbTLayout->addWidget(lvThemes);
     lvThemes->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
@@ -259,22 +177,28 @@ map, mapInfo);
 
     setRandomSeed();
     setRandomTheme();
+
+    chooseMap->setCurrentIndex(0);
+    mapChanged(0);
+    // use signal "activated" rather than currentIndexChanged
+    // because index is somtimes changed a few times in a row programmatically
+    connect(chooseMap, SIGNAL(activated(int)), this, SLOT(mapChanged(int)));
+
+    // update model views after model changes (to e.g. re-adjust separators)
+    connect(&DataManager::instance(), SIGNAL(updated()), this, SLOT(updateModelViews()));
 }
 
 void HWMapContainer::setImage(const QImage newImage)
 {
-    QPixmap px(256, 128);
-    QPixmap pxres(256, 128);
+    QPixmap px(m_previewSize);
+    QPixmap pxres(px.size());
     QPainter p(&pxres);
 
     px.fill(Qt::yellow);
     QBitmap bm = QBitmap::fromImage(newImage);
     px.setMask(bm);
 
-    QLinearGradient linearGrad(QPoint(128, 0), QPoint(128, 128));
-    linearGrad.setColorAt(1, QColor(0, 0, 192));
-    linearGrad.setColorAt(0, QColor(66, 115, 225));
-    p.fillRect(QRect(0, 0, 256, 128), linearGrad);
+    p.fillRect(pxres.rect(), linearGrad);
     p.drawPixmap(QPoint(0, 0), px);
 
     addInfoToPreview(pxres);
@@ -289,51 +213,65 @@ void HWMapContainer::setHHLimit(int newHHLimit)
 
 void HWMapContainer::mapChanged(int index)
 {
-    switch(index) {
-    case MAPGEN_REGULAR:
-        mapgen = MAPGEN_REGULAR;
-        updatePreview();
-        gbThemes->show();
-        lblFilter->show();
-        cbTemplateFilter->show();
-        maze_size_label->hide();
-        cbMazeSize->hide();
-        emit mapChanged("+rnd+");
-        emit themeChanged(chooseMap->itemData(index).toList()[1].toString());
-        break;
-    case MAPGEN_MAZE:
-        mapgen = MAPGEN_MAZE;
-        updatePreview();
-        gbThemes->show();
-        lblFilter->hide();
-        cbTemplateFilter->hide();
-        maze_size_label->show();
-        cbMazeSize->show();
-        emit mapChanged("+maze+");
-        emit themeChanged(chooseMap->itemData(index).toList()[1].toString());
-        break;
-    case MAPGEN_DRAWN:
-        mapgen = MAPGEN_DRAWN;
-        updatePreview();
-        gbThemes->show();
-        lblFilter->hide();
-        cbTemplateFilter->hide();
-        maze_size_label->hide();
-        cbMazeSize->hide();
-        emit mapChanged("+drawn+");
-        emit themeChanged(chooseMap->itemData(index).toList()[1].toString());
-        break;
-    default:
-        mapgen = MAPGEN_MAP;
+    if (chooseMap->currentIndex() != index)
+        chooseMap->setCurrentIndex(index);
+
+    if (index < 0)
+    {
+        m_mapInfo.type = MapModel::Invalid;
         updatePreview();
-        gbThemes->hide();
-        lblFilter->hide();
-        cbTemplateFilter->hide();
-        maze_size_label->hide();
-        cbMazeSize->hide();
-        emit mapChanged(chooseMap->itemData(index).toList()[0].toString());
+        return;
+    }
+
+    Q_ASSERT(chooseMap->itemData(index, Qt::UserRole + 1).canConvert<MapModel::MapInfo>());
+    m_mapInfo = chooseMap->itemData(index, Qt::UserRole + 1).value<MapModel::MapInfo>();
+    m_curMap = m_mapInfo.name;
+
+    switch(m_mapInfo.type)
+    {
+        case MapModel::GeneratedMap:
+            mapgen = MAPGEN_REGULAR;
+            gbThemes->show();
+            lblFilter->show();
+            cbTemplateFilter->show();
+            maze_size_label->hide();
+            cbMazeSize->hide();
+            break;
+        case MapModel::GeneratedMaze:
+            mapgen = MAPGEN_MAZE;
+            gbThemes->show();
+            lblFilter->hide();
+            cbTemplateFilter->hide();
+            maze_size_label->show();
+            cbMazeSize->show();
+            break;
+        case MapModel::HandDrawnMap:
+            mapgen = MAPGEN_DRAWN;
+            gbThemes->show();
+            lblFilter->hide();
+            cbTemplateFilter->hide();
+            maze_size_label->hide();
+            cbMazeSize->hide();
+            break;
+        default:
+            mapgen = MAPGEN_MAP;
+            gbThemes->hide();
+            lblFilter->hide();
+            cbTemplateFilter->hide();
+            maze_size_label->hide();
+            cbMazeSize->hide();
+            m_theme = m_mapInfo.theme;
+    }
+
+    // the map has no pre-defined theme, so let's use the selected one
+    if (m_mapInfo.theme.isEmpty())
+    {
+        m_theme = lvThemes->currentIndex().data().toString();
+        emit themeChanged(m_theme);
     }
 
+    updatePreview();
+    emit mapChanged(m_curMap);
     emit mapgenChanged(mapgen);
 }
 
@@ -350,7 +288,8 @@ void HWMapContainer::addInfoToPreview(QPixmap image)
     p.setBrush(QColor(0, 0, 0));
     p.drawRect(image.rect().width() - hhSmall.rect().width() - 28, 3, 40, 20);
     p.setFont(QFont("MS Shell Dlg", 10));
-    p.drawText(image.rect().width() - hhSmall.rect().width() - 14 - (hhLimit > 9 ? 10 : 0), 18, QString::number(hhLimit));
+    QString text = (hhLimit > 0) ? QString::number(hhLimit) : "?";
+    p.drawText(image.rect().width() - hhSmall.rect().width() - 14 - (hhLimit > 9 ? 10 : 0), 18, text);
     p.drawPixmap(image.rect().width() - hhSmall.rect().width() - 5, 5, hhSmall.rect().width(), hhSmall.rect().height(), hhSmall);
 
     imageButt->setIcon(finalImage);
@@ -359,40 +298,38 @@ void HWMapContainer::addInfoToPreview(QPixmap image)
 
 void HWMapContainer::askForGeneratedPreview()
 {
-    if (pMap)
-    {
-        disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
-        disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
-        pMap = 0;
-    }
-
     pMap = new HWMap();
     connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage)));
     connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int)));
+    connect(pMap, SIGNAL(destroyed(QObject *)), this, SLOT(onPreviewMapDestroyed(QObject *)));
     pMap->getImage(m_seed,
                    getTemplateFilter(),
                    get_mapgen(),
                    getMazeSize(),
                    getDrawnMapData()
-            );
+                  );
+
+    setHHLimit(0);
+
+    const QPixmap waitIcon(":/res/iconTime.png");
+
+    QPixmap waitImage(m_previewSize);
+    QPainter p(&waitImage);
+
+    p.fillRect(waitImage.rect(), linearGrad);
+    int x = (waitImage.width() - waitIcon.width()) / 2;
+    int y = (waitImage.height() - waitIcon.height()) / 2;
+    p.drawPixmap(QPoint(x, y), waitIcon);
+
+    addInfoToPreview(waitImage);
 }
 
 void HWMapContainer::themeSelected(const QModelIndex & current, const QModelIndex &)
 {
-    QString theme = current.data().toString();
-    QList<QVariant> mapInfo;
-    mapInfo.push_back(QString("+rnd+"));
-    mapInfo.push_back(theme);
-    mapInfo.push_back(18);
-    mapInfo.push_back(false);
-    chooseMap->setItemData(0, mapInfo);
-    mapInfo[0] = QString("+maze+");
-    chooseMap->setItemData(1, mapInfo);
-    mapInfo[0] = QString("+drawn+");
-    chooseMap->setItemData(2, mapInfo);
+    m_theme = current.data().toString();
 
     gbThemes->setIcon(qVariantValue<QIcon>(current.data(Qt::UserRole)));
-    emit themeChanged(theme);
+    emit themeChanged(m_theme);
 }
 
 QString HWMapContainer::getCurrentSeed() const
@@ -403,18 +340,17 @@ QString HWMapContainer::getCurrentSeed() const
 QString HWMapContainer::getCurrentMap() const
 {
     if(chooseMap->currentIndex() < MAPGEN_MAP) return QString();
-    return chooseMap->itemData(chooseMap->currentIndex()).toList()[0].toString();
+    return(m_curMap);
 }
 
 QString HWMapContainer::getCurrentTheme() const
 {
-    return chooseMap->itemData(chooseMap->currentIndex()).toList()[1].toString();
+    return(m_theme);
 }
 
 bool HWMapContainer::getCurrentIsMission() const
 {
-    if(!chooseMap->currentIndex()) return false;
-    return chooseMap->itemData(chooseMap->currentIndex()).toList()[3].toBool();
+    return(m_mapInfo.type == MapModel::MissionMap);
 }
 
 int HWMapContainer::getCurrentHHLimit() const
@@ -424,12 +360,12 @@ int HWMapContainer::getCurrentHHLimit() const
 
 QString HWMapContainer::getCurrentScheme() const
 {
-    return chooseMap->itemData(chooseMap->currentIndex()).toList()[4].toString();
+    return(m_mapInfo.scheme);
 }
 
 QString HWMapContainer::getCurrentWeapons() const
 {
-    return chooseMap->itemData(chooseMap->currentIndex()).toList()[5].toString();
+    return(m_mapInfo.weapons);
 }
 
 quint32 HWMapContainer::getTemplateFilter() const
@@ -440,7 +376,7 @@ quint32 HWMapContainer::getTemplateFilter() const
 void HWMapContainer::resizeEvent ( QResizeEvent * event )
 {
     Q_UNUSED(event);
-  //imageButt->setIconSize(imageButt->size());
+    //imageButt->setIconSize(imageButt->size());
 }
 
 void HWMapContainer::intSetSeed(const QString & seed)
@@ -453,40 +389,28 @@ void HWMapContainer::intSetSeed(const QString & seed)
 void HWMapContainer::setSeed(const QString & seed)
 {
     intSetSeed(seed);
-    if (chooseMap->currentIndex() < MAPGEN_DRAWN)
+    if ((m_mapInfo.type == MapModel::GeneratedMap) || (m_mapInfo.type == MapModel::GeneratedMaze))
         updatePreview();
 }
 
 void HWMapContainer::intSetMap(const QString & map)
 {
-    int id = 0;
-    for(int i = 0; i < chooseMap->count(); i++)
-        if(!chooseMap->itemData(i).isNull() && chooseMap->itemData(i).toList()[0].toString() == map)
-        {
-            id = i;
-            break;
-        }
+    m_curMap = map;
 
-    if(id > 0) {
-        if (pMap)
-        {
-            disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
-            disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
-            pMap = 0;
-        }
-        chooseMap->setCurrentIndex(id);
-    }
+    int id = m_mapModel->indexOf(map);
+
+    mapChanged(id);
 }
 
-void HWMapContainer::setMap(const QString &map)
+void HWMapContainer::setMap(const QString & map)
 {
-    intSetMap(map);
-    updatePreview();
+    if ((m_mapInfo.type == MapModel::Invalid) || (map != m_mapInfo.name))
+        intSetMap(map);
 }
 
 void HWMapContainer::setTheme(const QString & theme)
 {
-    QModelIndexList mdl = themesModel->match(themesModel->index(0), Qt::DisplayRole, theme);
+    QModelIndexList mdl = m_themeModel->match(m_themeModel->index(0), Qt::DisplayRole, theme);
 
     if(mdl.size())
         lvThemes->setCurrentIndex(mdl.at(0));
@@ -494,53 +418,41 @@ void HWMapContainer::setTheme(const QString & theme)
 
 void HWMapContainer::setRandomMap()
 {
+    int idx;
+
     setRandomSeed();
-    switch(chooseMap->currentIndex())
+    switch(m_mapInfo.type)
     {
-    case MAPGEN_REGULAR:
-    case MAPGEN_MAZE:
-        setRandomTheme();
-        break;
-    case MAPGEN_DRAWN:
-        emit drawMapRequested();
-        break;
-    default:
-        if(chooseMap->currentIndex() <= numMissions + MAPGEN_MAP + 1)
-            setRandomMission();
-        else
-            setRandomStatic();
-        break;
+        case MapModel::GeneratedMap:
+        case MapModel::GeneratedMaze:
+            setRandomTheme();
+            break;
+        case MapModel::HandDrawnMap:
+            emit drawMapRequested();
+            break;
+        case MapModel::MissionMap:
+        case MapModel::StaticMap:
+            // get random map of same type
+            idx = m_mapModel->randomMap(m_mapInfo.type);
+            mapChanged(idx);
+            break;
+        case MapModel::Invalid:
+            mapChanged(0);
     }
 }
 
-void HWMapContainer::setRandomStatic()
-{
-    int i = MAPGEN_MAP + 3 + numMissions + rand() % (chooseMap->count() - MAPGEN_MAP - 3 - numMissions);
-    chooseMap->setCurrentIndex(i);
-    mapChanged(i);
-}
-
-void HWMapContainer::setRandomMission()
-{
-    int i = MAPGEN_MAP + 2 + rand() % numMissions;
-    chooseMap->setCurrentIndex(i);
-    mapChanged(i);
-}
 
 void HWMapContainer::setRandomSeed()
 {
-    m_seed = QUuid::createUuid().toString();
-    seedEdit->setText(m_seed);
+    setSeed(QUuid::createUuid().toString());
     emit seedChanged(m_seed);
-    if (chooseMap->currentIndex() < MAPGEN_MAP)
-        updatePreview();
 }
 
 void HWMapContainer::setRandomTheme()
 {
-    if(!themesModel->rowCount()) return;
-    quint32 themeNum = rand() % themesModel->rowCount();
-    lvThemes->setCurrentIndex(themesModel->index(themeNum));
+    if(!m_themeModel->rowCount()) return;
+    quint32 themeNum = rand() % m_themeModel->rowCount();
+    lvThemes->setCurrentIndex(m_themeModel->index(themeNum));
 }
 
 void HWMapContainer::intSetTemplateFilter(int filter)
@@ -552,7 +464,8 @@ void HWMapContainer::intSetTemplateFilter(int filter)
 void HWMapContainer::setTemplateFilter(int filter)
 {
     intSetTemplateFilter(filter);
-    updatePreview();
+    if (m_mapInfo.type == MapModel::GeneratedMap)
+        updatePreview();
 }
 
 MapGenerator HWMapContainer::get_mapgen(void) const
@@ -574,23 +487,52 @@ void HWMapContainer::intSetMazeSize(int size)
 void HWMapContainer::setMazeSize(int size)
 {
     intSetMazeSize(size);
-    updatePreview();
+    if (m_mapInfo.type == MapModel::GeneratedMaze)
+        updatePreview();
 }
 
 void HWMapContainer::intSetMapgen(MapGenerator m)
 {
-    mapgen = m;
+    if (mapgen != m)
+    {
+        mapgen = m;
 
-    if(m != MAPGEN_MAP)
-        chooseMap->setCurrentIndex(m);
+        switch (m)
+        {
+            case MAPGEN_REGULAR:
+                m_mapInfo.type = MapModel::GeneratedMap;
+                break;
+            case MAPGEN_MAZE:
+                m_mapInfo.type = MapModel::GeneratedMaze;
+                break;
+            case MAPGEN_DRAWN:
+                m_mapInfo.type = MapModel::HandDrawnMap;
+                break;
+            case MAPGEN_MAP:
+                switch (m_mapInfo.type)
+                {
+                    case MapModel::GeneratedMap:
+                    case MapModel::GeneratedMaze:
+                    case MapModel::HandDrawnMap:
+                        m_mapInfo.type = MapModel::Invalid;
+                    default:
+                        break;
+                }
+                break;
+        }
 
-    emit mapgenChanged(m);
+        if(m != MAPGEN_MAP)
+            chooseMap->setCurrentIndex(m);
+
+        emit mapgenChanged(m);
+    }
 }
 
 void HWMapContainer::setMapgen(MapGenerator m)
 {
     intSetMapgen(m);
-    updatePreview();
+    if(m != MAPGEN_MAP)
+        updatePreview();
 }
 
 void HWMapContainer::setDrawnMapData(const QByteArray & ar)
@@ -637,41 +579,83 @@ void HWMapContainer::mapDrawingFinished()
 
 void HWMapContainer::updatePreview()
 {
-    int curIndex = chooseMap->currentIndex();
+    if (pMap)
+    {
+        disconnect(pMap, 0, this, SLOT(setImage(const QImage)));
+        disconnect(pMap, 0, this, SLOT(setHHLimit(int)));
+        pMap = 0;
+    }
+
+    QPixmap failIcon;
 
-    switch(curIndex)
+    switch(m_mapInfo.type)
     {
-    case MAPGEN_REGULAR:
-        askForGeneratedPreview();
-        break;
-    case MAPGEN_MAZE:
-        askForGeneratedPreview();
-        break;
-    case MAPGEN_DRAWN:
-        askForGeneratedPreview();
-        break;
-    default:
-        QPixmap mapImage;
-        QFile tmpfile;
-        tmpfile.setFileName(cfgdir->absolutePath() + "/Data/Maps/" + chooseMap->itemData(curIndex).toList()[0].toString() + "/preview.png");
-        if (!tmpfile.exists()) tmpfile.setFileName(datadir->absolutePath() + "/Maps/" + chooseMap->itemData(curIndex).toList()[0].toString() + "/preview.png");
-        if(!mapImage.load(QFileInfo(tmpfile).absoluteFilePath())) {
-            imageButt->setIcon(QIcon());
-            return;
-        }
+        case MapModel::Invalid:
+            failIcon = QPixmap(":/res/btnDisabled.png");
+            imageButt->setIcon(failIcon);
+            imageButt->setIconSize(failIcon.size());
+            break;
+        case MapModel::GeneratedMap:
+            askForGeneratedPreview();
+            break;
+        case MapModel::GeneratedMaze:
+            askForGeneratedPreview();
+            break;
+        case MapModel::HandDrawnMap:
+            askForGeneratedPreview();
+            break;
+        default:
+            QPixmap mapImage;
+            bool success = mapImage.load(
+                DataManager::instance().findFileForRead(
+                    "Maps/" + m_mapInfo.name + "/preview.png")
+            );
+
+            if(!success)
+            {
+                imageButt->setIcon(QIcon());
+                return;
+            }
 
-        hhLimit = chooseMap->itemData(curIndex).toList()[2].toInt();
-        addInfoToPreview(mapImage);
+            hhLimit = m_mapInfo.limit;
+            addInfoToPreview(mapImage);
     }
 }
 
 void HWMapContainer::setAllMapParameters(const QString &map, MapGenerator m, int mazesize, const QString &seed, int tmpl)
 {
-    intSetMap(map);
     intSetMapgen(m);
     intSetMazeSize(mazesize);
     intSetSeed(seed);
     intSetTemplateFilter(tmpl);
+    // this one last because it will refresh the preview
+    intSetMap(map);
+}
 
-    updatePreview();
+
+void HWMapContainer::updateModelViews()
+{
+    // restore theme selection
+    // do this before map selection restore, because map may overwrite theme
+    if (!m_theme.isEmpty())
+    {
+        QModelIndexList mdl = m_themeModel->match(m_themeModel->index(0), Qt::DisplayRole, m_theme);
+        if (mdl.size() > 0)
+            lvThemes->setCurrentIndex(mdl.at(0));
+        else
+            setRandomTheme();
+    }
+
+    // restore map selection
+    if ((!m_curMap.isEmpty()) && (chooseMap->currentIndex() < 0))
+        intSetMap(m_curMap);
+    else
+        updatePreview();
+}
+
+
+void HWMapContainer::onPreviewMapDestroyed(QObject * map)
+{
+    if (map == pMap)
+        pMap = 0;
 }
diff --git a/QTfrontend/ui/widget/mapContainer.h b/QTfrontend/ui/widget/mapContainer.h
index 45838f2..141ff04 100644
--- a/QTfrontend/ui/widget/mapContainer.h
+++ b/QTfrontend/ui/widget/mapContainer.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,12 +27,16 @@
 #include <QByteArray>
 #include <QLineEdit>
 
+#include "DataManager.h"
+
 #include "hwmap.h"
 #include "drawmapscene.h"
+#include "MapModel.h"
 
 class QPushButton;
 class IconedGroupBox;
 class QListView;
+class SeparatorPainter;
 
 class MapFileErrorException
 {
@@ -40,89 +44,97 @@ class MapFileErrorException
 
 class HWMapContainer : public QWidget
 {
-  Q_OBJECT
-
- public:
-  HWMapContainer(QWidget * parent=0);
-  QString getCurrentSeed() const;
-  QString getCurrentMap() const;
-  QString getCurrentTheme() const;
-  int     getCurrentHHLimit() const;
-  QString getCurrentScheme() const;
-  QString getCurrentWeapons() const;
-  quint32 getTemplateFilter() const;
-  MapGenerator get_mapgen(void) const;
-  int getMazeSize(void) const;
-  bool getCurrentIsMission() const;
-  QByteArray getDrawnMapData();
-  DrawMapScene * getDrawMapScene();
-  void mapDrawingFinished();
-  QLineEdit* seedEdit;
-
- public slots:
-  void askForGeneratedPreview();
-  void setSeed(const QString & seed);
-  void setMap(const QString & map);
-  void setTheme(const QString & theme);
-  void setTemplateFilter(int);
-  void setMapgen(MapGenerator m);
-  void setMazeSize(int size);
-  void setDrawnMapData(const QByteArray & ar);
-  void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl);
-
- signals:
-  void seedChanged(const QString & seed);
-  void mapChanged(const QString & map);
-  void themeChanged(const QString & theme);
-  void newTemplateFilter(int filter);
-  void mapgenChanged(MapGenerator m);
-  void mazeSizeChanged(int s);
-  void drawMapRequested();
-  void drawnMapChanged(const QByteArray & data);
-
- private slots:
-  void setImage(const QImage newImage);
-  void setHHLimit(int hhLimit);
-  void mapChanged(int index);
-  void setRandomSeed();
-  void setRandomTheme();
-  void setRandomMap();
-  void setRandomStatic();
-  void setRandomMission();
-  void themeSelected(const QModelIndex & current, const QModelIndex &);
-  void addInfoToPreview(QPixmap image);
-  void seedEdited();
-
- protected:
-  virtual void resizeEvent ( QResizeEvent * event );
-
- private:
-  QGridLayout mainLayout;
-  QPushButton* imageButt;
-  QComboBox* chooseMap;
-  IconedGroupBox* gbThemes;
-  QListView* lvThemes;
-  HWMap* pMap;
-  QString m_seed;
-  QPushButton* seedSet;
-  QLabel* seedLabel;
-  int hhLimit;
-  int templateFilter;
-  QPixmap hhSmall;
-  QLabel* lblFilter;
-  QComboBox* cbTemplateFilter;
-  QLabel *maze_size_label;
-  QComboBox *cbMazeSize;
-  MapGenerator mapgen;
-  int numMissions;
-  DrawMapScene drawMapScene;
-
-  void intSetSeed(const QString & seed);
-  void intSetMap(const QString & map);
-  void intSetMapgen(MapGenerator m);
-  void intSetTemplateFilter(int);
-  void intSetMazeSize(int size);
-  void updatePreview();
+        Q_OBJECT
+
+    public:
+        HWMapContainer(QWidget * parent=0);
+        QString getCurrentSeed() const;
+        QString getCurrentMap() const;
+        QString getCurrentTheme() const;
+        int     getCurrentHHLimit() const;
+        QString getCurrentScheme() const;
+        QString getCurrentWeapons() const;
+        quint32 getTemplateFilter() const;
+        MapGenerator get_mapgen(void) const;
+        int getMazeSize(void) const;
+        bool getCurrentIsMission() const;
+        QByteArray getDrawnMapData();
+        DrawMapScene * getDrawMapScene();
+        void mapDrawingFinished();
+        QLineEdit* seedEdit;
+
+    public slots:
+        void askForGeneratedPreview();
+        void setSeed(const QString & seed);
+        void setMap(const QString & map);
+        void setTheme(const QString & theme);
+        void setTemplateFilter(int);
+        void setMapgen(MapGenerator m);
+        void setMazeSize(int size);
+        void setDrawnMapData(const QByteArray & ar);
+        void setAllMapParameters(const QString & map, MapGenerator m, int mazesize, const QString & seed, int tmpl);
+        void updateModelViews();
+        void onPreviewMapDestroyed(QObject * map);
+
+    signals:
+        void seedChanged(const QString & seed);
+        void mapChanged(const QString & map);
+        void themeChanged(const QString & theme);
+        void newTemplateFilter(int filter);
+        void mapgenChanged(MapGenerator m);
+        void mazeSizeChanged(int s);
+        void drawMapRequested();
+        void drawnMapChanged(const QByteArray & data);
+
+    private slots:
+        void setImage(const QImage newImage);
+        void setHHLimit(int hhLimit);
+        void mapChanged(int index);
+        void setRandomSeed();
+        void setRandomTheme();
+        void setRandomMap();
+        void themeSelected(const QModelIndex & current, const QModelIndex &);
+        void addInfoToPreview(QPixmap image);
+        void seedEdited();
+
+    protected:
+        virtual void resizeEvent ( QResizeEvent * event );
+
+    private:
+        QGridLayout mainLayout;
+        QPushButton* imageButt;
+        QComboBox* chooseMap;
+        MapModel * m_mapModel;
+        IconedGroupBox* gbThemes;
+        QListView* lvThemes;
+        ThemeModel * m_themeModel;
+        HWMap* pMap;
+        QString m_seed;
+        QPushButton* seedSet;
+        QLabel* seedLabel;
+        int hhLimit;
+        int templateFilter;
+        QPixmap hhSmall;
+        QLabel* lblFilter;
+        QComboBox* cbTemplateFilter;
+        QLabel *maze_size_label;
+        QComboBox *cbMazeSize;
+        MapGenerator mapgen;
+        DrawMapScene drawMapScene;
+
+        void intSetSeed(const QString & seed);
+        void intSetMap(const QString & map);
+        void intSetMapgen(MapGenerator m);
+        void intSetTemplateFilter(int);
+        void intSetMazeSize(int size);
+        void updatePreview();
+
+        MapModel::MapInfo m_mapInfo;
+        QString m_theme;
+        QString m_curMap;
+
+        QLinearGradient linearGrad; ///< for preview background
+        QSize m_previewSize;
 };
 
 #endif // _HWMAP_CONTAINER_INCLUDED
diff --git a/QTfrontend/ui/widget/qpushbuttonwithsound.cpp b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp
new file mode 100644
index 0000000..4f4088f
--- /dev/null
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp
@@ -0,0 +1,43 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <QDir>
+
+#include "qpushbuttonwithsound.h"
+#include "DataManager.h"
+#include "SDLInteraction.h"
+#include "hwform.h"
+#include "gameuiconfig.h"
+
+QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) :
+    QPushButton(parent),
+    isSoundEnabled(true)
+{
+    connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+}
+
+void QPushButtonWithSound::buttonClicked()
+{
+    if ( !isSoundEnabled || !HWForm::config->isFrontendSoundEnabled())
+        return;
+
+    DataManager & dataMgr = DataManager::instance();
+
+    if (this->isEnabled())
+        SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg"));
+}
diff --git a/QTfrontend/ui/widget/qpushbuttonwithsound.h b/QTfrontend/ui/widget/qpushbuttonwithsound.h
new file mode 100644
index 0000000..c8352e8
--- /dev/null
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.h
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef QPUSHBUTTONWITHSOUND_H
+#define QPUSHBUTTONWITHSOUND_H
+
+#include <QPushButton>
+
+class QPushButtonWithSound : public QPushButton
+{
+        Q_OBJECT
+    public:
+        explicit QPushButtonWithSound(QWidget *parent = 0);
+        bool isSoundEnabled;
+    signals:
+
+    public slots:
+    private slots:
+        void buttonClicked();
+
+};
+
+#endif // QPUSHBUTTONWITHSOUND_H
diff --git a/QTfrontend/ui/widget/selectWeapon.cpp b/QTfrontend/ui/widget/selectWeapon.cpp
index ba1d114..bd645ff 100644
--- a/QTfrontend/ui/widget/selectWeapon.cpp
+++ b/QTfrontend/ui/widget/selectWeapon.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -81,8 +81,8 @@ void SelWeaponItem::setEnabled(bool value)
 }
 
 SelWeaponWidget::SelWeaponWidget(int numItems, QWidget* parent) :
-  QFrame(parent),
-  m_numItems(numItems)
+    QFrame(parent),
+    m_numItems(numItems)
 {
     wconf = new QSettings(cfgdir->absolutePath() + "/weapons.ini", QSettings::IniFormat, this);
 
@@ -127,9 +127,9 @@ SelWeaponWidget::SelWeaponWidget(int numItems, QWidget* parent) :
 
     int j = -1;
     int i = 0, k = 0;
-    for(; i < m_numItems; ++i) {
+    for(; i < m_numItems; ++i)
+    {
         if (i == 6) continue;
-        if (i == 52) continue; // Disable structures for now
         if (k % 4 == 0) ++j;
         SelWeaponItem * swi = new SelWeaponItem(true, i, currentState[i].digitValue(), QImage(":/res/ammopic.png"), QImage(":/res/ammopicgrey.png"), this);
         weaponItems[i].append(swi);
@@ -159,10 +159,12 @@ void SelWeaponWidget::setWeapons(const QString& ammo)
 {
     bool enable = true;
     for(int i = 0; i < cDefaultAmmos.size(); i++)
-        if (!cDefaultAmmos[i].first.compare(m_name->text())) {
+        if (!cDefaultAmmos[i].first.compare(m_name->text()))
+        {
             enable = false;
         }
-    for(int i = 0; i < m_numItems; ++i) {
+    for(int i = 0; i < m_numItems; ++i)
+    {
         twi::iterator it = weaponItems.find(i);
         if (it == weaponItems.end()) continue;
         it.value()[0]->setItemsNum(ammo[i].digitValue());
@@ -180,7 +182,8 @@ void SelWeaponWidget::setWeapons(const QString& ammo)
 void SelWeaponWidget::setDefault()
 {
     for(int i = 0; i < cDefaultAmmos.size(); i++)
-        if (!cDefaultAmmos[i].first.compare(m_name->text())) {
+        if (!cDefaultAmmos[i].first.compare(m_name->text()))
+        {
             return;
         }
     setWeapons(*cDefaultAmmoStore);
@@ -188,20 +191,18 @@ void SelWeaponWidget::setDefault()
 
 void SelWeaponWidget::save()
 {
-    for(int i = 0; i < cDefaultAmmos.size(); i++)
-        if (!cDefaultAmmos[i].first.compare(m_name->text())) {
-            QMessageBox::warning(0, QMessageBox::tr("Weapons"), QMessageBox::tr("Can not overwrite default weapon set '%1'!").arg(cDefaultAmmos[i].first));
-            return;
-        }
-
+    // TODO make this return if success or not, so that the page can react
+    // properly and not goBack if saving failed
     if (m_name->text() == "") return;
 
     QString state1;
     QString state2;
     QString state3;
     QString state4;
+    QString stateFull;
 
-    for(int i = 0; i < m_numItems; ++i) {
+    for(int i = 0; i < m_numItems; ++i)
+    {
         twi::const_iterator it = weaponItems.find(i);
         int num = it == weaponItems.end() ? 9 : it.value()[0]->getItemsNum(); // 9 is for 'skip turn'
         state1.append(QString::number(num));
@@ -212,11 +213,33 @@ void SelWeaponWidget::save()
         int am = it == weaponItems.end() ? 0 : it.value()[3]->getItemsNum();
         state4.append(QString::number(am));
     }
-    if (curWeaponsName != "") {
+
+    stateFull = state1 + state2 + state3 + state4;
+
+    for(int i = 0; i < cDefaultAmmos.size(); i++)
+    {
+        if (cDefaultAmmos[i].first.compare(m_name->text()) == 0)
+        {
+            // don't show warning if no change
+            if (cDefaultAmmos[i].second.compare(stateFull) == 0)
+                return;
+
+            QMessageBox deniedMsg(this);
+            deniedMsg.setIcon(QMessageBox::Warning);
+            deniedMsg.setWindowTitle(QMessageBox::tr("Weapons - Warning"));
+            deniedMsg.setText(QMessageBox::tr("Cannot overwrite default weapon set '%1'!").arg(cDefaultAmmos[i].first));
+            deniedMsg.setWindowModality(Qt::WindowModal);
+            deniedMsg.exec();
+            return;
+        }
+    }
+
+    if (curWeaponsName != "")
+    {
         // remove old entry
         wconf->remove(curWeaponsName);
     }
-    wconf->setValue(m_name->text(), state1 + state2 + state3 + state4);
+    wconf->setValue(m_name->text(), stateFull);
     emit weaponsChanged();
 }
 
@@ -236,14 +259,26 @@ void SelWeaponWidget::deleteWeaponsName()
     if (curWeaponsName == "") return;
 
     for(int i = 0; i < cDefaultAmmos.size(); i++)
-        if (!cDefaultAmmos[i].first.compare(m_name->text())) {
-            QMessageBox::warning(0, QMessageBox::tr("Weapons"), QMessageBox::tr("Can not delete default weapon set '%1'!").arg(cDefaultAmmos[i].first));
+        if (!cDefaultAmmos[i].first.compare(m_name->text()))
+        {
+            QMessageBox deniedMsg(this);
+            deniedMsg.setIcon(QMessageBox::Warning);
+            deniedMsg.setWindowTitle(QMessageBox::tr("Weapons - Warning"));
+            deniedMsg.setText(QMessageBox::tr("Cannot delete default weapon set '%1'!").arg(cDefaultAmmos[i].first));
+            deniedMsg.setWindowModality(Qt::WindowModal);
+            deniedMsg.exec();
             return;
         }
 
-    QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Weapons"), QMessageBox::tr("Really delete this weapon set?"), QMessageBox::Ok | QMessageBox::Cancel);
+    QMessageBox reallyDeleteMsg(this);
+    reallyDeleteMsg.setIcon(QMessageBox::Question);
+    reallyDeleteMsg.setWindowTitle(QMessageBox::tr("Weapons - Are you sure?"));
+    reallyDeleteMsg.setText(QMessageBox::tr("Do you really want to delete the weapon set '%1'?").arg(curWeaponsName));
+    reallyDeleteMsg.setWindowModality(Qt::WindowModal);
+    reallyDeleteMsg.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
 
-    if (reallyDelete.exec() == QMessageBox::Ok) {
+    if (reallyDeleteMsg.exec() == QMessageBox::Ok)
+    {
         wconf->remove(curWeaponsName);
         emit weaponsDeleted();
     }
@@ -252,10 +287,11 @@ void SelWeaponWidget::deleteWeaponsName()
 void SelWeaponWidget::newWeaponsName()
 {
     QString newName = tr("new");
-    if(wconf->contains(newName)) {
+    if(wconf->contains(newName))
+    {
         //name already used -> look for an appropriate name:
         int i=2;
-        while(wconf->contains(newName = tr("new")+QString::number(i++)));
+        while(wconf->contains(newName = tr("new")+QString::number(i++))) ;
     }
     setWeaponsName(newName);
 }
@@ -266,9 +302,12 @@ void SelWeaponWidget::setWeaponsName(const QString& name)
 
     curWeaponsName = name;
 
-    if(name != "" && wconf->contains(name)) {
+    if(name != "" && wconf->contains(name))
+    {
         setWeapons(wconf->value(name).toString());
-    } else {
+    }
+    else
+    {
         setWeapons(*cDefaultAmmoStore);
     }
 }
@@ -280,13 +319,15 @@ QStringList SelWeaponWidget::getWeaponNames() const
 
 void SelWeaponWidget::copy()
 {
-    if(wconf->contains(curWeaponsName)) {
+    if(wconf->contains(curWeaponsName))
+    {
         QString ammo = getWeaponsString(curWeaponsName);
         QString newName = tr("copy of") + " " + curWeaponsName;
-        if(wconf->contains(newName)) {
+        if(wconf->contains(newName))
+        {
             //name already used -> look for an appropriate name:
             int i=2;
-            while(wconf->contains(newName = tr("copy of") + " " + curWeaponsName+QString::number(i++)));
+            while(wconf->contains(newName = tr("copy of") + " " + curWeaponsName+QString::number(i++))) ;
         }
         setWeaponsName(newName);
         setWeapons(ammo);
diff --git a/QTfrontend/ui/widget/selectWeapon.h b/QTfrontend/ui/widget/selectWeapon.h
index 908e2a9..7718da1 100644
--- a/QTfrontend/ui/widget/selectWeapon.h
+++ b/QTfrontend/ui/widget/selectWeapon.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,62 +31,62 @@ class QSettings;
 
 class SelWeaponItem : public QWidget
 {
-  Q_OBJECT
+        Q_OBJECT
 
-public:
-  SelWeaponItem(bool allowInfinite, int iconNum, int wNum, QImage image, QImage imagegrey, QWidget* parent=0);
+    public:
+        SelWeaponItem(bool allowInfinite, int iconNum, int wNum, QImage image, QImage imagegrey, QWidget* parent=0);
 
-  unsigned char getItemsNum() const;
-  void setItemsNum(const unsigned char num);
-  void setEnabled(bool value);
+        unsigned char getItemsNum() const;
+        void setItemsNum(const unsigned char num);
+        void setEnabled(bool value);
 
- private:
-  WeaponItem* item;
+    private:
+        WeaponItem* item;
 };
 
 class SelWeaponWidget : public QFrame
 {
-  Q_OBJECT
-
- public:
-  SelWeaponWidget(int numItems, QWidget* parent=0);
-  QString getWeaponsString(const QString& name) const;
-  QStringList getWeaponNames() const;
-
- public slots:
-  void setDefault();
-  void setWeapons(const QString& ammo);
-  //sets the name of the current set
-  void setWeaponsName(const QString& name);
-  void deleteWeaponsName();
-  void newWeaponsName();
-  void save();
-  void copy();
-
- signals:
-  void weaponsChanged();
-  void weaponsDeleted();
-
- private:
-  //the name of the current weapon set
-  QString curWeaponsName;
-
-  QLineEdit* m_name;
-
-  //storage for all the weapons sets
-  QSettings* wconf;
-
-  const int m_numItems;
-  int operator [] (unsigned int weaponIndex) const;
-
-  typedef QList<SelWeaponItem*> ItemsList;
-  typedef QMap<int, ItemsList> twi;
-  twi weaponItems;
-  //layout element for each tab:
-  QGridLayout* p1Layout;
-  QGridLayout* p2Layout;
-  QGridLayout* p3Layout;
-  QGridLayout* p4Layout;
+        Q_OBJECT
+
+    public:
+        SelWeaponWidget(int numItems, QWidget* parent=0);
+        QString getWeaponsString(const QString& name) const;
+        QStringList getWeaponNames() const;
+
+    public slots:
+        void setDefault();
+        void setWeapons(const QString& ammo);
+        //sets the name of the current set
+        void setWeaponsName(const QString& name);
+        void deleteWeaponsName();
+        void newWeaponsName();
+        void save();
+        void copy();
+
+    signals:
+        void weaponsChanged();
+        void weaponsDeleted();
+
+    private:
+        //the name of the current weapon set
+        QString curWeaponsName;
+
+        QLineEdit* m_name;
+
+        //storage for all the weapons sets
+        QSettings* wconf;
+
+        const int m_numItems;
+        int operator [] (unsigned int weaponIndex) const;
+
+        typedef QList<SelWeaponItem*> ItemsList;
+        typedef QMap<int, ItemsList> twi;
+        twi weaponItems;
+        //layout element for each tab:
+        QGridLayout* p1Layout;
+        QGridLayout* p2Layout;
+        QGridLayout* p3Layout;
+        QGridLayout* p4Layout;
 };
 
 #endif // _SELECT_WEAPON_INCLUDED
diff --git a/QTfrontend/ui/widget/teamselect.cpp b/QTfrontend/ui/widget/teamselect.cpp
index 7d632bd..102f961 100644
--- a/QTfrontend/ui/widget/teamselect.cpp
+++ b/QTfrontend/ui/widget/teamselect.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -32,28 +32,34 @@
 
 void TeamSelWidget::addTeam(HWTeam team)
 {
-  if(team.isNetTeam()) {
-    framePlaying->addTeam(team, true);
-    curPlayingTeams.push_back(team);
-    connect(framePlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
-             this, SLOT(netTeamStatusChanged(const HWTeam&)));
-    connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)),
+    if(team.isNetTeam())
+    {
+        framePlaying->addTeam(team, true);
+        curPlayingTeams.push_back(team);
+        connect(framePlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
+                this, SLOT(netTeamStatusChanged(const HWTeam&)));
+        connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)),
                 this, SLOT(hhNumChanged(const HWTeam&)));
-    dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged();
-    connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)),
+        dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged();
+        connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)),
                 this, SLOT(proxyTeamColorChanged(const HWTeam&)));
-  } else {
-    frameDontPlaying->addTeam(team, false);
-    m_curNotPlayingTeams.push_back(team);
-    if(m_acceptOuter) {
-      connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
-          this, SLOT(pre_changeTeamStatus(HWTeam)));
-    } else {
-      connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
-          this, SLOT(changeTeamStatus(HWTeam)));
     }
-  }
-  emit setEnabledGameStart(curPlayingTeams.size()>1);
+    else
+    {
+        frameDontPlaying->addTeam(team, false);
+        m_curNotPlayingTeams.push_back(team);
+        if(m_acceptOuter)
+        {
+            connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
+                    this, SLOT(pre_changeTeamStatus(HWTeam)));
+        }
+        else
+        {
+            connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
+                    this, SLOT(changeTeamStatus(HWTeam)));
+        }
+    }
+    emit setEnabledGameStart(curPlayingTeams.size()>1);
 }
 
 void TeamSelWidget::setInteractivity(bool interactive)
@@ -87,15 +93,15 @@ void TeamSelWidget::proxyTeamColorChanged(const HWTeam& team)
 
 void TeamSelWidget::changeHHNum(const HWTeam& team)
 {
-  QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
+    QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
     if(itPlay==curPlayingTeams.end())
     {
         qWarning() << QString("changeHHNum: team '%1' not found").arg(team.name());
         return;
     }
-  itPlay->setNumHedgehogs(team.numHedgehogs());
+    itPlay->setNumHedgehogs(team.numHedgehogs());
 
-  framePlaying->setHHNum(team);
+    framePlaying->setHHNum(team);
 }
 
 void TeamSelWidget::changeTeamColor(const HWTeam& team)
@@ -114,93 +120,111 @@ void TeamSelWidget::changeTeamColor(const HWTeam& team)
 void TeamSelWidget::removeNetTeam(const HWTeam& team)
 {
     //qDebug() << QString("removeNetTeam: removing team '%1'").arg(team.TeamName);
-    for(;;) {
+    for(;;)
+    {
         QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
         if(itPlay==curPlayingTeams.end())
         {
             qWarning() << QString("removeNetTeam: team '%1' not found").arg(team.name());
             break;
         }
-        if(itPlay->isNetTeam()) {
+        if(itPlay->isNetTeam())
+        {
             QObject::disconnect(framePlaying->getTeamWidget(*itPlay), SIGNAL(teamStatusChanged(HWTeam)));
             framePlaying->removeTeam(team);
             curPlayingTeams.erase(itPlay);
             break;
         }
+        else
+        {
+            qWarning() << QString("removeNetTeam: team '%1' was actually a local team!").arg(team.name());
+            break;
+        }
     }
     emit setEnabledGameStart(curPlayingTeams.size()>1);
 }
 
 void TeamSelWidget::netTeamStatusChanged(const HWTeam& team)
 {
-  QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
+    QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
 
 }
 
 //void TeamSelWidget::removeTeam(__attribute__ ((unused)) HWTeam team)
 //{
-  //curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team));
+//curDontPlayingTeams.erase(std::find(curDontPlayingTeams.begin(), curDontPlayingTeams.end(), team));
 //}
 
 void TeamSelWidget::changeTeamStatus(HWTeam team)
 {
-  QList<HWTeam>::iterator itDontPlay=std::find(m_curNotPlayingTeams.begin(), m_curNotPlayingTeams.end(), team);
-  QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
-
-  bool willBePlaying=itDontPlay!=m_curNotPlayingTeams.end();
-
-  if(!willBePlaying) {
-    // playing team => dont playing
-    m_curNotPlayingTeams.push_back(*itPlay);
-    emit teamNotPlaying(*itPlay);
-    curPlayingTeams.erase(itPlay);
-  } else {
-    // return if max playing teams reached
-    if(framePlaying->isFullTeams()) return;
-    // dont playing team => playing
-    team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network)
-    itDontPlay->setColor(framePlaying->getNextColor());
-    curPlayingTeams.push_back(*itDontPlay);
-    if(!m_acceptOuter) emit teamWillPlay(*itDontPlay);
-    m_curNotPlayingTeams.erase(itDontPlay);
-  }
-
-  FrameTeams* pRemoveTeams;
-  FrameTeams* pAddTeams;
-  if(!willBePlaying) {
-    pRemoveTeams=framePlaying;
-    pAddTeams=frameDontPlaying;
-  } else {
-    pRemoveTeams=frameDontPlaying;
-    pAddTeams=framePlaying;
-  }
-
-  pAddTeams->addTeam(team, willBePlaying);
-  pRemoveTeams->removeTeam(team);
-  if(!team.isNetTeam() && m_acceptOuter && !willBePlaying) {
-    connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
-        this, SLOT(pre_changeTeamStatus(HWTeam)));
-  } else {
-    connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
-        this, SLOT(changeTeamStatus(HWTeam)));
-  }
-  if(willBePlaying) {
-    connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)),
-        this, SLOT(hhNumChanged(const HWTeam&)));
-    dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged();
-    connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)),
-        this, SLOT(proxyTeamColorChanged(const HWTeam&)));
-    emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam());
-  }
-
-  QSize szh=pAddTeams->sizeHint();
-  QSize szh1=pRemoveTeams->sizeHint();
-  if(szh.isValid() && szh1.isValid()) {
-    pAddTeams->resize(pAddTeams->size().width(), szh.height());
-    pRemoveTeams->resize(pRemoveTeams->size().width(), szh1.height());
-  }
-
-  emit setEnabledGameStart(curPlayingTeams.size()>1);
+    QList<HWTeam>::iterator itDontPlay=std::find(m_curNotPlayingTeams.begin(), m_curNotPlayingTeams.end(), team);
+    QList<HWTeam>::iterator itPlay=std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team);
+
+    bool willBePlaying=itDontPlay!=m_curNotPlayingTeams.end();
+
+    if(!willBePlaying)
+    {
+        // playing team => dont playing
+        m_curNotPlayingTeams.push_back(*itPlay);
+        emit teamNotPlaying(*itPlay);
+        curPlayingTeams.erase(itPlay);
+    }
+    else
+    {
+        // return if max playing teams reached
+        if(framePlaying->isFullTeams()) return;
+        // dont playing team => playing
+        itDontPlay->setColor(framePlaying->getNextColor());
+        team=*itDontPlay; // for net team info saving in framePlaying (we have only name with netID from network)
+        curPlayingTeams.push_back(*itDontPlay);
+        if(!m_acceptOuter) emit teamWillPlay(*itDontPlay);
+        m_curNotPlayingTeams.erase(itDontPlay);
+    }
+
+    FrameTeams* pRemoveTeams;
+    FrameTeams* pAddTeams;
+    if(!willBePlaying)
+    {
+        pRemoveTeams=framePlaying;
+        pAddTeams=frameDontPlaying;
+    }
+    else
+    {
+        pRemoveTeams=frameDontPlaying;
+        pAddTeams=framePlaying;
+    }
+
+    pAddTeams->addTeam(team, willBePlaying);
+    pRemoveTeams->removeTeam(team);
+    if(!team.isNetTeam() && m_acceptOuter && !willBePlaying)
+    {
+        connect(frameDontPlaying->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
+                this, SLOT(pre_changeTeamStatus(HWTeam)));
+    }
+    else
+    {
+        connect(pAddTeams->getTeamWidget(team), SIGNAL(teamStatusChanged(HWTeam)),
+                this, SLOT(changeTeamStatus(HWTeam)));
+    }
+    if(willBePlaying)
+    {
+        connect(framePlaying->getTeamWidget(team), SIGNAL(hhNmChanged(const HWTeam&)),
+                this, SLOT(hhNumChanged(const HWTeam&)));
+        dynamic_cast<TeamShowWidget*>(framePlaying->getTeamWidget(team))->hhNumChanged();
+        connect(framePlaying->getTeamWidget(team), SIGNAL(teamColorChanged(const HWTeam&)),
+                this, SLOT(proxyTeamColorChanged(const HWTeam&)));
+        emit teamColorChanged(((TeamShowWidget*)framePlaying->getTeamWidget(team))->getTeam());
+    }
+
+    QSize szh=pAddTeams->sizeHint();
+    QSize szh1=pRemoveTeams->sizeHint();
+    if(szh.isValid() && szh1.isValid())
+    {
+        pAddTeams->resize(pAddTeams->size().width(), szh.height());
+        pRemoveTeams->resize(pRemoveTeams->size().width(), szh1.height());
+    }
+
+    emit setEnabledGameStart(curPlayingTeams.size()>1);
 }
 
 void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int fixedHeight)
@@ -213,18 +237,18 @@ void TeamSelWidget::addScrArea(FrameTeams* pfteams, QColor color, int fixedHeigh
         area->setMinimumHeight(fixedHeight);
         area->setMaximumHeight(fixedHeight);
         area->setStyleSheet(
-                "FrameTeams{"
-                    "border: solid;"
-                    "border-width: 1px;"
-                    "border-radius: 16px;"
-                    "border-color: #ffcc00;"
-                    "}"
+            "FrameTeams{"
+            "border: solid;"
+            "border-width: 1px;"
+            "border-radius: 16px;"
+            "border-color: #ffcc00;"
+            "}"
         );
     }
 }
 
 TeamSelWidget::TeamSelWidget(QWidget* parent) :
-  QGroupBox(parent), mainLayout(this), m_acceptOuter(false)
+    QGroupBox(parent), mainLayout(this), m_acceptOuter(false)
 {
     setTitle(QGroupBox::tr("Playing teams"));
     framePlaying = new FrameTeams();
@@ -238,44 +262,44 @@ TeamSelWidget::TeamSelWidget(QWidget* parent) :
 
 void TeamSelWidget::setAcceptOuter(bool acceptOuter)
 {
-  m_acceptOuter=acceptOuter;
+    m_acceptOuter=acceptOuter;
 }
 
 void TeamSelWidget::resetPlayingTeams(const QList<HWTeam>& teamslist)
 {
-  //for(it=curPlayingTeams.begin(); it!=curPlayingTeams.end(); it++) {
-  //framePlaying->removeTeam(*it);
-  //}
-  framePlaying->resetTeams();
-  framePlaying->resetColors();
-  curPlayingTeams.clear();
-  //for(it=curDontPlayingTeams.begin(); it!=curDontPlayingTeams.end(); it++) {
-  //frameDontPlaying->removeTeam(*it);
-  //}
-  frameDontPlaying->resetTeams();
-  m_curNotPlayingTeams.clear();
-
-  foreach(HWTeam team, teamslist)
+    //for(it=curPlayingTeams.begin(); it!=curPlayingTeams.end(); it++) {
+    //framePlaying->removeTeam(*it);
+    //}
+    framePlaying->resetTeams();
+    framePlaying->resetColors();
+    curPlayingTeams.clear();
+    //for(it=curDontPlayingTeams.begin(); it!=curDontPlayingTeams.end(); it++) {
+    //frameDontPlaying->removeTeam(*it);
+    //}
+    frameDontPlaying->resetTeams();
+    m_curNotPlayingTeams.clear();
+
+    foreach(HWTeam team, teamslist)
     addTeam(team);
 }
 
-bool TeamSelWidget::isPlaying(HWTeam team) const
+bool TeamSelWidget::isPlaying(const HWTeam &team) const
 {
-  return std::find(curPlayingTeams.begin(), curPlayingTeams.end(), team)!=curPlayingTeams.end();
+    return curPlayingTeams.contains(team);
 }
 
 QList<HWTeam> TeamSelWidget::getPlayingTeams() const
 {
-  return curPlayingTeams;
+    return curPlayingTeams;
 }
 
 QList<HWTeam> TeamSelWidget::getNotPlayingTeams() const
 {
-  return m_curNotPlayingTeams;
+    return m_curNotPlayingTeams;
 }
 
-void TeamSelWidget::pre_changeTeamStatus(HWTeam team)
+void TeamSelWidget::pre_changeTeamStatus(const HWTeam & team)
 {
-  team.setColor(framePlaying->getNextColor());
-  emit acceptRequested(team);
+    //team.setColor(framePlaying->getNextColor());
+    emit acceptRequested(team);
 }
diff --git a/QTfrontend/ui/widget/teamselect.h b/QTfrontend/ui/widget/teamselect.h
index 4e81043..1636d80 100644
--- a/QTfrontend/ui/widget/teamselect.h
+++ b/QTfrontend/ui/widget/teamselect.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -36,48 +36,48 @@ using namespace std;
 
 class TeamSelWidget : public QGroupBox
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  TeamSelWidget(QWidget* parent);
-  void setAcceptOuter(bool acceptOuter);
-  void removeNetTeam(const HWTeam& team);
-  void resetPlayingTeams(const QList<HWTeam>& teamslist);
-  bool isPlaying(HWTeam team) const;
-  QList<HWTeam> getPlayingTeams() const;
-  QList<HWTeam> getNotPlayingTeams() const;
-  void setInteractivity(bool interactive);
+    public:
+        TeamSelWidget(QWidget* parent);
+        void setAcceptOuter(bool acceptOuter);
+        void removeNetTeam(const HWTeam& team);
+        void resetPlayingTeams(const QList<HWTeam>& teamslist);
+        bool isPlaying(const HWTeam &team) const;
+        QList<HWTeam> getPlayingTeams() const;
+        QList<HWTeam> getNotPlayingTeams() const;
+        void setInteractivity(bool interactive);
 
- public slots:
-  void addTeam(HWTeam team);
-  void netTeamStatusChanged(const HWTeam& team);
-  void changeHHNum(const HWTeam&);
-  void changeTeamColor(const HWTeam&);
-  void changeTeamStatus(HWTeam team);
+    public slots:
+        void addTeam(HWTeam team);
+        void netTeamStatusChanged(const HWTeam& team);
+        void changeHHNum(const HWTeam&);
+        void changeTeamColor(const HWTeam&);
+        void changeTeamStatus(HWTeam team);
 
- signals:
-  void setEnabledGameStart(bool);
-  void teamWillPlay(HWTeam team);
-  void teamNotPlaying(const HWTeam& team);
-  void hhogsNumChanged(const HWTeam&);
-  void teamColorChanged(const HWTeam&);
-  void acceptRequested(HWTeam team);
+    signals:
+        void setEnabledGameStart(bool);
+        void teamWillPlay(const HWTeam& team);
+        void teamNotPlaying(const HWTeam& team);
+        void hhogsNumChanged(const HWTeam&);
+        void teamColorChanged(const HWTeam&);
+        void acceptRequested(const HWTeam& team);
 
- private slots:
-  void pre_changeTeamStatus(HWTeam);
-  void hhNumChanged(const HWTeam& team);
-  void proxyTeamColorChanged(const HWTeam& team);
+    private slots:
+        void pre_changeTeamStatus(const HWTeam&);
+        void hhNumChanged(const HWTeam& team);
+        void proxyTeamColorChanged(const HWTeam& team);
 
- private:
-  void addScrArea(FrameTeams* pfteams, QColor color, int maxHeight);
-  FrameTeams* frameDontPlaying;
-  FrameTeams* framePlaying;
+    private:
+        void addScrArea(FrameTeams* pfteams, QColor color, int maxHeight);
+        FrameTeams* frameDontPlaying;
+        FrameTeams* framePlaying;
 
-  QVBoxLayout mainLayout;
-  bool m_acceptOuter;
+        QVBoxLayout mainLayout;
+        bool m_acceptOuter;
 
-  QList<HWTeam> curPlayingTeams;
-  QList<HWTeam> m_curNotPlayingTeams;
+        QList<HWTeam> curPlayingTeams;
+        QList<HWTeam> m_curNotPlayingTeams;
 };
 
 #endif // _TEAM_SELECT_INCLUDED
diff --git a/QTfrontend/ui/widget/teamselhelper.cpp b/QTfrontend/ui/widget/teamselhelper.cpp
index dacfad4..3e60eda 100644
--- a/QTfrontend/ui/widget/teamselhelper.cpp
+++ b/QTfrontend/ui/widget/teamselhelper.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,22 +20,26 @@
 #include <QPixmap>
 #include <QPainter>
 #include <QStyleFactory>
+#include <QDebug>
 
 #include <algorithm>
 
 #include "teamselhelper.h"
 #include "hwconsts.h"
 #include "frameTeam.h"
+#include "colorwidget.h"
+#include "DataManager.h"
 
 void TeamLabel::teamButtonClicked()
 {
-  emit teamActivated(text());
+    emit teamActivated(text());
 }
 
-TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) :
-  QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0),
-  colorButt(0)
+TeamShowWidget::TeamShowWidget(const HWTeam & team, bool isPlaying, FrameTeams * parent) :
+    QWidget(parent), mainLayout(this), m_team(team), m_isPlaying(isPlaying), phhoger(0),
+    colorWidget(0)
 {
+    m_parentFrameTeams = parent;
     QPalette newPalette = palette();
     newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
     setPalette(newPalette);
@@ -46,39 +50,42 @@ TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) :
     this->setMaximumHeight(38);
     this->setMinimumHeight(38);
     QIcon difficultyIcon=team.isNetTeam() ?
-        QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty()))
-        : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty()));
+                         QIcon(QString(":/res/botlevels/net%1.png").arg(m_team.difficulty()))
+                         : QIcon(QString(":/res/botlevels/%1.png").arg(m_team.difficulty()));
 
     butt = new QPushButton(difficultyIcon, team.name().replace("&","&&"), this);
     butt->setFlat(true);
     butt->setToolTip(team.owner());
     mainLayout.addWidget(butt);
     butt->setStyleSheet("QPushButton{"
-            "icon-size: 48px;"
-            "text-align: left;"
-            "background-color: #0d0544;"
-            "color: orange;"
-            "font: bold;"
-            "border-width: 2px;"
-            "margin: 6px 0px 6px 0px;"
-            "}");
-
-    if(m_isPlaying) {
+                        "icon-size: 48px;"
+                        "text-align: left;"
+                        "background-color: #0d0544;"
+                        "color: orange;"
+                        "font: bold;"
+                        "border-width: 2px;"
+                        "margin: 6px 0px 6px 0px;"
+                        "}");
+
+    if(m_isPlaying)
+    {
         // team color
-        colorButt = new QPushButton(this);
-        colorButt->setMaximumWidth(26);
-        colorButt->setMinimumHeight(26);
-        colorButt->setGeometry(0, 0, 26, 26);
-
-        changeTeamColor();
-        connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor()));
-        mainLayout.addWidget(colorButt);
+        colorWidget = new ColorWidget(DataManager::instance().colorsModel(), this);
+        colorWidget->setMinimumWidth(26);
+        colorWidget->setMaximumWidth(26);
+        colorWidget->setMinimumHeight(26);
+        colorWidget->setMaximumHeight(26);
+        colorWidget->setColor(team.color());
+        connect(colorWidget, SIGNAL(colorChanged(int)), this, SLOT(onColorChanged(int)));
+        mainLayout.addWidget(colorWidget);
 
         phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), QImage(":/res/hh25x25grey.png"), this);
         connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged()));
         phhoger->setHHNum(team.numHedgehogs());
         mainLayout.addWidget(phhoger);
-    } else {
+    }
+    else
+    {
     }
 
     QObject::connect(butt, SIGNAL(clicked()), this, SLOT(activateTeam()));
@@ -87,28 +94,29 @@ TeamShowWidget::TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent) :
 
 void TeamShowWidget::setInteractivity(bool interactive)
 {
-    if(m_team.isNetTeam()) {
+    if(m_team.isNetTeam())
+    {
         butt->setEnabled(interactive);
     }
 
-    colorButt->setEnabled(interactive);
+    colorWidget->setEnabled(interactive);
     phhoger->setEnabled(interactive);
 }
 
 void TeamShowWidget::setHHNum(unsigned int num)
 {
-  phhoger->setHHNum(num);
+    phhoger->setHHNum(num);
 }
 
 void TeamShowWidget::hhNumChanged()
 {
-  m_team.setNumHedgehogs(phhoger->getHedgehogsNum());
-  emit hhNmChanged(m_team);
+    m_team.setNumHedgehogs(phhoger->getHedgehogsNum());
+    emit hhNmChanged(m_team);
 }
 
 void TeamShowWidget::activateTeam()
 {
-  emit teamStatusChanged(m_team);
+    emit teamStatusChanged(m_team);
 }
 
 /*HWTeamTempParams TeamShowWidget::getTeamParams() const
@@ -120,35 +128,20 @@ void TeamShowWidget::activateTeam()
   return params;
 }*/
 
-void TeamShowWidget::changeTeamColor(QColor color)
-{
-    FrameTeams* pOurFrameTeams=dynamic_cast<FrameTeams*>(parentWidget());
-    if(!color.isValid()) {
-        if(++pOurFrameTeams->currentColor==pOurFrameTeams->availableColors.end()) {
-            pOurFrameTeams->currentColor=pOurFrameTeams->availableColors.begin();
-        }
-        color=*pOurFrameTeams->currentColor;
-    } else {
-        // set according color iterator
-        pOurFrameTeams->currentColor=std::find(pOurFrameTeams->availableColors.begin(),
-                pOurFrameTeams->availableColors.end(), color);
-        if(pOurFrameTeams->currentColor==pOurFrameTeams->availableColors.end()) {
-            // error condition
-            pOurFrameTeams->currentColor=pOurFrameTeams->availableColors.begin();
-        }
-    }
 
-    colorButt->setStyleSheet(QString("QPushButton{"
-            "background-color: %1;"
-            "border-width: 1px;"
-            "border-radius: 2px;"
-            "}").arg(pOurFrameTeams->currentColor->name()));
+void TeamShowWidget::changeTeamColor(int color)
+{
+    colorWidget->setColor(color);
+}
 
+void TeamShowWidget::onColorChanged(int color)
+{
     m_team.setColor(color);
+
     emit teamColorChanged(m_team);
 }
 
 HWTeam TeamShowWidget::getTeam() const
 {
-  return m_team;
+    return m_team;
 }
diff --git a/QTfrontend/ui/widget/teamselhelper.h b/QTfrontend/ui/widget/teamselhelper.h
index 2823725..5abb445 100644
--- a/QTfrontend/ui/widget/teamselhelper.h
+++ b/QTfrontend/ui/widget/teamselhelper.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,53 +28,56 @@
 #include "teamselect.h"
 #include "hedgehogerWidget.h"
 
+class ColorWidget;
+
 class TeamLabel : public QLabel
 {
- Q_OBJECT
+        Q_OBJECT
 
- public:
- TeamLabel(const QString& inp_str) : QLabel(inp_str) {};
+    public:
+        TeamLabel(const QString& inp_str) : QLabel(inp_str) {};
 
- signals:
- void teamActivated(QString team_name);
+    signals:
+        void teamActivated(QString team_name);
 
- public slots:
- void teamButtonClicked();
+    public slots:
+        void teamButtonClicked();
 
 };
 
 class TeamShowWidget : public QWidget
 {
- Q_OBJECT
-
- public slots:
- void changeTeamColor(QColor color=QColor());
- void hhNumChanged();
-
- private slots:
- void activateTeam();
-
- public:
- TeamShowWidget(HWTeam team, bool isPlaying, QWidget * parent);
- void setPlaying(bool isPlaying);
- void setHHNum(unsigned int num);
- void setInteractivity(bool interactive);
- HWTeam getTeam() const;
-
- private:
- TeamShowWidget();
- QHBoxLayout mainLayout;
- HWTeam m_team;
- bool m_isPlaying;
- CHedgehogerWidget* phhoger;
- QPushButton* colorButt;
- QPushButton* butt;
-// QPushButton* bText;
-
- signals:
- void teamStatusChanged(HWTeam team);
- void hhNmChanged(const HWTeam&);
- void teamColorChanged(const HWTeam&);
+        Q_OBJECT
+
+    public slots:
+        void changeTeamColor(int color = 0);
+        void hhNumChanged();
+
+    private slots:
+        void activateTeam();
+        void onColorChanged(int color);
+
+    public:
+        TeamShowWidget(const HWTeam &team, bool isPlaying, FrameTeams * parent);
+        void setPlaying(bool isPlaying);
+        void setHHNum(unsigned int num);
+        void setInteractivity(bool interactive);
+        HWTeam getTeam() const;
+
+    private:
+        TeamShowWidget();
+        QHBoxLayout mainLayout;
+        HWTeam m_team;
+        bool m_isPlaying;
+        CHedgehogerWidget* phhoger;
+        ColorWidget* colorWidget;
+        QPushButton* butt;
+        FrameTeams * m_parentFrameTeams;
+
+    signals:
+        void teamStatusChanged(HWTeam team);
+        void hhNmChanged(const HWTeam&);
+        void teamColorChanged(const HWTeam&);
 };
 
 #endif // _TEAMSEL_HELPER_INCLUDED
diff --git a/QTfrontend/ui/widget/togglebutton.cpp b/QTfrontend/ui/widget/togglebutton.cpp
index 5308d72..8c2801f 100644
--- a/QTfrontend/ui/widget/togglebutton.cpp
+++ b/QTfrontend/ui/widget/togglebutton.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email at thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/QTfrontend/ui/widget/togglebutton.h b/QTfrontend/ui/widget/togglebutton.h
index 0001ae9..e256987 100644
--- a/QTfrontend/ui/widget/togglebutton.h
+++ b/QTfrontend/ui/widget/togglebutton.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Kristian Lehmann <email at thexception.net>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,15 +28,15 @@
 
 class ToggleButtonWidget : public QPushButton
 {
-    Q_OBJECT
-public:
-    ToggleButtonWidget(QWidget * parent, QString img);
-    ~ToggleButtonWidget();
-private:
-    QPixmap pmChecked;
-    QPixmap pmDisabled;
-private slots:
-    void eventToggled(bool checked);
+        Q_OBJECT
+    public:
+        ToggleButtonWidget(QWidget * parent, QString img);
+        ~ToggleButtonWidget();
+    private:
+        QPixmap pmChecked;
+        QPixmap pmDisabled;
+    private slots:
+        void eventToggled(bool checked);
 };
 
 #endif // TOGGLEBUTTONWIDGET_H
diff --git a/QTfrontend/ui/widget/vertScrollArea.cpp b/QTfrontend/ui/widget/vertScrollArea.cpp
index bda34aa..c95ab27 100644
--- a/QTfrontend/ui/widget/vertScrollArea.cpp
+++ b/QTfrontend/ui/widget/vertScrollArea.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,7 +22,7 @@
 #include <QResizeEvent>
 
 VertScrArea::VertScrArea(QColor frameColor, QWidget * parent) :
-  QScrollArea(parent)
+    QScrollArea(parent)
 {
     QPalette newPalette = palette();
     newPalette.setColor(QPalette::Background, frameColor);
diff --git a/QTfrontend/ui/widget/vertScrollArea.h b/QTfrontend/ui/widget/vertScrollArea.h
index a1ccefd..4b1699a 100644
--- a/QTfrontend/ui/widget/vertScrollArea.h
+++ b/QTfrontend/ui/widget/vertScrollArea.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,13 +24,13 @@
 
 class VertScrArea : public QScrollArea
 {
-    Q_OBJECT
+        Q_OBJECT
 
-public:
-    VertScrArea(QColor frameColor, QWidget * parent = 0);
+    public:
+        VertScrArea(QColor frameColor, QWidget * parent = 0);
 
-protected:
-    virtual void resizeEvent(QResizeEvent * event);
+    protected:
+        virtual void resizeEvent(QResizeEvent * event);
 };
 
 #endif // _VERT_SCROLL_AREA_INCLUDED
diff --git a/QTfrontend/ui/widget/weaponItem.cpp b/QTfrontend/ui/widget/weaponItem.cpp
index dc2c790..7e37962 100644
--- a/QTfrontend/ui/widget/weaponItem.cpp
+++ b/QTfrontend/ui/widget/weaponItem.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,7 +20,7 @@
 #include "weaponItem.h"
 
 WeaponItem::WeaponItem(const QImage& im, const QImage& img, QWidget * parent) :
-  ItemNum(im, img, parent, 0)
+    ItemNum(im, img, parent, 0)
 {
 }
 
@@ -30,11 +30,11 @@ WeaponItem::~WeaponItem()
 
 void WeaponItem::incItems()
 {
-  ++numItems;
+    ++numItems;
 }
 
 void WeaponItem::decItems()
 {
-  --numItems;
+    --numItems;
 }
 
diff --git a/QTfrontend/ui/widget/weaponItem.h b/QTfrontend/ui/widget/weaponItem.h
index 7e37221..b2d6a70 100644
--- a/QTfrontend/ui/widget/weaponItem.h
+++ b/QTfrontend/ui/widget/weaponItem.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2008-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,21 +24,21 @@
 
 class WeaponItem : public ItemNum
 {
-  Q_OBJECT
+        Q_OBJECT
 
- public:
-  WeaponItem(const QImage& im, const QImage& img, QWidget * parent);
-  virtual ~WeaponItem();
+    public:
+        WeaponItem(const QImage& im, const QImage& img, QWidget * parent);
+        virtual ~WeaponItem();
 
- signals:
-  void hedgehogsNumChanged();
+    signals:
+        void hedgehogsNumChanged();
 
- protected:
-  virtual void incItems();
-  virtual void decItems();
+    protected:
+        virtual void incItems();
+        virtual void decItems();
 
- private:
-  WeaponItem();
+    private:
+        WeaponItem();
 };
 
 #endif // _WEAPON_ITEM
diff --git a/QTfrontend/ui_hwform.cpp b/QTfrontend/ui_hwform.cpp
index 2e83a4c..c5eeab6 100644
--- a/QTfrontend/ui_hwform.cpp
+++ b/QTfrontend/ui_hwform.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,6 +27,7 @@
 #include "pagetraining.h"
 #include "pagenetserver.h"
 #include "pageoptions.h"
+#include "pagefeedback.h"
 #include "pageingame.h"
 #include "pagescheme.h"
 #include "pagenettype.h"
@@ -45,6 +46,7 @@
 #include "pagegamestats.h"
 #include "pageplayrecord.h"
 #include "pagedata.h"
+#include "pagevideos.h"
 #include "hwconsts.h"
 
 void Ui_HWForm::setupUi(HWForm *HWForm)
@@ -141,4 +143,10 @@ void Ui_HWForm::SetupPages(QWidget *Parent, HWForm *HWForm)
 
     pageDataDownload = new PageDataDownload();
     Pages->addWidget(pageDataDownload);
+
+    pageFeedback = new PageFeedback();
+    Pages->addWidget(pageFeedback);
+
+    pageVideos = new PageVideos();
+    Pages->addWidget(pageVideos);
 }
diff --git a/QTfrontend/ui_hwform.h b/QTfrontend/ui_hwform.h
index 43d53f3..1b24e39 100644
--- a/QTfrontend/ui_hwform.h
+++ b/QTfrontend/ui_hwform.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,6 +24,7 @@ class PageEditTeam;
 class PageMultiplayer;
 class PagePlayDemo;
 class PageOptions;
+class PageFeedback;
 class PageNet;
 class PageNetServer;
 class PageNetChat;
@@ -42,6 +43,7 @@ class PageScheme;
 class PageAdmin;
 class PageNetType;
 class PageDrawMap;
+class PageVideos;
 class QStackedLayout;
 class QFont;
 class QWidget;
@@ -50,39 +52,41 @@ class HWForm;
 
 class Ui_HWForm
 {
-public:
-    QWidget *centralWidget;
+    public:
+        QWidget *centralWidget;
 
-    PageMain *pageMain;
-    PageEditTeam *pageEditTeam;
-    PageMultiplayer *pageMultiplayer;
-    PagePlayDemo *pagePlayDemo;
-    PageOptions *pageOptions;
-    PageNet *pageNet;
-    PageNetServer * pageNetServer;
-    PageNetChat *pageNetChat;
-    PageNetGame *pageNetGame;
-    PageInfo *pageInfo;
-    PageDataDownload *pageDataDownload;
-    PageGameStats *pageGameStats;
-    PageSinglePlayer *pageSinglePlayer;
-    PageTraining *pageTraining;
-    PageSelectWeapon *pageSelectWeapon;
-    PageInGame *pageInGame;
-    PageRoomsList *pageRoomsList;
-    PageConnecting *pageConnecting;
-    PageScheme *pageScheme;
-    PageAdmin *pageAdmin;
-    PageNetType *pageNetType;
-    PageCampaign *pageCampaign;
-    PageDrawMap *pageDrawMap;
+        PageMain *pageMain;
+        PageEditTeam *pageEditTeam;
+        PageMultiplayer *pageMultiplayer;
+        PagePlayDemo *pagePlayDemo;
+        PageOptions *pageOptions;
+        PageFeedback *pageFeedback;
+        PageNet *pageNet;
+        PageNetServer * pageNetServer;
+        PageNetChat *pageNetChat;
+        PageNetGame *pageNetGame;
+        PageInfo *pageInfo;
+        PageDataDownload *pageDataDownload;
+        PageGameStats *pageGameStats;
+        PageSinglePlayer *pageSinglePlayer;
+        PageTraining *pageTraining;
+        PageSelectWeapon *pageSelectWeapon;
+        PageInGame *pageInGame;
+        PageRoomsList *pageRoomsList;
+        PageConnecting *pageConnecting;
+        PageScheme *pageScheme;
+        PageAdmin *pageAdmin;
+        PageNetType *pageNetType;
+        PageCampaign *pageCampaign;
+        PageDrawMap *pageDrawMap;
+        PageVideos *pageVideos;
 
-    QStackedLayout *Pages;
-    QFont *font14;
+        QStackedLayout *Pages;
+        QFont *font14;
 
-    void setupUi(HWForm *HWForm);
-    void SetupFonts();
-    void SetupPages(QWidget *Parent, HWForm *HWForm);
+        void setupUi(HWForm *HWForm);
+        void SetupFonts();
+        void SetupPages(QWidget *Parent, HWForm *HWForm);
 };
 
 #endif // UI_HWFORM_H
diff --git a/QTfrontend/util/DataManager.cpp b/QTfrontend/util/DataManager.cpp
new file mode 100644
index 0000000..302fc28
--- /dev/null
+++ b/QTfrontend/util/DataManager.cpp
@@ -0,0 +1,215 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataManager class implementation
+ */
+
+#include <QMap>
+#include <QStringList>
+#include <QStandardItemModel>
+#include <QFileInfo>
+
+#include "hwconsts.h"
+#include "HWApplication.h"
+#include "sdlkeys.h"
+
+#include "DataManager.h"
+
+#include "GameStyleModel.h"
+#include "HatModel.h"
+#include "MapModel.h"
+#include "ThemeModel.h"
+
+DataManager::DataManager()
+{
+    m_userData = new QDir(cfgdir->absolutePath());
+    if (!m_userData->cd("Data"))
+        m_userData = NULL;
+
+    m_defaultData = new QDir(datadir->absolutePath());
+
+    m_hatModel = NULL;
+    m_mapModel = NULL;
+    m_themeModel = NULL;
+    m_colorsModel = NULL;
+    m_bindsModel = NULL;
+}
+
+
+DataManager & DataManager::instance()
+{
+    static DataManager instance;
+    return instance;
+}
+
+
+QStringList DataManager::entryList(
+    const QString & subDirectory,
+    QDir::Filters filters,
+    const QStringList & nameFilters
+) const
+{
+    QStringList result;
+
+    if (m_userData != NULL)
+    {
+        QDir tmpDir(*m_userData);
+        if (tmpDir.cd(subDirectory))
+            result.append(tmpDir.entryList(nameFilters, filters));
+    }
+
+    QDir tmpDir(*m_defaultData);
+    if (tmpDir.cd(subDirectory))
+        result.append(tmpDir.entryList(nameFilters, filters));
+
+    result.removeDuplicates();
+
+    // sort case-insensitive
+    QMap<QString, QString> sortedFileNames;
+    foreach ( QString fn, result)
+    {
+        sortedFileNames.insert(fn.toLower(), fn);
+    }
+    result = sortedFileNames.values();
+
+    return result;
+}
+
+
+QString DataManager::findFileForRead(
+    const QString & relativeDataFilePath) const
+{
+    QString path;
+
+    if (m_userData != NULL)
+        path = m_userData->absolutePath()+"/"+relativeDataFilePath;
+
+    if ((!path.isEmpty()) && (!QFile::exists(path)))
+        path = m_defaultData->absolutePath()+"/"+relativeDataFilePath;
+
+    return path;
+}
+
+
+QString DataManager::findFileForWrite(
+    const QString & relativeDataFilePath) const
+{
+    if (m_userData != NULL)
+    {
+        QString path = m_userData->absolutePath()+"/"+relativeDataFilePath;
+
+        // create folders if needed
+        QDir tmp;
+        tmp.mkpath(QFileInfo(path).absolutePath());
+
+        return path;
+    }
+
+
+    return "";
+}
+
+GameStyleModel * DataManager::gameStyleModel()
+{
+    if (m_gameStyleModel == NULL) {
+        m_gameStyleModel = new GameStyleModel();
+        m_gameStyleModel->loadGameStyles();
+    }
+    return m_gameStyleModel;
+}
+
+HatModel * DataManager::hatModel()
+{
+    if (m_hatModel == NULL) {
+        m_hatModel = new HatModel();
+        m_hatModel->loadHats();
+    }
+    return m_hatModel;
+}
+
+MapModel * DataManager::mapModel()
+{
+    if (m_mapModel == NULL) {
+        m_mapModel = new MapModel();
+        m_mapModel->loadMaps();
+    }
+    return m_mapModel;
+}
+
+ThemeModel * DataManager::themeModel()
+{
+    if (m_themeModel == NULL) {
+        m_themeModel = new ThemeModel();
+        m_themeModel->loadThemes();
+    }
+    return m_themeModel;
+}
+
+QStandardItemModel * DataManager::colorsModel()
+{
+    if(m_colorsModel == NULL)
+    {
+        m_colorsModel = new QStandardItemModel();
+
+        int i = 0;
+        while(colors[i])
+        {
+            QStandardItem * item = new QStandardItem();
+            item->setData(QColor(colors[i]));
+            m_colorsModel->appendRow(item);
+            ++i;
+        }
+    }
+
+    return m_colorsModel;
+}
+
+QStandardItemModel * DataManager::bindsModel()
+{
+    if(m_bindsModel == NULL)
+    {
+        m_bindsModel = new QStandardItemModel();
+
+        for(int j = 0; sdlkeys[j][1][0] != '\0'; j++)
+        {
+            QStandardItem * item = new QStandardItem();
+            item->setData(HWApplication::translate("binds (keys)", sdlkeys[j][1]).contains(": ") ? HWApplication::translate("binds (keys)", sdlkeys[j][1]) : HWApplication::translate("binds (keys)", "Keyboard") + QString(": ") + HWApplication::translate("binds (keys)", sdlkeys[j][1]), Qt::DisplayRole);
+            item->setData(sdlkeys[j][0], Qt::UserRole + 1);
+            m_bindsModel->appendRow(item);
+        }
+    }
+
+    return m_bindsModel;
+}
+
+void DataManager::reload()
+{
+    // removed for now (also code was a bit unclean, could lead to segfault if
+    // reload() is called before all members are initialized - because currently
+    // they are initialized in the getter methods rather than the constructor)
+}
+
+void DataManager::resetColors()
+{
+    for(int i = colorsModel()->rowCount() - 1; i >= 0; --i)
+    {
+        m_colorsModel->item(i)->setData(QColor(colors[i]));
+    }
+}
diff --git a/QTfrontend/util/DataManager.h b/QTfrontend/util/DataManager.h
new file mode 100644
index 0000000..b50bddd
--- /dev/null
+++ b/QTfrontend/util/DataManager.h
@@ -0,0 +1,166 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/**
+ * @file
+ * @brief DataManager class definition
+ */
+
+#ifndef HEDGEWARS_DATAMANAGER_H
+#define HEDGEWARS_DATAMANAGER_H
+
+#include <QDir>
+#include <QFile>
+#include <QStringList>
+
+class GameStyleModel;
+class HatModel;
+class MapModel;
+class ThemeModel;
+class QStandardItemModel;
+
+/**
+ * @brief Offers access to the data files of hedgewars.
+ *
+ * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+ *
+ * @author sheepluva
+ * @since 0.9.17
+ */
+class DataManager: public QObject
+{
+        Q_OBJECT
+
+    public:
+        /**
+         * @brief Returns reference to the <i>singleton</i> instance of this class.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         *
+         * @return reference to the instance.
+         */
+        static DataManager & instance();
+
+        /**
+         * @brief Returns a sorted list of data directory entries.
+         *
+         * @param subDirectory sub-directory to search.
+         * @param filters filters for entry type.
+         * @param nameFilters filters by name patterns.
+         * @return a sorted list of matches in the subDirectory of data directory.
+         */
+        QStringList entryList(const QString & subDirectory,
+                              QDir::Filters filters = QDir::NoFilter,
+                              const QStringList & nameFilters = QStringList("*")
+                             ) const;
+
+        /**
+         * @brief Returns the path for the desires data file.
+         *
+         * Use this method if you want to read an existing data file.
+         *
+         * @param relativeDataFilePath relative path of the data file.
+         * @return real path to the file.
+         */
+        QString findFileForRead(const QString & relativeDataFilePath) const;
+
+
+        /**
+         * @brief Returns the path for the data file that is to be written.
+         *
+         * Use this method if you want to create or write into a data file.
+         *
+         * @param relativeDataFilePath relative path of data file write path.
+         * @return destination of path data file.
+         */
+        QString findFileForWrite(const QString & relativeDataFilePath) const;
+
+
+        /**
+         * @brief Returns pointer to a model of available game styles.
+         *
+         * The model is updated automatically on data reload.
+         *
+         * @return game style model pointer.
+         */
+        GameStyleModel * gameStyleModel();
+
+        /**
+         * @brief Returns pointer to a model of available hats.
+         *
+         * The model is updated automatically on data reload.
+         *
+         * @return hat model pointer.
+         */
+        HatModel * hatModel();
+
+        /**
+         * @brief Returns pointer to a model of available maps.
+         *
+         * The model is updated automatically on data reload.
+         *
+         * @return map model pointer.
+         */
+        MapModel * mapModel();
+
+        /**
+         * @brief Returns pointer to a model of available themes.
+         *
+         * The model is updated automatically on data reload.
+         *
+         * @return theme model pointer.
+         */
+        ThemeModel * themeModel();
+
+        QStandardItemModel * colorsModel();
+        QStandardItemModel * bindsModel();
+
+    public slots:
+        /// Reloads data from storage.
+        void reload();
+        void resetColors();
+
+
+    signals:
+        /// This signal is emitted after the data has been updated.
+        void updated();
+
+
+    private:
+        /**
+         * @brief Class constructor of the <i>singleton</i>.
+         *
+         * Not to be used from outside the class,
+         * use the static {@link DataManager::instance()} instead.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         */
+        DataManager();
+
+        QDir * m_defaultData; ///< directory of the installed data
+        QDir * m_userData;    ///< directory of custom data in the user's directory
+
+        GameStyleModel * m_gameStyleModel; ///< game style model instance
+        HatModel * m_hatModel; ///< hat model instance
+        MapModel * m_mapModel; ///< map model instance
+        ThemeModel * m_themeModel; ///< theme model instance
+        QStandardItemModel * m_colorsModel;
+        QStandardItemModel * m_bindsModel;
+};
+
+#endif // HEDGEWARS_DATAMANAGER_H
diff --git a/QTfrontend/util/HWDataManager.cpp b/QTfrontend/util/HWDataManager.cpp
deleted file mode 100644
index cf4f47d..0000000
--- a/QTfrontend/util/HWDataManager.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-/**
- * @file
- * @brief HWDataManager class implementation
- */
-
-#include <QMap>
-#include <QStringList>
-
-#include <QFileInfo>
-
-#include "hwconsts.h"
-
-#include "HWDataManager.h"
-
-
-HWDataManager::HWDataManager()
-{
-    userData = new QDir(cfgdir->absolutePath());
-    if (!userData->cd("Data"))
-        userData = NULL;
-
-    defaultData = new QDir(datadir->absolutePath());
-}
-
-
-HWDataManager & HWDataManager::instance()
-{
-    static HWDataManager instance;
-    return instance;
-}
-
-
-QStringList HWDataManager::entryList(
-                    const QString & subDirectory,
-                    QDir::Filters filters,
-                    const QStringList & nameFilters
-                    ) const
-{
-    QStringList result;
-
-    if (userData != NULL)
-    {
-        QDir tmpDir(*userData);
-        if (tmpDir.cd(subDirectory))
-            result.append(tmpDir.entryList(nameFilters, filters));
-    }
-
-    QDir tmpDir(*defaultData);
-    if (tmpDir.cd(subDirectory))
-        result.append(tmpDir.entryList(nameFilters, filters));
-
-    result.removeDuplicates();
-
-    // sort case-insensitive
-    QMap<QString, QString> sortedFileNames;
-    foreach ( QString fn, result)
-    {
-        sortedFileNames.insert(fn.toLower(), fn);
-    }
-    result = sortedFileNames.values();
-
-    return result;
-}
-
-
-QString HWDataManager::findFileForRead(
-                                const QString & relativeDataFilePath) const
-{
-    QString path;
-
-    if (userData != NULL)
-        path = userData->absolutePath()+"/"+relativeDataFilePath;
-
-    if ((!path.isEmpty()) && (!QFile::exists(path)))
-        path = defaultData->absolutePath()+"/"+relativeDataFilePath;
-
-    return path;
-}
-
-
-QString HWDataManager::findFileForWrite(
-                                const QString & relativeDataFilePath) const
-{
-    if (userData != NULL)
-    {
-        QString path = userData->absolutePath()+"/"+relativeDataFilePath;
-
-        // create folders if needed
-        QDir tmp;
-        tmp.mkpath(QFileInfo(path).absolutePath());
-
-        return path;
-    }
-
-
-    return "";
-}
-
diff --git a/QTfrontend/util/HWDataManager.h b/QTfrontend/util/HWDataManager.h
deleted file mode 100644
index 8cf2e9d..0000000
--- a/QTfrontend/util/HWDataManager.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov at gmail.com>
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-/**
- * @file
- * @brief HWDataManager class definition
- */
-
-#ifndef HEDGEWARS_HWDATAMANAGER_H
-#define HEDGEWARS_HWDATAMANAGER_H
-
-#include <QDir>
-#include <QFile>
-
-#include <QStringList>
-
-class QDir;
-class QFile;
-class QStringList;
-
-/**
- * @brief Offers access to the data files of hedgewars.
- * 
- * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
- * 
- * @author sheepluva
- * @since 0.9.17
- */
-class HWDataManager
-{
-public:
-    /**
-     * @brief Returns reference to the <i>singleton</i> instance of this class.
-     * 
-     * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-     * 
-     * @return reference to the instance.
-     */
-    static HWDataManager & instance();
-
-    /**
-     * @brief Returns a sorted list of data directory entries.
-     * 
-     * @param subDirectory sub-directory to search.
-     * @param filters filters for entry type.
-     * @param nameFilters filters by name patterns.
-     * @return a sorted list of matches in the subDirectory of data directory.
-     */
-    QStringList entryList(const QString & subDirectory,
-                          QDir::Filters filters = QDir::NoFilter,
-                          const QStringList & nameFilters = QStringList("*")
-                         ) const;
-
-    /**
-     * @brief Returns the path for the desires data file.
-     * 
-     * Use this method if you want to read an existing data file.
-     * 
-     * @param relativeDataFilePath relative path of the data file.
-     * @return real path to the file.
-     */
-    QString findFileForRead(const QString & relativeDataFilePath) const;
-
-
-    /**
-     * @brief Returns the path for the data file that is to be written.
-     * 
-     * Use this method if you want to create or write into a data file.
-     * 
-     * @param relativeDataFilePath relative path of data file write path.
-     * @return destination of path data file.
-     */
-    QString findFileForWrite(const QString & relativeDataFilePath) const;
-
-
-private:
-    /**
-     * @brief Class constructor of the <i>singleton</i>.
-     * 
-     * Not to be used from outside the class,
-     * use the static {@link HWDataManager::instance()} instead.
-     * 
-     * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-     */
-    HWDataManager();
-
-    QDir * defaultData; ///< directory of the installed data
-    QDir * userData;    ///< directory of custom data in the user's directory
-};
-
-#endif // HEDGEWARS_HWDATAMANAGER_H
diff --git a/QTfrontend/util/LibavInteraction.cpp b/QTfrontend/util/LibavInteraction.cpp
new file mode 100644
index 0000000..4dbdea0
--- /dev/null
+++ b/QTfrontend/util/LibavInteraction.cpp
@@ -0,0 +1,356 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include "LibavInteraction.h"
+
+#if VIDEOREC
+extern "C"
+{
+#include "libavformat/avformat.h"
+}
+
+#include <QVector>
+#include <QList>
+#include <QComboBox>
+
+#include "HWApplication.h"
+
+struct Codec
+{
+    CodecID id;
+    bool isAudio;
+    QString shortName; // used for identification
+    QString longName; // used for displaying to user
+    bool isRecomended;
+};
+
+struct Format
+{
+    QString shortName;
+    QString longName;
+    bool isRecomended;
+    QString extension;
+    QVector<Codec*> codecs;
+};
+
+QList<Codec> codecs;
+QMap<QString,Format> formats;
+
+// test if given format supports given codec
+bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
+{
+#if LIBAVFORMAT_VERSION_MAJOR >= 54
+    return avformat_query_codec(ofmt, codec_id, FF_COMPLIANCE_NORMAL) == 1;
+#else
+    if (ofmt->codec_tag)
+        return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
+    return codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec;
+#endif
+}
+
+LibavInteraction::LibavInteraction() : QObject()
+{
+    // initialize libav and register all codecs and formats
+    av_register_all();
+
+    // get list of all codecs
+    AVCodec* pCodec = NULL;
+    while (pCodec = av_codec_next(pCodec))
+    {
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+        if (!av_codec_is_encoder(pCodec))
+#else
+        if (!pCodec->encode)
+#endif
+            continue;
+
+        if (pCodec->type != AVMEDIA_TYPE_VIDEO && pCodec->type != AVMEDIA_TYPE_AUDIO)
+            continue;
+
+        // this encoders seems to be buggy
+        if (strcmp(pCodec->name, "rv10") == 0 || strcmp(pCodec->name, "rv20") == 0)
+            continue;
+
+        // doesn't support stereo sound
+        if (strcmp(pCodec->name, "real_144") == 0)
+            continue;
+
+        if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
+            continue;
+
+        if (pCodec->type == AVMEDIA_TYPE_VIDEO)
+        {
+            if (pCodec->supported_framerates != NULL)
+                continue;
+
+            // check if codec supports yuv 4:2:0 format
+            if (!pCodec->pix_fmts)
+                continue;
+            bool yuv420Supported = false;
+            for (const PixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == PIX_FMT_YUV420P)
+                {
+                    yuv420Supported = true;
+                    break;
+                }
+            if (!yuv420Supported)
+                continue;
+        }
+        if (pCodec->type == AVMEDIA_TYPE_AUDIO)
+        {
+            // check if codec supports signed 16-bit format
+            if (!pCodec->sample_fmts)
+                continue;
+            bool s16Supported = false;
+            for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == AV_SAMPLE_FMT_S16)
+                {
+                    s16Supported = true;
+                    break;
+                }
+            if (!s16Supported)
+                continue;
+        }
+        // add codec to list of codecs
+        codecs.push_back(Codec());
+        Codec & codec = codecs.back();
+        codec.id = pCodec->id;
+        codec.isAudio = pCodec->type == AVMEDIA_TYPE_AUDIO;
+        codec.shortName = pCodec->name;
+        codec.longName = pCodec->long_name;
+
+        codec.isRecomended = false;
+        if (strcmp(pCodec->name, "libx264") == 0)
+        {
+            codec.longName = "H.264/MPEG-4 Part 10 AVC (x264)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libxvid") == 0)
+        {
+            codec.longName = "MPEG-4 Part 2 (Xvid)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libmp3lame") == 0)
+        {
+            codec.longName = "MP3 (MPEG audio layer 3) (LAME)";
+            codec.isRecomended = true;
+        }
+        else
+            codec.longName = pCodec->long_name;
+
+        if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
+            codec.isRecomended = true;
+
+        // FIXME: remove next line
+        //codec.longName += QString(" (%1)").arg(codec.shortName);
+    }
+
+    // get list of all formats
+    AVOutputFormat* pFormat = NULL;
+    while (pFormat = av_oformat_next(pFormat))
+    {
+        if (!pFormat->extensions)
+            continue;
+
+        // skip some strange formats to not confuse users
+        if (strstr(pFormat->long_name, "raw"))
+            continue;
+
+        Format format;
+        bool hasVideoCodec = false;
+        for (QList<Codec>::iterator codec = codecs.begin(); codec != codecs.end(); ++codec)
+        {
+            if (!FormatQueryCodec(pFormat, codec->id))
+                continue;
+            format.codecs.push_back(&*codec);
+            if (!codec->isAudio)
+                hasVideoCodec = true;
+        }
+        if (!hasVideoCodec)
+            continue;
+
+        QString ext(pFormat->extensions);
+        ext.truncate(strcspn(pFormat->extensions, ","));
+        format.extension = ext;
+        format.shortName = pFormat->name;
+        format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
+
+        // FIXME: remove next line
+        //format.longName += QString(" (%1)").arg(format.shortName);
+
+        format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
+
+        formats[pFormat->name] = format;
+    }
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    // first insert recomended formats
+    foreach(const Format & format, formats)
+        if (format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // remember where to place separator between recomended and other formats
+    int sep = pFormats->count();
+
+    // insert remaining formats
+    foreach(const Format & format, formats)
+        if (!format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // insert separator if necessary
+    if (sep != 0 && sep != pFormats->count())
+        pFormats->insertSeparator(sep);
+}
+
+void LibavInteraction::fillCodecs(const QString & fmt, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Format & format = formats[fmt];
+
+    // first insert recomended codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // remember where to place separators between recomended and other codecs
+    int vsep = pVCodecs->count();
+    int asep = pACodecs->count();
+
+    // insert remaining codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (!codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // insert separators if necessary
+    if (vsep != 0 && vsep != pVCodecs->count())
+        pVCodecs->insertSeparator(vsep);
+    if (asep != 0 && asep != pACodecs->count())
+        pACodecs->insertSeparator(asep);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    return formats[format].extension;
+}
+
+// get information abaout file (duration, resolution etc) in multiline string
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    AVFormatContext* pContext = NULL;
+    QByteArray utf8path = filepath.toUtf8();
+    if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
+        return "";
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    if (av_find_stream_info(pContext) < 0)
+#else
+    if (avformat_find_stream_info(pContext, NULL) < 0)
+#endif
+        return "";
+
+    int s = float(pContext->duration)/AV_TIME_BASE;
+    QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60);
+    for (int i = 0; i < (int)pContext->nb_streams; i++)
+    {
+        AVStream* pStream = pContext->streams[i];
+        if (!pStream)
+            continue;
+        AVCodecContext* pCodec = pContext->streams[i]->codec;
+        if (!pCodec)
+            continue;
+
+        if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO)
+        {
+            desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height);
+            if (pStream->avg_frame_rate.den)
+            {
+                float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den;
+                desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2);
+            }
+        }
+        else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO)
+            desc += tr("Audio: ");
+        else
+            continue;
+        AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id);
+        desc += pDecoder? pDecoder->name : "unknown";
+        desc += "\n";
+    }
+    AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
+    if (pComment)
+        desc += QString("\n") + pComment->value;
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    av_close_input_file(pContext);
+#else
+    avformat_close_input(&pContext);
+#endif
+    return desc;
+}
+
+#else
+LibavInteraction::LibavInteraction() : QObject()
+{
+
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    Q_UNUSED(pFormats);
+}
+
+void LibavInteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Q_UNUSED(format);
+    Q_UNUSED(pVCodecs);
+    Q_UNUSED(pACodecs);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    Q_UNUSED(format);
+
+    return QString();
+}
+
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    Q_UNUSED(filepath);
+
+    return QString();
+}
+#endif
+
+LibavInteraction & LibavInteraction::instance()
+{
+    static LibavInteraction instance;
+    return instance;
+}
diff --git a/QTfrontend/util/LibavInteraction.h b/QTfrontend/util/LibavInteraction.h
new file mode 100644
index 0000000..8010f8d
--- /dev/null
+++ b/QTfrontend/util/LibavInteraction.h
@@ -0,0 +1,51 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef LIBAV_ITERACTION
+#define LIBAV_ITERACTION
+
+#include <QComboBox>
+
+/**
+ * @brief Class for interacting with ffmpeg/libav libraries
+ *
+ * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+ */
+class LibavInteraction : public QObject
+{
+    Q_OBJECT;
+
+    LibavInteraction();
+
+public:
+
+    static LibavInteraction & instance();
+
+    // fill combo box with known file formats
+    void fillFormats(QComboBox * pFormats);
+
+    // fill combo boxes with known codecs for given formats
+    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
+
+    QString getExtension(const QString & format);
+
+    // get information about file (duration, resolution etc) in multiline string
+    QString getFileInfo(const QString & filepath);
+};
+
+#endif // LIBAV_ITERACTION
diff --git a/QTfrontend/util/SDLInteraction.cpp b/QTfrontend/util/SDLInteraction.cpp
index e8d6659..f008ee6 100644
--- a/QTfrontend/util/SDLInteraction.cpp
+++ b/QTfrontend/util/SDLInteraction.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -64,7 +64,10 @@ SDLInteraction::~SDLInteraction()
     if (m_audioInitialized)
     {
         if (m_music != NULL)
+        {
+            Mix_HaltMusic();
             Mix_FreeMusic(m_music);
+        }
         Mix_CloseAudio();
     }
     SDL_Quit();
@@ -84,7 +87,8 @@ QStringList SDLInteraction::getResolutions() const
     if((modes == (SDL_Rect **)0) || (modes == (SDL_Rect **)-1))
     {
         result << "640x480";
-    } else
+    }
+    else
     {
         for(int i = 0; modes[i]; ++i)
             if ((modes[i]->w >= 640) && (modes[i]->h >= 480))
@@ -191,10 +195,11 @@ void SDLInteraction::playSoundFile(const QString & soundFile)
     if (!m_soundMap->contains(soundFile))
         m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData()));
 
-    Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
+    //FIXME: this is a hack, but works as long as we have few concurrent playing sounds
+    if (Mix_Playing(lastchannel) == false)
+        lastchannel = Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0);
 }
 
-
 void SDLInteraction::setMusicTrack(const QString & musicFile)
 {
     bool wasPlayingMusic = m_isPlayingMusic;
@@ -236,9 +241,11 @@ void SDLInteraction::startMusic()
 
 void SDLInteraction::stopMusic()
 {
-    if (m_isPlayingMusic && (m_music != NULL)) {
+    if (m_isPlayingMusic && (m_music != NULL))
+    {
         // fade out music to finish 0,5 seconds from now
-        while(!Mix_FadeOutMusic(1000) && Mix_PlayingMusic()) {
+        while(!Mix_FadeOutMusic(1000) && Mix_PlayingMusic())
+        {
             SDL_Delay(100);
         }
     }
diff --git a/QTfrontend/util/SDLInteraction.h b/QTfrontend/util/SDLInteraction.h
index bb6366d..0df8624 100644
--- a/QTfrontend/util/SDLInteraction.h
+++ b/QTfrontend/util/SDLInteraction.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -32,75 +32,77 @@
 
 /**
  * @brief Class for interacting with SDL (used for music and keys)
- * 
+ *
  * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
  */
 class SDLInteraction
 {
 
-private:
-    /**
-     * @brief Class constructor of the <i>singleton</i>.
-     * 
-     * Not to be used from outside the class,
-     * use the static {@link HWDataManager::instance()} instead.
-     * 
-     * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-     */
-    SDLInteraction();
-
-    /// Initializes SDL for sound output if needed.
-    void SDLAudioInit();
-
-    bool m_audioInitialized; ///< true if audio is initialized already
-    Mix_Music * m_music; ///< pointer to the music channel of the mixer
-    QString m_musicTrack; ///< path to the music track;
-    bool m_isPlayingMusic; ///< true if music was started but not stopped again.
-
-    QMap<QString,Mix_Chunk*> * m_soundMap; ///< maps sound file paths to channels
-
-public:
-    /**
-     * @brief Returns reference to the <i>singleton</i> instance of this class.
-     *
-     * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
-     *
-     * @return reference to the instance.
-     */
-    static SDLInteraction & instance();
-
-    /// Class Destructor.
-    ~SDLInteraction();
-
-    /**
-     * @brief Returns available (screen) resolutions.
-     *
-     * @return list of resolutions in the format WIDTHxHEIGHT.
-     */
-    QStringList getResolutions() const;
-
-    /// Adds all available joystick controlls to the list of SDL keys.
-    void addGameControllerKeys() const;
-
-    /**
-     * @brief Plays a sound file.
-     *
-     * @param soundFile path of the sound file.
-     */
-    void playSoundFile(const QString & soundFile);
-
-    /**
-     * @brief Sets the music track to be played (or not).
-     *
-     * @param musicFile path of the music file.
-     */
-    void setMusicTrack(const QString & musicFile);
-
-    /// Starts the background music if not already playing.
-    void startMusic();
-
-    /// Fades out and stops the background music (if playing).
-    void stopMusic();
+    private:
+        /**
+         * @brief Class constructor of the <i>singleton</i>.
+         *
+         * Not to be used from outside the class,
+         * use the static {@link DataManager::instance()} instead.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         */
+        SDLInteraction();
+
+        /// Initializes SDL for sound output if needed.
+        void SDLAudioInit();
+
+        bool m_audioInitialized; ///< true if audio is initialized already
+        Mix_Music * m_music; ///< pointer to the music channel of the mixer
+        QString m_musicTrack; ///< path to the music track;
+        bool m_isPlayingMusic; ///< true if music was started but not stopped again.
+
+        QMap<QString,Mix_Chunk*> * m_soundMap; ///< maps sound file paths to channels
+
+        int lastchannel; ///< channel of the last music played
+
+    public:
+        /**
+         * @brief Returns reference to the <i>singleton</i> instance of this class.
+         *
+         * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+         *
+         * @return reference to the instance.
+         */
+        static SDLInteraction & instance();
+
+        /// Class Destructor.
+        ~SDLInteraction();
+
+        /**
+         * @brief Returns available (screen) resolutions.
+         *
+         * @return list of resolutions in the format WIDTHxHEIGHT.
+         */
+        QStringList getResolutions() const;
+
+        /// Adds all available joystick controlls to the list of SDL keys.
+        void addGameControllerKeys() const;
+
+        /**
+         * @brief Plays a sound file.
+         *
+         * @param soundFile path of the sound file.
+         */
+        void playSoundFile(const QString & soundFile);
+
+        /**
+         * @brief Sets the music track to be played (or not).
+         *
+         * @param musicFile path of the music file.
+         */
+        void setMusicTrack(const QString & musicFile);
+
+        /// Starts the background music if not already playing.
+        void startMusic();
+
+        /// Fades out and stops the background music (if playing).
+        void stopMusic();
 };
 
 
diff --git a/QTfrontend/util/namegen.cpp b/QTfrontend/util/namegen.cpp
index 28ea8d7..d945ea0 100644
--- a/QTfrontend/util/namegen.cpp
+++ b/QTfrontend/util/namegen.cpp
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Martin Minarik <ttsmj at pokec.sk>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,7 +23,7 @@
 #include <QLineEdit>
 
 #include "hwform.h"
-#include "HWDataManager.h"
+#include "DataManager.h"
 
 #include "namegen.h"
 
@@ -79,7 +79,7 @@ void HWNamegen::teamRandomNames(HWTeam & team, const bool changeteamname)
 
         // there is a chance that this hog has the same hat as the previous one
         // let's reuse the hat-specific dict in this case
-        if ((i == 0) or (team.hedgehog(i).Hat != team.hedgehog(i-1).Hat))
+        if ((i == 0) || (team.hedgehog(i).Hat != team.hedgehog(i-1).Hat))
         {
             dicts = dictsForHat(team.hedgehog(i).Hat);
             dict  = dictContents(dicts[rand()%(dicts.size())]);
@@ -125,8 +125,8 @@ QStringList HWNamegen::dictContents(const QString filename)
     QStringList list;
 
     // find .txt to load the names from
-    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
-                                                "Names/%1.txt").arg(filename)));
+    QFile * file = new QFile(DataManager::instance().findFileForRead(QString(
+                                 "Names/%1.txt").arg(filename)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
     {
@@ -143,7 +143,7 @@ QStringList HWNamegen::dictContents(const QString filename)
     delete file;
 
     if (list.size() == 0)
-         list.append(filename);
+        list.append(filename);
 
     return list;
 }
@@ -154,8 +154,8 @@ QStringList HWNamegen::dictsForHat(const QString hatname)
     QStringList list;
 
     // find .cfg to load the dicts from
-    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
-                                                "Names/%1.cfg").arg(hatname)));
+    QFile * file = new QFile(DataManager::instance().findFileForRead(QString(
+                                 "Names/%1.cfg").arg(hatname)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
     {
@@ -172,7 +172,7 @@ QStringList HWNamegen::dictsForHat(const QString hatname)
     delete file;
 
     if (list.size() == 0)
-         list.append(QString("generic"));
+        list.append(QString("generic"));
 
     return list;
 }
@@ -184,7 +184,7 @@ bool HWNamegen::loadTypes()
 
     // find .ini to load the names from
     QFile * file = new QFile(
-        HWDataManager::instance().findFileForRead(QString("Names/types.ini")));
+        DataManager::instance().findFileForRead(QString("Names/types.ini")));
 
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
@@ -243,11 +243,11 @@ QString HWNamegen::getRandomGrave()
     QStringList Graves;
 
     //list all available Graves
-    Graves.append(HWDataManager::instance().entryList(
-                         "Graphics/Graves",
-                         QDir::Files,
-                         QStringList("*.png")
-                     ).replaceInStrings(QRegExp("\\.png$"), "")
+    Graves.append(DataManager::instance().entryList(
+                      "Graphics/Graves",
+                      QDir::Files,
+                      QStringList("*.png")
+                  ).replaceInStrings(QRegExp("\\.png$"), "")
                  );
 
     if(Graves.size()==0)
@@ -265,11 +265,11 @@ QString HWNamegen::getRandomFort()
     QStringList Forts;
 
     //list all available Forts
-    Forts.append(HWDataManager::instance().entryList(
-                        "Forts",
-                        QDir::Files,
-                        QStringList("*L.png")
-                    ).replaceInStrings(QRegExp("L\\.png$"), "")
+    Forts.append(DataManager::instance().entryList(
+                     "Forts",
+                     QDir::Files,
+                     QStringList("*L.png")
+                 ).replaceInStrings(QRegExp("L\\.png$"), "")
                 );
 
     if(Forts.size()==0)
diff --git a/QTfrontend/util/namegen.h b/QTfrontend/util/namegen.h
index 7a6c0e9..009d8ad 100644
--- a/QTfrontend/util/namegen.h
+++ b/QTfrontend/util/namegen.h
@@ -1,7 +1,7 @@
 /*
  * Hedgewars, a free turn based strategy game
  * Copyright (c) 2009 Martin Minarik <ttsmj at pokec.sk>
- * Copyright (c) 2009-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,12 +27,12 @@ class HWTeam;
 
 class HWNamegen
 {
-public:
+    public:
 
-    static void teamRandomName(HWTeam & team, const int HedgehogNumber);
-    static void teamRandomNames(HWTeam & team, const bool changeteamname);
+        static void teamRandomName(HWTeam & team, const int HedgehogNumber);
+        static void teamRandomNames(HWTeam & team, const bool changeteamname);
 
-private:
+    private:
         HWNamegen();
 
         static QList<QStringList> TypesTeamnames;
diff --git a/QTfrontend/xfire.cpp b/QTfrontend/xfire.cpp
index 3070de2..1840bbc 100644
--- a/QTfrontend/xfire.cpp
+++ b/QTfrontend/xfire.cpp
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,6 +23,7 @@
 #include "xfire.h"
 #include "../misc/xfire/xfiregameclient.h"
 
+#ifdef USE_XFIRE
 // use_xfire: stores if xfire is loaded and functions should do something at all
 bool use_xfire = false;
 char *keys[XFIRE_KEY_COUNT];
@@ -81,3 +82,4 @@ void xfire_update(void)
         return;
     XfireSetCustomGameDataA(XFIRE_KEY_COUNT, (const char**)keys, (const char**)values);
 }
+#endif // USE_XFIRE
diff --git a/QTfrontend/xfire.h b/QTfrontend/xfire.h
index 64609cb..70d233d 100644
--- a/QTfrontend/xfire.h
+++ b/QTfrontend/xfire.h
@@ -1,6 +1,6 @@
 /*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2010-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/README_WINDOWS b/README_WINDOWS
new file mode 100644
index 0000000..4239dd6
--- /dev/null
+++ b/README_WINDOWS
@@ -0,0 +1 @@
+For instructions, please visit: http://code.google.com/p/hedgewars/wiki/BuildingOnWindows
diff --git a/cmake_modules/FindFFMPEG.cmake b/cmake_modules/FindFFMPEG.cmake
new file mode 100644
index 0000000..b42d6ce
--- /dev/null
+++ b/cmake_modules/FindFFMPEG.cmake
@@ -0,0 +1,94 @@
+# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil)
+# Once done this will define
+#
+#  FFMPEG_FOUND - system has ffmpeg or libav
+#  FFMPEG_INCLUDE_DIR - the ffmpeg include directory
+#  FFMPEG_LIBRARIES - Link these to use ffmpeg
+#  FFMPEG_LIBAVCODEC
+#  FFMPEG_LIBAVFORMAT
+#  FFMPEG_LIBAVUTIL
+#
+#  Copyright (c) 2008 Andreas Schneider <mail at cynapses.org>
+#  Modified for other libraries by Lasse Kärkkäinen <tronic>
+#  Modified for Hedgewars by Stepik777
+#
+#  Redistribution and use is allowed according to the terms of the New
+#  BSD license.
+#
+
+if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
+  # in cache already
+  set(FFMPEG_FOUND TRUE)
+else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
+  # use pkg-config to get the directories and then use these values
+  # in the FIND_PATH() and FIND_LIBRARY() calls
+  find_package(PkgConfig)
+  if (PKG_CONFIG_FOUND)
+    pkg_check_modules(_FFMPEG_AVCODEC libavcodec)
+    pkg_check_modules(_FFMPEG_AVFORMAT libavformat)
+    pkg_check_modules(_FFMPEG_AVUTIL libavutil)
+  endif (PKG_CONFIG_FOUND)
+
+  find_path(FFMPEG_AVCODEC_INCLUDE_DIR
+    NAMES libavcodec/avcodec.h
+    PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS}
+        /usr/include /usr/local/include #system level
+        /opt/local/include #macports
+        /sw/include #fink
+    PATH_SUFFIXES ffmpeg libav
+  )
+
+  find_library(FFMPEG_LIBAVCODEC
+    NAMES avcodec
+    PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS}
+        /usr/lib /usr/local/lib #system level
+        /opt/local/lib #macports
+        /sw/lib #fink
+  )
+
+  find_library(FFMPEG_LIBAVFORMAT
+    NAMES avformat
+    PATHS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS}
+        /usr/lib /usr/local/lib #system level
+        /opt/local/lib #macports
+        /sw/lib #fink
+  )
+
+  find_library(FFMPEG_LIBAVUTIL
+    NAMES avutil
+    PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS}
+        /usr/lib /usr/local/lib #system level
+        /opt/local/lib #macports
+        /sw/lib #fink
+  )
+
+  if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT)
+    set(FFMPEG_FOUND TRUE)
+  endif()
+
+  if (FFMPEG_FOUND)
+    set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
+
+    set(FFMPEG_LIBRARIES
+      ${FFMPEG_LIBAVCODEC}
+      ${FFMPEG_LIBAVFORMAT}
+      ${FFMPEG_LIBAVUTIL}
+    )
+    if (APPLE)
+      set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} "bz2" "-framework CoreVideo" "-framework VideoDecodeAcceleration")
+    endif(APPLE)
+
+  endif (FFMPEG_FOUND)
+
+  if (FFMPEG_FOUND)
+    if (NOT FFMPEG_FIND_QUIETLY)
+      message(STATUS "Found FFMPEG/LibAV: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
+    endif (NOT FFMPEG_FIND_QUIETLY)
+  else (FFMPEG_FOUND)
+    if (FFMPEG_FIND_REQUIRED)
+      message(FATAL_ERROR "Could NOT find libavcodec or libavformat or libavutil")
+    endif (FFMPEG_FIND_REQUIRED)
+  endif (FFMPEG_FOUND)
+
+endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
+
diff --git a/cmake_modules/FindLua.cmake b/cmake_modules/FindLua.cmake
index 4cd4216..0824b49 100644
--- a/cmake_modules/FindLua.cmake
+++ b/cmake_modules/FindLua.cmake
@@ -1,21 +1,34 @@
 # Find the Lua library
-#
+# --------------------
+# On Android/Windows/OSX this just defines the name of the library that
+#  will be compiled from our bundled sources
+# On Linux it will try to load the system library and fallback to compiling
+#  the bundled one when nothing is found
+
+set(LUA_FOUND false)
+
+if (ANDROID)
+    SET(LUA_DEFAULT "liblua5.1.so")
+else (ANDROID)
+    IF(WIN32)
+        SET(LUA_DEFAULT lua.dll)
+    ELSE(WIN32)
+        IF(APPLE)
+            SET(LUA_DEFAULT lua)
+        ELSE(APPLE)
+            #locate the system's lua library
+            FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
+            IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
+	        set(LUA_DEFAULT lua)
+            ELSE()
+                set(LUA_FOUND true)
+                message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}")
+                #remove the path (fpc doesn't like it - why?)
+                GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
+            ENDIF()
+        ENDIF(APPLE)
+    ENDIF(WIN32)
+ENDIF(ANDROID)
 
-IF(WIN32)
-	SET(LUA_DEFAULT lua.dll)
-ELSE(WIN32)
-	IF(APPLE)
-		SET(LUA_DEFAULT lua)
-	ELSE(APPLE)
-		#locate the system's lua library
-		FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
-		IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
-			#UNSET(LUA_DEFAULT)
-			MESSAGE(FATAL_ERROR "Couldn't find Lua 5.1 library!")
-		ENDIF()
-		#remove the path (fpc doesn't like it - why?)
-		GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
-	ENDIF(APPLE)
-ENDIF(WIN32)
 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
-#UNSET(LUA_DEFAULT)
+
diff --git a/cmake_modules/FindSDL_Extras.cmake b/cmake_modules/FindSDL_Extras.cmake
index fe5dae2..f24d79d 100644
--- a/cmake_modules/FindSDL_Extras.cmake
+++ b/cmake_modules/FindSDL_Extras.cmake
@@ -1,22 +1,5 @@
 #if the headers are not installed, the newer apis won't be activated
 
-#find which version of SDL we are building against
-find_file(sdl_h SDL_version.h ${SDL_INCLUDE_DIR})
-if(sdl_h)
-    file(STRINGS ${sdl_h} sdl_majorversion_tmp REGEX "SDL_MAJOR_VERSION[\t' ']+[0-9]+")
-    file(STRINGS ${sdl_h} sdl_minorversion_tmp REGEX "SDL_MINOR_VERSION[\t' ']+[0-9]+")
-    file(STRINGS ${sdl_h} sdl_patchversion_tmp REGEX "SDL_PATCHLEVEL[\t' ']+[0-9]+")
-    string(REGEX MATCH ".([0-9]+)" sdl_majorversion "${sdl_majorversion_tmp}")
-    string(REGEX MATCH ".([0-9]+)" sdl_minorversion "${sdl_minorversion_tmp}")
-    string(REGEX MATCH ".([0-9]+)" sdl_patchversion "${sdl_patchversion_tmp}")
-    math(EXPR sdl_version "${sdl_majorversion}*10000 + ${sdl_minorversion}*100 + ${sdl_patchversion}")
-
-    if(NOT (sdl_version LESS "010300"))
-        message(STATUS "Enabling SDL-1.3+ calls")
-        set(pascal_compiler_flags_cmn "-dSDL13" ${pascal_compiler_flags_cmn})
-    endif()
-endif()
-
 #find which version of SDL_mixer we have (for Mix_Init)
 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
 if(sdlmixer_h)
@@ -29,8 +12,8 @@ if(sdlmixer_h)
     math(EXPR sdlmixer_version "${sdlmixer_majorversion}*10000 + ${sdlmixer_minorversion}*100 + ${sdlmixer_patchversion}")
 
     if(sdlmixer_version GREATER "10209")
-        message(STATUS "Enabling enhanced SDL_Mixer calls")
-        set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
+        message(STATUS "Mix_Init() is present")
+        set(pascal_flags "-dSDL_MIXER_NEWER" ${pascal_flags})
     endif()
 endif()
 
@@ -46,8 +29,8 @@ if(sdlimage_h)
     math(EXPR sdlimage_version "${sdlimage_majorversion}*10000 + ${sdlimage_minorversion}*100 + ${sdlimage_patchversion}")
 
     if(sdlimage_version GREATER "010207")
-        message(STATUS "Enabling enhanced SDL_Image calls")
-        set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
+        message(STATUS "IMG_Init() is present")
+        set(pascal_flags "-dSDL_IMAGE_NEWER" ${pascal_flags})
     endif()
 endif()
 
diff --git a/cmake_modules/FindSparkle.cmake b/cmake_modules/FindSparkle.cmake
index 02a585b..f79eabe 100644
--- a/cmake_modules/FindSparkle.cmake
+++ b/cmake_modules/FindSparkle.cmake
@@ -24,14 +24,14 @@ else ()
 endif ()
 
 if (SPARKLE_FOUND)
-   if (NOT Sparkle_FIND_QUIETLY)
+   if (NOT SPARKLE_FIND_QUIETLY)
       message(STATUS "Found Sparkle: ${SPARKLE_LIBRARY}")
    endif ()
 else ()
-   if (Sparkle_FIND_REQUIRED)
+   if (SPARKLE_FIND_REQUIRED)
       message(FATAL_ERROR "Could NOT find Sparkle framework")
    else ()
-      if (NOT Sparkle_FIND_QUIETLY)
+      if (NOT SPARKLE_FIND_QUIETLY)
          message(STATUS "Could NOT find Sparkle framework, autoupdate feature will be disabled")
       endif()
    endif ()
diff --git a/gameServer/Actions.hs b/gameServer/Actions.hs
index 06642b5..d0f501c 100644
--- a/gameServer/Actions.hs
+++ b/gameServer/Actions.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP, OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
 module Actions where
 
 import Control.Concurrent
@@ -20,7 +21,9 @@ import Control.Exception
 import System.Process
 import Network.Socket
 -----------------------------
+#if defined(OFFICIAL_SERVER)
 import OfficialServer.GameReplayStore
+#endif
 import CoreTypes
 import Utils
 import ClientIO
@@ -36,7 +39,9 @@ data Action =
     | MoveToRoom RoomIndex
     | MoveToLobby B.ByteString
     | RemoveTeam B.ByteString
+    | SendTeamRemovalMessage B.ByteString
     | RemoveRoom
+    | FinishGame
     | UnreadyRoomClients
     | JoinLobby
     | ProtocolError B.ByteString
@@ -48,13 +53,16 @@ data Action =
     | BanClient NominalDiffTime B.ByteString ClientIndex
     | BanIP B.ByteString NominalDiffTime B.ByteString
     | BanList
+    | Unban B.ByteString
     | ChangeMaster
     | RemoveClientTeams ClientIndex
     | ModifyClient (ClientInfo -> ClientInfo)
     | ModifyClient2 ClientIndex (ClientInfo -> ClientInfo)
+    | ModifyRoomClients (ClientInfo -> ClientInfo)
     | ModifyRoom (RoomInfo -> RoomInfo)
     | ModifyServerInfo (ServerInfo -> ServerInfo)
     | AddRoom B.ByteString B.ByteString
+    | SendUpdateOnThisRoom
     | CheckRegistered
     | ClearAccountsCache
     | ProcessAccountInfo AccountInfo
@@ -144,9 +152,14 @@ processAction (ByeClient msg) = do
     io $
         infoM "Clients" (show ci ++ " quits: " ++ B.unpack msg)
 
-    processAction $ AnswerClients [chan] ["BYE", msg]
     when loggedIn $ processAction $ AnswerClients clientsChans ["LOBBY:LEFT", clNick, msg]
 
+    mapM processAction
+        [
+        AnswerClients [chan] ["BYE", msg]
+        , ModifyClient (\c -> c{nick = "", logonPassed = False}) -- this will effectively hide client from others while he isn't deleted from list
+        ]
+
     s <- get
     put $! s{removedClients = ci `Set.insert` removedClients s}
 
@@ -158,7 +171,7 @@ processAction (DeleteClient ci) = do
 
     s <- get
     put $! s{removedClients = ci `Set.delete` removedClients s}
-    
+
     sp <- gets (shutdownPending . serverInfo)
     cls <- allClientsS
     io $ when (sp && null cls) $ throwIO ShutdownException
@@ -174,6 +187,12 @@ processAction (ModifyClient2 ci f) = do
     io $ modifyClient rnc f ci
     return ()
 
+processAction (ModifyRoomClients f) = do
+    rnc <- gets roomsClients
+    ri <- clientRoomA
+    roomClIDs <- io $ roomClientsIndicesM rnc ri
+    io $ mapM_ (modifyClient rnc f) roomClIDs
+
 
 processAction (ModifyRoom f) = do
     rnc <- gets roomsClients
@@ -193,7 +212,7 @@ processAction (MoveToRoom ri) = do
     rnc <- gets roomsClients
 
     io $ do
-        modifyClient rnc (\cl -> cl{teamsInGame = 0, isReady = False, isMaster = False}) ci
+        modifyClient rnc (\cl -> cl{teamsInGame = 0, isReady = False, isMaster = False, isInGame = False}) ci
         modifyRoom rnc (\r -> r{playersIn = playersIn r + 1}) ri
         moveClientToRoom rnc ri ci
 
@@ -207,46 +226,64 @@ processAction (MoveToLobby msg) = do
     (Just ci) <- gets clientIndex
     ri <- clientRoomA
     rnc <- gets roomsClients
-    (gameProgress, playersNum) <- io $ room'sM rnc ((isJust . gameInfo) &&& playersIn) ri
-    ready <- client's isReady
+    playersNum <- io $ room'sM rnc playersIn ri
     master <- client's isMaster
 --    client <- client's id
     clNick <- client's nick
     chans <- othersChans
 
     if master then
-        if gameProgress && playersNum > 1 then
-            mapM_ processAction [ChangeMaster, AnswerClients chans ["LEFT", clNick, msg], NoticeMessage AdminLeft, RemoveClientTeams ci]
+        if playersNum > 1 then
+            mapM_ processAction [ChangeMaster, NoticeMessage AdminLeft, RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]]
             else
             processAction RemoveRoom
         else
-        mapM_ processAction [AnswerClients chans ["LEFT", clNick, msg], RemoveClientTeams ci]
+        mapM_ processAction [RemoveClientTeams ci, AnswerClients chans ["LEFT", clNick, msg]]
 
     -- when not removing room
-    when (not master || (gameProgress && playersNum > 1)) . io $ do
+    ready <- client's isReady
+    when (not master || playersNum > 1) . io $ do
         modifyRoom rnc (\r -> r{
                 playersIn = playersIn r - 1,
                 readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r
                 }) ri
         moveClientToLobby rnc ci
 
+
 processAction ChangeMaster = do
     (Just ci) <- gets clientIndex
+    proto <- client's clientProto
     ri <- clientRoomA
     rnc <- gets roomsClients
     newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
     newMaster <- io $ client'sM rnc id newMasterId
-    let newRoomName = nick newMaster
+    oldRoomName <- io $ room'sM rnc name ri
+    oldMaster <- client's nick
+    thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
+    let newRoomName = if proto < 42 then nick newMaster else oldRoomName
     mapM_ processAction [
-        ModifyRoom (\r -> r{masterID = newMasterId, name = newRoomName}),
-        ModifyClient2 newMasterId (\c -> c{isMaster = True}),
-        AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"]
+        ModifyRoom (\r -> r{masterID = newMasterId
+                , name = newRoomName
+                , isRestrictedJoins = False
+                , isRestrictedTeams = False
+                , readyPlayers = if isReady newMaster then readyPlayers r else readyPlayers r + 1})
+        , ModifyClient2 newMasterId (\c -> c{isMaster = True, isReady = True})
+        , AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"]
+        , AnswerClients thisRoomChans ["WARNING", "New room admin is " `B.append` nick newMaster]
+        , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", oldMaster]
+        , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+hr", nick newMaster]
         ]
 
+    newRoom' <- io $ room'sM rnc id ri
+    chans <- liftM (map sendChan) $! sameProtoClientsS proto
+    processAction $ AnswerClients chans ("ROOM" : "UPD" : oldRoomName : roomInfo newRoomName newRoom')
+
+
 processAction (AddRoom roomName roomPassword) = do
     Just clId <- gets clientIndex
     rnc <- gets roomsClients
-    proto <- io $ client'sM rnc clientProto clId
+    proto <- client's clientProto
+    n <- client's nick
 
     let rm = newRoom{
             masterID = clId,
@@ -259,11 +296,10 @@ processAction (AddRoom roomName roomPassword) = do
 
     processAction $ MoveToRoom rId
 
-    chans <- liftM (map sendChan) $! roomClientsS lobbyId
+    chans <- liftM (map sendChan) $! sameProtoClientsS proto
 
     mapM_ processAction [
-        AnswerClients chans ["ROOM", "ADD", roomName]
-        , ModifyClient (\cl -> cl{isMaster = True})
+        AnswerClients chans ("ROOM" : "ADD" : roomInfo n rm)
         ]
 
 
@@ -273,54 +309,95 @@ processAction RemoveRoom = do
     ri <- io $ clientRoomM rnc clId
     roomName <- io $ room'sM rnc name ri
     others <- othersChans
-    lobbyChans <- liftM (map sendChan) $! roomClientsS lobbyId
+    proto <- client's clientProto
+    chans <- liftM (map sendChan) $! sameProtoClientsS proto
 
     mapM_ processAction [
-            AnswerClients lobbyChans ["ROOM", "DEL", roomName],
+            AnswerClients chans ["ROOM", "DEL", roomName],
             AnswerClients others ["ROOMABANDONED", roomName]
         ]
 
     io $ removeRoom rnc ri
 
 
-processAction (UnreadyRoomClients) = do
+processAction SendUpdateOnThisRoom = do
+    Just clId <- gets clientIndex
+    proto <- client's clientProto
     rnc <- gets roomsClients
+    ri <- io $ clientRoomM rnc clId
+    rm <- io $ room'sM rnc id ri
+    chans <- liftM (map sendChan) $! sameProtoClientsS proto
+    processAction $ AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo (name rm) rm)
+
+
+processAction UnreadyRoomClients = do
     ri <- clientRoomA
     roomPlayers <- roomClientsS ri
-    roomClIDs <- io $ roomClientsIndicesM rnc ri
     pr <- client's clientProto
-    processAction $ AnswerClients (map sendChan roomPlayers) $ notReadyMessage pr (map nick roomPlayers)
-    io $ mapM_ (modifyClient rnc (\cl -> cl{isReady = False})) roomClIDs
-    processAction $ ModifyRoom (\r -> r{readyPlayers = 0})
+    mapM_ processAction [
+        AnswerClients (map sendChan roomPlayers) $ notReadyMessage pr . map nick . filter (not . isMaster) $ roomPlayers
+        , ModifyRoomClients (\cl -> cl{isReady = isMaster cl})
+        , ModifyRoom (\r -> r{readyPlayers = 1})
+        ]
     where
         notReadyMessage p nicks = if p < 38 then "NOT_READY" : nicks else "CLIENT_FLAGS" : "-r" : nicks
 
 
-processAction (RemoveTeam teamName) = do
+processAction FinishGame = do
     rnc <- gets roomsClients
     ri <- clientRoomA
-    inGame <- io $ room'sM rnc (isJust . gameInfo) ri
+    thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
+    answerRemovedTeams <- io $
+         room'sM rnc (map (\t -> AnswerClients thisRoomChans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo) ri
+
+    mapM_ processAction $
+        SaveReplay
+        : ModifyRoom
+            (\r -> r{
+                gameInfo = Nothing,
+                readyPlayers = 0
+                }
+            )
+        : UnreadyRoomClients
+        : SendUpdateOnThisRoom
+        : answerRemovedTeams
+
+
+processAction (SendTeamRemovalMessage teamName) = do
     chans <- othersChans
-    if not $ inGame then
-            mapM_ processAction [
-                AnswerClients chans ["REMOVE_TEAM", teamName],
-                ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r})
-                ]
-        else
-            mapM_ processAction [
-                AnswerClients chans ["EM", rmTeamMsg],
-                ModifyRoom (\r -> r{
-                    teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r,
-                        gameInfo = liftM (\g -> g{
-                        leftTeams = teamName : leftTeams g,
-                        roundMsgs = roundMsgs g Seq.|> rmTeamMsg
-                        }) $ gameInfo r
-                    })
-                ]
+    mapM_ processAction [
+        AnswerClients chans ["EM", rmTeamMsg],
+        ModifyRoom (\r -> r{
+                gameInfo = liftM (\g -> g{
+                    teamsInGameNumber = teamsInGameNumber g - 1
+                    , roundMsgs = roundMsgs g Seq.|> rmTeamMsg
+                }) $ gameInfo r
+            })
+        ]
+
+    rnc <- gets roomsClients
+    ri <- clientRoomA
+    gi <- io $ room'sM rnc gameInfo ri
+    when (isJust gi && 0 == teamsInGameNumber (fromJust gi)) $
+        processAction FinishGame
     where
         rmTeamMsg = toEngineMsg $ 'F' `B.cons` teamName
 
 
+processAction (RemoveTeam teamName) = do
+    rnc <- gets roomsClients
+    ri <- clientRoomA
+    inGame <- io $ room'sM rnc (isJust . gameInfo) ri
+    chans <- othersChans
+    mapM_ processAction $
+        ModifyRoom (\r -> r{
+            teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r
+            , gameInfo = liftM (\g -> g{leftTeams = teamName : leftTeams g}) $ gameInfo r
+            })
+        : AnswerClients chans ["REMOVE_TEAM", teamName]
+        : [SendTeamRemovalMessage teamName | inGame]
+
+
 processAction (RemoveClientTeams clId) = do
     rnc <- gets roomsClients
 
@@ -377,11 +454,22 @@ processAction (ProcessAccountInfo info) =
 processAction JoinLobby = do
     chan <- client's sendChan
     clientNick <- client's nick
-    (lobbyNicks, clientsChans) <- liftM (unzip . Prelude.map (nick &&& sendChan) . Prelude.filter logonPassed) $! allClientsS
-    mapM_ processAction $
-        AnswerClients clientsChans ["LOBBY:JOINED", clientNick]
-        : AnswerClients [chan] ("LOBBY:JOINED" : clientNick : lobbyNicks)
-        : [ModifyClient (\cl -> cl{logonPassed = True}), SendServerMessage]
+    isAuthenticated <- liftM (not . B.null) $ client's webPassword
+    isAdmin <- client's isAdministrator
+    loggedInClients <- liftM (Prelude.filter logonPassed) $! allClientsS
+    let (lobbyNicks, clientsChans) = unzip . L.map (nick &&& sendChan) $ loggedInClients
+    let authenticatedNicks = L.map nick . L.filter (not . B.null . webPassword) $ loggedInClients
+    let adminsNicks = L.map nick . L.filter isAdministrator $ loggedInClients
+    let clFlags = B.concat . L.concat $ [["u" | isAuthenticated], ["a" | isAdmin]]
+    mapM_ processAction . concat $ [
+        [AnswerClients clientsChans ["LOBBY:JOINED", clientNick]]
+        , [AnswerClients [chan] ("LOBBY:JOINED" : clientNick : lobbyNicks)]
+        , [AnswerClients [chan] ("CLIENT_FLAGS" : "+u" : authenticatedNicks) | not $ null authenticatedNicks]
+        , [AnswerClients [chan] ("CLIENT_FLAGS" : "+a" : adminsNicks) | not $ null adminsNicks]
+        , [AnswerClients (chan : clientsChans) ["CLIENT_FLAGS",  B.concat["+" , clFlags], clientNick] | not $ B.null clFlags]
+        , [ModifyClient (\cl -> cl{logonPassed = True})]
+        , [SendServerMessage]
+        ]
 
 
 processAction (KickClient kickId) = do
@@ -412,11 +500,15 @@ processAction (BanIP ip seconds reason) = do
 
 processAction BanList = do
     ch <- client's sendChan
-    bans <- gets (bans . serverInfo)
+    b <- gets (B.pack . unlines . map show . bans . serverInfo)
     processAction $
-        AnswerClients [ch] ["BANLIST", B.pack $ show bans]
-    
+        AnswerClients [ch] ["BANLIST", b]
 
+processAction (Unban entry) = do
+    processAction $ ModifyServerInfo (\s -> s{bans = filter f $ bans s})
+    where
+        f (BanByIP bip _ _) = bip == entry
+        f (BanByNick bn _ _) = bn == entry
 
 processAction (KickRoomClient kickId) = do
     modify (\s -> s{clientIndex = Just kickId})
@@ -481,9 +573,11 @@ processAction PingAll = do
     where
         kickTimeouted rnc ci = do
             pq <- io $ client'sM rnc pingsQueue ci
-            when (pq > 0) $
+            when (pq > 0) $ do
                 withStateT (\as -> as{clientIndex = Just ci}) $
                     processAction (ByeClient "Ping timeout")
+--                when (pq > 1) $
+--                    processAction $ DeleteClient ci -- smth went wrong with client io threads, issue DeleteClient here
 
 
 processAction StatsAction = do
@@ -495,7 +589,7 @@ processAction StatsAction = do
     where
           st irnc = (length $ allRooms irnc, length $ allClients irnc)
 
-processAction RestartServer = do 
+processAction RestartServer = do
     sp <- gets (shutdownPending . serverInfo)
     when (not sp) $ do
         sock <- gets (fromJust . serverSocket . serverInfo)
diff --git a/gameServer/CMakeLists.txt b/gameServer/CMakeLists.txt
index 96a9eff..adb3fe6 100644
--- a/gameServer/CMakeLists.txt
+++ b/gameServer/CMakeLists.txt
@@ -1,43 +1,44 @@
-find_program(ghc_executable ghc)
-
-if(NOT ghc_executable)
-	message(FATAL_ERROR "Cannot find GHC")
-endif(NOT ghc_executable)
 
 
 set(hwserver_sources
-	OfficialServer/DBInteraction.hs
-	Actions.hs
-	ClientIO.hs
-	CoreTypes.hs
-	HWProtoCore.hs
-	HWProtoInRoomState.hs
-	HWProtoLobbyState.hs
-	HWProtoNEState.hs
-	NetRoutines.hs
-	Opts.hs
-	ServerCore.hs
-	Utils.hs
-	hedgewars-server.hs
-	)
+    OfficialServer/DBInteraction.hs
+    Actions.hs
+    ClientIO.hs
+    ConfigFile.hs
+    Consts.hs
+    CoreTypes.hs
+    EngineInteraction.hs
+    HWProtoCore.hs
+    HWProtoInRoomState.hs
+    HWProtoLobbyState.hs
+    HWProtoNEState.hs
+    HandlerUtils.hs
+    NetRoutines.hs
+    Opts.hs
+    RoomsAndClients.hs
+    ServerCore.hs
+    ServerState.hs
+    Store.hs
+    Utils.hs
+    hedgewars-server.hs
+    )
 
 set(hwserv_main ${hedgewars_SOURCE_DIR}/gameServer/hedgewars-server.hs)
 
 set(ghc_flags
-	--make ${hwserv_main}
-	-i${hedgewars_SOURCE_DIR}/gameServer
-	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
-	-odir ${CMAKE_CURRENT_BINARY_DIR}
-	-hidir ${CMAKE_CURRENT_BINARY_DIR})
-
-set(ghc_flags ${haskell_compiler_flags_cmn} ${ghc_flags})
+    --make ${hwserv_main}
+    -i${hedgewars_SOURCE_DIR}/gameServer
+    -o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
+    -odir ${CMAKE_CURRENT_BINARY_DIR}
+    -hidir ${CMAKE_CURRENT_BINARY_DIR}
+    ${haskell_flags})
 
 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
-		COMMAND "${ghc_executable}"
-		ARGS ${ghc_flags}
-		MAIN_DEPENDENCY ${hwserv_main}
-		DEPENDS ${hwserver_sources}
-		)
+        COMMAND "${ghc_executable}"
+        ARGS ${ghc_flags}
+        MAIN_DEPENDENCY ${hwserv_main}
+        DEPENDS ${hwserver_sources}
+        )
 
 add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
 
diff --git a/gameServer/ClientIO.hs b/gameServer/ClientIO.hs
index e04b647..8e57967 100644
--- a/gameServer/ClientIO.hs
+++ b/gameServer/ClientIO.hs
@@ -43,15 +43,18 @@ listenLoop sock chan ci = recieveWithBufferLoop B.empty
 
 clientRecvLoop :: Socket -> Chan CoreMessage -> Chan [B.ByteString] -> ClientIndex -> (forall a. IO a -> IO a) -> IO ()
 clientRecvLoop s chan clChan ci restore =
-    myThreadId >>=
+    (myThreadId >>=
     \t -> (restore $ forkIO (clientSendLoop s t clChan ci) >>
         listenLoop s chan ci >> return "Connection closed")
-        `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
         `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
-        >>= clientOff >> remove
+        `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
+        `Exception.catch` (\(e :: Exception.SomeException) -> return . B.pack . show $ e)
+        >>= clientOff) `Exception.finally` remove
     where
         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
-        remove = writeChan chan $ Remove ci
+        remove = do
+            clientOff "Client is in some weird state"
+            writeChan chan $ Remove ci
 
 
 
@@ -63,12 +66,11 @@ clientSendLoop s tId chan ci = do
         killReciever . B.unpack $ quitMessage answer
 
     Exception.handle
-        (\(e :: Exception.IOException) -> unless (isQuit answer) . killReciever $ show e) $
+        (\(e :: Exception.SomeException) -> unless (isQuit answer) . killReciever $ show e) $
             sendAll s $ B.unlines answer `B.snoc` '\n'
 
     if isQuit answer then
-        do
-        Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s
+        sClose s
         else
         clientSendLoop s tId chan ci
 
diff --git a/gameServer/Consts.hs b/gameServer/Consts.hs
index 5e36eec..e29bd34 100644
--- a/gameServer/Consts.hs
+++ b/gameServer/Consts.hs
@@ -4,4 +4,4 @@ module Consts where
 import qualified Data.ByteString.Char8 as B
 
 serverVersion :: B.ByteString
-serverVersion = "0"
+serverVersion = "1"
diff --git a/gameServer/CoreTypes.hs b/gameServer/CoreTypes.hs
index cd188c6..93578de 100644
--- a/gameServer/CoreTypes.hs
+++ b/gameServer/CoreTypes.hs
@@ -34,6 +34,7 @@ data ClientInfo =
         pingsQueue :: !Word,
         isMaster :: Bool,
         isReady :: !Bool,
+        isInGame :: Bool,
         isAdministrator :: Bool,
         clientClan :: Maybe B.ByteString,
         teamsInGame :: Word
@@ -62,24 +63,29 @@ data TeamInfo =
         hedgehogs :: [HedgehogInfo]
     }
     deriving (Show, Read)
-    
+
 data GameInfo =
     GameInfo
     {
         roundMsgs :: Seq B.ByteString,
         leftTeams :: [B.ByteString],
         teamsAtStart :: [TeamInfo],
+        teamsInGameNumber :: Int,
         allPlayersHaveRegisteredAccounts :: Bool,
         giMapParams :: Map.Map B.ByteString B.ByteString,
         giParams :: Map.Map B.ByteString [B.ByteString]
     } deriving (Show, Read)
-    
---newGameInfo ::  -> GameInfo 
-newGameInfo = 
+
+newGameInfo :: [TeamInfo]
+                -> Int
+                -> Bool
+                -> Map.Map ByteString ByteString
+                -> Map.Map ByteString [ByteString]
+                -> GameInfo
+newGameInfo =
     GameInfo
         Data.Sequence.empty
         []
-        []
 
 data RoomInfo =
     RoomInfo
@@ -94,6 +100,7 @@ data RoomInfo =
         readyPlayers :: !Int,
         isRestrictedJoins :: Bool,
         isRestrictedTeams :: Bool,
+        roomBansList :: [B.ByteString],
         mapParams :: Map.Map B.ByteString B.ByteString,
         params :: Map.Map B.ByteString [B.ByteString]
     }
@@ -111,6 +118,7 @@ newRoom =
         0
         False
         False
+        []
         (
             Map.fromList $ Prelude.zipWith (,)
                 ["MAP", "MAPGEN", "MAZE_SIZE", "SEED", "TEMPLATE"]
@@ -134,7 +142,6 @@ data ServerInfo =
         latestReleaseVersion :: Word16,
         earliestCompatibleVersion :: Word16,
         listenPort :: PortNumber,
-        nextRoomID :: Int,
         dbHost :: B.ByteString,
         dbName :: B.ByteString,
         dbLogin :: B.ByteString,
@@ -154,11 +161,10 @@ newServerInfo =
     ServerInfo
         True
         "<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>"
-        "<font color=yellow><h3 align=center>Hedgewars 0.9.16 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>"
-        39
-        31 -- 0.9.13
+        "<font color=yellow><h3 align=center>Hedgewars 0.9.18 is out! Please update.</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></font>"
+        43 -- latestReleaseVersion
+        41 -- earliestCompatibleVersion
         46631
-        0
         ""
         ""
         ""
@@ -192,6 +198,7 @@ type IRnC = IRoomsAndClients RoomInfo ClientInfo
 data Notice =
     NickAlreadyInUse
     | AdminLeft
+    | WrongPassword
     deriving Enum
 
 data ShutdownException =
diff --git a/gameServer/EngineInteraction.hs b/gameServer/EngineInteraction.hs
index 1e44590..7d03045 100644
--- a/gameServer/EngineInteraction.hs
+++ b/gameServer/EngineInteraction.hs
@@ -1,7 +1,6 @@
 module EngineInteraction where
 
 import qualified Data.Set as Set
-import qualified Data.List as List
 import Control.Monad
 import qualified Codec.Binary.Base64 as Base64
 import qualified Data.ByteString.Char8 as B
@@ -31,6 +30,7 @@ checkNetCmd msg = check decoded
         legalMessages = Set.fromList $ "M#+LlRrUuDdZzAaSjJ,sNpPwtghbc12345" ++ slotMessages
         slotMessages = "\128\129\130\131\132\133\134\135\136\137\138"
 
+
 gameInfo2Replay :: GameInfo -> B.ByteString
 gameInfo2Replay GameInfo{roundMsgs = rm,
         teamsAtStart = teams,
diff --git a/gameServer/HWProtoCore.hs b/gameServer/HWProtoCore.hs
index 0dc694e..6237017 100644
--- a/gameServer/HWProtoCore.hs
+++ b/gameServer/HWProtoCore.hs
@@ -51,7 +51,7 @@ handleCmd_loggedin ["INFO", asknick] = do
     let clRoom = room rnc roomId
     let roomMasterSign = if isMaster cl then "@" else ""
     let adminSign = if isAdministrator cl then "@" else ""
-    let roomInfo = if roomId /= lobbyId then B.concat [roomMasterSign, "room ", name clRoom] else adminSign `B.append` "lobby"
+    let rInfo = if roomId /= lobbyId then B.concat [roomMasterSign, "room ", name clRoom] else adminSign `B.append` "lobby"
     let roomStatus = if isJust $ gameInfo clRoom then
             if teamsInGame cl > 0 then "(playing)" else "(spectating)"
             else
@@ -65,7 +65,7 @@ handleCmd_loggedin ["INFO", asknick] = do
             nick cl,
             B.concat ["[", hostStr, "]"],
             protoNumber2ver $ clientProto cl,
-            B.concat ["[", roomInfo, "]", roomStatus]
+            B.concat ["[", rInfo, "]", roomStatus]
             ]
 
 
diff --git a/gameServer/HWProtoInRoomState.hs b/gameServer/HWProtoInRoomState.hs
index 02cc89a..718b34c 100644
--- a/gameServer/HWProtoInRoomState.hs
+++ b/gameServer/HWProtoInRoomState.hs
@@ -2,8 +2,8 @@
 module HWProtoInRoomState where
 
 import qualified Data.Map as Map
-import Data.Sequence((|>), empty)
-import Data.List
+import Data.Sequence((|>))
+import Data.List as L
 import Data.Maybe
 import qualified Data.ByteString.Char8 as B
 import Control.Monad
@@ -52,6 +52,13 @@ handleCmd_inRoom ("ADD_TEAM" : tName : color : grave : fort : voicepack : flag :
         clNick <- clientNick
         clChan <- thisClientChans
         othChans <- roomOthersChans
+        roomChans <- roomClientsChans
+        cl <- thisClient
+        teamColor <-
+            if clientProto cl < 42 then 
+                return color
+                else
+                liftM (head . (L.\\) (map B.singleton ['0'..]) . map teamcolor . teams) thisRoom
         return $
             if not . null . drop (maxTeams rm - 1) $ teams rm then
                 [Warning "too many teams"]
@@ -64,25 +71,26 @@ handleCmd_inRoom ("ADD_TEAM" : tName : color : grave : fort : voicepack : flag :
             else if isRestrictedTeams rm then
                 [Warning "restricted"]
             else
-                [ModifyRoom (\r -> r{teams = teams r ++ [newTeam ci clNick r]}),
-                ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just color}),
+                [ModifyRoom (\r -> r{teams = teams r ++ [newTeam ci clNick r teamColor]}),
+                SendUpdateOnThisRoom,
+                ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just teamColor}),
                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
-                AnswerClients othChans $ teamToNet $ newTeam ci clNick rm,
-                AnswerClients othChans ["TEAM_COLOR", tName, color]
+                AnswerClients othChans $ teamToNet $ newTeam ci clNick rm teamColor,
+                AnswerClients roomChans ["TEAM_COLOR", tName, teamColor]
                 ]
         where
         canAddNumber r = 48 - (sum . map hhnum $ teams r)
         findTeam = find (\t -> tName == teamname t) . teams
-        newTeam ci clNick r = TeamInfo ci clNick tName color grave fort voicepack flag dif (newTeamHHNum r) (hhsList hhsInfo)
+        newTeam ci clNick r tColor = TeamInfo ci clNick tName tColor grave fort voicepack flag dif (newTeamHHNum r) (hhsList hhsInfo)
         dif = readInt_ difStr
         hhsList [] = []
         hhsList [_] = error "Hedgehogs list with odd elements number"
         hhsList (n:h:hhs) = HedgehogInfo n h : hhsList hhs
         newTeamHHNum r = min 4 (canAddNumber r)
-        maxTeams r 
+        maxTeams r
             | roomProto r < 38 = 6
             | otherwise = 8
-                
+
 
 handleCmd_inRoom ["REMOVE_TEAM", tName] = do
         (ci, _) <- ask
@@ -99,6 +107,7 @@ handleCmd_inRoom ["REMOVE_TEAM", tName] = do
                 [ProtocolError "Not team owner!"]
             else
                 [RemoveTeam tName,
+                SendUpdateOnThisRoom,
                 ModifyClient
                     (\c -> c{
                         teamsInGame = teamsInGame c - 1,
@@ -157,21 +166,25 @@ handleCmd_inRoom ["TEAM_COLOR", teamName, newColor] = do
 handleCmd_inRoom ["TOGGLE_READY"] = do
     cl <- thisClient
     chans <- roomClientsChans
-    return [
-        ModifyClient (\c -> c{isReady = not $ isReady cl}),
-        ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
-        AnswerClients chans $ if clientProto cl < 38 then
-                [if isReady cl then "NOT_READY" else "READY", nick cl]
-                else
-                ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
-        ]
+    if isMaster cl then
+        return []
+        else
+        return [
+            ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
+            ModifyClient (\c -> c{isReady = not $ isReady cl}),
+            AnswerClients chans $ if clientProto cl < 38 then
+                    [if isReady cl then "NOT_READY" else "READY", nick cl]
+                    else
+                    ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
+            ]
 
 handleCmd_inRoom ["START_GAME"] = do
     (ci, rnc) <- ask
     cl <- thisClient
     rm <- thisRoom
     chans <- roomClientsChans
-    
+
+    let nicks = map (nick . client rnc) . roomClients rnc $ clientRoom rnc ci
     let allPlayersRegistered = all ((<) 0 . B.length . webPassword . client rnc . teamownerId) $ teams rm
 
     if isMaster cl && playersIn rm == readyPlayers rm && not (isJust $ gameInfo rm) then
@@ -179,10 +192,13 @@ handleCmd_inRoom ["START_GAME"] = do
             return [
                 ModifyRoom
                     (\r -> r{
-                        gameInfo = Just $ newGameInfo allPlayersRegistered (mapParams rm) (params rm)
+                        gameInfo = Just $ newGameInfo (teams rm) (length $ teams rm) allPlayersRegistered (mapParams rm) (params rm)
                         }
-                    ),
-                AnswerClients chans ["RUN_GAME"]
+                    )
+                , AnswerClients chans ["RUN_GAME"]
+                , SendUpdateOnThisRoom
+                , AnswerClients chans $ "CLIENT_FLAGS" : "+g" : nicks
+                , ModifyRoomClients (\c -> c{isInGame = True})
                 ]
             else
             return [Warning "Less than two clans!"]
@@ -210,21 +226,20 @@ handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
     rm <- thisRoom
     chans <- roomClientsChans
 
-    if isMaster cl && (isJust $ gameInfo rm) then
-        return $
-            SaveReplay
-            : ModifyRoom
-                (\r -> r{
-                    gameInfo = Nothing,
-                    readyPlayers = 0
-                    }
-                )
-            : UnreadyRoomClients
-            : answerRemovedTeams chans rm
+    let clTeams = map teamname . filter (\t -> teamowner t == nick cl) . teams $ rm
+    let unsetInGameState = [AnswerClients chans ["CLIENT_FLAGS", "-g", nick cl], ModifyClient (\c -> c{isInGame = False})]
+
+    if isInGame cl then
+        if isJust $ gameInfo rm then
+            if (isMaster cl && isCorrect) then
+                return $ FinishGame : unsetInGameState
+                else
+                return $ unsetInGameState ++ map SendTeamRemovalMessage clTeams
+            else
+            return unsetInGameState
         else
-        return []
+        return [] -- don't accept this message twice
     where
-        answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
         isCorrect = correctly == "1"
 
 -- compatibility with clients with protocol < 38
@@ -252,7 +267,9 @@ handleCmd_inRoom ["TOGGLE_RESTRICT_TEAMS"] = do
 handleCmd_inRoom ["ROOM_NAME", newName] = do
     cl <- thisClient
     rs <- allRoomInfos
-    
+    rm <- thisRoom
+    chans <- sameProtoChans
+
     return $
         if not $ isMaster cl then
             [ProtocolError "Not room master"]
@@ -260,7 +277,10 @@ handleCmd_inRoom ["ROOM_NAME", newName] = do
         if isJust $ find (\r -> newName == name r) rs then
             [Warning "Room with such name already exists"]
         else
-            [ModifyRoom (\r -> r{name = newName})]
+            [ModifyRoom roomUpdate,
+            AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo (nick cl) (roomUpdate rm))]
+    where
+        roomUpdate r = r{name = newName}
 
 
 handleCmd_inRoom ["KICK", kickNick] = do
@@ -280,4 +300,16 @@ handleCmd_inRoom ["TEAMCHAT", msg] = do
     where
         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
 
-handleCmd_inRoom _ = return [ProtocolError "Incorrect command (state: in room)"]
+handleCmd_inRoom ["BAN", banNick] = do
+    (_, rnc) <- ask
+    maybeClientId <- clientByNick banNick
+    let banId = fromJust maybeClientId
+    master <- liftM isMaster thisClient
+    return [ModifyRoom (\r -> r{roomBansList = (host $ rnc `client` banId) : roomBansList r}) | master && isJust maybeClientId]
+
+
+handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)
+
+handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]
+
+handleCmd_inRoom [] = return [ProtocolError "Empty command (state: in room)"]
diff --git a/gameServer/HWProtoLobbyState.hs b/gameServer/HWProtoLobbyState.hs
index 6807e47..241b34f 100644
--- a/gameServer/HWProtoLobbyState.hs
+++ b/gameServer/HWProtoLobbyState.hs
@@ -6,6 +6,7 @@ import qualified Data.Foldable as Foldable
 import Data.Maybe
 import Data.List
 import Control.Monad.Reader
+import qualified Data.ByteString.Char8 as B
 --------------------------------------
 import CoreTypes
 import Actions
@@ -24,6 +25,7 @@ answerAllTeams cl = concatMap toAnswer
             AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team],
             AnswerClients [clChan] ["HH_NUM", teamname team, showB $ hhnum team]]
 
+
 handleCmd_lobby :: CmdHandler
 
 
@@ -31,19 +33,8 @@ handleCmd_lobby ["LIST"] = do
     (ci, irnc) <- ask
     let cl = irnc `client` ci
     rooms <- allRoomInfos
-    let roomsInfoList = concatMap (roomInfo irnc) . filter (\r -> (roomProto r == clientProto cl) && not (isRestrictedJoins r))
+    let roomsInfoList = concatMap (\r -> roomInfo (nick $ irnc `client` masterID r) r) . filter (\r -> (roomProto r == clientProto cl))
     return [AnswerClients [sendChan cl] ("ROOMS" : roomsInfoList rooms)]
-    where
-        roomInfo irnc r = [
-                showB $ isJust $ gameInfo r,
-                name r,
-                showB $ playersIn r,
-                showB $ length $ teams r,
-                nick $ irnc `client` masterID r,
-                Map.findWithDefault "+rnd+" "MAP" (mapParams r),
-                head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
-                head (Map.findWithDefault ["Default"] "AMMO" (params r))
-                ]
 
 
 handleCmd_lobby ["CHAT", msg] = do
@@ -60,8 +51,10 @@ handleCmd_lobby ["CREATE_ROOM", rName, roomPassword]
             [Warning "Room exists"]
             else
             [
-                AddRoom rName roomPassword,
-                AnswerClients [sendChan cl] ["CLIENT_FLAGS", "-r", nick cl]
+                AddRoom rName roomPassword
+                , AnswerClients [sendChan cl] ["CLIENT_FLAGS", "+hr", nick cl]
+                , ModifyClient (\c -> c{isMaster = True, isReady = True})
+                , ModifyRoom (\r -> r{readyPlayers = 1})
             ]
 
 
@@ -79,19 +72,25 @@ handleCmd_lobby ["JOIN_ROOM", roomName, roomPassword] = do
     let sameProto = clientProto cl == roomProto jRoom
     let jRoomClients = map (client irnc) $ roomClients irnc jRI
     let nicks = map nick jRoomClients
+    let ownerNick = nick . fromJust $ find isMaster jRoomClients
     let chans = map sendChan (cl : jRoomClients)
+    let isBanned = host cl `elem` roomBansList jRoom
     return $
-        if isNothing maybeRI || not sameProto then 
+        if isNothing maybeRI || not sameProto then
             [Warning "No such room"]
             else if isRestrictedJoins jRoom then
             [Warning "Joining restricted"]
+            else if isBanned then
+            [Warning "You are banned in this room"]
             else if roomPassword /= password jRoom then
-            [Warning "Wrong password"]
+            [NoticeMessage WrongPassword]
             else
             [
-                MoveToRoom jRI,
-                AnswerClients [sendChan cl] $ "JOINED" : nicks,
-                AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl]
+                MoveToRoom jRI
+                , AnswerClients [sendChan cl] $ "JOINED" : nicks
+                , AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl]
+                , AnswerClients [sendChan cl] $ ["WARNING", "Room admin is " `B.append` ownerNick]
+                , AnswerClients [sendChan cl] $ ["CLIENT_FLAGS", "+h", ownerNick]
             ]
             ++ map (readynessMessage cl) jRoomClients
             ++ answerFullConfig cl (mapParams jRoom) (params jRoom)
@@ -134,7 +133,6 @@ handleCmd_lobby ["JOIN_ROOM", roomName] =
 handleCmd_lobby ["FOLLOW", asknick] = do
     (_, rnc) <- ask
     ci <- clientByNick asknick
-    cl <- thisClient
     let ri = clientRoom rnc $ fromJust ci
     let clRoom = room rnc ri
     if isNothing ci || ri == lobbyId then
@@ -157,18 +155,21 @@ handleCmd_lobby ["BAN", banNick, reason] = do
     cl <- thisClient
     banId <- clientByNick banNick
     return [BanClient 60 reason (fromJust banId) | isAdministrator cl && isJust banId && fromJust banId /= ci]
-    
+
 handleCmd_lobby ["BANIP", ip, reason, duration] = do
-    (ci, _) <- ask
     cl <- thisClient
     return [BanIP ip (readInt_ duration) reason | isAdministrator cl]
-    
+
 handleCmd_lobby ["BANLIST"] = do
-    (ci, _) <- ask
     cl <- thisClient
     return [BanList | isAdministrator cl]
 
 
+handleCmd_lobby ["UNBAN", entry] = do
+    cl <- thisClient
+    return [Unban entry | isAdministrator cl]
+
+
 handleCmd_lobby ["SET_SERVER_VAR", "MOTD_NEW", newMessage] = do
     cl <- thisClient
     return [ModifyServerInfo (\si -> si{serverMessage = newMessage}) | isAdministrator cl]
@@ -182,7 +183,7 @@ handleCmd_lobby ["SET_SERVER_VAR", "LATEST_PROTO", protoNum] = do
     return [ModifyServerInfo (\si -> si{latestReleaseVersion = readNum}) | isAdministrator cl && readNum > 0]
     where
         readNum = readInt_ protoNum
- 
+
 handleCmd_lobby ["GET_SERVER_VAR"] = do
     cl <- thisClient
     return [SendServerVars | isAdministrator cl]
@@ -193,7 +194,7 @@ handleCmd_lobby ["CLEAR_ACCOUNTS_CACHE"] = do
 
 handleCmd_lobby ["RESTART_SERVER"] = do
     cl <- thisClient
-    return [RestartServer]
+    return [RestartServer | isAdministrator cl]
 
 
 handleCmd_lobby _ = return [ProtocolError "Incorrect command (state: in lobby)"]
diff --git a/gameServer/HandlerUtils.hs b/gameServer/HandlerUtils.hs
index 83d54a6..5daf4c3 100644
--- a/gameServer/HandlerUtils.hs
+++ b/gameServer/HandlerUtils.hs
@@ -48,6 +48,12 @@ thisClientChans = do
     (ci, rnc) <- ask
     return [sendChan (rnc `client` ci)]
 
+sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan]
+sameProtoChans = do
+    (ci, rnc) <- ask
+    let p = clientProto (rnc `client` ci)
+    return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rnc
+
 answerClient :: [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
 answerClient msg = liftM ((: []) . flip AnswerClients msg) thisClientChans
 
diff --git a/gameServer/NetRoutines.hs b/gameServer/NetRoutines.hs
index 67db0e7..c9f2b89 100644
--- a/gameServer/NetRoutines.hs
+++ b/gameServer/NetRoutines.hs
@@ -3,7 +3,6 @@ module NetRoutines where
 
 import Network.Socket
 import Control.Concurrent.Chan
-import qualified Control.Exception as Exception
 import Data.Time
 import Control.Monad
 import Data.Unique
@@ -41,6 +40,7 @@ acceptLoop servSock chan = forever $
                     False
                     False
                     False
+                    False
                     Nothing
                     0
                     )
diff --git a/gameServer/OfficialServer/DBInteraction.hs b/gameServer/OfficialServer/DBInteraction.hs
index dea6e6f..3f8e72a 100644
--- a/gameServer/OfficialServer/DBInteraction.hs
+++ b/gameServer/OfficialServer/DBInteraction.hs
@@ -60,7 +60,7 @@ pipeDbConnectionLoop queries cChan hIn hOut accountsCache req =
         CheckAccount clId clUid clNick _ -> do
             let cacheEntry = clNick `Map.lookup` accountsCache
             currentTime <- getCurrentTime
-            if (isNothing cacheEntry) || (currentTime `diffUTCTime` (fst . fromJust) cacheEntry > 2 * 24 * 60 * 60) then
+            if (isNothing cacheEntry) || (currentTime `diffUTCTime` (fst . fromJust) cacheEntry > 10 * 60) then
                 do
                     SIO.hPutStrLn hIn $ show q
                     hFlush hIn
diff --git a/gameServer/RoomsAndClients.hs b/gameServer/RoomsAndClients.hs
index f2dc8e6..6ae37df 100644
--- a/gameServer/RoomsAndClients.hs
+++ b/gameServer/RoomsAndClients.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving #-}
+
 module RoomsAndClients(
     RoomIndex(),
     ClientIndex(),
@@ -34,24 +36,25 @@ module RoomsAndClients(
 
 import Store
 import Control.Monad
+import Control.DeepSeq
 
 
 data Room r = Room {
-    roomClients' :: [ClientIndex],
-    room' :: r
+    roomClients' :: ![ClientIndex],
+    room' :: !r
     }
 
 
 data Client c = Client {
-    clientRoom' :: RoomIndex,
-    client' :: c
+    clientRoom' :: !RoomIndex,
+    client' :: !c
     }
 
 
 newtype RoomIndex = RoomIndex ElemIndex
-    deriving (Eq)
+    deriving (Eq, NFData)
 newtype ClientIndex = ClientIndex ElemIndex
-    deriving (Eq, Show, Read, Ord)
+    deriving (Eq, Show, Read, Ord, NFData)
 
 instance Show RoomIndex where
     show (RoomIndex i) = 'r' : show i
@@ -82,10 +85,10 @@ newRoomsAndClients r = do
 
 
 roomAddClient :: ClientIndex -> Room r -> Room r
-roomAddClient cl rm = let cls = cl : roomClients' rm; nr = rm{roomClients' = cls} in cls `seq` nr
+roomAddClient cl rm = let cls = cl : roomClients' rm; nr = rm{roomClients' = cls} in cls `deepseq` nr
 
 roomRemoveClient :: ClientIndex -> Room r -> Room r
-roomRemoveClient cl rm = let cls = filter (/= cl) $ roomClients' rm; nr = rm{roomClients' = cls} in cls `seq` nr
+roomRemoveClient cl rm = let cls = filter (/= cl) $ roomClients' rm; nr = rm{roomClients' = cls} in cls `deepseq` nr
 
 
 addRoom :: MRoomsAndClients r c -> r -> IO RoomIndex
diff --git a/gameServer/ServerCore.hs b/gameServer/ServerCore.hs
index 440703f..4280b9c 100644
--- a/gameServer/ServerCore.hs
+++ b/gameServer/ServerCore.hs
@@ -1,6 +1,5 @@
 module ServerCore where
 
-import Network
 import Control.Concurrent
 import Control.Monad
 import System.Log.Logger
@@ -43,7 +42,7 @@ mainLoop = forever $ do
 
         ClientMessage (ci, cmd) -> do
             liftIO $ debugM "Clients" $ show ci ++ ": " ++ show cmd
-            
+
             removed <- gets removedClients
             unless (ci `Set.member` removed) $ do
                 modify (\s -> s{clientIndex = Just ci})
@@ -75,8 +74,6 @@ startServer si = do
             (fromJust $ serverSocket si)
             (coreChan si)
 
-    return ()
-
     _ <- forkIO $ timerLoop 0 $ coreChan si
 
     startDBConnection si
diff --git a/gameServer/ServerState.hs b/gameServer/ServerState.hs
index db1ca38..b163394 100644
--- a/gameServer/ServerState.hs
+++ b/gameServer/ServerState.hs
@@ -6,11 +6,13 @@ module ServerState
     client's,
     allClientsS,
     roomClientsS,
+    sameProtoClientsS,
     io
     ) where
 
 import Control.Monad.State.Strict
-import Data.Set as Set
+import Data.Set as Set(Set)
+import Data.Word
 ----------------------
 import RoomsAndClients
 import CoreTypes
@@ -43,5 +45,10 @@ roomClientsS ri = do
     rnc <- gets roomsClients
     io $ roomClientsM rnc ri
 
+sameProtoClientsS :: Word16 -> StateT ServerState IO [ClientInfo]
+sameProtoClientsS p = liftM f allClientsS
+    where
+        f = filter (\c -> clientProto c == p)
+    
 io :: IO a -> StateT ServerState IO a
 io = liftIO
diff --git a/gameServer/Store.hs b/gameServer/Store.hs
index 50f033c..24b7465 100644
--- a/gameServer/Store.hs
+++ b/gameServer/Store.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving #-}
 module Store(
     ElemIndex(),
     MStore(),
@@ -17,17 +18,18 @@ module Store(
     indices
     ) where
 
-import qualified Data.Array.IArray as IA
-import qualified Data.Array.IO as IOA
 import qualified Data.IntSet as IntSet
+import qualified Data.Vector as V
+import qualified Data.Vector.Mutable as MV
 import Data.IORef
 import Control.Monad
+import Control.DeepSeq
 
 
 newtype ElemIndex = ElemIndex Int
-    deriving (Eq, Show, Read, Ord)
-newtype MStore e = MStore (IORef (IntSet.IntSet, IntSet.IntSet, IOA.IOArray Int e))
-newtype IStore e = IStore (IntSet.IntSet, IA.Array Int e)
+    deriving (Eq, Show, Read, Ord, NFData)
+newtype MStore e = MStore (IORef (IntSet.IntSet, IntSet.IntSet, MV.IOVector e))
+newtype IStore e = IStore (IntSet.IntSet, V.Vector e)
 
 
 firstIndex :: ElemIndex
@@ -48,7 +50,7 @@ truncFunc a | a > growFunc initialSize = (a `div` 2)
 
 newStore :: IO (MStore e)
 newStore = do
-    newar <- IOA.newArray_ (0, initialSize - 1)
+    newar <- MV.new initialSize
     new <- newIORef (IntSet.empty, IntSet.fromAscList [0..initialSize - 1], newar)
     return (MStore new)
 
@@ -56,11 +58,10 @@ newStore = do
 growStore :: MStore e -> IO ()
 growStore (MStore ref) = do
     (busyElems, freeElems, arr) <- readIORef ref
-    (_, m') <- IOA.getBounds arr
-    let newM' = growFunc (m' + 1) - 1
-    newArr <- IOA.newArray_ (0, newM')
-    sequence_ [IOA.readArray arr i >>= IOA.writeArray newArr i | i <- [0..m']]
-    writeIORef ref (busyElems, freeElems `IntSet.union` IntSet.fromAscList [m'+1..newM'], newArr)
+    let oldSize = MV.length arr
+    let newSize = growFunc oldSize
+    newArr <- MV.grow arr (newSize - oldSize)
+    writeIORef ref (busyElems, freeElems `IntSet.union` IntSet.fromAscList [oldSize .. newSize-1], newArr)
 
 
 growIfNeeded :: MStore e -> IO ()
@@ -72,20 +73,18 @@ growIfNeeded m@(MStore ref) = do
 truncateIfNeeded :: MStore e -> IO ()
 truncateIfNeeded (MStore ref) = do
     (busyElems, _, arr) <- readIORef ref
-    (_, m') <- IOA.getBounds arr
-    let newM' = truncFunc (m' + 1) - 1
-    when (newM' < m' && (not $ IntSet.null busyElems) && IntSet.findMax busyElems <= newM') $ do
-        newArr <- IOA.newArray_ (0, newM')
-        sequence_ [IOA.readArray arr i >>= IOA.writeArray newArr i | i <- IntSet.toList busyElems]
-        writeIORef ref (busyElems, IntSet.fromAscList [0..newM'] `IntSet.difference` busyElems, newArr)
+    let oldSize = MV.length arr
+    let newSize = truncFunc oldSize
+    when (newSize < oldSize && (not $ IntSet.null busyElems) && IntSet.findMax busyElems < newSize) $ do
+        writeIORef ref (busyElems, IntSet.fromAscList [0..newSize - 1] `IntSet.difference` busyElems, MV.take newSize arr)
 
 
 addElem :: MStore e -> e -> IO ElemIndex
 addElem m@(MStore ref) element = do
     growIfNeeded m
     (busyElems, freeElems, arr) <- readIORef ref
-    let (n, freeElems') = IntSet.deleteFindMin freeElems
-    IOA.writeArray arr n element
+    let (!n, freeElems') = IntSet.deleteFindMin freeElems
+    MV.write arr n element
     writeIORef ref (IntSet.insert n busyElems, freeElems', arr)
     return $ ElemIndex n
 
@@ -93,32 +92,32 @@ addElem m@(MStore ref) element = do
 removeElem :: MStore e -> ElemIndex -> IO ()
 removeElem m@(MStore ref) (ElemIndex n) = do
     (busyElems, freeElems, arr) <- readIORef ref
-    IOA.writeArray arr n (error $ "Store: no element " ++ show n)
+    MV.write arr n (error $ "Store: no element " ++ show n)
     writeIORef ref (IntSet.delete n busyElems, IntSet.insert n freeElems, arr)
     truncateIfNeeded m
 
 
 readElem :: MStore e -> ElemIndex -> IO e
-readElem (MStore ref) (ElemIndex n) = readIORef ref >>= \(_, _, arr) -> IOA.readArray arr n
+readElem (MStore ref) (ElemIndex n) = readIORef ref >>= \(_, _, arr) -> MV.read arr n
 
 
 writeElem :: MStore e -> ElemIndex -> e -> IO ()
-writeElem (MStore ref) (ElemIndex n) el = readIORef ref >>= \(_, _, arr) -> IOA.writeArray arr n el
+writeElem (MStore ref) (ElemIndex n) el = readIORef ref >>= \(_, _, arr) -> MV.write arr n el
 
 
 modifyElem :: MStore e -> (e -> e) -> ElemIndex -> IO ()
 modifyElem (MStore ref) f (ElemIndex n) = do
     (_, _, arr) <- readIORef ref
-    IOA.readArray arr n >>= IOA.writeArray arr n . f
+    MV.read arr n >>= MV.write arr n . f
 
 elemExists :: MStore e -> ElemIndex -> IO Bool
 elemExists (MStore ref) (ElemIndex n) = do
-    (_, free, _) <- readIORef ref
+    (_, !free, _) <- readIORef ref
     return $ n `IntSet.notMember` free
 
 indicesM :: MStore e -> IO [ElemIndex]
 indicesM (MStore ref) = do
-    (busy, _, _) <- readIORef ref
+    (!busy, _, _) <- readIORef ref
     return $ map ElemIndex $ IntSet.toList busy
 
 
@@ -126,13 +125,13 @@ indicesM (MStore ref) = do
 m2i :: MStore e -> IO (IStore e)
 m2i (MStore ref) = do
     (a, _, c') <- readIORef ref
-    c <- IOA.unsafeFreeze c'
+    c <- V.unsafeFreeze c'
     return $ IStore (a, c)
 
 i2m :: MStore e -> IStore e -> IO ()
 i2m (MStore ref) (IStore (_, arr)) = do
     (b, e, _) <- readIORef ref
-    a <- IOA.unsafeThaw arr
+    a <- V.unsafeThaw arr
     writeIORef ref (b, e, a)
 
 withIStore :: MStore e -> (IStore e -> a) -> IO a
@@ -155,7 +154,7 @@ withIStore2 m1 m2 f = do
 
 -- IStore code
 (!) :: IStore e -> ElemIndex -> e
-(!) (IStore (_, arr)) (ElemIndex i) = (IA.!) arr i
+(!) (IStore (_, arr)) (ElemIndex i) = (V.!) arr i
 
 indices :: IStore e -> [ElemIndex]
 indices (IStore (busy, _)) = map ElemIndex $ IntSet.toList busy
diff --git a/gameServer/Utils.hs b/gameServer/Utils.hs
index c27c087..86cdfe6 100644
--- a/gameServer/Utils.hs
+++ b/gameServer/Utils.hs
@@ -4,19 +4,17 @@ module Utils where
 import Data.Char
 import Data.Word
 import qualified Data.Map as Map
-import qualified Data.Set as Set
 import qualified Data.Char as Char
 import Numeric
 import Network.Socket
 import System.IO
 import qualified Data.List as List
 import Control.Monad
-import qualified Codec.Binary.Base64 as Base64
 import qualified Data.ByteString.Lazy as BL
 import qualified Text.Show.ByteString as BS
 import qualified Data.ByteString.Char8 as B
 import qualified Data.ByteString.UTF8 as UTF8
-import qualified Data.ByteString as BW
+import Data.Maybe
 -------------------------------------------------
 import CoreTypes
 
@@ -90,6 +88,8 @@ protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
             , (40, "0.9.17-dev")
             , (41, "0.9.17")
             , (42, "0.9.18-dev")
+            , (43, "0.9.18")
+            , (44, "0.9.19-dev")
             ]
 
 askFromConsole :: B.ByteString -> IO B.ByteString
@@ -121,3 +121,16 @@ caseInsensitiveCompare :: B.ByteString -> B.ByteString -> Bool
 caseInsensitiveCompare a b = f a == f b
     where
         f = map Char.toUpper . UTF8.toString
+
+
+roomInfo :: B.ByteString -> RoomInfo -> [B.ByteString]
+roomInfo n r = [
+        showB $ isJust $ gameInfo r,
+        name r,
+        showB $ playersIn r,
+        showB $ length $ teams r,
+        n,
+        Map.findWithDefault "+rnd+" "MAP" (mapParams r),
+        head (Map.findWithDefault ["Default"] "SCHEME" (params r)),
+        head (Map.findWithDefault ["Default"] "AMMO" (params r))
+        ]
diff --git a/gameServer/hedgewars-server.cabal b/gameServer/hedgewars-server.cabal
index 070acb4..5d75355 100644
--- a/gameServer/hedgewars-server.cabal
+++ b/gameServer/hedgewars-server.cabal
@@ -18,7 +18,7 @@ Executable hedgewars-server
     base >= 4.3,
     unix,
     containers,
-    array,
+    vector,
     bytestring,
     bytestring-show,
     network >= 2.3,
diff --git a/gameServer/stresstest.hs b/gameServer/stresstest.hs
index e51a503..b92eecd 100644
--- a/gameServer/stresstest.hs
+++ b/gameServer/stresstest.hs
@@ -14,10 +14,10 @@ import System.Random
 import System.Posix
 #endif
 
-session 0 nick room = ["NICK", nick, "", "PROTO", "38", "", "PING", "", "CHAT", "lobby 1", "", "PONG", "", "CREATE_ROOM", room, "", "CHAT", "room 1", "", "QUIT", "creator", ""]
-session 1 nick room = ["NICK", nick, "", "PROTO", "38", "", "LIST", "", "JOIN_ROOM", room, "", "PONG", "", "CHAT", "room 2", "", "PART", "", "CHAT", "lobby after part", "", "QUIT", "part-quit", ""]
-session 2 nick room = ["NICK", nick, "", "PROTO", "38", "", "LIST", "", "JOIN_ROOM", room, "", "PONG", "", "CHAT", "room 2", "", "QUIT", "quit", ""]
-session 3 nick room = ["NICK", nick, "", "PROTO", "38", "", "CHAT", "lobby 1", "", "CREATE_ROOM", room, "", "", "PONG", "CHAT", "room 1", "", "PART", "creator", "", "QUIT", "part-quit", ""]
+session 0 nick room = ["NICK", nick, "", "PROTO", "42", "", "PING", "", "CHAT", "lobby 1", "", "PONG", "", "CREATE_ROOM", room, "", "CHAT", "room 1", "", "QUIT", "creator", ""]
+session 1 nick room = ["NICK", nick, "", "PROTO", "42", "", "LIST", "", "JOIN_ROOM", room, "", "PONG", "", "CHAT", "room 2", "", "PART", "", "CHAT", "lobby after part", "", "QUIT", "part-quit", ""]
+session 2 nick room = ["NICK", nick, "", "PROTO", "42", "", "LIST", "", "JOIN_ROOM", room, "", "PONG", "", "CHAT", "room 2", "", "QUIT", "quit", ""]
+session 3 nick room = ["NICK", nick, "", "PROTO", "42", "", "CHAT", "lobby 1", "", "CREATE_ROOM", room, "", "", "PONG", "CHAT", "room 1", "", "PART", "creator", "", "QUIT", "part-quit", ""]
 
 emulateSession sock s = do
     mapM_ (\x -> hPutStrLn sock x >> hFlush sock >> randomRIO (100000::Int, 600000) >>= threadDelay) s
diff --git a/gameServer/stresstest3.hs b/gameServer/stresstest3.hs
index 91c68e8..40e8e4e 100644
--- a/gameServer/stresstest3.hs
+++ b/gameServer/stresstest3.hs
@@ -47,7 +47,7 @@ emulateSession = do
     waitPacket "CONNECTED"
     sendPacket ["NICK", "test" ++ show n]
     waitPacket "NICK"
-    sendPacket ["PROTO", "31"]
+    sendPacket ["PROTO", "41"]
     waitPacket "PROTO"
     b <- waitPacket "LOBBY:JOINED"
     --io $ print b
diff --git a/hedgewars/ArgParsers.inc b/hedgewars/ArgParsers.inc
index 410cbee..503cec2 100644
--- a/hedgewars/ArgParsers.inc
+++ b/hedgewars/ArgParsers.inc
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,51 +16,54 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-procedure playReplayFileWithParameters(); forward;
-
-procedure internalSetGameTypeLandPreviewFromParameters();
-begin
-    if ParamStr(3) = '--stats-only' then
-        playReplayFileWithParameters()
-    else
-        begin
-        val(ParamStr(2), ipcPort);
-        GameType:= gmtLandPreview;
-        if ParamStr(3) <> 'landpreview' then
-            GameType:= gmtSyntax
-        end
-end;
 
 procedure internalStartGameWithParameters();
 var tmp: LongInt;
 begin
     UserPathPrefix:= ParamStr(1);
-    val(ParamStr(2), cScreenWidth);
-    val(ParamStr(3), cScreenHeight);
-    val(ParamStr(4), cBits);
-    val(ParamStr(5), ipcPort);
+    cScreenWidth:= StrToInt(ParamStr(2));
+    cScreenHeight:= StrToInt(ParamStr(3));
+    cBits:= StrToInt(ParamStr(4));
+    ipcPort:= StrToInt(ParamStr(5));
     cFullScreen:= ParamStr(6) = '1';
-    isSoundEnabled:= ParamStr(7) = '1';
-    isMusicEnabled:= ParamStr(8) = '1';
-    val(ParamStr(9), cInitVolume);
-    val(ParamStr(10), cTimerInterval);
+    SetSound(ParamStr(7) = '1');
+    SetMusic(ParamStr(8) = '1');
+    SetVolume(StrToInt(ParamStr(9)));
+    cTimerInterval:= StrToInt(ParamStr(10));
     PathPrefix:= ParamStr(11);
     cShowFPS:= ParamStr(12) = '1';
     cAltDamage:= ParamStr(13) = '1';
     UserNick:= DecodeBase64(ParamStr(14));
-    val(ParamStr(15), cReducedQuality);
-    val(ParamStr(16), tmp);
-    cGrayScale:= false;
+    cReducedQuality:= StrToInt(ParamStr(15));
+    tmp:= StrToInt(ParamStr(16));
+    GrayScale:= false;
     if (tmp > 9) and (tmp < 16) then 
         begin
-        cGrayScale:= true;
+        GrayScale:= true;
         cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp-9)))
         end
-    else if tmp <= 9 then cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp)))
-    else cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp-6)));
+    else if tmp <= 9 then 
+        cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp)))
+    else 
+        cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp-6)));
     cLocaleFName:= ParamStr(17);
 end;
 
+{$IFDEF USE_VIDEO_RECORDING}
+procedure internalStartVideoRecordingWithParameters();
+begin
+    internalStartGameWithParameters();
+    GameType:= gmtRecord;
+    cVideoFramerateNum:= StrToInt(ParamStr(18));
+    cVideoFramerateDen:= StrToInt(ParamStr(19));
+    RecPrefix:= ParamStr(20);
+    cAVFormat:= ParamStr(21);
+    cVideoCodec:= ParamStr(22);
+    cVideoQuality:= StrToInt(ParamStr(23));
+    cAudioCodec:= ParamStr(24);
+end;
+{$ENDIF}
+
 procedure setVideo(screenWidth: LongInt; screenHeight: LongInt; bitsStr: LongInt);
 begin
     cScreenWidth:= screenWidth;
@@ -69,11 +72,11 @@ begin
 end;
 
 procedure setVideoWithParameters(screenWidthParam: string; screenHeightParam: string; bitsParam: string);
-var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt: LongInt;
+var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt, c: LongInt;
 begin
-    val(screenWidthParam, screenWidthAsInt);
-    val(screenHeightParam, screenHeightAsInt);
-    val(bitsParam, bitsStrAsInt);
+    val(screenWidthParam, screenWidthAsInt, c);
+    val(screenHeightParam, screenHeightAsInt, c);
+    val(bitsParam, bitsStrAsInt, c);
     setVideo(screenWidthAsInt,screenHeightAsInt,bitsStrAsInt)
 end;
 
@@ -99,16 +102,16 @@ end;
 
 procedure setAudio(initialVolume: LongInt; musicEnabled: boolean; soundEnabled: boolean);
 begin
-    cInitVolume:= initialVolume;
-    isMusicEnabled:= musicEnabled;
-    isSoundEnabled:= soundEnabled
+    SetVolume(initialVolume);
+    SetMusic(musicEnabled);
+    SetSound(soundEnabled);
 end;
 
 procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string);
-var initialVolumeAsInt: LongInt;
+var initialVolumeAsInt, c: LongInt;
     musicEnabled, soundEnabled: boolean;
 begin
-    val(initialVolumeParam, initialVolumeAsInt);
+    val(initialVolumeParam, initialVolumeAsInt, c);
     musicEnabled:= musicEnabledParam = '1';
     soundEnabled:= soundEnabledParam = '1';
     setAudio(initialVolumeAsInt,musicEnabled, soundEnabled)
@@ -136,7 +139,7 @@ procedure setAllOptionsWithParameters(screenWidthParam:string; screenHeightParam
                                       languageFileParam:string; fullScreenParam:string; showFPSParam:string;
                                       altDamageParam:string; timeItervalParam:string; reducedQualityParam: string);
 var showFPS, altDamage, reducedQuality: boolean;
-    timeIterval: LongInt;
+    timeIterval, c: LongInt;
 begin
     setMultimediaOptionsWithParameters(screenWidthParam,screenHeightParam, bitsParam,
                                        initialVolumeParam,musicEnabledParam,soundEnabledParam,
@@ -145,7 +148,7 @@ begin
     setShowFPS(showFPS);
 
     altDamage:= altDamageParam = '1';
-    val(timeItervalParam, timeIterval);
+    val(timeItervalParam, timeIterval, c);
     reducedQuality:= reducedQualityParam = '1';
     setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality);
 end;
@@ -159,7 +162,7 @@ begin
     recordFileName:= ParamStr(3);
     paramIndex:= 4;
     wrongParameter:= false;
-    while (paramIndex <= ParamCount) and not wrongParameter do
+    while (paramIndex <= ParamCount) and (not wrongParameter) do
         begin
         if ParamStr(paramIndex) = '--set-video'  then
 //--set-video [screen width] [screen height] [color dept]
@@ -229,8 +232,8 @@ begin
                             if ParamStr(paramIndex) = '--stats-only'  then
                                 begin
                                 cOnlyStats:= true;
-                                isSoundEnabled:= false;
-                                isMusicEnabled:= false;
+                                SetSound(false);
+                                SetMusic(false);
                                 cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK
                                 paramIndex:= paramIndex + 1
                                 end
diff --git a/hedgewars/CMakeLists.txt b/hedgewars/CMakeLists.txt
index 56dadda..6bf3766 100644
--- a/hedgewars/CMakeLists.txt
+++ b/hedgewars/CMakeLists.txt
@@ -3,7 +3,6 @@ find_package(SDL_image)
 find_package(SDL_net)
 find_package(SDL_ttf)
 find_package(SDL_mixer)
-find_package(Lua)
 
 include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake)
 
@@ -15,9 +14,12 @@ set(engine_output_name "hwengine")
 
 set(engine_sources
     ${hwengine_project}
+    LuaPas.pas
+    PNGh.pas
     SDLh.pas
     uAI.pas
     uAIActions.pas
+    uAILandMarks.pas
     uAIAmmoTests.pas
     uAIMisc.pas
     uAmmos.pas
@@ -28,16 +30,24 @@ set(engine_sources
     uCommandHandlers.pas
     uConsole.pas
     uConsts.pas
+    uCursor.pas
     uDebug.pas
     uFloat.pas
     uGame.pas
     uGears.pas
+    uGearsHandlers.pas
+    uGearsHandlersRope.pas
+    uGearsHedgehog.pas
+    uGearsList.pas
     uGearsRender.pas
+    uGearsUtils.pas
     uIO.pas
-    uKeys.pas
+    uInputHandler.pas
     uLand.pas
+    uLandGenMaze.pas
     uLandGraphics.pas
     uLandObjects.pas
+    uLandOutline.pas
     uLandPainted.pas
     uLandTemplates.pas
     uLandTexture.pas
@@ -54,14 +64,15 @@ set(engine_sources
     uStore.pas
     uTeams.pas
     uTextures.pas
+    uTouch.pas
     uTypes.pas
     uUtils.pas
     uVariables.pas
+    uVideoRec.pas
     uVisualGears.pas
     uWorld.pas
     GSHandlers.inc
     VGSHandlers.inc
-    HHHandlers.inc
     ArgParsers.inc
     options.inc
     adler32.pas
@@ -71,17 +82,16 @@ set(engine_sources
 if(BUILD_ENGINE_LIBRARY)
     message(STATUS "Engine will be built as library (experimental)")
     set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas)
-    set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources})
-    set(pascal_compiler_flags_cmn "-dHWLIBRARY" ${pascal_compiler_flags_cmn})
+    set(pascal_flags "-dHWLIBRARY" ${pascal_flags})
 
     # create position independent code, only required for x68_64 builds, similar to -fPIC
     if(CMAKE_SIZEOF_VOID_P MATCHES "8")
-        set(pascal_compiler_flags_cmn "-Cg" ${pascal_compiler_flags_cmn})
+        set(pascal_flags "-Cg" ${pascal_flags})
     endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
 
-    # due to compiling/linker issues on Max OS X 10.6 -k-no_order_inits is needed to avoid linking fail
+    # due to compiler/linker issues on Max OS X 10.6 -k-no_order_inits is needed to avoid linking fail
     if(APPLE AND current_macosx_version GREATER "10.5")
-        set(pascal_compiler_flags_cmn "-k-no_order_inits" ${pascal_compiler_flags_cmn})
+        set(pascal_flags "-k-no_order_inits" ${pascal_flags})
     endif()
 
     if (APPLE)
@@ -89,7 +99,11 @@ if(BUILD_ENGINE_LIBRARY)
     endif (APPLE)
 endif(BUILD_ENGINE_LIBRARY)
 
-find_program(fpc_executable fpc)
+IF(FPC)
+    set(fpc_executable ${FPC})
+ELSE()
+    find_program(fpc_executable fpc)
+ENDIF()
 
 if(fpc_executable)
     exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output)
@@ -117,6 +131,26 @@ if(APPLE)
     if(powerpc_build)
         set(powerpc_build "powerpc")
     endif()
+
+    #on OSX we need to provide the SDL_main() function when building as executable
+    if(NOT BUILD_ENGINE_LIBRARY)
+        #let's look for the installed sdlmain file; if it is not found, let's build our own
+        find_package(SDL REQUIRED)
+        #remove the ";-framework Cocoa" from the SDL_LIBRARY variable
+        string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
+        #find libsdmain.a
+        find_file(SDLMAIN_LIB libSDLMain.a PATHS ${sdl_dir}/Resources/)
+
+        if(SDLMAIN_LIB MATCHES "SDLMAIN_LIB-NOTFOUND")
+            include_directories(${SDL_INCLUDE_DIR})
+            add_library (SDLmain STATIC SDLMain.m)
+            #add a dependency to the hwengine target
+            set(engine_sources ${engine_sources} SDLmain)
+            set(SDLMAIN_LIB "${LIBRARY_OUTPUT_PATH}/libSDLmain.a")
+        endif()
+
+        set(pascal_flags "-k${SDLMAIN_LIB}" ${pascal_flags})
+    endif()
 endif(APPLE)
 
 
@@ -127,49 +161,86 @@ if(fpc_version)
     string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
     string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
     string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
-    message(STATUS "Freepascal version installed: ${fpc_vers_major}.${fpc_vers_minor}")
-    math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
+    message(STATUS "Found Freepascal: ${fpc_executable} (version ${fpc_vers_major}.${fpc_vers_minor})")
+    math(EXPR fpc_version "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
 
-    if(fpc_ver LESS "020200")
+    if(fpc_version LESS "020200")
         message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0")
-    elseif(APPLE AND x86_64_build AND (fpc_ver LESS "020400"))
-        message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications on Mac OS X")
+    elseif(APPLE AND (fpc_version LESS "020600"))
+        message(FATAL_ERROR "Minimum required version of FreePascal is 2.6.0 on Mac OS X")
     endif()
 else()
-    message(FATAL_ERROR "No Pascal compiler found!")
+    message(FATAL_ERROR "No FreePascal compiler found!")
 endif()
 
-set(pascal_compiler ${fpc_executable})
-set(pascal_compiler_flags ${noexecstack_flags} ${pascal_compiler_flags_cmn} ${hwengine_project})
-
 
 #DEPENDECIES AND EXECUTABLES SECTION
+if(NOT NOPNG)
+    find_package(PNG)
+    if(${PNG_FOUND})
+        set(pascal_flags "-dPNG_SCREENSHOTS" ${pascal_flags})
+        if(APPLE)  # fpc png unit doesn't pull the library (see bug 21833)
+            set(pascal_flags "-k${PNG_LIBRARY}" ${pascal_flags})
+        endif()
+    else()
+        message(STATUS "Screenshots will be in BMP format because libpng was not found")
+    endif()
+else()
+    message(STATUS "Screenshots will be in BMP format per user request")
+endif()
+
+
+
+#this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
+if(fpc_version LESS "020600")
+    add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars")
+endif()
+
+
+if(NOT NOVIDEOREC)
+    set(FFMPEG_FIND_QUIETLY true)
+    find_package(FFMPEG)
+    if(${FFMPEG_FOUND})
+        include_directories(${FFMPEG_INCLUDE_DIR})
+        set(pascal_flags "-dUSE_VIDEO_RECORDING" ${pascal_flags})
+        IF (WIN32)
+            # there are some problems with linking our avwrapper as static lib, so link it as shared
+            add_library(avwrapper SHARED avwrapper.c)
+            target_link_libraries(avwrapper ${FFMPEG_LIBRARIES})
+            install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}avwrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION ${target_dir})
+        ELSE()
+            add_library(avwrapper STATIC avwrapper.c)
+            set(pascal_flags "-k${FFMPEG_LIBAVCODEC}" "-k${FFMPEG_LIBAVFORMAT}" "-k${FFMPEG_LIBAVUTIL}" ${pascal_flags})
+        ENDIF()
+        if(fpc_version LESS "020600")
+            add_dependencies(avwrapper ENGINECLEAN)
+        endif()
+    else()
+        message(STATUS "Could NOT find FFMPEG/LibAV, video recording will be disabled")
+    endif()
+else()
+    message(STATUS "Video recording disabled by user")
+endif()
+
+set(fpc_flags ${noexecstack_flags} ${pascal_flags} ${hwengine_project})
+
 IF(NOT APPLE)
     #here is the command for standard executables or for shared library
     add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}"
-        COMMAND "${pascal_compiler}"
-        ARGS ${pascal_compiler_flags}
+        COMMAND "${fpc_executable}"
+        ARGS ${fpc_flags}
         MAIN_DEPENDENCY ${hwengine_project}
         DEPENDS ${engine_sources}
         )
 ELSE()
-    #let's build sdlmain, which is absent from the framework
-    find_package(SDL REQUIRED)
-
-    set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
-    include_directories(${SDL_INCLUDE_DIR})
-
-    add_library (SDLmain STATIC SDLMain.m)
-
-
     #these are the dependencies for building a universal binary on Mac OS X
     foreach (build_arch ${powerpc_build} ${i386_build} ${x86_64_build})
         set(lipo_args_list "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}" ${lipo_args_list})
         add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}"
-            COMMAND "${pascal_compiler}"
-            ARGS ${pascal_compiler_flags} -ohwengine.${build_arch} -P${build_arch}
+            COMMAND "${fpc_executable}"
+            ARGS ${fpc_flags} -ohwengine.${build_arch} -P${build_arch}
             MAIN_DEPENDENCY ${hwengine_project}
-            DEPENDS ${engine_sources} SDLmain lua
+            DEPENDS ${engine_sources}
             )
         add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}")
     endforeach()
@@ -183,10 +254,15 @@ ENDIF()
 
 
 add_custom_target(${engine_output_name} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}")
-IF(NOT APPLE)
-add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars")
-add_dependencies(${engine_output_name} ENGINECLEAN)
-ENDIF()
 
-install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
+#when system Lua is not found we need to compile it before engine
+if(NOT LUA_FOUND)
+    add_dependencies(${engine_output_name} lua)
+endif()
 
+#this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
+if((fpc_version LESS "020600") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND}))
+    add_dependencies(${engine_output_name} ENGINECLEAN)
+endif()
+
+install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
diff --git a/hedgewars/GL.h b/hedgewars/GL.h
new file mode 100644
index 0000000..6a18374
--- /dev/null
+++ b/hedgewars/GL.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#include <GL/gl.h>
diff --git a/hedgewars/GSHandlers.inc b/hedgewars/GSHandlers.inc
index cd29765..c915a40 100644
--- a/hedgewars/GSHandlers.inc
+++ b/hedgewars/GSHandlers.inc
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -53,6 +53,7 @@ begin
         sX:= dX / steps;
         sY:= dY / steps;
         end
+        
     else
         begin
         sX:= dX;
@@ -84,216 +85,83 @@ begin
         if (gi^.Kind = gtHedgehog) then
             begin
             d := r - hwRound(Distance(gi^.X - x, gi^.Y - y));
-            if (d > 1) and not gi^.Invulnerable and (GetRandom(2) = 0) then
+            if (d > 1) and (not gi^.Invulnerable) and (GetRandom(2) = 0) then
                 begin
                 if (CurrentHedgehog^.Gear = gi) then
-                    PlaySound(sndOops, gi^.Hedgehog^.Team^.voicepack)
+                    PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack)
+                    
                 else
                     begin
                     if (gi^.State and gstMoving) = 0 then
+                        begin
+                        gi^.dX.isNegative:= X<gi^.X;
                         gi^.State := gi^.State or gstLoser;
+                        end;
+                        
                     if d > r div 2 then
-                        PlaySound(sndNooo, gi^.Hedgehog^.Team^.voicepack)
+                        PlaySoundV(sndNooo, gi^.Hedgehog^.Team^.voicepack) 
                     else
-                        PlaySound(sndUhOh, gi^.Hedgehog^.Team^.voicepack);
+                        PlaySoundV(sndUhOh, gi^.Hedgehog^.Team^.voicepack);
                     end;
                 end;
             end;
+            
         gi := gi^.NextGear
         end;
 end;
 
 procedure HideHog(HH: PHedgehog);
 begin
-ScriptCall('onHogHide', HH^.Gear^.Uid);
-DeleteCI(HH^.Gear);
-if FollowGear = HH^.Gear then FollowGear:= nil;
-if lastGearByUID = HH^.Gear then lastGearByUID := nil;
-RemoveGearFromList(HH^.Gear);
-with HH^.Gear^ do
-    begin
-    Z := cHHZ;
-    Active := false;
-    State:= State and not (gstHHDriven or gstAttacking or gstAttacked);
-    Message := Message and not gmAttack;
+    ScriptCall('onHogHide', HH^.Gear^.Uid);
+    DeleteCI(HH^.Gear);
+    if FollowGear = HH^.Gear then
+        FollowGear:= nil;
+        
+    if lastGearByUID = HH^.Gear then
+        lastGearByUID := nil;
+    
+    HH^.Gear^.Message:= HH^.Gear^.Message or gmRemoveFromList;
+    with HH^.Gear^ do
+        begin
+        Z := cHHZ;
+        HH^.Gear^.Active:= false;
+        State:= State and (not (gstHHDriven or gstAttacking or gstAttacked));
+        Message := Message and (not gmAttack);
     end;
-HH^.GearHidden:= HH^.Gear;
-HH^.Gear:= nil
+    HH^.GearHidden:= HH^.Gear;
+    HH^.Gear:= nil
 end;
 
 procedure RestoreHog(HH: PHedgehog);
 begin
-HH^.Gear:=HH^.GearHidden;
-HH^.GearHidden:= nil;
-InsertGearToList(HH^.Gear);
-HH^.Gear^.State:= (HH^.Gear^.State and not (gstHHDriven or gstInvisible or gstAttacking)) or gstAttacked;
-AddGearCI(HH^.Gear);
-HH^.Gear^.Active:= true;
-ScriptCall('onHogRestore', HH^.Gear^.Uid)
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepDrowningGear(Gear: PGear);
-forward;
-
-function CheckGearDrowning(Gear: PGear): boolean;
-var 
-    skipSpeed, skipAngle, skipDecay: hwFloat;
-    i, maxDrops, X, Y: LongInt;
-    vdX, vdY: real;
-    particle: PVisualGear;
-    isSubmersible: boolean;
-begin
-    isSubmersible:= (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack);
-    // probably needs tweaking. might need to be in a case statement based upon gear type
-    Y:= hwRound(Gear^.Y);
-    if cWaterLine < Y + Gear^.Radius then
-        begin
-        skipSpeed := _0_25;
-        skipAngle := _1_9;
-        skipDecay := _0_87;
-        X:= hwRound(Gear^.X);
-        vdX:= hwFloat2Float(Gear^.dX);
-        vdY:= hwFloat2Float(Gear^.dY);
-        // this could perhaps be a tiny bit higher.
-        if  (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) and
-           (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then
-            begin
-            Gear^.dY.isNegative := true;
-            Gear^.dY := Gear^.dY * skipDecay;
-            Gear^.dX := Gear^.dX * skipDecay;
-            CheckGearDrowning := false;
-            PlaySound(sndSkip)
-            end
-        else
-            begin
-            if not isSubmersible then
-                begin
-                CheckGearDrowning := true;
-                Gear^.State := gstDrowning;
-                Gear^.RenderTimer := false;
-                if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot) and 
-                   (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then
-                    if Gear^.Kind = gtHedgehog then
-                        begin
-                        if Gear^.Hedgehog^.Effects[heResurrectable] then
-                            ResurrectHedgehog(Gear)
-                        else
-                            begin
-                            Gear^.doStep := @doStepDrowningGear;
-                            Gear^.State := Gear^.State and (not gstHHDriven);
-                            AddCaption(Format(GetEventString(eidDrowned), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
-                            end
-                        end
-                    else Gear^.doStep := @doStepDrowningGear;
-                    if Gear^.Kind = gtFlake then exit // skip splashes 
-                end;
-            if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius)) or
-               (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01))) then
-                // don't play splash if they are already way past the surface
-                PlaySound(sndSplash)
-            end;
-
-        if ((cReducedQuality and rqPlainSplash) = 0) and 
-           (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius)) or
-             (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0) and (CurAmmoGear^.dY < _0_01)))) then
-            begin
-            AddVisualGear(X, cWaterLine, vgtSplash);
-
-            maxDrops := (Gear^.Radius div 2) + round(vdX * Gear^.Radius * 2) + round(vdY * Gear^.Radius * 2);
-            for i:= max(maxDrops div 3, min(32, Random(maxDrops))) downto 0 do
-                begin
-                particle := AddVisualGear(X - 3 + Random(6), cWaterLine, vgtDroplet);
-                if particle <> nil then
-                    begin
-                    particle^.dX := particle^.dX - vdX / 10;
-                    particle^.dY := particle^.dY - vdY / 5;
-                    end
-                end
-            end;
-        if isSubmersible and (CurAmmoGear^.Pos = 0) then CurAmmoGear^.Pos := 1000
-        end
-    else
-        CheckGearDrowning := false;
-end;
-
-procedure CheckCollision(Gear: PGear); inline;
-begin
-    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) or (TestCollisionYwithGear(Gear, hwSign(Gear^.dY)) <> 0) then
-        Gear^.State := Gear^.State or gstCollision
-    else Gear^.State := Gear^.State and not gstCollision
-end;
-
-procedure CheckCollisionWithLand(Gear: PGear); inline;
-begin
-    if TestCollisionX(Gear, hwSign(Gear^.dX)) or TestCollisionY(Gear, hwSign(Gear^.dY)
-       )
-        then Gear^.State := Gear^.State or      gstCollision
-    else Gear^.State := Gear^.State and not gstCollision
-end;
-
-procedure CheckHHDamage(Gear: PGear);
-var 
-    dmg: Longword;
-    i: LongInt;
-    particle: PVisualGear;
-begin
-    if _0_4 < Gear^.dY then
-        begin
-        dmg := ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear);
-        PlaySound(sndBump);
-        if dmg < 1 then exit;
-
-        for i:= min(12, (3 + dmg div 10)) downto 0 do
-            begin
-            particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
-            if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480);
-            end;
-
-        if (Gear^.Invulnerable) then exit;
-
-        //if _0_6 < Gear^.dY then
-        //    PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack)
-        //else
-        //    PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack);
-
-        if Gear^.LastDamage <> nil then
-            ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall)
-            else
-            ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall);
-    end
+    HH^.Gear:=HH^.GearHidden;
+    HH^.GearHidden:= nil;
+    InsertGearToList(HH^.Gear);
+    HH^.Gear^.State:= (HH^.Gear^.State and (not (gstHHDriven or gstInvisible or gstAttacking))) or gstAttacked;
+    AddGearCI(HH^.Gear);
+    HH^.Gear^.Active:= true;
+    ScriptCall('onHogRestore', HH^.Gear^.Uid)
 end;
 
-////////////////////////////////////////////////////////////////////////////////
-procedure CalcRotationDirAngle(Gear: PGear);
-var 
-    dAngle: real;
-begin
-    dAngle := (Gear^.dX.QWordValue + Gear^.dY.QWordValue) / $80000000;
-    if not Gear^.dX.isNegative then
-        Gear^.DirAngle := Gear^.DirAngle + dAngle
-    else
-        Gear^.DirAngle := Gear^.DirAngle - dAngle;
-
-    if Gear^.DirAngle < 0 then Gear^.DirAngle := Gear^.DirAngle + 360
-    else if 360 < Gear^.DirAngle then Gear^.DirAngle := Gear^.DirAngle - 360
-end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepDrowningGear(Gear: PGear);
-begin
+    begin
     AllInactive := false;
     Gear^.Y := Gear^.Y + cDrownSpeed;
     Gear^.X := Gear^.X + Gear^.dX * cDrownSpeed;
     // Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
-    if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cSDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then
+    if ((not SuddenDeathDmg and (WaterOpacity < $FF))
+    or (SuddenDeathDmg and (SDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then
         if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then
             AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble)
     else if Random(12) = 0 then
              AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble);
-    if (not SuddenDeathDmg and (cWaterOpacity > $FE)) or (SuddenDeathDmg and (cSDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
+    if (not SuddenDeathDmg and (WaterOpacity > $FE))
+    or (SuddenDeathDmg and (SDWaterOpacity > $FE))
+    or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
         DeleteGear(Gear);
-end;
+    end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepFallingGear(Gear: PGear);
@@ -304,10 +172,25 @@ var
     collV, collH: LongInt;
     land: word;
 begin
-    // clip velocity at 1.9 - over 1 per pixel, but really shouldn't cause many actual problems.
-    if Gear^.dX.QWordValue > 8160437862 then Gear^.dX.QWordValue:= 8160437862;
-    if Gear^.dY.QWordValue > 8160437862 then Gear^.dY.QWordValue:= 8160437862;
-    Gear^.State := Gear^.State and not gstCollision;
+    // clip velocity at 2 - over 1 per pixel, but really shouldn't cause many actual problems.
+{$IFNDEF WEB}
+    if Gear^.dX.Round > 2 then
+        Gear^.dX.QWordValue:= 8589934592;
+    if Gear^.dY.Round > 2 then
+        Gear^.dY.QWordValue:= 8589934592;
+{$ELSE}
+    if Gear^.dX.Round > 2 then
+        begin
+        Gear^.dX.Round:= 2;
+        Gear^.dX.Frac:= 0
+        end;
+    if Gear^.dY.QWordValue > 2 then
+        begin
+        Gear^.dY.Round:= 2;
+        Gear^.dY.Frac:= 0
+        end;
+{$ENDIF}
+    Gear^.State := Gear^.State and (not gstCollision);
     collV := 0;
     collH := 0;
     tdX := Gear^.dX;
@@ -315,7 +198,9 @@ begin
 
 
 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips)
-    if (hwRound(Gear^.X) < LAND_WIDTH div -2) or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then Gear^.State := Gear^.State or gstCollision;
+    if (hwRound(Gear^.X) < min(LAND_WIDTH div -2, -2048))
+    or (hwRound(Gear^.X) > max(LAND_WIDTH * 3 div 2, 6144)) then
+        Gear^.State := Gear^.State or gstCollision;
 
     if Gear^.dY.isNegative then
         begin
@@ -324,23 +209,28 @@ begin
         if land <> 0 then
             begin
             collV := -1;
-            if land and lfIce <> 0 then Gear^.dX := Gear^.dX * (_1 - (_1 - Gear^.Friction) / _10)
-            else Gear^.dX := Gear^.dX * Gear^.Friction;
+            if land and lfIce <> 0 then
+                Gear^.dX := Gear^.dX * (_0_9 + Gear^.Friction * _0_1)
+            else
+                Gear^.dX := Gear^.dX * Gear^.Friction;
 
             Gear^.dY := - Gear^.dY * Gear^.Elasticity;
             Gear^.State := Gear^.State or gstCollision
             end
-        else if (Gear^.AdvBounce=1) and (TestCollisionYwithGear(Gear, 1) <> 0) then collV := 1;
+        else if (Gear^.AdvBounce=1) and (TestCollisionYwithGear(Gear, 1) <> 0) then
+            collV := 1;
         end
     else 
-        begin
+        begin // Gear^.dY.isNegative is false
         land:= TestCollisionYwithGear(Gear, 1);
         if land <> 0 then
             begin
             collV := 1;
             isFalling := false;
-            if land and lfIce <> 0 then Gear^.dX := Gear^.dX * (_1 - (_1 - Gear^.Friction) / _10)
-            else Gear^.dX := Gear^.dX * Gear^.Friction;
+            if land and lfIce <> 0 then 
+                Gear^.dX := Gear^.dX * (_0_9 + Gear^.Friction * _0_1)
+            else 
+                Gear^.dX := Gear^.dX * Gear^.Friction;
 
             Gear^.dY := - Gear^.dY * Gear^.Elasticity;
             Gear^.State := Gear^.State or gstCollision
@@ -348,7 +238,7 @@ begin
         else
             begin
             isFalling := true;
-            if (Gear^.AdvBounce=1) and not Gear^.dY.isNegative and (TestCollisionYwithGear(Gear, -1) <> 0) then
+            if (Gear^.AdvBounce=1) and (TestCollisionYwithGear(Gear, -1) <> 0) then
                 collV := -1
             end
         end;
@@ -364,8 +254,8 @@ begin
     else if (Gear^.AdvBounce=1) and TestCollisionXwithGear(Gear, -hwSign(Gear^.dX)) then
         collH := -hwSign(Gear^.dX); 
     //if Gear^.AdvBounce and (collV <>0) and (collH <> 0) and (hwSqr(tdX) + hwSqr(tdY) > _0_08) then
-    if (Gear^.AdvBounce=1) and (collV <>0) and (collH <> 0) and ((collV=-1) or ((tdX.QWordValue +
-       tdY.QWordValue) > _0_2.QWordValue)) then
+    if (Gear^.AdvBounce=1) and (collV <>0) and (collH <> 0) and ((collV=-1)
+    or ((tdX.QWordValue + tdY.QWordValue) > _0_2.QWordValue)) then
         begin
         Gear^.dX := tdY*Gear^.Elasticity*Gear^.Friction;
         Gear^.dY := tdX*Gear^.Elasticity;
@@ -375,31 +265,32 @@ begin
         Gear^.AdvBounce := 10;
         end;
 
-    if Gear^.AdvBounce > 1 then dec(Gear^.AdvBounce);
+    if Gear^.AdvBounce > 1 then
+        dec(Gear^.AdvBounce);
 
     if isFalling then
         begin
         Gear^.dY := Gear^.dY + cGravity;
-        if (GameFlags and gfMoreWind) <> 0 then Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
-        end;
+        if (GameFlags and gfMoreWind) <> 0 then
+            Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
+            end;
 
     Gear^.X := Gear^.X + Gear^.dX;
     Gear^.Y := Gear^.Y + Gear^.dY;
     if Gear^.Kind <> gtBee then
         CheckGearDrowning(Gear);
     //if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) < _0_0002) and
-    if ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_02.QWordValue) and
-       (not isFalling) then
-        Gear^.State := Gear^.State and not gstMoving
+    if (not isFalling) and ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_02.QWordValue) then
+        Gear^.State := Gear^.State and (not gstMoving)
     else
-        Gear^.State := Gear^.State or      gstMoving;
+        Gear^.State := Gear^.State or gstMoving;
 
     if (Gear^.nImpactSounds > 0) and 
-       (((Gear^.Kind <> gtMine) and (Gear^.Damage <> 0)) or 
-          ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
-       (((Gear^.Radius < 3) and (Gear^.dY < -_0_1)) or
-        ((Gear^.Radius >= 3) and ((Gear^.dX.QWordValue > _0_1.QWordValue) or 
-          (Gear^.dY.QWordValue > _0_1.QWordValue)))) then
+        (Gear^.State and gstCollision <> 0) and
+        (((Gear^.Kind <> gtMine) and (Gear^.Damage <> 0)) or (Gear^.State and gstMoving <> 0)) and
+        (((Gear^.Radius < 3) and (Gear^.dY < -_0_1)) or
+            ((Gear^.Radius >= 3) and 
+                ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)))) then
         PlaySound(TSound(ord(Gear^.ImpactSound) + LongInt(GetRandom(Gear^.nImpactSounds))), true);
 end;
 
@@ -425,35 +316,35 @@ begin
         end;
 
     if (Gear^.Kind = gtBall) and ((Gear^.State and gstTmpFlag) <> 0) then
-    begin
+        begin
         CheckCollision(Gear);
         if (Gear^.State and gstCollision) <> 0 then
             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLDontDraw or EXPLNoGfx);
-    end;
+        end;
 
     if (Gear^.Kind = gtGasBomb) and ((GameTicks mod 200) = 0) then
-    begin
+        begin
         vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite);
         if vg <> nil then
             vg^.Tint:= $FFC0C000;
-    end;
+        end;
 
     if Gear^.Timer = 0 then
-    begin
+        begin
         case Gear^.Kind of 
             gtGrenade: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
             gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, Gear^.Hedgehog, EXPLAutoSound);
             gtClusterBomb: 
                 begin
-                    x := hwRound(Gear^.X);
-                    y := hwRound(Gear^.Y);
-                    doMakeExplosion(x, y, 20, Gear^.Hedgehog, EXPLAutoSound);
-                    for i:= 0 to 4 do
-                        begin
-                        dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5;
-                        dY := (GetRandom - _3) * _0_08;
-                        FollowGear := AddGear(x, y, gtCluster, 0, dX, dY, 25)
-                        end
+                x := hwRound(Gear^.X);
+                y := hwRound(Gear^.Y);
+                doMakeExplosion(x, y, 20, Gear^.Hedgehog, EXPLAutoSound);
+                for i:= 0 to 4 do
+                    begin
+                    dX := rndSign(GetRandomf * _0_1) + Gear^.dX / 5;
+                    dY := (GetRandomf - _3) * _0_08;
+                    FollowGear := AddGear(x, y, gtCluster, 0, dX, dY, 25)
+                    end
                 end;
             gtWatermelon: 
                 begin
@@ -462,8 +353,8 @@ begin
                 doMakeExplosion(x, y, 75, Gear^.Hedgehog, EXPLAutoSound);
                 for i:= 0 to 5 do
                     begin
-                    dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5;
-                    dY := (GetRandom - _1_5) * _0_3;
+                    dX := rndSign(GetRandomf * _0_1) + Gear^.dX / 5;
+                    dY := (GetRandomf - _1_5) * _0_3;
                     FollowGear:= AddGear(x, y, gtMelonPiece, 0, dX, dY, 75);
                     FollowGear^.DirAngle := i * 60
                     end
@@ -476,8 +367,8 @@ begin
 
                 for i:= 0 to 127 do
                     begin
-                    dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1);
-                    dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1);
+                    dX := AngleCos(i * 16) * _0_5 * (GetRandomf + _1);
+                    dY := AngleSin(i * 16) * _0_5 * (GetRandomf + _1);
                     if i mod 2 = 0 then
                         begin
                         AddGear(x, y, gtFlame, gstTmpFlag, dX, dY, 0);
@@ -500,32 +391,32 @@ begin
                     FollowGear:= AddGear(hwRound(Gear^.X) - 30 + x, hwRound(Gear^.Y) - 20 + y, gtPoisonCloud, 0, _0, _0, 0);
                     end
                 end;
+            end;
+        DeleteGear(Gear);
+        exit
         end;
-    DeleteGear(Gear);
-    exit
-end;
 
-CalcRotationDirAngle(Gear);
+    CalcRotationDirAngle(Gear);
 
-if Gear^.Kind = gtHellishBomb then
-begin
+    if Gear^.Kind = gtHellishBomb then
+        begin
 
-    if Gear^.Timer = 3000 then
-    begin
-        Gear^.nImpactSounds := 0;
-        PlaySound(sndHellish);
-    end;
+        if Gear^.Timer = 3000 then
+            begin
+            Gear^.nImpactSounds := 0;
+            PlaySound(sndHellish);
+            end;
 
-    if (GameTicks and $3F) = 0 then
-        if (Gear^.State and gstCollision) = 0 then
-            AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEvilTrace);
-end;
+        if (GameTicks and $3F) = 0 then
+            if (Gear^.State and gstCollision) = 0 then
+                AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEvilTrace);
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepMolotov(Gear: PGear);
 var 
-	s: Longword;
+    s: Longword;
     i, gX, gY: LongInt;
     dX, dY: hwFloat;
     smoke, glass: PVisualGear;
@@ -540,13 +431,18 @@ begin
     if (GameTicks mod s) = 0 then
         begin
         // adjust angle to match the texture
-        if Gear^.dX.isNegative then i:= 130 else i:= 50;
+        if Gear^.dX.isNegative then
+            i:= 130
+        else
+            i:= 50;
+            
         smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+i) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+i) * pi / 180)*20), vgtSmoke);
-        if smoke <> nil then smoke^.Scale:= 0.75;
+        if smoke <> nil then
+            smoke^.Scale:= 0.75;
         end;
 
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         PlaySound(sndMolotov);
         gX := hwRound(Gear^.X);
         gY := hwRound(Gear^.Y);
@@ -566,18 +462,19 @@ begin
                     begin
                     Frame:= 2;
                     Tint:= $41B83ED0 - i * $10081000;
-                    Angle:= random * 360;
+                    Angle:= random(360);
                     dx:= 0.0000001;
                     dy:= 0;
-                    if random(2) = 0 then dx := -dx;
+                    if random(2) = 0 then
+                        dx := -dx;
                     FrameTicks:= 750;
                     State:= ord(sprEgg)
                     end;
             end;
         for i:= 0 to 24 do
             begin
-            dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1);
-            dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
+            dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandomf + _1);
+            dY := AngleSin(i * 8) * _0_5 * (GetRandomf + _1);
             AddGear(gX, gY, gtFlame, gstTmpFlag, dX, dY, 0);
             AddGear(gX, gY, gtFlame, gstTmpFlag, dX,-dY, 0);
             AddGear(gX, gY, gtFlame, gstTmpFlag,-dX, dY, 0);
@@ -585,7 +482,7 @@ begin
             end;
         DeleteGear(Gear);
         exit
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -595,13 +492,14 @@ begin
     AllInactive := false;
     doStepFallingGear(Gear);
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Timer, Gear^.Hedgehog, EXPLAutoSound);
         DeleteGear(Gear);
         exit
     end;
 
-    if (Gear^.Kind = gtMelonPiece) or (Gear^.Kind = gtBall) then
+    if (Gear^.Kind = gtMelonPiece)
+    or (Gear^.Kind = gtBall) then
         CalcRotationDirAngle(Gear)
     else if (GameTicks and $1F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
@@ -611,7 +509,8 @@ end;
 procedure doStepShell(Gear: PGear);
 begin
     AllInactive := false;
-    if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed;
+    if (GameFlags and gfMoreWind) = 0 then
+        Gear^.dX := Gear^.dX + cWindSpeed;
     doStepFallingGear(Gear);
     if (Gear^.State and gstCollision) <> 0 then
         begin
@@ -629,7 +528,8 @@ var kick, i: LongInt;
     particle: PVisualGear;
 begin
     AllInactive := false;
-    if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed;
+    if (GameFlags and gfMoreWind) = 0 then
+        Gear^.dX := Gear^.dX + cWindSpeed;
     doStepFallingGear(Gear);
     CalcRotationDirAngle(Gear);
     if (Gear^.State and gstCollision) <> 0 then
@@ -637,11 +537,12 @@ begin
         kick:= hwRound((hwAbs(Gear^.dX)+hwAbs(Gear^.dY)) * _20);
         Gear^.dY.isNegative:= not Gear^.dY.isNegative;
         Gear^.dX.isNegative:= not Gear^.dX.isNegative;
-        AmmoShove(Gear, 1, kick);
+        AmmoShove(Gear, 0, kick);
         for i:= 15 + kick div 10 downto 0 do
             begin
             particle := AddVisualGear(hwRound(Gear^.X) + Random(25), hwRound(Gear^.Y) + Random(25), vgtDust);
-            if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
+            if particle <> nil then
+                particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
             end;
         DeleteGear(Gear);
         exit
@@ -649,13 +550,14 @@ begin
     if ((GameTicks and $1F) = 0) and (Random(3) = 0) then
         begin
         particle:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust);
-        if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
+        if particle <> nil then
+            particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
         end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSnowflake(Gear: PGear);
-var xx, yy, px, py: LongInt;
+var xx, yy, px, py, rx, ry, lx, ly: LongInt;
     move, draw, allpx, gun: Boolean;
     s: PSDL_Surface;
     p: PLongwordArray;
@@ -667,10 +569,11 @@ move:= false;
 draw:= false;
 if gun then
     begin
-    Gear^.State:= Gear^.State and not gstInvisible;
+    Gear^.State:= Gear^.State and (not gstInvisible);
     doStepFallingGear(Gear);
     CheckCollision(Gear);
-    if ((Gear^.State and gstCollision) <> 0) or ((Gear^.State and gstMoving) = 0) then draw:= true;
+    if ((Gear^.State and gstCollision) <> 0) or ((Gear^.State and gstMoving) = 0) then
+        draw:= true;
     xx:= hwRound(Gear^.X);
     yy:= hwRound(Gear^.Y);
     end
@@ -678,32 +581,39 @@ else if GameTicks and $7 = 0 then
     begin
     with Gear^ do
         begin
-        State:= State and not gstInvisible;
+        State:= State and (not gstInvisible);
         X:= X + cWindSpeed * 3200 + dX;
         Y:= Y + dY + cGravity * vobFallSpeed * 8;  // using same value as flakes to try and get similar results
         xx:= hwRound(X);
         yy:= hwRound(Y);
         if vobVelocity <> 0 then
             begin
-            DirAngle := DirAngle + (Angle / 1250000000);
-            if DirAngle < 0 then DirAngle := DirAngle + 360
-            else if 360 < DirAngle then DirAngle := DirAngle - 360;
+            DirAngle := DirAngle + (Damage / 1000);
+            if DirAngle < 0 then
+                DirAngle := DirAngle + 360
+            else if 360 < DirAngle then
+                DirAngle := DirAngle - 360;
             end;
-
+(*
+We aren't using frametick right now, so just a waste of cycles.
         inc(Health, 8);
         if longword(Health) > vobFrameTicks then
             begin
             dec(Health, vobFrameTicks);
             inc(Timer);
-            if Timer = vobFramesCount then Timer:= 0
+            if Timer = vobFramesCount then
+                Timer:= 0
             end;
+*)
     // move back to cloud layer
-        if yy > cWaterLine then move:= true
-        else if ((yy and LAND_HEIGHT_MASK) <> 0) or (xx > LAND_WIDTH + 512) or (xx < -512) then move:=true
+        if yy > cWaterLine then
+            move:= true
+        else if (xx > snowRight) or (xx < snowLeft) then
+            move:=true
         // Solid pixel encountered
-        else if ((xx and LAND_WIDTH_MASK) = 0) and (Land[yy, xx] <> 0) then
+        else if ((yy and LAND_HEIGHT_MASK) = 0) and ((xx and LAND_WIDTH_MASK) = 0) and (Land[yy, xx] <> 0) then
             begin
-            lf:= Land[yy, xx] and (lfObject or lfBasic);
+            lf:= Land[yy, xx] and (lfObject or lfBasic or lfIndestructible);
             // If there's room below keep falling
             if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (Land[yy-1, xx] = 0) then
                 begin
@@ -742,7 +652,8 @@ if draw then
         begin
         // we've collided with land. draw some stuff and get back into the clouds
         move:= true;
-        if (Pos > 20) and ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtRope)) then
+        if (Pos > 20) and ((CurAmmoGear = nil)
+        or (CurAmmoGear^.Kind <> gtRope)) then
             begin
 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
             if not gun then
@@ -756,43 +667,46 @@ if draw then
             for py:= 0 to Pred(s^.h) do
                 begin
                 for px:= 0 to Pred(s^.w) do
-                    if ((((yy + py) and LAND_HEIGHT_MASK) = 0) and (((xx + px) and LAND_WIDTH_MASK) = 0)) and ((Land[yy + py, xx + px] and $FF) = 0) then
+                    begin
+                    lx:=xx + px; ly:=yy + py;
+                    if (ly and LAND_HEIGHT_MASK = 0) and (lx and LAND_WIDTH_MASK = 0) and (Land[ly, lx] and $FF = 0) then
                         begin
-                        if gun then
-                            begin
-                            // try to avoid speckles. might need disabling
-                            LandDirty[yy div 32, xx div 32]:= 1;
-                            Land[yy + py, xx + px]:= (Land[yy + py, xx + px] or lfDamaged or lfObject) and not lfBasic;
-                            end
-                        else if Land[yy + py, xx + px] and $FF00 = 0 then Land[yy + py, xx + px]:= lf;
-                        if (cReducedQuality and rqBlurryLand) = 0 then
-                            begin
-                            if gun then
-                                LandPixels[yy + py, xx + px]:= (cExplosionBorderColor and not AMask) or (p^[px] and AMask)
-                            else LandPixels[yy + py, xx + px]:= addBgColor(LandPixels[yy + py, xx + px], p^[px]);
-                            end
-                        else
+                        rx:= lx;
+                        ry:= ly;
+                        if cReducedQuality and rqBlurryLand <> 0 then
                             begin
-                            if gun then
-                                LandPixels[(yy + py) div 2, (xx + px) div 2]:= (cExplosionBorderColor and not AMask) or (p^[px] and AMask)
-                            else LandPixels[(yy + py) div 2, (xx + px) div 2]:= addBgColor(LandPixels[(yy + py) div 2, (xx + px) div 2], p^[px]);
+                            rx:= rx div 2;ry:= ry div 2;
                             end;
+                        if Land[yy + py, xx + px] and $FF00 = 0 then
+                            if gun then
+                                begin
+                                LandDirty[yy div 32, xx div 32]:= 1;
+                                if LandPixels[ry, rx] = 0 then
+                                    Land[ly, lx]:=  lfDamaged or lfObject
+                                else Land[ly, lx]:=  lfDamaged or lfBasic
+                                end
+                            else Land[ly, lx]:= lf;
+                        if gun then
+                            LandPixels[ry, rx]:= (ExplosionBorderColor and (not AMask)) or (p^[px] and AMask)
+                        else LandPixels[ry, rx]:= addBgColor(LandPixels[ry, rx], p^[px]);
                         end
-                    else allpx:= false;
+                    else allpx:= false
+                    end;
                 p:= @(p^[s^.pitch shr 2])
                 end;
             
+            // Why is this here.  For one thing, there's no test on +1 being safe. 
+            //Land[py, px+1]:= lfBasic;
             
-            Land[py, px+1]:= lfBasic;
-            
-            if allpx then UpdateLandTexture(xx, Pred(s^.h), yy, Pred(s^.w))
+            if allpx then
+                UpdateLandTexture(xx, Pred(s^.h), yy, Pred(s^.w), true)
             else
                 begin
                 UpdateLandTexture(
                     max(0, min(LAND_WIDTH, xx)),
                     min(LAND_WIDTH - xx, Pred(s^.w)),
                     max(0, min(LAND_WIDTH, yy)),
-                    min(LAND_HEIGHT - yy, Pred(s^.h))
+                    min(LAND_HEIGHT - yy, Pred(s^.h)), false // could this be true without unnecessarily creating blanks?
                 );
                 end;
 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
@@ -807,8 +721,8 @@ if move then
         exit
         end;
     Gear^.Pos:= 0;
-    Gear^.X:= int2hwFloat(GetRandom(LAND_WIDTH+1024)-512);
-    Gear^.Y:= int2hwFloat(750+(GetRandom(50)-25));
+    Gear^.X:= int2hwFloat(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft);
+    Gear^.Y:= int2hwFloat(LongInt(LAND_HEIGHT + GetRandom(50)) - 1325);
     Gear^.State:= Gear^.State or gstInvisible;
     end
 end;
@@ -816,9 +730,17 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepGrave(Gear: PGear);
 begin
+    if (Gear^.Message and gmDestroy) <> 0 then
+        begin
+        DeleteGear(Gear);
+        exit
+        end;
+
     AllInactive := false;
+
     if Gear^.dY.isNegative then
-        if TestCollisionY(Gear, -1) then Gear^.dY := _0;
+        if TestCollisionY(Gear, -1) then
+            Gear^.dY := _0;
 
     if not Gear^.dY.isNegative then
         if TestCollisionY(Gear, 1) then
@@ -829,7 +751,8 @@ begin
                 Gear^.Active := false;
                 exit
             end
-            else if Gear^.dY < - _0_03 then PlaySound(Gear^.ImpactSound)
+            else if Gear^.dY < - _0_03 then
+                PlaySound(Gear^.ImpactSound)
         end;
 
     Gear^.Y := Gear^.Y + Gear^.dY;
@@ -854,32 +777,32 @@ begin
 
     // if water entered or left
     if nuw <> uw then
-    begin
+        begin
         AddVisualGear(gX, cWaterLine, vgtSplash);
         AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet);
         AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet);
         AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet);
         AddVisualGear(gX - 3 + Random(6), cWaterLine, vgtDroplet);
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         if nuw then
-        begin
+            begin
             Gear^.SoundChannel := LoopSound(sndBeeWater);
             Gear^.Tag := 1;
         end
         else
-        begin
+            begin
             Gear^.SoundChannel := LoopSound(sndBee);
             Gear^.Tag := 0;
+            end;
         end;
-    end;
 
 
     if Gear^.Timer = 0 then
         Gear^.RenderTimer:= false
     else
-    begin
-        if (GameTicks and $F) = 0 then
         begin
+        if (GameTicks and $F) = 0 then
+            begin
             if (GameTicks and $30) = 0 then
                 AddVisualGear(gX, gY, vgtBeeTrace);
             Gear^.dX := Gear^.Elasticity * (Gear^.dX + _0_000064 * (Gear^.Target.X - gX));
@@ -888,18 +811,18 @@ begin
             t := Gear^.Friction / Distance(Gear^.dX, Gear^.dY);
             Gear^.dX := Gear^.dX * t;
             Gear^.dY := Gear^.dY * t;
-        end;
+            end;
 
         Gear^.X := Gear^.X + Gear^.dX;
         Gear^.Y := Gear^.Y + Gear^.dY;
 
-    end;
+        end;
 
 
     CheckCollision(Gear);
     if ((Gear^.State and gstCollision) <> 0) then
-    begin
-        StopSound(Gear^.SoundChannel);
+        begin
+        StopSoundChan(Gear^.SoundChannel);
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
         for i:= 0 to 31 do
             begin
@@ -910,8 +833,10 @@ begin
                     Scale:= 0.75;
                     dx:= 0.001 * (random(200));
                     dy:= 0.001 * (random(200));
-                    if random(2) = 0 then dx := -dx;
-                    if random(2) = 0 then dy := -dy;
+                    if random(2) = 0 then
+                        dx := -dx;
+                    if random(2) = 0 then
+                        dy := -dy;
                     FrameTicks:= random(250) + 250;
                     State:= ord(sprTargetBee);
                     end;
@@ -922,15 +847,15 @@ begin
     if (Gear^.Timer > 0) then
         dec(Gear^.Timer)
     else
-    begin
-        if nuw then
         begin
-            StopSound(Gear^.SoundChannel);
+        if nuw then
+           begin
+            StopSoundChan(Gear^.SoundChannel);
             CheckGearDrowning(Gear);
-        end
+            end
         else
             doStepFallingGear(Gear);
-    end;
+        end;
 end;
 
 procedure doStepBee(Gear: PGear);
@@ -941,16 +866,16 @@ begin
     Gear^.dY := Gear^.dY + cGravity;
     CheckCollision(Gear);
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
         DeleteGear(Gear);
         exit
     end;
     dec(Gear^.Timer);
     if Gear^.Timer = 0 then
-    begin
-        Gear^.Hedgehog^.Gear^.Message:= Gear^.Hedgehog^.Gear^.Message and not gmAttack;
-        Gear^.Hedgehog^.Gear^.State:= Gear^.Hedgehog^.Gear^.State and not gstAttacking;
+        begin
+        Gear^.Hedgehog^.Gear^.Message:= Gear^.Hedgehog^.Gear^.Message and (not gmAttack);
+        Gear^.Hedgehog^.Gear^.State:= Gear^.Hedgehog^.Gear^.State and (not gstAttacking);
         AttackBar:= 0;
         
         Gear^.SoundChannel := LoopSound(sndBee);
@@ -958,7 +883,7 @@ begin
         // save initial speed in otherwise unused Friction variable
         Gear^.Friction := Distance(Gear^.dX, Gear^.dY);
         Gear^.doStep := @doStepBeeWork
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -967,10 +892,10 @@ begin
     AllInactive := false;
     inc(Gear^.Timer);
     if Gear^.Timer > 75 then
-    begin
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end
+        end
 end;
 
 procedure doStepShotgunShot(Gear: PGear);
@@ -981,48 +906,54 @@ begin
     AllInactive := false;
 
     if ((Gear^.State and gstAnimation) = 0) then
-    begin
+        begin
         dec(Gear^.Timer);
         if Gear^.Timer = 0 then
-        begin
+            begin
             PlaySound(sndShotgunFire);
             shell := AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
             if shell <> nil then
-            begin
+                begin
                 shell^.dX := gear^.dX.QWordValue / -17179869184;
                 shell^.dY := gear^.dY.QWordValue / -17179869184;
                 shell^.Frame := 0
-            end;
+                end;
             Gear^.State := Gear^.State or gstAnimation
-        end;
-        exit
-    end
-    else inc(Gear^.Timer);
+            end;
+            exit
+        end else
+        if(Gear^.Hedgehog^.Gear = nil) or ((Gear^.Hedgehog^.Gear^.State and gstMoving) <> 0) then
+            begin
+            DeleteGear(Gear);
+            AfterAttack;
+            exit
+            end
+    else
+        inc(Gear^.Timer);
 
-    i := 200;
+        i := 200;
     repeat
         Gear^.X := Gear^.X + Gear^.dX;
         Gear^.Y := Gear^.Y + Gear^.dY;
         CheckCollision(Gear);
         if (Gear^.State and gstCollision) <> 0 then
-        begin
+            begin
             Gear^.X := Gear^.X + Gear^.dX * 8;
             Gear^.Y := Gear^.Y + Gear^.dY * 8;
             ShotgunShot(Gear);
             Gear^.doStep := @doStepShotIdle;
             exit
-        end;
+            end;
 
         CheckGearDrowning(Gear);
         if (Gear^.State and gstDrowning) <> 0 then
-        begin
+            begin
             Gear^.doStep := @doStepShotIdle;
             exit
-        end;
+            end;
         dec(i)
     until i = 0;
-    if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0)
-        then
+    if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
         Gear^.doStep := @doStepShotIdle
 end;
 
@@ -1044,6 +975,7 @@ begin
 
         // Bullet trail
         VGear := AddVisualGear(hwRound(ox), hwRound(oy), vgtLineTrail);
+        
         if VGear <> nil then
             begin
             VGear^.X:= hwFloat2Float(ox);
@@ -1053,12 +985,12 @@ begin
 
             // reached edge of land. assume infinite beam. Extend it way out past camera
             if (hwRound(Bullet^.X) and LAND_WIDTH_MASK <> 0)
-                or (hwRound(Bullet^.Y) and LAND_HEIGHT_MASK <> 0) then
+            or (hwRound(Bullet^.Y) and LAND_HEIGHT_MASK <> 0) then
                     // only extend if not under water
                     if hwRound(Bullet^.Y) < cWaterLine then
                         begin
-                        VGear^.dX := VGear^.dX + LAND_WIDTH * (VGear^.dX - VGear^.X);
-                        VGear^.dY := VGear^.dY + LAND_WIDTH * (VGear^.dY - VGear^.Y);
+                        VGear^.dX := VGear^.dX + max(LAND_WIDTH,4096) * (VGear^.dX - VGear^.X);
+                        VGear^.dY := VGear^.dY + max(LAND_WIDTH,4096) * (VGear^.dY - VGear^.Y);
                         end;
 
             VGear^.Timer := 200;
@@ -1081,18 +1013,19 @@ begin
         Gear^.Y := Gear^.Y + Gear^.dY;
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
-        if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)
-           and (Land[y, x] <> 0) then inc(Gear^.Damage);
+        
+        if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] <> 0) then
+            inc(Gear^.Damage);
         // let's interrupt before a collision to give portals a chance to catch the bullet
         if (Gear^.Damage = 1) and (Gear^.Tag = 0) and (Land[y, x] > 255) then
-        begin
+            begin
             Gear^.Tag := 1;
             Gear^.Damage := 0;
             Gear^.X := Gear^.X - Gear^.dX;
             Gear^.Y := Gear^.Y - Gear^.dY;
             CheckGearDrowning(Gear);
             break;
-        end
+            end
         else
             Gear^.Tag := 0;
 
@@ -1102,48 +1035,48 @@ begin
         else
             AmmoShove(Gear, Gear^.Timer, 20);
         CheckGearDrowning(Gear);
-        dec(i)
+        dec(i) 
     until (i = 0) or (Gear^.Damage > Gear^.Health) or ((Gear^.State and gstDrowning) <> 0);
+
     if Gear^.Damage > 0 then
-    begin
+        begin
         DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1);
         dec(Gear^.Health, Gear^.Damage);
         Gear^.Damage := 0
-    end;
-    if ((Gear^.State and gstDrowning) <> 0) and (Gear^.Damage < Gear^.Health) and ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cSDWaterOpacity < $FF))) then
-    begin
-        for i:=(Gear^.Health - Gear^.Damage) * 4 downto 0 do
+        end;
+    if ((Gear^.State and gstDrowning) <> 0) and (Gear^.Damage < Gear^.Health) and ((not SuddenDeathDmg and (WaterOpacity < $FF)) or (SuddenDeathDmg and (SDWaterOpacity < $FF))) then
         begin
+        for i:=(Gear^.Health - Gear^.Damage) * 4 downto 0 do
+            begin
             if Random(6) = 0 then
                 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble);
             Gear^.X := Gear^.X + Gear^.dX;
             Gear^.Y := Gear^.Y + Gear^.dY;
+            end;
         end;
-    end;
 
     if (Gear^.Health <= 0)
-       or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
-       or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
-    begin
-        if (Gear^.Kind = gtSniperRifleShot) and ((GameFlags and gfLaserSight) = 0) then
-            cLaserSighting := false;
-        if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and
-           ((GameFlags and gfArtillery) = 0) then cArtillery := false;
+        or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
+        or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
+            begin
+            if (Gear^.Kind = gtSniperRifleShot) and ((GameFlags and gfLaserSight) = 0) then
+                cLaserSighting := false;
+            if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and ((GameFlags and gfArtillery) = 0) then
+                cArtillery := false;
         
         // Bullet Hit
-        if (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) 
-            and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
-        begin
-            VGear := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBulletHit);
-            if VGear <> nil then
-            begin
-                VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);
-            end;
-        end;
+            if (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
+                begin
+                VGear := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBulletHit);
+                if VGear <> nil then
+                    begin
+                    VGear^.Angle := DxDy2Angle(-Gear^.dX, Gear^.dY);
+                    end;
+                end;
        
-        spawnBulletTrail(Gear);
-        Gear^.doStep := @doStepShotIdle
-    end;
+            spawnBulletTrail(Gear);
+            Gear^.doStep := @doStepShotIdle
+            end;
 end;
 
 procedure doStepDEagleShot(Gear: PGear);
@@ -1166,21 +1099,22 @@ begin
     HedgehogChAngle(HHGear);
     if not cLaserSighting then
         // game does not have default laser sight. turn it on and give them a chance to aim
-    begin
+        begin
         cLaserSighting := true;
         HHGear^.Message := 0;
-        if (HHGear^.Angle - 32 >= 0) then dec(HHGear^.Angle,32)
-    end;
+        if (HHGear^.Angle >= 32) then
+            dec(HHGear^.Angle,32)
+        end;
 
     if (HHGear^.Message and gmAttack) <> 0 then
-    begin
+        begin
         shell := AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
         if shell <> nil then
-        begin
+            begin
             shell^.dX := gear^.dX.QWordValue / -8589934592;
             shell^.dY := gear^.dY.QWordValue / -8589934592;
             shell^.Frame := 1
-        end;
+            end;
         Gear^.State := Gear^.State or gstAnimation;
         Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5;
         Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5;
@@ -1189,56 +1123,59 @@ begin
         Gear^.X := Gear^.X + Gear^.dX * 3;  
         Gear^.Y := Gear^.Y + Gear^.dY * 3;
         Gear^.doStep := @doStepBulletWork;
-    end
+        end
     else
         if (GameTicks mod 32) = 0 then
             if (GameTicks mod 4096) < 2048 then
-            begin
-                if (HHGear^.Angle + 1 <= cMaxAngle) then inc(HHGear^.Angle)
-            end
+                begin
+                if (HHGear^.Angle + 1 <= cMaxAngle) then
+                    inc(HHGear^.Angle)
+                end
     else
-        if (HHGear^.Angle - 1 >= 0) then dec(HHGear^.Angle);
+        if (HHGear^.Angle >= 1) then
+            dec(HHGear^.Angle);
 
     if (TurnTimeLeft > 0) then
         dec(TurnTimeLeft)
     else
-    begin
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepActionTimer(Gear: PGear);
 begin
-    dec(Gear^.Timer);
-    case Gear^.Kind of 
-        gtATStartGame: 
+dec(Gear^.Timer);
+case Gear^.Kind of
+    gtATStartGame: 
     begin
         AllInactive := false;
         if Gear^.Timer = 0 then
-        begin
+            begin
             AddCaption(trmsg[sidStartFight], cWhiteColor, capgrpGameState);
-        end
+            end
     end;
     gtATFinishGame: 
     begin
         AllInactive := false;
         if Gear^.Timer = 1000 then
-        begin
+            begin
             ScreenFade := sfToBlack;
             ScreenFadeValue := 0;
             ScreenFadeSpeed := 1;
-        end;
+            end;
         if Gear^.Timer = 0 then
-        begin
-            SendIPC('N');
-            SendIPC('q');
+            begin
+            SendIPC(_S'N');
+            SendIPC(_S'q');
             GameState := gsExit
-        end
+            end
     end;
 end;
-if Gear^.Timer = 0 then DeleteGear(Gear)
+if Gear^.Timer = 0 then
+    DeleteGear(Gear)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1250,11 +1187,13 @@ begin
     AllInactive := false;
     HHGear := Gear^.Hedgehog^.Gear;
     dec(Gear^.Timer);
-    if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then dec(TurnTimeLeft);
-    if (TurnTimeLeft = 0) or (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) =
-       0) then
+    if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then
+        dec(TurnTimeLeft);
+    if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
+    or((Gear^.Message and gmDestroy) <> 0)
+    or((HHGear^.State and gstHHDriven) =0) then
         begin
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         DeleteGear(Gear);
         AfterAttack;
         doStepHedgehogMoving(HHGear);  // for gfInfAttack
@@ -1267,7 +1206,7 @@ begin
         begin
         HHGear^.State := HHGear^.State or gstNoDamage;
         doMakeExplosion(x, y + 7, 6, Gear^.Hedgehog, EXPLDontDraw);
-        HHGear^.State := HHGear^.State and not gstNoDamage
+        HHGear^.State := HHGear^.State and (not gstNoDamage)
         end;
 
     if (Gear^.Timer mod 47) = 0 then
@@ -1305,7 +1244,8 @@ begin
             Gear^.dY := Gear^.dY + cGravity;
             Gear^.Y := Gear^.Y + Gear^.dY
             end;
-        if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1
+        if hwRound(Gear^.Y) > cWaterLine then
+            Gear^.Timer := 1
         end;
 
     Gear^.X := Gear^.X + HHGear^.dX;
@@ -1316,13 +1256,17 @@ begin
         end;
 
     if (Gear^.Message and gmAttack) <> 0 then
-        if (Gear^.State and gsttmpFlag) <> 0 then Gear^.Timer := 1
-    else
+        if (Gear^.State and gsttmpFlag) <> 0 then
+            Gear^.Timer := 1
+    else //there would be a mistake.
     else
-        if (Gear^.State and gsttmpFlag) = 0 then Gear^.State := Gear^.State or gsttmpFlag;
-    if ((Gear^.Message and gmLeft) <> 0) then Gear^.dX := - _0_3
+        if (Gear^.State and gsttmpFlag) = 0 then
+            Gear^.State := Gear^.State or gsttmpFlag;
+    if ((Gear^.Message and gmLeft) <> 0) then
+        Gear^.dX := - _0_3
     else
-        if ((Gear^.Message and gmRight) <> 0) then Gear^.dX := _0_3
+        if ((Gear^.Message and gmRight) <> 0) then
+            Gear^.dX := _0_3
     else Gear^.dX := _0;
 end;
 
@@ -1337,12 +1281,12 @@ begin
 
     y := hwRound(Gear^.Y) - cHHRadius * 2;
     while y < hwRound(Gear^.Y) do
-    begin
+        begin
         ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2));
         ar[i].Right := hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2));
         inc(y, 2);
         inc(i)
-    end;
+        end;
 
     DrawHLinesExplosions(@ar, 3, hwRound(Gear^.Y) - cHHRadius * 2, 2, Pred(i));
     Gear^.dY := HHGear^.dY;
@@ -1365,7 +1309,8 @@ var
 begin
     AllInactive := false;
     dec(Gear^.Timer);
-    if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then dec(TurnTimeLeft);
+    if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then
+        dec(TurnTimeLeft);
     
     HHGear := Gear^.Hedgehog^.Gear;
 
@@ -1384,7 +1329,8 @@ begin
     if ((HHGear^.State and gstMoving) <> 0) then
         begin
         doStepHedgehogMoving(HHGear);
-        if (HHGear^.State and gstHHDriven) = 0 then Gear^.Timer := 0
+        if (HHGear^.State and gstHHDriven) = 0 then
+            Gear^.Timer := 0
         end;
 
     if Gear^.Timer mod cHHStepTicks = 0 then
@@ -1397,7 +1343,7 @@ begin
 
         if ((HHGear^.State and gstMoving) = 0) then
             begin
-            HHGear^.State := HHGear^.State and not gstAttacking;
+            HHGear^.State := HHGear^.State and (not gstAttacking);
             prevX := hwRound(HHGear^.X);
 
             // why the call to HedgehogStep then a further increment of X?
@@ -1415,16 +1361,14 @@ begin
         if BTSteps = 7 then
             begin
             BTSteps := 0;
-            if CheckLandValue(hwRound(HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC) + SignAs(_6,
-               Gear^.dX)), hwRound(HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC)),
-               lfIndestructible) then
+            if CheckLandValue(hwRound(HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC) + SignAs(_6,Gear^.dX)), hwRound(HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC)),lfIndestructible) then
                 begin
                 Gear^.X := HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC);
                 Gear^.Y := HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC);
                 end;
             HHGear^.State := HHGear^.State or gstNoDamage;
             AmmoShove(Gear, 2, 15);
-            HHGear^.State := HHGear^.State and not gstNoDamage
+            HHGear^.State := HHGear^.State and (not gstNoDamage)
             end;
         end;
 
@@ -1437,7 +1381,8 @@ begin
         cHHStepTicks, cHHRadius * 2 + 7);
     end;
 
-    if (TurnTimeLeft = 0) or (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then
+    if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
+    or ((HHGear^.Message and gmAttack) <> 0) then
         begin
         HHGear^.Message := 0;
         HHGear^.State := HHGear^.State and (not gstNotKickable);
@@ -1459,464 +1404,40 @@ begin
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
-
-procedure doStepRope(Gear: PGear);
-forward;
-
-procedure doStepRopeAfterAttack(Gear: PGear);
-var 
-    HHGear: PGear;
-begin
-    HHGear := Gear^.Hedgehog^.Gear;
-    if ((HHGear^.State and gstHHDriven) = 0)
-       or (CheckGearDrowning(HHGear))
-       or (TestCollisionYwithGear(HHGear, 1) <> 0) then
-    begin
-        DeleteGear(Gear);
-        isCursorVisible := false;
-        ApplyAmmoChanges(HHGear^.Hedgehog^);
-        exit
-    end;
-
-    HedgehogChAngle(HHGear);
-
-    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX);
-
-    if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then HHGear^.dY := _0;
-    HHGear^.X := HHGear^.X + HHGear^.dX;
-    HHGear^.Y := HHGear^.Y + HHGear^.dY;
-    HHGear^.dY := HHGear^.dY + cGravity;
-    if (GameFlags and gfMoreWind) <> 0 then HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density;
-
-    if (Gear^.Message and gmAttack) <> 0 then
-    begin
-        Gear^.X := HHGear^.X;
-        Gear^.Y := HHGear^.Y;
-
-        ApplyAngleBounds(Gear^.Hedgehog^, amRope);
-
-        Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX);
-        Gear^.dY := -AngleCos(HHGear^.Angle);
-        Gear^.Friction := _450 * _0_01 * cRopePercent;
-        Gear^.Elasticity := _0;
-        Gear^.State := Gear^.State and not gsttmpflag;
-        Gear^.doStep := @doStepRope;
-    end
-end;
-
-procedure doStepRopeWork(Gear: PGear);
-var 
-    HHGear: PGear;
-    len, tx, ty, nx, ny, ropeDx, ropeDy, mdX, mdY: hwFloat;
-    lx, ly, cd: LongInt;
-    haveCollision,
-    haveDivided: boolean;
-
-procedure DeleteMe;
-begin
-    with HHGear^ do
-    begin
-        Message := Message and not gmAttack;
-        State := (State or gstMoving) and not gstWinner;
-    end;
-    DeleteGear(Gear)
-end;
-
-procedure WaitCollision;
-begin
-    with HHGear^ do
-    begin
-        Message := Message and not gmAttack;
-        State := State or gstMoving;
-    end;
-    RopePoints.Count := 0;
-    Gear^.Elasticity := _0;
-    Gear^.doStep := @doStepRopeAfterAttack
-end;
-
-begin
-    HHGear := Gear^.Hedgehog^.Gear;
-
-    if ((HHGear^.State and gstHHDriven) = 0)
-       or (CheckGearDrowning(HHGear)) then
-        begin
-        PlaySound(sndRopeRelease);
-        DeleteMe;
-        exit
-        end;
-
-    if (Gear^.Message and gmLeft  <> 0) and not TestCollisionXwithGear(HHGear, -1) then
-        HHGear^.dX := HHGear^.dX - _0_0002;
-
-    if (Gear^.Message and gmRight <> 0) and not TestCollisionXwithGear(HHGear,  1) then
-        HHGear^.dX := HHGear^.dX + _0_0002;
-
-    // vector between hedgehog and rope attaching point
-    ropeDx := HHGear^.X - Gear^.X;
-    ropeDy := HHGear^.Y - Gear^.Y;
-
-    if TestCollisionYwithGear(HHGear, 1) = 0 then
-        begin
-
-        // depending on the rope vector we know which X-side to check for collision
-        // in order to find out if the hog can still be moved by gravity
-        if ropeDx.isNegative = RopeDy.IsNegative then
-            cd:= -1
-        else
-            cd:= 1;
-
-        // apply gravity if there is no obstacle
-        if not TestCollisionXwithGear(HHGear, cd) then
-            HHGear^.dY := HHGear^.dY + cGravity;
-
-        if (GameFlags and gfMoreWind) <> 0 then
-            // apply wind if there's no obstacle
-            if not TestCollisionXwithGear(HHGear, hwSign(cWindSpeed)) then
-                HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density;
-        end;
-
-    mdX := ropeDx + HHGear^.dX;
-    mdY := ropeDy + HHGear^.dY;
-    len := _1 / Distance(mdX, mdY);
-    // rope vector plus hedgehog direction vector normalized
-    mdX := mdX * len;
-    mdY := mdY * len;
-
-    // for visual purposes only
-    Gear^.dX := mdX;
-    Gear^.dY := mdY;
-
-    /////
-    tx := HHGear^.X;
-    ty := HHGear^.Y;
-
-    if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
-        if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
-           or (TestCollisionYwithGear(HHGear, hwSign(ropeDy)) <> 0)) then
-            Gear^.Elasticity := Gear^.Elasticity + _0_3;
-
-    if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
-        if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
-           or (TestCollisionYwithGear(HHGear, -hwSign(ropeDy)) <> 0)) then
-            Gear^.Elasticity := Gear^.Elasticity - _0_3;
-
-    HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
-    HHGear^.Y := Gear^.Y + mdY * Gear^.Elasticity;
-
-    HHGear^.dX := HHGear^.X - tx;
-    HHGear^.dY := HHGear^.Y - ty;
-    ////
-
-
-    haveDivided := false;
-    // check whether rope needs dividing
-
-    len := Gear^.Elasticity - _5;
-    nx := Gear^.X + mdX * len;
-    ny := Gear^.Y + mdY * len;
-    tx := mdX * _0_3; // should be the same as increase step
-    ty := mdY * _0_3;
-
-    while len > _3 do
-        begin
-        lx := hwRound(nx);
-        ly := hwRound(ny);
-        if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and ((Land[ly, lx] and $FF00) <> 0) then
-            begin
-            ny := _1 / Distance(ropeDx, ropeDy);
-            // old rope pos
-            nx := ropeDx * ny;
-            ny := ropeDy * ny;
-
-            with RopePoints.ar[RopePoints.Count] do
-                begin
-                X := Gear^.X;
-                Y := Gear^.Y;
-                if RopePoints.Count = 0 then RopePoints.HookAngle := DxDy2Angle(Gear^.dY, Gear^.dX);
-                b := (nx * HHGear^.dY) > (ny * HHGear^.dX);
-                dLen := len
-                end;
-            with RopePoints.rounded[RopePoints.Count] do
-                begin
-                X := hwRound(Gear^.X);
-                Y := hwRound(Gear^.Y);
-                end;
-
-            Gear^.X := Gear^.X + nx * len;
-            Gear^.Y := Gear^.Y + ny * len;
-            inc(RopePoints.Count);
-            TryDo(RopePoints.Count <= MAXROPEPOINTS, 'Rope points overflow', true);
-            Gear^.Elasticity := Gear^.Elasticity - len;
-            Gear^.Friction := Gear^.Friction - len;
-            haveDivided := true;
-            break
-            end;
-        nx := nx - tx;
-        ny := ny - ty;
-
-        // len := len - _0_3 // should be the same as increase step
-        len.QWordValue := len.QWordValue - _0_3.QWordValue;
-        end;
-
-    if not haveDivided then
-        if RopePoints.Count > 0 then // check whether the last dividing point could be removed
-            begin
-            tx := RopePoints.ar[Pred(RopePoints.Count)].X;
-            ty := RopePoints.ar[Pred(RopePoints.Count)].Y;
-            mdX := tx - Gear^.X;
-            mdY := ty - Gear^.Y;
-            if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * (ty - HHGear^.Y) > (tx - HHGear^.X) * mdY) then
-                begin
-                dec(RopePoints.Count);
-                Gear^.X := RopePoints.ar[RopePoints.Count].X;
-                Gear^.Y := RopePoints.ar[RopePoints.Count].Y;
-                Gear^.Elasticity := Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen;
-                Gear^.Friction := Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen;
-
-                // restore hog position
-                len := _1 / Distance(mdX, mdY);
-                mdX := mdX * len;
-                mdY := mdY * len;
-
-                HHGear^.X := Gear^.X - mdX * Gear^.Elasticity;
-                HHGear^.Y := Gear^.Y - mdY * Gear^.Elasticity;
-                end
-            end;
-
-    haveCollision := false;
-    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
-        begin
-        HHGear^.dX := -_0_6 * HHGear^.dX;
-        haveCollision := true
-        end;
-    if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0 then
-        begin
-        HHGear^.dY := -_0_6 * HHGear^.dY;
-        haveCollision := true
-        end;
-
-    if haveCollision
-       and (Gear^.Message and (gmLeft or gmRight) <> 0)
-       and (Gear^.Message and (gmUp or gmDown) <> 0) then
-        begin
-        HHGear^.dX := SignAs(hwAbs(HHGear^.dX) + _0_2, HHGear^.dX);
-        HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_2, HHGear^.dY)
-        end;
-
-    len := hwSqr(HHGear^.dX) + hwSqr(HHGear^.dY);
-    if len > _0_64 then
-        begin
-        len := _0_8 / hwSqrt(len);
-        HHGear^.dX := HHGear^.dX * len;
-        HHGear^.dY := HHGear^.dY * len;
-        end;
-
-    haveCollision:= ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)]) <> 0);
-
-    if not haveCollision then
-        begin
-        // backup gear location
-        tx:= Gear^.X;
-        ty:= Gear^.Y;
-
-        if RopePoints.Count > 0 then
-            begin
-            // set gear location to the remote end of the rope, the attachment point
-            Gear^.X:= RopePoints.ar[0].X;
-            Gear^.Y:= RopePoints.ar[0].Y;
-            end;
-
-        CheckCollision(Gear);
-        // if we haven't found any collision yet then check the other side too
-        if (Gear^.State and gstCollision) = 0 then
-            begin
-            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
-            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
-            CheckCollision(Gear);
-            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
-            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
-            end;
-
-        haveCollision:= (Gear^.State and gstCollision) <> 0;
-
-        // restore gear location
-        Gear^.X:= tx;
-        Gear^.Y:= ty;
-        end;
-
-    // if the attack key is pressed, lose rope contact as well
-    if (Gear^.Message and gmAttack) <> 0 then
-        haveCollision:= false;
-
-    if not haveCollision then
-        begin
-        if (Gear^.State and gsttmpFlag) <> 0 then
-            with Gear^.Hedgehog^ do
-                begin
-                PlaySound(sndRopeRelease);
-                if CurAmmoType <> amParachute then
-                    WaitCollision
-                else
-                    DeleteMe
-                end
-        end
-    else
-        if (Gear^.State and gsttmpFlag) = 0 then
-            Gear^.State := Gear^.State or gsttmpFlag;
-end;
-
-procedure doStepRopeAttach(Gear: PGear);
-var 
-    HHGear: PGear;
-    tx, ty, tt: hwFloat;
-
-procedure RemoveFromAmmo;
-begin
-    if (Gear^.State and gstAttacked) = 0 then
-    begin
-        OnUsedAmmo(HHGear^.Hedgehog^);
-        Gear^.State := Gear^.State or gstAttacked
-    end;
-    ApplyAmmoChanges(HHGear^.Hedgehog^)
-end;
-
-begin
-    Gear^.X := Gear^.X - Gear^.dX;
-    Gear^.Y := Gear^.Y - Gear^.dY;
-    Gear^.Elasticity := Gear^.Elasticity + _1;
-
-    HHGear := Gear^.Hedgehog^.Gear;
-    DeleteCI(HHGear);
-
-    if (HHGear^.State and gstMoving) <> 0 then
-        begin
-        if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX);
-        if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then HHGear^.dY := _0;
-
-        HHGear^.X := HHGear^.X + HHGear^.dX;
-        Gear^.X := Gear^.X + HHGear^.dX;
-
-        if TestCollisionYwithGear(HHGear, 1) <> 0 then
-            begin
-            CheckHHDamage(HHGear);
-            HHGear^.dY := _0
-            //HHGear^.State:= HHGear^.State and not (gstHHJumping or gstHHHJump);
-            end
-        else
-            begin
-            HHGear^.Y := HHGear^.Y + HHGear^.dY;
-            Gear^.Y := Gear^.Y + HHGear^.dY;
-            HHGear^.dY := HHGear^.dY + cGravity;
-            if (GameFlags and gfMoreWind) <> 0 then HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density
-            end;
-
-        tt := Gear^.Elasticity;
-        tx := _0;
-        ty := _0;
-        while tt > _20 do
-            begin
-            if ((hwRound(Gear^.Y+ty) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X+tx) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y+ty), hwRound(Gear^.X+tx)] and $FF00) <> 0) then
-                begin
-                Gear^.X := Gear^.X + tx;
-                Gear^.Y := Gear^.Y + ty;
-                Gear^.Elasticity := tt;
-                Gear^.doStep := @doStepRopeWork;
-                PlaySound(sndRopeAttach);
-                with HHGear^ do
-                    begin
-                    State := State and not (gstAttacking or gstHHJumping or gstHHHJump);
-                    Message := Message and not gmAttack
-                    end;
-
-                RemoveFromAmmo;
-
-                tt := _0;
-                exit
-                end;
-            tx := tx + Gear^.dX + Gear^.dX;
-            ty := ty + Gear^.dY + Gear^.dY;
-            tt := tt - _2;
-            end;
-        end;
-
-    CheckCollision(Gear);
-
-    if (Gear^.State and gstCollision) <> 0 then
-        if Gear^.Elasticity < _10 then
-            Gear^.Elasticity := _10000
-    else
-        begin
-        Gear^.doStep := @doStepRopeWork;
-        PlaySound(sndRopeAttach);
-        with HHGear^ do
-            begin
-            State := State and not (gstAttacking or gstHHJumping or gstHHHJump);
-            Message := Message and not gmAttack
-            end;
-
-        RemoveFromAmmo;
-
-        exit
-        end;
-
-    if (Gear^.Elasticity > Gear^.Friction)
-       or ((Gear^.Message and gmAttack) = 0)
-       or ((HHGear^.State and gstHHDriven) = 0)
-       or (HHGear^.Damage > 0) then
-        begin
-        with Gear^.Hedgehog^.Gear^ do
-            begin
-            State := State and not gstAttacking;
-            Message := Message and not gmAttack
-            end;
-        DeleteGear(Gear)
-        end;
-    CheckGearDrowning(HHGear)
-end;
-
-procedure doStepRope(Gear: PGear);
-begin
-    Gear^.dX := - Gear^.dX;
-    Gear^.dY := - Gear^.dY;
-    Gear^.doStep := @doStepRopeAttach;
-    PlaySound(sndRopeShot)
-end;
-
-////////////////////////////////////////////////////////////////////////////////
 procedure doStepMine(Gear: PGear);
 var vg: PVisualGear;
 begin
     if (Gear^.State and gstMoving) <> 0 then
-    begin
+        begin
         DeleteCI(Gear);
         doStepFallingGear(Gear);
         if (Gear^.State and gstMoving) = 0 then
-        begin
+            begin
             AddGearCI(Gear);
             Gear^.dX := _0;
             Gear^.dY := _0
-        end;
+            end;
         CalcRotationDirAngle(Gear);
         AllInactive := false
-    end
-    else
-        if ((GameTicks and $3F) = 25) then
-            doStepFallingGear(Gear);
+        end
+    else if (GameTicks and $3F) = 25 then
+        doStepFallingGear(Gear);
     if (Gear^.Health = 0) then
         begin
-            if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and (TestCollisionYwithGear(Gear, 1) <> 0) then
-                inc(Gear^.Damage, hwRound(Gear^.dY * _70))
-            else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * _70))
-            else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0) then
-                 inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
-            else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
+        if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and (TestCollisionYwithGear(Gear, 1) <> 0) then
+            inc(Gear^.Damage, hwRound(Gear^.dY * _70))
+        else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then
+            inc(Gear^.Damage, hwRound(Gear^.dX * _70))
+        else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0) then
+            inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
+        else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then
+            inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
         
-        if (Gear^.Damage > random(30)) and ((GameTicks and $FF) = 0) then
+        if ((GameTicks and $FF) = 0) and (Gear^.Damage > random(30)) then
             begin
             vg:= AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke);
-            if vg <> nil then vg^.Scale:= 0.5
+            if vg <> nil then
+                vg^.Scale:= 0.5
             end;
 
         if (Gear^.Damage > 35) then
@@ -1931,18 +1452,19 @@ begin
         if ((Gear^.State and gstAttacking) = 0) then
             begin
             if ((GameTicks and $1F) = 0) then
-                if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State := Gear^.State or
-                                                                                      gstAttacking
+                if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then
+                    Gear^.State := Gear^.State or gstAttacking
             end
         else // gstAttacking <> 0
             begin
             AllInactive := false;
-            if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
+            if (Gear^.Timer and $FF) = 0 then
+                PlaySound(sndMineTick);
             if Gear^.Timer = 0 then
                 begin
-                if ((Gear^.State and gstWait) <> 0) or
-                   (cMineDudPercent = 0) or
-                   (getRandom(100) > cMineDudPercent) then
+                if ((Gear^.State and gstWait) <> 0)
+                or (cMineDudPercent = 0)
+                or (getRandom(100) > cMineDudPercent) then
                     begin
                     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
                     DeleteGear(Gear)
@@ -1950,65 +1472,77 @@ begin
                 else
                     begin
                     vg:= AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke);
-                    if vg <> nil then vg^.Scale:= 0.5;
+                    if vg <> nil then
+                        vg^.Scale:= 0.5;
                     PlaySound(sndVaporize);
                     Gear^.Health := 0;
                     Gear^.Damage := 0;
-                    Gear^.State := Gear^.State and not gstAttacking
+                    Gear^.State := Gear^.State and (not gstAttacking)
                     end;
                 exit
                 end;
             dec(Gear^.Timer);
             end
     else // gsttmpFlag = 0
-        if (TurnTimeLeft = 0) or ((GameFlags and gfInfAttack <> 0) and (GameTicks > Gear^.FlightTime)) or (Gear^.Hedgehog^.Gear = nil) then Gear^.State := Gear^.State or gsttmpFlag;
+        if (TurnTimeLeft = 0)
+        or ((GameFlags and gfInfAttack <> 0) and (GameTicks > Gear^.FlightTime))
+        or (Gear^.Hedgehog^.Gear = nil) then
+            Gear^.State := Gear^.State or gsttmpFlag;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSMine(Gear: PGear);
 begin
     // TODO: do real calculation?
-    if TestCollisionXwithGear(Gear, 2) or (TestCollisionYwithGear(Gear, -2) <> 0) or TestCollisionXwithGear(Gear, -2) or (TestCollisionYwithGear(Gear, 2) <> 0) then
-    begin
-        if (hwAbs(Gear^.dX) > _0) or (hwAbs(Gear^.dY) > _0) then
+    if TestCollisionXwithGear(Gear, 2) 
+    or (TestCollisionYwithGear(Gear, -2) <> 0) 
+    or TestCollisionXwithGear(Gear, -2) 
+    or (TestCollisionYwithGear(Gear, 2) <> 0) then
         begin
+        if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
+            begin
             PlaySound(sndRopeAttach);
             Gear^.dX:= _0;
             Gear^.dY:= _0;
             AddGearCI(Gear);
-        end;
-    end
+            end;
+        end
     else
-    begin
+        begin
         DeleteCI(Gear);
         doStepFallingGear(Gear);
         AllInactive := false;
         CalcRotationDirAngle(Gear);
-    end;
+        end;
 
     if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then
-    begin
-        if ((Gear^.State and gstAttacking) = 0) then
         begin
+        if ((Gear^.State and gstAttacking) = 0) then
+            begin
             if ((GameTicks and $1F) = 0) then
-                if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State := Gear^.State or
-                                                                                      gstAttacking
-        end
+                if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then
+                    Gear^.State := Gear^.State or gstAttacking
+            end
         else // gstAttacking <> 0
         begin
             AllInactive := false;
-            if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
             if Gear^.Timer = 0 then
-            begin
+                begin
                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
                 DeleteGear(Gear);
                 exit
-            end;
+            end else
+                if (Gear^.Timer and $FF) = 0 then
+                    PlaySound(sndMineTick);
+
             dec(Gear^.Timer);
+                end
         end
-    end
     else // gsttmpFlag = 0
-        if (TurnTimeLeft = 0) or ((GameFlags and gfInfAttack <> 0) and (GameTicks > Gear^.FlightTime)) or (Gear^.Hedgehog^.Gear = nil) then Gear^.State := Gear^.State or gsttmpFlag;
+        if (TurnTimeLeft = 0)
+        or ((GameFlags and gfInfAttack <> 0) and (GameTicks > Gear^.FlightTime))
+        or (Gear^.Hedgehog^.Gear = nil) then
+            Gear^.State := Gear^.State or gsttmpFlag;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2016,15 +1550,16 @@ procedure doStepDynamite(Gear: PGear);
 begin
     doStepFallingGear(Gear);
     AllInactive := false;
-    if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag);
+    if Gear^.Timer mod 166 = 0 then
+        inc(Gear^.Tag);
     if Gear^.Timer = 1000 then // might need better timing
         makeHogsWorry(Gear^.X, Gear^.Y, 75);
     if Gear^.Timer = 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, Gear^.Hedgehog, EXPLAutoSound);
         DeleteGear(Gear);
         exit
-    end;
+        end;
     dec(Gear^.Timer);
 end;
 
@@ -2040,42 +1575,44 @@ var
     i: LongInt;
     particle: PVisualGear;
 begin
-    if (Gear^.dY.QWordValue = 0) and (Gear^.dY.QWordValue = 0) and (TestCollisionYwithGear(Gear, 1) = 0) then SetLittle(Gear^.dY);
+    if (Gear^.dY.QWordValue = 0) and (Gear^.dY.QWordValue = 0) and (TestCollisionYwithGear(Gear, 1) = 0) then
+        SetLittle(Gear^.dY);
     Gear^.State := Gear^.State or gstAnimation;
-    if ((Gear^.dX.QWordValue <> 0) or (Gear^.dY.QWordValue <> 0))  then
-    begin
+    
+    if ((Gear^.dX.QWordValue <> 0)
+    or (Gear^.dY.QWordValue <> 0))  then
+        begin
         DeleteCI(Gear);
         AllInactive := false;
         if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and (TestCollisionYwithGear(Gear, 1) <> 0) then
-        begin
+            begin
             Gear^.State := Gear^.State or gsttmpFlag;
             inc(Gear^.Damage, hwRound(Gear^.dY * _70));
             for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do
-            begin
-                particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12,
-                            vgtDust);
-                if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
+                begin
+                particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12,vgtDust);
+                if particle <> nil then
+                    particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480)
+                end
             end
-        end
-        else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1)
-                 then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * _70))
-        else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0)
-                 then
-                 inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
-        else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1)
-                 then
-                 inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
+        else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then
+                inc(Gear^.Damage, hwRound(Gear^.dX * _70))
+                
+        else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and (TestCollisionYwithGear(Gear, -1) <> 0) then
+                inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
+                
+        else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then
+                inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
 
         doStepFallingGear(Gear);
         CalcRotationDirAngle(Gear);
         //CheckGearDrowning(Gear)
-    end
+        end
     else
-    begin
+        begin
         Gear^.State := Gear^.State or gsttmpFlag;
         AddGearCI(Gear)
-    end;
+        end;
 
 (*
 Attempt to make a barrel knock itself over an edge.  Would need more checks to avoid issues like burn damage
@@ -2093,9 +1630,10 @@ Attempt to make a barrel knock itself over an edge.  Would need more checks to a
     if Gear^.dX.QWordValue = 0 then AddGearCI(Gear)
     end; *)
 
-    if not Gear^.dY.isNegative and (Gear^.dY < _0_001) and (TestCollisionYwithGear(Gear, 1) <> 0) then Gear
-        ^.dY := _0;
-    if hwAbs(Gear^.dX) < _0_001 then Gear^.dX := _0;
+    if not Gear^.dY.isNegative and (Gear^.dY < _0_001) and (TestCollisionYwithGear(Gear, 1) <> 0) then
+        Gear^.dY := _0;
+    if hwAbs(Gear^.dX) < _0_001 then
+        Gear^.dX := _0;
 
     if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
         if (cBarrelHealth div Gear^.Health) > 2 then
@@ -2104,7 +1642,8 @@ Attempt to make a barrel knock itself over an edge.  Would need more checks to a
         AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
     dec(Gear^.Health, Gear^.Damage);
     Gear^.Damage := 0;
-    if Gear^.Health <= 0 then Gear^.doStep := @doStepCase;
+    if Gear^.Health <= 0 then
+        Gear^.doStep := @doStepCase;
     // Hand off to doStepCase for the explosion
 
 end;
@@ -2116,26 +1655,29 @@ var
     exBoom: boolean;
     dX, dY: HWFloat;
     hog: PHedgehog;
+    sparkles: PVisualGear;
+    gi: PGear;
 begin
     k := Gear^.Kind;
     exBoom := false;
 
     if (Gear^.Message and gmDestroy) > 0 then
-    begin
+        begin
         DeleteGear(Gear);
         FreeActionsList;
         SetAllToActive;
         // something (hh, mine, etc...) could be on top of the case
         with CurrentHedgehog^ do
-            if Gear <> nil then Gear^.Message := Gear^.Message and not (gmLJump or gmHJump);
+            if Gear <> nil then
+                Gear^.Message := Gear^.Message and (not (gmLJump or gmHJump));
         exit
-    end;
+        end;
 
     if k = gtExplosives then
-    begin
+        begin
         //if V > _0_03 then Gear^.State:= Gear^.State or gstAnimation;
-        if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02))
-            then Gear^.doStep := @doStepRollingBarrel;
+        if (hwAbs(Gear^.dX) > _0_15) or ((hwAbs(Gear^.dY) > _0_15) and (hwAbs(Gear^.dX) > _0_02)) then
+            Gear^.doStep := @doStepRollingBarrel;
 
         if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
             if (cBarrelHealth div Gear^.Health) > 2 then
@@ -2146,10 +1688,59 @@ begin
         Gear^.Damage := 0;
         if Gear^.Health <= 0 then
             exBoom := true;
-    end;
+        end
+    else
+        begin 
+        if (Gear^.Pos <> posCaseHealth) and (GameTicks and $3FF = 0) then // stir it up every second or so
+            begin
+            gi := GearsList;
+            while gi <> nil do
+                begin
+                if gi^.Kind = gtGenericFaller then
+                    begin
+                    gi^.Active:= true;
+                    gi^.X:=  int2hwFloat(GetRandom(rightX-leftX)+leftX);
+                    gi^.Y:=  int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY);
+                    gi^.dX:= _90-(GetRandomf*_360);
+                    gi^.dY:= _90-(GetRandomf*_360)
+                    end;
+                gi := gi^.NextGear
+                end
+            end;
+
+        if Gear^.Timer = 500 then
+            begin
+(* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up
+   voices. Reinforcements voices is heard for active team, not team-to-be.  Either that or change crate spawn from end of turn to start, although that
+   has its own complexities. *)
+            // Abuse a couple of gear values to track origin
+            Gear^.Angle:= hwRound(Gear^.Y);
+            Gear^.Tag:= random(2);
+            inc(Gear^.Timer)
+            end;
+        if Gear^.Timer < 1833 then inc(Gear^.Timer);
+        if Gear^.Timer = 1000 then
+            begin
+            sparkles:= AddVisualGear(hwRound(Gear^.X), Gear^.Angle, vgtDust, 1);
+            if sparkles <> nil then
+                begin
+                sparkles^.dX:= 0;
+                sparkles^.dY:= 0;
+                sparkles^.Angle:= 270;
+                if Gear^.Tag = 1 then 
+                    sparkles^.Tint:= $3744D7FF
+                else sparkles^.Tint:= $FAB22CFF
+                end;
+            end;
+        if Gear^.Timer < 1000 then 
+            begin
+            AllInactive:= false;
+            exit
+            end
+        end;
 
     if (Gear^.Damage > 0) or exBoom then
-    begin
+        begin
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
         hog:= Gear^.Hedgehog;
@@ -2158,52 +1749,63 @@ begin
         // <-- delete gear!
 
         if k = gtCase then
-        begin
+            begin
             doMakeExplosion(x, y, 25, hog, EXPLAutoSound);
             for i:= 0 to 63 do
                 AddGear(x, y, gtFlame, 0, _0, _0, 0);
-        end
+            end
         else if k = gtExplosives then
-            begin
+                begin
                 doMakeExplosion(x, y, 75, hog, EXPLAutoSound);
                 for i:= 0 to 31 do
-                begin
-                    dX := AngleCos(i * 64) * _0_5 * (getrandom + _1);
-                    dY := AngleSin(i * 64) * _0_5 * (getrandom + _1);
+                    begin
+                    dX := AngleCos(i * 64) * _0_5 * (getrandomf + _1);
+                    dY := AngleSin(i * 64) * _0_5 * (getrandomf + _1);
                     AddGear(x, y, gtFlame, 0, dX, dY, 0);
                     AddGear(x, y, gtFlame, gstTmpFlag, -dX, -dY, 0);
-                end
-            end;
-        exit
-    end;
+                    end
+                end;
+            exit
+        end;
 
-    if (Gear^.dY.QWordValue <> 0) or (TestCollisionYwithGear(Gear, 1) = 0) then
-    begin
+    if (Gear^.dY.QWordValue <> 0)
+    or (TestCollisionYwithGear(Gear, 1) = 0) then
+        begin
         AllInactive := false;
+
         Gear^.dY := Gear^.dY + cGravity;
+
+        if (Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, -1) <> 0) then
+            Gear^.dY := _0;
+
         Gear^.Y := Gear^.Y + Gear^.dY;
-        if (not Gear^.dY.isNegative) and (Gear^.dY > _0_001) then SetAllHHToActive;
-        if (Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, -1) <> 0) then Gear^.dY := _0;
+
+        if (not Gear^.dY.isNegative) and (Gear^.dY > _0_001) then
+            SetAllHHToActive;
+
         if (not Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, 1) <> 0) then
-        begin
+            begin
             if (Gear^.dY > _0_2) and (k = gtExplosives) then
                 inc(Gear^.Damage, hwRound(Gear^.dY * _70));
 
             if Gear^.dY > _0_2 then
                 for i:= min(12, hwRound(Gear^.dY*_10)) downto 0 do
-                    AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust)
-            ;
+                    AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
+                    
             Gear^.dY := - Gear^.dY * Gear^.Elasticity;
-            if Gear^.dY > - _0_001 then Gear^.dY := _0
+            if Gear^.dY > - _0_001 then
+                Gear^.dY := _0
             else if Gear^.dY < - _0_03 then
-                     PlaySound(Gear^.ImpactSound);
-        end;
+                PlaySound(Gear^.ImpactSound);
+            end;
         //if Gear^.dY > - _0_001 then Gear^.dY:= _0
         CheckGearDrowning(Gear);
-    end;
+        end;
 
-    if (Gear^.dY.QWordValue = 0) then AddGearCI(Gear)
-    else if (Gear^.dY.QWordValue <> 0) then DeleteCI(Gear)
+    if (Gear^.dY.QWordValue = 0) then
+        AddGearCI(Gear)
+    else if (Gear^.dY.QWordValue <> 0) then
+        DeleteCI(Gear)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2218,13 +1820,13 @@ begin
     else if Gear^.Tag = 1 then
         Gear^.Tag := 2
     else if Gear^.Tag = 2 then
-             if Gear^.Timer > 0 then
-                 dec(Gear^.Timer)
+            if Gear^.Timer > 0 then
+                dec(Gear^.Timer)
     else
-    begin
+        begin
         DeleteGear(Gear);
         exit;
-    end;
+        end;
 
     doStepCase(Gear)
 end;
@@ -2235,10 +1837,10 @@ begin
     AllInactive := false;
     dec(Gear^.Timer);
     if Gear^.Timer = 0 then
-    begin
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2291,7 +1893,7 @@ begin
     if not sticky then AllInactive := false;
 
     if TestCollisionYwithGear(Gear, 1) = 0 then
-    begin
+        begin
         AllInactive := false;
 
         if ((GameTicks mod 100) = 0) then
@@ -2308,26 +1910,29 @@ begin
 
         if Gear^.dX.QWordValue > _0_01.QWordValue then
             Gear^.dX := Gear^.dX * _0_995;
+            
         Gear^.dY := Gear^.dY + cGravity;
         // if sticky then Gear^.dY := Gear^.dY + cGravity;
-        if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995;
+        
+        if Gear^.dY.QWordValue > _0_2.QWordValue then
+            Gear^.dY := Gear^.dY * _0_995;
 
         //if sticky then Gear^.X := Gear^.X + Gear^.dX else
         Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640;
         Gear^.Y := Gear^.Y + Gear^.dY;
 
         if (hwRound(Gear^.Y) > cWaterLine) then
-        begin
+            begin
             gX := hwRound(Gear^.X);
             for i:= 0 to 3 do
                 AddVisualGear(gX - 16 + Random(32), cWaterLine - 16 + Random(16), vgtSteam);
             PlaySound(sndVaporize);
             DeleteGear(Gear);
             exit
+            end
         end
-    end
     else
-    begin
+        begin
         if sticky then
             begin
             Gear^.Radius := 7;
@@ -2348,7 +1953,7 @@ begin
             inc(Gear^.Damage)
             end
         else
-        begin
+            begin
             gX := hwRound(Gear^.X);
             gY := hwRound(Gear^.Y);
             // Standard fire
@@ -2368,12 +1973,16 @@ begin
                     Gear^.dY:= tdY;
                     Gear^.Radius := 1;
                     end
-                else if ((GameTicks and $3) = 3) then doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
+                else if ((GameTicks and $3) = 3) then
+                    doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
                 //DrawExplosion(gX, gY, 4);
+                
                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
-                    for i:= 1 to Random(2)+1 do
+                    for i:= Random(2) downto 0 do
                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
-                if Gear^.Health > 0 then dec(Gear^.Health);
+                        
+                if Gear^.Health > 0 then
+                    dec(Gear^.Health);
                 Gear^.Timer := 450 - Gear^.Tag * 8
                 end
             else
@@ -2383,40 +1992,33 @@ begin
                     begin
                     DrawExplosion(gX, gY, 4);
 
-                    for i:= 0 to Random(3) do
+                    for i:= Random(3) downto 0 do
                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
                     end;
 
 // This one is interesting.  I think I understand the purpose, but I wonder if a bit more fuzzy of kicking could be done with getrandom.
                 Gear^.Timer := 100 - Gear^.Tag * 3;
-                if (Gear^.Damage > 3000+Gear^.Tag*1500) then Gear^.Health := 0
+                if (Gear^.Damage > 3000+Gear^.Tag*1500) then
+                    Gear^.Health := 0
+                end
             end
-        end
-    end;
+        end;
     if Gear^.Health = 0 then
-    begin
+        begin
         gX := hwRound(Gear^.X);
         gY := hwRound(Gear^.Y);
         if not sticky then
-        begin
-            if ((GameTicks and $3) = 0) and (Random(1) = 0) then
             begin
-                for i:= 1 to Random(2)+1 do
-                begin
+            if ((GameTicks and $3) = 0) and (Random(1) = 0) then
+                for i:= Random(2) downto 0 do
                     AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
-                end;
-            end;
-        end
+            end
         else
-        begin
-            for i:= 0 to Random(3) do
-            begin
+            for i:= Random(3) downto 0 do
                 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
-            end;
-        end;
 
         DeleteGear(Gear)
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2426,35 +2028,35 @@ var
 begin
     AllInactive := false;
     if ((Gear^.Message and gmDestroy) <> 0) then
-    begin
+        begin
         DeleteGear(Gear);
         AfterAttack;
         exit
-    end;
+        end;
 
     HHGear := Gear^.Hedgehog^.Gear;
     if hwRound(HHGear^.Y) <= Gear^.Tag - 2 then
-    begin
+        begin
         Gear^.Tag := hwRound(HHGear^.Y);
         DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y - _1, _0_5, _0, cHHRadius * 4, 2);
         HHGear^.State := HHGear^.State or gstNoDamage;
         Gear^.Y := HHGear^.Y;
         AmmoShove(Gear, 30, 40);
-        HHGear^.State := HHGear^.State and not gstNoDamage
-    end;
+        HHGear^.State := HHGear^.State and (not gstNoDamage)
+        end;
 
     HHGear^.dY := HHGear^.dY + cGravity;
     if not (HHGear^.dY.isNegative) then
-    begin
+        begin
         HHGear^.State := HHGear^.State or gstMoving;
         DeleteGear(Gear);
         AfterAttack;
         exit
-    end;
+        end;
 
     if CheckLandValue(hwRound(HHGear^.X), hwRound(HHGear^.Y + HHGear^.dY + SignAs(_6,Gear^.dY)),
-       lfIndestructible) then
-        HHGear^.Y := HHGear^.Y + HHGear^.dY
+        lfIndestructible) then
+            HHGear^.Y := HHGear^.Y + HHGear^.dY
 end;
 
 procedure doStepFirePunch(Gear: PGear);
@@ -2475,7 +2077,7 @@ begin
     Gear^.doStep := @doStepFirePunchWork;
     DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5);
 
-    PlaySound(TSound(ord(sndFirePunch1) + GetRandom(6)), HHGear^.Hedgehog^.Team^.voicepack)
+    PlaySoundV(TSound(ord(sndFirePunch1) + GetRandom(6)), HHGear^.Hedgehog^.Team^.voicepack)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2489,29 +2091,36 @@ begin
     inc(Gear^.Timer);
 
     if (TestCollisionYwithGear(HHGear, 1) <> 0)
-       or ((HHGear^.State and gstHHDriven) = 0)
-       or CheckGearDrowning(HHGear)
-       or ((Gear^.Message and gmAttack) <> 0) then
-    begin
-        with HHGear^ do
+    or ((HHGear^.State and gstHHDriven) = 0)
+    or CheckGearDrowning(HHGear)
+    or ((Gear^.Message and gmAttack) <> 0) then
         begin
+        with HHGear^ do
+            begin
             Message := 0;
             SetLittle(dX);
             dY := _0;
             State := State or gstMoving;
-        end;
+            end;
         DeleteGear(Gear);
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
         exit
-    end;
+        end;
 
     HHGear^.X := HHGear^.X + cWindSpeed * 200;
 
-    if (Gear^.Message and gmLeft) <> 0 then HHGear^.X := HHGear^.X - cMaxWindSpeed * 80
-    else if (Gear^.Message and gmRight) <> 0 then HHGear^.X := HHGear^.X + cMaxWindSpeed * 80;
-    if (Gear^.Message and gmUp) <> 0 then HHGear^.Y := HHGear^.Y - cGravity * 40
-    else if (Gear^.Message and gmDown) <> 0 then HHGear^.Y := HHGear^.Y + cGravity * 40;
+    if (Gear^.Message and gmLeft) <> 0 then
+        HHGear^.X := HHGear^.X - cMaxWindSpeed * 80
+        
+    else if (Gear^.Message and gmRight) <> 0 then
+        HHGear^.X := HHGear^.X + cMaxWindSpeed * 80;
+        
+    if (Gear^.Message and gmUp) <> 0 then
+        HHGear^.Y := HHGear^.Y - cGravity * 40
+        
+    else if (Gear^.Message and gmDown) <> 0 then
+        HHGear^.Y := HHGear^.Y + cGravity * 40;
 
     // don't drift into obstacles
     if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
@@ -2531,8 +2140,8 @@ begin
 
     AfterAttack;
 
-    HHGear^.State := HHGear^.State and not (gstAttacking or gstAttacked or gstMoving);
-    HHGear^.Message := HHGear^.Message and not gmAttack;
+    HHGear^.State := HHGear^.State and (not (gstAttacking or gstAttacked or gstMoving));
+    HHGear^.Message := HHGear^.Message and (not gmAttack);
 
     Gear^.doStep := @doStepParachuteWork;
 
@@ -2549,31 +2158,27 @@ begin
     if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then
         begin
         dec(Gear^.Health);
-        case Gear^.State of 
-            0: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed *
-                             Gear^.Tag, _0, 0);
-            1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed *
-                             Gear^.Tag, _0, 0);
-            2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed *
-                             Gear^.Tag, _0, 0);
-            3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed *
-                             Gear^.Tag, _0, Gear^.Timer + 1);
+            case Gear^.State of 
+                0: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
+                1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed * Gear^.Tag, _0, 0);
+                2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
+                3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed * Gear^.Tag, _0, Gear^.Timer + 1);
             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
             //                 Gear^.Tag, _0, 5000);
             end;
         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag);
-        StopSound(Gear^.SoundChannel, 4000);
+        StopSoundChan(Gear^.SoundChannel, 4000);
         end;
 
     if (GameTicks and $3F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
 
-    if (hwRound(Gear^.X) > (LAND_WIDTH+2048)) or (hwRound(Gear^.X) < -2048) then
-    begin
+    if (hwRound(Gear^.X) > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) < -2048) then
+        begin
         // avoid to play forever (is this necessary?)
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         DeleteGear(Gear)
-    end;
+        end;
 end;
 
 procedure doStepAirAttack(Gear: PGear);
@@ -2581,15 +2186,15 @@ begin
     AllInactive := false;
 
     if Gear^.X.QWordValue = 0 then
-    begin
+        begin
         Gear^.Tag :=  1;
         Gear^.X := -_2048;
-    end
+        end
     else
-    begin
+        begin
         Gear^.Tag := -1;
-        Gear^.X := int2hwFloat(LAND_WIDTH + 2048);
-    end;
+        Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048);
+        end;
 
     Gear^.Y := int2hwFloat(topY-300);
     Gear^.dX := int2hwFloat(Gear^.Target.X - 5 * Gear^.Tag * 15);
@@ -2615,12 +2220,12 @@ begin
     AllInactive := false;
     doStepFallingGear(Gear);
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
         DeleteGear(Gear);
         performRumble();
         exit
-    end;
+        end;
     if (GameTicks and $3F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
 end;
@@ -2640,27 +2245,25 @@ begin
     x := HHGear^.X;
     y := HHGear^.Y;
 
-    if (Distance(tx - x, ty - y) > _256) or
-       not TryPlaceOnLand(Gear^.Target.X - SpritesData[sprAmGirder].Width div 2,
-       Gear^.Target.Y - SpritesData[sprAmGirder].Height div 2,
-       sprAmGirder, Gear^.State, true, false) then
-    begin
+    if (Distance(tx - x, ty - y) > _256)
+    or (not TryPlaceOnLand(Gear^.Target.X - SpritesData[sprAmGirder].Width div 2, Gear^.Target.Y - SpritesData[sprAmGirder].Height div 2, sprAmGirder, Gear^.State, true, false)) then
+        begin
         PlaySound(sndDenied);
-        HHGear^.Message := HHGear^.Message and not gmAttack;
-        HHGear^.State := HHGear^.State and not gstAttacking;
+        HHGear^.Message := HHGear^.Message and (not gmAttack);
+        HHGear^.State := HHGear^.State and (not gstAttacking);
         HHGear^.State := HHGear^.State or gstHHChooseTarget;
         isCursorVisible := true;
         DeleteGear(Gear)
-    end
+        end
     else 
-    begin
+        begin
         PlaySound(sndPlaced);
         DeleteGear(Gear);
         AfterAttack;
-    end;
+        end;
 
-    HHGear^.State := HHGear^.State and not (gstAttacking or gstAttacked);
-    HHGear^.Message := HHGear^.Message and not gmAttack;
+    HHGear^.State := HHGear^.State and (not (gstAttacking or gstAttacked));
+    HHGear^.Message := HHGear^.Message and (not gmAttack);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2668,30 +2271,34 @@ procedure doStepTeleportAfter(Gear: PGear);
 var 
     HHGear: PGear;
 begin
-    Gear^.Hedgehog^.Unplaced := false;
     HHGear := Gear^.Hedgehog^.Gear;
-    HHGear^.Y := HHGear^.Y + HHGear^.dY;
-    HHGear^.X := HHGear^.X + HHGear^.dX;
-    // hedgehog falling to collect cases
-    HHGear^.dY := HHGear^.dY + cGravity;
-    if (TestCollisionYwithGear(HHGear, 1) <> 0)
-       or CheckGearDrowning(HHGear) then
-    begin
+    doStepHedgehogMoving(HHGear);
+    // if not infattack mode wait for hedgehog finish falling to collect cases
+    if ((GameFlags and gfInfAttack) <> 0)
+    or ((HHGear^.State and gstMoving) = 0)
+    or (Gear^.Hedgehog^.Gear^.Damage > 0)
+    or ((HHGear^.State and gstDrowning) = 1) then
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end
+        end
 end;
 
 procedure doStepTeleportAnim(Gear: PGear);
 begin
+    if (Gear^.Hedgehog^.Gear^.Damage > 0) then
+        begin
+        DeleteGear(Gear);
+        AfterAttack;
+        end;
     inc(Gear^.Timer);
     if Gear^.Timer = 65 then
-    begin
+        begin
         Gear^.Timer := 0;
         inc(Gear^.Pos);
         if Gear^.Pos = 11 then
             Gear^.doStep := @doStepTeleportAfter
-    end;
+        end;
 end;
 
 procedure doStepTeleport(Gear: PGear);
@@ -2702,18 +2309,18 @@ begin
 
     HHGear := Gear^.Hedgehog^.Gear;
     if not TryPlaceOnLand(Gear^.Target.X - SpritesData[sprHHTelepMask].Width div 2,
-       Gear^.Target.Y - SpritesData[sprHHTelepMask].Height div 2,
-       sprHHTelepMask, 0, false, false) then
-    begin
-        HHGear^.Message := HHGear^.Message and not gmAttack;
-        HHGear^.State := HHGear^.State and not gstAttacking;
+        Gear^.Target.Y - SpritesData[sprHHTelepMask].Height div 2,
+        sprHHTelepMask, 0, false, false) then
+        begin
+        HHGear^.Message := HHGear^.Message and (not gmAttack);
+        HHGear^.State := HHGear^.State and (not gstAttacking);
         HHGear^.State := HHGear^.State or gstHHChooseTarget;
         DeleteGear(Gear);
         isCursorVisible := true;
         PlaySound(sndDenied)
-    end
+        end
     else
-    begin
+        begin
         DeleteCI(HHGear);
         SetAllHHToActive;
         Gear^.doStep := @doStepTeleportAnim;
@@ -2727,8 +2334,10 @@ begin
         HHGear^.X := int2hwFloat(Gear^.Target.X);
         HHGear^.Y := int2hwFloat(Gear^.Target.Y);
         HHGear^.State := HHGear^.State or gstMoving;
+        Gear^.Hedgehog^.Unplaced := false;
+        isCursorVisible := false;
         playSound(sndWarp)
-    end;
+        end;
     Gear^.Target.X:= NoPointX
 end;
 
@@ -2736,54 +2345,53 @@ end;
 procedure doStepSwitcherWork(Gear: PGear);
 var 
     HHGear: PGear;
-    Msg, State: Longword;
+    hedgehog: PHedgehog;
+    State: Longword;
 begin
     AllInactive := false;
 
-    if ((Gear^.Message and not gmSwitch) <> 0) or (TurnTimeLeft = 0) then
-    begin
-        HHGear := Gear^.Hedgehog^.Gear;
-        Msg := Gear^.Message and not gmSwitch;
+    if ((Gear^.Message and (not gmSwitch)) <> 0) or (TurnTimeLeft = 0) then
+        begin
+        hedgehog := Gear^.Hedgehog;
+        //Msg := Gear^.Message and (not gmSwitch);
         DeleteGear(Gear);
-        ApplyAmmoChanges(HHGear^.Hedgehog^);
+        ApplyAmmoChanges(hedgehog^);
 
         HHGear := CurrentHedgehog^.Gear;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
-        HHGear^.Message := Msg;
+        //HHGear^.Message := Msg;
         exit
-    end;
+        end;
 
     if (Gear^.Message and gmSwitch) <> 0 then
-    begin
+        begin
         HHGear := CurrentHedgehog^.Gear;
-        HHGear^.Message := HHGear^.Message and not gmSwitch;
-        Gear^.Message := Gear^.Message and not gmSwitch;
+        HHGear^.Message := HHGear^.Message and (not gmSwitch);
+        Gear^.Message := Gear^.Message and (not gmSwitch);
         State := HHGear^.State;
         HHGear^.State := 0;
-        HHGear^.Active := false;
         HHGear^.Z := cHHZ;
-        RemoveGearFromList(HHGear);
-        InsertGearToList(HHGear);
+        HHGear^.Active := false;
+        HHGear^.Message:= HHGear^.Message or gmRemoveFromList or gmAddToList;
 
         PlaySound(sndSwitchHog);
 
         repeat
-            CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.
-                                         HedgehogsNumber);
+            CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber);
         until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0);
 
-        CurrentHedgehog := @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog];
+        SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+        AmmoMenuInvalidated:= true; 
 
         HHGear := CurrentHedgehog^.Gear;
         HHGear^.State := State;
         HHGear^.Active := true;
         FollowGear := HHGear;
         HHGear^.Z := cCurrHHZ;
-        RemoveGearFromList(HHGear);
-        InsertGearToList(HHGear);
+        HHGear^.Message:= HHGear^.Message or gmRemoveFromList or gmAddToList;
         Gear^.X := HHGear^.X;
         Gear^.Y := HHGear^.Y
-    end;
+        end;
 end;
 
 procedure doStepSwitcher(Gear: PGear);
@@ -2795,10 +2403,10 @@ begin
     HHGear := Gear^.Hedgehog^.Gear;
     OnUsedAmmo(HHGear^.Hedgehog^);
     with HHGear^ do
-    begin
-        State := State and not gstAttacking;
-        Message := Message and not gmAttack
-    end
+        begin
+        State := State and (not gstAttacking);
+        Message := Message and (not gmAttack)
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2814,21 +2422,21 @@ begin
 
     doStepFallingGear(Gear);
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLAutoSound);
 
         Gear^.dX.isNegative := not dxn;
         Gear^.dY.isNegative := not dyn;
         for i:= 0 to 4 do
-        begin
-            dX := Gear^.dX + (GetRandom - _0_5) * _0_03;
-            dY := Gear^.dY + (GetRandom - _0_5) * _0_03;
+            begin
+            dX := Gear^.dX + (GetRandomf - _0_5) * _0_03;
+            dY := Gear^.dY + (GetRandomf - _0_5) * _0_03;
             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25);
-        end;
+            end;
 
         DeleteGear(Gear);
         exit
-    end;
+        end;
 
     if (GameTicks and $3F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
@@ -2836,8 +2444,6 @@ end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepKamikazeWork(Gear: PGear);
-
-const upd: Longword =   0;
 var 
     i: LongWord;
     HHGear: PGear;
@@ -2846,7 +2452,8 @@ var
 begin
     AllInactive := false;
     hasWishes:= ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch));
-    if hasWishes then Gear^.AdvBounce:= 1;
+    if hasWishes then
+        Gear^.AdvBounce:= 1;
 
     HHGear := Gear^.Hedgehog^.Gear;
     HHGear^.State := HHGear^.State or gstNoDamage;
@@ -2860,7 +2467,7 @@ begin
         if sparkles <> nil then
             begin
             sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
-            sparkles^.Angle:= random * 360;
+            sparkles^.Angle:= random(360);
             end
         end;
 
@@ -2878,33 +2485,34 @@ begin
         //      or TestCollisionYwithGear(HHGear, hwSign(Gear^.dY)) then inc(Gear^.Damage, 3);
 
         dec(i)
-    until (i = 0) or (Gear^.Damage > Gear^.Health);
+    until (i = 0)
+    or (Gear^.Damage > Gear^.Health);
 
     inc(upd);
     if upd > 3 then
-    begin
-        if Gear^.Health < 1500 then
         begin
+        if Gear^.Health < 1500 then
+            begin
             if Gear^.AdvBounce <> 0 then
                 Gear^.Pos := 3
             else
                 Gear^.Pos := 2;
-        end;
+            end;
 
         AmmoShove(Gear, 30, 40);
 
         DrawTunnel(HHGear^.X - HHGear^.dX * 10,
-                   HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2,
+                    HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2,
         HHGear^.dX,
         HHGear^.dY,
         20 + cHHRadius * 2,
         cHHRadius * 2 + 7);
 
         upd := 0
-    end;
+        end;
 
     if Gear^.Health < Gear^.Damage then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
         if hasWishes then
             for i:= 0 to 31 do
@@ -2914,23 +2522,25 @@ begin
                     with sparkles^ do
                         begin
                         Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
-                        Angle:= random * 360;
+                        Angle:= random(360);
                         dx:= 0.001 * (random(200));
                         dy:= 0.001 * (random(200));
-                        if random(2) = 0 then dx := -dx;
-                        if random(2) = 0 then dy := -dy;
+                        if random(2) = 0 then
+                            dx := -dx;
+                        if random(2) = 0 then
+                            dy := -dy;
                         FrameTicks:= random(400) + 250
                         end
                 end;
         AfterAttack;
+        HHGear^.Message:= HHGear^.Message or gmDestroy;
         DeleteGear(Gear);
-        DeleteGear(HHGear);
     end
     else
-    begin
+        begin
         dec(Gear^.Health, Gear^.Damage);
         Gear^.Damage := 0
-    end
+        end
 end;
 
 procedure doStepKamikazeIdle(Gear: PGear);
@@ -2940,7 +2550,7 @@ begin
     if Gear^.Timer = 0 then
         begin
         Gear^.Pos := 1;
-        PlaySound(sndKamikaze, Gear^.Hedgehog^.Team^.voicepack);
+        PlaySoundV(sndKamikaze, Gear^.Hedgehog^.Team^.voicepack);
         Gear^.doStep := @doStepKamikazeWork
         end
 end;
@@ -2967,7 +2577,6 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 
 const cakeh =   27;
-    cakeDmg =   75;
 var 
     CakePoints: array[0..Pred(cakeh)] of record
         x, y: hwFloat;
@@ -2979,7 +2588,8 @@ begin
     AllInactive := false;
 
     inc(Gear^.Tag);
-    if Gear^.Tag < 2250 then exit;
+    if Gear^.Tag < 2250 then
+        exit;
 
     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, Gear^.Hedgehog, EXPLAutoSound);
     AfterAttack;
@@ -2989,112 +2599,87 @@ end;
 procedure doStepCakeDown(Gear: PGear);
 var 
     gi: PGear;
-    dmg: LongInt;
+    dmg, dmgBase: LongInt;
+    fX, fY, tdX, tdY: hwFloat;
 begin
     AllInactive := false;
 
     inc(Gear^.Tag);
-    if Gear^.Tag < 100 then exit;
+    if Gear^.Tag < 100 then
+        exit;
     Gear^.Tag := 0;
 
     if Gear^.Pos = 0 then
-    begin
+        begin
+///////////// adapted from doMakeExplosion ///////////////////////////
+        //fX:= Gear^.X;
+        //fY:= Gear^.Y;
+        //fX.QWordValue:= fX.QWordValue and $FFFFFFFF00000000;
+        //fY.QWordValue:= fY.QWordValue and $FFFFFFFF00000000;
+        fX:= int2hwFloat(hwRound(Gear^.X));
+        fY:= int2hwFloat(hwRound(Gear^.Y));
+        dmgBase:= cakeDmg shl 1 + cHHRadius div 2;
         gi := GearsList;
         while gi <> nil do
-        begin
-            dmg := cakeDmg * 2 - hwRound(Distance(gi^.X - Gear^.X, gi^.Y - Gear^.Y));
-            if (dmg > 1) and (gi^.Kind = gtHedgehog) then
-                if (CurrentHedgehog^.Gear = gi) and (not gi^.Invulnerable) then
-                    gi^.State := gi^.State or gstLoser
-            else
-                gi^.State := gi^.State or gstWinner;
+            begin
+            if gi^.Kind = gtHedgehog then
+                begin
+                dmg:= 0;
+                tdX:= gi^.X-fX;
+                tdY:= gi^.Y-fY;
+                if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
+                    dmg:= dmgBase - max(hwRound(Distance(tdX, tdY)),gi^.Radius);
+                if (dmg > 1) then dmg:= ModifyDamage(min(dmg div 2, cakeDmg), gi);
+                if (dmg > 1) then
+                    if (CurrentHedgehog^.Gear = gi) and (not gi^.Invulnerable) then
+                        gi^.State := gi^.State or gstLoser
+                    else
+                        gi^.State := gi^.State or gstWinner;
+                end;
             gi := gi^.NextGear
-        end;
+            end;
+//////////////////////////////////////////////////////////////////////
         Gear^.doStep := @doStepCakeExpl;
         PlaySound(sndCake)
-    end
+        end
     else dec(Gear^.Pos)
 end;
 
 
 procedure doStepCakeWork(Gear: PGear);
-
-const dirs: array[0..3] of TPoint =   ((x: 0; y: -1), (x: 1; y: 0),(x: 0; y: 1),(x: -1; y: 0));
-var 
-    xx, yy, xxn, yyn: LongInt;
-    da: LongInt;
+var
     tdx, tdy: hwFloat;
-
-procedure PrevAngle;
-begin
-    Gear^.Angle := (LongInt(Gear^.Angle) + 4 - dA) mod 4
-end;
-
-procedure NextAngle;
-begin
-    Gear^.Angle := (LongInt(Gear^.Angle) + 4 + dA) mod 4
-end;
-
 begin
     AllInactive := false;
 
     inc(Gear^.Tag);
-    if Gear^.Tag < 7 then exit;
-
-    dA := hwSign(Gear^.dX);
-    xx := dirs[Gear^.Angle].x;
-    yy := dirs[Gear^.Angle].y;
-    xxn := dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x;
-    yyn := dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y;
+    if Gear^.Tag < 7 then
+        exit;
 
-    if (xx = 0) then
-        if TestCollisionYwithGear(Gear, yy) <> 0 then
-            PrevAngle
-    else
-    begin
-        Gear^.Tag := 0;
-        Gear^.Y := Gear^.Y + int2hwFloat(yy);
-        if not TestCollisionXwithGear(Gear, xxn) then
+    dec(Gear^.Health);
+    Gear^.Timer := Gear^.Health*10;
+    if Gear^.Health mod 100 = 0 then
+        Gear^.PortalCounter:= 0;
+    // This is not seconds, but at least it is *some* feedback
+    if (Gear^.Health = 0) or ((Gear^.Message and gmAttack) <> 0) then
         begin
-            Gear^.X := Gear^.X + int2hwFloat(xxn);
-            NextAngle
+        FollowGear := Gear;
+        Gear^.RenderTimer := false;
+        Gear^.doStep := @doStepCakeDown;
+        exit
         end;
-    end;
 
-    if (yy = 0) then
-        if TestCollisionXwithGear(Gear, xx) then
-            PrevAngle
-    else
-    begin
-        Gear^.Tag := 0;
-        Gear^.X := Gear^.X + int2hwFloat(xx);
-        if not TestCollisionY(Gear, yyn) then
-        begin
-            Gear^.Y := Gear^.Y + int2hwFloat(yyn);
-            NextAngle
-        end;
-    end;
+    cakeStep(Gear);
 
     if Gear^.Tag = 0 then
-    begin
+        begin
         CakeI := (CakeI + 1) mod cakeh;
         tdx := CakePoints[CakeI].x - Gear^.X;
         tdy := - CakePoints[CakeI].y + Gear^.Y;
         CakePoints[CakeI].x := Gear^.X;
         CakePoints[CakeI].y := Gear^.Y;
         Gear^.DirAngle := DxDy2Angle(tdx, tdy);
-    end;
-
-    dec(Gear^.Health);
-    Gear^.Timer := Gear^.Health*10;
-    if Gear^.Health mod 100 = 0 then Gear^.PortalCounter:= 0;
-    // This is not seconds, but at least it is *some* feedback
-    if (Gear^.Health = 0) or ((Gear^.Message and gmAttack) <> 0) then
-    begin
-        FollowGear := Gear;
-        Gear^.RenderTimer := false;
-        Gear^.doStep := @doStepCakeDown
-    end
+        end;
 end;
 
 procedure doStepCakeUp(Gear: PGear);
@@ -3104,20 +2689,22 @@ begin
     AllInactive := false;
 
     inc(Gear^.Tag);
-    if Gear^.Tag < 100 then exit;
+    if Gear^.Tag < 100 then
+        exit;
     Gear^.Tag := 0;
 
     if Gear^.Pos = 6 then
-    begin
-        for i:= 0 to Pred(cakeh) do
         begin
+        for i:= 0 to Pred(cakeh) do
+            begin
             CakePoints[i].x := Gear^.X;
             CakePoints[i].y := Gear^.Y
-        end;
+            end;
         CakeI := 0;
         Gear^.doStep := @doStepCakeWork
-    end
-    else inc(Gear^.Pos)
+        end
+    else
+        inc(Gear^.Pos)
 end;
 
 procedure doStepCakeFall(Gear: PGear);
@@ -3125,11 +2712,13 @@ begin
     AllInactive := false;
 
     Gear^.dY := Gear^.dY + cGravity;
-    if TestCollisionYwithGear(Gear, 1) <> 0 then Gear^.doStep := @doStepCakeUp
+    if TestCollisionYwithGear(Gear, 1) <> 0 then
+        Gear^.doStep := @doStepCakeUp
     else
         begin
         Gear^.Y := Gear^.Y + Gear^.dY;
-        if CheckGearDrowning(Gear) then AfterAttack
+        if CheckGearDrowning(Gear) then
+            AfterAttack
         end
 end;
 
@@ -3141,8 +2730,7 @@ begin
 
     HHGear := Gear^.Hedgehog^.Gear;
     HHGear^.Message := HHGear^.Message and (not gmAttack);
-    DeleteCI(HHGear);
-    Gear^.IntersectGear:= nil;
+    Gear^.CollisionMask:= $FF7F;
 
     FollowGear := Gear;
 
@@ -3152,23 +2740,22 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSeductionWork(Gear: PGear);
 var i: LongInt;
-    hogs: TPGearArray;
+    hogs: PGearArrayS;
 begin
     AllInactive := false;
     hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Radius);
-    if Length(hogs) > 0 then
+    if hogs.size > 0 then
         begin
-        for i:= 0 to High(hogs) do
-            begin
-            if hogs[i] <> CurrentHedgehog^.Gear then
+        for i:= 0 to hogs.size - 1 do
+            with hogs.ar^[i]^ do
                 begin
-                //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
-                hogs[i]^.dX:= _50 * cGravity * (Gear^.X - hogs[i]^.X) / _25;
-                //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
-                hogs[i]^.dY:= -_450 * cGravity;
-                hogs[i]^.Active:= true;
-                end
-            end;
+                if hogs.ar^[i] <> CurrentHedgehog^.Gear then
+                    begin
+                    dX:= _50 * cGravity * (Gear^.X - X) / _25;
+                    dY:= -_450 * cGravity;
+                    Active:= true;
+                    end
+                end;
         end ;
         AfterAttack;
         DeleteGear(Gear);
@@ -3207,7 +2794,7 @@ begin
         Gear^.Timer := 0;
         inc(Gear^.Pos);
         if Gear^.Pos = 5 then
-            PlaySound(sndYoohoo, Gear^.Hedgehog^.Team^.voicepack)
+            PlaySoundV(sndYoohoo, Gear^.Hedgehog^.Team^.voicepack)
         end;
 
     if (Gear^.Pos = 14) and (RealTicks and $3 = 0) then
@@ -3218,8 +2805,10 @@ begin
                 begin
                 dx:= 0.001 * (random(200));
                 dy:= 0.001 * (random(200));
-                if random(2) = 0 then dx := -dx;
-                if random(2) = 0 then dy := -dy;
+                if random(2) = 0 then
+                    dx := -dx;
+                if random(2) = 0 then
+                    dy := -dy;
                 FrameTicks:= random(750) + 1000;
                 State:= ord(sprSeduction)
                 end;
@@ -3241,10 +2830,11 @@ procedure doStepWaterUp(Gear: PGear);
 var 
     i: LongWord;
 begin
-    if (Gear^.Tag = 0) or (cWaterLine = 0) then
+    if (Gear^.Tag = 0)
+    or (cWaterLine = 0) then
         begin
-            DeleteGear(Gear);
-            exit
+        DeleteGear(Gear);
+        exit
         end;
 
     AllInactive := false;
@@ -3256,12 +2846,12 @@ begin
         exit;
 
     if cWaterLine > 0 then
-    begin
+        begin
         dec(cWaterLine);
         for i:= 0 to LAND_WIDTH - 1 do
             Land[cWaterLine, i] := 0;
         SetAllToActive
-    end;
+        end;
 
     dec(Gear^.Tag);
 end;
@@ -3287,23 +2877,25 @@ begin
         if (Gear^.Timer mod 30) = 0 then
             AddVisualGear(hwRound(Gear^.X + _20 * Gear^.dX), hwRound(Gear^.Y + _20 * Gear^.dY), vgtDust);
         if (CheckGearDrowning(Gear)) then
-        begin
-            StopSound(Gear^.SoundChannel);
+            begin
+            StopSoundChan(Gear^.SoundChannel);
             exit
         end
     end;
 
-    t := CheckGearsCollision(Gear);
+    if GameTicks > Gear^.FlightTime then
+        t := CheckGearsCollision(Gear)
+        
+    else t := nil;
     //fixes drill not exploding when touching HH bug
-    if (Gear^.Timer = 0) or (t^.Count <> 0) or 
-       ( ((Gear^.State and gsttmpFlag) = 0) and
-         (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0)
-         and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)))
+    
+    if (Gear^.Timer = 0) or ((t <> nil) and (t^.Count <> 0))
+    or ( ((Gear^.State and gsttmpFlag) = 0) and (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))))
 // CheckLandValue returns true if the type isn't matched
-       or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then
+    or (not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible)) then
         begin
         //out of time or exited ground
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         if (Gear^.State and gsttmpFlag) <> 0 then
             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound)
         else
@@ -3311,9 +2903,10 @@ begin
         DeleteGear(Gear);
         exit
         end
-    else if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) then
+        
+    else if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) = 0) and (not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) then
         begin
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Tag := 1;
         Gear^.doStep := @doStepDrill
         end;
@@ -3341,21 +2934,25 @@ begin
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
 
     if ((Gear^.State and gstCollision) <> 0) then
-    begin
+        begin
         //hit
         Gear^.dX := oldDx;
         Gear^.dY := oldDy;
 
-        t := CheckGearsCollision(Gear);
-        if (t^.Count = 0) then
-        begin
+        if GameTicks > Gear^.FlightTime then 
+            t := CheckGearsCollision(Gear)
+        else
+            t := nil;
+        if (t = nil) or (t^.Count = 0) then
+            begin
             //hit the ground not the HH
             t2 := _0_5 / Distance(Gear^.dX, Gear^.dY);
             Gear^.dX := Gear^.dX * t2;
             Gear^.dY := Gear^.dY * t2;
-        end
-        else
-        begin
+            end
+            
+        else if (t <> nil) then
+            begin
             //explode right on contact with HH
             if (Gear^.State and gsttmpFlag) <> 0 then
                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound)
@@ -3363,30 +2960,31 @@ begin
                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
             DeleteGear(Gear);
             exit;
-        end;
+            end;
 
         Gear^.SoundChannel := LoopSound(sndDrillRocket);
         Gear^.doStep := @doStepDrillDrilling;
+        
         if (Gear^.State and gsttmpFlag) <> 0 then
             gear^.RenderTimer:= true;
-        dec(Gear^.Timer)
-    end
+        if Gear^.Timer > 0 then dec(Gear^.Timer)
+        end
     else if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Tag <> 0) then
-         begin
-            if Gear^.Timer = 0 then
+        begin
+        if Gear^.Timer > 0 then 
+            dec(Gear^.Timer)
+        else
             begin
-                doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
-                DeleteGear(Gear);
+            doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound);
+            DeleteGear(Gear);
             end
-            else
-                dec(Gear^.Timer);
-         end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBallgunWork(Gear: PGear);
 var 
-    HHGear: PGear;
+    HHGear, ball: PGear;
     rx, ry: hwFloat;
     gX, gY: LongInt;
 begin
@@ -3397,23 +2995,21 @@ begin
     gX := hwRound(Gear^.X) + GetLaunchX(amBallgun, hwSign(HHGear^.dX), HHGear^.Angle);
     gY := hwRound(Gear^.Y) + GetLaunchY(amBallgun, HHGear^.Angle);
     if (Gear^.Timer mod 100) = 0 then
-    begin
-        rx := rndSign(getRandom * _0_1);
-        ry := rndSign(getRandom * _0_1);
+        begin
+        rx := rndSign(getRandomf * _0_1);
+        ry := rndSign(getRandomf * _0_1);
 
-        AddGear(gx, gy, gtBall, 0,
-                SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx,
-        AngleCos(HHGear^.Angle) * ( - _0_8) + ry,
-        0);
+        ball:= AddGear(gx, gy, gtBall, 0, SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0);
+        ball^.CollisionMask:= $FF7F;
 
         PlaySound(sndGun);
-    end;
+        end;
 
-    if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then
-    begin
+    if (Gear^.Timer = 0) or ((HHGear^.State and gstHHDriven) = 0) then
+        begin
         DeleteGear(Gear);
         AfterAttack
-    end
+        end
 end;
 
 procedure doStepBallgun(Gear: PGear);
@@ -3421,7 +3017,7 @@ var
     HHGear: PGear;
 begin
     HHGear := Gear^.Hedgehog^.Gear;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmDown);
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown));
     HHGear^.State := HHGear^.State or gstNotKickable;
     Gear^.doStep := @doStepBallgunWork
 end;
@@ -3443,34 +3039,36 @@ begin
     HHGear := Gear^.Hedgehog^.Gear;
     FollowGear := Gear;
 
-    if Gear^.Timer > 0 then dec(Gear^.Timer);
+    if Gear^.Timer > 0 then
+        dec(Gear^.Timer);
 
     fChanged := false;
     if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then
-    begin
+        begin
         fChanged := true;
-        if Gear^.Angle > 2048 then dec(Gear^.Angle)
-        else
-            if Gear^.Angle < 2048 then inc(Gear^.Angle)
+        if Gear^.Angle > 2048 then
+            dec(Gear^.Angle)
+        else if Gear^.Angle < 2048 then
+            inc(Gear^.Angle)
         else fChanged := false
     end
     else
-    begin
-        if ((Gear^.Message and gmLeft) <> 0) then
         begin
+        if ((Gear^.Message and gmLeft) <> 0) then
+            begin
             fChanged := true;
             Gear^.Angle := (Gear^.Angle + (4096 - cAngleSpeed)) mod 4096
-        end;
+            end;
 
         if ((Gear^.Message and gmRight) <> 0) then
-        begin
+            begin
             fChanged := true;
             Gear^.Angle := (Gear^.Angle + cAngleSpeed) mod 4096
-        end
-    end;
+            end
+        end;
 
     if fChanged then
-    begin
+        begin
         Gear^.dX.isNegative := (Gear^.Angle > 2048);
         if Gear^.dX.isNegative then
             trueAngle := 4096 - Gear^.Angle
@@ -3479,7 +3077,7 @@ begin
 
         Gear^.dX := SignAs(AngleSin(trueAngle), Gear^.dX) * _0_25;
         Gear^.dY := AngleCos(trueAngle) * -_0_25;
-    end;
+        end;
 
     Gear^.X := Gear^.X + Gear^.dX;
     Gear^.Y := Gear^.Y + Gear^.dY;
@@ -3491,20 +3089,19 @@ begin
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
 
     if ((HHGear^.Message and gmAttack) <> 0) and (Gear^.Health <> 0) then
-    begin
-        HHGear^.Message := HHGear^.Message and not gmAttack;
+        begin
+        HHGear^.Message := HHGear^.Message and (not gmAttack);
         AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY *
         _0_5, 0);
         dec(Gear^.Health)
-    end;
+        end;
 
-    if ((HHGear^.Message and gmLJump) <> 0)
-       and ((Gear^.State and gsttmpFlag) = 0) then
-    begin
+    if ((HHGear^.Message and gmLJump) <> 0) and ((Gear^.State and gsttmpFlag) = 0) then
+        begin
         Gear^.State := Gear^.State or gsttmpFlag;
         PauseMusic;
         playSound(sndRideOfTheValkyries);
-    end;
+        end;
 
     // pickup bonuses
     t := CheckGearNear(Gear, gtCase, 36, 36);
@@ -3514,35 +3111,37 @@ begin
     CheckCollision(Gear);
 
     if ((Gear^.State and gstCollision) <> 0) or CheckGearDrowning(Gear) then
-    begin
-        StopSound(Gear^.SoundChannel);
+        begin
+        StopSoundChan(Gear^.SoundChannel);
         StopSound(sndRideOfTheValkyries);
         ResumeMusic;
 
         if ((Gear^.State and gstCollision) <> 0) then
-        begin
+            begin
             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, Gear^.Hedgehog, EXPLAutoSound);
             for i:= 0 to 15 do
-            begin
-                dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1);
-                dY := AngleSin(i * 64) * _0_5 * (GetRandom + _1);
+                begin
+                dX := AngleCos(i * 64) * _0_5 * (GetRandomf + _1);
+                dY := AngleSin(i * 64) * _0_5 * (GetRandomf + _1);
                 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0);
                 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0);
-            end;
+                end;
             DeleteGear(Gear)
-        end;
+            end;
 
         AfterAttack;
         CurAmmoGear := nil;
         if (GameFlags and gfInfAttack) = 0 then
             begin
-            if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
+            if TagTurnTimeLeft = 0 then
+                TagTurnTimeLeft:= TurnTimeLeft;
+                
             TurnTimeLeft:= 14 * 125;
             end;
 
         HHGear^.Message := 0;
-        ParseCommand('/taunt '#1, true)
-    end
+        ParseCommand('/taunt ' + #1, true)
+        end
 end;
 
 procedure doStepRCPlane(Gear: PGear);
@@ -3554,7 +3153,9 @@ begin
     HHGear^.State := HHGear^.State or gstNotKickable;
     Gear^.Angle := HHGear^.Angle;
     Gear^.Tag := hwSign(HHGear^.dX);
-    if HHGear^.dX.isNegative then Gear^.Angle := 4096 - Gear^.Angle;
+    
+    if HHGear^.dX.isNegative then
+        Gear^.Angle := 4096 - Gear^.Angle;
     Gear^.doStep := @doStepRCPlaneWork
 end;
 
@@ -3568,7 +3169,8 @@ var
     bubble: PVisualGear;
 begin
     isUnderwater:= cWaterLine < hwRound(Gear^.Y) + Gear^.Radius;
-    if Gear^.Pos > 0 then dec(Gear^.Pos);
+    if Gear^.Pos > 0 then
+        dec(Gear^.Pos);
     AllInactive := false;
     HHGear := Gear^.Hedgehog^.Gear;
     //dec(Gear^.Timer);
@@ -3592,7 +3194,8 @@ begin
                     for i:= random(10)+10 downto 0 do
                         begin
                         bubble := AddVisualGear(hwRound(HHGear^.X) - 8 + random(16), hwRound(HHGear^.Y) + 16 + random(8), vgtBubble);
-                        if bubble <> nil then bubble^.dY:= random(20)/10+0.1;
+                        if bubble <> nil then
+                            bubble^.dY:= random(20)/10+0.1;
                         end
                     end
                 else HHGear^.dY := HHGear^.dY - move;
@@ -3635,30 +3238,35 @@ begin
         Gear^.MsgParam := 0
         end;
 
-    if Gear^.Health < 0 then Gear^.Health := 0;
+    if Gear^.Health < 0 then
+        Gear^.Health := 0;
+        
     i:= Gear^.Health div 20;
+    
     if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
         begin
         Gear^.Damage:= i;
         //AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate);
         FreeTexture(Gear^.Tex);
-        Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
-                     '%', cWhiteColor, fntSmall)
+        Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) + '%', cWhiteColor, fntSmall)
         end;
 
-    if HHGear^.Message and (gmAttack or gmUp or gmPrecise or gmLeft or gmRight) <> 0 then Gear^
-        .State := Gear^.State and not gsttmpFlag;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
+    if HHGear^.Message and (gmAttack or gmUp or gmPrecise or gmLeft or gmRight) <> 0 then 
+        Gear^.State := Gear^.State and (not gsttmpFlag);
+        
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmPrecise or gmLeft or gmRight));
     HHGear^.State := HHGear^.State or gstMoving;
 
     Gear^.X := HHGear^.X;
     Gear^.Y := HHGear^.Y;
-    // For some reason I need to reapply followgear here, something else grabs it otherwise.
-    // This is probably not needed anymore
-    if not CurrentTeam^.ExtDriven then FollowGear := HHGear;
 
-    if not isUnderWater and hasBorder and ((HHGear^.X < _0) or (hwRound(HHGear^.X) > LAND_WIDTH)) then HHGear^.dY.isNegative:= false;
-    if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear);
+    if not isUnderWater and hasBorder and ((HHGear^.X < _0)
+    or (hwRound(HHGear^.X) > LAND_WIDTH)) then
+        HHGear^.dY.isNegative:= false;
+        
+    if ((Gear^.State and gsttmpFlag) = 0)
+    or (HHGear^.dY < _0) then
+        doStepHedgehogMoving(HHGear);
 
     if // (Gear^.Health = 0)
         (HHGear^.Damage <> 0)
@@ -3668,22 +3276,22 @@ begin
         // allow brief ground touches - to be fair on this, might need another counter
         or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and (TestCollisionYwithGear(HHGear, 1) <> 0))
         or ((Gear^.Message and gmAttack) <> 0) then
-        begin
-        with HHGear^ do
             begin
-            Message := 0;
-            Active := true;
-            State := State or gstMoving
-            end;
-        DeleteGear(Gear);
-        isCursorVisible := false;
-        ApplyAmmoChanges(HHGear^.Hedgehog^);
+            with HHGear^ do
+                begin
+                Message := 0;
+                Active := true;
+                State := State or gstMoving
+                end;
+            DeleteGear(Gear);
+            isCursorVisible := false;
+            ApplyAmmoChanges(HHGear^.Hedgehog^);
         //    if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
 
 //    Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall)
 
 //AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate);
-        end
+            end
 end;
 
 procedure doStepJetpack(Gear: PGear);
@@ -3697,15 +3305,16 @@ begin
     FollowGear := HHGear;
     AfterAttack;
     with HHGear^ do
-    begin
-        State := State and not gstAttacking;
-        Message := Message and not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight);
-        if (dY < _0_1) and (dY > -_0_1) then
         begin
+        State := State and (not gstAttacking);
+        Message := Message and (not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight));
+        
+        if (dY < _0_1) and (dY > -_0_1) then
+            begin
             Gear^.State := Gear^.State or gsttmpFlag;
             dY := dY - _0_2
+            end
         end
-    end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -3716,9 +3325,9 @@ begin
     if Gear^.Timer < 2000 then
         inc(Gear^.Timer, 1)
     else
-    begin
+        begin
         DeleteGear(Gear);
-    end;
+        end;
 end;
 
 procedure doStepBirdyFly(Gear: PGear);
@@ -3740,7 +3349,7 @@ begin
     if Gear^.Pos > 0 then
         dec(Gear^.Pos, 1)
     else if (HHGear^.Message and (gmLeft or gmRight or gmUp)) <> 0 then
-             Gear^.Pos := 500;
+            Gear^.Pos := 500;
 
     if HHGear^.dX.isNegative then
         Gear^.Tag := -1
@@ -3749,11 +3358,14 @@ begin
 
     if (HHGear^.Message and gmUp) <> 0 then
         begin
-        if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then
+        if (not HHGear^.dY.isNegative)
+        or (HHGear^.Y > -_256) then
             HHGear^.dY := HHGear^.dY - move;
+            
         dec(Gear^.Health, fuel);
         Gear^.MsgParam := Gear^.MsgParam or gmUp;
         end;
+        
     if (HHGear^.Message and gmLeft) <> 0 then move.isNegative := true;
     if (HHGear^.Message and (gmLeft or gmRight)) <> 0 then
         begin
@@ -3762,14 +3374,16 @@ begin
         Gear^.MsgParam := Gear^.MsgParam or (HHGear^.Message and (gmLeft or gmRight));
         end;
 
-    if Gear^.Health < 0 then Gear^.Health := 0;
+    if Gear^.Health < 0 then
+        Gear^.Health := 0;
+        
     if ((GameTicks and $FF) = 0) and (Gear^.Health < 500) then
         for i:= ((500-Gear^.Health) div 250) downto 0 do
             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather);
 
     if (HHGear^.Message and gmAttack <> 0) then
         begin
-        HHGear^.Message := HHGear^.Message and not gmAttack;
+        HHGear^.Message := HHGear^.Message and (not gmAttack);
         if Gear^.FlightTime > 0 then
             begin
             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + 32, gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0);
@@ -3779,8 +3393,9 @@ begin
         end;
 
     if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then
-        Gear^.State := Gear^.State and not gsttmpFlag;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
+        Gear^.State := Gear^.State and (not gsttmpFlag);
+        
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmPrecise or gmLeft or gmRight));
     HHGear^.State := HHGear^.State or gstMoving;
 
     Gear^.X := HHGear^.X;
@@ -3789,34 +3404,36 @@ begin
     // this is probably not needed anymore
     if not CurrentTeam^.ExtDriven then FollowGear := HHGear;
 
-    if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear);
+    if ((Gear^.State and gsttmpFlag) = 0)
+    or (HHGear^.dY < _0) then
+        doStepHedgehogMoving(HHGear);
 
     if  (Gear^.Health = 0)
-       or (HHGear^.Damage <> 0)
-       or CheckGearDrowning(HHGear)
-       or (TurnTimeLeft = 0)
-       // allow brief ground touches - to be fair on this, might need another counter
-       or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and (TestCollisionYwithGear(HHGear, 1) <> 0))
-       or ((Gear^.Message and gmAttack) <> 0) then
-        begin
-        with HHGear^ do
-            begin
-            Message := 0;
-            Active := true;
-            State := State or gstMoving
-            end;
-        Gear^.State := Gear^.State or gstAnimation or gstTmpFlag;
-        if HHGear^.dY < _0 then
+        or (HHGear^.Damage <> 0)
+        or CheckGearDrowning(HHGear)
+        or (TurnTimeLeft = 0)
+        // allow brief ground touches - to be fair on this, might need another counter
+        or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and (TestCollisionYwithGear(HHGear, 1) <> 0))
+        or ((Gear^.Message and gmAttack) <> 0) then
             begin
-            Gear^.dX := HHGear^.dX;
-            Gear^.dY := HHGear^.dY;
-            end;
-        Gear^.Timer := 0;
-        Gear^.doStep := @doStepBirdyDisappear;
-        CurAmmoGear := nil;
-        isCursorVisible := false;
-        AfterAttack;
-        end
+            with HHGear^ do
+                begin
+                Message := 0;
+                Active := true;
+                State := State or gstMoving
+                end;
+            Gear^.State := Gear^.State or gstAnimation or gstTmpFlag;
+            if HHGear^.dY < _0 then
+                begin
+                Gear^.dX := HHGear^.dX;
+                Gear^.dY := HHGear^.dY;
+                end;
+            Gear^.Timer := 0;
+            Gear^.doStep := @doStepBirdyDisappear;
+            CurAmmoGear := nil;
+            isCursorVisible := false;
+            AfterAttack;
+            end
 end;
 
 procedure doStepBirdyDescend(Gear: PGear);
@@ -3827,21 +3444,21 @@ begin
         dec(Gear^.Timer, 1)
     else if Gear^.Hedgehog^.Gear = nil then
         begin
-            DeleteGear(Gear);
-            AfterAttack;
-            exit
+        DeleteGear(Gear);
+        AfterAttack;
+        exit
         end;
     HHGear := Gear^.Hedgehog^.Gear;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmPrecise or gmLeft or gmRight));
     if abs(hwRound(HHGear^.Y - Gear^.Y)) > 32 then
-    begin
+        begin
         if Gear^.Timer = 0 then
             Gear^.Y := Gear^.Y + _0_1
-    end
+        end
     else if Gear^.Timer = 0 then
         begin
-            Gear^.doStep := @doStepBirdyFly;
-            HHGear^.dY := -_0_2
+        Gear^.doStep := @doStepBirdyFly;
+        HHGear^.dY := -_0_2
         end
 end;
 
@@ -3851,26 +3468,27 @@ begin
     if Gear^.Timer < 2000 then
         inc(Gear^.Timer, 1)
     else
-    begin
+        begin
         Gear^.Timer := 500;
         Gear^.dX := _0;
         Gear^.dY := _0;
-        Gear^.State :=  Gear^.State and not gstAnimation;
+        Gear^.State :=  Gear^.State and (not gstAnimation);
         Gear^.doStep := @doStepBirdyDescend;
-    end
+        end
 end;
 
 procedure doStepBirdy(Gear: PGear);
 var 
     HHGear: PGear;
 begin
-    gear^.State :=  gear^.State or gstAnimation and not gstTmpFlag;
+    gear^.State :=  gear^.State or gstAnimation and (not gstTmpFlag);
     Gear^.doStep := @doStepBirdyAppear;
+    
     if CurrentHedgehog = nil then
-    begin
+        begin
         DeleteGear(Gear);
         exit
-    end;
+        end;
 
     HHGear := CurrentHedgehog^.Gear;
 
@@ -3883,8 +3501,8 @@ begin
     FollowGear := HHGear;
     with HHGear^ do
         begin
-        State := State and not gstAttacking;
-        Message := Message and not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight)
+        State := State and (not gstAttacking);
+        Message := Message and (not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight))
         end
 end;
 
@@ -3901,43 +3519,44 @@ begin
     CalcRotationDirAngle(Gear);
 
     if (Gear^.State and gstCollision) <> 0 then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLPoisoned, $C0E0FFE0);
         PlaySound(sndEggBreak);
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg);
         vg := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg);
-        if vg <> nil then vg^.Frame := 2;
+        if vg <> nil then
+            vg^.Frame := 2;
 
         for i:= 10 downto 0 do
-        begin
+            begin
             vg := AddVisualGear(hwRound(Gear^.X) - 3 + Random(6), hwRound(Gear^.Y) - 3 + Random(6),
                   vgtDust);
-            if vg <> nil then vg^.dX := vg^.dX + (Gear^.dX.QWordValue / 21474836480);
-        end;
+            if vg <> nil then
+                vg^.dX := vg^.dX + (Gear^.dX.QWordValue / 21474836480);
+            end;
 
         DeleteGear(Gear);
         exit
-    end;
+        end;
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doPortalColorSwitch();
 var CurWeapon: PAmmo;
 begin
-    if (CurrentHedgehog <> nil)
-       and (CurrentHedgehog^.Gear <> nil)
-       and ((CurrentHedgehog^.Gear^.Message and gmSwitch) <> 0) then
-        With CurrentHedgehog^ do
-            if (CurAmmoType = amPortalGun) then
-            begin
-                CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gmSwitch;
+    if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.Message and gmSwitch) <> 0) then
+            with CurrentHedgehog^ do
+                if (CurAmmoType = amPortalGun) then
+                    begin
+                    CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSwitch);
                 
-                CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
-                if CurWeapon^.Pos <> 0 then
-                    CurWeapon^.Pos := 0
-                else
+                    CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
+                    if CurWeapon^.Pos <> 0 then
+                        CurWeapon^.Pos := 0
+                        
+                    else
                     CurWeapon^.Pos := 1;
-            end;
+                    end;
 end;
 
 procedure doStepPortal(Gear: PGear);
@@ -3952,28 +3571,28 @@ begin
 
     // destroy portal if ground it was attached too is gone
     if ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0)
-       or (Gear^.Timer < 1)
-       or (Gear^.Hedgehog <> CurrentHedgehog)
-       or (hwRound(Gear^.Y) > cWaterLine) then
-    begin
+    or (Gear^.Timer < 1)
+    or (Gear^.Hedgehog^.Team <> CurrentHedgehog^.Team)
+    or (hwRound(Gear^.Y) > cWaterLine) then
+        begin
         deleteGear(Gear);
         EXIT;
-    end;
+        end;
 
     if (TurnTimeLeft < 1)
-       or (Gear^.Health < 1) then
+    or (Gear^.Health < 1) then
         dec(Gear^.Timer);
 
     if Gear^.Timer < 10000 then
         gear^.RenderTimer := true;
 
     // abort if there is no other portal connected to this one
-    if (Gear^.IntersectGear = nil) then
+    if (Gear^.LinkedGear = nil) then
         exit;
-    if ((Gear^.IntersectGear^.Tag and 1) = 0) then // or if it's still moving;
+    if ((Gear^.LinkedGear^.Tag and 1) = 0) then // or if it's still moving;
         exit;
 
-    conPortal := Gear^.IntersectGear;
+    conPortal := Gear^.LinkedGear;
 
     // check all gears for stuff to port through
     iterator := nil;
@@ -3991,17 +3610,13 @@ begin
             break;
 
         // don't port portals or other gear that wouldn't make sense
-        if (iterator^.Kind in [gtPortal, gtRope, gtRCPlane])
-            or (iterator^.PortalCounter > 32) then
-             continue;
+        if (iterator^.Kind in [gtPortal, gtRope, gtAirAttack])
+        or (iterator^.PortalCounter > 32) then
+            continue;
 
         // don't port hogs on rope
         // TODO: this will also prevent hogs while falling after rope use from
         //       falling through portals... fix that!
-        if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
-           and (iterator = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.Kind =
-           gtRope) then
-            continue;
 
         // check if gear fits through portal
         if (iterator^.Radius > Gear^.Radius) then
@@ -4012,39 +3627,38 @@ begin
 
         // too far away?
         if (iterator^.X < Gear^.X - r)
-           or (iterator^.X > Gear^.X + r)
-           or (iterator^.Y < Gear^.Y - r)
-           or (iterator^.Y > Gear^.Y + r) then
+        or (iterator^.X > Gear^.X + r)
+        or (iterator^.Y < Gear^.Y - r)
+        or (iterator^.Y > Gear^.Y + r) then
             continue;
 
-        hasdxy := (((iterator^.dX.QWordValue <> 0) or (iterator^.dY.QWordValue <> 0))
-                    or ((iterator^.State or gstMoving) = 0));
+        hasdxy := (((iterator^.dX.QWordValue <> 0) or (iterator^.dY.QWordValue <> 0)) or ((iterator^.State or gstMoving) = 0));
 
         // in case the object is not moving, let's asume it's falling towards the portal
         if not hasdxy then
-        begin
+            begin
             if Gear^.Y < iterator^.Y then
                 continue;
             ox:= Gear^.X - iterator^.X;
             oy:= Gear^.Y - iterator^.Y;
-        end
+            end
         else
-        begin
+            begin
             ox:= iterator^.dX;
             oy:= iterator^.dY;
-        end;
+            end;
 
         // cake will need extra treatment... it's so delicious and moist!
         iscake:= (iterator^.Kind = gtCake);
 
         // won't port stuff that does not move towards the front/portal entrance
         if iscake then
-        begin
-            if not ((iterator^.X - Gear^.X)*ox + (iterator^.Y - Gear^.Y)*oy).isNegative then
+            begin
+            if not (((iterator^.X - Gear^.X)*ox + (iterator^.Y - Gear^.Y)*oy).isNegative) then
                 continue;
-        end
+            end
         else
-            if not (Gear^.dX*ox + Gear^.dY*oy).isNegative then
+            if not ((Gear^.dX*ox + Gear^.dY*oy).isNegative) then
                 continue;
 
         isbullet:= (iterator^.Kind in [gtShotgunShot, gtDEagleShot, gtSniperRifleShot, gtSineGunShot]);
@@ -4052,23 +3666,23 @@ begin
         r:= int2hwFloat(iterator^.Radius);
 
         if not (isbullet or iscake) then
-        begin
+            begin
             // wow! good candidate there, let's see if the distance and direction is okay!
             if hasdxy then
-            begin
+                begin
                 s := r / Distance(iterator^.dX, iterator^.dY);
                 ox:= iterator^.X + s * iterator^.dX;
                 oy:= iterator^.Y + s * iterator^.dY;
-            end
+                end
             else
-            begin
+                begin
                 ox:= iterator^.X;
                 oy:= iterator^.Y + r;
-            end;
+                end;
 
             if (hwRound(Distance(Gear^.X-ox,Gear^.Y-oy)) > Gear^.Radius + 1 ) then
                 continue;
-        end;
+            end;
 
         // draw bullet trail
         if isbullet then
@@ -4083,7 +3697,7 @@ begin
             continue;
 
         // only port bullets close to the portal
-        if isBullet and not (hwAbs(poffs) < _3) then
+        if isBullet and (not (hwAbs(poffs) < _3)) then
             continue;
 
         //
@@ -4104,39 +3718,41 @@ begin
         ny := Gear^.dX;
         // ... decide where the top is based on the hog's direction when firing the portal
         if Gear^.Elasticity.isNegative then
-            nx.isNegative := not nx.isNegative
+            nx.isNegative := (not nx.isNegative)
         else
             ny.isNegative := not ny.isNegative;
 
         // calc gear offset in portal normal vector direction
         noffs:= (nx * ox + ny * oy);
 
-        if isBullet and (hwRound(hwAbs(noffs)) >= Gear^.Radius) then
+        if isBullet and (noffs.Round >= Longword(Gear^.Radius)) then
             continue;
 
         // avoid gravity related loops of not really moving gear
-        if not (iscake or isbullet) and (Gear^.dY.isNegative) and (conPortal^.dY.isNegative)
-            and ((iterator^.dX.QWordValue + iterator^.dY.QWordValue) < _0_08.QWordValue)
-            and (iterator^.PortalCounter > 0) then
-             continue;
+        if not (iscake or isbullet)
+        and (Gear^.dY.isNegative)
+        and (conPortal^.dY.isNegative)
+        and ((iterator^.dX.QWordValue + iterator^.dY.QWordValue) < _0_08.QWordValue)
+        and (iterator^.PortalCounter > 0) then
+            continue;
 
         // calc gear speed along to the vector and the normal vector of the portal
         if hasdxy then
-        begin
+            begin
             pspeed:= (Gear^.dX * iterator^.dX + Gear^.dY * iterator^.dY);
             nspeed:= (nx * iterator^.dX + ny * iterator^.dY);
-        end
+            end
         else
-        begin
+            begin
             pspeed:= hwAbs(cGravity * oy);
             nspeed:= _0;
-        end;
+            end;
 
         // creating normal vector of connected (exit) portal
         nx := conPortal^.dY;
         ny := conPortal^.dX;
         if conPortal^.Elasticity.isNegative then
-            nx.isNegative := not nx.isNegative
+            nx.isNegative := (not nx.isNegative)
         else
             ny.isNegative := not ny.isNegative;
 
@@ -4151,37 +3767,38 @@ begin
         // make the gear's exit position close to the portal while
         // still respecting the movement direction
 
-         // determine the distance (in exit vector direction)
-         // that we want the gear at
-         if iscake then
-             ox:= (r - _0_7)
-         else
-             ox:= (r * _1_5);
-         s:= ox / poffs;
-         poffs:= ox;
-         if (nspeed.QWordValue <> 0) and (pspeed > _0) then
-             noffs:= noffs * s * (nspeed / pspeed);
+        // determine the distance (in exit vector direction)
+        // that we want the gear at
+        if iscake then
+            ox:= (r - _0_7)
+        else
+            ox:= (r * _1_5);
+        s:= ox / poffs;
+        poffs:= ox;
+        if (nspeed.QWordValue <> 0)
+        and (pspeed > _0) then
+            noffs:= noffs * s * (nspeed / pspeed);
 
         // move stuff with high normal offset closer to the portal's center
         if not isbullet then
-        begin
+            begin
             s := hwAbs(noffs) + r - int2hwFloat(Gear^.Radius);
             if s > _0 then
                 noffs:= noffs - SignAs(s,noffs)
-        end;
+            end;
 
         iterator^.X := conPortal^.X + poffs * conPortal^.dX + noffs * nx;
         iterator^.Y := conPortal^.Y + poffs * conPortal^.dY + noffs * ny;
 
-        if not hasdxy and not (conPortal^.dY.isNegative) then
-        begin
+        if not hasdxy and (not (conPortal^.dY.isNegative)) then
+            begin
             iterator^.dY:= iterator^.dY + hwAbs(cGravity * (iterator^.Y - conPortal^.Y))
-        end;
+            end;
 
         // see if the space on the exit side actually is enough
 
         if not (isBullet or isCake) then
-        begin
+            begin
             // TestCollisionXwithXYShift requires a hwFloat for xShift
             ox.QWordValue := _1.QWordValue;
             ox.isNegative := not iterator^.dX.isNegative;
@@ -4197,74 +3814,91 @@ begin
                         or TestCollisionX(iterator, sx);
 
             if not isCollision then
-            begin
+                begin
                 // check center area (with half the radius so that the
                 // the square check won't check more pixels than we want to)
                 iterator^.Radius := 1 + resetr div 2;
                 rh := resetr div 4;
                 isCollision := TestCollisionYwithXYShift(iterator,       0, -sy * rh, sy, false)
                             or TestCollisionXwithXYShift(iterator, ox * rh,        0, sx, false);
-            end;
+                end;
 
             iterator^.Radius := resetr;
 
             if isCollision then
-            begin
+                begin
                 // collision! oh crap! go back!
                 iterator^.X  := resetx;
                 iterator^.Y  := resety;
                 iterator^.dX := resetdx;
                 iterator^.dY := resetdy;
                 continue;
+                end;
             end;
-        end;
 
         //
         // You're now officially portaled!
         //
 
         // Until loops are reliably broken
-        if iscake then iterator^.PortalCounter:= 33
+        if iscake then
+            iterator^.PortalCounter:= 33
         else
             begin
             inc(iterator^.PortalCounter);
-            iterator^.State:= iterator^.State and not gstHHHJump
+            iterator^.Active:= true;
+            iterator^.State:= iterator^.State and (not gstHHHJump)
+            end;
+
+        // is it worth adding an arcsin table?  Just how often would we end up doing something like this?
+        // SYNCED ANGLE UPDATE
+        if iterator^.Kind = gtRCPlane then
+            begin
+            // recycling as temp vars
+            resety.isNegative:= false;
+            resety.QWordValue:= 4294967296 * 112;
+            resetx.isNegative:= false;
+            resetx.QWordValue:= 4294967296 * 35;
+            resetdx.isNegative:= false;
+            resetdx.QWordValue:= 4294967296 * 1152;
+    
+            resetdy:=hwAbs(iterator^.dX*4);
+            resetdy:= resetdy + hwPow(resetdy,3)/_6 + _3 * hwPow(resetdy,5) / _40 + _5 * hwPow(resetdy,7) / resety + resetx * hwPow(resetdy,9) / resetdx;
+            iterator^.Angle:= hwRound(resetdy*_2048 / _PI);
+            if not iterator^.dY.isNegative then iterator^.Angle:= 2048-iterator^.Angle;
+            if iterator^.dX.isNegative then iterator^.Angle:= 4096-iterator^.Angle;
+            end
+        // VISUAL USE OF ANGLE ONLY
+        else if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtKamikaze) and (CurAmmoGear^.Hedgehog = iterator^.Hedgehog) then
+            begin
+            iterator^.Angle:= DxDy2AttackAngle(iterator^.dX, iterator^.dY);
+            iterator^.Angle:= 2048-iterator^.Angle;
+            if iterator^.dX.isNegative then iterator^.Angle:= 4096-iterator^.Angle;
             end;
 
-        if not isbullet and (iterator^.Kind <> gtFlake) then
+        if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
+        and (iterator = CurrentHedgehog^.Gear)
+        and (CurAmmoGear <> nil)
+        and (CurAmmoGear^.Kind =gtRope) then
+               CurAmmoGear^.PortalCounter:= 1;
+
+        if not isbullet and (iterator^.State and gstInvisible = 0) 
+        and (iterator^.Kind <> gtFlake) then
             FollowGear := iterator;
 
         // store X/Y values of exit for net bullet trail
         if isbullet then
-        begin
+            begin
             iterator^.Elasticity:= iterator^.X;
             iterator^.Friction  := iterator^.Y;
-        end;
-
-        // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
-        iterator:= GearsList;
-        while iterator <> nil do
-            begin
-            if (iterator^.Kind <> gtPortal) and 
-               ((iterator^.Hedgehog <> CurrentHedgehog) or ((iterator^.Message and gmAllStoppable) = 0)) then
-                begin
-                iterator^.Active:= true;
-                if iterator^.dY.QWordValue = _0.QWordValue then iterator^.dY.isNegative:= false;
-                iterator^.State:= iterator^.State or gstMoving;
-                DeleteCI(iterator);
-                //inc(iterator^.dY.QWordValue,10);
-                end;
-            iterator:= iterator^.NextGear
             end;
 
-        if Gear^.Health > 1 then dec(Gear^.Health);
+        if Gear^.Health > 1 then
+            dec(Gear^.Health);
     end;
 end;
 
-procedure doStepMovingPortal_real(Gear: PGear);
-var 
-    x, y, tx, ty: LongInt;
-    s: hwFloat;
+
 
 procedure loadNewPortalBall(oldPortal: PGear; destroyGear: Boolean);
 var
@@ -4273,7 +3907,7 @@ begin
     if CurrentHedgehog <> nil then
         with CurrentHedgehog^ do
             begin
-            CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
+            CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
             if (CurAmmoType = amPortalGun) then
                 begin
                 if not destroyGear then
@@ -4289,9 +3923,14 @@ begin
                 CurWeapon^.Timer := 0;
                 end
             end;
-    if destroyGear then oldPortal^.Timer:= 0;
+    if destroyGear then
+        oldPortal^.Timer:= 0;
 end;
 
+procedure doStepMovingPortal_real(Gear: PGear);
+var 
+    x, y, tx, ty: LongInt;
+    s: hwFloat;
 begin
     x := hwRound(Gear^.X);
     y := hwRound(Gear^.Y);
@@ -4300,15 +3939,17 @@ begin
     // avoid compiler hints
 
     if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] > 255) then
-    begin
-        Gear^.State := Gear^.State or gstCollision;
-        Gear^.State := Gear^.State and not gstMoving;
-        if not CalcSlopeTangent(Gear, x, y, tx, ty, 255)
-           or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
         begin
+        Gear^.State := Gear^.State or gstCollision;
+        Gear^.State := Gear^.State and (not gstMoving);
+        
+        if (Land[y, x] and lfBouncy <> 0)
+        or (not CalcSlopeTangent(Gear, x, y, tx, ty, 255))
+        or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
+            begin
             loadNewPortalBall(Gear, true);
             EXIT;
-        end;
+            end;
 
         // making a normalized normal vector
         s := _1/DistanceI(tx,ty);
@@ -4316,13 +3957,12 @@ begin
         Gear^.dY := -s * tx;
 
         Gear^.DirAngle := DxDy2Angle(-Gear^.dY,Gear^.dX);
-        if not Gear^.dX.isNegative then Gear^.DirAngle := 180-Gear^.DirAngle;
+        if not Gear^.dX.isNegative then
+            Gear^.DirAngle := 180-Gear^.DirAngle;
 
-        if ((Gear^.IntersectGear = nil)
-           or (hwRound(Distance(Gear^.X - Gear^.IntersectGear^.X,Gear^.Y-Gear^.IntersectGear^.Y)) >=
-           Gear^.Radius*2))
-            then
-        begin
+        if ((Gear^.LinkedGear = nil)
+        or (hwRound(Distance(Gear^.X - Gear^.LinkedGear^.X,Gear^.Y-Gear^.LinkedGear^.Y)) >=Gear^.Radius*2)) then
+            begin
             loadNewPortalBall(Gear, false);
             inc(Gear^.Tag);
             Gear^.doStep := @doStepPortal;
@@ -4330,18 +3970,21 @@ begin
         else
             loadNewPortalBall(Gear, true);
     end
-    else if (y > cWaterLine) or (y < -LAND_WIDTH)
-            or (x > 2*LAND_WIDTH) or (x < -LAND_WIDTH) then
-             loadNewPortalBall(Gear, true);
+    
+    else if (y > cWaterLine)
+    or (y < -max(LAND_WIDTH,4096))
+    or (x > 2*max(LAND_WIDTH,4096))
+    or (x < -max(LAND_WIDTH,4096)) then
+        loadNewPortalBall(Gear, true);
 end;
 
 procedure doStepMovingPortal(Gear: PGear);
 begin
     doPortalColorSwitch();
     doStepPerPixel(Gear, @doStepMovingPortal_real, true);
-    if (Gear^.Timer < 1)
-       or (Gear^.Hedgehog <> CurrentHedgehog) then
-            deleteGear(Gear);
+    if (Gear^.Timer < 1) 
+    or (Gear^.Hedgehog^.Team <> CurrentHedgehog^.Team) then
+        deleteGear(Gear);
 end;
 
 procedure doStepPortalShot(newPortal: PGear);
@@ -4360,16 +4003,16 @@ begin
     newPortal^.dX := newPortal^.dX * s;
     newPortal^.dY := newPortal^.dY * s;
 
-    newPortal^.IntersectGear := nil;
+    newPortal^.LinkedGear := nil;
 
     if CurrentHedgehog <> nil then
-        With CurrentHedgehog^ do
-        begin
-            CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
+        with CurrentHedgehog^ do
+            begin
+            CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
             // let's save the HH's dX's direction so we can decide where the "top" of the portal hole
             newPortal^.Elasticity.isNegative := CurrentHedgehog^.Gear^.dX.isNegative;
             // when doing a backjump the dx is the opposite of the facing direction
-            if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then
+            if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then
                 newPortal^.Elasticity.isNegative := not newPortal^.Elasticity.isNegative;
 
             // make portal gun look unloaded
@@ -4378,27 +4021,47 @@ begin
 
             iterator := GearsList;
             while iterator <> nil do
-            begin
+                begin
                 if (iterator^.Kind = gtPortal) then
-                    if (iterator <> newPortal) and (iterator^.Timer > 0) then
-                    begin
-                        if (iterator^.Tag and 2) = (newPortal^.Tag and 2) then
+                    if (iterator <> newPortal) and (iterator^.Timer > 0) and (iterator^.Hedgehog = CurrentHedgehog) then
                         begin
+                        if ((iterator^.Tag and 2) = (newPortal^.Tag and 2)) then
+                            begin
                             iterator^.Timer:= 0;
-                        end
+                            end
                         else
-                        begin
+                            begin
                             // link portals with each other
-                            newPortal^.IntersectGear := iterator;
-                            iterator^.IntersectGear := newPortal;
+                            newPortal^.LinkedGear := iterator;
+                            iterator^.LinkedGear := newPortal;
                             iterator^.Health := newPortal^.Health;
+                            end;
                         end;
-                    end;
                 iterator^.PortalCounter:= 0;
                 iterator := iterator^.NextGear
+                end;
+
+            if newPortal^.LinkedGear <> nil then
+                begin
+                // This jiggles gears, to ensure a portal connection just placed under a gear takes effect.
+                iterator:= GearsList;
+                while iterator <> nil do
+                    begin
+                    if not (iterator^.Kind in [gtPortal, gtAirAttack, gtKnife]) and ((iterator^.Hedgehog <> CurrentHedgehog)
+                    or ((iterator^.Message and gmAllStoppable) = 0)) then
+                            begin
+                            iterator^.Active:= true;
+                            if iterator^.dY.QWordValue = _0.QWordValue then
+                                iterator^.dY.isNegative:= false;
+                            iterator^.State:= iterator^.State or gstMoving;
+                            DeleteCI(iterator);
+                        //inc(iterator^.dY.QWordValue,10);
+                            end;
+                    iterator:= iterator^.NextGear
+                    end
+                end
             end;
-        end;
-    newPortal^.State := newPortal^.State and not gstCollision;
+    newPortal^.State := newPortal^.State and (not gstCollision);
     newPortal^.State := newPortal^.State or gstMoving;
     newPortal^.doStep := @doStepMovingPortal;
 end;
@@ -4411,31 +4074,31 @@ var
 begin
     AllInactive := false;
     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and 
-       ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then
-        begin
-        case CurrentHedgehog^.Gear^.MsgParam of 
-            0: PlaySound(sndPiano0);
-            1: PlaySound(sndPiano1);
-            2: PlaySound(sndPiano2);
-            3: PlaySound(sndPiano3);
-            4: PlaySound(sndPiano4);
-            5: PlaySound(sndPiano5);
-            6: PlaySound(sndPiano6);
-            7: PlaySound(sndPiano7);
-            else PlaySound(sndPiano8);
-        end;
+        ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then
+            begin
+                case CurrentHedgehog^.Gear^.MsgParam of 
+                0: PlaySound(sndPiano0);
+                1: PlaySound(sndPiano1);
+                2: PlaySound(sndPiano2);
+                3: PlaySound(sndPiano3);
+                4: PlaySound(sndPiano4);
+                5: PlaySound(sndPiano5);
+                6: PlaySound(sndPiano6);
+                7: PlaySound(sndPiano7);
+                else PlaySound(sndPiano8);
+            end;
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
         CurrentHedgehog^.Gear^.MsgParam := 0;
-        CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gmSlot;
+        CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSlot);
         end;
 
     if (*((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or*) (Gear^.Pos = 5) then
         begin
         Gear^.dY := Gear^.dY + cGravity * 2;
         Gear^.Y := Gear^.Y + Gear^.dY;
-        CheckGearDrowning(Gear);
-        if (Gear^.State and gstDrowning) <> 0 then
+        if CheckGearDrowning(Gear) then
             begin
+            Gear^.Y:= Gear^.Y + _50;
             OnUsedAmmo(CurrentHedgehog^);
             if CurrentHedgehog^.Gear <> nil then
                 begin
@@ -4444,7 +4107,8 @@ begin
                 CurrentHedgehog^.Gear^.X := Gear^.X;
                 CurrentHedgehog^.Gear^.Y := int2hwFloat(cWaterLine+cVisibleWater)+_128;
                 CurrentHedgehog^.Unplaced := false;
-                if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
+                if TagTurnTimeLeft = 0 then
+                    TagTurnTimeLeft:= TurnTimeLeft;
                 TurnTimeLeft:= 0
                 end;
             ResumeMusic
@@ -4457,6 +4121,7 @@ begin
 
     if (Gear^.State and gstDrowning) <> 0 then
         begin
+        Gear^.Y:= Gear^.Y + _50;
         OnUsedAmmo(CurrentHedgehog^);
         if CurrentHedgehog^.Gear <> nil then
             begin
@@ -4465,7 +4130,8 @@ begin
             CurrentHedgehog^.Gear^.X := Gear^.X;
             CurrentHedgehog^.Gear^.Y := int2hwFloat(cWaterLine+cVisibleWater)+_128;
             CurrentHedgehog^.Unplaced := false;
-            if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
+            if TagTurnTimeLeft = 0 then
+                TagTurnTimeLeft:= TurnTimeLeft;
             TurnTimeLeft:= 0
             end;
         ResumeMusic
@@ -4479,7 +4145,7 @@ begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound);
         for r0:= 0 to 4 do
             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
-        Gear^.dY := odY * -1 + cGravity * 2;
+        Gear^.dY := cGravity * 2 - odY;
         Gear^.Pos := Gear^.Pos + 1;
         end
     else
@@ -4507,10 +4173,11 @@ begin
     sdY := hwAbs(ldX) + hwAbs(ldY);
     sdX := _1 - hwAbs(ldX/sdY);
     sdY := _1 - hwAbs(ldY/sdY);
-    if (ldX.isNegative = ldY.isNegative) then sdY := -sdY;
+    if (ldX.isNegative = ldY.isNegative) then
+        sdY := -sdY;
 
     // initial angle depends on current GameTicks
-    t := GameTicks mod 4096;
+    t := getRandom(4096);
 
 
     // used for a work-around detection of area that is within land array, but outside borders
@@ -4538,35 +4205,35 @@ begin
 
         // if borders are on, stop outside land array
         if hasBorder and (((x and LAND_WIDTH_MASK) <> 0) or ((y and LAND_HEIGHT_MASK) <> 0)) then
-        begin
+            begin
             Gear^.Damage := 0;
             Gear^.Health := 0;
-        end
+            end
         else
-        begin
-            if (rY <= cWaterLine) or (y <= cWaterLine) then
             begin
-                if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)
-                   and (Land[y, x] <> 0) then
+            if (rY <= cWaterLine) or (y <= cWaterLine) then
                 begin
-                    if justCollided then
-                    begin
-                        Gear^.Damage := 0;
-                        Gear^.Health := 0;
-                    end
-                    else
-                    begin
-                        inc(Gear^.Damage,3);
-                        justCollided := true;
-                    end;
-                end
+                if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)
+                    and (Land[y, x] <> 0) then
+                        begin
+                            if justCollided then
+                                begin
+                                Gear^.Damage := 0;
+                                Gear^.Health := 0;
+                                end
+                            else
+                                begin
+                                inc(Gear^.Damage,3);
+                                justCollided := true;
+                                end;
+                        end
                 else
                     justCollided := false;
 
                 // kick nearby hogs, dig tunnel and add some fire
                 // if at least 5 collisions occured
                 if Gear^.Damage > 0 then
-                begin
+                    begin
                     DrawExplosion(rX,rY,Gear^.Radius);
 
                     // kick nearby hogs
@@ -4577,27 +4244,40 @@ begin
 
                     // add some fire to the tunnel
                     if getRandom(6) = 0 then
-                        AddGear(x - Gear^.Radius + LongInt(getRandom(2 * Gear^.Radius)), y -
-                        getRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0);
-                end;
+                        begin
+                        tmp:= GetRandom(2 * Gear^.Radius);
+                        AddGear(x - Gear^.Radius + tmp, y - GetRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0)
+                        end
+                    end;
 
-                if getRandom(100) = 0 then
+                if random(100) = 0 then
                     AddVisualGear(x, y, vgtSmokeTrace); 
-            end
-            else dec(Gear^.Health, 5); // if underwater get additional damage
-        end;
+                end
+                else dec(Gear^.Health, 5); // if underwater get additional damage
+            end;
 
         dec(Gear^.Health);
 
         // decrease bullet size towards the end
-        if (Gear^.Radius > 4) then begin
-            if (Gear^.Health <= (initHealth div 3)) then dec(Gear^.Radius) end
-        else if (Gear^.Radius > 3) then begin
-            if (Gear^.Health <= (initHealth div 4)) then dec(Gear^.Radius) end
+        if (Gear^.Radius > 4) then
+            begin
+            if (Gear^.Health <= (initHealth div 3)) then
+                dec(Gear^.Radius)
+            end
+        else if (Gear^.Radius > 3) then
+            begin
+            if (Gear^.Health <= (initHealth div 4)) then
+                dec(Gear^.Radius)
+            end
         else if (Gear^.Radius > 2) then begin
-            if (Gear^.Health <= (initHealth div 5)) then dec(Gear^.Radius) end
-        else if (Gear^.Radius > 1) then begin
-            if (Gear^.Health <= (initHealth div 6)) then dec(Gear^.Radius) end;
+            if (Gear^.Health <= (initHealth div 5)) then
+                dec(Gear^.Radius)
+            end
+        else if (Gear^.Radius > 1) then
+            begin
+            if (Gear^.Health <= (initHealth div 6)) then
+                dec(Gear^.Radius)
+            end;
 
     until (Gear^.Health <= 0);
 
@@ -4606,7 +4286,7 @@ begin
 end;
 
 procedure doStepSineGunShot(Gear: PGear);
-var 
+var
     HHGear: PGear;
 begin
     PlaySound(sndSineGun); 
@@ -4628,7 +4308,7 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepFlamethrowerWork(Gear: PGear);
 var 
-    HHGear: PGear;
+    HHGear, flame: PGear;
     rx, ry, speed: hwFloat;
     i, gX, gY: LongInt;
 begin
@@ -4642,13 +4322,17 @@ begin
         begin
         if (HHGear^.Message and gmRight) <> 0 then
             begin
-            if HHGear^.dX.isNegative and (Gear^.Tag < 20) then inc(Gear^.Tag)
-            else if Gear^.Tag > 5 then dec(Gear^.Tag);
+            if HHGear^.dX.isNegative and (Gear^.Tag < 20) then
+                inc(Gear^.Tag)
+            else if Gear^.Tag > 5 then
+                dec(Gear^.Tag);
             end
         else if (HHGear^.Message and gmLeft) <> 0 then
             begin
-            if HHGear^.dX.isNegative and (Gear^.Tag > 5) then dec(Gear^.Tag)
-            else if Gear^.Tag < 20 then inc(Gear^.Tag);
+            if HHGear^.dX.isNegative and (Gear^.Tag > 5) then
+                dec(Gear^.Tag)
+            else if Gear^.Tag < 20 then 
+                inc(Gear^.Tag);
             end
         end;
     
@@ -4658,23 +4342,27 @@ begin
         dec(Gear^.Health);
         if (Gear^.Health mod 5) = 0 then
             begin
-            rx := rndSign(getRandom * _0_1);
-            ry := rndSign(getRandom * _0_1);
+            rx := rndSign(getRandomf * _0_1);
+            ry := rndSign(getRandomf * _0_1);
             speed := _0_5 * (_10 / Gear^.Tag);
     
-            AddGear(gx, gy, gtFlame, gstTmpFlag,
+            flame:= AddGear(gx, gy, gtFlame, gstTmpFlag,
                     SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
                     AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
+            flame^.CollisionMask:= $FF7F;
             
             if (Gear^.Health mod 30) = 0 then
-                AddGear(gx, gy, gtFlame, 0,
+                begin
+                flame:= AddGear(gx, gy, gtFlame, 0,
                         SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
                         AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
+                flame^.CollisionMask:= $FF7F;
+                end
             end;
         Gear^.Timer:= Gear^.Tag
         end;
 
-    if (Gear^.Health = 0) or (HHGear^.Damage <> 0) then
+    if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) then
         begin
         DeleteGear(Gear);
         AfterAttack
@@ -4697,7 +4385,7 @@ var
     HHGear: PGear;
 begin
     HHGear := Gear^.Hedgehog^.Gear;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmDown or gmLeft or gmRight);
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown or gmLeft or gmRight));
     HHGear^.State := HHGear^.State or gstNotKickable;
     Gear^.doStep := @doStepFlamethrowerWork
 end;
@@ -4705,7 +4393,7 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepLandGunWork(Gear: PGear);
 var 
-    HHGear: PGear;
+    HHGear, land: PGear;
     rx, ry, speed: hwFloat;
     i, gX, gY: LongInt;
 begin
@@ -4719,13 +4407,17 @@ begin
         begin
         if (HHGear^.Message and gmRight) <> 0 then
             begin
-            if HHGear^.dX.isNegative and (Gear^.Tag < 20) then inc(Gear^.Tag)
-            else if Gear^.Tag > 5 then dec(Gear^.Tag);
+            if HHGear^.dX.isNegative and (Gear^.Tag < 20) then
+                inc(Gear^.Tag)
+            else if Gear^.Tag > 5 then
+                dec(Gear^.Tag);
             end
         else if (HHGear^.Message and gmLeft) <> 0 then
             begin
-            if HHGear^.dX.isNegative and (Gear^.Tag > 5) then dec(Gear^.Tag)
-            else if Gear^.Tag < 20 then inc(Gear^.Tag);
+            if HHGear^.dX.isNegative and (Gear^.Tag > 5) then
+                dec(Gear^.Tag)
+            else if Gear^.Tag < 20 then
+                inc(Gear^.Tag);
             end
         end;
     
@@ -4734,20 +4426,21 @@ begin
         begin
         dec(Gear^.Health);
 
-        rx := rndSign(getRandom * _0_1);
-        ry := rndSign(getRandom * _0_1);
+        rx := rndSign(getRandomf * _0_1);
+        ry := rndSign(getRandomf * _0_1);
         speed := (_3 / Gear^.Tag);
 
-        AddGear(gx, gy, gtFlake, gstTmpFlag, 
+        land:= AddGear(gx, gy, gtFlake, gstTmpFlag, 
                 SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, 
                 AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
+        land^.CollisionMask:= $FF7F;
             
         Gear^.Timer:= Gear^.Tag
         end;
 
-    if (Gear^.Health = 0) or (HHGear^.Damage <> 0) or ((HHGear^.Message and gmAttack) <> 0) then
+    if (Gear^.Health = 0) or ((HHGear^.State and gstHHDriven) = 0) or ((HHGear^.Message and gmAttack) <> 0) then
         begin
-        HHGear^.Message:= HHGear^.Message and not gmAttack;
+        HHGear^.Message:= HHGear^.Message and (not gmAttack);
         DeleteGear(Gear);
         AfterAttack
         end
@@ -4769,7 +4462,7 @@ var
     HHGear: PGear;
 begin
     HHGear := Gear^.Hedgehog^.Gear;
-    HHGear^.Message := HHGear^.Message and not (gmUp or gmDown or gmLeft or gmRight or gmAttack);
+    HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown or gmLeft or gmRight or gmAttack));
     HHGear^.State := HHGear^.State or gstNotKickable;
     Gear^.doStep := @doStepLandGunWork
 end;
@@ -4778,10 +4471,10 @@ end;
 procedure doStepPoisonCloud(Gear: PGear);
 begin
     if Gear^.Timer = 0 then
-    begin
+        begin
         DeleteGear(Gear);
         exit
-    end;
+        end;
     dec(Gear^.Timer);
     Gear^.X:= Gear^.X + Gear^.dX;
     Gear^.Y:= Gear^.Y + Gear^.dY;
@@ -4816,10 +4509,11 @@ while i > 0 do
         if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then
             begin
             //tmp^.State:= tmp^.State or gstFlatened;
-            if not tmp^.Invulnerable then ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
+            if not tmp^.Invulnerable then
+                ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
             //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3);
             tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0);
-            tmp2^.IntersectGear:= tmp;
+            tmp2^.LinkedGear:= tmp;
             SetAllToActive
             end
         else
@@ -4827,7 +4521,7 @@ while i > 0 do
             end
     end;
 
-HHGear^.State:= HHGear^.State and not gstNoDamage;
+HHGear^.State:= HHGear^.State and (not gstNoDamage);
 Gear^.Timer:= 250;
 Gear^.doStep:= @doStepIdle
 end;
@@ -4838,7 +4532,7 @@ var
     HitGear: PGear;
 begin
     AllInactive := false;
-    HitGear := Gear^.IntersectGear;
+    HitGear := Gear^.LinkedGear;
     dec(Gear^.Timer);
     if (HitGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then
         begin
@@ -4877,7 +4571,8 @@ begin
         begin
         Gear^.dY := Gear^.dY + cGravity;
         Gear^.Y := Gear^.Y + Gear^.dY;
-        if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1
+        if hwRound(Gear^.Y) > cWaterLine then
+            Gear^.Timer := 1
         end;
 
     Gear^.X := Gear^.X + HitGear^.dX;
@@ -4897,12 +4592,12 @@ begin
 
     y := hwRound(Gear^.Y) - cHHRadius * 2;
     while y < hwRound(Gear^.Y) do
-    begin
+        begin
         ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2));
         ar[i].Right := hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2));
         inc(y, 2);
         inc(i)
-    end;
+        end;
 
     DrawHLinesExplosions(@ar, 3, hwRound(Gear^.Y) - cHHRadius * 2, 2, Pred(i));
     Gear^.dY := HHGear^.dY;
@@ -4915,7 +4610,7 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepResurrectorWork(Gear: PGear);
 var
-    graves: TPGearArray;
+    graves: PGearArrayS;
     resgear: PGear;
     hh: PHedgehog;
     i: LongInt;
@@ -4935,21 +4630,24 @@ begin
 
     if ((Gear^.Message and gmUp) <> 0) then
         begin
-        if (GameTicks and $F) <> 0 then exit;
+        if (GameTicks and $F) <> 0 then
+        exit;
         end 
-    else if (GameTicks and $1FF) <> 0 then exit;
+    else if (GameTicks and $1FF) <> 0 then
+        exit;
 
     if Gear^.Power < 45 then
         begin
         inc(Gear^.Power);
-        if TestCollisionYwithGear(hh^.Gear, -1) = 0 then hh^.Gear^.Y := hh^.Gear^.Y - _1;
+        if TestCollisionYwithGear(hh^.Gear, -1) = 0 then
+            hh^.Gear^.Y := hh^.Gear^.Y - _1;
         end;
 
     graves := GearsNear(Gear^.X, Gear^.Y, gtGrave, Gear^.Radius);
 
-    if Length(graves) = 0 then
+    if graves.size = 0 then
         begin
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Timer := 250;
         Gear^.doStep := @doStepIdle;
         exit;
@@ -4957,12 +4655,13 @@ begin
 
     if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) and (TurnTimeLeft > 0) then
         begin
-        if Length(graves) <= Gear^.Tag then Gear^.Tag:= 0;
+        if LongInt(graves.size) <= Gear^.Tag then Gear^.Tag:= 0;
         dec(hh^.Gear^.Health);
         if (hh^.Gear^.Health = 0) and (hh^.Gear^.Damage = 0) then
             hh^.Gear^.Damage:= 1;
         RenderHealth(hh^);
-        inc(graves[Gear^.Tag]^.Health);
+        RecountTeamHealth(hh^.Team);
+        inc(graves.ar^[Gear^.Tag]^.Health);
         inc(Gear^.Tag)
 {-for i:= 0 to High(graves) do begin
             if hh^.Gear^.Health > 0 then begin
@@ -4974,27 +4673,28 @@ begin
     else 
         begin
         // now really resurrect the hogs with the hp saved in the graves
-        for i:= 0 to High(graves) do
-            if graves[i]^.Health > 0 then
+        for i:= 0 to graves.size - 1 do
+            if graves.ar^[i]^.Health > 0 then
                 begin
-                resgear := AddGear(hwRound(graves[i]^.X), hwRound(graves[i]^.Y),
-                        gtHedgehog, gstWait, _0, _0, 0);
-                resgear^.Hedgehog := graves[i]^.Hedgehog;
-                resgear^.Health := graves[i]^.Health;
-                PHedgehog(graves[i]^.Hedgehog)^.Gear := resgear;
-                DeleteGear(graves[i]);
+                resgear := AddGear(hwRound(graves.ar^[i]^.X), hwRound(graves.ar^[i]^.Y), gtHedgehog, gstWait, _0, _0, 0);
+                resgear^.Hedgehog := graves.ar^[i]^.Hedgehog;
+                resgear^.Health := graves.ar^[i]^.Health;
+                PHedgehog(graves.ar^[i]^.Hedgehog)^.Gear := resgear;
+                graves.ar^[i]^.Message:= graves.ar^[i]^.Message or gmDestroy;
+                graves.ar^[i]^.Active:= true;
                 RenderHealth(resgear^.Hedgehog^);
                 RecountTeamHealth(resgear^.Hedgehog^.Team);
-                resgear^.Hedgehog^.Effects[heResurrected]:= true;
+                resgear^.Hedgehog^.Effects[heResurrected]:= 1;
                 // only make hat-less hedgehogs look like zombies, preserve existing hats
+
                 if resgear^.Hedgehog^.Hat = 'NoHat' then
-                    LoadHedgehogHat(resgear, 'Reserved/Zombie');
+                    LoadHedgehogHat(resgear^.Hedgehog^, 'Reserved/Zombie');
                 end;
 
         hh^.Gear^.dY := _0;
         hh^.Gear^.dX := _0;
         doStepHedgehogMoving(hh^.Gear);
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Timer := 250;
         Gear^.doStep := @doStepIdle;
         end
@@ -5003,24 +4703,24 @@ end;
 
 procedure doStepResurrector(Gear: PGear);
 var
-    graves: TPGearArray;
+    graves: PGearArrayS;
     i: LongInt;
 begin
     AllInactive := false;
     graves := GearsNear(Gear^.X, Gear^.Y, gtGrave, Gear^.Radius);
 
-    if Length(graves) > 0 then
+    if graves.size > 0 then
         begin
-        for i:= 0 to High(graves) do
+        for i:= 0 to graves.size - 1 do
             begin
-            PHedgehog(graves[i]^.Hedgehog)^.Gear := nil;
-            graves[i]^.Health := 0;
+            PHedgehog(graves.ar^[i]^.Hedgehog)^.Gear := nil;
+            graves.ar^[i]^.Health := 0;
             end;
         Gear^.doStep := @doStepResurrectorWork;
         end 
     else 
         begin
-        StopSound(Gear^.SoundChannel);
+        StopSoundChan(Gear^.SoundChannel);
         Gear^.Timer := 250;
         Gear^.doStep := @doStepIdle;
         end
@@ -5041,8 +4741,8 @@ begin
         gY := hwRound(Gear^.Y); 
         for i:= 0 to 10 do
         begin
-            dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1);
-            dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
+            dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandomf + _1);
+            dY := AngleSin(i * 8) * _0_5 * (GetRandomf + _1);
             AddGear(gX, gY, gtFlame, 0, dX, dY, 0);
             AddGear(gX, gY, gtFlame, 0, dX, -dY, 0);
             AddGear(gX, gY, gtFlame, 0, -dX, dY, 0);
@@ -5052,13 +4752,13 @@ begin
         exit
     end;
     if (Gear^.Timer = 0) then
-    begin
+        begin
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLAutoSound);
         for i:= -19 to 19 do
            FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0);
         DeleteGear(Gear);
         exit
-    end;
+        end;
     if (GameTicks and $3F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
     dec(Gear^.Timer)
@@ -5068,53 +4768,84 @@ end;
 procedure doStepStructure(Gear: PGear);
 var 
     x, y: LongInt;
+    HH: PHedgehog;
+    t: PGear;
 begin
+    HH:= Gear^.Hedgehog;
+
     if (Gear^.State and gstMoving) <> 0 then
         begin
         AddGearCI(Gear);
         Gear^.dX:= _0;
         Gear^.dY:= _0;
-        Gear^.State:= Gear^.State and not gstMoving;
+        Gear^.State:= Gear^.State and (not gstMoving);
         end;
 
-    if CurAmmoGear = Gear then
+    dec(Gear^.Health, Gear^.Damage);
+    Gear^.Damage:= 0;
+        
+    if Gear^.Pos = 1 then
         begin
-        if (CurrentHedgehog = nil) or (CurrentHedgehog^.Gear = nil) then
-            begin
-            DeleteGear(Gear);
-            exit
-            end;
-        if Gear = CurAmmoGear then CurAmmoGear := nil;
-        Gear^.Hedgehog:= CurrentHedgehog;
-        RemoveGearFromList(CurrentHedgehog^.Gear);
-        CurrentHedgehog^.Gear^.Z := cHHZ;
-        CurrentHedgehog^.Gear^.Active := false;
-        CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstHHDriven;
-        CurrentHedgehog^.GearHidden:= CurrentHedgehog^.Gear;
-        CurrentHedgehog^.Gear:= nil;
-        Gear^.Tag:= TotalRounds + Gear^.Tag;
         AddGearCI(Gear);
+        AfterAttack;
+        if Gear = CurAmmoGear then
+            CurAmmoGear:= nil;
+        if HH^.Gear <> nil then
+            HideHog(HH);
+        Gear^.Pos:= 2
         end;
-
-    dec(Gear^.Health, Gear^.Damage);
-    Gear^.Damage := 0;
         
-    if (Gear^.Tag = TotalRounds) or (Gear^.Health <= 0) then
+    if Gear^.Pos = 2 then
         begin
-        if Gear^.Hedgehog <> nil then
+        if ((GameTicks mod 100) = 0) and (Gear^.Timer < 1000) then
             begin
-            Gear^.Hedgehog^.Gear:= Gear^.Hedgehog^.GearHidden;
-            Gear^.Hedgehog^.GearHidden:= nil;
-            Gear^.Hedgehog^.Gear^.X:= Gear^.X;
-            Gear^.Hedgehog^.Gear^.Y:= Gear^.Y - int2hwFloat(Gear^.Radius + cHHRadius);
-            InsertGearToList(Gear^.Hedgehog^.Gear);
-            Gear^.Hedgehog:= nil;
-            SetAllHHToActive;
+            if (Gear^.Timer mod 10) = 0 then
+                begin
+                DeleteCI(Gear);
+                Gear^.Y:= Gear^.Y - _0_5;
+                AddGearCI(Gear);
+                end;
+            inc(Gear^.Timer);
             end;
+        if Gear^.Tag <= TotalRounds then
+            Gear^.Pos:= 3;
         end;
         
+    if Gear^.Pos = 3 then
+        if Gear^.Timer < 1000 then
+            begin
+            if (Gear^.Timer mod 10) = 0 then
+                begin
+                DeleteCI(Gear);
+                Gear^.Y:= Gear^.Y - _0_5;
+                AddGearCI(Gear);
+                end;
+            inc(Gear^.Timer);
+            end
+        else
+            begin
+            if HH^.GearHidden <> nil then
+                RestoreHog(HH);
+            Gear^.Pos:= 4;
+            end;
+        
+    if Gear^.Pos = 4 then
+        if ((GameTicks mod 1000) = 0) and ((GameFlags and gfInvulnerable) = 0) then
+            begin
+            t:= GearsList;
+            while t <> nil do
+                begin
+                if (t^.Kind = gtHedgehog) and (t^.Hedgehog^.Team^.Clan = HH^.Team^.Clan) then
+                    t^.Invulnerable:= true;
+                t:= t^.NextGear;
+                end;
+            end;
+        
     if Gear^.Health <= 0 then
         begin
+        if HH^.GearHidden <> nil then
+            RestoreHog(HH);
+        
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
 
@@ -5146,7 +4877,7 @@ begin
 HH:= Gear^.Hedgehog;
 if Gear^.Pos = 2 then
     begin
-    StopSound(Gear^.SoundChannel);
+    StopSoundChan(Gear^.SoundChannel);
     if (Gear^.Timer = 0) then
         begin
         if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then
@@ -5174,21 +4905,23 @@ if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then
     begin
     inc(Gear^.Power);
     if (Gear^.Power = 172) and (HH^.Gear <> nil) and 
-       (HH^.Gear^.Damage = 0) and (HH^.Gear^.Health > 0) and
-       ((HH^.Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then
-        with HH^.Gear^ do
-            begin
-	        State:= State or gstAnimation;
-	        Tag:= 2;
-	        Timer:= 0;
-	        Pos:= 0
-            end
+        (HH^.Gear^.Damage = 0) and (HH^.Gear^.Health > 0) and
+        ((HH^.Gear^.State and (gstMoving or gstHHDeath or gstHHGone)) = 0) then
+            with HH^.Gear^ do
+                begin
+                State:= State or gstAnimation;
+                Tag:= 2;
+                Timer:= 0;
+                Pos:= 0
+                end
     end;
-if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then dec(Gear^.Power);
-if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then Gear^.Pos:= 2;
+if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then
+    dec(Gear^.Power);
+if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then
+    Gear^.Pos:= 2;
 if (Gear^.Pos = 3) and (Gear^.Power = 0) then
     begin
-    StopSound(Gear^.SoundChannel);
+    StopSoundChan(Gear^.SoundChannel);
     if HH^.GearHidden = nil then
         begin
         DeleteGear(Gear);
@@ -5196,7 +4929,7 @@ if (Gear^.Pos = 3) and (Gear^.Power = 0) then
         end;
     Gear^.Pos:= 4;
     // This condition might need tweaking
-    Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount)+cHedgehogTurnTime
+    Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount*2)+cHedgehogTurnTime*2
     end;
 
 if (Gear^.Pos = 4) then
@@ -5204,24 +4937,32 @@ if (Gear^.Pos = 4) then
     cnt:= 0;
     for j:= 0 to Pred(HH^.Team^.Clan^.TeamsNumber) do
         for i:= 0 to Pred(HH^.Team^.Clan^.Teams[j]^.HedgehogsNumber) do
-            if (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear <> nil) and
-               ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0) and
-               (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health >
-                HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then inc(cnt);
+            if (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear <> nil)
+            and ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0)
+            and (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health > HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then
+                inc(cnt);
     if (cnt = 0) or SuddenDeathDmg or (Gear^.Timer = 0) then
         begin
-        Gear^.SoundChannel := LoopSound(sndTardis);
-        Gear^.Pos:= 1;
-        Gear^.Power:= 0;
-        Gear^.Timer:= 0;
-        if HH^.GearHidden <> nil then FindPlace(HH^.GearHidden, false, 0, LAND_WIDTH,true);
+        if HH^.GearHidden <> nil then
+            FindPlace(HH^.GearHidden, false, 0, LAND_WIDTH,true);
+            
         if HH^.GearHidden <> nil then
             begin
             Gear^.X:= HH^.GearHidden^.X;
             Gear^.Y:= HH^.GearHidden^.Y;
-            //HH^.Gear:=HH^.GearHidden;
-            //HH^.GearHidden:= nil;
-            //HH^.Gear^.State:= HH^.Gear^.State or gstInvisible;
+            end;
+        Gear^.Timer:= 0;
+
+        if (HH^.GearHidden <> nil) and (cnt = 0) then // do an emergency jump back in this case. the team needs you!
+            begin
+            AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplosion);
+            Gear^.Pos:= 2;
+            Gear^.Power:= 255;
+            end
+        else begin
+            Gear^.SoundChannel := LoopSound(sndTardis);
+            Gear^.Pos:= 1;
+            Gear^.Power:= 0;
             end
         end
     else dec(Gear^.Timer);
@@ -5245,8 +4986,8 @@ begin
         begin
         if HH^.Gear <> nil then
             begin
-            HH^.Gear^.Message := HH^.Gear^.Message and not gmAttack;
-            HH^.Gear^.State:= HH^.Gear^.State and not gstAttacking;
+            HH^.Gear^.Message := HH^.Gear^.Message and (not gmAttack);
+            HH^.Gear^.State:= HH^.Gear^.State and (not gstAttacking);
             end;
         PlaySound(sndDenied);
         DeleteGear(gear);
@@ -5255,16 +4996,16 @@ begin
     cnt:= 0;
     for j:= 0 to Pred(HH^.Team^.Clan^.TeamsNumber) do
         for i:= 0 to Pred(HH^.Team^.Clan^.Teams[j]^.HedgehogsNumber) do
-            if (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear <> nil) and
-               ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0) and
-               (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health >
-                HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then inc(cnt);
+            if (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear <> nil)
+            and ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0)
+            and (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health > HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then
+                inc(cnt);
     if cnt < 2 then
         begin
         if HH^.Gear <> nil then
             begin
-            HH^.Gear^.Message := HH^.Gear^.Message and not gmAttack;
-            HH^.Gear^.State:= HH^.Gear^.State and not gstAttacking;
+            HH^.Gear^.Message := HH^.Gear^.Message and (not gmAttack);
+            HH^.Gear^.State:= HH^.Gear^.State and (not gstAttacking);
             end;
             PlaySound(sndDenied);
             DeleteGear(gear);
@@ -5276,3 +5017,429 @@ end;
 
 ////////////////////////////////////////////////////////////////////////////////
 
+(*
+WIP. The ice gun will have the following effects.  It has been proposed by sheepluva that it take the appearance of a large freezer
+spewing ice cubes.  The cubes will be visual gears only.  The scatter from them and the impact snow dust should help hide imprecisions in things like the GearsNear effect.
+For now we assume a "ray" like a deagle projected out from the gun.
+All these effects assume the ray's angle is not changed and that the target type was unchanged over a number of ticks.  This is a simplifying assumption for "gun was applying freezing effect to the same target".  
+  * When fired at water a layer of ice textured land is added above the water.
+  * When fired at non-ice land (land and $FF00 and not lfIce) the land is overlaid with a thin layer of ice textured land around that point (say, 1 or 2px into land, 1px above). For attractiveness, a slope would probably be needed.
+  * When fired at a hog (land and $00FF <> 0), while the hog is targetted, the hog's state is set to frozen.  As long as the gun is on the hog, a frozen hog sprite creeps up from the feet to the head.  If the effect is interrupted before reaching the top, the freezing state is cleared.
+A frozen hog will animate differently.  To be decided, but possibly in a similar fashion to a grave when it comes to explosions.  The hog might (possibly) not be damaged by explosions.  This might make freezing potentially useful for friendlies in a bad position.  It might be better to allow damage though.
+A frozen hog stays frozen for a certain number of turns. Each turn the frozen overlay becomes fainter, until it fades and the hog animates normally again.
+*)
+procedure doStepIceGun(Gear: PGear);
+var
+    HHGear: PGear;
+    ndX, ndY: hwFloat;
+    i, t, gX, gY: LongInt;
+    hogs: PGearArrayS;
+begin
+    HHGear := Gear^.Hedgehog^.Gear;
+    if (Gear^.Health = 0) or (HHGear = nil) or (HHGear^.Damage <> 0) then
+        begin
+        DeleteGear(Gear);
+        AfterAttack;
+        exit
+        end
+    else
+        begin
+        t:= Gear^.Health div 10;
+        if (t <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
+            begin
+            Gear^.Damage:= t;
+            FreeTexture(Gear^.Tex);
+            Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(t) +
+                         '%', cWhiteColor, fntSmall)
+            end
+        end;
+    if GameTicks mod 10 = 0 then dec(Gear^.Health);
+    with Gear^ do
+        begin
+        HedgehogChAngle(HHGear);
+        ndX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _4;
+        ndY:= -AngleCos(HHGear^.Angle) * _4;
+        if (ndX <> dX) or (ndY <> dY) or 
+           ((Target.X <> NoPointX) and (Target.X and LAND_WIDTH_MASK = 0) and 
+             (Target.Y and LAND_HEIGHT_MASK = 0) and ((Land[Target.Y, Target.X] = 0))) then
+            begin
+            dX:= ndX;
+            dY:= ndY;
+            Pos:= 0;
+            Target.X:= NoPointX;
+            LastDamage:= nil;
+            X:= HHGear^.X;
+            Y:= HHGear^.Y;
+(* unfreeze all semifrozen hogs - make this generic hog cleanup
+            iter := GearsList;
+            while iter <> nil do
+                begin
+                if (iter^.Kind = gtHedgehog) and 
+                   (iter^.Hedgehog^.Effects[heFrozen] < 0) then 
+                    iter^.Hedgehog^.Effects[heFrozen]:= 0;
+                iter:= iter^.NextGear
+                end *)
+            end
+        else
+            begin
+            X:= X + dX;
+            Y:= Y + dY;
+            gX:= hwRound(X);
+            gY:= hwRound(Y);
+            if Target.X = NoPointX then t:= hwRound(hwSqr(X-HHGear^.X)+hwSqr(Y-HHGear^.Y));
+            if Target.X <> NoPointX then
+                begin
+                if (abs(gX-Target.X) < 2) and (abs(gY-Target.Y) < 2) then
+                    begin
+                    X:= HHGear^.X;
+                    Y:= HHGear^.Y
+                    end;
+// freeze nearby hogs
+                if GameTicks mod 10 = 0 then dec(Gear^.Health);
+                hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Radius);
+                if hogs.size > 0 then
+                    for i:= 0 to hogs.size - 1 do
+                        if hogs.ar^[i] <> HHGear then
+                            begin
+                            //if Gear^.Hedgehog^.Effects[heFrozen]:= 0;
+                            end;
+                inc(Pos)
+                end
+            else if (t > 400) and ((gY > cWaterLine) or
+                    (((gX and LAND_WIDTH_MASK = 0) and (gY and LAND_HEIGHT_MASK = 0))
+                        and (Land[gY, gX] <> 0))) then
+                begin
+                Target.X:= gX;
+                Target.Y:= gY;
+                X:= HHGear^.X;
+                Y:= HHGear^.Y
+                end;
+            if (gX > max(LAND_WIDTH,4096)*2) or
+                    (gX < -max(LAND_WIDTH,4096)) or
+                    (gY < -max(LAND_HEIGHT,4096)) or
+                    (gY > max(LAND_HEIGHT,4096)+512) then
+                begin
+                X:= HHGear^.X;
+                Y:= HHGear^.Y
+                end
+        end
+    end;
+end;
+
+procedure doStepAddAmmo(Gear: PGear);
+var a: TAmmoType;
+    gi: PGear;
+begin
+if Gear^.Timer > 0 then dec(Gear^.Timer)
+else
+    begin
+    if Gear^.Pos = posCaseUtility then
+        a:= GetUtility(Gear^.Hedgehog)
+    else
+        a:= GetAmmo(Gear^.Hedgehog);
+    CheckSum:= CheckSum xor GameTicks;
+    gi := GearsList;
+    while gi <> nil do
+        begin
+        with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac;
+        AddRandomness(CheckSum);
+        gi := gi^.NextGear
+        end;
+    AddPickup(Gear^.Hedgehog^, a, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
+    DeleteGear(Gear)
+    end;
+end;
+
+procedure doStepGenericFaller(Gear: PGear);
+begin
+if Gear^.Timer < $FFFFFFFF then
+    if Gear^.Timer > 0 then
+        dec(Gear^.Timer)
+    else
+        begin
+        DeleteGear(Gear);
+        exit
+        end;
+    
+doStepFallingGear(Gear);
+end;
+
+procedure doStepCreeper(Gear: PGear);
+var hogs: PGearArrayS;
+    HHGear: PGear;
+    tdX: hwFloat;
+    dir: LongInt;
+begin
+doStepFallingGear(Gear);
+if Gear^.Timer > 0 then dec(Gear^.Timer);
+// creeper sleep phase
+if (Gear^.Hedgehog = nil) and (Gear^.Timer > 0) then exit;
+
+if Gear^.Hedgehog <> nil then HHGear:= Gear^.Hedgehog^.Gear
+else HHGear:= nil;
+
+// creeper boom phase
+if (Gear^.State and gstTmpFlag <> 0) then
+    begin
+    if (Gear^.Timer = 0) then
+        begin
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 300, CurrentHedgehog, EXPLAutoSound);
+        DeleteGear(Gear)
+        end;
+    // ssssss he essssscaped
+    if (Gear^.Timer > 250) and ((HHGear = nil) or 
+            (((abs(HHGear^.X.Round-Gear^.X.Round) + abs(HHGear^.Y.Round-Gear^.Y.Round) + 2) >  180) and
+            (Distance(HHGear^.X-Gear^.X,HHGear^.Y-Gear^.Y) > _180))) then
+        begin
+        Gear^.State:= Gear^.State and (not gstTmpFlag);
+        Gear^.Timer:= 0
+        end;
+    exit
+    end;
+
+// Search out a new target, as target seek time has expired, target is dead, target is out of range, or we did not have a target
+if (HHGear = nil) or (Gear^.Timer = 0) or 
+   (((abs(HHGear^.X.Round-Gear^.X.Round) + abs(HHGear^.Y.Round-Gear^.Y.Round) + 2) >  Gear^.Angle) and
+        (Distance(HHGear^.X-Gear^.X,HHGear^.Y-Gear^.Y) > int2hwFloat(Gear^.Angle)))
+    then
+    begin
+    hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Angle);
+    if hogs.size > 1 then
+        Gear^.Hedgehog:= hogs.ar^[GetRandom(hogs.size)]^.Hedgehog
+    else if hogs.size = 1 then Gear^.Hedgehog:= hogs.ar^[0]^.Hedgehog
+    else Gear^.Hedgehog:= nil;
+    if Gear^.Hedgehog <> nil then Gear^.Timer:= 5000;
+    exit
+    end;
+
+// we have a target. move the creeper.
+if HHGear <> nil then
+    begin
+    // GOTCHA
+    if ((abs(HHGear^.X.Round-Gear^.X.Round) + abs(HHGear^.Y.Round-Gear^.Y.Round) + 2) <  50) and
+         (Distance(HHGear^.X-Gear^.X,HHGear^.Y-Gear^.Y) < _50) then
+        begin
+        // hisssssssssss
+        Gear^.State:= Gear^.State or gstTmpFlag;
+        Gear^.Timer:= 1500;
+        exit
+        end;
+    if (Gear^.State and gstMoving <> 0) then
+        begin
+        Gear^.dY:= _0;
+        Gear^.dX:= _0;
+        end
+    else if (GameTicks and $FF = 0) then
+        begin
+        tdX:= HHGear^.X-Gear^.X;
+        dir:= hwSign(tdX);
+        if not TestCollisionX(Gear, dir) then
+            Gear^.X:= Gear^.X + signAs(_1,tdX);
+        if TestCollisionXwithXYShift(Gear, signAs(_10,tdX), 0, dir) then
+            begin
+            Gear^.dX:= SignAs(_0_15, tdX);
+            Gear^.dY:= -_0_3;
+            Gear^.State:= Gear^.State or gstMoving
+            end
+        end;
+    end;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepKnife(Gear: PGear);
+var ox, oy: LongInt;
+    la: hwFloat;
+    a: real;
+begin
+    // Gear is shrunk so it can actually escape the hog without carving into the terrain
+    if (Gear^.Radius = 6) and (Gear^.CollisionMask = $FFFF) then Gear^.Radius:= 16;
+    if Gear^.Damage > 100 then Gear^.CollisionMask:= 0
+    else if Gear^.Damage > 30 then
+        if GetRandom(max(4,18-Gear^.Damage div 10)) < 3 then Gear^.CollisionMask:= 0;
+    Gear^.Damage:= 0;
+    if Gear^.Timer > 0 then dec(Gear^.Timer);
+    if (Gear^.State and gstMoving <> 0) and (Gear^.State and gstCollision = 0) then
+        begin
+        DeleteCI(Gear);
+        // used for damage and impact calc. needs balancing I think
+        Gear^.Health:= hwRound(hwSqr((hwAbs(Gear^.dY)+hwAbs(Gear^.dX))*_4));
+        doStepFallingGear(Gear);
+        AllInactive := false;
+        a:= Gear^.DirAngle;
+        CalcRotationDirAngle(Gear);
+        Gear^.DirAngle:= a+(Gear^.DirAngle-a)*2*hwSign(Gear^.dX) // double rotation
+        end
+    else if (Gear^.CollisionIndex = -1) and (Gear^.Timer = 0) then
+        begin
+        ox:= 0; oy:= 0;
+        if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1;
+        if TestCollisionXwithGear(Gear, 1)       then ox:=  1;
+        if TestCollisionXwithGear(Gear, -1)      then ox:= -1;
+        if TestCollisionYwithGear(Gear, 1) <> 0  then oy:=  1;
+        if Gear^.Health > 0 then
+            PlaySound(sndRopeAttach);
+(*
+        la:= _10000;
+        if (ox <> 0) or (oy <> 0) then
+            la:= CalcSlopeNearGear(Gear, ox, oy);
+        if la = _10000 then
+            begin
+            // debug for when we couldn't get an angle
+            //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite);
+*)
+            Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(30)-15);
+            if (Gear^.dX.isNegative and Gear^.dY.isNegative) or
+             ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90;
+ //           end
+ //       else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent?
+ //       AddFileLog('la: '+floattostr(la)+' DirAngle: '+inttostr(round(Gear^.DirAngle)));
+        Gear^.dX:= _0;
+        Gear^.dY:= _0;
+        Gear^.State:= Gear^.State and (not gstMoving) or gstCollision;
+        Gear^.Radius:= 20;
+        if Gear^.Health > 0 then AmmoShove(Gear, Gear^.Health, 0);
+        Gear^.Radius:= 16;
+        Gear^.Health:= 0;
+        Gear^.Timer:= 500;
+        AddGearCI(Gear)
+        end
+    else if GameTicks and $3F = 0 then
+        begin
+        if  (TestCollisionYwithGear(Gear, -1) = 0)
+        and (not TestCollisionXwithGear(Gear, 1))
+        and (not TestCollisionXwithGear(Gear, -1))
+        and (TestCollisionYwithGear(Gear, 1) = 0) then Gear^.State:= Gear^.State and (not gstCollision) or gstMoving;
+        end
+end;
+(*
+ This didn't end up getting used, but, who knows, might be reasonable for javellin or something
+// Make the knife initial angle based on the hog attack angle, or is that too hard?
+procedure doStepKnife(Gear: PGear);
+var t, 
+    gx, gy, ga,  // gear x,y,angle
+    lx, ly, la, // land x,y,angle
+    ox, oy, // x,y offset
+    w, h,   // wXh of clip area
+    tx, ty  // tip position in sprite
+    : LongInt;
+    surf: PSDL_Surface;
+    s: hwFloat;
+
+begin
+    Gear^.dY := Gear^.dY + cGravity;
+    if (GameFlags and gfMoreWind) <> 0 then
+        Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density;
+    Gear^.X := Gear^.X + Gear^.dX;
+    Gear^.Y := Gear^.Y + Gear^.dY;
+    CheckGearDrowning(Gear);
+    gx:= hwRound(Gear^.X);
+    gy:= hwRound(Gear^.Y);
+    if Gear^.State and gstDrowning <> 0 then exit;
+    with Gear^ do
+        begin
+        if CheckLandValue(gx, gy, $FF00) then
+            begin
+            t:= Angle + hwRound((hwAbs(dX)+hwAbs(dY)) * _10); 
+
+            if t < 0 then inc(t, 4096)
+            else if 4095 < t then dec(t, 4096);
+            Angle:= t;
+
+            DirAngle:= Angle / 4096 * 360
+            end
+        else
+            begin
+//This is the set of postions for the knife.
+//Using FlipSurface and copyToXY the knife can be written to the LandPixels at 32 positions, and an appropriate line drawn in Land.
+            t:= Angle mod 1024;
+            case t div 128 of
+                0:  begin
+                    ox:=   2; oy:= 5;
+                    w :=  25;  h:= 5;
+                    tx:=   0; ty:= 2
+                    end;
+                1:  begin
+                    ox:=   2; oy:= 15;
+                     w:=  24;  h:=  8;
+                    tx:=   0; ty:=  7
+                    end;
+                2:  begin
+                    ox:=   2; oy:= 27;
+                     w:=  23;  h:= 12;
+                    tx:= -12; ty:= -5
+                    end;
+                3:  begin
+                    ox:=   2; oy:= 43;
+                     w:=  21;  h:= 15;
+                    tx:=   0; ty:= 14
+                    end;
+                4:  begin
+                    ox:= 29; oy:=  8;
+                     w:= 19;  h:= 19;
+                    tx:=  0; ty:= 17 
+                    end;
+                5:  begin
+                    ox:= 29; oy:=  32;
+                     w:= 15;  h:=  21;
+                    tx:=  0; ty:=  20
+                    end;
+                6:  begin
+                    ox:= 51; oy:=   3;
+                     w:= 11;  h:=  23;
+                    tx:=  0; ty:=  22 
+                    end;
+                7:  begin
+                    ox:= 51; oy:=  34;
+                     w:=  7;  h:=  24;
+                    tx:=  0; ty:=  23
+                    end
+                end;
+                
+            surf:= SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMask, GMask, BMask, AMask);
+            copyToXYFromRect(SpritesData[sprKnife].Surface, surf, ox, oy, w, h, 0, 0);
+            // try to make the knife hit point first
+            lx := 0;
+            ly := 0;
+            if CalcSlopeTangent(Gear, gx, gy, lx, ly, 255) then
+                begin
+                la:= vector2Angle(int2hwFloat(lx), int2hwFloat(ly));
+                ga:= vector2Angle(dX, dY);
+                AddFileLog('la: '+inttostr(la)+' ga: '+inttostr(ga)+' Angle: '+inttostr(Angle));
+                // change  to 0 to 4096 forced by LongWord in Gear
+                if la < 0 then la:= 4096+la;
+                if ga < 0 then ga:= 4096+ga;
+                if ((Angle > ga) and (Angle < la)) or ((Angle < ga) and (Angle > la)) then
+                    begin
+                    if Angle >= 2048 then dec(Angle, 2048)
+                    else if Angle < 2048 then inc(Angle, 2048)
+                    end;
+                AddFileLog('la: '+inttostr(la)+' ga: '+inttostr(ga)+' Angle: '+inttostr(Angle))
+                end;
+            case Angle div 1024 of
+                0:  begin 
+                    flipSurface(surf, true);
+                    flipSurface(surf, true);
+                    BlitImageAndGenerateCollisionInfo(gx-(w-tx), gy-(h-ty), w, surf)
+                    end;
+                1:  begin
+                    flipSurface(surf, false);
+                    BlitImageAndGenerateCollisionInfo(gx-(w-tx), gy-ty, w, surf)
+                    end;
+                2:  begin // knife was actually drawn facing this way...
+                    BlitImageAndGenerateCollisionInfo(gx-tx, gy-ty, w, surf)
+                    end;
+                3:  begin
+                    flipSurface(surf, true);
+                    BlitImageAndGenerateCollisionInfo(gx-tx, gy-(h-ty), w, surf)
+                    end
+                end;
+            SDL_FreeSurface(surf);
+            // this needs to calculate actual width/height + land clipping since update texture doesn't.
+            // i.e. this will crash if you fire near sides of map, but until I get the blit right, not going to put real values
+            UpdateLandTexture(hwRound(X)-32, 64, hwRound(Y)-32, 64, true);
+            DeleteGear(Gear);
+            exit
+            end
+        end;
+end;
+*)
diff --git a/hedgewars/HHHandlers.inc b/hedgewars/HHHandlers.inc
deleted file mode 100644
index 14fef13..0000000
--- a/hedgewars/HHHandlers.inc
+++ /dev/null
@@ -1,1154 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *)
-
-////////////////////////////////////////////////////////////////////////////////
-
-procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource);
-begin
-if (Source = dsFall) or (Source = dsExplosion) then
-    case random(3) of
-        0: PlaySound(sndOoff1, Hedgehog^.Team^.voicepack);
-        1: PlaySound(sndOoff2, Hedgehog^.Team^.voicepack);
-        2: PlaySound(sndOoff3, Hedgehog^.Team^.voicepack);
-    end
-else if (Source = dsPoison) then
-    case random(2) of
-        0: PlaySound(sndPoisonCough, Hedgehog^.Team^.voicepack);
-        1: PlaySound(sndPoisonMoan, Hedgehog^.Team^.voicepack);
-    end
-else
-    case random(4) of
-        0: PlaySound(sndOw1, Hedgehog^.Team^.voicepack);
-        1: PlaySound(sndOw2, Hedgehog^.Team^.voicepack);
-        2: PlaySound(sndOw3, Hedgehog^.Team^.voicepack);
-        3: PlaySound(sndOw4, Hedgehog^.Team^.voicepack);
-    end
-end;
-
-// Shouldn't more of this ammo switching stuff be moved to uAmmos ?
-function ChangeAmmo(HHGear: PGear): boolean;
-var slot, i: Longword;
-    ammoidx: LongInt;
-begin
-ChangeAmmo:= false;
-slot:= HHGear^.MsgParam;
-
-with HHGear^.Hedgehog^ do
-    begin
-    HHGear^.Message:= HHGear^.Message and not gmSlot;
-    ammoidx:= 0;
-    if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) or
-       ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
-       ((HHGear^.State and gstHHDriven) = 0) then exit;
-    ChangeAmmo:= true;
-
-    while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx);
-
-    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(HHGear^.Hedgehog^);
-
-    MultiShootAttacks:= 0;
-    HHGear^.Message:= HHGear^.Message and not (gmLJump or gmHJump);
-    
-    if Ammoz[CurAmmoType].Slot = slot then
-        begin
-        i:= 0;
-        repeat
-        inc(ammoidx);
-        if (ammoidx > cMaxSlotAmmoIndex) then
-            begin
-            inc(i);
-            CurAmmoType:= amNothing;
-            ammoidx:= -1;
-            //TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
-            end;
-        until (i = 1) or ((Ammo^[slot, ammoidx].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns))
-        end 
-    else
-        begin
-        i:= 0;
-        // check whether there is ammo in slot
-        while (i <= cMaxSlotAmmoIndex)
-          and ((Ammo^[slot, i].Count = 0)
-               or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
-
-        if i <= cMaxSlotAmmoIndex then ammoidx:= i
-        else ammoidx:= -1
-        end;
-        if ammoidx >= 0 then CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
-    end
-end;
-
-procedure HHSetWeapon(HHGear: PGear);
-var t: LongInt;
-    weap: TAmmoType;
-    Hedgehog: PHedgehog;
-    s: boolean;
-begin
-s:= false;
-
-weap:= TAmmoType(HHGear^.MsgParam);
-Hedgehog:= HHGear^.Hedgehog;
-
-if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon is not activated yet
-
-HHGear^.MsgParam:= Ammoz[weap].Slot;
-
-t:= cMaxSlotAmmoIndex;
-
-HHGear^.Message:= HHGear^.Message and not gmWeapon;
-
-with Hedgehog^ do
-    while (CurAmmoType <> weap) and (t >= 0) do
-        begin
-        s:= ChangeAmmo(HHGear);
-        dec(t)
-        end;
-
-if s then ApplyAmmoChanges(HHGear^.Hedgehog^)
-end;
-
-procedure HHSetTimer(Gear: PGear);
-var CurWeapon: PAmmo;
-    color: LongWord;
-begin
-Gear^.Message:= Gear^.Message and not gmTimer;
-CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
-with Gear^.Hedgehog^ do
-    if ((Gear^.Message and gmPrecise) <> 0) and ((CurWeapon^.Propz and ammoprop_SetBounce) <> 0) then
-        begin
-        color:= Gear^.Hedgehog^.Team^.Clan^.Color;
-        case Gear^.MsgParam of
-            1: begin
-               AddCaption(format(trmsg[sidBounce], trmsg[sidBounce1]), color, capgrpAmmostate);
-               CurWeapon^.Bounciness:= 350;
-               end;
-            2: begin
-               AddCaption(format(trmsg[sidBounce], trmsg[sidBounce2]), color, capgrpAmmostate);
-               CurWeapon^.Bounciness:= 700;
-               end;
-            3: begin
-               AddCaption(format(trmsg[sidBounce], trmsg[sidBounce3]), color, capgrpAmmostate);
-               CurWeapon^.Bounciness:= 1000;
-               end;
-            4: begin
-               AddCaption(format(trmsg[sidBounce], trmsg[sidBounce4]), color, capgrpAmmostate);
-               CurWeapon^.Bounciness:= 2000;
-               end;
-            5: begin
-               AddCaption(format(trmsg[sidBounce], trmsg[sidBounce5]), color, capgrpAmmostate);
-               CurWeapon^.Bounciness:= 4000;
-               end
-            end
-        end
-    else if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
-        begin
-        CurWeapon^.Timer:= 1000 * Gear^.MsgParam;
-        with CurrentTeam^ do
-            ApplyAmmoChanges(Hedgehogs[CurrHedgehog]);
-        end;
-end;
-
-
-procedure Attack(Gear: PGear);
-var xx, yy, newDx, newDy, lx, ly: hwFloat;
-    speech: PVisualGear;
-    newGear:  PGear;
-    CurWeapon: PAmmo;
-    altUse: boolean;
-    elastic: hwFloat;
-begin
-newGear:= nil;
-bShowFinger:= false;
-CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
-with Gear^,
-     Gear^.Hedgehog^ do
-     begin
-     if ((State and gstHHDriven) <> 0)and
-        ((State and (gstAttacked or gstHHChooseTarget)) = 0) and
-        (((State and gstMoving) = 0) or
-            (Power > 0) or
-            (CurAmmoType = amTeleport) or 
-            // Allow attacks while moving on ammo with AltAttack
-            ((CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)) or
-            ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackInMove) <> 0)) and
-        ((TargetPoint.X <> NoPointX) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) = 0)) then
-        begin
-        State:= State or gstAttacking;
-        if Power = cMaxPower then Message:= Message and not gmAttack
-        else if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) = 0 then Message:= Message and not gmAttack
-        else begin
-             if Power = 0 then
-                begin
-                AttackBar:= CurrentTeam^.AttackBar;
-                PlaySound(sndThrowPowerUp)
-                end;
-             inc(Power)
-             end;
-        if ((Message and gmAttack) <> 0) then exit;
-
-        if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0 then
-           begin
-           StopSound(sndThrowPowerUp);
-           PlaySound(sndThrowRelease);
-           end;
-
-        xx:= SignAs(AngleSin(Angle), dX);
-        yy:= -AngleCos(Angle);
-
-        lx:= X + int2hwfloat(round(GetLaunchX(CurAmmoType, hwSign(dX), Angle)));
-        ly:= Y + int2hwfloat(round(GetLaunchY(CurAmmoType, Angle)));
-
-        if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then xx:= - xx;
-        if Ammoz[CurAmmoType].Ammo.AttackVoice <> sndNone then
-           AddVoice(Ammoz[CurAmmoType].Ammo.AttackVoice, CurrentTeam^.voicepack);
-
-// Initiating alt attack
-        if  (CurAmmoGear <> nil) and
-            ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) and
-            ((Gear^.Message and gmLJump) <> 0) and
-            ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
-            begin
-            newDx:= dX / _2; 
-            newDy:= dY / _2;
-            altUse:= true;
-            end
-        else
-            begin
-            newDx:= xx*Power/cPowerDivisor;
-            newDy:= yy*Power/cPowerDivisor;
-            altUse:= false
-            end;
-
-             case CurAmmoType of
-                      amGrenade: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGrenade,         0, newDx, newDy, CurWeapon^.Timer);
-                      amMolotov: newGear:= AddGear(hwRound(lx), hwRound(ly), gtMolotov,      0, newDx, newDy, 0);
-                  amClusterBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtClusterBomb,  0, newDx, newDy, CurWeapon^.Timer);
-                      amGasBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGasBomb,      0, newDx, newDy, CurWeapon^.Timer);
-                      amBazooka: newGear:= AddGear(hwRound(lx), hwRound(ly), gtShell,        0, newDx, newDy, 0);
-                     amSnowball: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSnowball,     0, newDx, newDy, 0);
-                          amBee: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBee,          0, newDx, newDy, 0);
-                      amShotgun: begin
-                                 PlaySound(sndShotgunReload);
-                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtShotgunShot,  0, xx * _0_5, yy * _0_5, 0);
-                                 end;
-                   amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0);
-                         amSkip: ParseCommand('/skip', true);
-                         amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0);
-                         amMine: if altUse then
-                                    newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, newDx, newDy, 3000)
-                                 else
-                                    newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000);
-                        amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
-                       amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
-                      amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0);
-                    amPortalGun: begin
-                                 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 
-                                 // set selected color
-                                 CurWeapon^.Pos);
-                                 end;
-                  amSniperRifle: begin
-                                 PlaySound(sndSniperReload);
-                                 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0);
-                                 end;
-                     amDynamite: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
-                    amFirePunch: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtFirePunch, 0, xx, _0, 0);
-                         amWhip: begin
-                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtWhip, 0, SignAs(_1, dX), - _0_8, 0);
-                                 PlaySound(sndWhipCrack)
-                                 end;
-                       amHammer: begin
-                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtHammer, 0, SignAs(_1, dX), - _0_8, 0);
-                                 PlaySound(sndWhack)
-                                 end;
-                  amBaseballBat: begin
-                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtShover, gsttmpFlag, xx * _0_5, yy * _0_5, 0);
-                                 PlaySound(sndBaseballBat) // TODO: Only play if something is hit?
-                                 end;
-                    amParachute: begin
-                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtParachute, 0, _0, _0, 0);
-                                 PlaySound(sndParachute)
-                                 end;
-                    // we save CurWeapon^.Pos (in this case: cursor direction) by using it as (otherwise irrelevant) X value of the new gear.
-                    amAirAttack: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 0, _0, _0, 0);
-                   amMineStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 1, _0, _0, 0);
-                  amDrillStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 3, _0, _0, CurWeapon^.Timer);
-                       amNapalm: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 2, _0, _0, 0);
-                    amBlowTorch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBlowTorch, 0, SignAs(_0_5, dX), _0, 0);
-                       amGirder: newGear:= AddGear(0, 0, gtGirder, CurWeapon^.Pos, _0, _0, 0);
-                     amTeleport: newGear:= AddGear(CurWeapon^.Pos, 0, gtTeleport, 0, _0, _0, 0);
-                       amSwitch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSwitcher, 0, _0, _0, 0);
-                       amMortar: begin
-                                 playSound(sndMortar);
-                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtMortar,  0, xx*cMaxPower/cPowerDivisor, yy*cMaxPower/cPowerDivisor, 0);
-                                 end;
-                      amRCPlane: begin
-                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtRCPlane,  0, xx * cMaxPower / cPowerDivisor / 4, yy * cMaxPower / cPowerDivisor / 4, 0);
-                                 newGear^.SoundChannel:= LoopSound(sndRCPlane, nil)
-                                 end;
-                       amKamikaze: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
-                         amCake: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 3, hwRound(ly), gtCake, 0, xx, _0, 0);
-                    amSeduction: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSeduction, 0, _0, _0, 0);
-                   amWatermelon: newGear:= AddGear(hwRound(lx), hwRound(ly), gtWatermelon,  0, newDx, newDy, CurWeapon^.Timer);
-                  amHellishBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtHellishBomb,    0, newDx, newDy, 0);
-                        amDrill: newGear:= AddGear(hwRound(lx), hwRound(ly), gtDrill, 0, newDx, newDy, 0);
-                      amBallgun: newGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun,  0, xx * _0_5, yy * _0_5, 0);
-                    amJetpack: newGear:= AddGear(hwRound(lx), hwRound(ly), gtJetpack, 0, _0, _0, 0);
-                    amBirdy: begin
-                             PlaySound(sndWhistle);
-                             newGear:= AddGear(hwRound(lx), hwRound(ly) - 32, gtBirdy, 0, _0, _0, 0);
-                             end;
-                      amLowGravity: begin
-                                    PlaySound(sndLowGravity);
-                                    cGravity:= cMaxWindSpeed;
-                                    cGravityf:= 0.00025
-                                    end;
-                      amExtraDamage:begin 
-                                    PlaySound(sndHellishImpact4);
-                                    cDamageModifier:= _1_5
-                                    end;
-                      amInvulnerable: Invulnerable:= true;
-                      amExtraTime:  begin
-                                    PlaySound(sndSwitchHog);
-                                    TurnTimeLeft:= TurnTimeLeft + 30000
-                                    end;
-                      amLaserSight: cLaserSighting:= true;
-                      amVampiric: begin
-                                  PlaySound(sndOw1, Team^.voicepack);
-                                  cVampiric:= true;
-                                  end;
-                      amPiano: begin
-                               // Tuck the hedgehog away until the piano attack is completed
-                               Unplaced:= true;
-                               X:= _0;
-                               Y:= _0;
-                               newGear:= AddGear(TargetPoint.X, 0, gtPiano, 0, _0, _0, 0);
-                               PauseMusic
-                               end;
-                      amFlamethrower: newGear:= AddGear(hwRound(X), hwRound(Y), gtFlamethrower,  0, xx * _0_5, yy * _0_5, 0);
-                      amLandGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtLandGun,  0, xx * _0_5, yy * _0_5, 0);
-                    amResurrector: begin
-                        newGear:= AddGear(hwRound(lx), hwRound(ly),
-                                gtResurrector, 0, _0, _0, 0);
-                        newGear^.SoundChannel := LoopSound(sndResurrector);
-                    end;
-                   //amMelonStrike: AddGear(CurWeapon^.Pos, 0, gtAirAttack, 4, _0, _0, 0);
-                     amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
-                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
-                  end;
-             case CurAmmoType of
-                      amGrenade, amMolotov, 
-                  amClusterBomb, amGasBomb, 
-                      amBazooka, amSnowball, 
-                          amBee, amSMine,
-                       amMortar, amWatermelon,
-                  amHellishBomb, amDrill: FollowGear:= newGear;
-
-                      amShotgun, amPickHammer,
-                         amRope, amDEagle,
-                      amSineGun, amSniperRifle,
-                    amFirePunch, amWhip,
-                       amHammer, amBaseballBat,
-                    amParachute, amBlowTorch,
-                       amGirder, amTeleport,
-                       amSwitch, amRCPlane,
-                     amKamikaze, amCake,
-                    amSeduction, amBallgun,
-                      amJetpack, amBirdy,
-                 amFlamethrower, amLandGun,
-                  amResurrector, amStructure,
-                       amTardis, amPiano: CurAmmoGear:= newGear;
-                  end;
-              if (CurAmmoType = amMine) or (CurAmmoType = amSMine) and (GameFlags and gfInfAttack <> 0) then newGear^.FlightTime:= GameTicks + 1000;
-        if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then
-            begin
-            newGear^.Target.X:= TargetPoint.X;
-            newGear^.Target.Y:= TargetPoint.Y
-            end;
-
-        // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement
-        if altUse then FollowGear:= nil;
-
-        if (newGear <> nil) and ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then
-            begin
-            elastic:=  int2hwfloat(CurWeapon^.Bounciness) / _1000;
-
-            if elastic < _1 then newGear^.Elasticity:= newGear^.Elasticity * elastic
-            else if elastic > _1 then newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic);
-(* Experimented with friction modifier. Didn't seem helpful 
-            fric:= int2hwfloat(CurWeapon^.Bounciness) / _250;
-            if fric < _1 then newGear^.Friction:= newGear^.Friction * fric
-            else if fric > _1 then newGear^.Friction:= _1 - ((_1-newGear^.Friction) / fric)*)
-            end;
-
-
-        uStats.AmmoUsed(CurAmmoType);
-
-        if not (SpeechText = '') then
-            begin
-            speech:= AddVisualGear(0, 0, vgtSpeechBubble);
-            if speech <> nil then
-               begin
-               speech^.Text:= SpeechText;
-               speech^.Hedgehog:= Gear^.Hedgehog;
-               speech^.FrameTicks:= SpeechType;
-               end;
-            SpeechText:= ''
-            end;
-
-        Power:= 0;
-        if (CurAmmoGear <> nil)
-           and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) = 0){check for dropping ammo from rope} then
-           begin
-           Message:= Message or gmAttack;
-           CurAmmoGear^.Message:= Message
-           end else begin
-           if not CurrentTeam^.ExtDriven and
-             ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0) then SendIPC('a');
-           AfterAttack;
-           end
-        end else Message:= Message and not gmAttack;
-     end;
-     TargetPoint.X := NoPointX;
-     ScriptCall('onHogAttack');	
-end;
-
-procedure AfterAttack;
-var s: shortstring;
-    a: TAmmoType;
-begin
-with CurrentHedgehog^.Gear^,
-        CurrentHedgehog^ do
-    begin
-    a:= CurAmmoType;
-    State:= State and not gstAttacking;
-    if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then
-        begin
-        Inc(MultiShootAttacks);
-        
-        if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
-            begin
-            s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1);
-            AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate);
-            end;
-        
-        if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) or
-            ((GameFlags and gfMultiWeapon) <> 0) then
-            begin
-            isInMultiShoot:= true
-            end
-        else
-            begin
-            OnUsedAmmo(CurrentHedgehog^);
-            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (((GameFlags and gfInfAttack) = 0) or PlacingHogs) then
-                begin
-                if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
-                TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
-                end;
-            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then State:= State or gstAttacked;
-            if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then ApplyAmmoChanges(CurrentHedgehog^)
-            end;
-        end
-    else
-        begin
-        OnUsedAmmo(CurrentHedgehog^);
-        ApplyAmmoChanges(CurrentHedgehog^);
-        end;
-    AttackBar:= 0
-    end
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepHedgehogDead(Gear: PGear);
-const frametime = 200;
-      timertime = frametime * 6;
-begin
-if Gear^.Hedgehog^.Unplaced then exit;
-if Gear^.Timer > 1 then
-    begin
-    AllInactive:= false;
-    dec(Gear^.Timer);
-    if (Gear^.Timer mod frametime) = 0 then inc(Gear^.Pos)
-    end 
-else if Gear^.Timer = 1 then
-    begin
-    Gear^.State:= Gear^.State or gstNoDamage;
-    doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, CurrentHedgehog, EXPLAutoSound);
-    AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtGrave, 0, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
-    DeleteGear(Gear);
-    SetAllToActive
-    end 
-else // Gear^.Timer = 0
-    begin
-    AllInactive:= false;
-    Gear^.Z:= cCurrHHZ;
-    RemoveGearFromList(Gear);
-    InsertGearToList(Gear);
-    PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
-    Gear^.Pos:= 0;
-    Gear^.Timer:= timertime
-    end
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepHedgehogGone(Gear: PGear);
-const frametime = 65;
-      timertime = frametime * 11;
-begin
-if Gear^.Hedgehog^.Unplaced then exit;
-if Gear^.Timer > 1 then
-    begin
-    AllInactive:= false;
-    dec(Gear^.Timer);
-    if (Gear^.Timer mod frametime) = 0 then inc(Gear^.Pos)
-    end else
-if Gear^.Timer = 1 then
-    begin
-    DeleteGear(Gear);
-    SetAllToActive
-    end else // Gear^.Timer = 0
-    begin
-    AllInactive:= false;
-    Gear^.Z:= cCurrHHZ;
-    RemoveGearFromList(Gear);
-    InsertGearToList(Gear);
-    PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
-    PlaySound(sndWarp);
-    Gear^.Pos:= 0;
-    Gear^.Timer:= timertime
-    end
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure PickUp(HH, Gear: PGear);
-var s: shortstring;
-    a: TAmmoType;
-    i: LongInt;
-    vga: PVisualGear;
-begin
-Gear^.Message:= gmDestroy;
-PlaySound(sndShotgunReload);
-if (Gear^.Pos and posCaseExplode) <> 0 then
-    if (Gear^.Pos and posCasePoison) <> 0 then
-        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned)
-    else
-        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound)
-else if (Gear^.Pos and posCasePoison) <> 0 then
-    doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage)
-else
-case Gear^.Pos of
-       posCaseUtility,
-       posCaseAmmo: begin
-                    if Gear^.AmmoType <> amNothing then a:= Gear^.AmmoType 
-                    else
-                        begin
-                        for i:= 0 to GameTicks and $7F do GetRandom(2); // Burn some random numbers
-                        if Gear^.Pos = posCaseUtility then a:= GetUtility
-                        else a:= GetAmmo
-                        end;
-                    AddAmmo(HH^.Hedgehog^, a);
-// Possibly needs to check shared clan ammo game flag once added.
-// On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
-                    if (not (HH^.Hedgehog^.Team^.ExtDriven 
-                      or (HH^.Hedgehog^.BotLevel > 0)))
-                      or (HH^.Hedgehog^.Team^.Clan^.ClanIndex = LocalClan)
-                      or (GameType = gmtDemo)  then
-                        begin
-                        s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')';
-                        AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
-
-                        // show ammo icon
-                        vga:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtAmmo);
-                        if vga <> nil then
-                            vga^.Frame:= Longword(a);
-                        end;
-
-                    end;
-     posCaseHealth: begin
-                    inc(HH^.Health, Gear^.Health);
-                    HH^.Hedgehog^.Effects[hePoisoned] := false;
-                    str(Gear^.Health, s);
-                    s:= '+' + s;
-                    AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
-                    RenderHealth(HH^.Hedgehog^);
-                    RecountTeamHealth(HH^.Hedgehog^.Team);
-
-                    i:= 0;
-                    while i < Gear^.Health do
-                        begin
-                        vga:= AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtStraightShot);
-                        if vga <> nil then
-                            with vga^ do
-                                begin
-                                Tint:= $00FF00FF;
-                                State:= ord(sprHealth)
-                                end;
-                        inc(i, 5);
-                        end;
-                    end;
-     end
-end;
-
-const StepTicks: LongWord = 0;
-
-procedure HedgehogStep(Gear: PGear);
-var PrevdX: LongInt;
-    CurWeapon: PAmmo;
-begin
-CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
-if ((Gear^.State and (gstAttacking or gstMoving)) = 0) then
-   begin
-   if isCursorVisible then
-      with Gear^.Hedgehog^ do
-        with CurWeapon^ do
-          begin
-          if (Gear^.Message and gmLeft  ) <> 0 then
-             Pos:= (Pos - 1 + Ammoz[AmmoType].PosCount) mod Ammoz[AmmoType].PosCount
-          else
-          if (Gear^.Message and gmRight ) <> 0 then
-             Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount
-          else exit;
-          StepTicks:= 200;
-          exit
-          end;
-
-    if ((Gear^.Message and gmAnimate) <> 0) then
-        begin
-        Gear^.Message:= 0;
-        Gear^.State:= Gear^.State or gstAnimation;
-        Gear^.Tag:= Gear^.MsgParam;
-        Gear^.Timer:= 0;
-        Gear^.Pos:= 0
-        end;
-
-   if ((Gear^.Message and gmLJump ) <> 0) then
-      begin
-      Gear^.Message:= Gear^.Message and not gmLJump;
-      DeleteCI(Gear);
-      if TestCollisionYwithGear(Gear, -1) = 0 then
-         if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _2 else
-         if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX))
-         or   (TestCollisionYwithGear(Gear, -1) <> 0)) then
-         begin
-         Gear^.dY:= -_0_15;
-         if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX);
-         Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
-         PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack);
-         exit
-         end;
-      end;
-
-   if ((Gear^.Message and gmHJump ) <> 0) then
-      begin
-      DeleteCI(Gear);
-      Gear^.Message:= Gear^.Message and not gmHJump;
-
-      Gear^.dY:= -_0_2;
-      SetLittle(Gear^.dX);
-      Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
-      PlaySound(sndJump3, Gear^.Hedgehog^.Team^.voicepack);
-      exit
-      end;
-
-   PrevdX:= hwSign(Gear^.dX);
-   if (Gear^.Message and gmLeft  )<>0 then Gear^.dX:= -cLittle else
-   if (Gear^.Message and gmRight )<>0 then Gear^.dX:=  cLittle else exit;
-
-   if (Gear^.Message and (gmLeft or gmRight)) <> 0 then
-      begin
-      StepSoundTimer:= cHHStepTicks;
-      end;
-   
-   StepTicks:= cHHStepTicks;
-   if PrevdX <> hwSign(Gear^.dX) then
-      begin
-      FollowGear:= Gear;
-      exit
-      end;
-   DeleteCI(Gear); // must be after exit!! (see previous line)
-
-   Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7;
-   if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
-      begin
-      if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -5, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -4, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      end;
-
-   if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then
-      Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX);
-
-   SetAllHHToActive;
-
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-      begin
-      Gear^.Y:= Gear^.Y - _6;
-      Gear^.dY:= _0;
-      Gear^.State:= Gear^.State or gstMoving;
-      exit
-      end;
-   end
-   end
-   end
-   end
-   end
-   end;
-   AddGearCI(Gear)
-   end
-end;
-
-procedure HedgehogChAngle(HHGear: PGear);
-var da: LongWord;
-begin
-with HHGear^.Hedgehog^ do
-    if ((CurAmmoType = amRope) and 
-        ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving)) or
-       ((CurAmmoType = amPortalGun) and 
-        ((HHGear^.State and gstMoving) <> 0)) then da:= 2
-    else da:= 1;
-
-if (((HHGear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then
-    if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then dec(HHGear^.Angle, da)
-    else
-    if ((HHGear^.Message and gmDown) <> 0) and (HHGear^.Angle + da <= CurMaxAngle) then inc(HHGear^.Angle, da)
-end;
-
-procedure doStepHedgehog(Gear: PGear); forward;
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepHedgehogMoving(Gear: PGear);
-var isFalling, isUnderwater: boolean;
-    land: Word;
-begin
-land:= 0;
-isUnderwater:= cWaterLine < hwRound(Gear^.Y) + Gear^.Radius;
-if Gear^.dX.QWordValue > 8160437862 then Gear^.dX.QWordValue:= 8160437862;
-if Gear^.dY.QWordValue > 8160437862 then Gear^.dY.QWordValue:= 8160437862;
-
-if Gear^.Hedgehog^.Unplaced then
-   begin
-   Gear^.dY:= _0;
-   Gear^.dX:= _0;
-   Gear^.State:= Gear^.State and not gstMoving;
-   exit
-   end;
-isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1);
-if isFalling then
-   begin
-   if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then Gear^.dY:= _0;
-   Gear^.State:= Gear^.State or gstMoving;
-   if (CurrentHedgehog^.Gear = Gear)
-        and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then 
-        begin
-        FollowGear:= Gear;
-        end;
-   if isUnderwater then Gear^.dY:= Gear^.dY + cGravity / _2
-   else
-       begin
-       Gear^.dY:= Gear^.dY + cGravity;
-// this set of circumstances could be less complex if jumping was more clearly identified
-       if ((GameFlags and gfMoreWind) <> 0) and 
-          (((Gear^.Damage <> 0) or
-          ((CurAmmoGear <> nil) and
-            ((CurAmmoGear^.AmmoType = amJetpack) or
-            (CurAmmoGear^.AmmoType = amBirdy))) or
-          ((Gear^.dY.QWordValue + Gear^.dX.QWordValue) > _0_55.QWordValue)))
-          then Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
-       end
-   end 
-else
-   begin
-   land:= TestCollisionYwithGear(Gear, 1);
-   if ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_55.QWordValue) and ((land and lfIce) = 0)
-      and ((Gear^.State and gstHHJumping) <> 0) then SetLittle(Gear^.dX);
-
-   if not Gear^.dY.isNegative then
-      begin
-      CheckHHDamage(Gear);
-
-      if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) and
-         (Gear^.dX.QWordValue < _0_02.QWordValue) then Gear^.dX.isNegative:= not Gear^.dX.isNegative; // landing after high jump
-
-      Gear^.State:= Gear^.State and not (gstHHJumping or gstHHHJump);
-      Gear^.dY:= _0;
-      end else Gear^.dY:= Gear^.dY + cGravity;
-
-   if ((Gear^.State and gstMoving) <> 0) then
-       begin
-       if land and lfIce <> 0 then
-           begin
-           Gear^.dX:= Gear^.dX * (_1 - (_1 - Gear^.Friction) / _2)
-           end
-       else Gear^.dX:= Gear^.dX * Gear^.Friction;
-       end
-   end;
-
-if (Gear^.State <> 0) then DeleteCI(Gear);
-
-if isUnderwater then
-   begin
-   Gear^.dY:= Gear^.dY * _0_999;
-   Gear^.dX:= Gear^.dX * _0_999;
-   end;
-
-if (Gear^.State and gstMoving) <> 0 then
-   if TestCollisionXKick(Gear, hwSign(Gear^.dX)) then
-      if not isFalling then
-         if hwAbs(Gear^.dX) > _0_01 then
-            if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_96; Gear^.Y:= Gear^.Y - _1 end else
-            if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_93; Gear^.Y:= Gear^.Y - _2 end else
-            if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_9 ; Gear^.Y:= Gear^.Y - _3 end else
-            if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_87; Gear^.Y:= Gear^.Y - _4 end else
-            if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) then begin Gear^.X:= Gear^.X + Gear^.dX; Gear^.dX:= Gear^.dX * _0_84; Gear^.Y:= Gear^.Y - _5 end else
-            if hwAbs(Gear^.dX) > _0_02 then Gear^.dX:= -Gear^.Elasticity * Gear^.dX
-                                   else begin
-                                        Gear^.State:= Gear^.State and not gstMoving;
-                                        while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1;
-                                        SetLittle(Gear^.dX)
-                                        end
-            else begin
-                 Gear^.State:= Gear^.State and not gstMoving;
-                 while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1;
-                 SetLittle(Gear^.dX)
-                 end
-         else if (hwAbs(Gear^.dX) > cLittle)
-                and ((Gear^.State and gstHHJumping) = 0)
-                then Gear^.dX:= -Gear^.Elasticity * Gear^.dX
-                else SetLittle(Gear^.dX);
-
-if (not isFalling) and
-   (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
-   begin
-   Gear^.State:= Gear^.State and not gstWinner;
-   Gear^.State:= Gear^.State and not gstMoving;
-   while TestCollisionYWithGear(Gear,1) = 0 do Gear^.Y:= Gear^.Y+_1;
-   SetLittle(Gear^.dX);
-   Gear^.dY:= _0
-   end else Gear^.State:= Gear^.State or gstMoving;
-
-if (Gear^.State and gstMoving) <> 0 then
-   begin
-   Gear^.State:= Gear^.State and not gstAnimation;
-// ARTILLERY but not being moved by explosions
-   Gear^.X:= Gear^.X + Gear^.dX;
-   Gear^.Y:= Gear^.Y + Gear^.dY;
-   if (not Gear^.dY.isNegative) and
-      (not TestCollisionYKick(Gear, 1)) and
-       TestCollisionYwithXYShift(Gear, 0, 1, 1) then
-      begin
-      CheckHHDamage(Gear);
-      Gear^.dY:= _0;
-      Gear^.Y:= Gear^.Y + _1
-      end;
-   CheckGearDrowning(Gear);
-   // hide target cursor if current hog is drowning
-   if (Gear^.State and gstDrowning) <> 0 then
-       if (CurrentHedgehog^.Gear = Gear) then
-          isCursorVisible:= false
-   end;
-
-if (hwAbs(Gear^.dY) > _0) and (Gear^.FlightTime > 0) and ((GameFlags and gfLowGravity) = 0) then
-    begin
-    inc(Gear^.FlightTime);
-    if Gear^.FlightTime = 3000 then
-        begin
-        AddCaption(GetEventString(eidHomerun), cWhiteColor, capgrpMessage);
-        PlaySound(sndHomerun)
-        end;
-    end
-else
-    begin
-    uStats.hedgehogFlight(Gear, Gear^.FlightTime);
-    Gear^.FlightTime:= 0;
-    end;
-
-end;
-
-procedure doStepHedgehogDriven(HHGear: PGear);
-var t: PGear;
-    wasJumping: boolean;
-    Hedgehog: PHedgehog;
-begin
-Hedgehog:= HHGear^.Hedgehog;
-if isInMultiShoot then
-   HHGear^.Message:= 0;
-
-if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Utility) <> 0) and isInMultiShoot then 
-    AllInactive:= true
-else if not isInMultiShoot then AllInactive:= false;
-
-if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) then
-    begin
-    if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
-    TurnTimeLeft:= 0;
-    isCursorVisible:= false;
-    HHGear^.State:= HHGear^.State and not (gstHHDriven or gstAnimation or gstAttacking);
-    AttackBar:= 0;
-    if HHGear^.Damage > 0 then
-        HHGear^.State:= HHGear^.State and not (gstHHJumping or gstHHHJump);
-    exit
-    end;
-
-if (HHGear^.State and gstAnimation) <> 0 then
-    begin
-    HHGear^.Message:= 0;
-    if (HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].VoiceDelay) and (HHGear^.Timer = 0) then PlaySound(Wavez[TWave(HHGear^.Tag)].Voice, Hedgehog^.Team^.voicepack);
-    inc(HHGear^.Timer);
-    if HHGear^.Timer = Wavez[TWave(HHGear^.Tag)].Interval then
-        begin
-        HHGear^.Timer:= 0;
-        inc(HHGear^.Pos);
-        if HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].FramesCount then
-            HHGear^.State:= HHGear^.State and not gstAnimation
-        end;
-    exit
-    end;
-
-if ((HHGear^.State and gstMoving) <> 0)
-    or (StepTicks = cHHStepTicks)
-    or (CurAmmoGear <> nil) then // we are moving
-    begin
-    with Hedgehog^ do
-        if (CurAmmoGear = nil)
-        and (HHGear^.dY > _0_39)
-        and (CurAmmoType = amParachute) then HHGear^.Message:= HHGear^.Message or gmAttack;
-    // check for case with ammo
-    t:= CheckGearNear(HHGear, gtCase, 36, 36);
-    if t <> nil then
-        PickUp(HHGear, t)
-    end;
-
-if (CurAmmoGear = nil) then
-    if (((HHGear^.Message and gmAttack) <> 0)
-        or ((HHGear^.State and gstAttacking) <> 0)) then
-        Attack(HHGear) // should be before others to avoid desync with '/put' msg and changing weapon msgs
-    else
-else 
-    with Hedgehog^ do
-        if ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
-            and ((HHGear^.Message and gmLJump) <> 0)
-            and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
-            begin
-            Attack(HHGear);
-            HHGear^.Message:= HHGear^.Message and not gmLJump
-            end;
-
-if (CurAmmoGear = nil)
-    or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) 
-    or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) then
-    begin
-    if ((HHGear^.Message and gmSlot) <> 0) then
-        if ChangeAmmo(HHGear) then ApplyAmmoChanges(Hedgehog^);
-
-    if ((HHGear^.Message and gmWeapon) <> 0) then HHSetWeapon(HHGear);
-
-    if ((HHGear^.Message and gmTimer) <> 0) then HHSetTimer(HHGear);
-    end;
-
-if CurAmmoGear <> nil then
-   begin
-   CurAmmoGear^.Message:= HHGear^.Message;
-   exit
-   end;
-
-if not isInMultiShoot then
-   HedgehogChAngle(HHGear);
-
-if (HHGear^.State and gstMoving) <> 0 then
-    begin
-    wasJumping:= ((HHGear^.State and gstHHJumping) <> 0);
-
-    if ((HHGear^.Message and gmHJump) <> 0) and
-        wasJumping and
-        ((HHGear^.State and gstHHHJump) = 0) then
-        if (not (hwAbs(HHGear^.dX) > cLittle)) and (HHGear^.dY < -_0_02) then
-            begin
-            HHGear^.State:= HHGear^.State or gstHHHJump;
-            HHGear^.dY:= -_0_25;
-            if not cArtillery then HHGear^.dX:= -SignAs(_0_02, HHGear^.dX);
-            PlaySound(sndJump2, Hedgehog^.Team^.voicepack)
-            end;
-
-    HHGear^.Message:= HHGear^.Message and not (gmLJump or gmHJump);
-
-    if (not cArtillery) and wasJumping and
-        TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX);
-
-    if Hedgehog^.Gear <> nil then doStepHedgehogMoving(HHGear);
-
-    if ((HHGear^.State and (gstMoving or gstDrowning)) = 0) then
-        begin
-        AddGearCI(HHGear);
-        if wasJumping then
-            StepTicks:= 410
-        else
-            StepTicks:= 95
-        end;
-    exit
-    end;
-
-    if not isInMultiShoot and (Hedgehog^.Gear <> nil) then
-        begin
-        if StepTicks > 0 then dec(StepTicks);
-        if (StepTicks = 0) then HedgehogStep(HHGear)
-        end
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepHedgehogFree(Gear: PGear);
-var prevState: Longword;
-begin
-prevState:= Gear^.State;
-
-doStepHedgehogMoving(Gear);
-
-if (Gear^.State and (gstMoving or gstDrowning)) <> 0 then
-    begin
-    if Gear^.Damage > 0 then CalcRotationDirAngle(Gear);
-    AllInactive:= false;
-    exit
-    end;
-
-if (Gear^.Health = 0) then
-    begin
-    if PrvInactive or ((GameFlags and gfInfAttack) <> 0) then
-        begin
-        Gear^.Timer:= 0;
-        FollowGear:= Gear;
-        PrvInactive:= false;
-        AllInactive:= false;
-
-        if (Gear^.State and gstHHGone) = 0 then
-            begin
-            Gear^.Hedgehog^.Effects[hePoisoned] := false;
-            if Gear^.Hedgehog^.Effects[heResurrectable] then begin
-                ResurrectHedgehog(Gear);
-            end else 
-                begin
-                Gear^.State:= (Gear^.State or gstHHDeath) and not gstAnimation;
-                Gear^.doStep:= @doStepHedgehogDead;
-                // Death message
-                AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
-                end;
-            end
-        else
-            begin
-            Gear^.State:= Gear^.State and not gstAnimation;
-            Gear^.doStep:= @doStepHedgehogGone;
-
-            // Gone message
-            AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
-            end
-        end;
-    exit
-    end;
-
-if ((Gear^.State and gstWait) = 0) and
-    (prevState <> Gear^.State) then
-    begin
-    Gear^.State:= Gear^.State or gstWait;
-    Gear^.Timer:= 150
-    end else
-    begin
-    if Gear^.Timer = 0 then
-        begin
-        Gear^.State:= Gear^.State and not (gstWait or gstLoser or gstWinner or gstAttacked or gstNotKickable or gstHHChooseTarget);
-        Gear^.Active:= false;
-        AddGearCI(Gear);
-        exit
-        end else dec(Gear^.Timer)
-    end;
-
-AllInactive:= false
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-procedure doStepHedgehog(Gear: PGear);
-(*
-var x,y,tx,ty: LongInt;
-    tdX, tdY, slope: hwFloat; 
-    land: Word; *)
-var slope: hwFloat; 
-begin
-if (Gear^.Message and gmDestroy) <> 0 then
-    begin
-    DeleteGear(Gear);
-    exit
-    end;
-
-if (Gear^.State and gstHHDriven) = 0 then
-    doStepHedgehogFree(Gear)
-else
-    begin
-    with Gear^.Hedgehog^ do
-        if Team^.hasGone then
-            TeamGoneEffect(Team^)
-        else
-            doStepHedgehogDriven(Gear)
-    end;
-if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0) and
-   (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0) and
-   not Gear^.dY.isNegative and
-   (GameTicks mod (100*LongWOrd(hwRound(cMaxWindSpeed*2/cGravity))) = 0) and
-   (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
-    begin
-    slope:= CalcSlopeBelowGear(Gear);
-    Gear^.dX:=Gear^.dX+slope*_0_07;
-    if slope.QWordValue <> 0 then Gear^.State:= Gear^.State or gstMoving;
-(*
-    x:= hwRound(Gear^.X);
-    y:= hwRound(Gear^.Y);
-    AddVisualGear(x, y, vgtSmokeTrace);
-    AddVisualGear(x - hwRound(_5*slope), y + hwRound(_5*slope), vgtSmokeTrace);
-    AddVisualGear(x + hwRound(_5*slope), y - hwRound(_5*slope), vgtSmokeTrace);
-    AddVisualGear(x - hwRound(_20 * slope), y + hwRound(_20 * slope), vgtSmokeTrace);
-    AddVisualGear(x + hwRound(_20 * slope), y - hwRound(_20 * slope), vgtSmokeTrace);
-    AddVisualGear(x - hwRound(_30 * slope), y + hwRound(_30 * slope), vgtSmokeTrace);
-    AddVisualGear(x + hwRound(_30 * slope), y - hwRound(_30 * slope), vgtSmokeTrace);
-    AddVisualGear(x - hwRound(_40 * slope), y + hwRound(_40 * slope), vgtSmokeTrace);
-    AddVisualGear(x + hwRound(_40 * slope), y - hwRound(_40 * slope), vgtSmokeTrace);
-    AddVisualGear(x - hwRound(_50 * slope), y + hwRound(_50 * slope), vgtSmokeTrace);
-    AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *)
-    end
-end;
diff --git a/hedgewars/LuaPas.pas b/hedgewars/LuaPas.pas
index 58c978c..b847241 100644
--- a/hedgewars/LuaPas.pas
+++ b/hedgewars/LuaPas.pas
@@ -1,4 +1,5 @@
 {$HINTS OFF}
+{$INCLUDE "options.inc"}
 
 unit LuaPas;
 
@@ -10,20 +11,20 @@ unit LuaPas;
  *)
 
 interface
-
+uses uConsts;
 {.$DEFINE LUA_GETHOOK}
-{$INCLUDE "config.inc"}
 
 type
-  size_t   = type Cardinal;
-  Psize_t  = ^size_t;
-  PPointer = ^Pointer;
+{$IFNDEF PAS2C}    
+    size_t   = Cardinal;
+{$ENDIF}
+    Psize_t  = ^size_t;
+    PPointer = ^Pointer;
 
-  lua_State = record end;
-  Plua_State = ^lua_State;
+    lua_State = record end;
+    Plua_State = ^lua_State;
 
-const
-    LuaLibName = cLuaLibrary;
+{$DEFINE LuaLibName:= cLuaLibrary}
 
 
 (*****************************************************************************)
@@ -45,8 +46,8 @@ const
 ** ===================================================================
 *)
 type
-  LUA_NUMBER_  = type Double;            // ending underscore is needed in Pascal
-  LUA_INTEGER_ = type PtrInt;
+    LUA_NUMBER_  = Double;            // ending underscore is needed in Pascal
+    LUA_INTEGER_ = PtrInt;
 
 (*
 @@ LUA_IDSIZE gives the maximum size for the description of the source
@@ -54,13 +55,13 @@ type
 ** CHANGE it if you want a different size.
 *)
 const
-  LUA_IDSIZE = 60;
+    LUA_IDSIZE = 60;
 
 (*
 @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
 *)
 const
-  LUAL_BUFFERSIZE = 1024;
+    LUAL_BUFFERSIZE = 1024;
 
 (*
 @@ LUA_PROMPT is the default prompt used by stand-alone Lua.
@@ -69,8 +70,8 @@ const
 ** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
 *)
 const
-  LUA_PROMPT  = '> ';
-  LUA_PROMPT2 = '>> ';
+    LUA_PROMPT  = '> ';
+    LUA_PROMPT2 = '>> ';
 
 (*
 @@ lua_readline defines how to show a prompt and then read a line from
@@ -80,8 +81,11 @@ const
 ** CHANGE them if you want to improve this functionality (e.g., by using
 ** GNU readline and history facilities).
 *)
-function  lua_readline(L : Plua_State; var b : PChar; p : PChar): Boolean;
+{function  lua_readline(L : Plua_State;
+var b : PChar; p : PChar): Boolean;}
+
 procedure lua_saveline(L : Plua_State; idx : LongInt);
+
 procedure lua_freeline(L : Plua_State; b : PChar);
 
 (*
@@ -95,7 +99,7 @@ procedure lua_freeline(L : Plua_State; b : PChar);
 #define lua_stdin_is_tty()  _isatty(_fileno(stdin))
 *)
 const
-  lua_stdin_is_tty = TRUE;
+    lua_stdin_is_tty = TRUE;
 
 (*****************************************************************************)
 (*                                  lua.h                                    *)
@@ -109,283 +113,329 @@ const
 *)
 
 const
-  LUA_VERSION     = 'Lua 5.1';
-  LUA_VERSION_NUM = 501;
-  LUA_COPYRIGHT   = 'Copyright (C) 1994-2006 Tecgraf, PUC-Rio';
-  LUA_AUTHORS     = 'R. Ierusalimschy, L. H. de Figueiredo & W. Celes';
+    LUA_VERSION     = 'Lua 5.1';
+    LUA_VERSION_NUM = 501;
+    LUA_COPYRIGHT   = 'Copyright (C) 1994-2006 Tecgraf, PUC-Rio';
+    LUA_AUTHORS     = 'R. Ierusalimschy, L. H. de Figueiredo & W. Celes';
 
-  (* mark for precompiled code (`<esc>Lua') *)
-  LUA_SIGNATURE = #27'Lua';
+    (* mark for precompiled code (`<esc>Lua') *)
+    //LUA_SIGNATURE = #27'Lua';
 
-  (* option for multiple returns in `lua_pcall' and `lua_call' *)
-  LUA_MULTRET = -1;
+    (* option for multiple returns in `lua_pcall' and `lua_call' *)
+    LUA_MULTRET = -1;
 
-  (*
-  ** pseudo-indices
-  *)
-  LUA_REGISTRYINDEX = -10000;
-  LUA_ENVIRONINDEX  = -10001;
-  LUA_GLOBALSINDEX  = -10002;
+    (*
+    ** pseudo-indices
+    *)
+    LUA_REGISTRYINDEX = -10000;
+    LUA_ENVIRONINDEX  = -10001;
+    LUA_GLOBALSINDEX  = -10002;
 
 function lua_upvalueindex(idx : LongInt) : LongInt;   // a marco
 
 const
-  (* thread status; 0 is OK *)
-  LUA_YIELD_    = 1;     // Note: the ending underscore is needed in Pascal
-  LUA_ERRRUN    = 2;
-  LUA_ERRSYNTAX = 3;
-  LUA_ERRMEM    = 4;
-  LUA_ERRERR    = 5;
+   (* thread status; 0 is OK *)
+    LUA_YIELD_    = 1;     // Note: the ending underscore is needed in Pascal
+    LUA_ERRRUN    = 2;
+    LUA_ERRSYNTAX = 3;
+    LUA_ERRMEM    = 4;
+    LUA_ERRERR    = 5;
 
 type
-  lua_CFunction = function(L : Plua_State) : LongInt; cdecl;
+   lua_CFunction = function(L : Plua_State) : LongInt; cdecl;
 
-  (*
-  ** functions that read/write blocks when loading/dumping Lua chunks
-  *)
-  lua_Reader = function (L : Plua_State; ud : Pointer;
-                         sz : Psize_t) : PChar; cdecl;
-  lua_Writer = function (L : Plua_State; const p : Pointer; sz : size_t;
-                         ud : Pointer) : LongInt; cdecl;
+    (*
+    ** functions that read/write blocks when loading/dumping Lua chunks
+    *)
+    lua_Reader = function (L : Plua_State; ud : Pointer; sz : Psize_t) : PChar; cdecl;
+    lua_Writer = function (L : Plua_State; const p : Pointer; sz : size_t; ud : Pointer) : LongInt; cdecl;
 
   (*
   ** prototype for memory-allocation functions
   *)
-  lua_Alloc = function (ud, ptr : Pointer;
-                        osize, nsize : size_t) : Pointer; cdecl;
+  lua_Alloc = function (ud, ptr : Pointer; osize, nsize : size_t) : Pointer; cdecl;
 
 const
-  (*
-  ** basic types
-  *)
-  LUA_TNONE          = -1;
-
-  LUA_TNIL           = 0;
-  LUA_TBOOLEAN       = 1;
-  LUA_TLIGHTUSERDATA = 2;
-  LUA_TNUMBER        = 3;
-  LUA_TSTRING        = 4;
-  LUA_TTABLE         = 5;
-  LUA_TFUNCTION      = 6;
-  LUA_TUSERDATA      = 7;
-  LUA_TTHREAD        = 8;
-
-  (* minimum Lua stack available to a C function *)
-  LUA_MINSTACK = 20;
+    (*
+    ** basic types
+    *)
+    LUA_TNONE          = -1;
+    LUA_TNIL           = 0;
+    LUA_TBOOLEAN       = 1;
+    LUA_TLIGHTUSERDATA = 2;
+    LUA_TNUMBER        = 3;
+    LUA_TSTRING        = 4;
+    LUA_TTABLE         = 5;
+    LUA_TFUNCTION      = 6;
+    LUA_TUSERDATA      = 7;
+    LUA_TTHREAD        = 8;
+
+    (* minimum Lua stack available to a C function *)
+    LUA_MINSTACK = 20;
 
 type
-  (* type of numbers in Lua *)
-  lua_Number = LUA_NUMBER_;
+    (* type of numbers in Lua *)
+    lua_Number = LUA_NUMBER_;
 
-  (* type for integer functions *)
-  lua_Integer = LUA_INTEGER_;
+    (* type for integer functions *)
+    lua_Integer = LUA_INTEGER_;
 
 (*
 ** state manipulation
 *)
 function  lua_newstate(f : lua_Alloc; ud : Pointer) : Plua_State;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_close(L: Plua_State);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 function  lua_newthread(L : Plua_State) : Plua_State;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function  lua_atpanic(L : Plua_State; panicf : lua_CFunction) : lua_CFunction;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** basic stack manipulation
 *)
 function  lua_gettop(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_settop(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushvalue(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_remove(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_insert(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_replace(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function  lua_checkstack(L : Plua_State; sz : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 procedure lua_xmove(src, dest : Plua_State; n : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** access functions (stack -> C)
 *)
 function lua_isnumber(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_isstring(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_iscfunction(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_isuserdata(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_type(L : Plua_State; idx : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_typename(L : Plua_State; tp : LongInt) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
+    
 function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_rawequal(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_lessthan(L : Plua_State; idx1, idx2 : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function lua_tonumber(L : Plua_State; idx : LongInt) : lua_Number;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_tointeger(L : Plua_State; idx : LongInt) : lua_Integer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool;
-  cdecl; external LuaLibName;
-function lua_tolstring(L : Plua_State; idx : LongInt;
-                       len : Psize_t) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
+    
+function lua_tolstring(L : Plua_State; idx : LongInt; len : Psize_t) : PChar;
+    cdecl; external LuaLibName;
+    
 function lua_objlen(L : Plua_State; idx : LongInt) : size_t;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_tocfunction(L : Plua_State; idx : LongInt) : lua_CFunction;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_touserdata(L : Plua_State; idx : LongInt) : Pointer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_tothread(L : Plua_State; idx : LongInt) : Plua_State;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_topointer(L : Plua_State; idx : LongInt) : Pointer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** push functions (C -> stack)
 *)
 procedure lua_pushnil(L : Plua_State);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushnumber(L : Plua_State; n : lua_Number);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushinteger(L : Plua_State; n : lua_Integer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushstring(L : Plua_State; const s : PChar);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
+    
 function  lua_pushvfstring(L : Plua_State;
-                           const fmt : PChar; argp : Pointer) : PChar;
-  cdecl; external LuaLibName;
+    const fmt : PChar; argp : Pointer) : PChar;
+    cdecl; external LuaLibName;
+    
 function  lua_pushfstring(L : Plua_State; const fmt : PChar) : PChar; varargs;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushcclosure(L : Plua_State; fn : lua_CFunction; n : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushboolean(L : Plua_State; b : LongBool);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_pushlightuserdata(L : Plua_State; p : Pointer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function  lua_pushthread(L : Plua_state) : Cardinal;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** get functions (Lua -> stack)
 *)
 procedure lua_gettable(L : Plua_State ; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_rawget(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_rawgeti(L : Plua_State; idx, n : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_createtable(L : Plua_State; narr, nrec : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function  lua_newuserdata(L : Plua_State; sz : size_t) : Pointer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function  lua_getmetatable(L : Plua_State; objindex : LongInt) : LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_getfenv(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** set functions (stack -> Lua)
 *)
 procedure lua_settable(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_rawset(L : Plua_State; idx : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_rawseti(L : Plua_State; idx , n: LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_setmetatable(L : Plua_State; objindex : LongInt): LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_setfenv(L : Plua_State; idx : LongInt): LongBool;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 (*
 ** `load' and `call' functions (load and run Lua code)
 *)
 procedure lua_call(L : Plua_State; nargs, nresults : LongInt);
-  cdecl; external LuaLibName;
-function  lua_pcall(L : Plua_State;
-                    nargs, nresults, errfunc : LongInt) : LongInt;
-  cdecl; external LuaLibName;
-function  lua_cpcall(L : Plua_State;
-                     func : lua_CFunction; ud : Pointer) : LongInt;
-  cdecl; external LuaLibName;
-function  lua_load(L : Plua_State; reader : lua_Reader;
-                   dt : Pointer; const chunkname : PChar) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
+function  lua_pcall(L : Plua_State; nargs, nresults, errfunc : LongInt) : LongInt;
+    cdecl; external LuaLibName;
+    
+function  lua_cpcall(L : Plua_State; func : lua_CFunction; ud : Pointer) : LongInt;
+    cdecl; external LuaLibName;
+    
+function  lua_load(L : Plua_State; reader : lua_Reader; dt : Pointer; const chunkname : PChar) : LongInt;
+    cdecl; external LuaLibName;
+    
 
 function lua_dump(L : Plua_State; writer : lua_Writer; data: Pointer) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*
 ** coroutine functions
 *)
 function lua_yield(L : Plua_State; nresults : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_resume(L : Plua_State; narg : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_status(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 (*
 ** garbage-collection functions and options
 *)
 const
-  LUA_GCSTOP       = 0;
-  LUA_GCRESTART    = 1;
-  LUA_GCCOLLECT    = 2;
-  LUA_GCCOUNT      = 3;
-  LUA_GCCOUNTB     = 4;
-  LUA_GCSTEP       = 5;
-  LUA_GCSETPAUSE   = 6;
-  LUA_GCSETSTEPMUL = 7;
+    LUA_GCSTOP       = 0;
+    LUA_GCRESTART    = 1;
+    LUA_GCCOLLECT    = 2;
+    LUA_GCCOUNT      = 3;
+    LUA_GCCOUNTB     = 4;
+    LUA_GCSTEP       = 5;
+    LUA_GCSETPAUSE   = 6;
+    LUA_GCSETSTEPMUL = 7;
 
 function lua_gc(L : Plua_State; what, data : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 (*
 ** miscellaneous functions
 *)
 function lua_error(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function lua_next(L : Plua_State; idx : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 procedure lua_concat(L : Plua_State; n : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function  lua_getallocf(L : Plua_State; ud : PPointer) : lua_Alloc;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 procedure lua_setallocf(L : Plua_State; f : lua_Alloc; ud : Pointer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 (*
 ** ===============================================================
@@ -429,8 +479,8 @@ procedure lua_getregistry(L : Plua_State);
 function lua_getgccount(L : Plua_State) : LongInt;
 
 type
-  lua_Chuckreader = type lua_Reader;
-  lua_Chuckwriter = type lua_Writer;
+    lua_Chuckreader = lua_Reader;
+    lua_Chuckwriter = lua_Writer;
 
 (* ====================================================================== *)
 
@@ -444,23 +494,23 @@ type
 ** Event codes
 *)
 const
-  LUA_HOOKCALL    = 0;
-  LUA_HOOKRET     = 1;
-  LUA_HOOKLINE    = 2;
-  LUA_HOOKCOUNT   = 3;
-  LUA_HOOKTAILRET = 4;
+    LUA_HOOKCALL    = 0;
+    LUA_HOOKRET     = 1;
+    LUA_HOOKLINE    = 2;
+    LUA_HOOKCOUNT   = 3;
+    LUA_HOOKTAILRET = 4;
 
 
 (*
 ** Event masks
 *)
-  LUA_MASKCALL  = 1 shl LUA_HOOKCALL;
-  LUA_MASKRET   = 1 shl LUA_HOOKRET;
-  LUA_MASKLINE  = 1 shl LUA_HOOKLINE;
-  LUA_MASKCOUNT = 1 shl LUA_HOOKCOUNT;
+    LUA_MASKCALL  = 1 shl LUA_HOOKCALL;
+    LUA_MASKRET   = 1 shl LUA_HOOKRET;
+    LUA_MASKLINE  = 1 shl LUA_HOOKLINE;
+    LUA_MASKCOUNT = 1 shl LUA_HOOKCOUNT;
 
 type
-  lua_Debug = packed record
+    lua_Debug = packed record
     event : LongInt;
     name : PChar;          (* (n) *)
     namewhat : PChar;      (* (n) `global', `local', `field', `method' *)
@@ -472,42 +522,44 @@ type
     short_src : array [0..LUA_IDSIZE-1] of Char; (* (S) *)
     (* private part *)
     i_ci : LongInt;        (* active function *)
-  end;
-  Plua_Debug = ^lua_Debug;
+    end;
+    Plua_Debug = ^lua_Debug;
 
   (* Functions to be called by the debuger in specific events *)
   lua_Hook = procedure (L : Plua_State; ar : Plua_Debug); cdecl;
 
 
-function lua_getstack(L : Plua_State; level : LongInt;
-                      ar : Plua_Debug) : LongInt;
-  cdecl; external LuaLibName;
-function lua_getinfo(L : Plua_State; const what : PChar;
-                     ar: Plua_Debug): LongInt;
-  cdecl; external LuaLibName;
-function lua_getlocal(L : Plua_State;
-                      ar : Plua_Debug; n : LongInt) : PChar;
-  cdecl; external LuaLibName;
-function lua_setlocal(L : Plua_State;
-                      ar : Plua_Debug; n : LongInt) : PChar;
-  cdecl; external LuaLibName;
+function lua_getstack(L : Plua_State; level : LongInt; ar : Plua_Debug) : LongInt;
+    cdecl; external LuaLibName;
+    
+function lua_getinfo(L : Plua_State; const what : PChar; ar: Plua_Debug): LongInt;
+    cdecl; external LuaLibName;
+    
+function lua_getlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar;
+    cdecl; external LuaLibName;
+    
+function lua_setlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar;
+    cdecl; external LuaLibName;
+    
 function lua_getupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_setupvalue(L : Plua_State; funcindex, n : LongInt) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
-function lua_sethook(L : Plua_State; func : lua_Hook;
-                     mask, count: LongInt): LongInt;
-  cdecl; external LuaLibName;
+function lua_sethook(L : Plua_State; func : lua_Hook; mask, count: LongInt): LongInt;
+    cdecl; external LuaLibName;
+  
 {$IFDEF LUA_GETHOOK}
 function lua_gethook(L : Plua_State) : lua_Hook;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 {$ENDIF}
 
 function lua_gethookmask(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+    
 function lua_gethookcount(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 
 (*****************************************************************************)
@@ -521,44 +573,44 @@ function lua_gethookcount(L : Plua_State) : LongInt;
 *)
 
 const
-  (* Key to file-handle type *)
-  LUA_FILEHANDLE  = 'FILE*';
-
-  LUA_COLIBNAME   = 'coroutine';
-  LUA_TABLIBNAME  = 'table';
-  LUA_IOLIBNAME   = 'io';
-  LUA_OSLIBNAME   = 'os';
-  LUA_STRLIBNAME  = 'string';
-  LUA_MATHLIBNAME = 'math';
-  LUA_DBLIBNAME   = 'debug';
-  LUA_LOADLIBNAME = 'package';
+    (* Key to file-handle type *)
+    LUA_FILEHANDLE  = 'FILE*';
+
+    LUA_COLIBNAME   = 'coroutine';
+    LUA_TABLIBNAME  = 'table';
+    LUA_IOLIBNAME   = 'io';
+    LUA_OSLIBNAME   = 'os';
+    LUA_STRLIBNAME  = 'string';
+    LUA_MATHLIBNAME = 'math';
+    LUA_DBLIBNAME   = 'debug';
+    LUA_LOADLIBNAME = 'package';
 
 function luaopen_base(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_table(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_io(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_os(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_string(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_math(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_debug(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaopen_package(L : Plua_State) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 procedure luaL_openlibs(L : Plua_State);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 procedure lua_assert(x : Boolean);    // a macro
 
@@ -578,97 +630,83 @@ function  luaL_getn(L : Plua_State; idx : LongInt) : LongInt;
 procedure luaL_setn(L : Plua_State; i, j : LongInt);
 
 const
-  LUA_ERRFILE = LUA_ERRERR + 1;
+    LUA_ERRFILE = LUA_ERRERR + 1;
 
 type
-  luaL_Reg = packed record
+    luaL_Reg = packed record
     name : PChar;
     func : lua_CFunction;
-  end;
-  PluaL_Reg = ^luaL_Reg;
-
-
-procedure luaL_openlib(L : Plua_State; const libname : PChar;
-                       const lr : PluaL_Reg; nup : LongInt);
-  cdecl; external LuaLibName;
-procedure luaL_register(L : Plua_State; const libname : PChar;
-                       const lr : PluaL_Reg);
-  cdecl; external LuaLibName;
-function luaL_getmetafield(L : Plua_State; obj : LongInt;
-                           const e : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_callmeta(L : Plua_State; obj : LongInt;
-                       const e : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_typerror(L : Plua_State; narg : LongInt;
-                       const tname : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_argerror(L : Plua_State; numarg : LongInt;
-                       const extramsg : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_checklstring(L : Plua_State; numArg : LongInt;
-                           ls : Psize_t) : PChar;
-  cdecl; external LuaLibName;
-function luaL_optlstring(L : Plua_State; numArg : LongInt;
-                         const def: PChar; ls: Psize_t) : PChar;
-  cdecl; external LuaLibName;
+    end;
+    PluaL_Reg = ^luaL_Reg;
+
+
+procedure luaL_openlib(L : Plua_State; const libname : PChar; const lr : PluaL_Reg; nup : LongInt);
+    cdecl; external LuaLibName;
+procedure luaL_register(L : Plua_State; const libname : PChar; const lr : PluaL_Reg);
+    cdecl; external LuaLibName;
+function luaL_getmetafield(L : Plua_State; obj : LongInt; const e : PChar) : LongInt;
+    cdecl; external LuaLibName;
+function luaL_callmeta(L : Plua_State; obj : LongInt; const e : PChar) : LongInt;
+    cdecl; external LuaLibName;
+function luaL_typerror(L : Plua_State; narg : LongInt; const tname : PChar) : LongInt;
+    cdecl; external LuaLibName;
+function luaL_argerror(L : Plua_State; numarg : LongInt; const extramsg : PChar) : LongInt;
+    cdecl; external LuaLibName;
+function luaL_checklstring(L : Plua_State; numArg : LongInt; ls : Psize_t) : PChar;
+    cdecl; external LuaLibName;
+function luaL_optlstring(L : Plua_State; numArg : LongInt; const def: PChar; ls: Psize_t) : PChar;
+    cdecl; external LuaLibName;
 function luaL_checknumber(L : Plua_State; numArg : LongInt) : lua_Number;
-  cdecl; external LuaLibName;
-function luaL_optnumber(L : Plua_State; nArg : LongInt;
-                        def : lua_Number) : lua_Number;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+function luaL_optnumber(L : Plua_State; nArg : LongInt; def : lua_Number) : lua_Number;
+    cdecl; external LuaLibName;
 
 function luaL_checkinteger(L : Plua_State; numArg : LongInt) : lua_Integer;
-  cdecl; external LuaLibName;
-function luaL_optinteger(L : Plua_State; nArg : LongInt;
-                        def : lua_Integer) : lua_Integer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+function luaL_optinteger(L : Plua_State; nArg : LongInt; def : lua_Integer) : lua_Integer;
+    cdecl; external LuaLibName;
 
 procedure luaL_checkstack(L : Plua_State; sz : LongInt; const msg : PChar);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_checktype(L : Plua_State; narg, t : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_checkany(L : Plua_State; narg : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaL_newmetatable(L : Plua_State; const tname : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_checkudata(L : Plua_State; ud : LongInt;
-                         const tname : PChar) : Pointer;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+function luaL_checkudata(L : Plua_State; ud : LongInt; const tname : PChar) : Pointer;
+    cdecl; external LuaLibName;
 
 procedure luaL_where(L : Plua_State; lvl : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 function  luaL_error(L : Plua_State; const fmt : PChar) : LongInt; varargs;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
-function luaL_checkoption(L : Plua_State; narg : LongInt; const def : PChar;
-                          const lst : array of PChar) : LongInt;
-  cdecl; external LuaLibName;
+function luaL_checkoption(L : Plua_State; narg : LongInt; const def : PChar; const lst : array of PChar) : LongInt;
+    cdecl; external LuaLibName;
 
 function  luaL_ref(L : Plua_State; t : LongInt) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_unref(L : Plua_State; t, ref : LongInt);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaL_loadfile(L : Plua_State; const filename : PChar) : LongInt;
-  cdecl; external LuaLibName;
-function luaL_loadbuffer(L : Plua_State; const buff : PChar;
-                         sz : size_t; const name: PChar) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
+function luaL_loadbuffer(L : Plua_State; const buff : PChar; sz : size_t; const name: PChar) : LongInt;
+    cdecl; external LuaLibName;
 
 function luaL_loadstring(L : Plua_State; const s : Pchar) : LongInt;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaL_newstate : Plua_State;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 function luaL_gsub(L : Plua_State; const s, p, r : PChar) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
-function luaL_findtable(L : Plua_State; idx : LongInt;
-                        const fname : PChar; szhint : LongInt) : PChar;
-  cdecl; external LuaLibName;
+function luaL_findtable(L : Plua_State; idx : LongInt; const fname : PChar; szhint : LongInt) : PChar;
+    cdecl; external LuaLibName;
 
 
 (*
@@ -677,8 +715,7 @@ function luaL_findtable(L : Plua_State; idx : LongInt;
 ** ===============================================================
 *)
 
-function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt;
-                       extramsg : PChar): LongInt;
+function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt; extramsg : PChar): LongInt;
 function luaL_checkstring(L : Plua_State; n : LongInt) : PChar;
 function luaL_optstring(L : Plua_State; n : LongInt; d : PChar) : PChar;
 function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
@@ -705,13 +742,13 @@ procedure luaL_getmetatable(L : Plua_State; n : PChar);
 *)
 
 type
-  luaL_Buffer = packed record
+    luaL_Buffer = packed record
     p : PChar;       (* current position in buffer *)
     lvl : LongInt;   (* number of strings in the stack (level) *)
     L : Plua_State;
     buffer : array [0..LUAL_BUFFERSIZE-1] of Char;
-  end;
-  PluaL_Buffer = ^luaL_Buffer;
+    end;
+    PluaL_Buffer = ^luaL_Buffer;
 
 procedure luaL_addchar(B : PluaL_Buffer; c : Char);
 
@@ -721,17 +758,17 @@ procedure luaL_putchar(B : PluaL_Buffer; c : Char);
 procedure luaL_addsize(B : PluaL_Buffer; n : LongInt);
 
 procedure luaL_buffinit(L : Plua_State; B : PluaL_Buffer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 function  luaL_prepbuffer(B : PluaL_Buffer) : PChar;
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_addlstring(B : PluaL_Buffer; const s : PChar; ls : size_t);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_addstring(B : PluaL_Buffer; const s : PChar);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_addvalue(B : PluaL_Buffer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 procedure luaL_pushresult(B : PluaL_Buffer);
-  cdecl; external LuaLibName;
+    cdecl; external LuaLibName;
 
 (* ====================================================== *)
 
@@ -740,8 +777,8 @@ procedure luaL_pushresult(B : PluaL_Buffer);
 
 (* pre-defined references *)
 const
-  LUA_NOREF  = -2;
-  LUA_REFNIL = -1;
+    LUA_NOREF  = -2;
+    LUA_REFNIL = -1;
 
 function lua_ref(L : Plua_State; lock : Boolean) : LongInt;
 
@@ -762,17 +799,19 @@ uses
 (*****************************************************************************)
 (*                            luaconfig.h                                    *)
 (*****************************************************************************)
-
-function  lua_readline(L : Plua_State; var b : PChar; p : PChar): Boolean;
+{
+function  lua_readline(L : Plua_State;
 var
-  s : AnsiString;
+    b : PChar; p : PChar): Boolean;
+var
+    s : AnsiString;
 begin
-  Write(p);                        // show prompt
-  ReadLn(s);                       // get line
-  b := PChar(s);                   //   and return it
-  lua_readline := (b[0] <> #4);          // test for ctrl-D
+    Write(p);                        // show prompt
+    ReadLn(s);                       // get line
+    b := PChar(s);                   //   and return it
+    lua_readline := (b[0] <> #4);          // test for ctrl-D
 end;
-
+}
 procedure lua_saveline(L : Plua_State; idx : LongInt);
 begin
 end;
@@ -788,108 +827,108 @@ end;
 
 function lua_upvalueindex(idx : LongInt) : LongInt;
 begin
-  lua_upvalueindex := LUA_GLOBALSINDEX - idx;
+lua_upvalueindex := LUA_GLOBALSINDEX - idx;
 end;
 
 procedure lua_pop(L : Plua_State; n : LongInt);
 begin
-  lua_settop(L, -n - 1);
+lua_settop(L, -n - 1);
 end;
 
 procedure lua_newtable(L : Plua_State);
 begin
-  lua_createtable(L, 0, 0);
+lua_createtable(L, 0, 0);
 end;
 
 procedure lua_register(L : Plua_State; n : PChar; f : lua_CFunction);
 begin
-  lua_pushcfunction(L, f);
-  lua_setglobal(L, n);
+lua_pushcfunction(L, f);
+lua_setglobal(L, n);
 end;
 
 procedure lua_pushcfunction(L : Plua_State; f : lua_CFunction);
 begin
-  lua_pushcclosure(L, f, 0);
+    lua_pushcclosure(L, f, 0);
 end;
 
 function  lua_strlen(L : Plua_State; idx : LongInt) : LongInt;
 begin
-  lua_strlen := lua_objlen(L, idx);
+    lua_strlen := lua_objlen(L, idx);
 end;
 
 function lua_isfunction(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isfunction := lua_type(L, n) = LUA_TFUNCTION;
+    lua_isfunction := lua_type(L, n) = LUA_TFUNCTION;
 end;
 
 function lua_istable(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_istable := lua_type(L, n) = LUA_TTABLE;
+    lua_istable := lua_type(L, n) = LUA_TTABLE;
 end;
 
 function lua_islightuserdata(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_islightuserdata := lua_type(L, n) = LUA_TLIGHTUSERDATA;
+    lua_islightuserdata := lua_type(L, n) = LUA_TLIGHTUSERDATA;
 end;
 
 function lua_isnil(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isnil := lua_type(L, n) = LUA_TNIL;
+    lua_isnil := lua_type(L, n) = LUA_TNIL;
 end;
 
 function lua_isboolean(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isboolean := lua_type(L, n) = LUA_TBOOLEAN;
+    lua_isboolean := lua_type(L, n) = LUA_TBOOLEAN;
 end;
 
 function lua_isthread(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isthread := lua_type(L, n) = LUA_TTHREAD;
+    lua_isthread := lua_type(L, n) = LUA_TTHREAD;
 end;
 
 function lua_isnone(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isnone := lua_type(L, n) = LUA_TNONE;
+    lua_isnone := lua_type(L, n) = LUA_TNONE;
 end;
 
 function lua_isnoneornil(L : Plua_State; n : LongInt) : Boolean;
 begin
-  lua_isnoneornil := lua_type(L, n) <= 0;
+    lua_isnoneornil := lua_type(L, n) <= 0;
 end;
 
 procedure lua_pushliteral(L : Plua_State; s : PChar);
 begin
-  lua_pushlstring(L, s, StrLen(s));
+    lua_pushlstring(L, s, StrLen(s));
 end;
 
 procedure lua_setglobal(L : Plua_State; s : PChar);
 begin
-  lua_setfield(L, LUA_GLOBALSINDEX, s);
+    lua_setfield(L, LUA_GLOBALSINDEX, s);
 end;
 
 procedure lua_getglobal(L: Plua_State; s: PChar);
 begin
-  lua_getfield(L, LUA_GLOBALSINDEX, s);
+    lua_getfield(L, LUA_GLOBALSINDEX, s);
 end;
 
 function lua_tostring(L : Plua_State; idx : LongInt) : AnsiString;
 begin
-  lua_tostring := SysUtils.StrPas(lua_tolstring(L, idx, nil));
+    lua_tostring := StrPas(lua_tolstring(L, idx, nil));
 end;
 
 function lua_open : Plua_State;
 begin
-  lua_open := luaL_newstate;
+    lua_open := luaL_newstate;
 end;
 
 procedure lua_getregistry(L : Plua_State);
 begin
-  lua_pushvalue(L, LUA_REGISTRYINDEX);
+    lua_pushvalue(L, LUA_REGISTRYINDEX);
 end;
 
 function lua_getgccount(L : Plua_State) : LongInt;
 begin
-  lua_getgccount := lua_gc(L, LUA_GCCOUNT, 0);
+    lua_getgccount := lua_gc(L, LUA_GCCOUNT, 0);
 end;
 
 
@@ -908,88 +947,87 @@ end;
 
 function luaL_getn(L : Plua_State; idx : LongInt) : LongInt;
 begin
-  luaL_getn := lua_objlen(L, idx);
+    luaL_getn := lua_objlen(L, idx);
 end;
 
 procedure luaL_setn(L : plua_State; i, j : LongInt);
 begin
-  (* no op *)
+    (* no op *)
 end;
 
-function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt;
-                       extramsg : PChar): LongInt;
+function luaL_argcheck(L : Plua_State; cond : Boolean; numarg : LongInt; extramsg : PChar): LongInt;
 begin
-  if not cond then
-    luaL_argcheck := luaL_argerror(L, numarg, extramsg)
-  else
-    luaL_argcheck := 0;
+    if not cond then
+        luaL_argcheck := luaL_argerror(L, numarg, extramsg)
+    else
+        luaL_argcheck := 0;
 end;
 
 function luaL_checkstring(L : Plua_State; n : LongInt) : PChar;
 begin
-  luaL_checkstring := luaL_checklstring(L, n, nil);
+    luaL_checkstring := luaL_checklstring(L, n, nil);
 end;
 
 function luaL_optstring(L : Plua_State; n : LongInt; d : PChar) : PChar;
 begin
-  luaL_optstring := luaL_optlstring(L, n, d, nil);
+    luaL_optstring := luaL_optlstring(L, n, d, nil);
 end;
 
 function luaL_checkint(L : Plua_State; n : LongInt) : lua_Integer;
 begin
-  luaL_checkint := luaL_checkinteger(L, n);
+    luaL_checkint := luaL_checkinteger(L, n);
 end;
 
 function luaL_optint(L : Plua_State; n : LongInt; d : lua_Integer): lua_Integer;
 begin
-  luaL_optint := luaL_optinteger(L, n, d);
+    luaL_optint := luaL_optinteger(L, n, d);
 end;
 
 function luaL_checklong(L : Plua_State; n : LongInt) : lua_Integer;
 begin
-  luaL_checklong := luaL_checkinteger(L, n);
+    luaL_checklong := luaL_checkinteger(L, n);
 end;
 
 function luaL_optlong(L : Plua_State; n : LongInt; d : lua_Integer) : lua_Integer;
 begin
-  luaL_optlong := luaL_optinteger(L, n, d);
+    luaL_optlong := luaL_optinteger(L, n, d);
 end;
 
 function luaL_typename(L : Plua_State; idx : LongInt) : PChar;
 begin
-  luaL_typename := lua_typename( L, lua_type(L, idx) );
+    luaL_typename := lua_typename( L, lua_type(L, idx) );
 end;
 
 function luaL_dofile(L : Plua_State; fn : PChar) : LongInt;
 begin
-  luaL_dofile := luaL_loadfile(L, fn);
-  if luaL_dofile = 0 then
-    luaL_dofile := lua_pcall(L, 0, 0, 0);
+    luaL_dofile := luaL_loadfile(L, fn);
+    if luaL_dofile = 0 then
+        luaL_dofile := lua_pcall(L, 0, 0, 0);
 end;
 
 function luaL_dostring(L : Plua_State; s : PChar) : LongInt;
 begin
-  luaL_dostring := luaL_loadstring(L, s);
-  if luaL_dostring = 0 then
-    luaL_dostring := lua_pcall(L, 0, 0, 0);
+    luaL_dostring := luaL_loadstring(L, s);
+    if luaL_dostring = 0 then
+        luaL_dostring := lua_pcall(L, 0, 0, 0);
 end;
 
 procedure luaL_getmetatable(L : Plua_State; n : PChar);
 begin
-  lua_getfield(L, LUA_REGISTRYINDEX, n);
+    lua_getfield(L, LUA_REGISTRYINDEX, n);
 end;
 
 procedure luaL_addchar(B : PluaL_Buffer; c : Char);
 begin
-  if not(B^.p < B^.buffer + LUAL_BUFFERSIZE) then
-    luaL_prepbuffer(B);
-  B^.p^ := c;
-  Inc(B^.p);
+    if not(B^.p < B^.buffer + LUAL_BUFFERSIZE) then
+        luaL_prepbuffer(B);
+    (B^.p^) := c;
+    Inc(B^.p);
 end;
 
 procedure luaL_putchar(B : PluaL_Buffer; c : Char);
 begin
-  luaL_addchar(B, c);
+    luaL_addchar(B, c);
 end;
 
 procedure luaL_addsize(B : PluaL_Buffer; n : LongInt);
@@ -999,23 +1037,24 @@ end;
 
 function lua_ref(L : Plua_State; lock : Boolean) : LongInt;
 begin
-  if lock then
-    lua_ref := luaL_ref(L, LUA_REGISTRYINDEX)
-  else begin
-    lua_pushstring(L, 'unlocked references are obsolete');
-    lua_error(L);
-    lua_ref := 0;
-  end;
+    if lock then
+        lua_ref := luaL_ref(L, LUA_REGISTRYINDEX)
+    else
+        begin
+        lua_pushstring(L, _P'unlocked references are obsolete');
+        lua_error(L);
+        lua_ref := 0;
+        end;
 end;
 
 procedure lua_unref(L : Plua_State; ref : LongInt);
 begin
-  luaL_unref(L, LUA_REGISTRYINDEX, ref);
+    luaL_unref(L, LUA_REGISTRYINDEX, ref);
 end;
 
 procedure lua_getref(L : Plua_State; ref : LongInt);
 begin
-  lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
+    lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
 end;
 
 
diff --git a/hedgewars/Math.h b/hedgewars/Math.h
new file mode 100644
index 0000000..3f59c93
--- /dev/null
+++ b/hedgewars/Math.h
@@ -0,0 +1,2 @@
+#pragma once
+
diff --git a/hedgewars/PNGh.pas b/hedgewars/PNGh.pas
new file mode 100644
index 0000000..172f6e7
--- /dev/null
+++ b/hedgewars/PNGh.pas
@@ -0,0 +1,90 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit PNGh;
+interface
+
+uses png;
+
+{$IFDEF FPC}
+    {$PACKRECORDS C}
+{$ELSE}
+    {$DEFINE cdecl attribute(cdecl)}
+{$ENDIF}
+
+const
+    // Constants for libpng, they are not defined in png unit.
+    // We actually don't need all of them.
+
+    // These describe the color_type field in png_info.
+    // color type masks
+    PNG_COLOR_MASK_PALETTE = 1;
+    PNG_COLOR_MASK_COLOR   = 2;
+    PNG_COLOR_MASK_ALPHA   = 4;
+
+    // color types.  Note that not all combinations are legal
+    PNG_COLOR_TYPE_GRAY       = 0;
+    PNG_COLOR_TYPE_PALETTE    = PNG_COLOR_MASK_COLOR or PNG_COLOR_MASK_PALETTE;
+    PNG_COLOR_TYPE_RGB        = PNG_COLOR_MASK_COLOR;
+    PNG_COLOR_TYPE_RGB_ALPHA  = PNG_COLOR_MASK_COLOR or PNG_COLOR_MASK_ALPHA;
+    PNG_COLOR_TYPE_GRAY_ALPHA = PNG_COLOR_MASK_ALPHA;
+
+    // aliases
+    PNG_COLOR_TYPE_RGBA = PNG_COLOR_TYPE_RGB_ALPHA;
+    PNG_COLOR_TYPE_GA   = PNG_COLOR_TYPE_GRAY_ALPHA;
+
+    // This is for compression type. PNG 1.0-1.2 only define the single type.
+    PNG_COMPRESSION_TYPE_BASE    = 0; // Deflate method 8, 32K window
+    PNG_COMPRESSION_TYPE_DEFAULT = PNG_COMPRESSION_TYPE_BASE;
+
+    // This is for filter type. PNG 1.0-1.2 only define the single type.
+    PNG_FILTER_TYPE_BASE        = 0;  // Single row per-byte filtering
+    PNG_INTRAPIXEL_DIFFERENCING = 64; // Used only in MNG datastreams
+    PNG_FILTER_TYPE_DEFAULT     = PNG_FILTER_TYPE_BASE;
+
+    // These are for the interlacing type.  These values should NOT be changed.
+    PNG_INTERLACE_NONE  = 0; // Non-interlaced image
+    PNG_INTERLACE_ADAM7 = 1; // Adam7 interlacing
+    PNG_INTERLACE_LAST  = 2; // Not a valid value
+
+type
+    // where is better place for this definition?
+    PFile = ^file;
+
+procedure png_init_pascal_io(png_ptr: png_structp; pf : PFile);
+
+implementation
+
+// We cannot get c-style FILE* pointer to pass it to libpng, so we implement our own writing functions
+procedure PngWriteData(png_ptr: png_structp; p: PByte; len: png_size_t); cdecl;
+begin
+    BlockWrite( PFile(png_get_io_ptr(png_ptr))^, p^, len);
+end;
+
+procedure PngFlushData(png_ptr: png_structp); cdecl;
+begin
+end;
+
+procedure png_init_pascal_io(png_ptr: png_structp; pf : PFile);
+begin
+    png_set_write_fn(png_ptr, pf, @PngWriteData, @PngFlushData);
+end;
+
+end.
diff --git a/hedgewars/PascalExports.pas b/hedgewars/PascalExports.pas
deleted file mode 100644
index 25e3531..0000000
--- a/hedgewars/PascalExports.pas
+++ /dev/null
@@ -1,367 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *)
-
-{$INCLUDE "options.inc"}
-
-unit PascalExports;
-(*
- * If the engine is compiled as library this unit will export functions
- * as C declarations for convenient library usage in your application and
- * language of choice.
- *
- * See also: C declarations on wikipedia
- *           http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl
- *)
-interface
-uses uTypes, uConsts, uVariables, GLunit, uKeys, uSound, uAmmos, uUtils, uCommands;
-
-{$INCLUDE "config.inc"}
-procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
-
-implementation
-{$IFDEF HWLIBRARY}
-var cZoomVal: GLfloat;
-
-// retrieve protocol information
-procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
-begin
-    netProto^:= cNetProtoVersion;
-    versionStr^:= cVersionString;
-end;
-
-// emulate mouse/keyboard input
-procedure HW_click; cdecl; export;
-begin
-    leftClick:= true;
-end;
-
-procedure HW_ammoMenu; cdecl; export;
-begin
-    rightClick:= true;
-end;
-
-procedure HW_zoomSet(value: GLfloat); cdecl; export;
-begin
-    cZoomVal:= value;
-    ZoomValue:= value;
-end;
-
-procedure HW_zoomIn; cdecl; export;
-begin
-    if wheelDown = false then
-        wheelUp:= true;
-end;
-
-procedure HW_zoomOut; cdecl; export;
-begin
-    if wheelUp = false then
-        wheelDown:= true;
-end;
-
-procedure HW_zoomReset; cdecl; export;
-begin
-    ZoomValue:= cZoomVal;
-    // center the camera at current hog
-    if CurrentHedgehog <> nil then
-        followGear:= CurrentHedgehog^.Gear;
-end;
-
-function HW_zoomFactor: GLfloat; cdecl; export;
-begin
-    exit( ZoomValue / cDefaultZoomLevel );
-end;
-
-function HW_zoomLevel: LongInt; cdecl; export;
-begin
-    exit( trunc((ZoomValue - cDefaultZoomLevel) / cZoomDelta) );
-end;
-
-procedure HW_walkingKeysUp; cdecl; export;
-begin
-    leftKey:= false;
-    rightKey:= false;
-    upKey:= false;
-    downKey:= false;
-    preciseKey:= false;
-end;
-
-procedure HW_otherKeysUp; cdecl; export;
-begin
-    spaceKey:= false;
-    enterKey:= false;
-    backspaceKey:= false;
-end;
-
-procedure HW_allKeysUp; cdecl; export;
-begin
-    // set all keys to released
-    uKeys.initModule;
-end;
-
-procedure HW_walkLeft; cdecl; export;
-begin
-    leftKey:= true;
-end;
-
-procedure HW_walkRight; cdecl; export;
-begin
-    rightKey:= true;
-end;
-
-procedure HW_preciseSet(status:boolean); cdecl; export;
-begin
-    preciseKey:= status;
-end;
-
-procedure HW_aimUp; cdecl; export;
-begin
-    upKey:= true;
-end;
-
-procedure HW_aimDown; cdecl; export;
-begin
-    downKey:= true;
-end;
-
-procedure HW_shoot; cdecl; export;
-begin
-    spaceKey:= true;
-end;
-
-procedure HW_jump; cdecl; export;
-begin
-    enterKey:= true;
-end;
-
-procedure HW_backjump; cdecl; export;
-begin
-    backspaceKey:= true;
-end;
-
-procedure HW_tab; cdecl; export;
-begin
-    tabKey:= true;
-end;
-
-procedure HW_chat; cdecl; export;
-begin
-    chatAction:= true;
-end;
-
-procedure HW_screenshot; cdecl; export;
-begin
-    flagMakeCapture:= true;
-end;
-
-procedure HW_pause; cdecl; export;
-begin
-    if isPaused = false then
-        pauseAction:= true;
-end;
-
-procedure HW_pauseToggle; cdecl; export;
-begin
-    pauseAction:= true;
-end;
-
-function HW_isPaused: boolean; cdecl; export;
-begin
-    exit( isPaused );
-end;
-
-// equivalent to esc+y; when closeFrontend = true the game exits after memory cleanup
-procedure HW_terminate(closeFrontend: boolean); cdecl; export;
-begin
-    alsoShutdownFrontend:= closeFrontend;
-    ParseCommand('forcequit', true);
-end;
-
-function HW_getSDLWindow: pointer; cdecl; export;
-begin
-{$IFDEF SDL13}
-    exit( SDLwindow );
-{$ELSE}
-    exit( nil );
-{$ENDIF}
-end;
-
-// cursor handling
-procedure HW_setCursor(x,y: LongInt); cdecl; export;
-begin
-    CursorPoint.X:= x;
-    CursorPoint.Y:= y;
-end;
-
-procedure HW_getCursor(x,y: PLongInt); cdecl; export;
-begin
-    x^:= CursorPoint.X;
-    y^:= CursorPoint.Y;
-end;
-
-// ammo menu related functions
-function HW_isAmmoMenuOpen: boolean; cdecl; export;
-begin
-    exit( bShowAmmoMenu );
-end;
-
-function HW_isAmmoMenuNotAllowed: boolean; cdecl; export;
-begin;
-    exit( (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or
-          ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) );
-end;
-
-function HW_isWeaponRequiringClick: boolean; cdecl; export;
-begin
-    if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.BotLevel = 0) then
-        exit( (CurrentHedgehog^.Gear^.State and gstHHChooseTarget) <> 0 )
-    else
-        exit(false);
-end;
-
-function HW_isWeaponTimerable: boolean; cdecl; export;
-begin
-    if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
-        exit( (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Timerable) <> 0)
-    else
-        exit(false);
-end;
-
-function HW_isWeaponSwitch: boolean cdecl; export;
-begin
-    if (CurAmmoGear <> nil) and (CurrentHedgehog^.BotLevel = 0) then
-        exit(CurAmmoGear^.AmmoType = amSwitch)
-    else
-        exit(false)
-end;
-
-function HW_isWeaponRope: boolean cdecl; export;
-begin
-    if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
-        exit(CurrentHedgehog^.CurAmmoType = amRope)
-    else
-        exit(false);
-end;
-
-procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
-begin
-    ParseCommand('/timer ' + inttostr(time), true);
-end;
-
-procedure HW_setPianoSound(snd: LongInt); cdecl; export;
-begin
-    // this most likely won't work in network game
-    if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0)
-       and (CurrentHedgehog^.CurAmmoType = amPiano) then
-        case snd of
-            0: PlaySound(sndPiano0);
-            1: PlaySound(sndPiano1);
-            2: PlaySound(sndPiano2);
-            3: PlaySound(sndPiano3);
-            4: PlaySound(sndPiano4);
-            5: PlaySound(sndPiano5);
-            6: PlaySound(sndPiano6);
-            7: PlaySound(sndPiano7);
-            else PlaySound(sndPiano8);
-        end;
-end;
-
-function HW_getWeaponNameByIndex(whichone: LongInt): PChar; cdecl; export;
-begin
-    exit(str2pchar(trammo[Ammoz[TAmmoType(whichone+1)].NameId]));
-end;
-
-function HW_getWeaponCaptionByIndex(whichone: LongInt): PChar; cdecl; export;
-begin
-    exit(str2pchar(trammoc[Ammoz[TAmmoType(whichone+1)].NameId]));
-end;
-
-function HW_getWeaponDescriptionByIndex(whichone: LongInt): PChar; cdecl; export;
-begin
-    exit(str2pchar(trammod[Ammoz[TAmmoType(whichone+1)].NameId]));
-end;
-
-function HW_getNumberOfWeapons:LongInt; cdecl; export;
-begin
-    exit(ord(high(TAmmoType)));
-end;
-
-procedure HW_setWeapon(whichone: LongInt); cdecl; export;
-begin
-    if (CurrentTeam = nil) then exit;
-    if (not CurrentTeam^.ExtDriven) and (CurrentTeam^.Hedgehogs[0].BotLevel = 0) then
-        SetWeapon(TAmmoType(whichone+1));
-end;
-
-function HW_isWeaponAnEffect(whichone: LongInt): boolean; cdecl; export;
-begin
-    exit(Ammoz[TAmmoType(whichone+1)].Ammo.Propz and ammoprop_Effect <> 0)
-end;
-
-function HW_getAmmoCounts(counts: PLongInt): LongInt; cdecl; export;
-var a : PHHAmmo;
-    slot, index: LongInt;
-begin
-    // nil check
-    if (CurrentHedgehog = nil) or (CurrentHedgehog^.Ammo = nil) or (CurrentTeam = nil) then
-        exit(-1);
-    // hog controlled by opponent (net or ai)
-    if (CurrentTeam^.ExtDriven) or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
-        exit(1);
-
-    a:= CurrentHedgehog^.Ammo;
-    for slot:= 0 to cMaxSlotIndex do
-        for index:= 0 to cMaxSlotAmmoIndex do
-            if a^[slot,index].Count <> 0 then // yes, ammomenu is hell
-                counts[ord(a^[slot,index].AmmoType)-1]:= a^[slot,index].Count;
-    exit(0);
-end;
-
-procedure HW_getAmmoDelays (skipTurns: PByte); cdecl; export;
-var a : TAmmoType;
-begin
-    for a:= Low(TAmmoType) to High(TAmmoType) do
-        skipTurns[ord(a)-1]:= byte(Ammoz[a].SkipTurns);
-end;
-
-function HW_getTurnsForCurrentTeam: LongInt; cdecl; export;
-begin
-    if (CurrentTeam <> nil) and (CurrentTeam^.Clan <> nil) then
-        exit(CurrentTeam^.Clan^.TurnNumber)
-    else
-        exit(0);
-end;
-
-function HW_getMaxNumberOfHogs: LongInt; cdecl; export;
-begin
-    exit(cMaxHHIndex+1);
-end;
-
-function HW_getMaxNumberOfTeams: LongInt; cdecl; export;
-begin
-    exit(cMaxTeams);
-end;
-
-procedure HW_memoryWarningCallback; cdecl; export;
-begin
-    ReleaseSound(false);
-end;
-
-{$ENDIF}
-
-end.
-
diff --git a/hedgewars/SDLh.pas b/hedgewars/SDLh.pas
index d1a28b7..4a052e1 100644
--- a/hedgewars/SDLh.pas
+++ b/hedgewars/SDLh.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,46 +22,51 @@ unit SDLh;
 interface
 
 {$IFDEF LINUX}
-  {$DEFINE UNIX}
+    {$DEFINE UNIX}
 {$ENDIF}
 {$IFDEF FREEBSD}
-  {$DEFINE UNIX}
+    {$DEFINE UNIX}
 {$ENDIF}
 {$IFDEF DARWIN}
-  {$DEFINE UNIX}
+    {$DEFINE UNIX}
 {$ENDIF}
 {$IFDEF HAIKU}
-  {$DEFINE UNIX}
+    {$DEFINE UNIX}
 {$ENDIF}
 
 {$IFDEF UNIX}
-  {$IFNDEF DARWIN}
-    {$linklib c}
-  {$ENDIF}
-  {$IFDEF HAIKU}
-    {$linklib root}
-  {$ELSE}
-    {$linklib pthread}
-  {$ENDIF}
+    {$IFNDEF DARWIN}
+        {$linklib c}
+    {$ENDIF}
+    {$IFDEF HAIKU}
+        {$linklib root}
+    {$ELSE}
+        {$IFNDEF ANDROID}
+        {$linklib pthread}
+    {$ENDIF}
+    {$ENDIF}
 {$ENDIF}
 
 {$IFDEF FPC}
-  {$PACKRECORDS C}
+    {$PACKRECORDS C}
 {$ELSE}
-  {$DEFINE cdecl attribute(cdecl)}
+    {$DEFINE cdecl attribute(cdecl)}
+    type PByte = ^Byte;
+    type PInteger = ^Integer;
+    type PLongInt = ^LongInt;
 {$ENDIF}
 
 {$IFDEF DARWIN}
-  {$IFNDEF IPHONEOS}
-    {$PASCALMAINNAME SDL_main}
-    {$linkframework Cocoa}
-    {$linkframework SDL}
-    {$linkframework SDL_net}
-    {$linkframework SDL_image}
-    {$linkframework SDL_ttf}
-    {$linkframework SDL_mixer}
-    {$linkframework OpenGL}
-  {$ENDIF}
+    {$IFNDEF IPHONEOS}
+        {$PASCALMAINNAME SDL_main}
+        {$linkframework Cocoa}
+        {$linkframework SDL}
+        {$linkframework SDL_net}
+        {$linkframework SDL_image}
+        {$linkframework SDL_ttf}
+        {$linkframework SDL_mixer}
+        {$linkframework OpenGL}
+    {$ENDIF}
 {$ENDIF}
 
 
@@ -74,19 +79,19 @@ const
     SDL_ImageLibName = 'SDL_image.dll';
     SDL_NetLibName = 'SDL_net.dll';
 {$ELSE}
-  {$IFDEF DARWIN}
+    {$IFDEF DARWIN}
     SDLLibName = 'SDL';
     SDL_TTFLibName = 'SDL_ttf';
     SDL_MixerLibName = 'SDL_mixer';
     SDL_ImageLibName = 'SDL_image';
     SDL_NetLibName = 'SDL_net';
-  {$ELSE}
+    {$ELSE}
     SDLLibName = 'libSDL.so';
     SDL_TTFLibName = 'libSDL_ttf.so';
     SDL_MixerLibName = 'libSDL_mixer.so';
     SDL_ImageLibName = 'libSDL_image.so';
     SDL_NetLibName = 'libSDL_net.so';
-  {$ENDIF}
+    {$ENDIF}
 {$ENDIF}
 
 /////////////////////////////////////////////////////////////////
@@ -109,6 +114,10 @@ const
 
     SDL_ALLEVENTS        = $FFFFFFFF;
     SDL_APPINPUTFOCUS    = $02;
+
+    SDL_BUTTON_LEFT      = 1;
+    SDL_BUTTON_MIDDLE    = 2;
+    SDL_BUTTON_RIGHT     = 3;
     SDL_BUTTON_WHEELUP   = 4;
     SDL_BUTTON_WHEELDOWN = 5;
 
@@ -146,6 +155,7 @@ const
     SDL_DOLLARRECORD      = $801;
     SDL_MULTIGESTURE      = $802;
     SDL_CLIPBOARDUPDATE   = $900;
+    SDL_DROPFILE          = $1000;
     SDL_USEREVENT         = $8000;
     SDL_LASTEVENT         = $FFFF;
     // no compatibility events $7000
@@ -260,6 +270,19 @@ const
     AShift = 0;
 {$ENDIF}
 
+    KMOD_NONE   = $0000;
+    KMOD_LSHIFT = $0001;
+    KMOD_RSHIFT = $0002;
+    KMOD_LCTRL  = $0040;
+    KMOD_RCTRL  = $0080;
+    KMOD_LALT   = $0400;
+    KMOD_RALT   = $0800;
+    KMOD_LMETA  = $0400;
+    KMOD_RMETA  = $0800;
+    KMOD_NUM    = $1000;
+    KMOD_CAPS   = $2000;
+    KMOD_MODE   = $4000;
+
     {* SDL_mixer *}
     MIX_MAX_VOLUME = 128;
     MIX_INIT_FLAC  = $00000001;
@@ -288,7 +311,6 @@ const
     IMG_INIT_PNG = $00000002;
     IMG_INIT_TIF = $00000004;
 
-    {* SDL_EventMask type definition *}
 
 /////////////////////////////////////////////////////////////////
 ///////////////////////  TYPE DEFINITIONS ///////////////////////
@@ -304,6 +326,8 @@ type
     PSDL_Renderer = Pointer;
     PSDL_Texture  = Pointer;
     PSDL_GLContext= Pointer;
+    TSDL_FingerId = Int64;
+    TSDL_TouchId  = Int64;
 {$ENDIF}
 
     PSDL_Rect = ^TSDL_Rect;
@@ -363,7 +387,7 @@ type
 {$ENDIF}
         end;
 
-    SDL_eventaction = (SDL_ADDEVENT = 0, SDL_PEEPEVENT, SDL_GETEVENT);
+    TSDL_eventaction = (SDL_ADDEVENT, SDL_PEEPEVENT, SDL_GETEVENT);
 
     PSDL_Surface = ^TSDL_Surface;
     TSDL_Surface = record
@@ -386,12 +410,10 @@ type
 
     PSDL_Color = ^TSDL_Color;
     TSDL_Color = record
-        case Byte of
-            0: ( r: Byte;
-                 g: Byte;
-                 b: Byte;
-                 unused: Byte; );
-            1: ( value: LongWord; );
+            r: Byte;
+            g: Byte;
+            b: Byte;
+            unused: Byte;
         end;
 
 
@@ -434,13 +456,14 @@ type
 {$IFDEF SDL13}
     TSDL_KeySym = record
         scancode: LongInt;
-        sym: LongInt;
+        sym: LongWord;
         modifier: Word;
         unicode: LongWord;
         end;
 
     TSDL_WindowEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         event: Byte;
         padding1, padding2, padding3: Byte;
@@ -450,6 +473,7 @@ type
     // available in sdl12 but not exposed
     TSDL_TextEditingEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         text: array[0..31] of Byte;
         start, lenght: LongInt;
@@ -458,15 +482,17 @@ type
     // available in sdl12 but not exposed
     TSDL_TextInputEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         text: array[0..31] of Byte;
         end;
 
     TSDL_TouchFingerEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowId: LongWord;
-        touchId: Int64;
-        fingerId: Int64;
+        touchId: TSDL_TouchId;
+        fingerId: TSDL_FingerId;
         state, padding1, padding2, padding3: Byte;
         x, y: Word;
         dx, dy: SmallInt;
@@ -475,21 +501,24 @@ type
 
     TSDL_TouchButtonEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowId: LongWord;
-        touchId: Int64;
+        touchId: TSDL_TouchId;
         state, button, padding1, padding2: Byte;
         end;
 
     TSDL_MultiGestureEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowId: LongWord;
-        touchId: Int64;
+        touchId: TSDL_TouchId;
         dTheta, dDist, x, y: Single;
         numFingers, padding: Word;
         end;
 
     TSDL_DollarGestureEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         windowId: LongWord;
         touchId: Int64;
         gesturedId: Int64;
@@ -497,8 +526,15 @@ type
         error: Single;
         end;
 
+    TSDL_DropEvent = record
+        type_: LongWord;
+        timestamp: LongWord;
+        filename: PChar;
+        end;
+
     TSDL_SysWMEvent = record
         type_: LongWord;
+        timestamp: LongWord;
         msg: Pointer;
         end;
 {$ELSE}
@@ -524,8 +560,9 @@ type
     TSDL_KeyboardEvent = record
 {$IFDEF SDL13}
         type_: LongWord;
+//        timestamp: LongWord;
         windowID: LongWord;
-        state, repeat_, padding2, padding3: Byte;
+        state, repeat_ {*,padding2, padding3*}: Byte;
 {$ELSE}
         type_, which, state: Byte;
 {$ENDIF}
@@ -535,6 +572,7 @@ type
     TSDL_MouseMotionEvent = record
 {$IFDEF SDL13}
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
         state, padding1, padding2, padding3: Byte;
         x, y, z, xrel, yrel : LongInt;
@@ -547,8 +585,9 @@ type
     TSDL_MouseButtonEvent = record
 {$IFDEF SDL13}
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
-        buttonm, state, padding1, padding2: Byte;
+        button, state, padding1, padding2: Byte;
         x, y: LongInt;
 {$ELSE}
         type_, which, button, state: Byte;
@@ -559,6 +598,7 @@ type
     TSDL_MouseWheelEvent = record
         type_: LongWord;
 {$IFDEF SDL13}
+        timestamp: LongWord;
         windowID: LongWord;
 {$ELSE}
         which: Byte;
@@ -567,7 +607,12 @@ type
         end;
 
     TSDL_JoyAxisEvent = record
-        type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
+{$IFDEF SDL13}
+        type_: LongWord;
+        timestamp: LongWord;
+{$ELSE}
+        type_: Byte;
+{$ENDIF}
         which: Byte;
         axis: Byte;
 {$IFDEF SDL13}
@@ -579,7 +624,12 @@ type
         end;
 
     TSDL_JoyBallEvent = record
-        type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
+{$IFDEF SDL13}
+        type_: LongWord;
+        timestamp: LongWord;
+{$ELSE}
+        type_: Byte;
+{$ENDIF}
         which: Byte;
         ball: Byte;
 {$IFDEF SDL13}
@@ -591,7 +641,12 @@ type
         end;
 
     TSDL_JoyHatEvent = record
-        type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
+{$IFDEF SDL13}
+        type_: LongWord;
+        timestamp: LongWord;
+{$ELSE}
+        type_: Byte;
+{$ENDIF}
         which: Byte;
         hat: Byte;
         value: Byte;
@@ -601,7 +656,12 @@ type
         end;
 
     TSDL_JoyButtonEvent = record
-        type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
+{$IFDEF SDL13}
+        type_: LongWord;
+        timestamp: LongWord;
+{$ELSE}
+        type_: Byte;
+{$ENDIF}
         which: Byte;
         button: Byte;
         state: Byte;
@@ -611,12 +671,18 @@ type
         end;
 
     TSDL_QuitEvent = record
-        type_: {$IFDEF SDL13}LongWord{$ELSE}Byte{$ENDIF};
+{$IFDEF SDL13}
+        type_: LongWord;
+        timestamp: LongWord;
+{$ELSE}
+        type_: Byte;
+{$ENDIF}
         end;
 
     TSDL_UserEvent = record
 {$IFDEF SDL13}
         type_: LongWord;
+        timestamp: LongWord;
         windowID: LongWord;
 {$ELSE}
         type_: Byte;
@@ -654,6 +720,7 @@ type
             SDL_TOUCHBUTTONDOWN: (tbutton: TSDL_TouchButtonEvent);
             SDL_MULTIGESTURE: (mgesture: TSDL_MultiGestureEvent);
             SDL_DOLLARGESTURE: (dgesture: TSDL_DollarGestureEvent);
+            SDL_DROPFILE: (drop: TSDL_DropEvent);
             SDL_ALLEVENTS: (foo: shortstring);
 {$ELSE}
         case Byte of
@@ -678,10 +745,10 @@ type
 
     TSDL_EventFilter = function( event : PSDL_Event ): Integer; cdecl;
 
-    PByteArray = ^TByteArray;
     TByteArray = array[0..65535] of Byte;
-    PLongWordArray = ^TLongWordArray;
+    PByteArray = ^TByteArray;
     TLongWordArray = array[0..16383] of LongWord;
+    PLongWordArray = ^TLongWordArray;
 
     PSDL_Thread = Pointer;
     PSDL_mutex = Pointer;
@@ -746,40 +813,42 @@ type
     TMix_Fading = (MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN);
 
     TMidiSong = record
-               samples : LongInt;
-               events  : Pointer;
-               end;
+                samples : LongInt;
+                events  : Pointer;
+                end;
 
     TMusicUnion = record
         case Byte of
-             0: ( midi : TMidiSong );
-             1: ( ogg  : Pointer);
-             end;
+            0: ( midi : TMidiSong );
+            1: ( ogg  : Pointer);
+            end;
 
     PMixMusic = ^TMixMusic;
     TMixMusic = record
-                 end;
+                end;
+
+    TPostMix = procedure(udata: pointer; stream: PByte; len: LongInt); cdecl;
 
     {* SDL_net *}
     TIPAddress = record
-                  host: LongWord;
-                  port: Word;
-                  end;
+                host: LongWord;
+                port: Word;
+                end;
 
     PTCPSocket = ^TTCPSocket;
     TTCPSocket = record
-                  ready: LongInt;
-                  channel: LongInt;
-                  remoteAddress: TIPaddress;
-                  localAddress: TIPaddress;
-                  sflag: LongInt;
-                  end;
+                ready: LongInt;
+                channel: LongInt;
+                remoteAddress: TIPaddress;
+                localAddress: TIPaddress;
+                sflag: LongInt;
+                end;
     PSDLNet_SocketSet = ^TSDLNet_SocketSet;
     TSDLNet_SocketSet = record
-                         numsockets,
-                         maxsockets: LongInt;
-                         sockets: PTCPSocket;
-                         end;
+                        numsockets,
+                        maxsockets: LongInt;
+                        sockets: PTCPSocket;
+                        end;
 
 
 /////////////////////////////////////////////////////////////////
@@ -857,13 +926,18 @@ procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; exte
 function  SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName;
 procedure SDL_StartTextInput; cdecl; external SDLLibName;
 
-function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
+function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
+function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
 {$ELSE}
-function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: SDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName;
+function  SDL_CreateThread(fn: Pointer; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
+function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName;
 {$ENDIF}
 
 function  SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
 function  SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName;
+function  SDL_GetScancodeName(key: LongWord): PChar; cdecl; external SDLLibName;
+function  SDL_GetKeyFromScancode(key: LongWord): LongInt; cdecl; external SDLLibName;
+
 
 procedure SDL_PumpEvents; cdecl; external SDLLibName;
 function  SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName;
@@ -876,13 +950,17 @@ procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : Byte); cdecl; external SDLLi
 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
 
+procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
 function  SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP';
 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV';
 
 function  SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName;
-procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName;
+procedure SDL_GL_SwapBuffers; cdecl; external SDLLibName;
+
+procedure SDL_LockAudio; cdecl; external SDLLibName;
+procedure SDL_UnlockAudio; cdecl; external SDLLibName;
 
 function  SDL_NumJoysticks: LongInt; cdecl; external SDLLibName;
 function  SDL_JoystickName(idx: LongInt): PChar; cdecl; external SDLLibName;
@@ -906,14 +984,15 @@ function SDL_putenv(const text: PChar): LongInt; cdecl; external SDLLibName;
 function SDL_getenv(const text: PChar): PChar; cdecl; external SDLLibName;
 {$ENDIF}
 
+
 {* Compatibility between SDL-1.2 and SDL-1.3 *}
-procedure SDL_WarpMouse(x, y: Word); {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
+procedure SDL_WarpMouse(x, y: Word); {$IFDEF SDL13}inline{$ELSE}cdecl; external SDLLibName{$ENDIF};
 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF};
 function  SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
 function  SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
 function  SDL_EnableUNICODE(enable: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
-function  SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
+function  SDL_EnableKeyRepeat(timedelay, interval: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
 
 (*  SDL_ttf  *)
 function  TTF_Init: LongInt; cdecl; external SDL_TTFLibName;
@@ -934,6 +1013,7 @@ procedure Mix_Quit; {$IFDEF SDL_MIXER_NEWER}cdecl; external SDL_MixerLibName;{$E
 
 function  Mix_OpenAudio(frequency: LongInt; format: Word; channels: LongInt; chunksize: LongInt): LongInt; cdecl; external SDL_MixerLibName;
 procedure Mix_CloseAudio; cdecl; external SDL_MixerLibName;
+function  Mix_QuerySpec(frequency: PLongInt; format: PWord; channels: PLongInt): LongInt; cdecl; external SDL_MixerLibName;
 
 function  Mix_Volume(channel: LongInt; volume: LongInt): LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_SetDistance(channel: LongInt; distance: Byte): LongInt; cdecl; external SDL_MixerLibName;
@@ -961,6 +1041,8 @@ function  Mix_HaltMusic: LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_FadeInChannelTimed(channel: LongInt; chunk: PMixChunk; loops: LongInt; fadems: LongInt; ticks: LongInt): LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_FadeOutChannel(channel: LongInt; fadems: LongInt): LongInt; cdecl; external SDL_MixerLibName;
 
+procedure Mix_SetPostMix( mix_func: TPostMix; arg: pointer); cdecl; external SDL_MixerLibName;
+
 (*  SDL_image  *)
 function  IMG_Init(flags: LongInt): LongInt; {$IFDEF SDL_IMAGE_NEWER}cdecl; external SDL_ImageLibName;{$ENDIF}
 procedure IMG_Quit; {$IFDEF SDL_IMAGE_NEWER}cdecl; external SDL_ImageLibName;{$ENDIF}
@@ -992,14 +1074,13 @@ function  SDLNet_Read16(buf: Pointer): Word;
 function  SDLNet_Read32(buf: Pointer): LongWord;
 
 implementation
-uses strings, uVariables;
-
 {$IFDEF SDL13}
-// this needs to be reimplemented because in SDL_compat.c the window is the one created in the SDL_SetVideoMode
-// compatible function, but we use SDL_CreateWindow, so the window would be NULL
-procedure SDL_WarpMouse(x, y: Word);
+uses strings, uVariables, uStore;
+
+// compatible functions
+procedure SDL_WarpMouse(x, y: Word); inline;
 begin
-    SDL_WarpMouseInWindow(SDLwindow, x, y);
+    WarpMouse(x, y);
 end;
 
 function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar;
@@ -1009,37 +1090,41 @@ begin
     if (name <> nil) and (namebuf <> nil) then
         begin
         strlcopy(namebuf, name, maxlen);
-        exit(namebuf)
+        SDL_VideoDriverName:= namebuf
         end;
-    exit(name);
+    SDL_VideoDriverName:= name;
 end;
 
 function SDL_EnableUNICODE(enable: LongInt): LongInt;
 begin
+    enable:= enable; // avoid hint
     SDL_StartTextInput();
-    exit(0);
+    SDL_EnableUNICODE:= 0;
 end;
 
-function SDL_EnableKeyRepeat(delay_, interval: LongInt): LongInt;
+function SDL_EnableKeyRepeat(timedelay, interval: LongInt): LongInt;
 begin
-    exit(0);
+    timedelay:= timedelay;  // avoid hint
+    interval:= interval;    // avoid hint
+    SDL_EnableKeyRepeat:= 0;
 end;
 {$ELSE}
-function SDL_AllocFormat(format: LongWord): PSDL_PixelFormat;
 const conversionFormat: TSDL_PixelFormat = (
         palette: nil; BitsPerPixel: 32; BytesPerPixel: 4;
         Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0;
         Rshift: RShift; Gshift: GShift; Bshift: BShift; Ashift: AShift;
         RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask;
         colorkey: 0; alpha: 255);
+
+function SDL_AllocFormat(format: LongWord): PSDL_PixelFormat;
 begin
     format:= format;
-    exit(@conversionFormat);
+    SDL_AllocFormat:= @conversionFormat;
 end;
 
 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat);
 begin
-    pixelformat:= pixelformat;
+    pixelformat:= pixelformat;  // avoid hint
 end;
 {$ENDIF}
 
@@ -1056,7 +1141,7 @@ end;
 {$IFNDEF SDL_MIXER_NEWER}
 function  Mix_Init(flags: LongInt): LongInt;
 begin
-    exit(flags);
+    Mix_Init:= flags;
 end;
 
 procedure Mix_Quit;
@@ -1067,7 +1152,7 @@ end;
 {$IFNDEF SDL_IMAGE_NEWER}
 function  IMG_Init(flags: LongInt): LongInt;
 begin
-    exit(flags);
+    IMG_Init:= flags;
 end;
 
 procedure IMG_Quit;
diff --git a/hedgewars/SysUtils.h b/hedgewars/SysUtils.h
new file mode 100644
index 0000000..e69de29
diff --git a/hedgewars/Types.h b/hedgewars/Types.h
new file mode 100644
index 0000000..e69de29
diff --git a/hedgewars/VGSHandlers.inc b/hedgewars/VGSHandlers.inc
index 4337f16..ea89b27 100644
--- a/hedgewars/VGSHandlers.inc
+++ b/hedgewars/VGSHandlers.inc
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,6 +27,7 @@
 
 procedure doStepFlake(Gear: PVisualGear; Steps: Longword);
 var sign: real;
+    moved: boolean;
 begin
 if vobCount = 0 then exit;
 
@@ -38,19 +39,21 @@ with Gear^ do
         begin
         dec(FrameTicks, vobFrameTicks);
         inc(Frame);
-        if Frame = vobFramesCount then Frame:= 0
+        if Frame = vobFramesCount then
+            Frame:= 0
         end
     else if SuddenDeathDmg and (FrameTicks > vobSDFrameTicks) then
         begin
         dec(FrameTicks, vobSDFrameTicks);
         inc(Frame);
-        if Frame = vobSDFramesCount then Frame:= 0
+        if Frame = vobSDFramesCount then
+            Frame:= 0
         end;
-    X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps;
+    X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps * Gear^.Scale;
     if SuddenDeathDmg then
-        Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps
+        Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps * Gear^.Scale
     else
-        Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
+        Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps * Gear^.Scale;
     Angle:= Angle + dAngle * Steps;
     if Angle > 360 then
         Angle:= Angle - 360
@@ -59,28 +62,61 @@ with Gear^ do
             Angle:= Angle + 360;
     
   
-    if (round(X) >= cLeftScreenBorder) and
-       (round(X) <= cRightScreenBorder) and
-       (round(Y) - 75 <= LAND_HEIGHT) and
-       (Timer > 0) and (Timer-Steps > 0) then
+    if (round(X) >= cLeftScreenBorder)
+    and (round(X) <= cRightScreenBorder)
+    and (round(Y) - 75 <= LAND_HEIGHT)
+    and (Timer > 0) and (Timer-Steps > 0) then
         begin
-        if tdX > 0 then sign := 1
-        else sign:= -1;
+        if tdX > 0 then
+            sign := 1
+        else
+            sign:= -1;
         tdX:= tdX - 0.005*Steps*sign;
-        if ((sign < 0) and (tdX > 0)) or ((sign > 0) and (tdX < 0)) then tdX:= 0;
-        if tdX > 0 then sign := 1
-        else sign:= -1;
+        if ((sign < 0) and (tdX > 0)) or ((sign > 0) and (tdX < 0)) then
+            tdX:= 0;
+        if tdX > 0 then
+            sign := 1
+        else
+            sign:= -1;
         tdY:= tdY - 0.005*Steps*sign;
-        if ((sign < 0) and (tdY > 0)) or ((sign > 0) and (tdY < 0)) then tdY:= 0;
+        if ((sign < 0) and (tdY > 0)) or ((sign > 0) and (tdY < 0)) then
+            tdY:= 0;
         dec(Timer, Steps)
         end
     else
         begin
-        if round(X) < cLeftScreenBorder then X:= X + cScreenSpace else
-        if round(X) > cRightScreenBorder then X:= X - cScreenSpace;
-        // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
-        if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then Y:= Y - (1024 + 300) // TODO - configure in theme (jellies for example could use limited range)
-        else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then Y:= Y - (1024 + 25);
+        moved:= false;
+        if round(X) < cLeftScreenBorder then
+            begin
+            X:= X + cScreenSpace;
+            moved:= true
+            end
+        else
+            if round(X) > cRightScreenBorder then
+                begin
+                X:= X - cScreenSpace;
+                moved:= true
+                end;
+            // if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
+        if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then
+            begin
+            X:= cLeftScreenBorder + random(cScreenSpace);
+            Y:= Y - (1024 + 250 + random(50)); // TODO - configure in theme (jellies for example could use limited range)
+            moved:= true
+            end
+        else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then
+            begin
+            X:= cLeftScreenBorder + random(cScreenSpace);
+            Y:= Y - (1024 + random(25));
+            moved:= true
+            end;
+        if moved then
+            begin
+            Angle:= random(360);
+            dx:= 0.0000038654705 * random(10000);
+            dy:= 0.000003506096 * random(7000);
+            if random(2) = 0 then dx := -dx
+            end;
         Timer:= 0;
         tdX:= 0;
         tdY:= 0
@@ -103,29 +139,35 @@ procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
 var s: Longword;
     t: real;
 begin
-Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX) * Steps;
+Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX * Gear^.Scale) * Steps;
 
 // up-and-down-bounce magic
 s := (GameTicks + Gear^.Timer) mod 4096;
-t := 8 * hwFloat2Float(AngleSin(s mod 2048));
+t := 8 * Gear^.Scale * hwFloat2Float(AngleSin(s mod 2048));
 if (s < 2048) then t := -t;
 
 Gear^.Y := LAND_HEIGHT - 1184 + LongInt(Gear^.Timer mod 8) + t;
 
-if round(Gear^.X) < cLeftScreenBorder then Gear^.X:= Gear^.X + cScreenSpace else
-if round(Gear^.X) > cRightScreenBorder then Gear^.X:= Gear^.X - cScreenSpace
+if round(Gear^.X) < cLeftScreenBorder then
+    Gear^.X:= Gear^.X + cScreenSpace
+else
+    if round(Gear^.X) > cRightScreenBorder then
+        Gear^.X:= Gear^.X - cScreenSpace
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepExpl(Gear: PVisualGear; Steps: Longword);
+var s: LongInt;
 begin
-Gear^.X:= Gear^.X + Gear^.dX * Steps;
+s:= min(Steps, cExplFrameTicks);
 
-Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+Gear^.X:= Gear^.X + Gear^.dX * s;
+Gear^.Y:= Gear^.Y + Gear^.dY * s;
 //Gear^.dY:= Gear^.dY + cGravityf;
 
 if Gear^.FrameTicks <= Steps then
-    if Gear^.Frame = 0 then DeleteVisualGear(Gear)
+    if Gear^.Frame = 0 then
+        DeleteVisualGear(Gear)
     else
         begin
         dec(Gear^.Frame);
@@ -243,102 +285,108 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBubble(Gear: PVisualGear; Steps: Longword);
 begin
-    Gear^.X:= Gear^.X + Gear^.dX * Steps;
-    Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
-    Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
-
-    Gear^.dX := Gear^.dX / (1.001 * Steps);
-    Gear^.dY := Gear^.dY / (1.001 * Steps);
+Gear^.X:= Gear^.X + Gear^.dX * Steps;
+Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
+Gear^.dX := Gear^.dX / (1.001 * Steps);
+Gear^.dY := Gear^.dY / (1.001 * Steps);
 
-    if (Gear^.FrameTicks <= Steps) or (round(Gear^.Y) < cWaterLine) then
-        DeleteVisualGear(Gear)
-    else
-        dec(Gear^.FrameTicks, Steps)
+if (Gear^.FrameTicks <= Steps) or (round(Gear^.Y) < cWaterLine) then
+    DeleteVisualGear(Gear)
+else
+    dec(Gear^.FrameTicks, Steps)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSteam(Gear: PVisualGear; Steps: Longword);
 begin
-    Gear^.X:= Gear^.X + (cWindSpeedf * 100 + Gear^.dX) * Steps;
-    Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
+Gear^.X:= Gear^.X + (cWindSpeedf * 100 + Gear^.dX) * Steps;
+Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
 
-    if Gear^.FrameTicks <= Steps then
-        if Gear^.Frame = 0 then DeleteVisualGear(Gear)
-        else
-            begin
-            if Random(2) = 0 then dec(Gear^.Frame);
-            Gear^.FrameTicks:= cExplFrameTicks
-            end
-        else dec(Gear^.FrameTicks, Steps)
+if Gear^.FrameTicks <= Steps then
+    if Gear^.Frame = 0 then
+        DeleteVisualGear(Gear)
+    else
+        begin
+        if Random(2) = 0 then
+            dec(Gear^.Frame);
+        Gear^.FrameTicks:= cExplFrameTicks
+        end
+else dec(Gear^.FrameTicks, Steps)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepAmmo(Gear: PVisualGear; Steps: Longword);
 begin
-    Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
+Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps;
 
-    Gear^.scale:= Gear^.scale + 0.0025 * Steps;
-    Gear^.alpha:= Gear^.alpha - 0.0015 * Steps;
+Gear^.scale:= Gear^.scale + 0.0025 * Steps;
+Gear^.alpha:= Gear^.alpha - 0.0015 * Steps;
 
-    if Gear^.alpha < 0 then DeleteVisualGear(Gear)
+if Gear^.alpha < 0 then
+    DeleteVisualGear(Gear)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSmoke(Gear: PVisualGear; Steps: Longword);
 begin
-    Gear^.X:= Gear^.X + (cWindSpeedf + Gear^.dX) * Steps;
-    Gear^.Y:= Gear^.Y - (cDrownSpeedf + Gear^.dY) * Steps;
+Gear^.X:= Gear^.X + (cWindSpeedf + Gear^.dX) * Steps;
+Gear^.Y:= Gear^.Y - (cDrownSpeedf + Gear^.dY) * Steps;
 
-    Gear^.dX := Gear^.dX + (cWindSpeedf * 0.3 * Steps);
-    //Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.995);
+Gear^.dX := Gear^.dX + (cWindSpeedf * 0.3 * Steps);
+//Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.995);
 
-    if Gear^.FrameTicks <= Steps then
-        if Gear^.Frame = 0 then DeleteVisualGear(Gear)
-        else
-            begin
-            if Random(2) = 0 then dec(Gear^.Frame);
-            Gear^.FrameTicks:= cExplFrameTicks
-            end
-        else dec(Gear^.FrameTicks, Steps)
+if Gear^.FrameTicks <= Steps then
+    if Gear^.Frame = 0 then
+        DeleteVisualGear(Gear)
+    else
+        begin
+        if Random(2) = 0 then
+            dec(Gear^.Frame);
+        Gear^.FrameTicks:= cExplFrameTicks
+        end
+    else dec(Gear^.FrameTicks, Steps)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepDust(Gear: PVisualGear; Steps: Longword);
 begin
-    Gear^.X:= Gear^.X + (cWindSpeedf + (cWindSpeedf * 0.03 * Steps) + Gear^.dX) * Steps;
-    Gear^.Y:= Gear^.Y - (Gear^.dY) * Steps;
+Gear^.X:= Gear^.X + (cWindSpeedf + (cWindSpeedf * 0.03 * Steps) + Gear^.dX) * Steps;
+Gear^.Y:= Gear^.Y - (Gear^.dY) * Steps;
 
-    Gear^.dX := Gear^.dX - (Gear^.dX * 0.005 * Steps);
-    Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.001 * Steps);
+Gear^.dX := Gear^.dX - (Gear^.dX * 0.005 * Steps);
+Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.001 * Steps);
 
-    if Gear^.FrameTicks <= Steps then
-        if Gear^.Frame = 0 then DeleteVisualGear(Gear)
-        else
-            begin
-            dec(Gear^.Frame);
-            Gear^.FrameTicks:= cExplFrameTicks
-            end
-        else dec(Gear^.FrameTicks, Steps)
+if Gear^.FrameTicks <= Steps then
+    if Gear^.Frame = 0 then
+            DeleteVisualGear(Gear)
+    else
+        begin
+        dec(Gear^.Frame);
+        Gear^.FrameTicks:= cExplFrameTicks
+        end
+    else dec(Gear^.FrameTicks, Steps)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSplash(Gear: PVisualGear; Steps: Longword);
 begin
-  if Gear^.FrameTicks <= Steps then
-      DeleteVisualGear(Gear)
-  else
-      dec(Gear^.FrameTicks, Steps);
+if Gear^.FrameTicks <= Steps then
+    DeleteVisualGear(Gear)
+else
+    dec(Gear^.FrameTicks, Steps);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepDroplet(Gear: PVisualGear; Steps: Longword);
 begin
-  Gear^.X:= Gear^.X + Gear^.dX * Steps;
+Gear^.X:= Gear^.X + Gear^.dX * Steps;
 
-  Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
-  Gear^.dY:= Gear^.dY + cGravityf * Steps;
+Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+Gear^.dY:= Gear^.dY + cGravityf * Steps;
 
-  if round(Gear^.Y) > cWaterLine then begin
+if round(Gear^.Y) > cWaterLine then
+    begin
     DeleteVisualGear(Gear);
     PlaySound(TSound(ord(sndDroplet1) + Random(3)));
     end;
@@ -348,12 +396,14 @@ end;
 procedure doStepSmokeRing(Gear: PVisualGear; Steps: Longword);
 begin
 inc(Gear^.Timer, Steps);
-if Gear^.Timer >= Gear^.FrameTicks then DeleteVisualGear(Gear)
+if Gear^.Timer >= Gear^.FrameTicks then
+    DeleteVisualGear(Gear)
 else
     begin
     Gear^.scale := 1.25 * (-power(2, -10 * Int(Gear^.Timer)/Gear^.FrameTicks) + 1) + 0.4;
     Gear^.alpha := 1 - power(Gear^.Timer / 350, 4);
-    if Gear^.alpha < 0 then Gear^.alpha:= 0;
+    if Gear^.alpha < 0 then
+        Gear^.alpha:= 0;
     end;
 end;
 
@@ -386,7 +436,7 @@ var thexchar: array[0..cMaxTeams] of
 procedure doStepTeamHealthSorterWork(Gear: PVisualGear; Steps: Longword);
 var i, t: LongInt;
 begin
-for t:= 1 to Steps do
+for t:= 1 to min(Steps, Gear^.Timer) do
     begin
     dec(Gear^.Timer);
     if (Gear^.Timer and 15) = 0 then
@@ -394,17 +444,18 @@ for t:= 1 to Steps do
             with thexchar[i] do
                 begin
                 {$WARNINGS OFF}
-                team^.DrawHealthY:= ny + dy * LongInt(Gear^.Timer) div 640;
+                team^.DrawHealthY:= ny + dy * LongInt(Gear^.Timer) div cSorterWorkTime;
                 team^.TeamHealthBarWidth:= team^.NewTeamHealthBarWidth + dw * LongInt(Gear^.Timer) div cSorterWorkTime;
                 {$WARNINGS ON}
                 end;
+    end;
 
-    if (Gear^.Timer = 0) or (currsorter <> Gear) then
-        begin
-        if currsorter = Gear then currsorter:= nil;
-        DeleteVisualGear(Gear);
-        exit
-        end
+if (Gear^.Timer = 0) or (currsorter <> Gear) then
+    begin
+    if currsorter = Gear then
+        currsorter:= nil;
+    DeleteVisualGear(Gear);
+    exit
     end
 end;
 
@@ -414,15 +465,21 @@ var i: Longword;
     t: LongInt;
 begin
 Steps:= Steps; // avoid compiler hint
+
 for t:= 0 to Pred(TeamsCount) do
     with thexchar[t] do
         begin
-        dy:= TeamsArray[t]^.DrawHealthY;
-        dw:= TeamsArray[t]^.TeamHealthBarWidth - TeamsArray[t]^.NewTeamHealthBarWidth;
         team:= TeamsArray[t];
-        SortFactor:= TeamsArray[t]^.Clan^.ClanHealth;
-        SortFactor:= (SortFactor shl  3) + TeamsArray[t]^.Clan^.ClanIndex;
-        SortFactor:= (SortFactor shl 30) + TeamsArray[t]^.TeamHealth;
+        dy:= team^.DrawHealthY;
+        dw:= team^.TeamHealthBarWidth - team^.NewTeamHealthBarWidth;
+        if team^.TeamHealth > 0 then
+            begin
+            SortFactor:= team^.Clan^.ClanHealth;
+            SortFactor:= (SortFactor shl  3) + team^.Clan^.ClanIndex;
+            SortFactor:= (SortFactor shl 30) + team^.TeamHealth;
+            end
+        else
+            SortFactor:= 0;
         end;
 
 if TeamsCount > 1 then
@@ -440,12 +497,13 @@ if TeamsCount > 1 then
 
 t:= - 4;
 for i:= 0 to Pred(TeamsCount) do
-    with thexchar[i] do
-        begin
-        dec(t, team^.HealthTex^.h + 2);
-        ny:= t;
-        dy:= dy - ny
-        end;
+        with thexchar[i] do
+          if team^.TeamHealth > 0 then
+            begin
+            dec(t, team^.HealthTex^.h + 2);
+            ny:= t;
+            dy:= dy - ny
+            end;
 
 Gear^.Timer:= cSorterWorkTime;
 Gear^.doStep:= @doStepTeamHealthSorterWork;
@@ -477,7 +535,8 @@ begin
 Steps:= Steps; // avoid compiler hint
 
 with Gear^.Hedgehog^ do
-    if SpeechGear <> nil then SpeechGear^.Timer:= 0;
+    if SpeechGear <> nil then
+        SpeechGear^.Timer:= 0;
 
 Gear^.Hedgehog^.SpeechGear:= Gear;
 
@@ -536,7 +595,8 @@ if (round(Gear^.Y) > cWaterLine) and (Gear^.Frame = 0)  then
 
 Gear^.Y:= Gear^.Y - Gear^.Tex^.h;
 
-if Steps > 1 then Gear^.doStep(Gear, Steps-1);
+if Steps > 1 then
+    Gear^.doStep(Gear, Steps-1);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -546,10 +606,10 @@ inc(Gear^.Timer, Steps );
 if Gear^.Timer > 64 then
     begin
     if Gear^.State = 0 then
-      begin
-      DeleteVisualGear(Gear);
-      exit;
-      end;
+        begin
+        DeleteVisualGear(Gear);
+        exit;
+        end;
     dec(Gear^.State, Gear^.Timer div 65);
     Gear^.Timer:= Gear^.Timer mod 65;
     end;
@@ -565,7 +625,8 @@ if Gear^.Timer > 75 then
     begin
     inc(Gear^.State, Gear^.Timer div 76);
     Gear^.Timer:= Gear^.Timer mod 76;
-    if Gear^.State > 5 then DeleteVisualGear(Gear);
+    if Gear^.State > 5 then
+        DeleteVisualGear(Gear);
     end;
 end;
 
@@ -588,7 +649,8 @@ for i:= 0 to 31 do
 for i:= 0 to  8 do AddVisualGear(gX, gY, vgtExplPart);
 for i:= 0 to  8 do AddVisualGear(gX, gY, vgtExplPart2);
 Gear^.doStep:= @doStepExplosionWork;
-if Steps > 1 then Gear^.doStep(Gear, Steps-1);
+if Steps > 1 then
+    Gear^.doStep(Gear, Steps-1);
 end;
 
 
@@ -604,7 +666,8 @@ if (Gear^.Timer and 5) = 0 then
     ShakeCamera(maxMovement);
     end;
 
-if Gear^.Timer > 250 then DeleteVisualGear(Gear);
+if Gear^.Timer > 250 then
+    DeleteVisualGear(Gear);
 end;
 
 procedure doStepBigExplosion(Gear: PVisualGear; Steps: Longword);
@@ -627,10 +690,13 @@ for i:= 0 to 46 do
         inc(vg^.FrameTicks, vg^.FrameTicks)
         end
     end;
-for i:= 0 to 15 do AddVisualGear(gX, gY, vgtExplPart);
-for i:= 0 to 15 do AddVisualGear(gX, gY, vgtExplPart2);
+for i:= 0 to 15 do
+    AddVisualGear(gX, gY, vgtExplPart);
+for i:= 0 to 15 do
+    AddVisualGear(gX, gY, vgtExplPart2);
 Gear^.doStep:= @doStepBigExplosionWork;
-if Steps > 1 then Gear^.doStep(Gear, Steps-1);
+if Steps > 1 then
+    Gear^.doStep(Gear, Steps-1);
 performRumble();
 end;
 
@@ -653,10 +719,10 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBulletHit(Gear: PVisualGear; Steps: Longword);
 begin
-  if Gear^.FrameTicks <= Steps then
-      DeleteVisualGear(Gear)
-  else
-      dec(Gear^.FrameTicks, Steps);
+if Gear^.FrameTicks <= Steps then
+    DeleteVisualGear(Gear)
+else
+    dec(Gear^.FrameTicks, Steps);
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -672,12 +738,18 @@ with Gear^ do
             if (FrameTicks mod Frame) = 0 then
                 begin
                 tmp:= Gear^.Tint and $FF;
-                if tdY >= 0 then inc(tmp)
-                else dec(tmp);
-                if tmp < round(dX) then tdY:= 1;
-                if tmp > round(dY) then tdY:= -1;
-                if tmp > 255 then tmp := 255;
-                if tmp < 0 then tmp := 0;
+                if tdY >= 0 then
+                    inc(tmp)
+                else
+                    dec(tmp);
+                if tmp < round(dX) then
+                    tdY:= 1;
+                if tmp > round(dY) then
+                    tdY:= -1;
+                if tmp > 255 then
+                    tmp := 255;
+                if tmp < 0 then
+                    tmp := 0;
                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Longword(tmp)
                 end
             end
@@ -686,16 +758,28 @@ end;
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSmoothWindBar(Gear: PVisualGear; Steps: Longword);
 begin
-    inc(Gear^.Timer, Steps);
+inc(Gear^.Timer, Steps);
     
-    while Gear^.Timer >= 10 do
-        begin
-        dec(Gear^.Timer, 10);
-        if WindBarWidth < Gear^.Tag then inc(WindBarWidth)
-        else if WindBarWidth > Gear^.Tag then dec(WindBarWidth);
-        end;
+while Gear^.Timer >= 10 do
+    begin
+    dec(Gear^.Timer, 10);
+    if WindBarWidth < Gear^.Tag then
+        inc(WindBarWidth)
+    else if WindBarWidth > Gear^.Tag then
+        dec(WindBarWidth);
+    end;
+if cWindspeedf > Gear^.dAngle then
+    begin
+    cWindspeedf := cWindspeedf - Gear^.Angle*Steps;
+    if cWindspeedf < Gear^.dAngle then cWindspeedf:= Gear^.dAngle;
+    end
+else if cWindspeedf < Gear^.dAngle then
+    begin
+    cWindspeedf := cWindspeedf + Gear^.Angle*Steps;
+    if cWindspeedf > Gear^.dAngle then cWindspeedf:= Gear^.dAngle;
+    end;
         
-if WindBarWidth = Gear^.Tag then 
+if (WindBarWidth = Gear^.Tag) and (cWindspeedf = Gear^.dAngle)  then 
     DeleteVisualGear(Gear)
 end;
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/hedgewars/adler32.pas b/hedgewars/adler32.pas
index 083f3d4..ff3f58a 100644
--- a/hedgewars/adler32.pas
+++ b/hedgewars/adler32.pas
@@ -63,9 +63,10 @@ interface
 (*
 As per the license above, noting that this implementation of adler32 was stripped of everything we didn't need.
 That means no btypes, file loading, and the assembly version disabled.
+Also, the structure was removed to simplify C conversion
 *)
 
-procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
+function Adler32Update ( var adler     :longint; Msg     :pointer; Len     :longint ) : longint;
 
 implementation
 
@@ -73,29 +74,33 @@ implementation
 $ifdef BASM16
 
 procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
-  //-update Adler32 with Msg data
+    //-update Adler32 with Msg data
 const
-  BASE = 65521; // max. prime < 65536
-  NMAX =  5552; // max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^32
+    BASE = 65521; // max. prime < 65536
+    NMAX =  5552; // max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^32
 type
-  LH    = packed record
+    LH    = packed record
             L,H: word;
-          end;
+            end;
 var
-  s1,s2: longint;
-  n: integer;
+    s1,s2: longint;
+    n: integer;
 begin
-  s1 := LH(adler).L;
-  s2 := LH(adler).H;
-  while Len > 0 do begin
-    if Len<NMAX then n := Len else n := NMAX;
+    s1 := LH(adler).L;
+    s2 := LH(adler).H;
+    while Len > 0 do
+        begin
+    if Len<NMAX then
+        n := Len
+    else
+        n := NMAX;
     //BASM increases speed from about 52 cyc/byte to about 3.7 cyc/byte
     asm
                     mov  cx,[n]
             db $66; mov  ax,word ptr [s1]
             db $66; mov  di,word ptr [s2]
                     les  si,[msg]
-      @@1:  db $66, $26, $0f, $b6, $1c      // movzx ebx,es:[si]
+        @@1:  db $66, $26, $0f, $b6, $1c      // movzx ebx,es:[si]
                     inc  si
             db $66; add  ax,bx              // inc(s1, pByte(Msg)^)
             db $66; add  di,ax              // inc(s2, s1
@@ -111,42 +116,43 @@ begin
             db $66; div  cx
             db $66; mov  word ptr [s2],dx   // s2 := s2 mod BASE
                     mov  word ptr [msg],si  // save offset for next chunk
-    end;
+        end;
     dec(len, n);
-  end;
-  LH(adler).L := word(s1);
-  LH(adler).H := word(s2);
+    end;
+    LH(adler).L := word(s1);
+    LH(adler).H := word(s2);
 end;
 *)
 
-procedure Adler32Update(var adler: longint; Msg: pointer; Len: longint);
-  {-update Adler32 with Msg data}
-const
-  BASE = 65521; {max. prime < 65536 }
-  NMAX =  3854; {max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^31}
-type
-  LH    = packed record
-            L,H: word;
-          end;
-var
-  s1,s2: longint;
-  i,n: integer;
-begin
-  s1 := LH(adler).L;
-  s2 := LH(adler).H;
-  while Len > 0 do begin
-    if Len<NMAX then n := Len else n := NMAX;
-    for i:=1 to n do begin
-      inc(s1, pByte(Msg)^);
-      inc(Msg);
-      inc(s2, s1);
+function Adler32Update(var adler: longint; Msg: pointer; Len :longint) : longint;
+    {-update Adler32 with Msg data}
+    const
+        BASE = 65521; {max. prime < 65536 }
+        NMAX = 3854; {max. n with 255n(n+1)/2 + (n+1)(BASE-1) < 2^31}
+    var
+        s1, s2: longint;
+        i, n: integer;
+    begin
+        s1 := adler and $FFFF;
+        s2 := adler shr 16;
+        while Len>0 do
+            begin
+            if Len<NMAX then
+                n := Len
+            else
+                n := NMAX;
+
+            for i := 1 to n do
+                begin
+                inc(s1, pByte(Msg)^);
+                inc(Msg);
+                inc(s2, s1);
+                end;
+            s1 := s1 mod BASE;
+            s2 := s2 mod BASE;
+            dec(len, n);
+            end;
+        Adler32Update:= (s2 shl 16) or s1;
     end;
-    s1 := s1 mod BASE;
-    s2 := s2 mod BASE;
-    dec(len, n);
-  end;
-  LH(adler).L := word(s1);
-  LH(adler).H := word(s2);
-end;
 
 end.
diff --git a/hedgewars/avwrapper.c b/hedgewars/avwrapper.c
new file mode 100644
index 0000000..6e879e1
--- /dev/null
+++ b/hedgewars/avwrapper.c
@@ -0,0 +1,515 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdarg.h>
+#include "libavformat/avformat.h"
+
+#ifndef AVIO_FLAG_WRITE
+#define AVIO_FLAG_WRITE AVIO_WRONLY
+#endif
+
+static AVFormatContext* g_pContainer;
+static AVOutputFormat* g_pFormat;
+static AVStream* g_pAStream;
+static AVStream* g_pVStream;
+static AVFrame* g_pAFrame;
+static AVFrame* g_pVFrame;
+static AVCodec* g_pACodec;
+static AVCodec* g_pVCodec;
+static AVCodecContext* g_pAudio;
+static AVCodecContext* g_pVideo;
+
+static int g_Width, g_Height;
+static uint32_t g_Frequency, g_Channels;
+static int g_VQuality;
+static AVRational g_Framerate;
+
+static FILE* g_pSoundFile;
+static int16_t* g_pSamples;
+static int g_NumSamples;
+
+/*
+Initially I wrote code for latest ffmpeg, but on Linux (Ubuntu)
+only older version is available from repository. That's why you see here
+all of this #if LIBAVCODEC_VERSION_MAJOR < 54.
+Actually, it may be possible to remove code for newer version
+and use only code for older version.
+*/
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
+#define OUTBUFFER_SIZE 200000
+static uint8_t g_OutBuffer[OUTBUFFER_SIZE];
+#endif
+
+// pointer to function from hwengine (uUtils.pas)
+static void (*AddFileLogRaw)(const char* pString);
+
+static void FatalError(const char* pFmt, ...)
+{
+    const char Buffer[1024];
+    va_list VaArgs;
+
+    va_start(VaArgs, pFmt);
+    vsnprintf(Buffer, 1024, pFmt, VaArgs);
+    va_end(VaArgs);
+
+    AddFileLogRaw("Error in av-wrapper: ");
+    AddFileLogRaw(Buffer);
+    AddFileLogRaw("\n");
+    exit(1);
+}
+
+// Function to be called from libav for logging.
+// Note: libav can call LogCallback from different threads
+// (there is mutex in AddFileLogRaw).
+static void LogCallback(void* p, int Level, const char* pFmt, va_list VaArgs)
+{
+    const char Buffer[1024];
+
+    vsnprintf(Buffer, 1024, pFmt, VaArgs);
+    AddFileLogRaw(Buffer);
+}
+
+static void Log(const char* pFmt, ...)
+{
+    const char Buffer[1024];
+    va_list VaArgs;
+
+    va_start(VaArgs, pFmt);
+    vsnprintf(Buffer, 1024, pFmt, VaArgs);
+    va_end(VaArgs);
+
+    AddFileLogRaw(Buffer);
+}
+
+static void AddAudioStream()
+{
+#if LIBAVFORMAT_VERSION_MAJOR >= 54
+    g_pAStream = avformat_new_stream(g_pContainer, g_pACodec);
+#else
+    g_pAStream = av_new_stream(g_pContainer, 1);
+#endif
+    if(!g_pAStream)
+    {
+        Log("Could not allocate audio stream\n");
+        return;
+    }
+    g_pAStream->id = 1;
+
+    g_pAudio = g_pAStream->codec;
+
+    avcodec_get_context_defaults3(g_pAudio, g_pACodec);
+    g_pAudio->codec_id = g_pACodec->id;
+
+    // put parameters
+    g_pAudio->sample_fmt = AV_SAMPLE_FMT_S16;
+    g_pAudio->sample_rate = g_Frequency;
+    g_pAudio->channels = g_Channels;
+
+    // set quality
+    g_pAudio->bit_rate = 160000;
+
+    // for codecs that support variable bitrate use it, it should be better
+    g_pAudio->flags |= CODEC_FLAG_QSCALE;
+    g_pAudio->global_quality = 1*FF_QP2LAMBDA;
+
+    // some formats want stream headers to be separate
+    if (g_pFormat->flags & AVFMT_GLOBALHEADER)
+        g_pAudio->flags |= CODEC_FLAG_GLOBAL_HEADER;
+
+    // open it
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+    if (avcodec_open2(g_pAudio, g_pACodec, NULL) < 0)
+#else
+    if (avcodec_open(g_pAudio, g_pACodec) < 0)
+#endif
+    {
+        Log("Could not open audio codec %s\n", g_pACodec->long_name);
+        return;
+    }
+
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+    if (g_pACodec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
+#else
+    if (g_pAudio->frame_size == 0)
+#endif
+        g_NumSamples = 4096;
+    else
+        g_NumSamples = g_pAudio->frame_size;
+    g_pSamples = (int16_t*)av_malloc(g_NumSamples*g_Channels*sizeof(int16_t));
+    g_pAFrame = avcodec_alloc_frame();
+    if (!g_pAFrame)
+    {
+        Log("Could not allocate frame\n");
+        return;
+    }
+}
+
+// returns non-zero if there is more sound
+static int WriteAudioFrame()
+{
+    if (!g_pAStream)
+        return 0;
+
+    AVPacket Packet = { 0 };
+    av_init_packet(&Packet);
+
+    int NumSamples = fread(g_pSamples, 2*g_Channels, g_NumSamples, g_pSoundFile);
+
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+    AVFrame* pFrame = NULL;
+    if (NumSamples > 0)
+    {
+        g_pAFrame->nb_samples = NumSamples;
+        avcodec_fill_audio_frame(g_pAFrame, g_Channels, AV_SAMPLE_FMT_S16,
+                                 (uint8_t*)g_pSamples, NumSamples*2*g_Channels, 1);
+        pFrame = g_pAFrame;
+    }
+    // when NumSamples == 0 we still need to call encode_audio2 to flush
+    int got_packet;
+    if (avcodec_encode_audio2(g_pAudio, &Packet, pFrame, &got_packet) != 0)
+        FatalError("avcodec_encode_audio2 failed");
+    if (!got_packet)
+        return 0;
+#else
+    if (NumSamples == 0)
+        return 0;
+    int BufferSize = OUTBUFFER_SIZE;
+    if (g_pAudio->frame_size == 0)
+        BufferSize = NumSamples*g_Channels*2;
+    Packet.size = avcodec_encode_audio(g_pAudio, g_OutBuffer, BufferSize, g_pSamples);
+    if (Packet.size == 0)
+        return 1;
+    if (g_pAudio->coded_frame && g_pAudio->coded_frame->pts != AV_NOPTS_VALUE)
+        Packet.pts = av_rescale_q(g_pAudio->coded_frame->pts, g_pAudio->time_base, g_pAStream->time_base);
+    Packet.flags |= AV_PKT_FLAG_KEY;
+    Packet.data = g_OutBuffer;
+#endif
+
+    // Write the compressed frame to the media file.
+    Packet.stream_index = g_pAStream->index;
+    if (av_interleaved_write_frame(g_pContainer, &Packet) != 0) 
+        FatalError("Error while writing audio frame");
+    return 1;
+}
+
+// add a video output stream
+static void AddVideoStream()
+{
+#if LIBAVFORMAT_VERSION_MAJOR >= 54
+    g_pVStream = avformat_new_stream(g_pContainer, g_pVCodec);
+#else
+    g_pVStream = av_new_stream(g_pContainer, 0);
+#endif
+    if (!g_pVStream)
+        FatalError("Could not allocate video stream");
+
+    g_pVideo = g_pVStream->codec;
+
+    avcodec_get_context_defaults3(g_pVideo, g_pVCodec);
+    g_pVideo->codec_id = g_pVCodec->id;
+
+    // put parameters
+    // resolution must be a multiple of two
+    g_pVideo->width  = g_Width  & ~1; // make even (dimensions should be even)
+    g_pVideo->height = g_Height & ~1; // make even
+    /* time base: this is the fundamental unit of time (in seconds) in terms
+       of which frame timestamps are represented. for fixed-fps content,
+       timebase should be 1/framerate and timestamp increments should be
+       identically 1. */
+    g_pVideo->time_base.den = g_Framerate.num;
+    g_pVideo->time_base.num = g_Framerate.den;
+    //g_pVideo->gop_size = 12; /* emit one intra frame every twelve frames at most */
+    g_pVideo->pix_fmt = PIX_FMT_YUV420P;
+
+    // set quality
+    if (g_VQuality > 100)
+        g_pVideo->bit_rate = g_VQuality;
+    else
+    {
+        g_pVideo->flags |= CODEC_FLAG_QSCALE;
+        g_pVideo->global_quality = g_VQuality*FF_QP2LAMBDA;
+    }
+
+    // some formats want stream headers to be separate
+    if (g_pFormat->flags & AVFMT_GLOBALHEADER)
+        g_pVideo->flags |= CODEC_FLAG_GLOBAL_HEADER;
+
+#if LIBAVCODEC_VERSION_MAJOR < 54
+    // for some versions of ffmpeg x264 options must be set explicitly
+    if (strcmp(g_pVCodec->name, "libx264") == 0)
+    {
+        g_pVideo->coder_type = FF_CODER_TYPE_AC;
+        g_pVideo->flags |= CODEC_FLAG_LOOP_FILTER;
+        g_pVideo->crf = 23;
+        g_pVideo->thread_count = 3;
+        g_pVideo->me_cmp = FF_CMP_CHROMA;
+        g_pVideo->partitions = X264_PART_I8X8 | X264_PART_I4X4 | X264_PART_P8X8 | X264_PART_B8X8;
+        g_pVideo->me_method = ME_HEX;
+        g_pVideo->me_subpel_quality = 7;
+        g_pVideo->me_range = 16;
+        g_pVideo->gop_size = 250;
+        g_pVideo->keyint_min = 25;
+        g_pVideo->scenechange_threshold = 40;
+        g_pVideo->i_quant_factor = 0.71;
+        g_pVideo->b_frame_strategy = 1;
+        g_pVideo->qcompress = 0.6;
+        g_pVideo->qmin = 10;
+        g_pVideo->qmax = 51;
+        g_pVideo->max_qdiff = 4;
+        g_pVideo->max_b_frames = 3;
+        g_pVideo->refs = 3;
+        g_pVideo->directpred = 1;
+        g_pVideo->trellis = 1;
+        g_pVideo->flags2 = CODEC_FLAG2_BPYRAMID | CODEC_FLAG2_MIXED_REFS | CODEC_FLAG2_WPRED | CODEC_FLAG2_8X8DCT | CODEC_FLAG2_FASTPSKIP;
+        g_pVideo->weighted_p_pred = 2;
+    }
+#endif
+
+    // open the codec
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+    AVDictionary* pDict = NULL;
+    if (strcmp(g_pVCodec->name, "libx264") == 0)
+        av_dict_set(&pDict, "preset", "medium", 0);
+
+    if (avcodec_open2(g_pVideo, g_pVCodec, &pDict) < 0)
+#else
+    if (avcodec_open(g_pVideo, g_pVCodec) < 0)
+#endif
+        FatalError("Could not open video codec %s", g_pVCodec->long_name);
+
+    g_pVFrame = avcodec_alloc_frame();
+    if (!g_pVFrame)
+        FatalError("Could not allocate frame");
+
+    g_pVFrame->linesize[0] = g_Width;
+    g_pVFrame->linesize[1] = g_Width/2;
+    g_pVFrame->linesize[2] = g_Width/2;
+    g_pVFrame->linesize[3] = 0;
+}
+
+static int WriteFrame(AVFrame* pFrame)
+{
+    double AudioTime, VideoTime;
+
+    // write interleaved audio frame
+    if (g_pAStream)
+    {
+        VideoTime = (double)g_pVStream->pts.val*g_pVStream->time_base.num/g_pVStream->time_base.den;
+        do
+            AudioTime = (double)g_pAStream->pts.val*g_pAStream->time_base.num/g_pAStream->time_base.den;
+        while (AudioTime < VideoTime && WriteAudioFrame());
+    }
+    
+    if (!g_pVStream)
+        return 0;
+
+    AVPacket Packet;
+    av_init_packet(&Packet);
+    Packet.data = NULL;
+    Packet.size = 0;
+
+    g_pVFrame->pts++;
+    if (g_pFormat->flags & AVFMT_RAWPICTURE)
+    {
+        /* raw video case. The API will change slightly in the near
+           future for that. */
+        Packet.flags |= AV_PKT_FLAG_KEY;
+        Packet.stream_index = g_pVStream->index;
+        Packet.data = (uint8_t*)pFrame;
+        Packet.size = sizeof(AVPicture);
+
+        if (av_interleaved_write_frame(g_pContainer, &Packet) != 0)
+            FatalError("Error while writing video frame");
+        return 0;
+    }
+    else
+    {
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+        int got_packet;
+        if (avcodec_encode_video2(g_pVideo, &Packet, pFrame, &got_packet) < 0)
+            FatalError("avcodec_encode_video2 failed");
+        if (!got_packet)
+            return 0;
+
+        if (Packet.pts != AV_NOPTS_VALUE)
+            Packet.pts = av_rescale_q(Packet.pts, g_pVideo->time_base, g_pVStream->time_base);
+        if (Packet.dts != AV_NOPTS_VALUE)
+            Packet.dts = av_rescale_q(Packet.dts, g_pVideo->time_base, g_pVStream->time_base);
+#else 
+        Packet.size = avcodec_encode_video(g_pVideo, g_OutBuffer, OUTBUFFER_SIZE, pFrame);
+        if (Packet.size < 0)
+            FatalError("avcodec_encode_video failed");
+        if (Packet.size == 0)
+            return 0;
+
+        if( g_pVideo->coded_frame->pts != AV_NOPTS_VALUE)
+            Packet.pts = av_rescale_q(g_pVideo->coded_frame->pts, g_pVideo->time_base, g_pVStream->time_base);
+        if( g_pVideo->coded_frame->key_frame )
+            Packet.flags |= AV_PKT_FLAG_KEY;
+        Packet.data = g_OutBuffer;
+#endif
+        // write the compressed frame in the media file
+        Packet.stream_index = g_pVStream->index;
+        if (av_interleaved_write_frame(g_pContainer, &Packet) != 0)
+            FatalError("Error while writing video frame");
+            
+        return 1;
+    }
+}
+
+void AVWrapper_WriteFrame(uint8_t* pY, uint8_t* pCb, uint8_t* pCr)
+{
+    g_pVFrame->data[0] = pY;
+    g_pVFrame->data[1] = pCb;
+    g_pVFrame->data[2] = pCr;
+    WriteFrame(g_pVFrame);
+}
+
+void AVWrapper_Init(
+         void (*pAddFileLogRaw)(const char*),
+         const char* pFilename,
+         const char* pDesc,
+         const char* pSoundFile,
+         const char* pFormatName,
+         const char* pVCodecName,
+         const char* pACodecName,
+         int Width, int Height,
+         int FramerateNum, int FramerateDen,
+         int VQuality)
+{    
+    AddFileLogRaw = pAddFileLogRaw;
+    av_log_set_callback( &LogCallback );
+
+    g_Width  = Width;
+    g_Height = Height;
+    g_Framerate.num = FramerateNum;
+    g_Framerate.den = FramerateDen;
+    g_VQuality = VQuality;
+
+    // initialize libav and register all codecs and formats
+    av_register_all();
+
+    // find format
+    g_pFormat = av_guess_format(pFormatName, NULL, NULL);
+    if (!g_pFormat)
+        FatalError("Format \"%s\" was not found", pFormatName);
+
+    // allocate the output media context
+    g_pContainer = avformat_alloc_context();
+    if (!g_pContainer)
+        FatalError("Could not allocate output context");
+
+    g_pContainer->oformat = g_pFormat;
+
+    // store description of file
+    av_dict_set(&g_pContainer->metadata, "comment", pDesc, 0);
+
+    // append extesnion to filename
+    char ext[16];
+    strncpy(ext, g_pFormat->extensions, 16);
+    ext[15] = 0;
+    ext[strcspn(ext,",")] = 0;
+    snprintf(g_pContainer->filename, sizeof(g_pContainer->filename), "%s.%s", pFilename, ext);
+
+    // find codecs
+    g_pVCodec = avcodec_find_encoder_by_name(pVCodecName);
+    g_pACodec = avcodec_find_encoder_by_name(pACodecName);
+
+    // add audio and video stream to container
+    g_pVStream = NULL;
+    g_pAStream = NULL;
+
+    if (g_pVCodec)
+        AddVideoStream();
+    else
+        Log("Video codec \"%s\" was not found; video will be ignored.\n", pVCodecName);
+
+    if (g_pACodec)
+    {
+        g_pSoundFile = fopen(pSoundFile, "rb");
+        if (g_pSoundFile)
+        {
+            fread(&g_Frequency, 4, 1, g_pSoundFile);
+            fread(&g_Channels, 4, 1, g_pSoundFile);
+            AddAudioStream();
+        }
+        else
+            Log("Could not open %s\n", pSoundFile);
+    }
+    else
+        Log("Audio codec \"%s\" was not found; audio will be ignored.\n", pACodecName);
+
+    if (!g_pAStream && !g_pVStream)
+        FatalError("No video, no audio, aborting...");
+
+    // write format info to log
+    av_dump_format(g_pContainer, 0, g_pContainer->filename, 1);
+
+    // open the output file, if needed
+    if (!(g_pFormat->flags & AVFMT_NOFILE))
+    {
+        if (avio_open(&g_pContainer->pb, g_pContainer->filename, AVIO_FLAG_WRITE) < 0)
+            FatalError("Could not open output file (%s)", g_pContainer->filename);
+    }
+
+    // write the stream header, if any
+    avformat_write_header(g_pContainer, NULL);
+
+    g_pVFrame->pts = -1;
+}
+
+void AVWrapper_Close()
+{
+    // output buffered frames
+    if (g_pVCodec->capabilities & CODEC_CAP_DELAY)
+        while( WriteFrame(NULL) );
+    // output any remaining audio
+    while( WriteAudioFrame() );
+
+    // write the trailer, if any.
+    av_write_trailer(g_pContainer);
+
+    // close the output file
+    if (!(g_pFormat->flags & AVFMT_NOFILE))
+        avio_close(g_pContainer->pb);
+
+    // free everything
+    if (g_pVStream)
+    {
+        avcodec_close(g_pVideo);
+        av_free(g_pVideo);
+        av_free(g_pVStream);
+        av_free(g_pVFrame);
+    }
+    if (g_pAStream)
+    {
+        avcodec_close(g_pAudio);
+        av_free(g_pAudio);
+        av_free(g_pAStream);
+        av_free(g_pAFrame);
+        av_free(g_pSamples);
+        fclose(g_pSoundFile);
+    }
+
+    av_free(g_pContainer);
+}
diff --git a/hedgewars/config.inc.in b/hedgewars/config.inc.in
index ba518ae..35a86a8 100644
--- a/hedgewars/config.inc.in
+++ b/hedgewars/config.inc.in
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
diff --git a/hedgewars/hwLibrary.pas b/hedgewars/hwLibrary.pas
index f0be917..4c07a38 100644
--- a/hedgewars/hwLibrary.pas
+++ b/hedgewars/hwLibrary.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,17 +16,111 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
+{$INCLUDE "options.inc"}
+
+(*
+ * When engine is compiled as library this unit will export functions
+ * as C declarations for convenient library usage in your application
+ * and language of choice.
+ *
+ * See also: C declarations on Wikipedia
+ *           http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl
+ *)
+
 Library hwLibrary;
 
-// Add all your Pascal units to the "uses" clause below to add them to the program.
-// Mark all Pascal procedures/functions that you wish to call from C/C++/Objective-C code using
-// "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for
-// these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group)
-// to make these functions available in the C/C++/Objective-C source files
-// (add "#include PascalImports.h" near the top of these files if it's not there yet)
-uses PascalExports, hwengine;
-exports Game, HW_versionInfo;
+uses hwengine, uTypes, uConsts, uVariables, uSound, uCommands, uUtils,
+     uLocale{$IFDEF ANDROID}, jni{$ENDIF};
+
+{$INCLUDE "config.inc"}
+
+// retrieve protocol information
+procedure HW_versionInfo(netProto: PLongInt; versionStr: PPChar); cdecl; export;
 begin
+    netProto^:= cNetProtoVersion;
+    versionStr^:= cVersionString;
+end;
 
-end.
+// equivalent to esc+y; when closeFrontend = true the game exits after memory cleanup
+procedure HW_terminate(closeFrontend: boolean); cdecl; export;
+begin
+    closeFrontend:= closeFrontend; // avoid hint
+    ParseCommand('forcequit', true);
+end;
+
+function HW_getWeaponNameByIndex(whichone: LongInt): PChar; cdecl; export;
+begin
+    HW_getWeaponNameByIndex:= (str2pchar(trammo[Ammoz[TAmmoType(whichone+1)].NameId]));
+end;
+
+(*function HW_getWeaponCaptionByIndex(whichone: LongInt): PChar; cdecl; export;
+begin
+    HW_getWeaponCaptionByIndex:= (str2pchar(trammoc[Ammoz[TAmmoType(whichone+1)].NameId]));
+end;
+
+function HW_getWeaponDescriptionByIndex(whichone: LongInt): PChar; cdecl; export;
+begin
+    HW_getWeaponDescriptionByIndex:= (str2pchar(trammod[Ammoz[TAmmoType(whichone+1)].NameId]));
+end;*)
 
+function HW_getNumberOfWeapons: LongInt; cdecl; export;
+begin
+    HW_getNumberOfWeapons:= ord(high(TAmmoType));
+end;
+
+function HW_getMaxNumberOfHogs: LongInt; cdecl; export;
+begin
+    HW_getMaxNumberOfHogs:= cMaxHHIndex + 1;
+end;
+
+function HW_getMaxNumberOfTeams: LongInt; cdecl; export;
+begin
+    HW_getMaxNumberOfTeams:= cMaxTeams;
+end;
+
+procedure HW_memoryWarningCallback; cdecl; export;
+begin
+    ReleaseSound(false);
+end;
+
+{$IFDEF ANDROID}
+function JNI_HW_versionInfoNet(env: PJNIEnv; obj: JObject):JInt;cdecl;
+begin
+    env:= env; // avoid hint
+    obj:= obj; // avoid hint
+    JNI_HW_versionInfoNet:= cNetProtoVersion;
+end;
+
+function JNI_HW_versionInfoVersion(env: PJNIEnv; obj: JObject):JString; cdecl;
+var envderef : JNIEnv;
+begin
+    obj:= obj; // avoid hint
+    envderef:= @env;
+    JNI_HW_versionInfoVersion := envderef^.NewStringUTF(env, PChar(cVersionString));
+end;
+
+exports
+    JNI_HW_versionInfoNet name Java_Prefix+'HWversionInfoNetProto', 
+    JNI_HW_versionInfoVersion name Java_Prefix+'HWversionInfoVersion', 
+    GenLandPreview name Java_Prefix + 'GenLandPreview',
+    HW_getNumberOfweapons name Java_Prefix + 'HWgetNumberOfWeapons',
+    HW_getMaxNumberOfHogs name Java_Prefix + 'HWgetMaxNumberOfHogs',
+    HW_getMaxNumberOfTeams name Java_Prefix + 'HWgetMaxNumberOfTeams',
+    HW_terminate name Java_Prefix + 'HWterminate',
+    Game;
+{$ELSE}
+exports
+    Game,
+    GenLandPreview,
+    LoadLocaleWrapper,
+    HW_versionInfo,
+    HW_terminate,
+    HW_getNumberOfWeapons,
+    HW_getMaxNumberOfHogs,
+    HW_getMaxNumberOfTeams,
+    HW_getWeaponNameByIndex,
+    HW_memoryWarningCallback;
+{$ENDIF}
+
+begin
+end.
diff --git a/hedgewars/hwengine.pas b/hedgewars/hwengine.pas
index cf61d36..1a47023 100644
--- a/hedgewars/hwengine.pas
+++ b/hedgewars/hwengine.pas
@@ -1,20 +1,20 @@
 (*
-* Hedgewars, a free turn based strategy game
-* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-*)
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
 
 {$INCLUDE "options.inc"}
 
@@ -29,178 +29,209 @@ interface
 program hwengine;
 {$ENDIF}
 
-uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uKeys, uSound,
-     uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions,
-     sysutils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted;
+uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler,
+     uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions,
+     SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
+     {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
+     {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
+     {$IFDEF ANDROID}, GLUnit{$ENDIF}
+     ;
+
 
 {$IFDEF HWLIBRARY}
+procedure preInitEverything();
 procedure initEverything(complete:boolean);
 procedure freeEverything(complete:boolean);
 procedure Game(gameArgs: PPChar); cdecl; export;
+procedure GenLandPreview(port: Longint); cdecl; export;
 
 implementation
 {$ELSE}
-procedure OnDestroy; forward;
+procedure preInitEverything(); forward;
 procedure initEverything(complete:boolean); forward;
 procedure freeEverything(complete:boolean); forward;
 {$ENDIF}
 
-////////////////////////////////
-procedure DoTimer(Lag: LongInt);
+///////////////////////////////////////////////////////////////////////////////
+function DoTimer(Lag: LongInt): boolean;
 var s: shortstring;
 begin
-    if isPaused = false then
-        inc(RealTicks, Lag);
+    DoTimer:= false;
+    inc(RealTicks, Lag);
 
     case GameState of
-        gsLandGen: begin
-                GenMap;
-                ParseCommand('sendlanddigest', true);
-                GameState:= gsStart;
-                end;
-        gsStart: begin
-                if HasBorder then DisableSomeWeapons;
-                AddClouds;
-                AddFlakes;
-                AssignHHCoords;
-                AddMiscGears;
-                StoreLoad;
-                InitWorld;
-                ResetKbd;
-                SoundLoad;
-                if GameType = gmtSave then
-                    begin
-                    isSEBackup:= isSoundEnabled;
-                    isSoundEnabled:= false
-                    end;
-                FinishProgress;
-                PlayMusic;
-                SetScale(zoom);
-                ScriptCall('onGameStart');
-                GameState:= gsGame;
-                end;
-        gsConfirm,
-        gsGame: begin
-                DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
-                ProcessKbd;
-                if not isPaused then
-                    begin
-                    DoGameTick(Lag);
-                    ProcessVisualGears(Lag);
-                    end;
-                end;
-        gsChat: begin
-                DrawWorld(Lag);
-                if not isPaused then
-                    begin
-                    DoGameTick(Lag);
-                    ProcessVisualGears(Lag);
-                    end;
-                end;
-        gsExit: begin
-                isTerminated:= true;
-                end;
-        gsSuspend: exit;
-        end;
+        gsLandGen:
+            begin
+            GenMap;
+            SetLandTexture;
+            UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
+            setAILandMarks;
+            ParseCommand('sendlanddigest', true);
+            GameState:= gsStart;
+            end;
+        gsStart:
+            begin
+            if HasBorder then
+                DisableSomeWeapons;
+            AddClouds;
+            AddFlakes;
+            AssignHHCoords;
+            AddMiscGears;
+            StoreLoad(false);
+            InitWorld;
+            ResetKbd;
+            if GameType = gmtSave then
+                SetSound(false);
+            FinishProgress;
+            PlayMusic;
+            SetScale(zoom);
+            ScriptCall('onGameStart');
+            GameState:= gsGame;
+            end;
+        gsConfirm, gsGame:
+            begin
+            DrawWorld(Lag);
+            DoGameTick(Lag);
+            ProcessVisualGears(Lag);
+            end;
+        gsChat:
+            begin
+            DrawWorld(Lag);
+            DoGameTick(Lag);
+            ProcessVisualGears(Lag);
+            end;
+        gsExit:
+            begin
+            DoTimer:= true;
+            end;
+        gsSuspend:
+            exit(false);
+            end;
 
-{$IFDEF SDL13}
-    SDL_GL_SwapWindow(SDLwindow);
-{$ELSE}
-    SDL_GL_SwapBuffers();
+    SwapBuffers;
+
+{$IFDEF USE_VIDEO_RECORDING}
+    if flagPrerecording then
+        SaveCameraPosition;
 {$ENDIF}
 
     if flagMakeCapture then
-    begin
+        begin
         flagMakeCapture:= false;
-        s:= 'hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
+        {$IFDEF PAS2C}
+        s:= '/Screenshots/hw';
+        {$ELSE}
+        s:= '/Screenshots/hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
+        {$ENDIF}
 
+        // flash
         playSound(sndShutter);
-        if MakeScreenshot(s) then WriteLnToConsole('Screenshot saved: ' + s)
-        else begin
+        ScreenFade:= sfFromWhite;
+        ScreenFadeValue:= sfMax;
+        ScreenFadeSpeed:= 5;
+
+        if MakeScreenshot(s, 1) then
+            WriteLnToConsole('Screenshot saved: ' + s)
+        else
+            begin
             WriteLnToConsole('Screenshot failed.');
             AddChatString(#5 + 'screen capture failed (lack of memory or write permissions)');
             end
-    end;
-end;
-
-////////////////////
-procedure OnDestroy;
-begin
-    WriteLnToConsole('Freeing resources...');
-    FreeActionsList();
-    StoreRelease();
-    ControllerClose();
-    CloseIPC();
-    TTF_Quit();
-{$IFDEF SDL13}
-    SDL_GL_DeleteContext(SDLGLcontext);
-    SDL_DestroyWindow(SDLwindow);
-    SDLGLcontext:= nil;
-    SDLwindow:= nil;
-{$ENDIF}
-    SDL_Quit();
-    isTerminated:= false;
+        end;
 end;
 
-///////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure MainLoop;
 var event: TSDL_Event;
     PrevTime, CurrTime: Longword;
+    isTerminated: boolean;
 {$IFDEF SDL13}
     previousGameState: TGameState;
 {$ELSE}
     prevFocusState: boolean;
 {$ENDIF}
 begin
+    isTerminated:= false;
     PrevTime:= SDL_GetTicks;
     while isTerminated = false do
     begin
         SDL_PumpEvents();
+ 
         while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}SDL_ALLEVENTS{$ENDIF}) > 0 do
         begin
             case event.type_ of
 {$IFDEF SDL13}
-                SDL_KEYDOWN: if GameState = gsChat then
+                SDL_KEYDOWN:
+                    if GameState = gsChat then
                     // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3
-                    KeyPressChat(event.key.keysym.sym);
+                        KeyPressChat(SDL_GetKeyFromScancode(event.key.keysym.sym))//TODO correct for keymodifiers
+                    else
+                        ProcessKey(event.key);
+                SDL_KEYUP:
+                    if GameState <> gsChat then
+                        ProcessKey(event.key);
+                    
                 SDL_WINDOWEVENT:
                     if event.window.event = SDL_WINDOWEVENT_SHOWN then
-                        begin
+                    begin
                         cHasFocus:= true;
                         onFocusStateChanged()
-                        end
+                    end
                     else if event.window.event = SDL_WINDOWEVENT_MINIMIZED then
-                        begin
+                    begin
                         previousGameState:= GameState;
                         GameState:= gsSuspend;
-                        end
+                    end
                     else if event.window.event = SDL_WINDOWEVENT_RESTORED then
-                        begin
+                    begin
                         GameState:= previousGameState;
-                        end
+{$IFDEF ANDROID}
+                        //This call is used to reinitialize the glcontext and reload the textures
+                        ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
+{$ENDIF}
+                    end
                     else if event.window.event = SDL_WINDOWEVENT_RESIZED then
-                        begin
-                        // way too broken right now
-                        (*
+                    begin
                         cNewScreenWidth:= max(2 * (event.window.data1 div 2), cMinScreenWidth);
                         cNewScreenHeight:= max(2 * (event.window.data2 div 2), cMinScreenHeight);
-                        cScreenResizeDelay:= RealTicks+500;
-                        *)
-                        end;
+                        cScreenResizeDelay:= RealTicks + 500{$IFDEF IPHONEOS}div 2{$ENDIF};
+                    end;
+                        
+                SDL_FINGERMOTION:
+                    onTouchMotion(event.tfinger.x, event.tfinger.y,event.tfinger.dx, event.tfinger.dy, event.tfinger.fingerId);
+                
+                SDL_FINGERDOWN:
+                    onTouchDown(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
+                
+                SDL_FINGERUP:
+                    onTouchUp(event.tfinger.x, event.tfinger.y, event.tfinger.fingerId);
 {$ELSE}
-                SDL_KEYDOWN: if GameState = gsChat then
-                    KeyPressChat(event.key.keysym.unicode);
-                SDL_MOUSEBUTTONDOWN: if event.button.button = SDL_BUTTON_WHEELDOWN then wheelDown:= true;
-                SDL_MOUSEBUTTONUP: if event.button.button = SDL_BUTTON_WHEELUP then wheelUp:= true;
+                SDL_KEYDOWN:
+                    if GameState = gsChat then
+                        KeyPressChat(event.key.keysym.unicode)
+                    else
+                        ProcessKey(event.key);
+                SDL_KEYUP:
+                    if GameState <> gsChat then
+                        ProcessKey(event.key);
+                    
+                SDL_MOUSEBUTTONDOWN:
+                    ProcessMouse(event.button, true);
+                    
+                SDL_MOUSEBUTTONUP:
+                    ProcessMouse(event.button, false); 
+                    
                 SDL_ACTIVEEVENT:
                     if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then
-                        begin
+                    begin
                         prevFocusState:= cHasFocus;
                         cHasFocus:= event.active.gain = 1;
                         if prevFocusState xor cHasFocus then
                             onFocusStateChanged()
-                        end;
-                SDL_VIDEORESIZE: begin
+                    end;
+                        
+                SDL_VIDEORESIZE:
+                begin
                     // using lower values than cMinScreenWidth or cMinScreenHeight causes widget overlap and off-screen widget parts
                     // Change by sheepluva:
                     // Let's only use even numbers for custom width/height since I ran into scaling issues with odd width values.
@@ -208,18 +239,24 @@ begin
                     cNewScreenWidth:= max(2 * (event.resize.w div 2), cMinScreenWidth);
                     cNewScreenHeight:= max(2 * (event.resize.h div 2), cMinScreenHeight);
                     cScreenResizeDelay:= RealTicks+500;
-                    end;
+                end;
 {$ENDIF}
-                SDL_JOYAXISMOTION: ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
-                SDL_JOYHATMOTION: ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value);
-                SDL_JOYBUTTONDOWN: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true);
-                SDL_JOYBUTTONUP: ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false);
-                SDL_QUITEV: isTerminated:= true
+                SDL_JOYAXISMOTION:
+                    ControllerAxisEvent(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
+                SDL_JOYHATMOTION:
+                    ControllerHatEvent(event.jhat.which, event.jhat.hat, event.jhat.value);
+                SDL_JOYBUTTONDOWN:
+                    ControllerButtonEvent(event.jbutton.which, event.jbutton.button, true);
+                SDL_JOYBUTTONUP:
+                    ControllerButtonEvent(event.jbutton.which, event.jbutton.button, false);
+                SDL_QUITEV:
+                    isTerminated:= true
             end; //end case event.type_ of
         end; //end while SDL_PollEvent(@event) <> 0 do
 
-        if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
-            begin
+        if (cScreenResizeDelay <> 0) and (cScreenResizeDelay < RealTicks) and
+           ((cNewScreenWidth <> cScreenWidth) or (cNewScreenHeight <> cScreenHeight)) then
+        begin
             cScreenResizeDelay:= 0;
             cScreenWidth:= cNewScreenWidth;
             cScreenHeight:= cNewScreenHeight;
@@ -227,71 +264,94 @@ begin
             ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true);
             WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight));
             ScriptOnScreenResize();
-            InitCameraBorders()
-            end;
+            InitCameraBorders();
+            InitTouchInterface();
+        end;
 
-        if isTerminated = false then
-            begin
-            CurrTime:= SDL_GetTicks;
-            if PrevTime + longword(cTimerInterval) <= CurrTime then
-                begin
-                DoTimer(CurrTime - PrevTime);
-                PrevTime:= CurrTime
-                end
-            else SDL_Delay(1);
-            IPCCheckSock();
-            end;
+        CurrTime:= SDL_GetTicks();
+        if PrevTime + longword(cTimerInterval) <= CurrTime then
+        begin
+            isTerminated:= DoTimer(CurrTime - PrevTime);
+            PrevTime:= CurrTime
+        end
+        else SDL_Delay(1);
+        IPCCheckSock();
+    end;
+end;
+
+{$IFDEF USE_VIDEO_RECORDING}
+procedure RecorderMainLoop;
+var oldGameTicks, oldRealTicks, newGameTicks, newRealTicks: LongInt;
+begin
+    if not BeginVideoRecording() then
+        exit;
+    DoTimer(0); // gsLandGen -> gsStart
+    DoTimer(0); // gsStart -> gsGame
+
+    if not LoadNextCameraPosition(newRealTicks, newGameTicks) then
+        exit;
+    fastScrolling:= true;
+    DoGameTick(newGameTicks);
+    fastScrolling:= false;
+    oldRealTicks:= 0;
+    oldGameTicks:= newGameTicks;
+
+    while LoadNextCameraPosition(newRealTicks, newGameTicks) do
+    begin
+        IPCCheckSock();
+        DoGameTick(newGameTicks - oldGameTicks);
+        if GameState = gsExit then
+            break;
+        ProcessVisualGears(newRealTicks - oldRealTicks);
+        DrawWorld(newRealTicks - oldRealTicks);
+        EncodeFrame();
+        oldRealTicks:= newRealTicks;
+        oldGameTicks:= newGameTicks;
     end;
+    StopVideoRecording();
 end;
+{$ENDIF}
 
-///////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure Game{$IFDEF HWLIBRARY}(gameArgs: PPChar); cdecl; export{$ENDIF};
 var p: TPathType;
     s: shortstring;
     i: LongInt;
 begin
 {$IFDEF HWLIBRARY}
-    cBits:= 32;
-    cFullScreen:= false;
-    cTimerInterval:= 8;
-    PathPrefix:= 'Data';
-    UserPathPrefix:= '../Documents';
+    preInitEverything();
     cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF};
-    val(gameArgs[0], ipcPort);
-    val(gameArgs[1], cScreenWidth);
-    val(gameArgs[2], cScreenHeight);
-    val(gameArgs[3], cReducedQuality);
+    ipcPort:= StrToInt(gameArgs[0]);
+    cScreenWidth:= StrToInt(gameArgs[1]);
+    cScreenHeight:= StrToInt(gameArgs[2]);
+    cReducedQuality:= StrToInt(gameArgs[3]);
     cLocaleFName:= gameArgs[4];
-    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
-    else cLocale := Copy(cLocaleFName,1,2);
     UserNick:= gameArgs[5];
-    isSoundEnabled:= gameArgs[6] = '1';
-    isMusicEnabled:= gameArgs[7] = '1';
+    SetSound(gameArgs[6] = '1');
+    SetMusic(gameArgs[7] = '1');
     cAltDamage:= gameArgs[8] = '1';
-    val(gameArgs[9], rotationQt);
+    PathPrefix:= gameArgs[9];
+    UserPathPrefix:= '../Documents';
     recordFileName:= gameArgs[10];
-    cStereoMode:= smNone;
 {$ENDIF}
-    cMinScreenWidth:= min(cScreenWidth, cMinScreenWidth);
-    cMinScreenHeight:= min(cScreenHeight, cMinScreenHeight);
-    cOrigScreenWidth:= cScreenWidth;
-    cOrigScreenHeight:= cScreenHeight;
-
     initEverything(true);
 
     WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (network protocol: ' + inttostr(cNetProtoVersion) + ')');
     AddFileLog('Prefix: "' + PathPrefix +'"');
     AddFileLog('UserPrefix: "' + UserPathPrefix +'"');
+    
     for i:= 0 to ParamCount do
         AddFileLog(inttostr(i) + ': ' + ParamStr(i));
 
     for p:= Succ(Low(TPathType)) to High(TPathType) do
-        if (p <> ptMapCurrent) and (p <> ptData) then UserPathz[p]:= UserPathPrefix + '/Data/' + Pathz[p];
+        if (p <> ptMapCurrent) and (p <> ptData) then
+            UserPathz[p]:= UserPathPrefix + '/Data/' + Pathz[p];
 
     UserPathz[ptData]:= UserPathPrefix + '/Data';
 
     for p:= Succ(Low(TPathType)) to High(TPathType) do
-        if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p];
+        if p <> ptMapCurrent then
+            Pathz[p]:= PathPrefix + '/' + Pathz[p];
 
     WriteToConsole('Init SDL... ');
     SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
@@ -304,9 +364,18 @@ begin
     SDLTry(TTF_Init() <> -1, true);
     WriteLnToConsole(msgOK);
 
-    // show main window
-    if cFullScreen then ParseCommand('fullscr 1', true)
-    else ParseCommand('fullscr 0', true);
+{$IFDEF USE_VIDEO_RECORDING}
+    if GameType = gmtRecord then
+        InitOffscreenOpenGL()
+    else
+{$ENDIF}
+        begin            
+        // show main window
+        if cFullScreen then
+            ParseCommand('fullscr 1', true)
+        else
+            ParseCommand('fullscr 0', true);
+        end;
 
     ControllerInit(); // has to happen before InitKbdKeyTable to map keys
     InitKbdKeyTable();
@@ -332,75 +401,79 @@ begin
     if recordFileName = '' then
         begin
         InitIPC;
-        SendIPCAndWaitReply('C');        // ask for game config
+        SendIPCAndWaitReply(_S'C');        // ask for game config
         end
     else
         LoadRecordFromFile(recordFileName);
 
     ScriptOnGameInit;
-
     s:= 'eproto ' + inttostr(cNetProtoVersion);
     SendIPCRaw(@s[0], Length(s) + 1); // send proto version
 
     InitTeams();
     AssignStores();
 
-    if isSoundEnabled then
-        InitSound();
+    if GameType = gmtRecord then
+        SetSound(false);
 
-    isDeveloperMode:= false;
+    InitSound();
 
+    isDeveloperMode:= false;
     TryDo(InitStepsFlags = cifAllInited, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true);
-
     ParseCommand('rotmask', true);
 
-    MainLoop();
-    // clean up SDL and GL context
-    OnDestroy();
-    // clean up all the other memory allocated
+{$IFDEF USE_VIDEO_RECORDING}
+    if GameType = gmtRecord then
+        RecorderMainLoop()
+    else
+{$ENDIF}
+        MainLoop();
+
+    // clean up all the memory allocated
     freeEverything(true);
-    if alsoShutdownFrontend then halt;
 end;
 
-procedure initEverything (complete:boolean);
+///////////////////////////////////////////////////////////////////////////////
+// preInitEverything - init variables that are going to be ovewritten by arguments
+// initEverything - init variables only. Should be coupled by below
+// freeEverything - free above. Pay attention to the init/free order!
+procedure preInitEverything;
 begin
     Randomize();
 
-    if complete then cLogfileBase:= 'game'
-    else cLogfileBase:= 'preview';
-
-    // uConsts does not need initialization as they are all consts
-    uUtils.initModule;
-    uMisc.initModule;
-    uVariables.initModule;
-    uConsole.initModule;    // MUST happen after uMisc
-    uCommands.initModule;
-    uCommandHandlers.initModule;
+    uVariables.preInitModule;
+    uSound.preInitModule;
+end;
 
-    uLand.initModule;
-    uLandPainted.initModule;
+procedure initEverything (complete:boolean);
+begin
+    uUtils.initModule(complete);    // opens the debug file, must be the first
+    uVariables.initModule;          // inits all global variables
+    uConsole.initModule;            // opens stdout
+    uCommands.initModule;           // helps below
+    uCommandHandlers.initModule;    // registers all messages from frontend
 
-    uIO.initModule;
+    uLand.initModule;               // computes land
+    uLandPainted.initModule;        // computes drawn land
+    uIO.initModule;                 // sets up sockets
 
     if complete then
     begin
+{$IFDEF ANDROID}GLUnit.initModule;{$ENDIF}
+{$IFDEF USE_TOUCH_INTERFACE}uTouch.initModule;{$ENDIF}
+{$IFDEF USE_VIDEO_RECORDING}uVideoRec.initModule;{$ENDIF}   //stub
         uAI.initModule;
-        //uAIActions does not need initialization
-        //uAIAmmoTests does not need initialization
         uAIMisc.initModule;
+        uAILandMarks.initModule;    //stub
         uAmmos.initModule;
+        uCaptions.initModule;
+
         uChat.initModule;
         uCollisions.initModule;
-        //uFloat does not need initialization
-        //uGame does not need initialization
         uGears.initModule;
-        uKeys.initModule;
-        //uLandGraphics does not need initialization
-        //uLandObjects does not need initialization
-        //uLandTemplates does not need initialization
-        uLandTexture.initModule;
-        //uLocale does not need initialization
-        uRandom.initModule;
+        uInputHandler.initModule;   //stub
+        uMisc.initModule;
+        uLandTexture.initModule;    //stub
         uScript.initModule;
         uSound.initModule;
         uStats.initModule;
@@ -408,7 +481,6 @@ begin
         uTeams.initModule;
         uVisualGears.initModule;
         uWorld.initModule;
-        uCaptions.initModule;
     end;
 end;
 
@@ -416,46 +488,42 @@ procedure freeEverything (complete:boolean);
 begin
     if complete then
     begin
+        WriteLnToConsole('Freeing resources...');
+        uAI.freeModule;             // AI things need to be freed first
+        uAIMisc.freeModule;         //stub
+        uAILandMarks.freeModule;
         uCaptions.freeModule;
         uWorld.freeModule;
         uVisualGears.freeModule;
         uTeams.freeModule;
-        uStore.freeModule;          //stub
+        uInputHandler.freeModule;
         uStats.freeModule;          //stub
         uSound.freeModule;
         uScript.freeModule;
-        uRandom.freeModule;         //stub
-        //uLocale does not need to be freed
-        //uLandTemplates does not need to be freed
+        uMisc.freeModule;
         uLandTexture.freeModule;
-        //uLandObjects does not need to be freed
-        //uLandGraphics does not need to be freed
-        uKeys.freeModule;           //stub
         uGears.freeModule;
-        //uGame does not need to be freed
-        //uFloat does not need to be freed
         uCollisions.freeModule;     //stub
         uChat.freeModule;
         uAmmos.freeModule;
-        uAIMisc.freeModule;         //stub
-        //uAIAmmoTests does not need to be freed
-        //uAIActions does not need to be freed
-        uAI.freeModule;             //stub
+        uStore.freeModule;          // closes SDL
+{$IFDEF USE_VIDEO_RECORDING}uVideoRec.freeModule;{$ENDIF}
+{$IFDEF USE_TOUCH_INTERFACE}uTouch.freeModule;{$ENDIF}  //stub
+{$IFDEF ANDROID}GLUnit.freeModule;{$ENDIF}
     end;
 
-    uIO.freeModule;             //stub
+    uIO.freeModule;
     uLand.freeModule;
     uLandPainted.freeModule;
 
     uCommandHandlers.freeModule;
     uCommands.freeModule;
-    uConsole.freeModule;
+    uConsole.freeModule;            // closes stdout
     uVariables.freeModule;
-    uUtils.freeModule;
-    uMisc.freeModule;           // uMisc closes the debug log.
+    uUtils.freeModule;              // closes debug file
 end;
 
-/////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure GenLandPreview{$IFDEF HWLIBRARY}(port: LongInt); cdecl; export{$ENDIF};
 var Preview: TPreview;
 begin
@@ -463,46 +531,48 @@ begin
 {$IFDEF HWLIBRARY}
     WriteLnToConsole('Preview connecting on port ' + inttostr(port));
     ipcPort:= port;
+    InitStepsFlags:= cifRandomize;
 {$ENDIF}
     InitIPC;
     IPCWaitPongEvent;
     TryDo(InitStepsFlags = cifRandomize, 'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')', true);
 
-    Preview:= GenPreview();
+    GenPreview(Preview);
     WriteLnToConsole('Sending preview...');
     SendIPCRaw(@Preview, sizeof(Preview));
     SendIPCRaw(@MaxHedgehogs, sizeof(byte));
     WriteLnToConsole('Preview sent, disconnect');
-    CloseIPC();
     freeEverything(false);
 end;
 
 {$IFNDEF HWLIBRARY}
-/////////////////////
+///////////////////////////////////////////////////////////////////////////////
 procedure DisplayUsage;
 var i: LongInt;
 begin
-    WriteLn('Wrong argument format: correct configurations is');
-    WriteLn();
-    WriteLn('  hwengine <path to user hedgewars folder> <path to global data folder> <path to replay file> [options]');
-    WriteLn();
-    WriteLn('where [options] must be specified either as:');
-    WriteLn(' --set-video [screen width] [screen height] [color dept]');
-    WriteLn(' --set-audio [volume] [enable music] [enable sounds]');
-    WriteLn(' --set-other [language file] [full screen] [show FPS]');
-    WriteLn(' --set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]');
-    WriteLn(' --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]');
-    WriteLn(' --stats-only');
-    WriteLn();
-    WriteLn('Read documentation online at http://code.google.com/p/hedgewars/wiki/CommandLineOptions for more information');
-    WriteLn();
-    Write('PARSED COMMAND: ');
+    WriteLn(stdout, 'Wrong argument format: correct configurations is');
+    WriteLn(stdout, '');
+    WriteLn(stdout, '  hwengine <path to user hedgewars folder> <path to global data folder> <path to replay file> [options]');
+    WriteLn(stdout, '');
+    WriteLn(stdout, 'where [options] must be specified either as:');
+    WriteLn(stdout, ' --set-video [screen width] [screen height] [color dept]');
+    WriteLn(stdout, ' --set-audio [volume] [enable music] [enable sounds]');
+    WriteLn(stdout, ' --set-other [language file] [full screen] [show FPS]');
+    WriteLn(stdout, ' --set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]');
+    WriteLn(stdout, ' --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]');
+    WriteLn(stdout, ' --stats-only');
+    WriteLn(stdout, '');
+    WriteLn(stdout, 'Read documentation online at http://code.google.com/p/hedgewars/wiki/CommandLineOptions for more information');
+    WriteLn(stdout, '');
+    Write(stdout, 'PARSED COMMAND: ');
+    
     for i:=0 to ParamCount do
-        Write(ParamStr(i) + ' ');
-    WriteLn();
+        Write(stdout, ParamStr(i) + ' ');
+        
+    WriteLn(stdout, '');
 end;
 
-////////////////////
+///////////////////////////////////////////////////////////////////////////////
 {$INCLUDE "ArgParsers.inc"}
 
 procedure GetParams;
@@ -510,28 +580,41 @@ begin
     if (ParamCount < 3) then
         GameType:= gmtSyntax
     else
-        if (ParamCount = 3) and ((ParamStr(3) = '--stats-only') or (ParamStr(3) = 'landpreview')) then
-            internalSetGameTypeLandPreviewFromParameters()
+        if (ParamCount = 3) and (ParamStr(3) = 'landpreview') then
+            begin
+            ipcPort:= StrToInt(ParamStr(2));
+            GameType:= gmtLandPreview;
+            end
         else
-            if (ParamCount = cDefaultParamNum) then
-                internalStartGameWithParameters()
+            begin
+            if (ParamCount = 3) and (ParamStr(3) = '--stats-only') then
+                playReplayFileWithParameters()
             else
-                playReplayFileWithParameters();
+                if ParamCount = cDefaultParamNum then
+                    internalStartGameWithParameters()
+{$IFDEF USE_VIDEO_RECORDING}
+                else if ParamCount = cVideorecParamNum then
+                    internalStartVideoRecordingWithParameters()
+{$ENDIF}
+                else
+                    playReplayFileWithParameters();
+            end
 end;
 
-////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////// m a i n ////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////// m a i n ///////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 begin
+    preInitEverything();
     GetParams();
-    if (Length(cLocaleFName) > 6) then cLocale := Copy(cLocaleFName,1,5)
-    else cLocale := Copy(cLocaleFName,1,2);
 
-    if GameType = gmtLandPreview then GenLandPreview()
-    else if GameType = gmtSyntax then DisplayUsage()
+    if GameType = gmtLandPreview then
+        GenLandPreview()
+    else if GameType = gmtSyntax then
+        DisplayUsage()
     else Game();
 
     // return 1 when engine is not called correctly
-    ExitCode:= LongInt(GameType = gmtSyntax);
+    halt(LongInt(GameType = gmtSyntax));
 {$ENDIF}
 end.
diff --git a/hedgewars/options.inc b/hedgewars/options.inc
index 4b34907..0ba62bc 100644
--- a/hedgewars/options.inc
+++ b/hedgewars/options.inc
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004, 2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,27 +16,64 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-{$IFDEF FPC}
-  {$J+}
-{$ELSE}
-  {$ERROR Only Free Pascal supported!}
+{$IFNDEF FPC}
+    {$ERROR Only FreePascal Compiler is supported!}
 {$ENDIF}
 
-{$MODE OBJFPC}
 {$MACRO ON}
-
+{$MODE OBJFPC}
 {$DEFINE GLunit:=GL}
+{$WRITEABLECONST OFF}
+{$IMPLICITEXCEPTIONS OFF}
+{$VARSTRINGCHECKS ON}
+
+{$DEFINE USE_LUA_SCRIPT}
+
+
+{$IFDEF ANDROID}
+    {$DEFINE MOBILE}
+    {$DEFINE USE_SDLTHREADS}
+    {$DEFINE USE_CONTEXT_RESTORE}
+    {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'}
+{$ENDIF}
 
 {$IFDEF IPHONEOS}
-  {$DEFINE SDL13}
-  {$DEFINE HWLIBRARY}
-  {$DEFINE S3D_DISABLED}
-  {$DEFINE GLunit:=gles11}
+    {$DEFINE MOBILE}
+{$ENDIF}
+
+{$IFDEF MOBILE}
+    {$DEFINE HWLIBRARY}
+    {$DEFINE S3D_DISABLED}
+    {$DEFINE GLunit:=gles11}
+    {$DEFINE USE_LANDSCAPE_AMMOMENU}
+    {$DEFINE USE_TOUCH_INTERFACE}
 {$ELSE}
-  {$DEFINE DEBUGFILE}
-  //{$DEFINE TRACEAIACTIONS}
-  //{$DEFINE COUNTTICKS}
+    {$DEFINE USE_AM_NUMCOLUMN}
 {$ENDIF}
 
 
-//also available LUA_DISABLED
+{$IFDEF WIN32}
+    {$DEFINE USE_CONTEXT_RESTORE}
+{$ENDIF}
+
+{$IFDEF DARWIN}
+    {$IFNDEF IPHONEOS}
+        {$DEFINE USE_CONTEXT_RESTORE}
+    {$ENDIF}
+{$ENDIF}
+
+{$IFDEF USE_TOUCH_INTERFACE}
+    {$DEFINE SDL13}
+{$ENDIF}
+
+{$IFDEF PAS2C}
+    {$DEFINE NOCONSOLE}
+    {$DEFINE USE_SDLTHREADS}
+{$ENDIF}
+
+{$DEFINE _S:=}
+{$DEFINE _P:=}
+
+//{$DEFINE TRACEAIACTIONS}
+//{$DEFINE COUNTTICKS}
+
diff --git a/hedgewars/pas2c.h b/hedgewars/pas2c.h
new file mode 100644
index 0000000..2b414e6
--- /dev/null
+++ b/hedgewars/pas2c.h
@@ -0,0 +1,144 @@
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <wchar.h>
+
+typedef union string255_
+    {
+        struct {
+            char s[256];
+        };
+        struct {
+            char len;
+            char str[255];
+        };
+    } string255;
+typedef struct string192_
+    {
+        char s[193];
+    } string192;
+typedef struct string31_
+    {
+        char s[32];
+    } string31;
+typedef struct string15_
+    {
+        char s[16];
+    } string15;
+
+typedef string255 shortstring;
+typedef string255 ansistring;
+    
+typedef uint8_t Byte;
+typedef int8_t ShortInt;
+typedef uint16_t Word;
+typedef int16_t SmallInt;
+typedef uint32_t LongWord;
+typedef int32_t LongInt;
+typedef uint64_t QWord;
+typedef int64_t Int64;
+typedef LongWord Cardinal;
+
+typedef LongInt Integer;
+typedef float extended;
+typedef float real;
+typedef float single;
+
+typedef bool boolean;
+typedef int LongBool;
+
+typedef void * pointer;
+typedef Byte * PByte;
+typedef char * PChar;
+typedef LongInt * PLongInt;
+typedef LongWord * PLongWord;
+typedef Integer * PInteger;
+typedef int PtrInt;
+typedef wchar_t widechar;
+
+#define new(a) __new((void **)&a, sizeof(*(a)))
+void __new(void ** p, int size);
+#define dispose(a) __dispose(a, sizeof(*(a)))
+void __dispose(pointer p, int size);
+
+void * GetMem(int size);
+void FreeMem(void * p, int size);
+
+#define FillChar(a, b, c) __FillChar(&(a), b, c)
+
+void __FillChar(pointer p, int size, char fill);
+string255 _strconcat(string255 a, string255 b);
+string255 _strappend(string255 s, char c);
+string255 _strprepend(char c, string255 s);
+string255 _chrconcat(char a, char b);
+bool _strcompare(string255 a, string255 b);
+bool _strcomparec(string255 a, char b);
+bool _strncompare(string255 a, string255 b);
+char * _pchar(string255 s);
+string255 pchar2str(char * s);
+
+int Length(string255 a);
+string255 copy(string255 a, int s, int l);
+string255 delete(string255 a, int s, int l);
+string255 trim(string255 a);
+
+#define STRINIT(a) {.len = sizeof(a) - 1, .str = a}
+
+
+int length_ar(void * a);
+
+typedef int file;
+typedef int TextFile;
+extern int FileMode;
+extern int IOResult;
+extern int stdout;
+extern int stderr;
+
+#define assign(a, b) assign_(&(a), b)
+void assign_(int * f, string255 fileName);
+void reset_1(int f, int size);
+void reset_2(int f, int size);
+#define BlockRead(a, b, c, d) BlockRead_(a, &(b), c, &(d))
+void BlockRead_(int f, void * p, int size, int * sizeRead);
+#define BlockWrite(a, b, c) BlockWrite_(a, &(b), c)
+void BlockWrite_(int f, void * p, int size);
+void close(int f);
+
+void write(int f, string255 s);
+void writeLn(int f, string255 s);
+
+bool DirectoryExists(string255 dir);
+bool FileExists(string255 filename);
+
+bool odd(int i);
+
+
+typedef int TThreadId;
+void ThreadSwitch();
+#define InterlockedIncrement(a) __InterlockedIncrement(&(a))
+#define InterlockedDecrement(a) __InterlockedDecrement(&(a))
+void __InterlockedIncrement(int * a);
+void __InterlockedDecrement(int * a);
+
+bool Assigned(void * a);
+
+void randomize();
+int random(int max);
+int abs(int i);
+double sqr(double n);
+double sqrt(double n);
+int trunc(double n);
+int round(double n);
+
+string255 ParamStr(int n);
+int ParamCount();
+
+#define val(a, b, c) _val(a, (LongInt*)&(b), (LongInt*)&(c))
+void _val(string255 str, LongInt * a, LongInt * c);
+
+extern double pi;
+
+string255 EnumToStr(int a);
+string255 ExtractFileName(string255 f);
diff --git a/hedgewars/pas2cSystem.pas b/hedgewars/pas2cSystem.pas
new file mode 100644
index 0000000..d75c5e6
--- /dev/null
+++ b/hedgewars/pas2cSystem.pas
@@ -0,0 +1,148 @@
+system;
+
+type 
+    Integer = integer;
+    LongInt = integer;
+    LongWord = integer;
+    Cardinal = integer;
+    PtrInt = integer;
+    Word = integer;
+    Byte = integer;
+    SmallInt = integer;
+    ShortInt = integer;
+    QWord = integer;
+    GLint = integer;
+    GLuint = integer;
+    int = integer;
+    size_t = integer;
+
+    pointer = pointer;
+
+    float = float;
+    single = float;
+    double = float;
+    real = float;
+    extended = float;
+    GLfloat = float;
+
+    boolean = boolean;
+    LongBool = boolean;
+
+    string = string;
+    shortstring = string;
+    ansistring = string;
+    widechar = string;
+
+    char = char;
+    PChar = ^char;
+    PPChar = ^Pchar;
+    
+    PByte = ^Byte;
+    PWord = ^Word;
+    PLongInt = ^LongInt;
+    PLongWord = ^LongWord;
+    PInteger = ^Integer;
+    
+    Handle = integer;
+
+    png_structp = pointer;
+    png_size_t = integer;
+
+var 
+    false, true: boolean;
+    
+    write, writeLn, read, readLn: procedure;
+    
+    StrLen, ord, Succ, Pred : function : integer;
+    inc, dec, Low, High, Lo, Hi : function : integer;
+    odd, even : function : boolean;
+
+    Now : function : integer;
+
+    new, dispose, FillChar, Move : procedure;
+
+    trunc, round : function : integer;
+    abs, sqr : function : integer;
+
+    StrPas, FormatDateTime, copy, delete, str, pos, trim, LowerCase : function : shortstring;
+    Length, StrToInt : function : integer;
+    SetLength, val : procedure;
+    _pchar : function : PChar;
+    pchar2str : function : string;
+    memcpy : procedure;
+
+    assign, rewrite, reset, flush, BlockWrite, BlockRead, close : procedure;
+    IOResult : integer;
+    exit, break, halt, continue : procedure;
+    TextFile, file : Handle;
+    FileMode : integer;
+    FileExists, DirectoryExists, eof : function : boolean;
+    ExtractFileName : function : string;
+    exitcode : integer;
+    stdout, stderr : Handle;
+    
+    ParamCount : function : integer;
+    ParamStr : function : string;
+
+    sqrt, arctan2, cos, sin, power : function : float;
+    pi : float;
+
+    TypeInfo, GetEnumName : function : shortstring;
+
+    UTF8ToUnicode, WrapText: function : shortstring;
+
+    sizeof : function : integer;
+
+    GetMem : function : pointer;
+    FreeMem : procedure;
+   
+    glGetString : function : pchar;
+ 
+    glBegin, glBindTexture, glBlendFunc, glClear, glClearColor,
+    glColor4ub, glColorMask, glColorPointer, glDeleteTextures,
+    glDisable, glDisableClientState, glDrawArrays, glEnable,
+    glEnableClientState, glEnd, glGenTextures, glGetIntegerv,
+    glHint, glLineWidth, glLoadIdentity, glMatrixMode, glPopMatrix,
+    glPushMatrix, glReadPixels, glRotatef, glScalef, glTexCoord2f,
+    glTexCoordPointer, glTexImage2D, glTexParameterf,
+    glTexParameteri, glTranslatef, glVertex2d, glVertexPointer,
+    glViewport, glext_LoadExtension, glDeleteRenderbuffersEXT,
+    glDeleteFramebuffersEXT, glGenFramebuffersEXT,
+    glGenRenderbuffersEXT, glBindFramebufferEXT, 
+    glBindRenderbufferEXT, glRenderbufferStorageEXT,
+    glFramebufferRenderbufferEXT, glFramebufferTexture2DEXT : procedure;
+
+    GL_BGRA, GL_BLEND, GL_CLAMP_TO_EDGE, GL_COLOR_ARRAY,
+    GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_DEPTH_COMPONENT,
+    GL_DITHER, GL_EXTENSIONS, GL_FALSE, GL_FASTEST, GL_LINEAR,
+    GL_LINE_LOOP, GL_LINES, GL_LINE_SMOOTH, GL_LINE_STRIP,
+    GL_MAX_TEXTURE_SIZE, GL_MODELVIEW, GL_ONE_MINUS_SRC_ALPHA,
+    GL_PERSPECTIVE_CORRECTION_HINT, GL_PROJECTION, GL_QUADS,
+    GL_RENDERER, GL_RGBA, GL_RGBA8, GL_SRC_ALPHA, GL_TEXTURE_2D,
+    GL_TEXTURE_COORD_ARRAY, GL_TEXTURE_MAG_FILTER,
+    GL_TEXTURE_MIN_FILTER, GL_TEXTURE_PRIORITY, GL_TEXTURE_WRAP_S,
+    GL_TEXTURE_WRAP_T, GL_TRIANGLE_FAN, GL_TRUE, GL_VENDOR,
+    GL_VERSION, GL_VERTEX_ARRAY, GLenum,  GL_FRAMEBUFFER_EXT,
+    GL_RENDERBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+    GL_COLOR_ATTACHMENT0_EXT, GL_FLOAT, GL_UNSIGNED_BYTE : integer;
+
+    TThreadId : function : integer;
+    BeginThread, ThreadSwitch : procedure;
+    InterlockedIncrement, InterlockedDecrement : procedure;
+    
+    random : function : integer;
+    randomize : procedure;
+    
+    Assigned : function : boolean;
+    
+    _strconcat, _strappend, _strprepend, _chrconcat : function : string;
+    _strcompare, _strncompare, _strcomparec : function : boolean;
+
+    png_structp, png_set_write_fn, png_get_io_ptr,
+    png_get_libpng_ver, png_create_write_struct,
+    png_create_info_struct, png_destroy_write_struct,
+    png_write_row, png_set_ihdr, png_write_info,
+    png_write_end : procedure;
+
+    EnumToStr : function : string;
+
diff --git a/hedgewars/uAI.pas b/hedgewars/uAI.pas
index bdc7714..6d27b28 100644
--- a/hedgewars/uAI.pas
+++ b/hedgewars/uAI.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -30,34 +30,39 @@ procedure FreeActionsList;
 
 implementation
 uses uConsts, SDLh, uAIMisc, uAIAmmoTests, uAIActions,
-     uAmmos, SysUtils{$IFDEF UNIX}, cthreads{$ENDIF}, uTypes,
-     uVariables, uCommands, uUtils, uDebug;
+    uAmmos, SysUtils{$IFNDEF USE_SDLTHREADS} {$IFDEF UNIX}, cthreads{$ENDIF} {$ENDIF}, uTypes,
+    uVariables, uCommands, uUtils, uDebug, uAILandMarks;
 
 var BestActions: TActions;
     CanUseAmmo: array [TAmmoType] of boolean;
     StopThinking: boolean;
+{$IFDEF USE_SDLTHREADS} 
+    ThinkThread: PSDL_Thread = nil;
+{$ELSE}
     ThinkThread: TThreadID;
+{$ENDIF}
     hasThread: LongInt;
+    StartTicks: Longword;
 
 procedure FreeActionsList;
 begin
-AddFileLog('FreeActionsList called');
-if hasThread <> 0 then
-   begin
-   AddFileLog('Waiting AI thread to finish');
-   StopThinking:= true;
-   repeat
-     SDL_Delay(10)
-   until hasThread = 0
-   end;
+    AddFileLog('FreeActionsList called');
+    if hasThread <> 0 then
+    begin
+        AddFileLog('Waiting AI thread to finish');
+        StopThinking:= true;
+        repeat
+            SDL_Delay(10)
+        until hasThread = 0
+    end;
 
-with CurrentHedgehog^ do
-     if Gear <> nil then
-        if BotLevel <> 0 then
-           StopMessages(Gear^.Message);
+    with CurrentHedgehog^ do
+        if Gear <> nil then
+            if BotLevel <> 0 then
+                StopMessages(Gear^.Message);
 
-BestActions.Count:= 0;
-BestActions.Pos:= 0
+    BestActions.Count:= 0;
+    BestActions.Pos:= 0
 end;
 
 
@@ -103,80 +108,116 @@ end;
 
 
 
-procedure TestAmmos(var Actions: TActions; Me: PGear; isMoved: boolean);
+procedure TestAmmos(var Actions: TActions; Me: PGear; rareChecks: boolean);
 var BotLevel: Byte;
     ap: TAttackParams;
-    Score, i: LongInt;
+    Score, i, dAngle: LongInt;
     a, aa: TAmmoType;
 begin
 BotLevel:= Me^.Hedgehog^.BotLevel;
+windSpeed:= hwFloat2Float(cWindSpeed);
 
 for i:= 0 to Pred(Targets.Count) do
     if (Targets.ar[i].Score >= 0) and (not StopThinking) then
-       begin
-       with CurrentHedgehog^ do
+        begin
+        with Me^.Hedgehog^ do
             a:= CurAmmoType;
-       aa:= a;
-       
-       ThreadSwitch();
-       
-       repeat
-        if (CanUseAmmo[a]) and
-           ((not isMoved) or ((AmmoTests[a].flags and amtest_OnTurn) = 0)) then
-           begin
+        aa:= a;
+{$IFDEF USE_SDLTHREADS}
+        SDL_delay(0);    //ThreadSwitch was only a hint
+{$ELSE}
+        ThreadSwitch();
+{$ENDIF}       
+        repeat
+        if (CanUseAmmo[a]) 
+            and ((not rareChecks) or ((AmmoTests[a].flags and amtest_Rare) = 0)) 
+            and ((i = 0) or ((AmmoTests[a].flags and amtest_NoTarget) = 0)) 
+            then
+            begin
 {$HINTS OFF}
-           Score:= AmmoTests[a].proc(Me, Targets.ar[i].Point, BotLevel, ap);
+            Score:= AmmoTests[a].proc(Me, Targets.ar[i].Point, BotLevel, ap);
 {$HINTS ON}
-           if Actions.Score + Score > BestActions.Score then
-            if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then
-              begin
-              BestActions:= Actions;
-              inc(BestActions.Score, Score);
-              BestActions.isWalkingToABetterPlace:= false;
-
-              if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
-              else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
-
-              AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
-              if (ap.Time <> 0) then AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);
-              if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
-                 begin
-                 ap.Angle:= LongInt(Me^.Angle) - Abs(ap.Angle);
-                 if ap.Angle > 0 then
-                    begin
-                    AddAction(BestActions, aia_Up, aim_push, 300 + random(250), 0, 0);
-                    AddAction(BestActions, aia_Up, aim_release, ap.Angle, 0, 0)
-                    end else if ap.Angle < 0 then
+            if Actions.Score + Score > BestActions.Score then
+                if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then
                     begin
-                    AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
-                    AddAction(BestActions, aia_Down, aim_release, -ap.Angle, 0, 0)
+                    BestActions:= Actions;
+                    inc(BestActions.Score, Score);
+                    BestActions.isWalkingToABetterPlace:= false;
+
+                    AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
+
+                    if (ap.Angle > 0) then
+                        AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
+                    else if (ap.Angle < 0) then
+                        AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
+                    
+                    if (Ammoz[a].Ammo.Propz and ammoprop_Timerable) <> 0 then
+                        AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);
+                        
+                    if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
+                        begin
+                        dAngle:= LongInt(Me^.Angle) - Abs(ap.Angle);
+                        if dAngle > 0 then
+                            begin
+                            AddAction(BestActions, aia_Up, aim_push, 300 + random(250), 0, 0);
+                            AddAction(BestActions, aia_Up, aim_release, dAngle, 0, 0)
+                            end
+                        else if dAngle < 0 then
+                            begin
+                            AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
+                            AddAction(BestActions, aia_Down, aim_release, -dAngle, 0, 0)
+                            end
+                        end;
+                        
+                    if (Ammoz[a].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
+                        begin
+                        AddAction(BestActions, aia_Put, 0, 1, ap.AttackPutX, ap.AttackPutY)
+                        end;
+                        
+                    if (Ammoz[a].Ammo.Propz and ammoprop_OscAim) <> 0 then
+                        begin
+                        AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0);
+                        AddAction(BestActions, aia_attack, aim_release, 1, 0, 0);
+                         
+                        if abs(ap.Angle) > 32 then
+                           begin
+                           AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0);
+                           AddAction(BestActions, aia_Down, aim_release, 32, 0, 0);
+                           end;
+                        
+                        AddAction(BestActions, aia_waitAngle, ap.Angle, 250, 0, 0);
+                        AddAction(BestActions, aia_attack, aim_push, 1, 0, 0);
+                        AddAction(BestActions, aia_attack, aim_release, 1, 0, 0);
+                        end else
+                        if (Ammoz[a].Ammo.Propz and ammoprop_AttackingPut) = 0 then
+                            begin
+                            AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0);
+                            AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
+                            end;
+
+                    if (Ammoz[a].Ammo.Propz and ammoprop_Track) <> 0 then
+                        begin
+                        AddAction(BestActions, aia_waitAmmoXY, 0, 12, ap.ExplX, ap.ExplY);
+                        AddAction(BestActions, aia_attack, aim_push, 1, 0, 0);
+                        AddAction(BestActions, aia_attack, aim_release, 7, 0, 0);
+                        end;
+
+                    if ap.ExplR > 0 then
+                        AddAction(BestActions, aia_AwareExpl, ap.ExplR, 10, ap.ExplX, ap.ExplY);
                     end
-                 end;
-              if (Ammoz[a].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
-                 begin
-                 AddAction(BestActions, aia_Put, 0, 1, ap.AttackPutX, ap.AttackPutY)
-                 end;
-              if (Ammoz[a].Ammo.Propz and ammoprop_AttackingPut) = 0 then
-                 begin
-                 AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0);
-                 AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
-                 end;
-              if ap.ExplR > 0 then
-                 AddAction(BestActions, aia_AwareExpl, ap.ExplR, 10, ap.ExplX, ap.ExplY);
-              end
-           end;
-        if a = High(TAmmoType) then a:= Low(TAmmoType)
-                               else inc(a)
-       until (a = aa) or
-             (CurrentHedgehog^.MultiShootAttacks > 0) or // shooting same weapon
-             StopThinking
-       end
+            end;
+        if a = High(TAmmoType) then
+            a:= Low(TAmmoType)
+        else inc(a)
+        until (a = aa) or (CurrentHedgehog^.MultiShootAttacks > 0) {shooting same weapon}
+            or StopThinking
+        end
 end;
 
 procedure Walk(Me: PGear; var Actions: TActions);
-const FallPixForBranching = cHHRadius * 2 + 8;
+const FallPixForBranching = cHHRadius;
 var
-    ticks, maxticks, steps, tmp: Longword;
+    ticks, maxticks, oldticks, steps, tmp: Longword;
     BaseRate, BestRate, Rate: integer;
     GoInfo: TGoInfo;
     CanGo: boolean;
@@ -184,87 +225,151 @@ var
     BotLevel: Byte;
     a: TAmmoType;
 begin
-ticks:= 0; // avoid compiler hint
+ticks:= 0;
+oldticks:= 0; // avoid compiler hint
 Stack.Count:= 0;
 
+clearAllMarks;
+
 for a:= Low(TAmmoType) to High(TAmmoType) do
-    CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a);
+    CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and (HHHasAmmo(Me^.Hedgehog^, a) > 0);
 
 BotLevel:= Me^.Hedgehog^.BotLevel;
 
-tmp:= random(2) + 1;
-Push(0, Actions, Me^, tmp);
-Push(0, Actions, Me^, tmp xor 3);
-
-if (Me^.State and gstAttacked) = 0 then maxticks:= Max(0, TurnTimeLeft - 5000 - LongWord(4000 * BotLevel))
-                                   else maxticks:= TurnTimeLeft;
+if (Me^.State and gstAttacked) = 0 then
+    maxticks:= Max(0, TurnTimeLeft - 5000 - LongWord(4000 * BotLevel))
+else
+    maxticks:= TurnTimeLeft;
 
-if (Me^.State and gstAttacked) = 0 then TestAmmos(Actions, Me, false);
+if (Me^.State and gstAttacked) = 0 then
+    TestAmmos(Actions, Me, false);
+    
 BestRate:= RatePlace(Me);
 BaseRate:= Max(BestRate, 0);
 
+// switch to 'skip' if we can't move because of mouse cursor being shown
 if (Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
-    AddAction(Actions, aia_Weapon, Longword(amNothing), 100 + random(200), 0, 0);
-
-while (Stack.Count > 0) and (not StopThinking) and (GameFlags and gfArtillery = 0) do
+    AddAction(Actions, aia_Weapon, Longword(amSkip), 100 + random(200), 0, 0);
+    
+if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0)) 
+    and (GameFlags and gfArtillery = 0) then
     begin
-    Pop(ticks, Actions, Me^);
+    tmp:= random(2) + 1;
+    Push(0, Actions, Me^, tmp);
+    Push(0, Actions, Me^, tmp xor 3);
+    
+    while (Stack.Count > 0) and (not StopThinking) do
+        begin
+        Pop(ticks, Actions, Me^);
 
-    AddAction(Actions, Me^.Message, aim_push, 250, 0, 0);
-    if (Me^.Message and gmLeft) <> 0 then AddAction(Actions, aia_WaitXL, hwRound(Me^.X), 0, 0, 0)
-                                      else AddAction(Actions, aia_WaitXR, hwRound(Me^.X), 0, 0, 0);
-    steps:= 0;
+        AddAction(Actions, Me^.Message, aim_push, 250, 0, 0);
+        if (Me^.Message and gmLeft) <> 0 then
+            AddAction(Actions, aia_WaitXL, hwRound(Me^.X), 0, 0, 0)
+        else
+            AddAction(Actions, aia_WaitXR, hwRound(Me^.X), 0, 0, 0);
+        
+        steps:= 0;
 
-    while (not StopThinking) do
-       begin
-{$HINTS OFF}
-       CanGo:= HHGo(Me, @AltMe, GoInfo);
-{$HINTS ON}
-       inc(ticks, GoInfo.Ticks);
-       if ticks > maxticks then break;
-
-       if (BotLevel < 5) and (GoInfo.JumpType = jmpHJump) then // hjump support
-          if Push(ticks, Actions, AltMe, Me^.Message) then
-             with Stack.States[Pred(Stack.Count)] do
-                  begin
-                  if Me^.dX.isNegative then AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
-                                       else AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
-                  AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
-                  AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
-                  if Me^.dX.isNegative then AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
-                                       else AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
-                  end;
-       if (BotLevel < 3) and (GoInfo.JumpType = jmpLJump) then // ljump support
-          if Push(ticks, Actions, AltMe, Me^.Message) then
-             with Stack.States[Pred(Stack.Count)] do
-                  AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
-
-       if not CanGo then break;
-       inc(steps);
-       Actions.actions[Pred(Actions.Count)].Param:= hwRound(Me^.X);
-       Rate:= RatePlace(Me);
-       if Rate > BestRate then
-          begin
-          BestActions:= Actions;
-          BestActions.isWalkingToABetterPlace:= true;
-          BestRate:= Rate;
-          Me^.State:= Me^.State or gstAttacked // we have better place, go there and do not use ammo
-          end
-       else if Rate < BestRate then break;
-       if ((Me^.State and gstAttacked) = 0)
-           and ((steps mod 4) = 0) then TestAmmos(Actions, Me, true);
-       if GoInfo.FallPix >= FallPixForBranching then
-          Push(ticks, Actions, Me^, Me^.Message xor 3); // aia_Left xor 3 = aia_Right
-       end;
-
-    if BestRate > BaseRate then exit
-    end
+        while (not StopThinking) do
+            begin
+    {$HINTS OFF}
+            CanGo:= HHGo(Me, @AltMe, GoInfo);
+    {$HINTS ON}
+            oldticks:= ticks;
+            inc(ticks, GoInfo.Ticks);
+            if ticks > maxticks then
+                break;
+
+            if (BotLevel < 5) 
+                and (GoInfo.JumpType = jmpHJump) 
+                and (not checkMark(hwRound(Me^.X), hwRound(Me^.Y), markHJumped))
+                then // hjump support
+                begin
+                // check if we could go backwards and maybe ljump over a gap after this hjump
+                addMark(hwRound(Me^.X), hwRound(Me^.Y), markHJumped);
+                if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
+                    begin
+                    with Stack.States[Pred(Stack.Count)] do
+                        begin
+                        if Me^.dX.isNegative then
+                            AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0)
+                        else
+                            AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0);
+                            
+                        AddAction(MadeActions, aia_HJump, 0, 305 + random(50), 0, 0);
+                        AddAction(MadeActions, aia_HJump, 0, 350, 0, 0);
+                        
+                        if Me^.dX.isNegative then
+                            AddAction(MadeActions, aia_LookLeft, 0, 200, 0, 0)
+                        else
+                            AddAction(MadeActions, aia_LookRight, 0, 200, 0, 0);
+                        end;
+                    // but first check walking forward
+                    Push(ticks, Stack.States[Pred(Stack.Count)].MadeActions, AltMe, Me^.Message)
+                    end;
+                end;
+            if (BotLevel < 3) 
+                and (GoInfo.JumpType = jmpLJump) 
+                and (not checkMark(hwRound(Me^.X), hwRound(Me^.Y), markLJumped))
+                then // ljump support
+                begin
+                addMark(hwRound(Me^.X), hwRound(Me^.Y), markLJumped);
+                // at final check where we go after jump walking backward
+                if Push(ticks, Actions, AltMe, Me^.Message xor 3) then
+                    with Stack.States[Pred(Stack.Count)] do
+                        AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
+
+                // push current position so we proceed from it after checking jump+forward walk opportunities
+                if CanGo then Push(ticks, Actions, Me^, Me^.Message);
+                
+                // first check where we go after jump walking forward
+                if Push(ticks, Actions, AltMe, Me^.Message) then
+                    with Stack.States[Pred(Stack.Count)] do
+                        AddAction(MadeActions, aia_LJump, 0, 305 + random(50), 0, 0);
+                break
+                end;
+
+            // 'not CanGO' means we can't go straight, possible jumps are checked above
+            if not CanGo then
+                break;
+            
+             inc(steps);
+             Actions.actions[Pred(Actions.Count)].Param:= hwRound(Me^.X);
+             Rate:= RatePlace(Me);
+             if Rate > BestRate then
+                begin
+                BestActions:= Actions;
+                BestActions.isWalkingToABetterPlace:= true;
+                BestRate:= Rate;
+                Me^.State:= Me^.State or gstAttacked // we have better place, go there and do not use ammo
+                end
+            else if Rate < BestRate then
+                break;
+                
+            if ((Me^.State and gstAttacked) = 0) and ((steps mod 4) = 0) then
+                begin
+                if (steps > 4) and checkMark(hwRound(Me^.X), hwRound(Me^.Y), markWalkedHere) then
+                    break;                    
+                addMark(hwRound(Me^.X), hwRound(Me^.Y), markWalkedHere);
+
+                TestAmmos(Actions, Me, ticks shr 12 = oldticks shr 12);
+                end;
+                
+            if GoInfo.FallPix >= FallPixForBranching then
+                Push(ticks, Actions, Me^, Me^.Message xor 3); // aia_Left xor 3 = aia_Right
+            end {while};
+
+        if BestRate > BaseRate then
+            exit
+        end {while}
+    end {if}
 end;
 
 function Think(Me: Pointer): ptrint;
 var BackMe, WalkMe: TGear;
+    switchCount: LongInt;
     StartTicks, currHedgehogIndex, itHedgehog, switchesNum, i: Longword;
-    switchImmediatelyAvailable, switchAvailable: boolean;
+    switchImmediatelyAvailable: boolean;
     Actions: TActions;
 begin
 InterlockedIncrement(hasThread);
@@ -274,11 +379,13 @@ itHedgehog:= currHedgehogIndex;
 switchesNum:= 0;
 
 switchImmediatelyAvailable:= (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtSwitcher);
-switchAvailable:= HHHasAmmo(PGear(Me)^.Hedgehog^, amSwitch);
+if PGear(Me)^.Hedgehog^.BotLevel <> 5 then
+    switchCount:= HHHasAmmo(PGear(Me)^.Hedgehog^, amSwitch)
+else switchCount:= 0;
 
 if (PGear(Me)^.State and gstAttacked) = 0 then
-   if Targets.Count > 0 then
-      begin
+    if Targets.Count > 0 then
+        begin
         // iterate over current team hedgehogs
         repeat
             WalkMe:= CurrentTeam^.Hedgehogs[itHedgehog].Gear^;
@@ -288,10 +395,10 @@ if (PGear(Me)^.State and gstAttacked) = 0 then
             Actions.Score:= 0;
             if switchesNum > 0 then
                 begin
-                if not switchImmediatelyAvailable then
+                if not switchImmediatelyAvailable  then
                     begin
-                    // when AI has to use switcher, make it cost smth
-                    Actions.Score:= -20000;
+                    // when AI has to use switcher, make it cost smth unless they have a lot of switches
+                    if (switchCount < 10) then Actions.Score:= (-27+switchCount*3)*4000;
                     AddAction(Actions, aia_Weapon, Longword(amSwitch), 300 + random(200), 0, 0);                    
                     AddAction(Actions, aia_attack, aim_push, 300 + random(300), 0, 0);
                     AddAction(Actions, aia_attack, aim_release, 1, 0, 0);
@@ -306,13 +413,15 @@ if (PGear(Me)^.State and gstAttacked) = 0 then
                 itHedgehog:= Succ(itHedgehog) mod CurrentTeam^.HedgehogsNumber;
             until (itHedgehog = currHedgehogIndex) or (CurrentTeam^.Hedgehogs[itHedgehog].Gear <> nil);
 
+
             inc(switchesNum);
-        until (not (switchImmediatelyAvailable or switchAvailable))
+        until (not (switchImmediatelyAvailable or (switchCount > 0)))
             or StopThinking 
             or (itHedgehog = currHedgehogIndex)
             or BestActions.isWalkingToABetterPlace;
 
-        if (StartTicks > GameTicks - 1500) and (not StopThinking) then SDL_Delay(1000);
+        if (StartTicks > GameTicks - 1500) and (not StopThinking) then
+            SDL_Delay(1000);
 
         if (BestActions.Score < -1023) and (not BestActions.isWalkingToABetterPlace) then
             begin
@@ -320,22 +429,29 @@ if (PGear(Me)^.State and gstAttacked) = 0 then
             AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
             end;
 
-      end else
-else begin
+        end else
+else
+    begin
     BackMe:= PGear(Me)^;
     while (not StopThinking) and (BestActions.Count = 0) do
         begin
+(*
+        // Maybe this would get a bit of movement out of them? Hopefully not *toward* water. Need to check how often he'd choose that strategy
+        if SuddenDeathDmg and ((hwRound(BackMe.Y)+cWaterRise*2) > cWaterLine) then
+            AddBonus(hwRound(BackMe.X), hwRound(BackMe.Y), 250, -40);
+*)
         FillBonuses(true);
         WalkMe:= BackMe;
         Actions.Count:= 0;
         Actions.Pos:= 0;
         Actions.Score:= 0;
         Walk(@WalkMe, Actions);
-        if not StopThinking then SDL_Delay(100)
+        if not StopThinking then
+            SDL_Delay(100)
         end
     end;
 
-PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking;
+PGear(Me)^.State:= PGear(Me)^.State and (not gstHHThinking);
 Think:= 0;
 InterlockedDecrement(hasThread)
 end;
@@ -343,9 +459,11 @@ end;
 procedure StartThink(Me: PGear);
 begin
 if ((Me^.State and (gstAttacking or gstHHJumping or gstMoving)) <> 0)
-   or isInMultiShoot then exit;
+or isInMultiShoot then
+    exit;
+
+//DeleteCI(Me); // this will break demo/netplay
 
-//DeleteCI(Me); // this might break demo
 Me^.State:= Me^.State or gstHHThinking;
 Me^.Message:= 0;
 
@@ -359,49 +477,71 @@ ThinkingHH:= Me;
 
 FillTargets;
 if Targets.Count = 0 then
-   begin
-   OutError('AI: no targets!?', false);
-   exit
-   end;
+    begin
+    OutError('AI: no targets!?', false);
+    exit
+    end;
 
 FillBonuses((Me^.State and gstAttacked) <> 0);
 AddFileLog('Enter Think Thread');
-BeginThread(@Think, Me, ThinkThread)
+{$IFDEF USE_SDLTHREADS}
+ThinkThread := SDL_CreateThread(@Think{$IFDEF SDL13}, nil{$ENDIF}, Me);
+{$ELSE}
+BeginThread(@Think, Me, ThinkThread);
+{$ENDIF}
+AddFileLog('Thread started');
 end;
 
+//var scoreShown: boolean = false;
+
 procedure ProcessBot;
-const StartTicks: Longword = 0;
-      cStopThinkTime = 40;
+const cStopThinkTime = 40;
 begin
 with CurrentHedgehog^ do
-     if (Gear <> nil)
-        and ((Gear^.State and gstHHDriven) <> 0)
-        and (TurnTimeLeft < cHedgehogTurnTime - 50) then
+    if (Gear <> nil)
+    and ((Gear^.State and gstHHDriven) <> 0)
+    and (TurnTimeLeft < cHedgehogTurnTime - 50) then
         if ((Gear^.State and gstHHThinking) = 0) then
-           if (BestActions.Pos >= BestActions.Count)
-              and (TurnTimeLeft > cStopThinkTime) then
-              begin
-              if Gear^.Message <> 0 then
-                 begin
-                 StopMessages(Gear^.Message);
-                 TryDo((Gear^.Message and gmAllStoppable) = 0, 'Engine bug: AI may break demos playing', true);
-                 end;
-              if Gear^.Message <> 0 then exit;
-              StartThink(Gear);
-              StartTicks:= GameTicks
-              end else ProcessAction(BestActions, Gear)
+            if (BestActions.Pos >= BestActions.Count)
+            and (TurnTimeLeft > cStopThinkTime) then
+                begin
+                if Gear^.Message <> 0 then
+                    begin
+                    StopMessages(Gear^.Message);
+                    TryDo((Gear^.Message and gmAllStoppable) = 0, 'Engine bug: AI may break demos playing', true);
+                    end;
+                    
+                if Gear^.Message <> 0 then
+                    exit;
+                    
+                //scoreShown:= false;   
+                StartThink(Gear);
+                StartTicks:= GameTicks
+                
+            end else
+                begin
+                {if not scoreShown then
+                    begin
+                    if BestActions.Score > 0 then ParseCommand('/say Expected score = ' + inttostr(BestActions.Score div 1024), true);
+                    scoreShown:= true
+                    end;}
+                ProcessAction(BestActions, Gear)
+                end
         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
-                or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true
+            or (TurnTimeLeft <= cStopThinkTime) then
+                StopThinking:= true
 end;
 
 procedure initModule;
 begin
     hasThread:= 0;
+    StartTicks:= 0;
+    ThinkThread:= ThinkThread;
 end;
 
 procedure freeModule;
 begin
-
+    FreeActionsList();
 end;
 
 end.
diff --git a/hedgewars/uAIActions.pas b/hedgewars/uAIActions.pas
index 9070742..944eb9c 100644
--- a/hedgewars/uAIActions.pas
+++ b/hedgewars/uAIActions.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,48 +23,54 @@ interface
 uses uFloat, uTypes;
 
 const MAXACTIONS     = 96;
-      aia_none       = 0;
-      aia_Left       = 1;
-      aia_Right      = 2;
-      aia_Timer      = 3;
-      aia_attack     = 4;
-      aia_Up         = 5;
-      aia_Down       = 6;
-      aia_Switch     = 7;
-
-      aia_Weapon     = $8000;
-      aia_WaitXL     = $8001;
-      aia_WaitXR     = $8002;
-      aia_LookLeft   = $8003;
-      aia_LookRight  = $8004;
-      aia_AwareExpl  = $8005;
-      aia_HJump      = $8006;
-      aia_LJump      = $8007;
-      aia_Skip       = $8008;
-      aia_Wait       = $8009;
-      aia_Put        = $800A;
-
-      aim_push       = $8000;
-      aim_release    = $8001;
-      ai_specmask    = $8000;
+    aia_none       = 0;
+    aia_Left       = 1;
+    aia_Right      = 2;
+    aia_Timer      = 3;
+    aia_attack     = 4;
+    aia_Up         = 5;
+    aia_Down       = 6;
+    aia_Switch     = 7;
+
+    aia_Weapon     = $8000;
+    aia_WaitXL     = $8001;
+    aia_WaitXR     = $8002;
+    aia_LookLeft   = $8003;
+    aia_LookRight  = $8004;
+    aia_AwareExpl  = $8005;
+    aia_HJump      = $8006;
+    aia_LJump      = $8007;
+    aia_Skip       = $8008;
+    aia_Wait       = $8009;
+    aia_Put        = $800A;
+    aia_waitAngle  = $800B;
+    aia_waitAmmoXY = $800C;
+    
+    aim_push       = $8000;
+    aim_release    = $8001;
+    ai_specmask    = $8000;
 
 type TAction = record
-               Action: Longword;
-               X, Y, Param: LongInt;
-               Time: Longword;
-               end;
-     TActions = record
-                Count, Pos: Longword;
-                actions: array[0..Pred(MAXACTIONS)] of TAction;
-                Score: LongInt;
-                isWalkingToABetterPlace: boolean;
-                end;
+        Action: Longword;
+        X, Y, Param: LongInt;
+        Time: Longword;
+        end;
+        
+    TActions = record
+        Count, Pos: Longword;
+        actions: array[0..Pred(MAXACTIONS)] of TAction;
+        Score: LongInt;
+        isWalkingToABetterPlace: boolean;
+        end;
 
 procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt);
 procedure ProcessAction(var Actions: TActions; Me: PGear);
 
 implementation
-uses uAIMisc, uAI, uAmmos, uVariables, uCommands, uUtils, uDebug, uIO;
+uses uAIMisc, uAI, uAmmos, uVariables, uCommands, uUtils, uIO{$IFDEF TRACEAIACTIONS}, uConsole{$ENDIF};
+
+var PrevX: LongInt = 0;
+    timedelta: Longword = 0;
 
 const ActionIdToStr: array[0..7] of string[16] = (
 {aia_none}           '',
@@ -78,7 +84,7 @@ const ActionIdToStr: array[0..7] of string[16] = (
                      );
 
 {$IFDEF TRACEAIACTIONS}
-const SpecActionIdToStr: array[$8000..$8009] of string[16] = (
+const SpecActionIdToStr: array[$8000..$800C] of string[16] = (
 {aia_Weapon}             'aia_Weapon',
 {aia_WaitX}              'aia_WaitX',
 {aia_WaitY}              'aia_WaitY',
@@ -88,127 +94,173 @@ const SpecActionIdToStr: array[$8000..$8009] of string[16] = (
 {aia_HJump}              'aia_HJump',
 {aia_LJump}              'aia_LJump',
 {aia_Skip}               'aia_Skip',
-{aia_Wait}               'aia_Wait'
+{aia_Wait}               'aia_Wait',
+{aia_Put}                'aia_Put',
+{aia_waitAngle}          'aia_waitAngle',
+{aia_waitAmmoXY}         'aia_waitAmmoXY'
 );
 
 procedure DumpAction(Action: TAction; Me: PGear);
 begin
 if (Action.Action and ai_specmask) = 0 then
-   WriteLnToConsole('AI action: '+ActionIdToStr[Action.Action])
-else begin
-   WriteLnToConsole('AI action: '+SpecActionIdToStr[Action.Action]);
-   if (Action.Action = aia_WaitXL) or (Action.Action = aia_WaitXR) then
-      WriteLnToConsole('AI action Wait X = '+IntToStr(Action.Param)+', current X = '+IntToStr(hwRound(Me^.X)))
-   else if (Action.Action = aia_AwareExpl) then WriteLnToConsole('Aware X = ' + IntToStr(Action.X) + ', Y = ' + IntToStr(Action.Y));
-   end
+    WriteLnToConsole('AI action: '+ActionIdToStr[Action.Action])
+else
+    begin
+    WriteLnToConsole('AI action: '+SpecActionIdToStr[Action.Action]);
+    if (Action.Action = aia_WaitXL) or (Action.Action = aia_WaitXR) then
+        WriteLnToConsole('AI action Wait X = '+IntToStr(Action.Param)+', current X = '+IntToStr(hwRound(Me^.X)))
+        
+    else if (Action.Action = aia_AwareExpl) then
+        WriteLnToConsole('Aware X = ' + IntToStr(Action.X) + ', Y = ' + IntToStr(Action.Y));
+    end
 end;
 {$ENDIF}
 
 procedure AddAction(var Actions: TActions; Action: Longword; Param: LongInt; TimeDelta: Longword; X, Y: LongInt);
 begin
-with Actions do
-     begin
-     actions[Count].Action:= Action;
-     actions[Count].Param:= Param;
-     actions[Count].X:= X;
-     actions[Count].Y:= Y;
-     if Count > 0 then actions[Count].Time:= TimeDelta
-                  else actions[Count].Time:= GameTicks + TimeDelta;
-     inc(Count);
-     TryDo(Count < MAXACTIONS, 'AI: actions overflow', true);
-     end
+if Actions.Count < MAXACTIONS then
+    with Actions do
+        begin
+        actions[Count].Action:= Action;
+        actions[Count].Param:= Param;
+        actions[Count].X:= X;
+        actions[Count].Y:= Y;
+        if Count > 0 then
+            actions[Count].Time:= TimeDelta
+        else
+            actions[Count].Time:= GameTicks + TimeDelta;
+        inc(Count);
+        end
 end;
 
-procedure ProcessAction(var Actions: TActions; Me: PGear);
-var s: shortstring;
-
-    procedure CheckHang;
-    const PrevX: LongInt = 0;
-          timedelta: Longword = 0;
+procedure CheckHang(Me: PGear);
+begin
+if hwRound(Me^.X) <> PrevX then
     begin
-    if hwRound(Me^.X) <> PrevX then
-       begin
-       PrevX:= hwRound(Me^.X);
-       timedelta:= 0
-       end else
-       begin
-       inc(timedelta);
-       if timedelta > 1700 then
-          begin
-          timedelta:= 0;
-          FreeActionsList
-          end
-       end
-    end;
+    PrevX:= hwRound(Me^.X);
+    timedelta:= 0
+    end else
+        begin
+        inc(timedelta);
+        if timedelta > 1700 then
+            begin
+            timedelta:= 0;
+            FreeActionsList
+            end
+        end
+end;
 
+procedure ProcessAction(var Actions: TActions; Me: PGear);
+var s: shortstring;
 begin
 repeat
 if Actions.Pos >= Actions.Count then exit;
+
 with Actions.actions[Actions.Pos] do
-     begin
-     if Time > GameTicks then exit;
-     {$IFDEF TRACEAIACTIONS}
-     DumpAction(Actions.actions[Actions.Pos], Me);
-     {$ENDIF}
-     if (Action and ai_specmask) <> 0 then
+    begin
+    if Time > GameTicks then
+        exit;
+    {$IFDEF TRACEAIACTIONS}
+    DumpAction(Actions.actions[Actions.Pos], Me);
+    {$ENDIF}
+    if (Action and ai_specmask) <> 0 then
         case Action of
-           aia_Weapon: SetWeapon(TAmmoType(Param));
-           aia_WaitXL: if hwRound(Me^.X) = Param then
-                          begin
-                          Action:= aia_LookLeft;
-                          Time:= GameTicks;
-                          exit
-                          end
-                          else if hwRound(Me^.X) < Param then
-                               begin
-                               //OutError('AI: WaitXL assert (' + IntToStr(hwRound(Me^.X)) + ' < ' + IntToStr(Param) + ')', false);
-                               FreeActionsList;
-                               exit
-                               end
-                          else begin CheckHang; exit end;
-           aia_WaitXR: if hwRound(Me^.X) = Param then
-                          begin
-                          Action:= aia_LookRight;
-                          Time:= GameTicks;
-                          exit
-                          end
-                          else if hwRound(Me^.X) > Param then
-                               begin
-                               //OutError('AI: WaitXR assert (' + IntToStr(hwRound(Me^.X)) + ' > ' + IntToStr(Param) + ')', false);
-                               FreeActionsList;
-                               exit
-                               end
-                          else begin CheckHang; exit end;
-         aia_LookLeft: if not Me^.dX.isNegative then
-                          begin
-                          ParseCommand('+left', true);
-                          exit
-                          end else ParseCommand('-left', true);
-        aia_LookRight: if Me^.dX.isNegative then
-                          begin
-                          ParseCommand('+right', true);
-                          exit
-                          end else ParseCommand('-right', true);
-        aia_AwareExpl: AwareOfExplosion(X, Y, Param);
-            aia_HJump: ParseCommand('hjump', true);
-            aia_LJump: ParseCommand('ljump', true);
-             aia_Skip: ParseCommand('skip', true);
-              aia_Put: doPut(X, Y, true);
-             end else
-        begin
-        s:= ActionIdToStr[Action];
-        if (Param and ai_specmask) <> 0 then
-           case Param of
-             aim_push: s:= '+' + s;
-          aim_release: s:= '-' + s;
-             end
-          else if Param <> 0 then s:= s + ' ' + IntToStr(Param);
+            aia_Weapon: 
+                SetWeapon(TAmmoType(Param));
+            
+            aia_WaitXL: 
+                if hwRound(Me^.X) = Param then
+                    begin
+                    Action:= aia_LookLeft;
+                    Time:= GameTicks;
+                    exit
+                    end
+                    else if hwRound(Me^.X) < Param then
+                        begin
+                        //OutError('AI: WaitXL assert (' + IntToStr(hwRound(Me^.X)) + ' < ' + IntToStr(Param) + ')', false);
+                        FreeActionsList;
+                        exit
+                        end
+                    else
+                        begin 
+                        CheckHang(Me);
+                        exit
+                        end;
+                            
+            aia_WaitXR: 
+                if hwRound(Me^.X) = Param then
+                    begin
+                    Action:= aia_LookRight;
+                    Time:= GameTicks;
+                    exit
+                    end
+                    else if hwRound(Me^.X) > Param then
+                        begin
+                        //OutError('AI: WaitXR assert (' + IntToStr(hwRound(Me^.X)) + ' > ' + IntToStr(Param) + ')', false);
+                        FreeActionsList;
+                        exit
+                        end
+                    else
+                        begin 
+                        CheckHang(Me);
+                        exit
+                        end;
+            aia_LookLeft:
+                if not Me^.dX.isNegative then
+                    begin
+                    ParseCommand('+left', true);
+                    exit
+                    end
+                else
+                    ParseCommand('-left', true);
+            aia_LookRight:
+                if Me^.dX.isNegative then
+                    begin
+                    ParseCommand('+right', true);
+                    exit
+                    end
+                else ParseCommand('-right', true);
+            aia_AwareExpl:
+                AwareOfExplosion(X, Y, Param);
+            
+            aia_HJump:
+                ParseCommand('hjump', true);
+            
+            aia_LJump:
+                ParseCommand('ljump', true);
+            
+            aia_Skip:
+                ParseCommand('skip', true);
+            
+            aia_Put:
+                doPut(X, Y, true);
+                
+            aia_waitAngle:
+                if LongInt(Me^.Angle) <> Abs(Param) then exit;
+
+            aia_waitAmmoXY:
+                if (CurAmmoGear <> nil) and ((hwRound(CurAmmoGear^.X) <> X) or (hwRound(CurAmmoGear^.Y) <> Y)) then 
+                    exit;
+            end
+        else
+            begin
+            s:= ActionIdToStr[Action];
+            if (Param and ai_specmask) <> 0 then
+                case Param of
+                aim_push:
+                s:= '+' + s;
+                
+                aim_release:
+                s:= '-' + s;
+            end
+        else if Param <> 0 then
+            s:= s + ' ' + IntToStr(Param);
         ParseCommand(s, true)
         end
-     end;
+    end;
 inc(Actions.Pos);
 if Actions.Pos <= Actions.Count then
-   inc(Actions.actions[Actions.Pos].Time, GameTicks);
+    inc(Actions.actions[Actions.Pos].Time, GameTicks);
 until false
 end;
 
diff --git a/hedgewars/uAIAmmoTests.pas b/hedgewars/uAIAmmoTests.pas
index 1ec2f7b..9e74d22 100644
--- a/hedgewars/uAIAmmoTests.pas
+++ b/hedgewars/uAIAmmoTests.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,14 +21,18 @@
 unit uAIAmmoTests;
 interface
 uses SDLh, uConsts, uFloat, uTypes;
-const amtest_OnTurn = $00000001;
+const 
+    amtest_Rare     = $00000001; // check only several positions
+    amtest_NoTarget = $00000002; // each pos, but no targetting
+
+var windSpeed: real;
 
 type TAttackParams = record
-            Time: Longword;
-            Angle, Power: LongInt;
-            ExplX, ExplY, ExplR: LongInt;
-            AttackPutX, AttackPutY: LongInt;
-            end;
+        Time: Longword;
+        Angle, Power: LongInt;
+        ExplX, ExplY, ExplR: LongInt;
+        AttackPutX, AttackPutY: LongInt;
+        end;
 
 function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestSnowball(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
@@ -39,11 +43,15 @@ function TestWatermelon(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttack
 function TestMortar(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+function TestSniperRifle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+function TestWhip(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+function TestKamikaze(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestTeleport(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 function TestHammer(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+function TestCake(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 
 type TAmmoTestProc = function (Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
     TAmmoTest = record
@@ -65,11 +73,11 @@ const AmmoTests: array[TAmmoType] of TAmmoTest =
             (proc: nil;              flags: 0), // amMine
             (proc: @TestDesertEagle; flags: 0), // amDEagle
             (proc: nil;              flags: 0), // amDynamite
-            (proc: @TestFirePunch;   flags: 0), // amFirePunch
-            (proc: @TestFirePunch;   flags: 0), // amWhip
-            (proc: @TestBaseballBat; flags: 0), // amBaseballBat
+            (proc: @TestFirePunch;   flags: amtest_NoTarget), // amFirePunch
+            (proc: @TestWhip;        flags: amtest_NoTarget), // amWhip
+            (proc: @TestBaseballBat; flags: amtest_NoTarget), // amBaseballBat
             (proc: nil;              flags: 0), // amParachute
-            (proc: @TestAirAttack;   flags: amtest_OnTurn), // amAirAttack
+            (proc: @TestAirAttack;   flags: amtest_Rare), // amAirAttack
             (proc: nil;              flags: 0), // amMineStrike
             (proc: nil;              flags: 0), // amBlowTorch
             (proc: nil;              flags: 0), // amGirder
@@ -77,8 +85,8 @@ const AmmoTests: array[TAmmoType] of TAmmoTest =
             //(proc: @TestTeleport;    flags: amtest_OnTurn), // amTeleport
             (proc: nil;              flags: 0), // amSwitch
             (proc: @TestMortar;      flags: 0), // amMortar
-            (proc: nil;              flags: 0), // amKamikaze
-            (proc: nil;              flags: 0), // amCake
+            (proc: @TestKamikaze;    flags: 0), // amKamikaze
+            (proc: @TestCake;        flags: amtest_Rare or amtest_NoTarget), // amCake
             (proc: nil;              flags: 0), // amSeduction
             (proc: @TestWatermelon;  flags: 0), // amWatermelon
             (proc: nil;              flags: 0), // amHellishBomb
@@ -92,7 +100,7 @@ const AmmoTests: array[TAmmoType] of TAmmoTest =
             (proc: nil;              flags: 0), // amExtraTime
             (proc: nil;              flags: 0), // amLaserSight
             (proc: nil;              flags: 0), // amVampiric
-            (proc: nil;              flags: 0), // amSniperRifle
+            (proc: @TestSniperRifle; flags: 0), // amSniperRifle
             (proc: nil;              flags: 0), // amJetpack
             (proc: @TestMolotov;     flags: 0), // amMolotov
             (proc: nil;              flags: 0), // amBirdy
@@ -102,19 +110,21 @@ const AmmoTests: array[TAmmoType] of TAmmoTest =
             (proc: @TestShotgun;     flags: 0), // amSineGun
             (proc: nil;              flags: 0), // amFlamethrower
             (proc: @TestGrenade;     flags: 0), // amSMine
-            (proc: @TestHammer;      flags: 0), // amHammer
+            (proc: @TestHammer;      flags: amtest_NoTarget), // amHammer
             (proc: nil;              flags: 0), // amResurrector
             (proc: nil;              flags: 0), // amDrillStrike
             (proc: nil;              flags: 0), // amSnowball
             (proc: nil;              flags: 0), // amTardis
             (proc: nil;              flags: 0), // amStructure
-            (proc: nil;              flags: 0) // amLandGun
+            (proc: nil;              flags: 0), // amLandGun
+            (proc: nil;              flags: 0), // amIceGun
+            (proc: nil;              flags: 0)  // amKnife
             );
 
 const BadTurn = Low(LongInt) div 4;
 
 implementation
-uses uAIMisc, uVariables, uUtils;
+uses uAIMisc, uVariables, uUtils, uGearsHandlers;
 
 function Metric(x1, y1, x2, y2: LongInt): LongInt; inline;
 begin
@@ -124,33 +134,11 @@ end;
 function TestBazooka(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 var Vx, Vy, r, mX, mY: real;
     rTime: LongInt;
-    Score, EX, EY: LongInt;
+    EX, EY: LongInt;
     valueResult: LongInt;
-
-    function CheckTrace: LongInt;
-    var x, y, dX, dY: real;
-        t: LongInt;
-        value: LongInt;
-    begin
-    x:= mX;
-    y:= mY;
-    dX:= Vx;
-    dY:= -Vy;
-    t:= rTime;
-    repeat
-      x:= x + dX;
-      y:= y + dY;
-      dX:= dX + cWindSpeedf;
-      dY:= dY + cGravityf;
-      dec(t)
-    until TestCollExcludingMe(Me, trunc(x), trunc(y), 5) or (t <= 0);
-    EX:= trunc(x);
-    EY:= trunc(y);
-    value:= RateExplosion(Me, EX, EY, 101);
-    if value = 0 then value:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
-    CheckTrace:= value;
-    end;
-
+    x, y, dX, dY: real;
+    t: LongInt;
+    value: LongInt;
 begin
 mX:= hwFloat2Float(Me^.X);
 mY:= hwFloat2Float(Me^.Y);
@@ -159,533 +147,825 @@ rTime:= 350;
 ap.ExplR:= 0;
 valueResult:= BadTurn;
 repeat
-  rTime:= rTime + 300 + Level * 50 + random(300);
-  Vx:= - cWindSpeedf * rTime * 0.5 + (Targ.X + AIrndSign(2) - mX) / rTime;
-  Vy:= cGravityf * rTime * 0.5 - (Targ.Y - mY) / rTime;
-  r:= sqrt(sqr(Vx) + sqr(Vy));
-  if not (r > 1) then
-     begin
-     Score:= CheckTrace;
-     if valueResult <= Score then
+    rTime:= rTime + 300 + Level * 50 + random(300);
+    Vx:= - windSpeed * rTime * 0.5 + (Targ.X + AIrndSign(2) - mX) / rTime;
+    Vy:= cGravityf * rTime * 0.5 - (Targ.Y - mY) / rTime;
+    r:= sqr(Vx) + sqr(Vy);
+    if not (r > 1) then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
-        ap.Power:= trunc(r * cMaxPower) - random((Level - 1) * 17 + 1);
-        ap.ExplR:= 100;
-        ap.ExplX:= EX;
-        ap.ExplY:= EY;
-        valueResult:= Score
-        end;
-     end
-until (rTime > 4250);
+        x:= mX;
+        y:= mY;
+        dX:= Vx;
+        dY:= -Vy;
+        t:= rTime;
+        repeat
+            x:= x + dX;
+            y:= y + dY;
+            dX:= dX + windSpeed;
+            dY:= dY + cGravityf;
+            dec(t)
+        until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or 
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0);
+        
+        EX:= trunc(x);
+        EY:= trunc(y);
+        if Level = 1 then
+            value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
+        else value:= RateExplosion(Me, EX, EY, 101);
+        if value = 0 then
+            value:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
+        if valueResult <= value then
+            begin
+            ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
+            ap.Power:= trunc(sqrt(r) * cMaxPower) - random((Level - 1) * 17 + 1);
+            ap.ExplR:= 100;
+            ap.ExplX:= EX;
+            ap.ExplY:= EY;
+            valueResult:= value
+            end;
+        end
+//until (value > 204800) or (rTime > 4250); not so useful since adding score to the drowning
+until rTime > 4250;
 TestBazooka:= valueResult
 end;
 
 function TestSnowball(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-var Vx, Vy, r: hwFloat;
+var Vx, Vy, r: real;
     rTime: LongInt;
-    Score, EX, EY: LongInt;
+    EX, EY: LongInt;
     valueResult: LongInt;
-
-    function CheckTrace: LongInt;
-    var x, y, dX, dY: hwFloat;
-        t: LongInt;
-        value: LongInt;
-    begin
-    x:= Me^.X;
-    y:= Me^.Y;
-    dX:= Vx;
-    dY:= -Vy;
-    t:= rTime;
-    repeat
-      x:= x + dX;
-      y:= y + dY;
-      dX:= dX + cWindSpeed;
-      dY:= dY + cGravity;
-      dec(t)
-    until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t <= 0);
-    EX:= hwRound(x);
-    EY:= hwRound(y);
-    value:= RateExplosion(Me, EX, EY, 5);
-    if value = 0 then value:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
-    CheckTrace:= value;
-    end;
+    x, y, dX, dY, meX, meY: real;
+    t: LongInt;
+    value: LongInt;
 
 begin
+meX:= hwFloat2Float(Me^.X);
+meY:= hwFloat2Float(Me^.Y);
 ap.Time:= 0;
 rTime:= 350;
 ap.ExplR:= 0;
 valueResult:= BadTurn;
 repeat
-  rTime:= rTime + 300 + Level * 50 + random(300);
-  Vx:= - cWindSpeed * rTime * _0_5 + (int2hwFloat(Targ.X + AIrndSign(2)) - Me^.X) / int2hwFloat(rTime);
-  Vy:= cGravity * rTime * _0_5 - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(rTime);
-  r:= Distance(Vx, Vy);
-  if not (r > _1) then
-     begin
-     Score:= CheckTrace;
-     if valueResult <= Score then
+    rTime:= rTime + 300 + Level * 50 + random(1000);
+    Vx:= - windSpeed * rTime * 0.5 + ((Targ.X + AIrndSign(2)) - meX) / rTime;
+    Vy:= cGravityf * rTime * 0.5 - (Targ.Y - meY) / rTime;
+    r:= sqr(Vx) + sqr(Vy);
+    if not (r > 1) then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
-        ap.Power:= hwRound(r * cMaxPower) - random((Level - 1) * 17 + 1);
-        ap.ExplR:= 100;
-        ap.ExplX:= EX;
-        ap.ExplY:= EY;
-        valueResult:= Score
-        end;
+        x:= meX;
+        y:= meY;
+        dX:= Vx;
+        dY:= -Vy;
+        t:= rTime;
+        repeat
+            x:= x + dX;
+            y:= y + dY;
+            dX:= dX + windSpeed;
+            dY:= dY + cGravityf;
+            dec(t)
+        until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or 
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t <= 0);
+        EX:= trunc(x);
+        EY:= trunc(y);
+
+        value:= RateShove(trunc(x), trunc(y), 5, 1, trunc((abs(dX)+abs(dY))*20), -dX, -dY, afTrackFall);
+        if value = 0 then
+            value:= - Metric(Targ.X, Targ.Y, EX, EY) div 64;
+
+        if valueResult <= value then
+            begin
+            ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
+            ap.Power:= trunc(sqrt(r) * cMaxPower) - random((Level - 1) * 17 + 1);
+            ap.ExplR:= 0;
+            ap.ExplX:= EX;
+            ap.ExplY:= EY;
+            valueResult:= value
+            end;
      end
 until (rTime > 4250);
 TestSnowball:= valueResult
 end;
 
 function TestMolotov(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-var Vx, Vy, r: hwFloat;
+var Vx, Vy, r: real;
     Score, EX, EY, valueResult: LongInt;
     TestTime: Longword;
-
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        t: LongInt;
-    begin
-    x:= Me^.X;
-    y:= Me^.Y;
-    dY:= -Vy;
-    t:= TestTime;
-    repeat
-      x:= x + Vx;
-      y:= y + dY;
-      dY:= dY + cGravity;
-      dec(t)
-    until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 7) or (t = 0);
-    EX:= hwRound(x);
-    EY:= hwRound(y);
-    if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 97)  // average of 17 attempts, most good, but some failing spectacularly
-              else CheckTrace:= BadTurn
-    end;
+    x, y, dY, meX, meY: real;
+    t: LongInt;
 begin
+meX:= hwFloat2Float(Me^.X);
+meY:= hwFloat2Float(Me^.Y);
 valueResult:= BadTurn;
 TestTime:= 0;
 ap.ExplR:= 0;
 repeat
-  inc(TestTime, 300);
-  Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime);
-  Vy:= cGravity * (TestTime div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime);
-  r:= Distance(Vx, Vy);
-  if not (r > _1) then
-     begin
-     Score:= CheckTrace;
-     if valueResult < Score then
+    inc(TestTime, 300);
+    Vx:= (Targ.X - meX) / TestTime;
+    Vy:= cGravityf * (TestTime div 2) - Targ.Y - meY / TestTime;
+    r:= sqr(Vx) + sqr(Vy);
+    if not (r > 1) then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
-        ap.Power:= hwRound(r * cMaxPower) + AIrndSign(random(Level) * 15);
-        ap.Time:= TestTime;
-        ap.ExplR:= 100;
-        ap.ExplX:= EX;
-        ap.ExplY:= EY;
-        valueResult:= Score
-        end;
-     end
+        x:= meX;
+        y:= meY;
+        dY:= -Vy;
+        t:= TestTime;
+        repeat
+            x:= x + Vx;
+            y:= y + dY;
+            dY:= dY + cGravityf;
+            dec(t)
+        until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or 
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0);
+        EX:= trunc(x);
+        EY:= trunc(y);
+        if t < 50 then
+            Score:= RateExplosion(Me, EX, EY, 97)  // average of 17 attempts, most good, but some failing spectacularly
+        else
+            Score:= BadTurn;
+                  
+        if valueResult < Score then
+            begin
+            ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level));
+            ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15);
+            ap.ExplR:= 100;
+            ap.ExplX:= EX;
+            ap.ExplY:= EY;
+            valueResult:= Score
+            end;
+        end
 until (TestTime > 4250);
 TestMolotov:= valueResult
 end;
 
 function TestGrenade(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 const tDelta = 24;
-var Vx, Vy, r: hwFloat;
+var Vx, Vy, r: real;
     Score, EX, EY, valueResult: LongInt;
     TestTime: Longword;
-
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        t: LongInt;
-    begin
-    x:= Me^.X;
-    y:= Me^.Y;
-    dY:= -Vy;
-    t:= TestTime;
-    repeat
-      x:= x + Vx;
-      y:= y + dY;
-      dY:= dY + cGravity;
-      dec(t)
-    until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t = 0);
-    EX:= hwRound(x);
-    EY:= hwRound(y);
-    if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 101)
-              else CheckTrace:= BadTurn
-    end;
+    x, y, meX, meY, dY: real;
+    t: LongInt;
 begin
 valueResult:= BadTurn;
 TestTime:= 0;
 ap.ExplR:= 0;
+meX:= hwFloat2Float(Me^.X);
+meY:= hwFloat2Float(Me^.Y);
 repeat
-  inc(TestTime, 1000);
-  Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime + tDelta);
-  Vy:= cGravity * ((TestTime + tDelta) div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime + tDelta);
-  r:= Distance(Vx, Vy);
-  if not (r > _1) then
-     begin
-     Score:= CheckTrace;
-     if valueResult < Score then
+    inc(TestTime, 1000);
+    Vx:= (Targ.X - meX) / (TestTime + tDelta);
+    Vy:= cGravityf * ((TestTime + tDelta) div 2) - (Targ.Y - meY) / (TestTime + tDelta);
+    r:= sqr(Vx) + sqr(Vy);
+    if not (r > 1) then
+        begin
+        x:= meX;
+        y:= meY; 
+        dY:= -Vy;
+        t:= TestTime;
+        repeat
+            x:= x + Vx;
+            y:= y + dY;
+            dY:= dY + cGravityf;
+            dec(t)
+        until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or 
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0);
+    EX:= trunc(x);
+    EY:= trunc(y);
+    if t < 50 then 
+        if Level = 1 then
+            Score:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
+        else Score:= RateExplosion(Me, EX, EY, 101)
+    else 
+        Score:= BadTurn;
+
+    if valueResult < Score then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
-        ap.Power:= hwRound(r * cMaxPower) + AIrndSign(random(Level) * 15);
+        ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level));
+        ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15);
         ap.Time:= TestTime;
         ap.ExplR:= 100;
         ap.ExplX:= EX;
         ap.ExplY:= EY;
         valueResult:= Score
         end;
-     end
-until (TestTime = 4000);
+    end
+//until (Score > 204800) or (TestTime > 4000);
+until TestTime > 4000;
 TestGrenade:= valueResult
 end;
 
 function TestClusterBomb(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 const tDelta = 24;
-var Vx, Vy, r: hwFloat;
+var Vx, Vy, r: real;
     Score, EX, EY, valueResult: LongInt;
     TestTime: Longword;
-
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        t: LongInt;
-    begin
-    x:= Me^.X;
-    y:= Me^.Y;
-    dY:= -Vy;
-    t:= TestTime;
-    repeat
-      x:= x + Vx;
-      y:= y + dY;
-      dY:= dY + cGravity;
-      dec(t)
-    until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t = 0);
-    EX:= hwRound(x);
-    EY:= hwRound(y);
-    if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 41)
-              else CheckTrace:= BadTurn
-    end;
+    x, y, dY, meX, meY: real;
+    t: LongInt;
 begin
 valueResult:= BadTurn;
-TestTime:= 0;
+TestTime:= 500;
 ap.ExplR:= 0;
+meX:= hwFloat2Float(Me^.X);
+meY:= hwFloat2Float(Me^.Y);
 repeat
-  inc(TestTime, 1000);
-  // Try to overshoot slightly, seems to pay slightly better dividends in terms of hitting cluster
-  if Me^.X<int2hwFloat(Targ.X) then
-      Vx:= (int2hwFloat(Targ.X+10) - Me^.X) / int2hwFloat(TestTime + tDelta)
-  else
-      Vx:= (int2hwFloat(Targ.X-10) - Me^.X) / int2hwFloat(TestTime + tDelta);
-  Vy:= cGravity * ((TestTime + tDelta) div 2) - (int2hwFloat(Targ.Y-150) - Me^.Y) / int2hwFloat(TestTime + tDelta);
-  r:= Distance(Vx, Vy);
-  if not (r > _1) then
-     begin
-     Score:= CheckTrace;
+    inc(TestTime, 900);
+    // Try to overshoot slightly, seems to pay slightly better dividends in terms of hitting cluster
+    if meX<Targ.X then
+        Vx:= ((Targ.X+10) - meX) / (TestTime + tDelta)
+    else
+        Vx:= ((Targ.X-10) - meX) / (TestTime + tDelta);
+    Vy:= cGravityf * ((TestTime + tDelta) div 2) - ((Targ.Y-50) - meY) / (TestTime + tDelta);
+    r:= sqr(Vx)+sqr(Vy);
+    if not (r > 1) then
+        begin
+        x:= meX;
+        y:= meY;
+        dY:= -Vy;
+        t:= TestTime;
+    repeat
+        x:= x + Vx;
+        y:= y + dY;
+        dY:= dY + cGravityf;
+        dec(t)
+    until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 5)) or 
+           ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 5))) or (t = 0);
+    EX:= trunc(x);
+    EY:= trunc(y);
+    if t < 50 then 
+        Score:= RateExplosion(Me, EX, EY, 41)
+    else 
+        Score:= BadTurn;
+
      if valueResult < Score then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
-        ap.Power:= hwRound(r * cMaxPower * _0_9) + AIrndSign(random(Level) * 15);
-        ap.Time:= TestTime;
+        ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level));
+        ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15);
+        ap.Time:= TestTime div 1000 * 1000;
         ap.ExplR:= 90;
         ap.ExplX:= EX;
         ap.ExplY:= EY;
         valueResult:= Score
         end;
      end
-until (TestTime = 4000);
+until (TestTime = 4100);
 TestClusterBomb:= valueResult
 end;
 
 function TestWatermelon(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 const tDelta = 24;
-var Vx, Vy, r: hwFloat;
+var Vx, Vy, r: real;
     Score, EX, EY, valueResult: LongInt;
     TestTime: Longword;
-
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        t: LongInt;
-    begin
-    x:= Me^.X;
-    y:= Me^.Y;
-    dY:= -Vy;
-    t:= TestTime;
-    repeat
-      x:= x + Vx;
-      y:= y + dY;
-      dY:= dY + cGravity;
-      dec(t)
-    until TestCollExcludingMe(Me, hwRound(x), hwRound(y), 5) or (t = 0);
-    EX:= hwRound(x);
-    EY:= hwRound(y);
-    if t < 50 then CheckTrace:= RateExplosion(Me, EX, EY, 381)
-              else CheckTrace:= BadTurn
-    end;
+    x, y, dY, meX, meY: real;
+    t: LongInt;
 begin
 valueResult:= BadTurn;
-TestTime:= 0;
+TestTime:= 500;
 ap.ExplR:= 0;
+meX:= hwFloat2Float(Me^.X);
+meY:= hwFloat2Float(Me^.Y);
 repeat
-  inc(TestTime, 1000);
-  Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime + tDelta);
-  Vy:= cGravity * ((TestTime + tDelta) div 2) - (int2hwFloat(Targ.Y-200) - Me^.Y) / int2hwFloat(TestTime + tDelta);
-  r:= Distance(Vx, Vy);
-  if not (r > _1) then
-     begin
-     Score:= CheckTrace;
-     if valueResult < Score then
+    inc(TestTime, 900);
+    Vx:= (Targ.X - meX) / (TestTime + tDelta);
+    Vy:= cGravityf * ((TestTime + tDelta) div 2) - ((Targ.Y-50) - meY) / (TestTime + tDelta);
+    r:= sqr(Vx)+sqr(Vy);
+    if not (r > 1) then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
-        ap.Power:= hwRound(r * cMaxPower * _0_9) + AIrndSign(random(Level) * 15);
-        ap.Time:= TestTime;
-        ap.ExplR:= 300;
-        ap.ExplX:= EX;
-        ap.ExplY:= EY;
-        valueResult:= Score
-        end;
-     end
-until (TestTime = 4000);
-TestWatermelon:= valueResult
-end;
-
-function TestMortar(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-//const tDelta = 24;
-var Vx, Vy: hwFloat;
-    Score, EX, EY, valueResult: LongInt;
-    TestTime: Longword;
-
-    function CheckTrace: LongInt;
-    var x, y, dY: hwFloat;
-        value: LongInt;
-    begin
-        x:= Me^.X;
-        y:= Me^.Y;
+        x:= meX;
+        y:= meY;
         dY:= -Vy;
-
+        t:= TestTime;
         repeat
             x:= x + Vx;
             y:= y + dY;
-            dY:= dY + cGravity;
-            EX:= hwRound(x);
-            EY:= hwRound(y);
-        until TestCollExcludingMe(Me, EX, EY, 5) or (EY > cWaterLine);
-
-        if (EY < cWaterLine) and not dY.isNegative then
+            dY:= dY + cGravityf;
+            dec(t)
+       until (((Me = CurrentHedgehog^.Gear) and TestColl(trunc(x), trunc(y), 6)) or 
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, trunc(x), trunc(y), 6))) or (t = 0);
+        
+        EX:= trunc(x);
+        EY:= trunc(y);
+        if t < 50 then 
+            Score:= RateExplosion(Me, EX, EY, 200) + RateExplosion(Me, EX, EY + 120, 200)
+        else 
+            Score:= BadTurn;
+            
+        if valueResult < Score then
             begin
-            value:= RateExplosion(Me, EX, EY, 91);
-            if (value = 0) then
-                if (dY > _0_15) then
-                    value:= - abs(Targ.Y - EY) div 32
-                else
-                    value:= BadTurn
-            else if (value < 0) then value:= BadTurn
-            end
-        else
-            value:= BadTurn;
+            ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level));
+            ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15);
+            ap.Time:= TestTime div 1000 * 1000;
+            ap.ExplR:= 300;
+            ap.ExplX:= EX;
+            ap.ExplY:= EY;
+            valueResult:= Score
+            end;
+        end
+until (TestTime = 4100);
+TestWatermelon:= valueResult
+end;
 
-        CheckTrace:= value;
-    end;
 
-    function Solve: LongWord;
-    var A, B, D, T: hwFloat;
+    function Solve(TX, TY, MX, MY: LongInt): LongWord;
+    var A, B, D, T: real;
         C: LongInt;
     begin
-        A:= hwSqr(cGravity) * _0_25;
-        B:= - cGravity * (Targ.Y - hwRound(Me^.Y)) - _1;
-        C:= sqr(Targ.Y - hwRound(Me^.Y)) + sqr(Targ.X - hwRound(Me^.X));
-        D:= hwSqr(B) - (A * C * 4);
-        if D.isNegative = false then
+        A:= sqr(cGravityf);
+        B:= - cGravityf * (TY - MY) - 1;
+        C:= sqr(TY - MY) + sqr(TX - MX);
+        D:= sqr(B) - A * C;
+        if D >= 0 then
             begin
-            D:= ( - B + hwSqrt(D)) * _0_5 / A;
-            if D.isNegative = false then
-                T:= hwSqrt(D)
+            D:= sqrt(D) - B;
+            if D >= 0 then
+                T:= sqrt(D * 2 / A)
             else
-                T:= _0;
-            Solve:= hwRound(T)
-            end else Solve:= 0
+                T:= 0;
+            Solve:= trunc(T)
+            end
+            else
+                Solve:= 0
     end;
-
+    
+function TestMortar(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+//const tDelta = 24;
+var Vx, Vy: real;
+    Score, EX, EY: LongInt;
+    TestTime: Longword;
+    x, y, dY, meX, meY: real;
 begin
-valueResult:= BadTurn;
-ap.ExplR:= 0;
+    TestMortar:= BadTurn;
+    ap.ExplR:= 0;
 
-if (Level > 2) then exit(BadTurn);
+    meX:= hwFloat2Float(Me^.X);
+    meY:= hwFloat2Float(Me^.Y);
 
-TestTime:= Solve;
+    if (Level > 2) then
+        exit(BadTurn);
 
-if TestTime = 0 then exit(BadTurn);
+    TestTime:= Solve(Targ.X, Targ.Y, trunc(meX), trunc(meY));
 
-    Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime);
-    Vy:= cGravity * (TestTime div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime);
+    if TestTime = 0 then
+        exit(BadTurn);
 
-    Score:= CheckTrace;
-    if valueResult < Score then
+    Vx:= (Targ.X - meX) / TestTime;
+    Vy:= cGravityf * (TestTime div 2) - (Targ.Y - meY) / TestTime;
+
+    x:= meX;
+    y:= meY;
+    dY:= -Vy;
+
+    repeat
+        x:= x + Vx;
+        y:= y + dY;
+        dY:= dY + cGravityf;
+        EX:= trunc(x);
+        EY:= trunc(y);
+    until (((Me = CurrentHedgehog^.Gear) and TestColl(EX, EY, 4)) or 
+           ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, EX, EY, 4))) or (EY > cWaterLine);
+
+    if (EY < cWaterLine) and (dY >= 0) then
         begin
-        ap.Angle:= DxDy2AttackAngle(Vx, Vy) + AIrndSign(random(Level));
+        Score:= RateExplosion(Me, EX, EY, 91);
+        if (Score = 0) then
+            if (dY > 0.15) then
+                Score:= - abs(Targ.Y - EY) div 32
+            else
+                Score:= BadTurn
+        else if (Score < 0) then
+            Score:= BadTurn
+        end
+    else
+        Score:= BadTurn;
+
+    if BadTurn < Score then
+        begin
+        ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level));
         ap.Power:= 1;
         ap.ExplR:= 100;
         ap.ExplX:= EX;
         ap.ExplY:= EY;
-        valueResult:= Score
+        TestMortar:= Score
         end;
-
-TestMortar:= valueResult;
 end;
 
 function TestShotgun(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 const
-  MIN_RANGE =  80;
-  MAX_RANGE = 400;
-var Vx, Vy, x, y: hwFloat;
+    MIN_RANGE =  80;
+    MAX_RANGE = 400;
+var Vx, Vy, x, y: real;
     rx, ry, valueResult: LongInt;
     range: integer;
 begin
+TestShotgun:= BadTurn;
 ap.ExplR:= 0;
 ap.Time:= 0;
 ap.Power:= 1;
-x:= Me^.X;
-y:= Me^.Y;
-range:= Metric(hwRound(x), hwRound(y), Targ.X, Targ.Y);
-if ( range < MIN_RANGE ) or ( range > MAX_RANGE ) then exit(BadTurn);
-Vx:= (int2hwFloat(Targ.X) - x) * _1div1024;
-Vy:= (int2hwFloat(Targ.Y) - y) * _1div1024;
-ap.Angle:= DxDy2AttackAngle(Vx, -Vy);
+x:= hwFloat2Float(Me^.X);
+y:= hwFloat2Float(Me^.Y);
+range:= Metric(trunc(x), trunc(y), Targ.X, Targ.Y);
+if ( range < MIN_RANGE ) or ( range > MAX_RANGE ) then
+    exit(BadTurn);
+
+Vx:= (Targ.X - x) * 1 / 1024;
+Vy:= (Targ.Y - y) * 1 / 1024;
+ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
 repeat
-  x:= x + vX;
-  y:= y + vY;
-  rx:= hwRound(x);
-  ry:= hwRound(y);
-  if TestCollExcludingMe(Me, rx, ry, 2) then
-     begin
-     x:= x + vX * 8;
-     y:= y + vY * 8;
-     valueResult:= RateShotgun(Me, rx, ry);
+    x:= x + vX;
+    y:= y + vY;
+    rx:= trunc(x);
+    ry:= trunc(y);
+    if ((Me = CurrentHedgehog^.Gear) and TestColl(rx, ry, 2)) or 
+        ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me, rx, ry, 2)) then
+    begin
+        x:= x + vX * 8;
+        y:= y + vY * 8;
+        valueResult:= RateShotgun(Me, vX, vY, rx, ry);
      
-     if valueResult = 0 then 
-        valueResult:= - Metric(Targ.X, Targ.Y, rx, ry) div 64
+        if valueResult = 0 then 
+            valueResult:= - Metric(Targ.X, Targ.Y, rx, ry) div 64
         else 
-        dec(valueResult, Level * 4000);
-     exit(valueResult * 27 div 20) // 27/20 is reuse bonus
-     end
-until (Abs(Targ.X - hwRound(x)) + Abs(Targ.Y - hwRound(y)) < 4)
-    or (x.isNegative)
-    or (y.isNegative)
-    or (x.Round > LongWord(LAND_WIDTH))
-    or (y.Round > LongWord(LAND_HEIGHT));
+            dec(valueResult, Level * 4000);
+        // 27/20 is reuse bonus
+        exit(valueResult * 27 div 20)
+    end
+until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4)
+    or (x < 0)
+    or (y < 0)
+    or (trunc(x) > LAND_WIDTH)
+    or (trunc(y) > LAND_HEIGHT);
 
 TestShotgun:= BadTurn
 end;
 
 function TestDesertEagle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-var Vx, Vy, x, y, t: hwFloat;
+var Vx, Vy, x, y, t, dmgMod: real;
     d: Longword;
-    valueResult: LongInt;
+    fallDmg, valueResult: LongInt;
 begin
+if Level > 4 then exit(BadTurn);
+dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
 Level:= Level; // avoid compiler hint
 ap.ExplR:= 0;
 ap.Time:= 0;
 ap.Power:= 1;
-x:= Me^.X;
-y:= Me^.Y;
-if Abs(hwRound(Me^.X) - Targ.X) + Abs(hwRound(Me^.Y) - Targ.Y) < 80 then
-   exit(BadTurn);
-t:= _0_5 / Distance(int2hwFloat(Targ.X) - x, int2hwFloat(Targ.Y) - y);
-Vx:= (int2hwFloat(Targ.X) - x) * t;
-Vy:= (int2hwFloat(Targ.Y) - y) * t;
-ap.Angle:= DxDy2AttackAngle(Vx, -Vy);
+
+x:= hwFloat2Float(Me^.X);
+y:= hwFloat2Float(Me^.Y);
+
+if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 20 then
+    exit(BadTurn);
+
+t:= 2 / sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y));
+Vx:= (Targ.X - x) * t;
+Vy:= (Targ.Y - y) * t;
+ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
 d:= 0;
 
 repeat
-  x:= x + vX;
-  y:= y + vY;
-  if ((hwRound(x) and LAND_WIDTH_MASK) = 0)and((hwRound(y) and LAND_HEIGHT_MASK) = 0)
-     and (Land[hwRound(y), hwRound(x)] <> 0) then inc(d);
-until (Abs(Targ.X - hwRound(x)) + Abs(Targ.Y - hwRound(y)) < 4)
-    or (x.isNegative)
-    or (y.isNegative)
-    or (x.Round > LongWord(LAND_WIDTH))
-    or (y.Round > LongWord(LAND_HEIGHT))
-    or (d > 200);
-
-if Abs(Targ.X - hwRound(x)) + Abs(Targ.Y - hwRound(y)) < 3 then valueResult:= Max(0, (4 - d div 50) * 7 * 1024)
-                                                           else valueResult:= BadTurn;
+    x:= x + vX;
+    y:= y + vY;
+    if ((trunc(x) and LAND_WIDTH_MASK) = 0)and((trunc(y) and LAND_HEIGHT_MASK) = 0)
+    and (Land[trunc(y), trunc(x)] <> 0) then
+        inc(d);
+until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 5)
+    or (x < 0)
+    or (y < 0)
+    or (trunc(x) > LAND_WIDTH)
+    or (trunc(y) > LAND_HEIGHT)
+    or (d > 48);
+
+if Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 5 then
+    begin
+    fallDmg:= TraceShoveFall(Targ.X, Targ.Y, vX * 0.00125 * 20, vY * 0.00125 * 20);
+    if fallDmg < 0 then
+        valueResult:= 204800
+    else valueResult:= Max(0, (4 - d div 12) * trunc((7 + fallDmg) * dmgMod) * 1024)
+    end
+else
+    valueResult:= BadTurn;
 TestDesertEagle:= valueResult
 end;
 
-function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-var valueResult: LongInt;
-    x, y: hwFloat;
+
+function TestSniperRifle(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+var Vx, Vy, x, y, t, dmg, dmgMod: real;
+    d: Longword;
+    fallDmg: LongInt;
 begin
+if Level > 3 then exit(BadTurn);
+dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
 Level:= Level; // avoid compiler hint
 ap.ExplR:= 0;
-if (Level > 2) or (Abs(hwRound(Me^.X) - Targ.X) + Abs(hwRound(Me^.Y) - Targ.Y) > 25) then
-   exit(BadTurn);
-
 ap.Time:= 0;
 ap.Power:= 1;
-x:= Me^.X;
-y:= Me^.Y;
-if (Targ.X) - hwRound(x) >= 0 then ap.Angle:=   cMaxAngle div 4
-                              else ap.Angle:= - cMaxAngle div 4;
-valueResult:= RateShove(Me, hwRound(x) + 10 * hwSign(int2hwFloat(Targ.X) - x), hwRound(y), 15, 30);
-if valueResult <= 0 then valueResult:= BadTurn else inc(valueResult);
-TestBaseballBat:= valueResult;
+x:= hwFloat2Float(Me^.X);
+y:= hwFloat2Float(Me^.Y);
+if Abs(trunc(x) - Targ.X) + Abs(trunc(y) - Targ.Y) < 40 then
+    exit(BadTurn);
+
+dmg:= sqrt(sqr(Targ.X - x)+sqr(Targ.Y-y));
+t:= 1.5 / dmg;
+dmg:= dmg * 0.025; // div 40
+Vx:= (Targ.X - x) * t;
+Vy:= (Targ.Y - y) * t;
+ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
+d:= 0;
+
+repeat
+    x:= x + vX;
+    y:= y + vY;
+    if ((trunc(x) and LAND_WIDTH_MASK) = 0)and((trunc(y) and LAND_HEIGHT_MASK) = 0)
+    and (Land[trunc(y), trunc(x)] <> 0) then
+        inc(d);
+until (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4)
+    or (x < 0)
+    or (y < 0)
+    or (trunc(x) > LAND_WIDTH)
+    or (trunc(y) > LAND_HEIGHT)
+    or (d > 22);
+
+if Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) < 4 then
+    begin
+    fallDmg:= TraceShoveFall(Targ.X, Targ.Y, vX * 0.00166 * dmg, vY * 0.00166 * dmg);
+    if fallDmg < 0 then
+        TestSniperRifle:= BadTurn
+    else 
+        TestSniperRifle:= Max(0, trunc((dmg + fallDmg) * dmgMod) * 1024)
+    end
+else
+    TestSniperRifle:= BadTurn
+end;
+
+
+function TestBaseballBat(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+var valueResult, a, v1, v2: LongInt;
+    x, y, trackFall: LongInt;
+    dx, dy: real;
+begin
+    Targ:= Targ; // avoid compiler hint
+
+    if Level < 3 then trackFall:= afTrackFall
+    else trackFall:= 0;
+
+    ap.ExplR:= 0;
+    ap.Time:= 0;
+    ap.Power:= 1;
+    x:= hwRound(Me^.X);
+    y:= hwRound(Me^.Y);
+
+    a:= cMaxAngle div 2;
+    valueResult:= 0;
+
+    while a >= 0 do
+        begin
+        dx:= sin(a / cMaxAngle * pi) * 0.5;
+        dy:= cos(a / cMaxAngle * pi) * 0.5;
+
+        v1:= RateShove(x - 10, y + 2
+                , 32, 30, 115
+                , -dx, -dy, trackFall);
+        v2:= RateShove(x + 10, y + 2
+                , 32, 30, 115
+                , dx, -dy, trackFall);
+        if (v1 > valueResult) or (v2 > valueResult) then
+            if (v2 > v1) 
+                or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then
+                begin
+                ap.Angle:= a;
+                valueResult:= v2
+                end
+            else 
+                begin
+                ap.Angle:= -a;
+                valueResult:= v1
+                end;
+
+        a:= a - 15 - random(cMaxAngle div 16)
+        end;
+   
+    if valueResult <= 0 then
+        valueResult:= BadTurn;
+
+    TestBaseballBat:= valueResult;
 end;
 
 function TestFirePunch(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-var i, valueResult: LongInt;
-    x, y: hwFloat;
+var valueResult, v1, v2, i: LongInt;
+    x, y, trackFall: LongInt;
 begin
-Level:= Level; // avoid compiler hint
-ap.ExplR:= 0;
-ap.Time:= 0;
-ap.Power:= 1;
-ap.Angle:= 0;
-x:= Me^.X;
-y:= Me^.Y;
-if (Abs(hwRound(x) - Targ.X) > 25)
-or (Abs(hwRound(y) - 50 - Targ.Y) > 50) then
-    begin
-    if TestColl(hwRound(x), hwRound(y) - 16, 6)
-    and (RateShove(Me, hwRound(x) + 10 * hwSign(Me^.dX), hwRound(y) - 40, 30, 30) = 0) then
-        valueResult:= Succ(BadTurn)
-    else
+    Targ:= Targ; // avoid compiler hint
+
+    if Level = 1 then trackFall:= afTrackFall
+    else trackFall:= 0;
+
+    ap.ExplR:= 0;
+    ap.Time:= 0;
+    ap.Power:= 1;
+    x:= hwRound(Me^.X);
+    y:= hwRound(Me^.Y) + 4;
+
+    v1:= 0;
+    for i:= 0 to 8 do
+        begin
+        v1:= v1 + RateShove(x - 5, y - 10 * i
+                , 19, 30, 40
+                , -0.45, -0.9, trackFall or afSetSkip);
+        end;
+    v1:= v1 + RateShove(x - 5, y - 90
+            , 19, 30, 40
+            , -0.45, -0.9, trackFall);
+
+
+    // now try opposite direction
+    v2:= 0;
+    for i:= 0 to 8 do
+        begin
+        v2:= v2 + RateShove(x + 5, y - 10 * i
+                , 19, 30, 40
+                , 0.45, -0.9, trackFall or afSetSkip);
+        end;
+    v2:= v2 + RateShove(x + 5, y - 90
+            , 19, 30, 40
+            , 0.45, -0.9, trackFall);
+
+    if (v2 > v1) 
+        or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then
+        begin
+        ap.Angle:= 1;
+        valueResult:= v2
+        end
+    else 
+        begin
+        ap.Angle:= -1;
+        valueResult:= v1
+        end;
+    
+    if valueResult <= 0 then
         valueResult:= BadTurn;
-    exit(valueResult)
-    end;
 
-valueResult:= 0;
-for i:= 0 to 4 do
-    valueResult:= valueResult + RateShove(Me, hwRound(x) + 10 * hwSign(int2hwFloat(Targ.X) - x),
-                                    hwRound(y) - 20 * i - 5, 10, 30);
-if valueResult <= 0 then
-    valueResult:= BadTurn
-else
-    inc(valueResult);
+    TestFirePunch:= valueResult;
+end;
+
+
+function TestWhip(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+var valueResult, v1, v2: LongInt;
+    x, y, trackFall: LongInt;
+begin
+    Targ:= Targ; // avoid compiler hint
+
+    if Level = 1 then trackFall:= afTrackFall
+    else trackFall:= 0;
 
-TestFirePunch:= valueResult;
+    ap.ExplR:= 0;
+    ap.Time:= 0;
+    ap.Power:= 1;
+    x:= hwRound(Me^.X);
+    y:= hwRound(Me^.Y);
+
+    // check left direction
+    {first RateShove checks farthermost of two whip's AmmoShove attacks 
+    to encourage distant attacks (damaged hog is excluded from view of second 
+    RateShove call)}
+    v1:= RateShove(x - 13, y
+            , 30, 30, 25
+            , -1, -0.8, trackFall or afSetSkip);
+    v1:= v1 +
+        RateShove(x - 2, y
+            , 30, 30, 25
+            , -1, -0.8, trackFall);
+    // now try opposite direction
+    v2:= RateShove(x + 13, y
+            , 30, 30, 25
+            , 1, -0.8, trackFall or afSetSkip);
+    v2:= v2 +
+        RateShove(x + 2, y
+            , 30, 30, 25
+            , 1, -0.8, trackFall);
+
+    if (v2 > v1) 
+        or {don't encourage turning for no gain}((v2 = v1) and (not Me^.dX.isNegative)) then
+        begin
+        ap.Angle:= 1;
+        valueResult:= v2
+        end
+    else 
+        begin
+        ap.Angle:= -1;
+        valueResult:= v1
+        end;
+    
+    if valueResult <= 0 then
+        valueResult:= BadTurn
+    else
+        inc(valueResult);
+
+    TestWhip:= valueResult;
+end;
+
+function TestKamikaze(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+const step = 8;
+var valueResult, i, v, tx: LongInt;
+    trackFall: LongInt;
+    t, d, x, y, dx, dy, cx: real;
+begin
+    ap.ExplR:= 0;
+    ap.Time:= 0;
+    ap.Power:= 1;
+
+    if Level = 1 then 
+        trackFall:= afTrackFall
+    else if Level = 2 then
+        trackFall:= 0
+    else
+        exit(BadTurn);
+        
+    valueResult:= 0;
+    v:= 0;
+
+    x:= hwFloat2Float(Me^.X);
+    y:= hwFloat2Float(Me^.Y);
+    d:= sqrt(sqr(Targ.X - x) + sqr(Targ.Y - y));
+    if d < 10 then
+        begin
+        dx:= 0;
+        dy:= 8;
+        ap.Angle:= 2048
+        end
+    else
+        begin
+        t:= step / d;
+        dx:= (Targ.X - x) * t;
+        dy:= (Targ.Y - y) * t;
+
+        ap.Angle:= DxDy2AttackAnglef(dx, -dy)
+        end;
+    
+    if dx >= 0 then cx:= 0.45 else cx:= -0.45;
+
+    for i:= 0 to 512 div step - 2 do
+        begin
+        valueResult:= valueResult + 
+            RateShove(trunc(x), trunc(y)
+                , 30, 30, 25
+                , cx, -0.9, trackFall or afSetSkip);
+                
+        x:= x + dx;
+        y:= y + dy;
+        end;
+    if dx = 0 then
+        begin
+        x:= hwFloat2Float(Me^.X);
+        y:= hwFloat2Float(Me^.Y);
+        tx:= trunc(x);
+        v:= RateShove(tx, trunc(y)
+                , 30, 30, 25
+                , -cx, -0.9, trackFall);
+        for i:= 1 to 512 div step - 2 do
+            begin
+            y:= y + dy;
+            v:= v + 
+                RateShove(tx, trunc(y)
+                    , 30, 30, 25
+                    , -cx, -0.9, trackFall or afSetSkip);
+            end
+        end;
+    if v > valueResult then
+        begin
+        ap.Angle:= -2048;
+        valueResult:= v
+        end;
+
+    v:= RateShove(trunc(x), trunc(y)
+            , 30, 30, 25
+            , cx, -0.9, trackFall);
+    valueResult:= valueResult + v - KillScore * friendlyfactor div 100 * 1024;
+
+    if v < 65536 then
+        inc(valueResult, RateExplosion(Me, trunc(x), trunc(y), 30));
+
+    TestKamikaze:= valueResult;
 end;
 
 function TestHammer(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 var rate: LongInt;
 begin
 Level:= Level; // avoid compiler hint
+Targ:= Targ;
+
 ap.ExplR:= 0;
 ap.Time:= 0;
 ap.Power:= 1;
 ap.Angle:= 0;
          
-if (Abs(hwRound(Me^.X) + hwSign(Me^.dX) * 10 - Targ.X) + Abs(hwRound(Me^.Y) - Targ.Y) > 20) then
-    rate:= 0
-    else
-    rate:= RateHammer(Me);
-if rate = 0 then rate:= BadTurn;
+rate:= RateHammer(Me);
+if rate = 0 then
+    rate:= BadTurn;
 TestHammer:= rate;
 end;
 
 function TestAirAttack(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
 const cShift = 4;
-var X, Y, dY: hwFloat;
+var bombsSpeed, X, Y, dY: real;
     b: array[0..9] of boolean;
     dmg: array[0..9] of LongInt;
     fexit: boolean;
@@ -693,15 +973,18 @@ var X, Y, dY: hwFloat;
 begin
 ap.ExplR:= 0;
 ap.Time:= 0;
-if (Level > 3) then exit(BadTurn);
+if (Level > 3) then
+    exit(BadTurn);
 
+ap.Angle:= 0;
 ap.AttackPutX:= Targ.X;
 ap.AttackPutY:= Targ.Y;
 
-X:= int2hwFloat(Targ.X - 135 - cShift); // hh center - cShift
-X:= X - cBombsSpeed * hwSqrt(int2hwFloat((Targ.Y + 128) * 2) / cGravity);
-Y:= -_128;
-dY:= _0;
+bombsSpeed:= hwFloat2Float(cBombsSpeed);
+X:= Targ.X - 135 - cShift; // hh center - cShift
+X:= X - bombsSpeed * sqrt(((Targ.Y + 128) * 2) / cGravityf);
+Y:= -128;
+dY:= 0;
 
 for i:= 0 to 9 do
     begin
@@ -711,23 +994,23 @@ for i:= 0 to 9 do
 valueResult:= 0;
 
 repeat
-  X:= X + cBombsSpeed;
-  Y:= Y + dY;
-  dY:= dY + cGravity;
-  fexit:= true;
-
-  for i:= 0 to 9 do
-    if b[i] then
-       begin
-       fexit:= false;
-       if TestColl(hwRound(X) + i * 30, hwRound(Y), 4) then
-          begin
-          b[i]:= false;
-          dmg[i]:= RateExplosion(Me, hwRound(X) + i * 30, hwRound(Y), 58)
-          // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
-          end
-       end;
-until fexit or (Y.Round > cWaterLine);
+    X:= X + bombsSpeed;
+    Y:= Y + dY;
+    dY:= dY + cGravityf;
+    fexit:= true;
+
+    for i:= 0 to 9 do
+        if b[i] then
+            begin
+            fexit:= false;
+            if TestColl(trunc(X) + LongWord(i * 30), trunc(Y), 4) then
+                begin
+                b[i]:= false;
+                dmg[i]:= RateExplosion(Me, trunc(X) + LongWord(i * 30), trunc(Y), 58)
+                // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
+                end
+            end;
+until fexit or (Y > cWaterLine);
 
 for i:= 0 to 5 do inc(valueResult, dmg[i]);
 t:= valueResult;
@@ -738,13 +1021,14 @@ for i:= 0 to 3 do
     dec(t, dmg[i]);
     inc(t, dmg[i + 6]);
     if t > valueResult then
-       begin
-       valueResult:= t;
-       ap.AttackPutX:= Targ.X - 30 - cShift + i * 30
-       end
+        begin
+        valueResult:= t;
+        ap.AttackPutX:= Targ.X - 30 - cShift + i * 30
+        end
     end;
 
-if valueResult <= 0 then valueResult:= BadTurn;
+if valueResult <= 0 then
+    valueResult:= BadTurn;
 TestAirAttack:= valueResult;
 end;
 
@@ -755,32 +1039,115 @@ var
     maxTop: longword;
 begin
     TestTeleport := BadTurn;
+    exit(BadTurn);
     Level:= Level; // avoid compiler hint
-    FillBonuses(true, [gtCase]);
-    if bonuses.Count = 0 then begin
-        if Me^.Health <= 100  then begin
+    //FillBonuses(true, [gtCase]);
+    if bonuses.Count = 0 then
+        begin
+        if Me^.Health <= 100  then
+            begin
             maxTop := Targ.Y - cHHRadius * 2;
+            
             while not TestColl(Targ.X, maxTop, cHHRadius) and (maxTop > topY + cHHRadius * 2 + 1) do
-            dec(maxTop, cHHRadius*2);
-            if not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius) then begin
+                dec(maxTop, cHHRadius*2);
+            if not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius) then
+                begin
                 ap.AttackPutX := Targ.X;
                 ap.AttackPutY := maxTop + cHHRadius;
                 TestTeleport := Targ.Y - maxTop;
+                end;
             end;
-        end;
-    end
-    else begin
+        end
+    else
+        begin
         failNum := 0;
         repeat
             i := random(bonuses.Count);
             inc(failNum);
-        until not TestColl(bonuses.ar[i].X, bonuses.ar[i].Y - cHHRadius - bonuses.ar[i].Radius, cHHRadius) or (failNum = bonuses.Count*2);
-        if failNum < bonuses.Count*2 then begin
+        until not TestColl(bonuses.ar[i].X, bonuses.ar[i].Y - cHHRadius - bonuses.ar[i].Radius, cHHRadius)
+        or (failNum = bonuses.Count*2);
+        
+        if failNum < bonuses.Count*2 then
+            begin
             ap.AttackPutX := bonuses.ar[i].X;
             ap.AttackPutY := bonuses.ar[i].Y - cHHRadius - bonuses.ar[i].Radius;
             TestTeleport := 0;
+            end;
         end;
+end;
+
+
+procedure checkCakeWalk(Me, Gear: PGear; var ap: TAttackParams);
+var i: Longword;
+    v: LongInt;
+begin
+while (not TestColl(hwRound(Gear^.X), hwRound(Gear^.Y), 6)) and (Gear^.Y.Round < LAND_HEIGHT) do
+    Gear^.Y:= Gear^.Y + _1;
+
+for i:= 0 to 2040 do
+    begin
+    cakeStep(Gear);
+    v:= RateExplosion(Me, hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg * 2, afTrackFall);
+    if v > ap.Power then 
+        begin
+        ap.ExplX:= hwRound(Gear^.X);
+        ap.ExplY:= hwRound(Gear^.Y);
+        ap.Power:= v
+        end
     end;
 end;
 
+function TestCake(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
+var valueResult, v1, v2: LongInt;
+    cake: TGear;
+begin
+    Targ:= Targ; // avoid compiler hint
+
+    if (Level > 2) then
+        exit(BadTurn);
+
+    ap.ExplR:= 0;
+    ap.Time:= 0;
+    ap.Power:= BadTurn; // use it as max score value in checkCakeWalk
+
+    //FillChar(cake, sizeof(cake), 0);
+    cake.Radius:= 7;
+    cake.CollisionMask:= $FF7F;
+    cake.Hedgehog:= Me^.Hedgehog;
+
+    // check left direction
+    cake.Angle:= 3;
+    cake.dX.isNegative:= true;
+    cake.X:= Me^.X - _3;
+    cake.Y:= Me^.Y;
+    checkCakeWalk(Me, @cake, ap);
+    v1:= ap.Power;
+
+    // now try opposite direction
+    cake.Angle:= 1;
+    cake.dX.isNegative:= false;
+    cake.X:= Me^.X + _3;
+    cake.Y:= Me^.Y;
+    checkCakeWalk(Me, @cake, ap);
+    v2:= ap.Power;
+
+    ap.Power:= 1;
+
+    if (v2 > v1) then
+        begin
+        ap.Angle:= 1;
+        valueResult:= v2
+        end
+    else
+        begin
+        ap.Angle:= -1;
+        valueResult:= v1
+        end;
+
+    if valueResult <= 0 then
+        valueResult:= BadTurn;
+
+    TestCake:= valueResult;
+end;
+
 end.
diff --git a/hedgewars/uAILandMarks.pas b/hedgewars/uAILandMarks.pas
new file mode 100644
index 0000000..792073c
--- /dev/null
+++ b/hedgewars/uAILandMarks.pas
@@ -0,0 +1,78 @@
+unit uAILandMarks;
+
+interface
+const 
+    markWalkedHere = $01;
+    markHJumped    = $02;
+    markLJumped    = $04;
+
+procedure addMark(X, Y: LongInt; mark: byte);
+function  checkMark(X, Y: LongInt; mark: byte) : boolean;
+procedure clearAllMarks;
+procedure clearMarks(mark: byte);
+procedure setAILandMarks;
+
+procedure initModule;
+procedure freeModule;
+
+implementation
+uses uVariables;
+
+const gr = 2;
+
+var marks: array of array of byte;
+    WIDTH, HEIGHT: Longword;
+
+procedure addMark(X, Y: LongInt; mark: byte);
+begin
+    if((X and LAND_WIDTH_MASK) = 0) and ((Y and LAND_HEIGHT_MASK) = 0) then
+        begin
+        X:= X shr gr;
+        Y:= Y shr gr;
+        marks[Y, X]:= marks[Y, X] or mark
+        end
+end;
+
+function  checkMark(X, Y: LongInt; mark: byte) : boolean;
+begin
+    checkMark:= ((X and LAND_WIDTH_MASK) = 0) 
+        and ((Y and LAND_HEIGHT_MASK) = 0) 
+        and ((marks[Y shr gr, X shr gr] and mark) <> 0)
+end;
+
+procedure clearAllMarks;
+var 
+    Y, X: Longword;
+begin
+    for Y:= 0 to Pred(HEIGHT) do
+        for X:= 0 to Pred(WIDTH) do
+            marks[Y, X]:= 0
+end;
+
+procedure clearMarks(mark: byte);
+var 
+    Y, X: Longword;
+begin
+    for Y:= 0 to Pred(HEIGHT) do
+        for X:= 0 to Pred(WIDTH) do
+            marks[Y, X]:= marks[Y, X] and (not mark)
+end;
+
+procedure setAILandMarks;
+begin
+    WIDTH:= LAND_WIDTH shr gr;
+    HEIGHT:= LAND_HEIGHT shr gr;
+    
+    SetLength(marks, HEIGHT, WIDTH);
+end;
+
+procedure initModule;
+begin
+end;
+
+procedure freeModule;
+begin
+    SetLength(marks, 0, 0);
+end;
+
+end.
diff --git a/hedgewars/uAIMisc.pas b/hedgewars/uAIMisc.pas
index 99b0e0c..dd5f988 100644
--- a/hedgewars/uAIMisc.pas
+++ b/hedgewars/uAIMisc.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2005-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,59 +24,78 @@ uses SDLh, uConsts, uFloat, uTypes;
 
 const MAXBONUS = 1024;
 
+      afTrackFall  = $00000001;
+      afErasesLand = $00000002;
+      afSetSkip    = $00000004;
+
+
 type TTarget = record
-               Point: TPoint;
-               Score: LongInt;
-               end;
-     TTargets = record
-                Count: Longword;
-                ar: array[0..Pred(cMaxHHs)] of TTarget;
-                end;
-     TJumpType = (jmpNone, jmpHJump, jmpLJump);
-     TGoInfo = record
-               Ticks: Longword;
-               FallPix: Longword;
-               JumpType: TJumpType;
-               end;
-     TBonus = record
-              X, Y: LongInt;
-              Radius: LongInt;
-              Score: LongInt;
-              end;
+    Point: TPoint;
+    Score: LongInt;
+    skip: boolean;
+    end;
+TTargets = record
+    Count: Longword;
+    ar: array[0..Pred(cMaxHHs)] of TTarget;
+    end;
+TJumpType = (jmpNone, jmpHJump, jmpLJump);
+TGoInfo = record
+    Ticks: Longword;
+    FallPix: Longword;
+    JumpType: TJumpType;
+    end;
+TBonus = record
+    X, Y: LongInt;
+    Radius: LongInt;
+    Score: LongInt;
+    end;
 
 procedure initModule;
 procedure freeModule;
 
 procedure FillTargets;
-procedure FillBonuses(isAfterAttack: boolean; filter: TGearsType = []);
-procedure AwareOfExplosion(x, y, r: LongInt);
-function RatePlace(Gear: PGear): LongInt;
-function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean;
-function TestColl(x, y, r: LongInt): boolean;
-function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt;
-function RateShove(Me: PGear; x, y, r, power: LongInt): LongInt;
-function RateShotgun(Me: PGear; x, y: LongInt): LongInt;
-function RateHammer(Me: PGear): LongInt;
-function HHGo(Gear, AltGear: PGear; var GoInfo: TGoInfo): boolean;
-function AIrndSign(num: LongInt): LongInt;
+procedure AddBonus(x, y: LongInt; r: Longword; s: LongInt); inline;
+procedure FillBonuses(isAfterAttack: boolean);
+procedure AwareOfExplosion(x, y, r: LongInt); inline;
+
+function  RatePlace(Gear: PGear): LongInt;
+function  TestColl(x, y, r: LongInt): boolean; inline;
+function  TestCollExcludingObjects(x, y, r: LongInt): boolean; inline;
+function  TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline;
+function  TraceShoveFall(x, y, dX, dY: Real): LongInt;
+
+function  RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; inline;
+function  RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt;
+function  RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt;
+function  RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt;
+function  RateHammer(Me: PGear): LongInt;
+
+function  HHGo(Gear, AltGear: PGear; var GoInfo: TGoInfo): boolean;
+function  AIrndSign(num: LongInt): LongInt;
 
 var ThinkingHH: PGear;
     Targets: TTargets;
 
     bonuses: record
-             Count: Longword;
-             ar: array[0..Pred(MAXBONUS)] of TBonus;
-             end;
+        Count: Longword;
+        ar: array[0..Pred(MAXBONUS)] of TBonus;
+        end;
 
-implementation
-uses uCollisions, uVariables, uUtils, uDebug;
+    walkbonuses: record
+        Count: Longword;
+        ar: array[0..Pred(MAXBONUS div 8)] of TBonus;  // don't use too many
+        end;
 
 const KillScore = 200;
-
 var friendlyfactor: LongInt = 300;
+
+implementation
+uses uCollisions, uVariables, uUtils, uLandTexture, uGearsUtils;
+
+var 
     KnownExplosion: record
-                    X, Y, Radius: LongInt
-                    end = (X: 0; Y: 0; Radius: 0);
+        X, Y, Radius: LongInt
+        end = (X: 0; Y: 0; Radius: 0);
 
 procedure FillTargets;
 var i, t: Longword;
@@ -91,19 +110,22 @@ for t:= 0 to Pred(TeamsCount) do
             begin
             for i:= 0 to cMaxHHIndex do
                 if (Hedgehogs[i].Gear <> nil)
-                and (Hedgehogs[i].Gear <> ThinkingHH) then
+                and (Hedgehogs[i].Gear <> ThinkingHH) 
+                and (Hedgehogs[i].Gear^.Health > Hedgehogs[i].Gear^.Damage) 
+                    then
                     begin
                     with Targets.ar[Targets.Count], Hedgehogs[i] do
                         begin
+                        skip:= false;
                         Point.X:= hwRound(Gear^.X);
                         Point.Y:= hwRound(Gear^.Y);
                         if Clan <> CurrentTeam^.Clan then
                             begin
-                            Score:=  Gear^.Health;
+                            Score:= Gear^.Health - Gear^.Damage;
                             inc(e)
                             end else
                             begin
-                            Score:= -Gear^.Health;
+                            Score:= Gear^.Damage - Gear^.Health;
                             inc(f)
                             end
                         end;
@@ -115,187 +137,427 @@ if e > f then friendlyfactor:= 300 + (e - f) * 30
 else friendlyfactor:= max(30, 300 - f * 80 div max(1,e))
 end;
 
-procedure FillBonuses(isAfterAttack: boolean; filter: TGearsType);
-var Gear: PGear;
-    MyClan: PClan;
-
-    procedure AddBonus(x, y: LongInt; r: Longword; s: LongInt);
+procedure AddBonus(x, y: LongInt; r: Longword; s: LongInt); inline;
+begin
+if(bonuses.Count < MAXBONUS) then
     begin
     bonuses.ar[bonuses.Count].x:= x;
     bonuses.ar[bonuses.Count].y:= y;
     bonuses.ar[bonuses.Count].Radius:= r;
     bonuses.ar[bonuses.Count].Score:= s;
     inc(bonuses.Count);
-    TryDo(bonuses.Count <= MAXBONUS, 'Bonuses overflow', true)
     end;
+end;
 
+procedure AddWalkBonus(x, y: LongInt; r: Longword; s: LongInt); inline;
+begin
+if(walkbonuses.Count < MAXBONUS div 8) then
+    begin
+    walkbonuses.ar[walkbonuses.Count].x:= x;
+    walkbonuses.ar[walkbonuses.Count].y:= y;
+    walkbonuses.ar[walkbonuses.Count].Radius:= r;
+    walkbonuses.ar[walkbonuses.Count].Score:= s;
+    inc(walkbonuses.Count);
+    end;
+end;
+
+procedure FillBonuses(isAfterAttack: boolean);
+var Gear: PGear;
+    MyClan: PClan;
+    i: Longint;
 begin
 bonuses.Count:= 0;
 MyClan:= ThinkingHH^.Hedgehog^.Team^.Clan;
 Gear:= GearsList;
 while Gear <> nil do
     begin
-    if (filter = []) or (Gear^.Kind in filter) then
-      case Gear^.Kind of
-          gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
-          gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then
-                  AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 20, -50);
+        case Gear^.Kind of
+            gtCase:
+                AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y) + 3, 37, 25);
+            gtFlame:
+                if (Gear^.State and gsttmpFlag) <> 0 then
+                    AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 20, -50);
 // avoid mines unless they are very likely to be duds, or are duds. also avoid if they are about to blow 
-          gtMine:  if ((Gear^.State and gstAttacking) = 0) and 
-                      (((cMineDudPercent < 90) and (Gear^.Health <> 0)) or
-                       (isAfterAttack and (Gear^.Health = 0) and (Gear^.Damage > 30))) then
-                          AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -50)
-                      else if (Gear^.State and gstAttacking) <> 0 then
-                          AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, -50); // mine is on
-          gtExplosives: if isAfterAttack then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 75, -60+Gear^.Health);
-          gtSMine:    AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -30);
-          gtDynamite: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -75);
-          gtHedgehog: begin
-                      if Gear^.Damage >= Gear^.Health then
-                          AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
-                      else
-                          if isAfterAttack and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog) then
-                              if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then
-                                  AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend
-                              else
-                                  AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, 3)
-                      end;
-          end;
+            gtMine:
+                if ((Gear^.State and gstAttacking) = 0) and (((cMineDudPercent < 90) and (Gear^.Health <> 0))
+                or (isAfterAttack and (Gear^.Health = 0) and (Gear^.Damage > 30))) then
+                    AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -50)
+                else if (Gear^.State and gstAttacking) <> 0 then
+                    AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, -50); // mine is on
+                    
+            gtExplosives:
+            if isAfterAttack then
+                AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 75, -60 + Gear^.Health);
+                
+            gtSMine:
+                AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 50, -30);
+                
+            gtDynamite:
+                AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -75);
+                
+            gtHedgehog:
+                begin
+                if Gear^.Damage >= Gear^.Health then
+                    AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
+                else
+                    if isAfterAttack
+                      and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog)
+                      and ((hwAbs(Gear^.dX) + hwAbs(Gear^.dY)) < _0_1) then
+                        if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then
+                            AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend
+                        else
+                            AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, 3)
+                end;
+            end;
     Gear:= Gear^.NextGear
     end;
 if isAfterAttack and (KnownExplosion.Radius > 0) then
-   with KnownExplosion do
+    with KnownExplosion do
         AddBonus(X, Y, Radius + 10, -Radius);
+if isAfterAttack then
+    begin
+    for i:= 0 to Pred(walkbonuses.Count) do
+        with walkbonuses.ar[i] do
+            AddBonus(X, Y, Radius, Score);
+    walkbonuses.Count:= 0
+    end;
 end;
 
-procedure AwareOfExplosion(x, y, r: LongInt);
+procedure AwareOfExplosion(x, y, r: LongInt); inline;
 begin
-KnownExplosion.X:= x;
-KnownExplosion.Y:= y;
-KnownExplosion.Radius:= r
+    KnownExplosion.X:= x;
+    KnownExplosion.Y:= y;
+    KnownExplosion.Radius:= r
 end;
 
 function RatePlace(Gear: PGear): LongInt;
 var i, r: LongInt;
     rate: LongInt;
+    gX, gY: real;
 begin
+gX:= hwFloat2Float(Gear^.X);
+gY:= hwFloat2Float(Gear^.Y);
 rate:= 0;
 for i:= 0 to Pred(bonuses.Count) do
     with bonuses.ar[i] do
         begin
-        r:= hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
-        if r < Radius then
-            inc(rate, Score * (Radius - r))
+        r:= Radius;
+        if abs(gX-X)+abs(gY-Y) < Radius then
+            r:= trunc(sqrt(sqr(gX - X)+sqr(gY - Y)));
+        if r < 20 then
+                inc(rate, Score * Radius)
+        else if r < Radius then
+                inc(rate, Score * (Radius - r))
         end;
     RatePlace:= rate;
 end;
 
 // Wrapper to test various approaches.  If it works reasonably, will just replace.
 // Right now, converting to hwFloat is a tad inefficient since the x/y were hwFloat to begin with...
-function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean;
+function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline;
 var MeX, MeY: LongInt;
 begin
     if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then
-        begin
+    begin
         MeX:= hwRound(Me^.X);
         MeY:= hwRound(Me^.Y);
         // We are still inside the hog. Skip radius test
-        if ((((x-MeX)*(x-MeX)) + ((y-MeY)*(y-MeY))) < 256) and
-           ((Land[y, x] and $FF00) = 0) then exit(false);
-        end;
-    exit(TestColl(x, y, r))
+        if ((((x-MeX)*(x-MeX)) + ((y-MeY)*(y-MeY))) < 256) and ((Land[y, x] and $FF00) = 0) then
+            exit(false);
+    end;
+    TestCollExcludingMe:= TestColl(x, y, r)
+end;
+
+function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline;
+var b: boolean;
+begin
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and $FF00 <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and $FF00 <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and $FF00 <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and $FF00 <> 0);
+    if b then
+        exit(true);
+    
+    TestCollExcludingObjects:= false;
 end;
 
-function TestColl(x, y, r: LongInt): boolean;
+function TestColl(x, y, r: LongInt): boolean; inline;
 var b: boolean;
 begin
-b:= (((x-r) and LAND_WIDTH_MASK) = 0)and(((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] <> 0);
-if b then exit(true);
-b:=(((x-r) and LAND_WIDTH_MASK) = 0)and(((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] <> 0);
-if b then exit(true);
-b:=(((x+r) and LAND_WIDTH_MASK) = 0)and(((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] <> 0);
-if b then exit(true);
-TestColl:=(((x+r) and LAND_WIDTH_MASK) = 0)and(((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] <> 0)
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and $FF7F <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and $FF7F <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and $FF7F <> 0);
+    if b then
+        exit(true);
+    
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and $FF7F <> 0);
+    if b then
+        exit(true);
+    
+    TestColl:= false;
+end;
+
+function TestCollWithLand(x, y, r: LongInt): boolean; inline;
+var b: boolean;
+begin
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] > 255);
+    if b then
+        exit(true);
+        
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] > 255);
+    if b then
+        exit(true);
+        
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] > 255);
+    if b then
+        exit(true);
+        
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] > 255);
+    if b then
+        exit(true);
+
+    TestCollWithLand:= false;
+end;
+
+function TraceFall(eX, eY: LongInt; x, y, dX, dY: Real; r: LongWord): LongInt;
+var skipLandCheck: boolean;
+    rCorner: real;
+    dmg: LongInt;
+begin
+    skipLandCheck:= true;
+    if x - eX < 0 then dX:= -dX;
+    if y - eY < 0 then dY:= -dY;
+    // ok. attempt approximate search for an unbroken trajectory into water.  if it continues far enough, assume out of map
+    rCorner:= r * 0.75;
+    while true do
+    begin
+        x:= x + dX;
+        y:= y + dY;
+        dY:= dY + cGravityf;
+        skipLandCheck:= skipLandCheck and (r <> 0) and (abs(eX-x) + abs(eY-y) < r) and ((abs(eX-x) < rCorner) or (abs(eY-y) < rCorner));
+        if not skipLandCheck and TestCollWithLand(trunc(x), trunc(y), cHHRadius) then
+        begin
+            if 0.4 < dY then
+            begin
+                dmg := 1 + trunc((abs(dY) - 0.4) * 70);
+                if dmg >= 1 then
+                    exit(dmg);
+            end;
+            exit(0)
+        end;
+        if (y > cWaterLine) or (x > 4096) or (x < 0) then
+            exit(-1);
+    end;
+end;
+
+function TraceShoveFall(x, y, dX, dY: Real): LongInt;
+var dmg: LongInt;
+begin
+//v:= random($FFFFFFFF);
+    while true do
+    begin
+        x:= x + dX;
+        y:= y + dY;
+        dY:= dY + cGravityf;
+
+{        if ((trunc(y) and LAND_HEIGHT_MASK) = 0) and ((trunc(x) and LAND_WIDTH_MASK) = 0) then 
+            begin
+            LandPixels[trunc(y), trunc(x)]:= v;
+            UpdateLandTexture(trunc(X), 1, trunc(Y), 1, true);
+            end;}
+
+
+        // consider adding dX/dY calc here for fall damage
+        if TestCollExcludingObjects(trunc(x), trunc(y), cHHRadius) then
+        begin
+            if 0.4 < dY then
+            begin
+                dmg := 1 + trunc((abs(dY) - 0.4) * 70);
+                if dmg >= 1 then
+                    exit(dmg);
+            end;
+            exit(0)
+        end;
+        if (y > cWaterLine) or (x > 4096) or (x < 0) then
+            // returning -1 for drowning so it can be considered in the Rate routine
+            exit(-1)
+    end;
 end;
 
 function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt;
-var i, dmg, rate: LongInt;
 begin
+    RateExplosion:= RateExplosion(Me, x, y, r, 0);
+end;
+
+function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt;
+var i, fallDmg, dmg, dmgBase, rate, erasure: LongInt;
+    dX, dY, dmgMod: real;
+begin
+fallDmg:= 0;
+dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
 rate:= 0;
 // add our virtual position
 with Targets.ar[Targets.Count] do
-     begin
-     Point.x:= hwRound(Me^.X);
-     Point.y:= hwRound(Me^.Y);
-     Score:= - ThinkingHH^.Health
-     end;
+    begin
+    Point.x:= hwRound(Me^.X);
+    Point.y:= hwRound(Me^.Y);
+    Score:= - ThinkingHH^.Health
+    end;
 // rate explosion
+dmgBase:= r + cHHRadius div 2;
+if (Flags and afErasesLand <> 0) and (GameFlags and gfSolidLand = 0) then erasure:= r
+else erasure:= 0;
 for i:= 0 to Targets.Count do
     with Targets.ar[i] do
-         begin
-         dmg:= hwRound(_0_01 * cDamageModifier
-            * min((r + cHHRadius div 2 - LongInt(DistanceI(Point.x - x, Point.y - y).Round)) div 2, r) * cDamagePercent);
+        begin
+        dmg:= 0;
+        if abs(Point.x - x) + abs(Point.y - y) < dmgBase then
+            dmg:= trunc(dmgMod * min((dmgBase - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)))) div 2, r));
 
-         if dmg > 0 then
+        if dmg > 0 then
             begin
-            if dmg >= abs(Score) then
-               if Score > 0 then inc(rate, KillScore)
-                            else dec(rate, KillScore * friendlyfactor div 100)
+            if (Flags and afTrackFall <> 0) and (dmg < abs(Score)) then
+                begin
+                dX:= 0.005 * dmg + 0.01;
+                dY:= dX;
+                if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and 
+                   (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then
+                     fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod)
+                else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod)
+                end;
+            if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI
+                if Score > 0 then
+                    inc(rate, (KillScore + Score div 10) * 1024)   // Add a bit of a bonus for bigger hog drownings
+                else
+                    dec(rate, (KillScore * friendlyfactor div 100 - Score div 10) * 1024) // and more of a punishment for drowning bigger friendly hogs
+            else if (dmg+fallDmg) >= abs(Score) then
+                if Score > 0 then
+                    inc(rate, KillScore * 1024 + (dmg + fallDmg)) // tiny bonus for dealing more damage than needed to kill
+                else
+                    dec(rate, KillScore * friendlyfactor div 100 * 1024)
             else
-               if Score > 0 then inc(rate, dmg)
-                            else dec(rate, dmg * friendlyfactor div 100)
+                if Score > 0 then
+                    inc(rate, (dmg + fallDmg) * 1024)
+                else dec(rate, (dmg + fallDmg) * friendlyfactor div 100 * 1024)
             end;
-         end;
-RateExplosion:= rate * 1024;
+        end;
+RateExplosion:= rate;
 end;
 
-function RateShove(Me: PGear; x, y, r, power: LongInt): LongInt;
-var i, dmg, rate: LongInt;
+function RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt;
+var i, fallDmg, dmg, rate: LongInt;
+    dX, dY, dmgMod: real;
 begin
-Me:= Me; // avoid compiler hint
+fallDmg:= 0;
+dX:= gdX * 0.01 * kick;
+dY:= gdY * 0.01 * kick;
+dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
 rate:= 0;
 for i:= 0 to Pred(Targets.Count) do
     with Targets.ar[i] do
-         begin
-         dmg:= r - hwRound(DistanceI(Point.x - x, Point.y - y));
-         dmg:= hwRound(_0_01 * cDamageModifier * dmg * cDamagePercent);
-         if dmg > 0 then
+      if skip then 
+        if (Flags and afSetSkip = 0) then skip:= false else {still skip}
+      else  
+        begin
+        dmg:= 0;
+        if abs(Point.x - x) + abs(Point.y - y) < r then
+            dmg:= r - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)));
+
+        if dmg > 0 then
             begin
-            if power >= abs(Score) then
-               if Score > 0 then inc(rate, KillScore)
-                            else dec(rate, KillScore * friendlyfactor div 100)
+            if (Flags and afSetSkip <> 0) then skip:= true;
+            if (Flags and afTrackFall <> 0) and (Score > 0) then 
+                fallDmg:= trunc(TraceShoveFall(Point.x, Point.y - 2, dX, dY) * dmgMod);
+            if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI
+                if Score > 0 then
+                    inc(rate, KillScore + Score div 10)   // Add a bit of a bonus for bigger hog drownings
+                else
+                    dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs
+            else if power+fallDmg >= abs(Score) then
+                if Score > 0 then
+                    inc(rate, KillScore)
+                else
+                    dec(rate, KillScore * friendlyfactor div 100)
             else
-               if Score > 0 then inc(rate, power)
-                            else dec(rate, power * friendlyfactor div 100)
+                if Score > 0 then
+                    inc(rate, power+fallDmg)
+                else
+                    dec(rate, (power+fallDmg) * friendlyfactor div 100)
             end;
-         end;
+        end;
 RateShove:= rate * 1024
 end;
 
-function RateShotgun(Me: PGear; x, y: LongInt): LongInt;
-var i, dmg, rate: LongInt;
+function RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt;
+var i, dmg, fallDmg, baseDmg, rate, erasure: LongInt;
+    dX, dY, dmgMod: real;
 begin
+dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
 rate:= 0;
+gdX:= gdX * 0.01;
+gdY:= gdX * 0.01;
 // add our virtual position
 with Targets.ar[Targets.Count] do
-     begin
-     Point.x:= hwRound(Me^.X);
-     Point.y:= hwRound(Me^.Y);
-     Score:= - ThinkingHH^.Health
-     end;
+    begin
+    Point.x:= hwRound(Me^.X);
+    Point.y:= hwRound(Me^.Y);
+    Score:= - ThinkingHH^.Health
+    end;
 // rate shot
+baseDmg:= cHHRadius + cShotgunRadius + 4;
+if GameFlags and gfSolidLand = 0 then erasure:= cShotgunRadius
+else erasure:= 0;
 for i:= 0 to Targets.Count do
     with Targets.ar[i] do
-         begin
-         dmg:= min(cHHRadius + cShotgunRadius + 4 - hwRound(DistanceI(Point.x - x, Point.y - y)), 25);
-         dmg:= hwRound(_0_01 * cDamageModifier * dmg * cDamagePercent);
-         if dmg > 0 then
+        begin
+        dmg:= 0;
+        if abs(Point.x - x) + abs(Point.y - y) < baseDmg then
             begin
-                if dmg >= abs(Score) then dmg := KillScore;
-                if Score > 0 then inc(rate, dmg)
-                else dec(rate, dmg * friendlyfactor div 100);
+            dmg:= min(baseDmg - trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y))), 25);
+            dmg:= trunc(dmg * dmgMod);
             end;
-         end;        
+        if dmg > 0 then
+            begin
+            dX:= gdX * dmg;
+            dY:= gdY * dmg;
+            if dX < 0 then dX:= dX - 0.01
+            else dX:= dX + 0.01;
+            if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and 
+               (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then
+                 fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod)
+            else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod);
+            if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI
+                if Score > 0 then
+                    inc(rate, KillScore + Score div 10)   // Add a bit of a bonus for bigger hog drownings
+                else
+                    dec(rate, KillScore * friendlyfactor div 100 - Score div 10) // and more of a punishment for drowning bigger friendly hogs
+            else if (dmg+fallDmg) >= abs(Score) then
+                if Score > 0 then
+                    inc(rate, KillScore)
+                else
+                    dec(rate, KillScore * friendlyfactor div 100)
+            else
+                if Score > 0 then
+                    inc(rate, dmg+fallDmg)
+            else
+                dec(rate, (dmg+fallDmg) * friendlyfactor div 100)
+            end;
+        end;        
 RateShotgun:= rate * 1024;
 end;
 
@@ -309,189 +571,195 @@ rate:= 0;
 
 for i:= 0 to Pred(Targets.Count) do
     with Targets.ar[i] do
-         begin
          // hammer hit radius is 8, shift is 10
-         r:= hwRound(DistanceI(Point.x - x, Point.y - y));
-
-         if r <= 18 then
-            if Score > 0 then 
-                inc(rate, Score div 3)
-                else 
-                inc(rate, Score div 3 * friendlyfactor div 100)
-         end;
+        if abs(Point.x - x) + abs(Point.y - y) < 18 then
+            begin
+            r:= trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)));
+
+            if r <= 18 then
+                if Score > 0 then 
+                    inc(rate, Score div 3)
+                else
+                    inc(rate, Score div 3 * friendlyfactor div 100)
+            end;
 RateHammer:= rate * 1024;
 end;
 
 function HHJump(Gear: PGear; JumpType: TJumpType; var GoInfo: TGoInfo): boolean;
 var bX, bY: LongInt;
-    bRes: boolean;
 begin
-bRes:= false;
+HHJump:= false;
 GoInfo.Ticks:= 0;
 GoInfo.JumpType:= jmpNone;
 bX:= hwRound(Gear^.X);
 bY:= hwRound(Gear^.Y);
 case JumpType of
-     jmpNone: exit(bRes);
-    jmpHJump: if TestCollisionYwithGear(Gear, -1) = 0 then
-                 begin
-                 Gear^.dY:= -_0_2;
-                 SetLittle(Gear^.dX);
-                 Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
-                 end else exit(bRes);
-    jmpLJump: begin
-              if TestCollisionYwithGear(Gear, -1) <> 0 then
-                 if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - int2hwFloat(2) else
-                 if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _1;
-              if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX))
-                 or   (TestCollisionYwithGear(Gear, -1) <> 0)) then
-                 begin
-                 Gear^.dY:= -_0_15;
-                 Gear^.dX:= SignAs(_0_15, Gear^.dX);
-                 Gear^.State:= Gear^.State or gstMoving or gstHHJumping
-                 end else exit(bRes)
-              end
-    end;
+    jmpNone: exit(false);
+    
+    jmpHJump:
+        if TestCollisionYwithGear(Gear, -1) = 0 then
+        begin
+            Gear^.dY:= -_0_2;
+            SetLittle(Gear^.dX);
+            Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
+        end
+    else
+        exit(false);
+        
+    jmpLJump:
+        begin
+            if TestCollisionYwithGear(Gear, -1) <> 0 then
+                if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then
+                    Gear^.Y:= Gear^.Y - int2hwFloat(2)
+                else
+                    if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then
+                        Gear^.Y:= Gear^.Y - _1;
+            if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) or
+               (TestCollisionYwithGear(Gear, -1) <> 0)) then
+            begin
+                Gear^.dY:= -_0_15;
+                Gear^.dX:= SignAs(_0_15, Gear^.dX);
+                Gear^.State:= Gear^.State or gstMoving or gstHHJumping
+            end
+        else
+            exit(false)
+        end
+end;
 
 repeat
-if not (hwRound(Gear^.Y) + cHHRadius < cWaterLine) then exit(bRes);
-if (Gear^.State and gstMoving) <> 0 then
-   begin
-   if (GoInfo.Ticks = 350) then
-      if (not (hwAbs(Gear^.dX) > cLittle)) and (Gear^.dY < -_0_02) then
-         begin
-         Gear^.dY:= -_0_25;
-         Gear^.dX:= SignAs(_0_02, Gear^.dX)
-         end;
-   if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then SetLittle(Gear^.dX);
-   Gear^.X:= Gear^.X + Gear^.dX;
-   inc(GoInfo.Ticks);
-   Gear^.dY:= Gear^.dY + cGravity;
-   if Gear^.dY > _0_4 then exit(bRes);
-   if (Gear^.dY.isNegative)and (TestCollisionYwithGear(Gear, -1) <> 0) then Gear^.dY:= _0;
-   Gear^.Y:= Gear^.Y + Gear^.dY;
-   if (not Gear^.dY.isNegative)and (TestCollisionYwithGear(Gear, 1) <> 0) then
-      begin
-      Gear^.State:= Gear^.State and not (gstMoving or gstHHJumping);
-      Gear^.dY:= _0;
-      case JumpType of
-           jmpHJump: if bY - hwRound(Gear^.Y) > 5 then
+        {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then 
+            begin
+            LandPixels[hwRound(Gear^.Y), hwRound(Gear^.X)]:= Gear^.Hedgehog^.Team^.Clan^.Color;
+            UpdateLandTexture(hwRound(Gear^.X), 1, hwRound(Gear^.Y), 1, true);
+            end;}
+            
+    if not (hwRound(Gear^.Y) + cHHRadius < cWaterLine) then
+        exit(false);
+    if (Gear^.State and gstMoving) <> 0 then
+    begin
+        if (GoInfo.Ticks = 350) then
+            if (not (hwAbs(Gear^.dX) > cLittle)) and (Gear^.dY < -_0_02) then
+            begin
+                Gear^.dY:= -_0_25;
+                Gear^.dX:= SignAs(_0_02, Gear^.dX)
+            end;
+        if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then SetLittle(Gear^.dX);
+            Gear^.X:= Gear^.X + Gear^.dX;
+        inc(GoInfo.Ticks);
+        Gear^.dY:= Gear^.dY + cGravity;
+        if Gear^.dY > _0_4 then
+            exit(false);
+        if (Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, -1) <> 0) then
+            Gear^.dY:= _0;
+        Gear^.Y:= Gear^.Y + Gear^.dY;
+        if (not Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, 1) <> 0) then
+            begin
+            Gear^.State:= Gear^.State and (not (gstMoving or gstHHJumping));
+            Gear^.dY:= _0;
+            case JumpType of
+                jmpHJump:
+                    if bY - hwRound(Gear^.Y) > 5 then
                         begin
-                        bRes:= true;
                         GoInfo.JumpType:= jmpHJump;
-                        inc(GoInfo.Ticks, 300 + 300) // 300 before jump, 300 after
+                        inc(GoInfo.Ticks, 300 + 300); // 300 before jump, 300 after
+                        exit(true)
                         end;
-           jmpLJump: if abs(bX - hwRound(Gear^.X)) > 30 then
+                jmpLJump:
+                    if abs(bX - hwRound(Gear^.X)) > 30 then
                         begin
-                        bRes:= true;
                         GoInfo.JumpType:= jmpLJump;
-                        inc(GoInfo.Ticks, 300 + 300) // 300 before jump, 300 after
-                        end;
-           end;
-      exit(bRes)
-      end;
-   end;
+                        inc(GoInfo.Ticks, 300 + 300); // 300 before jump, 300 after
+                        exit(true)
+                        end
+                end;
+            exit(false)
+            end;
+    end;
 until false
 end;
 
 function HHGo(Gear, AltGear: PGear; var GoInfo: TGoInfo): boolean;
-var pX, pY: LongInt;
+var pX, pY, tY: LongInt;
 begin
+HHGo:= false;
+Gear^.CollisionMask:= $FF7F;
 AltGear^:= Gear^;
 
 GoInfo.Ticks:= 0;
 GoInfo.FallPix:= 0;
 GoInfo.JumpType:= jmpNone;
+tY:= hwRound(Gear^.Y);
 repeat
-pX:= hwRound(Gear^.X);
-pY:= hwRound(Gear^.Y);
-if pY + cHHRadius >= cWaterLine then exit(false);
-if (Gear^.State and gstMoving) <> 0 then
-   begin
-   inc(GoInfo.Ticks);
-   Gear^.dY:= Gear^.dY + cGravity;
-   if Gear^.dY > _0_4 then
-      begin
-      Goinfo.FallPix:= 0;
-      HHJump(AltGear, jmpLJump, GoInfo); // try ljump instead of fall with damage
-      exit(false)
-      end;
-   Gear^.Y:= Gear^.Y + Gear^.dY;
-   if hwRound(Gear^.Y) > pY then inc(GoInfo.FallPix);
-   if TestCollisionYwithGear(Gear, 1) <> 0 then
-      begin
-      inc(GoInfo.Ticks, 410);
-      Gear^.State:= Gear^.State and not (gstMoving or gstHHJumping);
-      Gear^.dY:= _0;
-      HHJump(AltGear, jmpLJump, GoInfo); // try ljump instead of fall
-      exit(true)
-      end;
-   continue
-   end;
-   if (Gear^.Message and gmLeft  )<>0 then Gear^.dX:= -cLittle else
-   if (Gear^.Message and gmRight )<>0 then Gear^.dX:=  cLittle else exit(false);
-   if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
-      begin
-      if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -5, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -4, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX))
-         or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-      end;
-
-   if not TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
-      begin
-      Gear^.X:= Gear^.X + int2hwFloat(hwSign(Gear^.dX));
-      inc(GoInfo.Ticks, cHHStepTicks)
-      end;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-   begin
-   Gear^.Y:= Gear^.Y + _1;
-   if TestCollisionYwithGear(Gear, 1) = 0 then
-      begin
-      Gear^.Y:= Gear^.Y - _6;
-      Gear^.dY:= _0;
-      Gear^.State:= Gear^.State or gstMoving
-      end
-   end
-   end
-   end
-   end
-   end
-   end;
-if (pX <> hwRound(Gear^.X)) and ((Gear^.State and gstMoving) = 0) then
-   exit(true);
+        {if ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) then 
+            begin
+            LandPixels[hwRound(Gear^.Y), hwRound(Gear^.X)]:= random($FFFFFFFF);//Gear^.Hedgehog^.Team^.Clan^.Color;
+            UpdateLandTexture(hwRound(Gear^.X), 1, hwRound(Gear^.Y), 1, true);
+            end;}
+
+    pX:= hwRound(Gear^.X);
+    pY:= hwRound(Gear^.Y);
+    if pY + cHHRadius >= cWaterLine then
+        begin
+        if AltGear^.Hedgehog^.BotLevel < 4 then
+            AddWalkBonus(pX, tY, 250, -40);
+        exit(false)
+        end;
+        
+    // hog is falling    
+    if (Gear^.State and gstMoving) <> 0 then
+        begin
+        inc(GoInfo.Ticks);
+        Gear^.dY:= Gear^.dY + cGravity;
+        if Gear^.dY > _0_4 then
+            begin
+            GoInfo.FallPix:= 0;
+            // try ljump instead of fall with damage
+            HHJump(AltGear, jmpLJump, GoInfo); 
+            if AltGear^.Hedgehog^.BotLevel < 4 then
+                AddWalkBonus(pX, tY, 175, -20);
+            exit(false)
+            end;
+        Gear^.Y:= Gear^.Y + Gear^.dY;
+        if hwRound(Gear^.Y) > pY then
+            inc(GoInfo.FallPix);
+        if TestCollisionYwithGear(Gear, 1) <> 0 then
+            begin
+            inc(GoInfo.Ticks, 410);
+            Gear^.State:= Gear^.State and (not (gstMoving or gstHHJumping));
+            Gear^.dY:= _0;
+            // try ljump instead of fall
+            HHJump(AltGear, jmpLJump, GoInfo);
+            exit(true)
+            end;
+        continue
+        end;
+
+        // usual walk
+        if (Gear^.Message and gmLeft) <> 0 then
+            Gear^.dX:= -cLittle
+        else
+            if (Gear^.Message and gmRight) <> 0 then
+                Gear^.dX:=  cLittle
+            else
+                exit(false);
+
+        if MakeHedgehogsStep(Gear) then
+            inc(GoInfo.Ticks, cHHStepTicks);
+
+        // we have moved for 1 px
+        if (pX <> hwRound(Gear^.X)) and ((Gear^.State and gstMoving) = 0) then
+            exit(true)
 until (pX = hwRound(Gear^.X)) and (pY = hwRound(Gear^.Y)) and ((Gear^.State and gstMoving) = 0);
+
 HHJump(AltGear, jmpHJump, GoInfo);
-HHGo:= false;
 end;
 
 function AIrndSign(num: LongInt): LongInt;
 begin
-if random(2) = 0 then AIrndSign:=   num
-                 else AIrndSign:= - num
+if random(2) = 0 then
+    AIrndSign:=   num
+else
+    AIrndSign:= - num
 end;
 
 procedure initModule;
@@ -504,7 +772,6 @@ end;
 
 procedure freeModule;
 begin
-
 end;
 
 end.
diff --git a/hedgewars/uAmmos.pas b/hedgewars/uAmmos.pas
index 220f200..b5247d7 100644
--- a/hedgewars/uAmmos.pas
+++ b/hedgewars/uAmmos.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,20 +20,21 @@
 
 unit uAmmos;
 interface
-uses uConsts, uTypes;
+uses uConsts, uTypes, uStore;
 
 procedure initModule;
 procedure freeModule;
 
 procedure AddAmmoStore;
-procedure SetAmmoLoadout(s: shortstring);
-procedure SetAmmoProbability(s: shortstring);
-procedure SetAmmoDelay(s: shortstring);
-procedure SetAmmoReinforcement(s: shortstring);
+procedure SetAmmoLoadout(var s: shortstring);
+procedure SetAmmoProbability(var s: shortstring);
+procedure SetAmmoDelay(var s: shortstring);
+procedure SetAmmoReinforcement(var s: shortstring);
 procedure AssignStores;
 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
-procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
-function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): boolean;
+procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; amt: LongWord);
+procedure SetAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
+function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): LongWord;
 procedure PackAmmo(Ammo: PHHAmmo; Slot: LongInt);
 procedure OnUsedAmmo(var Hedgehog: THedgehog);
 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType);
@@ -43,13 +44,13 @@ procedure SetWeapon(weap: TAmmoType);
 procedure DisableSomeWeapons;
 procedure ResetWeapons;
 function  GetAmmoByNum(num: Longword): PHHAmmo;
-function  GetAmmoEntry(var Hedgehog: THedgehog): PAmmo;
+function  GetCurAmmoEntry(var Hedgehog: THedgehog): PAmmo;
 function  GetAmmoEntry(var Hedgehog: THedgehog; am: TAmmoType): PAmmo;
 
 var StoreCnt: Longword;
 
 implementation
-uses uLocale, uMobile, uVariables, uCommands, uUtils, uCaptions, uDebug;
+uses uLocale, uVariables, uCommands, uUtils, uCaptions, uDebug;
 
 type TAmmoCounts = array[TAmmoType] of Longword;
 var StoresList: array[0..Pred(cMaxHHs)] of PHHAmmo;
@@ -67,13 +68,15 @@ FillChar(Ammo^, sizeof(Ammo^), 0);
 for a:= Low(TAmmoType) to High(TAmmoType) do
     begin
     if cnts[a] > 0 then
-       begin
-       TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true);
-       Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]]:= Ammoz[a].Ammo;
-       with Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]] do Count:= cnts[a];
-       inc(mi[Ammoz[a].Slot])
-       end
-    end
+        begin
+        TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true);
+        Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]]:= Ammoz[a].Ammo;
+        with Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]] do
+            Count:= cnts[a];
+        inc(mi[Ammoz[a].Slot])
+        end
+    end;
+AmmoMenuInvalidated:= true;
 end;
 
 procedure AddAmmoStore;
@@ -103,31 +106,36 @@ for a:= Low(TAmmoType) to High(TAmmoType) do
             cnt:= AMMO_INFINITE;
             Ammoz[a].Probability:= 0
             end;
-        if Ammoz[a].NumberInCase = 0 then Ammoz[a].Probability:= 0;
+        if Ammoz[a].NumberInCase = 0 then
+            Ammoz[a].Probability:= 0;
 
         // avoid things we already have by scheme
         // merge this into DisableSomeWeapons ?
-        if ((a = amLowGravity) and ((GameFlags and gfLowGravity) <> 0)) or
-           ((a = amInvulnerable) and ((GameFlags and gfInvulnerable) <> 0)) or
-           ((a = amLaserSight) and ((GameFlags and gfLaserSight) <> 0)) or
-           ((a = amVampiric) and ((GameFlags and gfVampiric) <> 0)) or
-           ((a = amExtraTime) and (cHedgehogTurnTime >= 1000000)) or
-            (a = amStructure) then
+        if ((a = amLowGravity) and ((GameFlags and gfLowGravity) <> 0))
+        or ((a = amInvulnerable) and ((GameFlags and gfInvulnerable) <> 0))
+        or ((a = amLaserSight) and ((GameFlags and gfLaserSight) <> 0))
+        or ((a = amVampiric) and ((GameFlags and gfVampiric) <> 0))
+        or ((a = amExtraTime) and (cHedgehogTurnTime >= 1000000)) then
             begin
             cnt:= 0;
             Ammoz[a].Probability:= 0
             end;
         ammos[a]:= cnt;
 
-        if ((GameFlags and gfKing) <> 0) and ((GameFlags and gfPlaceHog) = 0) and (Ammoz[a].SkipTurns = 0) and (a <> amTeleport) and (a <> amSkip) then
+        if ((GameFlags and gfKing) <> 0) and ((GameFlags and gfPlaceHog) = 0)
+        and (Ammoz[a].SkipTurns = 0) and (a <> amTeleport) and (a <> amSkip) then
             Ammoz[a].SkipTurns:= 1;
 
-        if ((GameFlags and gfPlaceHog) <> 0) and
-            (a <> amTeleport) and (a <> amSkip) and
-            (Ammoz[a].SkipTurns < 10000) then inc(Ammoz[a].SkipTurns,10000);
-    if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then ammos[a]:= AMMO_INFINITE
+        if ((GameFlags and gfPlaceHog) <> 0)
+        and (a <> amTeleport) and (a <> amSkip)
+        and (Ammoz[a].SkipTurns < 10000) then
+            inc(Ammoz[a].SkipTurns,10000);
+    if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then
+        ammos[a]:= AMMO_INFINITE
         end 
-    else ammos[a]:= AMMO_INFINITE;
+        
+    else
+        ammos[a]:= AMMO_INFINITE;
     if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then 
         InitialCounts[Pred(StoreCnt)][a]:= cnt
     else
@@ -138,13 +146,13 @@ end;
 
 function GetAmmoByNum(num: Longword): PHHAmmo;
 begin
-TryDo(num < StoreCnt, 'Invalid store number', true);
-exit(StoresList[num])
+    TryDo(num < StoreCnt, 'Invalid store number', true);
+    GetAmmoByNum:= StoresList[num]
 end;
 
-function GetAmmoEntry(var Hedgehog: THedgehog): PAmmo;
+function GetCurAmmoEntry(var Hedgehog: THedgehog): PAmmo;
 begin
-GetAmmoEntry:= GetAmmoEntry(Hedgehog, Hedgehog.CurAmmoType)
+    GetCurAmmoEntry:= GetAmmoEntry(Hedgehog, Hedgehog.CurAmmoType)
 end;
 
 function GetAmmoEntry(var Hedgehog: THedgehog; am: TAmmoType): PAmmo;
@@ -154,9 +162,11 @@ with Hedgehog do
     begin
     slot:= Ammoz[am].Slot;
     ammoidx:= 0;
-    while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> am) do inc(ammoidx);
+    while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> am) do
+        inc(ammoidx);
     GetAmmoEntry:= @Ammo^[slot, ammoidx];
-    if (Ammo^[slot, ammoidx].AmmoType <> am) then GetAmmoEntry:= GetAmmoEntry(Hedgehog, amNothing)
+    if (Ammo^[slot, ammoidx].AmmoType <> am) then
+        GetAmmoEntry:= GetAmmoEntry(Hedgehog, amNothing)
     end;
 end;
 
@@ -165,35 +175,42 @@ var t: LongInt;
     i: Longword;
 begin
 for t:= 0 to Pred(TeamsCount) do
-   with TeamsArray[t]^ do
-      begin
-      for i:= 0 to cMaxHHIndex do
-          if Hedgehogs[i].Gear <> nil then
-             begin
-             Hedgehogs[i].Ammo:= GetAmmoByNum(Hedgehogs[i].AmmoStore);
-             if (GameFlags and gfPlaceHog) <> 0 then
-                Hedgehogs[i].CurAmmoType:= amTeleport
-             else
-                Hedgehogs[i].CurAmmoType:= amNothing
-             end
-      end
+    with TeamsArray[t]^ do
+        begin
+        for i:= 0 to cMaxHHIndex do
+            if Hedgehogs[i].Gear <> nil then
+                begin
+                Hedgehogs[i].Ammo:= GetAmmoByNum(Hedgehogs[i].AmmoStore);
+                if (GameFlags and gfPlaceHog) <> 0 then
+                    Hedgehogs[i].CurAmmoType:= amTeleport
+                else
+                    Hedgehogs[i].CurAmmoType:= amNothing
+                end
+        end
 end;
 
-procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
+procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; amt: LongWord);
 var cnt: LongWord;
     a: PAmmo;
 begin
 a:= GetAmmoEntry(Hedgehog, ammo);
-if (a^.AmmoType <> amNothing) then cnt:= a^.Count
-else cnt:= 0;
+if (a^.AmmoType <> amNothing) then
+    cnt:= a^.Count
+else
+    cnt:= 0;
 if (cnt <> AMMO_INFINITE) then
     begin
-    inc(cnt, Ammoz[ammo].NumberInCase);
-    AddAmmo(Hedgehog, ammo, cnt)
+    inc(cnt, amt);
+    SetAmmo(Hedgehog, ammo, cnt)
     end
 end;
 
-procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
+procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
+begin
+    AddAmmo(Hedgehog, ammo, Ammoz[ammo].NumberInCase);
+end;
+
+procedure SetAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
 var ammos: TAmmoCounts;
     slot, ami: LongInt;
     hhammo: PHHAmmo;
@@ -207,19 +224,19 @@ hhammo:= Hedgehog.Ammo;
 for slot:= 0 to cMaxSlotIndex do
     for ami:= 0 to cMaxSlotAmmoIndex do
         if hhammo^[slot, ami].Count > 0 then
-           ammos[hhammo^[slot, ami].AmmoType]:= hhammo^[slot, ami].Count;
+            ammos[hhammo^[slot, ami].AmmoType]:= hhammo^[slot, ami].Count;
 
 ammos[ammo]:= cnt;
 if ammos[ammo] > AMMO_INFINITE then ammos[ammo]:= AMMO_INFINITE;
 
 FillAmmoStore(hhammo, ammos);
-CurWeapon:= GetAmmoEntry(Hedgehog);
+CurWeapon:= GetCurAmmoEntry(Hedgehog);
 with Hedgehog, CurWeapon^ do
-        if (Count = 0) or (AmmoType = amNothing) then
-            begin
-            PackAmmo(Ammo, Ammoz[AmmoType].Slot);
-            CurAmmoType:= amNothing
-            end
+    if (Count = 0) or (AmmoType = amNothing) then
+        begin
+        PackAmmo(Ammo, Ammoz[AmmoType].Slot);
+        CurAmmoType:= amNothing
+        end
 end;
 
 procedure PackAmmo(Ammo: PHHAmmo; Slot: LongInt);
@@ -227,24 +244,27 @@ var ami: LongInt;
     b: boolean;
 begin
     repeat
-      b:= false;
-      ami:= 0;
-      while (not b) and (ami < cMaxSlotAmmoIndex) do
-          if (Ammo^[Slot, ami].Count = 0)
-             and (Ammo^[Slot, ami + 1].Count > 0) then b:= true
-                                                  else inc(ami);
-      if b then // there is a free item in ammo stack
-         begin
-         Ammo^[Slot, ami]:= Ammo^[Slot, ami + 1];
-         Ammo^[Slot, ami + 1].Count:= 0
-         end;
+        b:= false;
+        ami:= 0;
+        while (not b) and (ami < cMaxSlotAmmoIndex) do
+            if (Ammo^[Slot, ami].Count = 0)
+            and (Ammo^[Slot, ami + 1].Count > 0) then
+                b:= true
+            else
+                inc(ami);
+        if b then // there is a free item in ammo stack
+            begin
+            Ammo^[Slot, ami]:= Ammo^[Slot, ami + 1];
+            Ammo^[Slot, ami + 1].Count:= 0
+            end;
     until not b;
+AmmoMenuInvalidated:= true;
 end;
 
 procedure OnUsedAmmo(var Hedgehog: THedgehog);
 var CurWeapon: PAmmo;
 begin
-CurWeapon:= GetAmmoEntry(Hedgehog);
+CurWeapon:= GetCurAmmoEntry(Hedgehog);
 with Hedgehog do
     begin
 
@@ -257,44 +277,50 @@ with Hedgehog do
                 begin
                 PackAmmo(Ammo, Ammoz[AmmoType].Slot);
                 //SwitchNotHeldAmmo(Hedgehog);
+                if CurAmmoType = amKnife then LoadHedgehogHat(Hedgehog, Hedgehog.Hat);
                 CurAmmoType:= amNothing
                 end
             end
     end;
-uMobile.AmmoUpdate;
 end;
 
-function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): boolean;
+function  HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): LongWord;
 var slot, ami: LongInt;
 begin
-Slot:= Ammoz[Ammo].Slot;
-ami:= 0;
-while (ami <= cMaxSlotAmmoIndex) do
-      begin
-      with Hedgehog.Ammo^[Slot, ami] do
+    HHHasAmmo:= 0;
+    Slot:= Ammoz[Ammo].Slot;
+    ami:= 0;
+    while (ami <= cMaxSlotAmmoIndex) do
+    begin
+        with Hedgehog.Ammo^[Slot, ami] do
             if (AmmoType = Ammo) then
-               exit((Count > 0) and (Hedgehog.Team^.Clan^.TurnNumber > Ammoz[AmmoType].SkipTurns));
-      inc(ami)
-      end;
-HHHasAmmo:= false
+                if Hedgehog.Team^.Clan^.TurnNumber > Ammoz[AmmoType].SkipTurns then
+                    exit(Count)
+                else 
+                    exit(0);
+        inc(ami)
+    end;
 end;
 
 procedure ApplyAngleBounds(var Hedgehog: THedgehog; AmmoType: TAmmoType);
 begin
-with Hedgehog do
-    begin
-    CurMinAngle:= Ammoz[AmmoType].minAngle;
-    if Ammoz[AmmoType].maxAngle <> 0 then
-        CurMaxAngle:= Ammoz[AmmoType].maxAngle
-    else
-        CurMaxAngle:= cMaxAngle;
-
-    with Hedgehog.Gear^ do
+if Hedgehog.Gear <> nil then
+    with Hedgehog do
         begin
-        if Angle < CurMinAngle then Angle:= CurMinAngle;
-        if Angle > CurMaxAngle then Angle:= CurMaxAngle;
+        CurMinAngle:= Ammoz[AmmoType].minAngle;
+        if Ammoz[AmmoType].maxAngle <> 0 then
+            CurMaxAngle:= Ammoz[AmmoType].maxAngle
+        else
+            CurMaxAngle:= cMaxAngle;
+
+        with Hedgehog.Gear^ do
+            begin
+            if Angle < CurMinAngle then
+                Angle:= CurMinAngle;
+            if Angle > CurMaxAngle then
+                Angle:= CurMaxAngle;
+            end
         end
-    end
 end;
 
 procedure SwitchToFirstLegalAmmo(var Hedgehog: THedgehog);
@@ -309,11 +335,10 @@ with Hedgehog do
         ((Ammo^[slot, ammoidx].Count = 0) or
         (Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0))
         do
-        begin
-        while (ammoidx <= cMaxSlotAmmoIndex) and
-            ((Ammo^[slot, ammoidx].Count = 0) or
-            (Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0))
-            do inc(ammoidx);
+            begin
+            while (ammoidx <= cMaxSlotAmmoIndex)
+            and ((Ammo^[slot, ammoidx].Count = 0) or (Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0))
+                do inc(ammoidx);
 
         if (ammoidx > cMaxSlotAmmoIndex) then
             begin
@@ -323,6 +348,7 @@ with Hedgehog do
         end;
     TryDo(slot <= cMaxSlotIndex, 'Ammo slot index overflow', true);
     CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
+    if CurAmmoType = amKnife then LoadHedgehogHat(Hedgehog, 'Reserved/chef')
     end
 end;
 
@@ -336,30 +362,33 @@ with Hedgehog do
     begin
     Timer:= 10;
 
-    CurWeapon:= GetAmmoEntry(Hedgehog);
+    CurWeapon:= GetCurAmmoEntry(Hedgehog);
 
     if (CurWeapon^.Count = 0) then
         SwitchToFirstLegalAmmo(Hedgehog)
-    else if CurWeapon^.AmmoType = amNothing then Hedgehog.CurAmmoType:= amNothing;
+    else if CurWeapon^.AmmoType = amNothing then
+        Hedgehog.CurAmmoType:= amNothing;
 
-    CurWeapon:= GetAmmoEntry(Hedgehog);
+    CurWeapon:= GetCurAmmoEntry(Hedgehog);
 
     ApplyAngleBounds(Hedgehog, CurWeapon^.AmmoType);
 
     with CurWeapon^ do
         begin
         s:= trammo[Ammoz[AmmoType].NameId];
-        if (Count <> AMMO_INFINITE) and not (Hedgehog.Team^.ExtDriven or (Hedgehog.BotLevel > 0)) then
+        if (Count <> AMMO_INFINITE) and (not (Hedgehog.Team^.ExtDriven or (Hedgehog.BotLevel > 0))) then
             s:= s + ' (' + IntToStr(Count) + ')';
         if (Propz and ammoprop_Timerable) <> 0 then
             s:= s + ', ' + IntToStr(Timer div 1000) + ' ' + trammo[sidSeconds];
         AddCaption(s, Team^.Clan^.Color, capgrpAmmoinfo);
-        if (Propz and ammoprop_NeedTarget) <> 0
-            then begin
-            Gear^.State:= Gear^.State or      gstHHChooseTarget;
+        if (Propz and ammoprop_NeedTarget) <> 0 then
+            begin
+            if Gear <> nil then Gear^.State:= Gear^.State or      gstHHChooseTarget;
             isCursorVisible:= true
-            end else begin
-            Gear^.State:= Gear^.State and not gstHHChooseTarget;
+            end
+        else
+            begin
+            if Gear <> nil then Gear^.State:= Gear^.State and (not gstHHChooseTarget);
             isCursorVisible:= false
             end;
         end
@@ -369,8 +398,8 @@ end;
 procedure SwitchNotHeldAmmo(var Hedgehog: THedgehog);
 begin
 with Hedgehog do
-    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_DontHold) <> 0) or
-        (Ammoz[CurAmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0) then
+    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_DontHold) <> 0)
+    or (Ammoz[CurAmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber >= 0) then
         SwitchToFirstLegalAmmo(Hedgehog);
 end;
 
@@ -398,25 +427,26 @@ for i:= 0 to Pred(StoreCnt) do
         end;
 
 for t:= Low(TAmmoType) to High(TAmmoType) do
-    if (Ammoz[t].Ammo.Propz and ammoprop_NotBorder) <> 0 then Ammoz[t].Probability:= 0
+    if (Ammoz[t].Ammo.Propz and ammoprop_NotBorder) <> 0 then
+        Ammoz[t].Probability:= 0
 end;
 
-procedure SetAmmoLoadout(s: shortstring);
+procedure SetAmmoLoadout(var s: shortstring);
 begin
     ammoLoadout:= s;
 end;
 
-procedure SetAmmoProbability(s: shortstring);
+procedure SetAmmoProbability(var s: shortstring);
 begin
     ammoProbability:= s;
 end;
 
-procedure SetAmmoDelay(s: shortstring);
+procedure SetAmmoDelay(var s: shortstring);
 begin
     ammoDelay:= s;
 end;
 
-procedure SetAmmoReinforcement(s: shortstring);
+procedure SetAmmoReinforcement(var s: shortstring);
 begin
     ammoReinforcement:= s;
 end;
@@ -427,16 +457,16 @@ var i, t: Longword;
     a: TAmmoType;
 begin
 for t:= 0 to Pred(TeamsCount) do
-   with TeamsArray[t]^ do
-      for i:= 0 to cMaxHHIndex do
-          if Hedgehogs[i].Gear <> nil then
-             begin
-             FillAmmoStore(Hedgehogs[i].Ammo, InitialCounts[Hedgehogs[i].AmmoStore]);
-             Hedgehogs[i].CurAmmoType:= amNothing
-             end;
+    with TeamsArray[t]^ do
+        for i:= 0 to cMaxHHIndex do
+            Hedgehogs[i].CurAmmoType:= amNothing;
+
+for i:= 0 to Pred(StoreCnt) do
+    FillAmmoStore(StoresList[i], InitialCounts[i]);
 
 for a:= Low(TAmmoType) to High(TAmmoType) do
-    if Ammoz[a].SkipTurns >= 10000 then dec(Ammoz[a].SkipTurns,10000)
+    if Ammoz[a].SkipTurns >= 10000 then
+        dec(Ammoz[a].SkipTurns,10000)
 end;
 
 
@@ -448,18 +478,26 @@ AddAmmoStore
 end;
 
 procedure initModule;
+var i: Longword;
 begin
-    RegisterVariable('ammloadt', vtCommand, @SetAmmoLoadout, false);
-    RegisterVariable('ammdelay', vtCommand, @SetAmmoDelay, false);
-    RegisterVariable('ammprob',  vtCommand, @SetAmmoProbability, false);
-    RegisterVariable('ammreinf', vtCommand, @SetAmmoReinforcement, false);
-    RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false);
+    RegisterVariable('ammloadt', @SetAmmoLoadout, false);
+    RegisterVariable('ammdelay', @SetAmmoDelay, false);
+    RegisterVariable('ammprob',  @SetAmmoProbability, false);
+    RegisterVariable('ammreinf', @SetAmmoReinforcement, false);
+    RegisterVariable('ammstore', @chAddAmmoStore , false);
 
     StoreCnt:= 0;
     ammoLoadout:= '';
     ammoProbability:= '';
     ammoDelay:= '';
     ammoReinforcement:= '';
+    for i:=1 to ord(High(TAmmoType)) do
+        begin
+        ammoLoadout:= ammoLoadout + '0';
+        ammoProbability:= ammoProbability + '0';
+        ammoDelay:= ammoDelay + '0';
+        ammoReinforcement:= ammoReinforcement + '0'
+        end;
     FillChar(InitialCounts, sizeof(InitialCounts), 0)
 end;
 
@@ -467,7 +505,8 @@ procedure freeModule;
 var i: LongWord;
 begin
     if StoreCnt > 0 then
-        for i:= 0 to Pred(StoreCnt) do Dispose(StoresList[i])
+        for i:= 0 to Pred(StoreCnt) do
+            Dispose(StoresList[i])
 end;
 
 end.
diff --git a/hedgewars/uCaptions.pas b/hedgewars/uCaptions.pas
index 97e87dc..e14f760 100644
--- a/hedgewars/uCaptions.pas
+++ b/hedgewars/uCaptions.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -34,11 +34,11 @@ implementation
 uses uTextures, uRenderUtils, uVariables, uRender;
 
 type TCaptionStr = record
-                   Tex: PTexture;
-                   EndTime: LongWord;
-                   Text: shortstring;
-                   Color: Longword
-                   end;
+    Tex: PTexture;
+    EndTime: LongWord;
+    Text: shortstring;
+    Color: Longword
+    end;
 var
     Captions: array[TCapGroup] of TCaptionStr;
 
@@ -69,7 +69,8 @@ procedure ReloadCaptions(unload: boolean);
 var Group: TCapGroup;
 begin
 for Group:= Low(TCapGroup) to High(TCapGroup) do
-    if unload then FreeTexture(Captions[Group].Tex)
+    if unload then
+        FreeTexture(Captions[Group].Tex)
     else if Captions[Group].Text <> '' then
         Captions[Group].Tex:= RenderStringTex(Captions[Group].Text, Captions[Group].Color, fntBig)
 end;
@@ -79,7 +80,7 @@ var
     grp: TCapGroup;
     offset: LongInt;
 begin
-{$IFDEF IPHONEOS}
+{$IFDEF USE_TOUCH_INTERFACE}
     offset:= 48;
 {$ELSE}
     offset:= 8;
@@ -89,7 +90,7 @@ begin
         with Captions[grp] do
             if Tex <> nil then
                 begin
-                DrawCentered(0, offset, Tex);
+                DrawTextureCentered(0, offset, Tex);
                 inc(offset, Tex^.h + 2);
                 if EndTime <= RealTicks then
                     begin
diff --git a/hedgewars/uChat.pas b/hedgewars/uChat.pas
index 42f0401..623bc09 100644
--- a/hedgewars/uChat.pas
+++ b/hedgewars/uChat.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -31,16 +31,16 @@ procedure DrawChat;
 procedure KeyPressChat(Key: Longword);
 
 implementation
-uses SDLh, uKeys, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO;
+uses SDLh, uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO;
 
 const MaxStrIndex = 27;
 
 type TChatLine = record
-        Tex: PTexture;
-        Time: Longword;
-        Width: LongInt;
-        s: shortstring;
-        end;
+    Tex: PTexture;
+    Time: Longword;
+    Width: LongInt;
+    s: shortstring;
+    end;
 
 var Strs: array[0 .. MaxStrIndex] of TChatLine;
     MStrs: array[0 .. MaxStrIndex] of shortstring;
@@ -52,7 +52,8 @@ var Strs: array[0 .. MaxStrIndex] of TChatLine;
     ChatReady: boolean;
     showAll: boolean;
 
-const colors: array[#1..#6] of TSDL_Color = (
+const colors: array[#0..#6] of TSDL_Color = (
+    (r:$FF; g:$FF; b:$FF; unused:$FF), // unused, feel free to take it for anything
     (r:$FF; g:$FF; b:$FF; unused:$FF), // chat message [White]
     (r:$FF; g:$00; b:$FF; unused:$FF), // action message [Purple]
     (r:$90; g:$FF; b:$90; unused:$FF), // join/leave message [Lime]
@@ -104,7 +105,8 @@ end;
 procedure ReloadLines;
 var i, t: LongWord;
 begin
-    if InputStr.s <> '' then SetLine(InputStr, InputStr.s, true);
+    if InputStr.s <> '' then
+        SetLine(InputStr, InputStr.s, true);
     for i:= 0 to MaxStrIndex do
         if Strs[i].s <> '' then
             begin
@@ -152,8 +154,7 @@ r.x:= 6 - cScreenWidth div 2;
 r.y:= (visibleCount - t) * 16 + 10;
 r.h:= 16;
 
-if (GameState = gsChat)
-    and (InputStr.Tex <> nil) then
+if (GameState = gsChat) and (InputStr.Tex <> nil) then
     begin
     r.w:= InputStr.Width;
     DrawFillRect(r);
@@ -165,9 +166,8 @@ if (GameState = gsChat)
 
 dec(r.y, 16);
 
-while (((t < 7) and (Strs[i].Time > RealTicks)) or
-       ((t < MaxStrIndex) and showAll)) and
-      (Strs[i].Tex <> nil) do
+while (((t < 7) and (Strs[i].Time > RealTicks)) or ((t < MaxStrIndex) and showAll))
+and (Strs[i].Tex <> nil) do
     begin
     r.w:= Strs[i].Width;
     DrawFillRect(r);
@@ -177,7 +177,11 @@ while (((t < 7) and (Strs[i].Time > RealTicks)) or
     DrawTexture(8 - cScreenWidth div 2, (visibleCount - t) * 16 - 6, Strs[i].Tex);
     dec(r.y, 16);
 
-    if i = 0 then i:= MaxStrIndex else dec(i);
+    if i = 0 then
+        i:= MaxStrIndex
+    else
+        dec(i);
+        
     inc(cnt);
     inc(t)
     end;
@@ -198,12 +202,19 @@ var i: TWave;
 begin
 t:= LocalTeam;
 x:= 0;
-if (s[1] = '"') and (s[Length(s)] = '"') then x:= 1
-else if (s[1] = '''') and (s[Length(s)] = '''') then x:= 2
-else if (s[1] = '-') and (s[Length(s)] = '-') then x:= 3;
+if (s[1] = '"') and (s[Length(s)] = '"')
+    then x:= 1
+    
+else if (s[1] = '''') and (s[Length(s)] = '''') then
+    x:= 2
+    
+else if (s[1] = '-') and (s[Length(s)] = '-') then
+    x:= 3;
+    
 if not CurrentTeam^.ExtDriven and (x <> 0) then
     for c:= 0 to Pred(TeamsCount) do
-        if (TeamsArray[c] = CurrentTeam) then t:= c;
+        if (TeamsArray[c] = CurrentTeam) then
+            t:= c;
 
 if x <> 0 then
     begin
@@ -262,11 +273,10 @@ if (s[1] = '/') and (copy(s, 1, 4) <> '/me ') then
 end;
 
 procedure KeyPressChat(Key: Longword);
-const firstByteMark: array[1..4] of byte = (0, $C0, $E0, $F0);
+const firstByteMark: array[0..3] of byte = (0, $C0, $E0, $F0);
 var i, btw: integer;
     utf8: shortstring;
 begin
-
 if Key <> 0 then
     case Key of
         {Backspace}
@@ -282,6 +292,7 @@ if Key <> 0 then
                 FreezeEnterKey;
                 SDL_EnableKeyRepeat(0,0);
                 GameState:= gsGame;
+                ResetKbd;
                 end;
         {Return}
         3, 13, 271: begin
@@ -293,12 +304,17 @@ if Key <> 0 then
             FreezeEnterKey;
             SDL_EnableKeyRepeat(0,0);
             GameState:= gsGame;
+            ResetKbd;
             end;
     else
-    if (Key < $80) then btw:= 1
-    else if (Key < $800) then btw:= 2
-    else if (Key < $10000) then btw:= 3
-    else btw:= 4;
+        if (Key < $80) then
+            btw:= 1
+        else if (Key < $800) then
+            btw:= 2
+        else if (Key < $10000) then
+            btw:= 3
+        else
+            btw:= 4;
 
     utf8:= '';
 
@@ -308,9 +324,10 @@ if Key <> 0 then
         Key:= Key shr 6
         end;
 
-    utf8:= char(Key or firstByteMark[btw]) + utf8;
+    utf8:= char(Key or firstByteMark[Pred(btw)]) + utf8;
 
-    if byte(InputStr.s[0]) + btw > 240 then exit;
+    if byte(InputStr.s[0]) + btw > 240 then
+        exit;
 
     InputStrL[byte(InputStr.s[0]) + btw]:= InputStr.s[0];
     SetLine(InputStr, InputStr.s + utf8, true)
@@ -327,7 +344,7 @@ begin
     SendIPC('s' + s);
 
     if copy(s, 1, 4) = '/me ' then
-        s:= #2'* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
+        s:= #2 + '* ' + UserNick + ' ' + copy(s, 5, Length(s) - 4)
     else
         s:= #1 + UserNick + ': ' + s;
 
@@ -346,7 +363,7 @@ end;
 procedure chHistory(var s: shortstring);
 begin
     s:= s; // avoid compiler hint
-    uChat.showAll:= not uChat.showAll
+    showAll:= not showAll
 end;
 
 procedure chChat(var s: shortstring);
@@ -359,6 +376,7 @@ begin
     else
         begin
         // err, does anyone have any documentation on this sequence?
+        // ^^ isn't it obvious? 27 is esc, 32 is space, inbetween is "/team"
         KeyPressChat(27);
         KeyPressChat(47);
         KeyPressChat(116);
@@ -372,11 +390,11 @@ end;
 procedure initModule;
 var i: ShortInt;
 begin
-    RegisterVariable('chatmsg', vtCommand, @chChatMessage, true);
-    RegisterVariable('say', vtCommand, @chSay, true);
-    RegisterVariable('team', vtCommand, @chTeamSay, true);
-    RegisterVariable('history', vtCommand, @chHistory, true );
-    RegisterVariable('chat', vtCommand, @chChat, true );
+    RegisterVariable('chatmsg', @chChatMessage, true);
+    RegisterVariable('say', @chSay, true);
+    RegisterVariable('team', @chTeamSay, true);
+    RegisterVariable('history', @chHistory, true );
+    RegisterVariable('chat', @chChat, true );
 
     lastStr:= 0;
     visibleCount:= 0;
@@ -385,14 +403,16 @@ begin
     missedCount:= 0;
 
     inputStr.Tex := nil;
-    for i:= 0 to MaxStrIndex do Strs[i].Tex := nil;
+    for i:= 0 to MaxStrIndex do
+        Strs[i].Tex := nil;
 end;
 
 procedure freeModule;
 var i: ShortInt;
 begin
     FreeTexture(InputStr.Tex);
-    for i:= 0 to MaxStrIndex do FreeTexture(Strs[i].Tex);
+    for i:= 0 to MaxStrIndex do
+        FreeTexture(Strs[i].Tex);
 end;
 
 end.
diff --git a/hedgewars/uCollisions.pas b/hedgewars/uCollisions.pas
index b909f8e..9717cf1 100644
--- a/hedgewars/uCollisions.pas
+++ b/hedgewars/uCollisions.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,9 +26,9 @@ const cMaxGearArrayInd = 1023;
 
 type PGearArray = ^TGearArray;
     TGearArray = record
-            ar: array[0..cMaxGearArrayInd] of PGear;
-            Count: Longword
-            end;
+        ar: array[0..cMaxGearArrayInd] of PGear;
+        Count: Longword
+        end;
 
 procedure initModule;
 procedure freeModule;
@@ -47,22 +47,25 @@ function  TestCollisionYKick(Gear: PGear; Dir: LongInt): boolean;
 function  TestCollisionX(Gear: PGear; Dir: LongInt): boolean;
 function  TestCollisionY(Gear: PGear; Dir: LongInt): boolean;
 
-function  TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt; withGear: boolean = true): boolean;
-function  TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt; withGear: boolean = true): boolean;
+function  TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt): boolean; inline;
+function  TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt; withGear: boolean): boolean;
+function  TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; inline;
+function  TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt; withGear: boolean): boolean;
 
 function  TestRectancleForObstacle(x1, y1, x2, y2: LongInt; landOnly: boolean): boolean;
 
 // returns: negative sign if going downhill to left, value is steepness (noslope/error = _0, 45° = _0_5)
 function  CalcSlopeBelowGear(Gear: PGear): hwFloat;
+function  CalcSlopeNearGear(Gear: PGear; dirX, dirY: LongInt): hwFloat;
 function  CalcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): Boolean;
 
 implementation
-uses uConsts, uLandGraphics, uVariables, uDebug, uGears;
+uses uConsts, uLandGraphics, uVariables, uDebug, uGearsList;
 
 type TCollisionEntry = record
-            X, Y, Radius: LongInt;
-            cGear: PGear;
-            end;
+    X, Y, Radius: LongInt;
+    cGear: PGear;
+    end;
 
 const MAXRECTSINDEX = 1023;
 var Count: Longword;
@@ -72,14 +75,15 @@ var Count: Longword;
 procedure AddGearCI(Gear: PGear);
 var t: PGear;
 begin
-if Gear^.CollisionIndex >= 0 then exit;
+if Gear^.CollisionIndex >= 0 then
+    exit;
 TryDo(Count <= MAXRECTSINDEX, 'Collision rects array overflow', true);
 with cinfos[Count] do
     begin
     X:= hwRound(Gear^.X);
     Y:= hwRound(Gear^.Y);
     Radius:= Gear^.Radius;
-    ChangeRoundInLand(X, Y, Radius - 1, true);
+    ChangeRoundInLand(X, Y, Radius - 1, true, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase));
     cGear:= Gear
     end;
 Gear^.CollisionIndex:= Count;
@@ -90,7 +94,8 @@ if (Count > (MAXRECTSINDEX-20)) then
     t:= GearsList;
     while (t <> nil) and (t^.Kind <> gtMine) do 
         t:= t^.NextGear;
-    if (t <> nil) then DeleteGear(t)
+    if (t <> nil) then
+        DeleteGear(t)
     end;
 end;
 
@@ -99,7 +104,7 @@ begin
 if Gear^.CollisionIndex >= 0 then
     begin
     with cinfos[Gear^.CollisionIndex] do
-        ChangeRoundInLand(X, Y, Radius - 1, false);
+        ChangeRoundInLand(X, Y, Radius - 1, false, (Gear = CurrentHedgehog^.Gear) or (Gear^.Kind = gtCase));
     cinfos[Gear^.CollisionIndex]:= cinfos[Pred(Count)];
     cinfos[Gear^.CollisionIndex].cGear^.CollisionIndex:= Gear^.CollisionIndex;
     Gear^.CollisionIndex:= -1;
@@ -113,7 +118,8 @@ var mx, my, tr: LongInt;
 begin
 CheckGearsCollision:= @ga;
 ga.Count:= 0;
-if Count = 0 then exit;
+if Count = 0 then
+    exit;
 mx:= hwRound(Gear^.X);
 my:= hwRound(Gear^.Y);
 
@@ -131,63 +137,63 @@ end;
 
 function TestCollisionXwithGear(Gear: PGear; Dir: LongInt): boolean;
 var x, y, i: LongInt;
-    TestWord: LongWord;
 begin
-if Gear^.IntersectGear <> nil then
-   with Gear^ do
-        if (hwRound(IntersectGear^.X) + IntersectGear^.Radius < hwRound(X) - Radius) or
-           (hwRound(IntersectGear^.X) - IntersectGear^.Radius > hwRound(X) + Radius) then
-           begin
-           IntersectGear:= nil;
-           TestWord:= 0
-           end else
-           TestWord:= 255
-   else TestWord:= 0;
+// Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap
+if (Gear^.CollisionMask = $FF7F) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and
+    ((hwRound(Gear^.Hedgehog^.Gear^.X) + Gear^.Hedgehog^.Gear^.Radius + 16 < hwRound(Gear^.X) - Gear^.Radius) or
+     (hwRound(Gear^.Hedgehog^.Gear^.X) - Gear^.Hedgehog^.Gear^.Radius - 16 > hwRound(Gear^.X) + Gear^.Radius)) then
+    Gear^.CollisionMask:= $FFFF;
 
 x:= hwRound(Gear^.X);
-if Dir < 0 then x:= x - Gear^.Radius
-           else x:= x + Gear^.Radius;
+if Dir < 0 then
+    x:= x - Gear^.Radius
+else
+    x:= x + Gear^.Radius;
+
+TestCollisionXwithGear:= true;
 if (x and LAND_WIDTH_MASK) = 0 then
-   begin
-   y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
-   i:= y + Gear^.Radius * 2 - 2;
-   repeat
-     if (y and LAND_HEIGHT_MASK) = 0 then
-        if Land[y, x] > TestWord then exit(true);
-     inc(y)
-   until (y > i);
-   end;
+    begin
+    y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
+    i:= y + Gear^.Radius * 2 - 2;
+    repeat
+        if (y and LAND_HEIGHT_MASK) = 0 then
+            if Land[y, x] and Gear^.CollisionMask <> 0 then
+                exit;
+        inc(y)
+    until (y > i);
+    end;
 TestCollisionXwithGear:= false
 end;
 
 function TestCollisionYwithGear(Gear: PGear; Dir: LongInt): Word;
 var x, y, i: LongInt;
-    TestWord: LongWord;
 begin
-if Gear^.IntersectGear <> nil then
-   with Gear^ do
-        if (hwRound(IntersectGear^.Y) + IntersectGear^.Radius < hwRound(Y) - Radius) or
-           (hwRound(IntersectGear^.Y) - IntersectGear^.Radius > hwRound(Y) + Radius) then
-           begin
-           IntersectGear:= nil;
-           TestWord:= 0
-           end else
-           TestWord:= 255
-   else TestWord:= 0;
+// Special case to emulate the old intersect gear clearing, but with a bit of slop for pixel overlap
+if (Gear^.CollisionMask = $FF7F) and (Gear^.Kind <> gtHedgehog) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) and
+    ((hwRound(Gear^.Hedgehog^.Gear^.Y) + Gear^.Hedgehog^.Gear^.Radius + 16 < hwRound(Gear^.Y) - Gear^.Radius) or
+     (hwRound(Gear^.Hedgehog^.Gear^.Y) - Gear^.Hedgehog^.Gear^.Radius - 16 > hwRound(Gear^.Y) + Gear^.Radius)) then
+    Gear^.CollisionMask:= $FFFF;
 
 y:= hwRound(Gear^.Y);
-if Dir < 0 then y:= y - Gear^.Radius
-           else y:= y + Gear^.Radius;
+if Dir < 0 then
+    y:= y - Gear^.Radius
+else
+    y:= y + Gear^.Radius;
+
 if (y and LAND_HEIGHT_MASK) = 0 then
-   begin
-   x:= hwRound(Gear^.X) - Gear^.Radius + 1;
-   i:= x + Gear^.Radius * 2 - 2;
-   repeat
-     if (x and LAND_WIDTH_MASK) = 0 then
-        if Land[y, x] > TestWord then exit(Land[y, x]);
-     inc(x)
-   until (x > i);
-   end;
+    begin
+    x:= hwRound(Gear^.X) - Gear^.Radius + 1;
+    i:= x + Gear^.Radius * 2 - 2;
+    repeat
+        if (x and LAND_WIDTH_MASK) = 0 then
+            if Land[y, x] and Gear^.CollisionMask <> 0 then
+                begin
+                TestCollisionYwithGear:= Land[y, x];
+                exit;
+                end;
+        inc(x)
+    until (x > i);
+    end;
 TestCollisionYwithGear:= 0
 end;
 
@@ -197,105 +203,131 @@ var x, y, mx, my, i: LongInt;
 begin
 flag:= false;
 x:= hwRound(Gear^.X);
-if Dir < 0 then x:= x - Gear^.Radius
-           else x:= x + Gear^.Radius;
+if Dir < 0 then
+    x:= x - Gear^.Radius
+else
+    x:= x + Gear^.Radius;
+
+TestCollisionXKick:= true;
 if (x and LAND_WIDTH_MASK) = 0 then
-   begin
-   y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
-   i:= y + Gear^.Radius * 2 - 2;
-   repeat
-     if (y and LAND_HEIGHT_MASK) = 0 then
-           if Land[y, x] > 255 then exit(true)
-           else if Land[y, x] <> 0 then flag:= true;
-     inc(y)
-   until (y > i);
-   end;
+    begin
+    y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
+    i:= y + Gear^.Radius * 2 - 2;
+    repeat
+        if (y and LAND_HEIGHT_MASK) = 0 then
+            if Land[y, x] > 255 then
+                exit
+            else if Land[y, x] <> 0 then
+                flag:= true;
+    inc(y)
+    until (y > i);
+    end;
 TestCollisionXKick:= flag;
 
 if flag then
-   begin
-   if hwAbs(Gear^.dX) < cHHKick then exit;
-   if (Gear^.State and gstHHJumping <> 0)
-   and (hwAbs(Gear^.dX) < _0_4) then exit;
-
-   mx:= hwRound(Gear^.X);
-   my:= hwRound(Gear^.Y);
-
-   for i:= 0 to Pred(Count) do
-    with cinfos[i] do
-      if (Gear <> cGear) and
-         (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2)) and
-         ((mx > x) xor (Dir > 0)) then
-         if ((cGear^.Kind in [gtHedgehog, gtMine]) and ((Gear^.State and gstNotKickable) = 0)) or
-            // only apply X kick if the barrel is knocked over
-            ((cGear^.Kind = gtExplosives) and ((cGear^.State and gsttmpflag) <> 0)) then
-             begin
-             with cGear^ do
-                  begin
-                  dX:= Gear^.dX;
-                  dY:= Gear^.dY * _0_5;
-                  State:= State or gstMoving;
-                  Active:= true
-                  end;
-             DeleteCI(cGear);
-             exit(false)
-             end
-   end
+    begin
+    if hwAbs(Gear^.dX) < cHHKick then
+        exit;
+    if (Gear^.State and gstHHJumping <> 0)
+    and (hwAbs(Gear^.dX) < _0_4) then
+        exit;
+
+    mx:= hwRound(Gear^.X);
+    my:= hwRound(Gear^.Y);
+
+    for i:= 0 to Pred(Count) do
+        with cinfos[i] do
+            if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2))
+            and ((mx > x) xor (Dir > 0)) and
+                (
+                  ((cGear^.Kind in [gtHedgehog, gtMine, gtKnife]) and ((Gear^.State and gstNotKickable) = 0)) or
+                // only apply X kick if the barrel is knocked over
+                ((cGear^.Kind = gtExplosives) and ((cGear^.State and gsttmpflag) <> 0))) then
+                    begin
+                    with cGear^ do
+                        begin
+                        dX:= Gear^.dX;
+                        dY:= Gear^.dY * _0_5;
+                        State:= State or gstMoving;
+                        if Kind = gtKnife then State:= State and (not gstCollision);
+                        Active:= true
+                        end;
+                    DeleteCI(cGear);
+                    TestCollisionXKick:= false;
+                    exit;
+                    end
+    end
 end;
 
 function TestCollisionYKick(Gear: PGear; Dir: LongInt): boolean;
-var x, y, mx, my, i: LongInt;
+var x, y, mx, my,  myr, i: LongInt;
     flag: boolean;
 begin
 flag:= false;
 y:= hwRound(Gear^.Y);
-if Dir < 0 then y:= y - Gear^.Radius
-           else y:= y + Gear^.Radius;
+if Dir < 0 then
+    y:= y - Gear^.Radius
+else
+    y:= y + Gear^.Radius;
+
+TestCollisionYKick:= true;
 if (y and LAND_HEIGHT_MASK) = 0 then
-   begin
-   x:= hwRound(Gear^.X) - Gear^.Radius + 1;
-   i:= x + Gear^.Radius * 2 - 2;
-   repeat
-     if (x and LAND_WIDTH_MASK) = 0 then
+    begin
+    x:= hwRound(Gear^.X) - Gear^.Radius + 1;
+    i:= x + Gear^.Radius * 2 - 2;
+    repeat
+    if (x and LAND_WIDTH_MASK) = 0 then
         if Land[y, x] > 0 then
-           if Land[y, x] > 255 then exit(true)
-           else if Land[y, x] <> 0 then flag:= true;
-     inc(x)
-   until (x > i);
-   end;
+            if Land[y, x] > 255 then
+                exit
+            else if Land[y, x] <> 0 then
+                flag:= true;
+    inc(x)
+    until (x > i);
+    end;
 TestCollisionYKick:= flag;
 
 if flag then
-   begin
-   if hwAbs(Gear^.dY) < cHHKick then exit(true);
-   if (Gear^.State and gstHHJumping <> 0)
-   and (not Gear^.dY.isNegative)
-   and (Gear^.dY < _0_4) then exit;
-
-   mx:= hwRound(Gear^.X);
-   my:= hwRound(Gear^.Y);
+    begin
+    if hwAbs(Gear^.dY) < cHHKick then
+        exit;
+    if (Gear^.State and gstHHJumping <> 0) and (not Gear^.dY.isNegative) and (Gear^.dY < _0_4) then
+        exit;
+
+    mx:= hwRound(Gear^.X);
+    my:= hwRound(Gear^.Y);
+    myr:= my+Gear^.Radius;
+
+    for i:= 0 to Pred(Count) do
+        with cinfos[i] do
+            if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2))
+            and ((myr > y) xor (Dir > 0)) and
+                (
+                 (cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives]) and 
+                 ((Gear^.State and gstNotKickable) = 0)) then
+                    begin
+                    with cGear^ do
+                        begin
+                        if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then
+                            dX:= Gear^.dX * _0_5;
+                        dY:= Gear^.dY;
+                        State:= State or gstMoving;
+                        if Kind = gtKnife then State:= State and (not gstCollision);
+                        Active:= true
+                        end;
+                    DeleteCI(cGear);
+                    TestCollisionYKick:= false;
+                    exit
+                    end
+    end
+end;
 
-   for i:= 0 to Pred(Count) do
-    with cinfos[i] do
-      if (Gear <> cGear) and
-         (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2)) and
-         ((my > y) xor (Dir > 0)) then
-         if (cGear^.Kind in [gtHedgehog, gtMine, gtExplosives]) and ((Gear^.State and gstNotKickable) = 0) then
-             begin
-             with cGear^ do
-                  begin
-                  if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then dX:= Gear^.dX * _0_5;
-                  dY:= Gear^.dY;
-                  State:= State or gstMoving;
-                  Active:= true
-                  end;
-             DeleteCI(cGear);
-             exit(false)
-             end
-   end
+function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt): boolean; inline;
+begin
+    TestCollisionXwithXYShift:= TestCollisionXwithXYShift(Gear, ShiftX, ShiftY, Dir, true);
 end;
 
-function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt; withGear: boolean = true): boolean;
+function TestCollisionXwithXYShift(Gear: PGear; ShiftX: hwFloat; ShiftY: LongInt; Dir: LongInt; withGear: boolean): boolean;
 begin
 Gear^.X:= Gear^.X + ShiftX;
 Gear^.Y:= Gear^.Y + int2hwFloat(ShiftY);
@@ -305,22 +337,28 @@ else TestCollisionXwithXYShift:= TestCollisionX(Gear, Dir);
 Gear^.X:= Gear^.X - ShiftX;
 Gear^.Y:= Gear^.Y - int2hwFloat(ShiftY)
 end;
+
 function TestCollisionX(Gear: PGear; Dir: LongInt): boolean;
 var x, y, i: LongInt;
 begin
 x:= hwRound(Gear^.X);
-if Dir < 0 then x:= x - Gear^.Radius
-           else x:= x + Gear^.Radius;
+if Dir < 0 then
+    x:= x - Gear^.Radius
+else
+    x:= x + Gear^.Radius;
+
+TestCollisionX:= true;
 if (x and LAND_WIDTH_MASK) = 0 then
-   begin
-   y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
-   i:= y + Gear^.Radius * 2 - 2;
-   repeat
-     if (y and LAND_HEIGHT_MASK) = 0 then
-        if Land[y, x] > 255 then exit(true);
-     inc(y)
-   until (y > i);
-   end;
+    begin
+    y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
+    i:= y + Gear^.Radius * 2 - 2;
+    repeat
+        if (y and LAND_HEIGHT_MASK) = 0 then
+            if Land[y, x] > 255 then
+                exit;
+    inc(y)
+    until (y > i);
+    end;
 TestCollisionX:= false
 end;
 
@@ -328,27 +366,41 @@ function TestCollisionY(Gear: PGear; Dir: LongInt): boolean;
 var x, y, i: LongInt;
 begin
 y:= hwRound(Gear^.Y);
-if Dir < 0 then y:= y - Gear^.Radius
-           else y:= y + Gear^.Radius;
+if Dir < 0 then
+    y:= y - Gear^.Radius
+else
+    y:= y + Gear^.Radius;
+
+TestCollisionY:= true;
 if (y and LAND_HEIGHT_MASK) = 0 then
-   begin
-   x:= hwRound(Gear^.X) - Gear^.Radius + 1;
-   i:= x + Gear^.Radius * 2 - 2;
-   repeat
-     if (x and LAND_WIDTH_MASK) = 0 then
-        if Land[y, x] > 255 then exit(true);
-     inc(x)
-   until (x > i);
-   end;
+    begin
+    x:= hwRound(Gear^.X) - Gear^.Radius + 1;
+    i:= x + Gear^.Radius * 2 - 2;
+    repeat
+        if (x and LAND_WIDTH_MASK) = 0 then
+            if Land[y, x] > 255 then
+                exit;
+    inc(x)
+    until (x > i);
+    end;
 TestCollisionY:= false
 end;
 
-function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt; withGear: boolean = true): boolean;
+function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt): boolean; inline;
+begin
+    TestCollisionYwithXYShift:= TestCollisionYwithXYShift(Gear, ShiftX, ShiftY, Dir, true);
+end;
+
+function TestCollisionYwithXYShift(Gear: PGear; ShiftX, ShiftY: LongInt; Dir: LongInt; withGear: boolean): boolean;
 begin
 Gear^.X:= Gear^.X + int2hwFloat(ShiftX);
 Gear^.Y:= Gear^.Y + int2hwFloat(ShiftY);
-if withGear then TestCollisionYwithXYShift:= TestCollisionYwithGear(Gear, Dir) <> 0
-else TestCollisionYwithXYShift:= TestCollisionY(Gear, Dir);
+
+if withGear then
+  TestCollisionYwithXYShift:= TestCollisionYwithGear(Gear, Dir) <> 0
+else
+  TestCollisionYwithXYShift:= TestCollisionY(Gear, Dir);
+  
 Gear^.X:= Gear^.X - int2hwFloat(ShiftX);
 Gear^.Y:= Gear^.Y - int2hwFloat(ShiftY)
 end;
@@ -357,6 +409,8 @@ function TestRectancleForObstacle(x1, y1, x2, y2: LongInt; landOnly: boolean): b
 var x, y: LongInt;
     TestWord: LongWord;
 begin
+TestRectancleForObstacle:= true;
+
 if landOnly then
     TestWord:= 255
 else
@@ -377,13 +431,12 @@ begin
 end;
 
 if (hasBorder and ((y1 < 0) or (x1 < 0) or (x2 > LAND_WIDTH))) then
-    exit(true);
+    exit;
 
 for y := y1 to y2 do
     for x := x1 to x2 do
-        if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)
-          and (Land[y, x] > TestWord) then
-            exit(true);
+        if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and (Land[y, x] > TestWord) then
+            exit;
 
 TestRectancleForObstacle:= false
 end;
@@ -393,10 +446,12 @@ var ldx, ldy, rdx, rdy: LongInt;
     i, j, k, mx, my, li, ri, jfr, jto, tmpo : ShortInt;
     tmpx, tmpy: LongWord;
     dx, dy, s: hwFloat;
-    offset: Array[0..7,0..1] of ShortInt;
+    offset: array[0..7,0..1] of ShortInt;
     isColl: Boolean;
 
 begin
+    CalcSlopeTangent:= false;
+
     dx:= Gear^.dX;
     dy:= Gear^.dY;
 
@@ -442,13 +497,18 @@ begin
                     end;
             end;
 
-        if i = 7 then break;
+        if i = 7 then
+            break;
 
         // prepare offset for next check (clockwise)
-        if (mx = -1) and (my <> -1) then my:= my - 1
-        else if (my = -1) and (mx <> 1) then mx:= mx + 1
-        else if (mx = 1) and (my <> 1) then my:= my + 1
-        else mx:= mx - 1;
+        if (mx = -1) and (my <> -1) then
+            my:= my - 1
+        else if (my = -1) and (mx <> 1) then
+            mx:= mx + 1
+        else if (mx = 1) and (my <> 1) then
+            my:= my + 1
+        else
+            mx:= mx - 1;
 
         end;
 
@@ -475,15 +535,16 @@ begin
                 tmpx:= ldx + k * offset[tmpo,0];
                 tmpy:= ldy + k * offset[tmpo,1];
                 if (((tmpy) and LAND_HEIGHT_MASK) = 0) and (((tmpx) and LAND_WIDTH_MASK)  = 0)
-                    and (Land[tmpy,tmpx] > TestWord) then
-                        begin
-                        ldx:= tmpx;
-                        ldy:= tmpy;
-                        isColl:= true;
-                        break;
-                        end;
+                and (Land[tmpy,tmpx] > TestWord) then
+                    begin
+                    ldx:= tmpx;
+                    ldy:= tmpy;
+                    isColl:= true;
+                    break;
+                    end;
                 end;
-            if isColl then break;
+            if isColl then
+                break;
             end;
 
         jfr:= 8+ri-1;
@@ -498,32 +559,127 @@ begin
                 tmpx:= rdx + k * offset[tmpo,0];
                 tmpy:= rdy + k * offset[tmpo,1];
                 if (((tmpy) and LAND_HEIGHT_MASK) = 0) and (((tmpx) and LAND_WIDTH_MASK)  = 0)
-                    and (Land[tmpy,tmpx] > TestWord) then
-                        begin
-                        rdx:= tmpx;
-                        rdy:= tmpy;
-                        isColl:= true;
-                        break;
-                        end;
+                and (Land[tmpy,tmpx] > TestWord) then
+                    begin
+                    rdx:= tmpx;
+                    rdy:= tmpy;
+                    isColl:= true;
+                    break;
+                    end;
                 end;
-            if isColl then break;
+            if isColl then
+                break;
             end;
         end;
 
     ldx:= rdx - ldx;
     ldy:= rdy - ldy;
 
-    if ((ldx = 0) and (ldy = 0)) then EXIT(false);
+    if ((ldx = 0) and (ldy = 0)) then
+        exit;
 
 outDeltaX:= ldx;
 outDeltaY:= ldy;
-exit(true);
+CalcSlopeTangent:= true;
+end;
+
+function CalcSlopeNearGear(Gear: PGear; dirX, dirY: LongInt): hwFloat;
+var dx, dy: hwFloat;
+    collX, collY, i, y, x, gx, gy, sdx, sdy: LongInt;
+    isColl, bSucc: Boolean;
+begin
+
+if dirY <> 0 then 
+    begin
+    y:= hwRound(Gear^.Y) + Gear^.Radius * dirY;
+    gx:= hwRound(Gear^.X);
+    collX := gx;
+    isColl:= false;
+
+    if (y and LAND_HEIGHT_MASK) = 0 then
+        begin
+        x:= hwRound(Gear^.X) - Gear^.Radius + 1;
+        i:= x + Gear^.Radius * 2 - 2;
+        repeat
+        if (x and LAND_WIDTH_MASK) = 0 then
+            if Land[y, x] <> 0 then
+                if (not isColl) or (abs(x-gx) < abs(collX-gx)) then
+                    begin
+                    isColl:= true;
+                    collX := x;
+                    end;
+        inc(x)
+        until (x > i);
+        end;
+    end
+else
+    begin
+    x:= hwRound(Gear^.X) + Gear^.Radius * dirX;
+    gy:= hwRound(Gear^.Y);
+    collY := gy;
+    isColl:= false;
+
+    if (x and LAND_WIDTH_MASK) = 0 then
+        begin
+        y:= hwRound(Gear^.Y) - Gear^.Radius + 1;
+        i:= y + Gear^.Radius * 2 - 2;
+        repeat
+        if (y and LAND_HEIGHT_MASK) = 0 then
+            if Land[y, x] <> 0 then
+                if (not isColl) or (abs(y-gy) < abs(collY-gy)) then
+                    begin
+                    isColl:= true;
+                    collY := y;
+                    end;
+        inc(y)
+        until (y > i);
+        end;
+    end;
+
+if isColl then
+    begin
+    // save original dx/dy
+    dx := Gear^.dX;
+    dy := Gear^.dY;
+
+    if dirY <> 0 then
+        begin
+        Gear^.dX.QWordValue:= 0;
+        Gear^.dX.isNegative:= (collX >= gx);
+        Gear^.dY:= _1*dirY
+        end
+    else
+        begin
+        Gear^.dY.QWordValue:= 0;
+        Gear^.dY.isNegative:= (collY >= gy);
+        Gear^.dX:= _1*dirX
+        end;
+
+    sdx:= 0;
+    sdy:= 0;
+    if dirY <> 0 then
+         bSucc := CalcSlopeTangent(Gear, collX, y, sdx, sdy, 0)
+    else bSucc := CalcSlopeTangent(Gear, x, collY, sdx, sdy, 0);
+
+    // restore original dx/dy
+    Gear^.dX := dx;
+    Gear^.dY := dy;
+
+    if bSucc and ((sdx <> 0) or (sdy <> 0)) then
+        begin
+        dx := int2hwFloat(sdy) / (abs(sdx) + abs(sdy));
+        dx.isNegative := (sdx * sdy) < 0;
+        exit (dx);
+        end
+    end;
+
+CalcSlopeNearGear := _0;
 end;
 
 function CalcSlopeBelowGear(Gear: PGear): hwFloat;
 var dx, dy: hwFloat;
     collX, i, y, x, gx, sdx, sdy: LongInt;
-    isColl, succ: Boolean;
+    isColl, bSucc: Boolean;
 begin
 
 
@@ -533,20 +689,20 @@ collX := gx;
 isColl:= false;
 
 if (y and LAND_HEIGHT_MASK) = 0 then
-   begin
-   x:= hwRound(Gear^.X) - Gear^.Radius + 1;
-   i:= x + Gear^.Radius * 2 - 2;
-   repeat
-     if (x and LAND_WIDTH_MASK) = 0 then
+    begin
+    x:= hwRound(Gear^.X) - Gear^.Radius + 1;
+    i:= x + Gear^.Radius * 2 - 2;
+    repeat
+    if (x and LAND_WIDTH_MASK) = 0 then
         if Land[y, x] > 255 then
-            if not isColl or (abs(x-gx) < abs(collX-gx)) then
+            if (not isColl) or (abs(x-gx) < abs(collX-gx)) then
                 begin
                 isColl:= true;
                 collX := x;
                 end;
-     inc(x)
-   until (x > i);
-   end;
+    inc(x)
+    until (x > i);
+    end;
 
 if isColl then
     begin
@@ -560,13 +716,13 @@ if isColl then
 
     sdx:= 0;
     sdy:= 0;
-    succ := CalcSlopeTangent(Gear, collX, y, sdx, sdy, 255);
+    bSucc := CalcSlopeTangent(Gear, collX, y, sdx, sdy, 255);
 
     // restore original dx/dy
     Gear^.dX := dx;
     Gear^.dY := dy;
 
-    if succ and (sdx <> 0) and (sdy <> 0) then
+    if bSucc and (sdx <> 0) and (sdy <> 0) then
     begin
         dx := int2hwFloat(sdy) / (abs(sdx) + abs(sdy));
         dx.isNegative := (sdx * sdy) < 0;
diff --git a/hedgewars/uCommandHandlers.pas b/hedgewars/uCommandHandlers.pas
index 212859c..b76fea6 100644
--- a/hedgewars/uCommandHandlers.pas
+++ b/hedgewars/uCommandHandlers.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,21 +26,24 @@ procedure initModule;
 procedure freeModule;
 
 implementation
-uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions;
+uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions
+     {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
+
+var prevGState: TGameState = gsConfirm;
 
 procedure chGenCmd(var s: shortstring);
 begin
 case s[1] of
-     'R': if ReadyTimeLeft > 1 then 
-          begin
-          ReadyTimeLeft:= 1;
-          if not CurrentTeam^.ExtDriven then SendIPC('c'+s);
-          end
+    'R': if ReadyTimeLeft > 1 then 
+        begin
+        ReadyTimeLeft:= 1;
+        if not isExternalSource then
+            SendIPC('c'+s);
+        end
     end
 end;
 
 procedure chQuit(var s: shortstring);
-const prevGState: TGameState = gsConfirm;
 begin
     s:= s; // avoid compiler hint
     if (GameState = gsGame) or (GameState = gsChat) then
@@ -48,7 +51,8 @@ begin
         prevGState:= GameState;
         GameState:= gsConfirm;
         SDL_ShowCursor(1)
-        end else
+        end
+    else
         if GameState = gsConfirm then
             begin
             GameState:= prevGState;
@@ -67,18 +71,18 @@ procedure chConfirm(var s: shortstring);
 begin
     s:= s; // avoid compiler hint
     if GameState = gsConfirm then
-    begin
-        SendIPC('Q');
+        begin
+        SendIPC(_S'Q');
         GameState:= gsExit
-    end
-else
-    ParseCommand('chat team', true);
+        end
+    else
+        ParseCommand('chat team', true);
 end;
 
 procedure chHalt (var s: shortstring);
 begin
     s:= s; // avoid compiler hint
-    SendIPC('H');
+    SendIPC(_S'H');
     GameState:= gsExit
 end;
 
@@ -88,48 +92,60 @@ begin
     if isDeveloperMode then
         begin
         val(s, i, c);
-        if (c <> 0) or (i = 0) then exit;
         TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
         TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true);
-    end
+        end
 end;
 
 procedure chTeamLocal(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if not isDeveloperMode then exit;
-if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/rdriven"', true);
+if not isDeveloperMode then
+    exit;
+if CurrentTeam = nil then
+    OutError(errmsgIncorrectUse + ' "/rdriven"', true);
 CurrentTeam^.ExtDriven:= true
 end;
 
 procedure chGrave(var s: shortstring);
 begin
-if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/grave"', true);
-if s[1]='"' then Delete(s, 1, 1);
-if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+if CurrentTeam = nil then
+    OutError(errmsgIncorrectUse + ' "/grave"', true);
+if s[1]='"' then
+    Delete(s, 1, 1);
+if s[byte(s[0])]='"' then
+    Delete(s, byte(s[0]), 1);
 CurrentTeam^.GraveName:= s
 end;
 
 procedure chFort(var s: shortstring);
 begin
-if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/fort"', true);
-if s[1]='"' then Delete(s, 1, 1);
-if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+if CurrentTeam = nil then
+    OutError(errmsgIncorrectUse + ' "/fort"', true);
+if s[1]='"' then
+    Delete(s, 1, 1);
+if s[byte(s[0])]='"' then
+    Delete(s, byte(s[0]), 1);
 CurrentTeam^.FortName:= s
 end;
 
 procedure chFlag(var s: shortstring);
 begin
-if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/flag"', true);
-if s[1]='"' then Delete(s, 1, 1);
-if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+if CurrentTeam = nil then
+    OutError(errmsgIncorrectUse + ' "/flag"', true);
+if s[1]='"' then
+    Delete(s, 1, 1);
+if s[byte(s[0])]='"' then
+    Delete(s, byte(s[0]), 1);
 CurrentTeam^.flag:= s
 end;
 
 procedure chScript(var s: shortstring);
 begin
-if s[1]='"' then Delete(s, 1, 1);
-if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+if s[1]='"' then
+    Delete(s, 1, 1);
+if s[byte(s[0])]='"' then
+    Delete(s, byte(s[0]), 1);
 cScriptName:= s;
 ScriptLoad(s)
 end;
@@ -140,9 +156,9 @@ if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
 with CurrentTeam^ do
     begin
     if not CurrentHedgehog^.King then
-    if (s = '') or
-        (((GameFlags and gfKing) <> 0) and (s = 'crown')) or
-        ((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then
+    if (s = '')
+    or (((GameFlags and gfKing) <> 0) and (s = 'crown'))
+    or ((Length(s) > 39) and (Copy(s,1,8) = 'Reserved') and (Copy(s,9,32) <> PlayerHash)) then
         CurrentHedgehog^.Hat:= 'NoHat'
     else
         CurrentHedgehog^.Hat:= s
@@ -200,8 +216,10 @@ end;
 procedure chLeft_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('L');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'L');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmLeft and InputMask);
@@ -211,18 +229,22 @@ end;
 procedure chLeft_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('l');
+if CheckNoTeamOrHH then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'l');
 with CurrentHedgehog^.Gear^ do
-    Message:= Message and not (gmLeft and InputMask);
+    Message:= Message and (not (gmLeft and InputMask));
     ScriptCall('onLeftUp');
 end;
 
 procedure chRight_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('R');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'R');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmRight and InputMask);
@@ -232,18 +254,22 @@ end;
 procedure chRight_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('r');
+if CheckNoTeamOrHH then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'r');
 with CurrentHedgehog^.Gear^ do
-    Message:= Message and not (gmRight and InputMask);
+    Message:= Message and (not (gmRight and InputMask));
     ScriptCall('onRightUp');
 end;
 
 procedure chUp_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('U');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'U');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmUp and InputMask);
@@ -253,18 +279,22 @@ end;
 procedure chUp_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('u');
+if CheckNoTeamOrHH then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'u');
 with CurrentHedgehog^.Gear^ do
-    Message:= Message and not (gmUp and InputMask);
+    Message:= Message and (not (gmUp and InputMask));
     ScriptCall('onUpUp');
 end;
 
 procedure chDown_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('D');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'D');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmDown and InputMask);
@@ -274,18 +304,22 @@ end;
 procedure chDown_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('d');
+if CheckNoTeamOrHH then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'd');
 with CurrentHedgehog^.Gear^ do
-    Message:= Message and not (gmDown and InputMask);
+    Message:= Message and (not (gmDown and InputMask));
     ScriptCall('onDownUp');
 end;
 
 procedure chPrecise_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('Z');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'Z');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmPrecise and InputMask);
@@ -295,18 +329,22 @@ end;
 procedure chPrecise_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('z');
+if CheckNoTeamOrHH then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'z');
 with CurrentHedgehog^.Gear^ do
-    Message:= Message and not (gmPrecise and InputMask);
+    Message:= Message and (not (gmPrecise and InputMask));
     ScriptCall('onPreciseUp');
 end;
 
 procedure chLJump(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('j');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'j');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmLJump and InputMask);
@@ -316,8 +354,10 @@ end;
 procedure chHJump(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('J');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'J');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmHJump and InputMask);
@@ -327,7 +367,8 @@ end;
 procedure chAttack_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused then
+    exit;
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     begin
@@ -335,7 +376,8 @@ with CurrentHedgehog^.Gear^ do
     if ((State and gstHHDriven) <> 0) then
         begin
         FollowGear:= CurrentHedgehog^.Gear;
-        if not CurrentTeam^.ExtDriven then SendIPC('A');
+        if not isExternalSource then
+            SendIPC(_S'A');
         Message:= Message or (gmAttack and InputMask);
         ScriptCall('onAttack');
         end
@@ -345,12 +387,14 @@ end;
 procedure chAttack_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH then exit;
+if CheckNoTeamOrHH then
+    exit;
 with CurrentHedgehog^.Gear^ do
     begin
-    if not CurrentTeam^.ExtDriven and
-        ((Message and gmAttack) <> 0) then SendIPC('a');
-    Message:= Message and not (gmAttack and InputMask);
+    if not isExternalSource and
+        ((Message and gmAttack) <> 0) then
+            SendIPC(_S'a');
+    Message:= Message and (not (gmAttack and InputMask));
     ScriptCall('onAttackUp');
     end
 end;
@@ -358,8 +402,10 @@ end;
 procedure chSwitch(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
-if not CurrentTeam^.ExtDriven then SendIPC('S');
+if CheckNoTeamOrHH or isPaused then
+    exit;
+if not isExternalSource then
+    SendIPC(_S'S');
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     Message:= Message or (gmSwitch and InputMask);
@@ -367,73 +413,110 @@ with CurrentHedgehog^.Gear^ do
 end;
 
 procedure chNextTurn(var s: shortstring);
+var gi: PGear;
 begin
     s:= s; // avoid compiler hint
+
     TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
 
-    if not CurrentTeam^.ExtDriven then SendIPC('N');
-    AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
+    CheckSum:= CheckSum xor GameTicks;
+    gi := GearsList;
+    while gi <> nil do
+        begin
+        with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac;
+        AddRandomness(CheckSum);
+        gi := gi^.NextGear
+        end;
+
+    if not isExternalSource then
+        begin
+        s[0]:= #5;
+        s[1]:= 'N';
+        SDLNet_Write32(CheckSum, @s[2]);
+        SendIPC(s)
+        end
+    else
+        TryDo(CurrentTeam^.hasGone or (CheckSum = lastTurnChecksum), 'Desync detected', true);
+
+    AddFileLog('Next turn: time '+inttostr(GameTicks));
 end;
 
 procedure chTimer(var s: shortstring);
 begin
-if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') or CheckNoTeamOrHH then exit;
+if CheckNoTeamOrHH then
+    exit;
+
+TryDo((s[0] = #1) and (s[1] >= '1') and (s[1] <= '5'), 'Malformed /timer', true);
 
-if not CurrentTeam^.ExtDriven then SendIPC(s);
+if not isExternalSource then
+    SendIPC(s);
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     begin
     Message:= Message or (gmTimer and InputMask);
     MsgParam:= byte(s[1]) - ord('0');
-    ScriptCall('onTimer');
+    ScriptCall('onTimer', MsgParam);
     end
 end;
 
 procedure chSlot(var s: shortstring);
 var slot: LongWord;
+    ss: shortstring;
 begin
-if (s[0] <> #1) or CheckNoTeamOrHH then exit;
+if (s[0] <> #1) or CheckNoTeamOrHH then
+    exit;
 slot:= byte(s[1]) - 49;
-if slot > cMaxSlotIndex then exit;
-if not CurrentTeam^.ExtDriven then SendIPC(char(byte(s[1]) + 79));
+if slot > cMaxSlotIndex then
+    exit;
+if not isExternalSource then
+    begin
+    ss[0]:= #1;
+    ss[1]:= char(byte(s[1]) + 79);
+    SendIPC(ss);
+    end;
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     begin
     Message:= Message or (gmSlot and InputMask);
     MsgParam:= slot; 
-    ScriptCall('onSlot');
+    ScriptCall('onSlot', MsgParam);
     end
 end;
 
 procedure chSetWeapon(var s: shortstring);
 begin
-    if (s[0] <> #1) or CheckNoTeamOrHH then exit;
+    if CheckNoTeamOrHH then
+        exit;
 
-    if TAmmoType(s[1]) > High(TAmmoType) then exit;
+    TryDo((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true);
 
-    if not CurrentTeam^.ExtDriven then SendIPC('w' + s);
+    if not isExternalSource then
+        SendIPC('w' + s);
 
     with CurrentHedgehog^.Gear^ do
-    begin
+        begin
         Message:= Message or (gmWeapon and InputMask);
         MsgParam:= byte(s[1]);
-    ScriptCall('onSetWeapon');
-    end;
+        ScriptCall('onSetWeapon', MsgParam);
+        end;
 end;
 
 procedure chTaunt(var s: shortstring);
 begin
-if (s[0] <> #1) or CheckNoTeamOrHH then exit;
+if (s[0] <> #1) or CheckNoTeamOrHH then
+    exit;
 
-if TWave(s[1]) > High(TWave) then exit;
+if TWave(s[1]) > High(TWave) then
+    exit;
 
-if not CurrentTeam^.ExtDriven then SendIPC('t' + s);
+if not isExternalSource then
+    SendIPC('t' + s);
 
 with CurrentHedgehog^.Gear^ do
     begin
     Message:= Message or (gmAnimate and InputMask);
     MsgParam:= byte(s[1]) ; 
-    ScriptCall('onTaunt');
+    ScriptCall('onTaunt', MsgParam);
     end
 end;
 
@@ -449,6 +532,17 @@ s:= s; // avoid compiler hint
 flagMakeCapture:= true
 end;
 
+procedure chRecord(var s: shortstring);
+begin
+s:= s; // avoid compiler hint
+{$IFDEF USE_VIDEO_RECORDING}
+if flagPrerecording then
+    StopPreRecording()
+else
+    BeginPreRecording();
+{$ENDIF}
+end;
+
 procedure chSetMap(var s: shortstring);
 begin
 if isDeveloperMode then
@@ -465,30 +559,30 @@ if isDeveloperMode then
         end;
     InitStepsFlags:= InitStepsFlags or cifMap
     end;
-
+cMapName:= s;
 ScriptLoad('Maps/' + s + '/map.lua')
 end;
 
 procedure chSetTheme(var s: shortstring);
 begin
 if isDeveloperMode then
-begin
-UserPathz[ptCurrTheme]:= UserPathz[ptThemes] + '/' + s;
-Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s;
-Theme:= s;
-InitStepsFlags:= InitStepsFlags or cifTheme
-end
+    begin
+    UserPathz[ptCurrTheme]:= UserPathz[ptThemes] + '/' + s;
+    Pathz[ptCurrTheme]:= Pathz[ptThemes] + '/' + s;
+    Theme:= s;
+    InitStepsFlags:= InitStepsFlags or cifTheme
+    end
 end;
 
 procedure chSetSeed(var s: shortstring);
 begin
 if isDeveloperMode then
-begin
-SetRandomSeed(s);
-cSeed:= s;
-InitStepsFlags:= InitStepsFlags or cifRandomize
-end
-end;
+    begin
+    SetRandomSeed(s);
+    cSeed:= s;
+    InitStepsFlags:= InitStepsFlags or cifRandomize
+    end
+    end;
 
 procedure chAmmoMenu(var s: shortstring);
 begin
@@ -502,10 +596,15 @@ else
             begin
             bSelected:= false;
 
-            if bShowAmmoMenu then bShowAmmoMenu:= false
-            else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or
-                    ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) or
-                    ((Gear^.State and gstHHDriven) = 0) then else bShowAmmoMenu:= true
+            if bShowAmmoMenu then
+                bShowAmmoMenu:= false
+            else if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0)
+            or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0))
+            or ((Gear^.State and gstHHDriven) = 0) then
+                begin
+                end
+            else
+                bShowAmmoMenu:= true
             end;
     end
 end;
@@ -525,17 +624,21 @@ end;
 procedure chFindhh(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused then
+    exit;
 
-if FollowGear <> nil then
+if autoCameraOn then
     begin
+    FollowGear:= nil;
     AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume);
     autoCameraOn:= false
     end
-    else begin
+else
+    begin
     AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
     bShowFinger:= true;
-    if not CurrentHedgehog^.Unplaced then FollowGear:= CurrentHedgehog^.Gear;
+    if not CurrentHedgehog^.Unplaced then
+        FollowGear:= CurrentHedgehog^.Gear;
     autoCameraOn:= true
     end
 end;
@@ -555,12 +658,16 @@ end;
 procedure chRotateMask(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if ((GameFlags and gfInvulnerable) = 0) then cTagsMask:= cTagsMasks[cTagsMask] else cTagsMask:= cTagsMasksNoHealth[cTagsMask];
+if ((GameFlags and gfInvulnerable) = 0) then
+    cTagsMask:= cTagsMasks[cTagsMask]
+else
+    cTagsMask:= cTagsMasksNoHealth[cTagsMask];
 end;
 
 procedure chSpeedup_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
+SpeedStart:= RealTicks;
 isSpeed:= true
 end;
 
@@ -590,90 +697,197 @@ begin
     ZoomValue:= cDefaultZoomLevel;
 end;
 
+procedure chMapGen(var s: shortstring);
+begin
+cMapGen:= StrToInt(s)
+end;
+
+procedure chTemplateFilter(var s: shortstring);
+begin
+cTemplateFilter:= StrToInt(s)
+end;
+
+procedure chInactDelay(var s: shortstring);
+begin
+cInactDelay:= StrToInt(s)
+end;
+
+procedure chReadyDelay(var s: shortstring);
+begin
+cReadyDelay:= StrToInt(s)
+end;
+
+procedure chCaseFactor(var s: shortstring);
+begin
+cCaseFactor:= StrToInt(s)
+end;
+
+procedure chHealthCaseProb(var s: shortstring);
+begin
+cHealthCaseProb:= StrToInt(s)
+end;
+
+procedure chHealthCaseAmount(var s: shortstring);
+begin
+cHealthCaseAmount:= StrToInt(s)
+end;
+
+procedure chSuddenDTurns(var s: shortstring);
+begin
+cSuddenDTurns:= StrToInt(s)
+end;
+
+procedure chWaterRise(var s: shortstring);
+begin
+cWaterRise:= StrToInt(s)
+end;
+
+procedure chHealthDecrease(var s: shortstring);
+begin
+cHealthDecrease:= StrToInt(s)
+end;
+
+procedure chDamagePercent(var s: shortstring);
+begin
+cDamagePercent:= StrToInt(s)
+end;
+
+procedure chRopePercent(var s: shortstring);
+begin
+cRopePercent:= StrToInt(s)
+end;
+
+procedure chGetAwayTime(var s: shortstring);
+begin
+cGetAwayTime:= StrToInt(s)
+end;
+
+procedure chMineDudPercent(var s: shortstring);
+begin
+cMineDudPercent:= StrToInt(s)
+end;
+
+procedure chLandMines(var s: shortstring);
+begin
+cLandMines:= StrToInt(s)
+end;
+
+procedure chExplosives(var s: shortstring);
+begin
+cExplosives:= StrToInt(s)
+end;
+
+procedure chGameFlags(var s: shortstring);
+begin
+GameFlags:= StrToInt(s);
+if GameFlags and gfSharedAmmo <> 0 then GameFlags:= GameFlags and (not gfPerHogAmmo)
+end;
+
+procedure chHedgehogTurnTime(var s: shortstring);
+begin
+cHedgehogTurnTime:= StrToInt(s)
+end;
+
+procedure chMinesTime(var s: shortstring);
+begin
+cMinesTime:= StrToInt(s)
+end;
+
+procedure chFastUntilLag(var s: shortstring);
+begin
+fastUntilLag:= StrToInt(s) <> 0
+end;
+
+procedure chCampVar(var s:shortstring);
+begin
+  CampaignVariable := s;
+end;
 
 procedure initModule;
 begin
 //////// Begin top sorted by freq analysis not including chatmsg
-    RegisterVariable('+right'  , vtCommand, @chRight_p      , false);
-    RegisterVariable('-right'  , vtCommand, @chRight_m      , false);
-    RegisterVariable('+up'     , vtCommand, @chUp_p         , false);
-    RegisterVariable('-up'     , vtCommand, @chUp_m         , false);
-    RegisterVariable('+left'   , vtCommand, @chLeft_p       , false);
-    RegisterVariable('-left'   , vtCommand, @chLeft_m       , false);
-    RegisterVariable('+attack' , vtCommand, @chAttack_p     , false);
-    RegisterVariable('+down'   , vtCommand, @chDown_p       , false);
-    RegisterVariable('-down'   , vtCommand, @chDown_m       , false);
-    RegisterVariable('hjump'   , vtCommand, @chHJump        , false);
-    RegisterVariable('ljump'   , vtCommand, @chLJump        , false);
-    RegisterVariable('nextturn', vtCommand, @chNextTurn     , false);
-    RegisterVariable('-attack' , vtCommand, @chAttack_m     , false);
-    RegisterVariable('slot'    , vtCommand, @chSlot         , false);
-    RegisterVariable('setweap' , vtCommand, @chSetWeapon    , false);
+    RegisterVariable('+right'  , @chRight_p      , false, true);
+    RegisterVariable('-right'  , @chRight_m      , false, true);
+    RegisterVariable('+up'     , @chUp_p         , false, true);
+    RegisterVariable('-up'     , @chUp_m         , false, true);
+    RegisterVariable('+left'   , @chLeft_p       , false, true);
+    RegisterVariable('-left'   , @chLeft_m       , false, true);
+    RegisterVariable('+attack' , @chAttack_p     , false);
+    RegisterVariable('+down'   , @chDown_p       , false, true);
+    RegisterVariable('-down'   , @chDown_m       , false, true);
+    RegisterVariable('hjump'   , @chHJump        , false, true);
+    RegisterVariable('ljump'   , @chLJump        , false, true);
+    RegisterVariable('nextturn', @chNextTurn     , false);
+    RegisterVariable('-attack' , @chAttack_m     , false);
+    RegisterVariable('slot'    , @chSlot         , false);
+    RegisterVariable('setweap' , @chSetWeapon    , false, true);
 //////// End top by freq analysis
-    RegisterVariable('gencmd'  , vtCommand, @chGenCmd       , false);
-    RegisterVariable('flag'    , vtCommand, @chFlag         , false);
-    RegisterVariable('script'  , vtCommand, @chScript       , false);
-    RegisterVariable('proto'   , vtCommand, @chCheckProto   , true );
-    RegisterVariable('spectate', vtBoolean, @fastUntilLag   , false);
-    RegisterVariable('capture' , vtCommand, @chCapture      , true );
-    RegisterVariable('rotmask' , vtCommand, @chRotateMask   , true );
-    RegisterVariable('rdriven' , vtCommand, @chTeamLocal    , false);
-    RegisterVariable('map'     , vtCommand, @chSetMap       , false);
-    RegisterVariable('theme'   , vtCommand, @chSetTheme     , false);
-    RegisterVariable('seed'    , vtCommand, @chSetSeed      , false);
-    RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false);
-    RegisterVariable('mapgen'  , vtLongInt, @cMapGen        , false);
-    RegisterVariable('maze_size',vtLongInt, @cTemplateFilter, false);
-    RegisterVariable('delay'   , vtLongInt, @cInactDelay    , false);
-    RegisterVariable('ready'   , vtLongInt, @cReadyDelay    , false);
-    RegisterVariable('casefreq', vtLongInt, @cCaseFactor    , false);
-    RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false);
-    RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false);
-    RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns  , false);
-    RegisterVariable('waterrise', vtLongInt, @cWaterRise    , false);
-    RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false);
-    RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false);
-    RegisterVariable('ropepct' , vtLongInt, @cRopePercent   , false);
-    RegisterVariable('getawaytime' , vtLongInt, @cGetAwayTime , false);
-    RegisterVariable('minedudpct',vtLongInt, at cMineDudPercent, false);
-    RegisterVariable('minesnum', vtLongInt, @cLandMines     , false);
-    RegisterVariable('explosives',vtLongInt, at cExplosives    , false);
-    RegisterVariable('gmflags' , vtLongInt, @GameFlags      , false);
-    RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false);
-    RegisterVariable('minestime',vtLongInt, @cMinesTime     , false);
-    RegisterVariable('fort'    , vtCommand, @chFort         , false);
-    RegisterVariable('grave'   , vtCommand, @chGrave        , false);
-    RegisterVariable('hat'     , vtCommand, @chSetHat       , false);
-    RegisterVariable('quit'    , vtCommand, @chQuit         , true );
-    RegisterVariable('forcequit', vtCommand, @chForceQuit   , true );
-    RegisterVariable('confirm' , vtCommand, @chConfirm      , true );
-    RegisterVariable('halt',     vtCommand, @chHalt         , true );
-    RegisterVariable('+speedup', vtCommand, @chSpeedup_p    , true );
-    RegisterVariable('-speedup', vtCommand, @chSpeedup_m    , true );
-    RegisterVariable('zoomin'  , vtCommand, @chZoomIn       , true );
-    RegisterVariable('zoomout' , vtCommand, @chZoomOut      , true );
-    RegisterVariable('zoomreset',vtCommand, @chZoomReset    , true );
-    RegisterVariable('ammomenu', vtCommand, @chAmmoMenu     , true);
-    RegisterVariable('+precise', vtCommand, @chPrecise_p    , false);
-    RegisterVariable('-precise', vtCommand, @chPrecise_m    , false);
-    RegisterVariable('switch'  , vtCommand, @chSwitch       , false);
-    RegisterVariable('timer'   , vtCommand, @chTimer        , false);
-    RegisterVariable('taunt'   , vtCommand, @chTaunt        , false);
-    RegisterVariable('put'     , vtCommand, @chPut          , false);
-    RegisterVariable('+volup'  , vtCommand, @chVol_p        , true );
-    RegisterVariable('-volup'  , vtCommand, @chVol_m        , true );
-    RegisterVariable('+voldown', vtCommand, @chVol_m        , true );
-    RegisterVariable('-voldown', vtCommand, @chVol_p        , true );
-    RegisterVariable('findhh'  , vtCommand, @chFindhh       , true );
-    RegisterVariable('pause'   , vtCommand, @chPause        , true );
-    RegisterVariable('+cur_u'  , vtCommand, @chCurU_p       , true );
-    RegisterVariable('-cur_u'  , vtCommand, @chCurU_m       , true );
-    RegisterVariable('+cur_d'  , vtCommand, @chCurD_p       , true );
-    RegisterVariable('-cur_d'  , vtCommand, @chCurD_m       , true );
-    RegisterVariable('+cur_l'  , vtCommand, @chCurL_p       , true );
-    RegisterVariable('-cur_l'  , vtCommand, @chCurL_m       , true );
-    RegisterVariable('+cur_r'  , vtCommand, @chCurR_p       , true );
-    RegisterVariable('-cur_r'  , vtCommand, @chCurR_m       , true );
+    RegisterVariable('gencmd'  , @chGenCmd       , false);
+    RegisterVariable('flag'    , @chFlag         , false);
+    RegisterVariable('script'  , @chScript       , false);
+    RegisterVariable('proto'   , @chCheckProto   , true );
+    RegisterVariable('spectate', @chFastUntilLag   , false);
+    RegisterVariable('capture' , @chCapture      , true );
+    RegisterVariable('rotmask' , @chRotateMask   , true );
+    RegisterVariable('rdriven' , @chTeamLocal    , false);
+    RegisterVariable('map'     , @chSetMap       , false);
+    RegisterVariable('theme'   , @chSetTheme     , false);
+    RegisterVariable('seed'    , @chSetSeed      , false);
+    RegisterVariable('template_filter', @chTemplateFilter, false);
+    RegisterVariable('mapgen'  , @chMapGen        , false);
+    RegisterVariable('maze_size', at chTemplateFilter, false);
+    RegisterVariable('delay'   , @chInactDelay    , false);
+    RegisterVariable('ready'   , @chReadyDelay    , false);
+    RegisterVariable('casefreq', @chCaseFactor    , false);
+    RegisterVariable('healthprob', @chHealthCaseProb, false);
+    RegisterVariable('hcaseamount', @chHealthCaseAmount, false);
+    RegisterVariable('sd_turns', @chSuddenDTurns  , false);
+    RegisterVariable('waterrise', @chWaterRise    , false);
+    RegisterVariable('healthdec', @chHealthDecrease, false);
+    RegisterVariable('damagepct', at chDamagePercent , false);
+    RegisterVariable('ropepct' , @chRopePercent   , false);
+    RegisterVariable('getawaytime' , @chGetAwayTime , false);
+    RegisterVariable('minedudpct', at chMineDudPercent, false);
+    RegisterVariable('minesnum', @chLandMines     , false);
+    RegisterVariable('explosives', at chExplosives    , false);
+    RegisterVariable('gmflags' , @chGameFlags      , false);
+    RegisterVariable('turntime', @chHedgehogTurnTime, false);
+    RegisterVariable('minestime', at chMinesTime     , false);
+    RegisterVariable('fort'    , @chFort         , false);
+    RegisterVariable('grave'   , @chGrave        , false);
+    RegisterVariable('hat'     , @chSetHat       , false);
+    RegisterVariable('quit'    , @chQuit         , true );
+    RegisterVariable('forcequit', @chForceQuit   , true );
+    RegisterVariable('confirm' , @chConfirm      , true );
+    RegisterVariable('halt',     @chHalt         , true );
+    RegisterVariable('+speedup', @chSpeedup_p    , true );
+    RegisterVariable('-speedup', @chSpeedup_m    , true );
+    RegisterVariable('zoomin'  , @chZoomIn       , true );
+    RegisterVariable('zoomout' , @chZoomOut      , true );
+    RegisterVariable('zoomreset', at chZoomReset    , true );
+    RegisterVariable('ammomenu', @chAmmoMenu     , true);
+    RegisterVariable('+precise', @chPrecise_p    , false, true);
+    RegisterVariable('-precise', @chPrecise_m    , false, true);
+    RegisterVariable('switch'  , @chSwitch       , false);
+    RegisterVariable('timer'   , @chTimer        , false, true);
+    RegisterVariable('taunt'   , @chTaunt        , false);
+    RegisterVariable('put'     , @chPut          , false);
+    RegisterVariable('+volup'  , @chVol_p        , true );
+    RegisterVariable('-volup'  , @chVol_m        , true );
+    RegisterVariable('+voldown', @chVol_m        , true );
+    RegisterVariable('-voldown', @chVol_p        , true );
+    RegisterVariable('findhh'  , @chFindhh       , true );
+    RegisterVariable('pause'   , @chPause        , true );
+    RegisterVariable('+cur_u'  , @chCurU_p       , true );
+    RegisterVariable('-cur_u'  , @chCurU_m       , true );
+    RegisterVariable('+cur_d'  , @chCurD_p       , true );
+    RegisterVariable('-cur_d'  , @chCurD_m       , true );
+    RegisterVariable('+cur_l'  , @chCurL_p       , true );
+    RegisterVariable('-cur_l'  , @chCurL_m       , true );
+    RegisterVariable('+cur_r'  , @chCurR_p       , true );
+    RegisterVariable('-cur_r'  , @chCurR_m       , true );
+    RegisterVariable('campvar' , @chCampVar      , true );
+    RegisterVariable('record'  , @chRecord       , true );
 end;
 
 procedure freeModule;
diff --git a/hedgewars/uCommands.pas b/hedgewars/uCommands.pas
index 7675cd3..7fac4ae 100644
--- a/hedgewars/uCommands.pas
+++ b/hedgewars/uCommands.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -23,112 +23,125 @@ unit uCommands;
 interface
 
 var isDeveloperMode: boolean;
-type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean);
-     TCommandHandler = procedure (var params: shortstring);
+var isExternalSource: boolean;
+type TCommandHandler = procedure (var params: shortstring);
 
 procedure initModule;
 procedure freeModule;
-procedure RegisterVariable(Name: shortstring; VType: TVariableType; p: pointer; Trusted: boolean);
-procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
+procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean; Rand: boolean);
+procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean);
+procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); inline;
+procedure ParseCommand(CmdStr: shortstring; TrustedSource, ExternalSource: boolean);
+procedure ParseTeamCommand(s: shortstring);
 procedure StopMessages(Message: Longword);
 
 implementation
-uses Types, uConsts, uVariables, uConsole, uUtils, uDebug;
+uses uConsts, uVariables, uConsole, uUtils, uDebug, SDLh;
 
 type  PVariable = ^TVariable;
-      TVariable = record
-                     Next: PVariable;
-                     Name: string[15];
-                    VType: TVariableType;
-                  Handler: pointer;
-                  Trusted: boolean;
-                  end;
+    TVariable = record
+        Next: PVariable;
+        Name: string[15];
+        Handler: TCommandHandler;
+        Trusted, Rand: boolean;
+        end;
 
-var
-      Variables: PVariable;
+var Variables: PVariable;
 
-procedure RegisterVariable(Name: shortstring; VType: TVariableType; p: pointer; Trusted: boolean);
-var value: PVariable;
+procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean);
+begin
+RegisterVariable(Name, p, Trusted, false);
+end;
+procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean; Rand: boolean);
+var
+    value: PVariable;
 begin
 New(value);
 TryDo(value <> nil, 'RegisterVariable: value = nil', true);
 FillChar(value^, sizeof(TVariable), 0);
 value^.Name:= Name;
-value^.VType:= VType;
 value^.Handler:= p;
 value^.Trusted:= Trusted;
+value^.Rand:= Rand;
 
-if Variables = nil then Variables:= value
-                   else begin
-                        value^.Next:= Variables;
-                        Variables:= value
-                        end;
+if Variables = nil then
+    Variables:= value
+else
+    begin
+    value^.Next:= Variables;
+    Variables:= value
+    end;
 end;
 
 
-procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
-var ii: LongInt;
-    s: shortstring;
+procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); inline;
+begin
+    ParseCommand(CmdStr, TrustedSource, false)
+end;
+
+procedure ParseCommand(CmdStr: shortstring; TrustedSource, ExternalSource: boolean);
+var s: shortstring;
     t: PVariable;
     c: char;
 begin
+isExternalSource:= ExternalSource or ((CurrentTeam <> nil) and CurrentTeam^.ExtDriven);
 //WriteLnToConsole(CmdStr);
-if CmdStr[0]=#0 then exit;
+if CmdStr[0]=#0 then
+    exit;
 c:= CmdStr[1];
-if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/';
+if (c = '/') or (c = '$') then
+    Delete(CmdStr, 1, 1);
 s:= '';
 SplitBySpace(CmdStr, s);
-AddFileLog('[Cmd] ' + c + CmdStr + ' (' + inttostr(length(s)) + ')');
+AddFileLog('[Cmd] ' + CmdStr + ' (' + inttostr(length(s)) + ')');
+
 t:= Variables;
 while t <> nil do
-      begin
-      if t^.Name = CmdStr then
-         begin
-         if TrustedSource or t^.Trusted then
-            case t^.VType of
-              vtCommand: if c='/' then
-                         begin
-                         TCommandHandler(t^.Handler)(s);
-                         end;
-              vtLongInt: if c='$' then
-                         if s[0]=#0 then
-                            begin
-                            str(PLongInt(t^.Handler)^, s);
-                            WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else val(s, PLongInt(t^.Handler)^);
-              vthwFloat: if c='$' then
-                         if s[0]=#0 then
-                            begin
-                            //str(PhwFloat(t^.Handler)^:4:6, s);
-                            WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else; //val(s, PhwFloat(t^.Handler)^, i);
-             vtBoolean: if c='$' then
-                         if s[0]=#0 then
-                            begin
-                            str(ord(boolean(t^.Handler^)), s);
-                            WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else
-                            begin
-                            val(s, ii);
-                            boolean(t^.Handler^):= not (ii = 0)
-                            end;
-              end;
-         exit
-         end else t:= t^.Next
-      end;
+    begin
+    if t^.Name = CmdStr then
+        begin
+        if TrustedSource or t^.Trusted then
+            begin
+            if t^.Rand and (not CheckNoTeamOrHH) then 
+                CheckSum:= CheckSum xor LongWord(SDLNet_Read32(@CmdStr)) xor LongWord(s[0]) xor GameTicks;
+            t^.Handler(s);
+            end;
+        exit
+        end
+    else
+        t:= t^.Next
+    end;
 case c of
-     '$': WriteLnToConsole(errmsgUnknownVariable + ': "$' + CmdStr + '"')
-     else WriteLnToConsole(errmsgUnknownCommand  + ': "/' + CmdStr + '"') end
+    '$': WriteLnToConsole(errmsgUnknownVariable + ': "$' + CmdStr + '"')
+    else
+        WriteLnToConsole(errmsgUnknownCommand  + ': "/' + CmdStr + '"') end
 end;
 
+procedure ParseTeamCommand(s: shortstring);
+var Trusted: boolean;
+begin
+Trusted:= (CurrentTeam <> nil)
+          and (not CurrentTeam^.ExtDriven)
+          and (CurrentHedgehog^.BotLevel = 0);
+ParseCommand(s, Trusted);
+if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
+    ParseCommand('gencmd R', true)
+end;
+
+
 
 procedure StopMessages(Message: Longword);
 begin
-if (Message and gmLeft) <> 0 then ParseCommand('/-left', true) else
-if (Message and gmRight) <> 0 then ParseCommand('/-right', true) else
-if (Message and gmUp) <> 0 then ParseCommand('/-up', true) else
-if (Message and gmDown) <> 0 then ParseCommand('/-down', true) else
-if (Message and gmAttack) <> 0 then ParseCommand('/-attack', true)
+if (Message and gmLeft) <> 0 then
+    ParseCommand('/-left', true)
+else if (Message and gmRight) <> 0 then
+    ParseCommand('/-right', true) 
+else if (Message and gmUp) <> 0 then
+    ParseCommand('/-up', true)
+else if (Message and gmDown) <> 0 then
+    ParseCommand('/-down', true)
+else if (Message and gmAttack) <> 0 then
+    ParseCommand('/-attack', true)
 end;
 
 procedure initModule;
diff --git a/hedgewars/uConsole.pas b/hedgewars/uConsole.pas
index 30607b2..ab828b7 100644
--- a/hedgewars/uConsole.pas
+++ b/hedgewars/uConsole.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,17 +26,18 @@ procedure freeModule;
 procedure WriteToConsole(s: shortstring);
 procedure WriteLnToConsole(s: shortstring);
 function  GetLastConsoleLine: shortstring;
+function  ShortStringAsPChar(s: shortstring): PChar;
 
 implementation
-uses Types, uVariables, uUtils;
+uses Types, uVariables, uUtils {$IFDEF ANDROID}, log in 'log.pas'{$ENDIF};
 
-const cLineWidth: LongInt = 0;
-      cLinesCount = 8;
+const cLinesCount = 8;
+var   cLineWidth: LongInt;
 
 type
-      TTextLine = record
-                  s: shortstring;
-                  end;
+    TTextLine = record
+        s: shortstring
+        end;
 
 var   ConsoleLines: array[byte] of TTextLine;
       CurrLine: LongInt;
@@ -44,15 +45,20 @@ var   ConsoleLines: array[byte] of TTextLine;
 procedure SetLine(var tl: TTextLine; str: shortstring);
 begin
 with tl do
-     s:= str;
+    s:= str;
 end;
 
 procedure WriteToConsole(s: shortstring);
+{$IFNDEF NOCONSOLE}
 var Len: LongInt;
     done: boolean;
+{$ENDIF}
 begin
 {$IFNDEF NOCONSOLE}
 AddFileLog('[Con] ' + s);
+{$IFDEF ANDROID}
+    Log.__android_log_write(Log.Android_LOG_DEBUG, 'HW_Engine', ShortStringAsPChar('[Con]' + s));
+{$ELSE}
 Write(stderr, s);
 done:= false;
 
@@ -64,26 +70,37 @@ while not done do
     if byte(ConsoleLines[CurrLine].s[0]) = cLineWidth then
         begin
         inc(CurrLine);
-        if CurrLine = cLinesCount then CurrLine:= 0;
+        if CurrLine = cLinesCount then
+            CurrLine:= 0;
         PByte(@ConsoleLines[CurrLine].s)^:= 0
         end;
     done:= (Length(s) = 0);
     end;
 {$ENDIF}
+{$ENDIF}
 end;
 
 procedure WriteLnToConsole(s: shortstring);
 begin
 {$IFNDEF NOCONSOLE}
 WriteToConsole(s);
-WriteLn(stderr);
+{$IFNDEF ANDROID}
+WriteLn(stderr, '');
 inc(CurrLine);
 if CurrLine = cLinesCount then
     CurrLine:= 0;
 PByte(@ConsoleLines[CurrLine].s)^:= 0
 {$ENDIF}
+{$ENDIF}
 end;
 
+function ShortStringAsPChar(s: shortstring) : PChar;
+begin
+    if Length(s) = High(s) then
+        Dec(s[0]);
+    s[Ord(Length(s))+1] := #0;
+    ShortStringAsPChar:= @s[1];
+end;
 
 function GetLastConsoleLine: shortstring;
 var valueStr: shortstring;
diff --git a/hedgewars/uConsts.pas b/hedgewars/uConsts.pas
index a5d8e7e..44baada 100644
--- a/hedgewars/uConsts.pas
+++ b/hedgewars/uConsts.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -28,6 +28,7 @@ uses    SDLh, uFloat, GLunit;
 const
     sfMax = 1000;
     cDefaultParamNum = 17;
+    cVideorecParamNum = cDefaultParamNum + 7;
 
     // message constants
     errmsgCreateSurface   = 'Error creating SDL surface';
@@ -51,7 +52,6 @@ const
     cWhiteColor           : Longword = $FFFFFFFF;
     cYellowColor          : Longword = $FFFFFF00;
     cNearBlackColor       : Longword = $FF000010;
-    cExplosionBorderColor : LongWord = $FF808080;
 
 {$WARNINGS OFF}
     cAirPlaneSpeed: hwFloat = (isNegative: false; QWordValue:   3006477107); // 1.4
@@ -95,6 +95,7 @@ const
     lfObject         = $2000;  
     lfDamaged        = $1000;  //
     lfIce            = $0800;  // blue
+    lfBouncy         = $0400;  // green
 
     cMaxPower     = 1500;
     cMaxAngle     = 2048;
@@ -103,18 +104,18 @@ const
     MAXNAMELEN = 192;
     MAXROPEPOINTS = 3840;
 
+    {$IFNDEF PAS2C}
     // some opengl headers do not have these macros
     GL_BGR              = $80E0;
     GL_BGRA             = $80E1;
     GL_CLAMP_TO_EDGE    = $812F;
     GL_TEXTURE_PRIORITY = $8066;
+    {$ENDIF}
 
     cSendCursorPosTime  : LongWord = 50;
     cVisibleWater       : LongInt = 128;
     cCursorEdgesDist    : LongInt = 100;
     cTeamHealthWidth    : LongInt = 128;
-    cWaterOpacity       : byte = $80;
-    cSDWaterOpacity     : byte = $80;
 
     cifRandomize = $00000001;
     cifTheme     = $00000002;
@@ -122,16 +123,10 @@ const
     cifAllInited = cifRandomize or cifTheme or cifMap;
 
     cTransparentColor: Longword = $00000000;
-    cGrayScale: Boolean = false;
 
     RGB_LUMINANCE_RED    = 0.212671;
     RGB_LUMINANCE_GREEN  = 0.715160;
     RGB_LUMINANCE_BLUE   = 0.072169;
-(*
-    RGB_LUMINANCE_RED    = 0.3333333333;
-    RGB_LUMINANCE_GREEN  = 0.3333333333;
-    RGB_LUMINANCE_BLUE   = 0.3333333333;
-*)
 
     cMaxTeams        = 8;
     cMaxHHIndex      = 7;
@@ -152,13 +147,21 @@ const
     cBarrelHealth = 60;
     cShotgunRadius = 22;
     cBlowTorchC    = 6;
+    cakeDmg =   75;
 
     cKeyMaxIndex = 1023;
+    cKbdMaxIndex = 65536;//need more room for the modifier keys
+
+    cHHFileName = 'Hedgehog';
+    cCHFileName = 'Crosshair';
+    cThemeCFGFilename = 'theme.cfg';
+
+    cFontBorder = 2;
 
     // do not change this value
     cDefaultZoomLevel = 2.0;
 
-{$IFDEF IPHONEOS}
+{$IFDEF MOBILE}
     cMaxZoomLevel = 0.5;
     cMinZoomLevel = 3.5;
     cZoomDelta = 0.20;
@@ -168,6 +171,8 @@ const
     cZoomDelta = 0.25;
 {$ENDIF}
 
+    cMinMaxZoomLevelDelta = cMaxZoomLevel - cMinZoomLevel;
+
     cSendEmptyPacketTime = 1000;
     trigTurns = $80000001;
 
@@ -224,20 +229,24 @@ const
     gstHHGone         = $00100000;
     gstInvisible      = $00200000;
 
-    gmLeft   = $00000001;
-    gmRight  = $00000002;
-    gmUp     = $00000004;
-    gmDown   = $00000008;
-    gmSwitch = $00000010;
-    gmAttack = $00000020;
-    gmLJump  = $00000040;
-    gmHJump  = $00000080;
-    gmDestroy= $00000100;
-    gmSlot   = $00000200; // with param
-    gmWeapon = $00000400; // with param
-    gmTimer  = $00000800; // with param
-    gmAnimate= $00001000; // with param
-    gmPrecise= $00002000;
+    gmLeft           = $00000001;
+    gmRight          = $00000002;
+    gmUp             = $00000004;
+    gmDown           = $00000008;
+    gmSwitch         = $00000010;
+    gmAttack         = $00000020;
+    gmLJump          = $00000040;
+    gmHJump          = $00000080;
+    gmDestroy        = $00000100;
+    gmSlot           = $00000200; // with param
+    gmWeapon         = $00000400; // with param
+    gmTimer          = $00000800; // with param
+    gmAnimate        = $00001000; // with param
+    gmPrecise        = $00002000;
+
+    gmRemoveFromList = $00004000;
+    gmAddToList      = $00008000;
+    gmDelete         = $00010000;
     gmAllStoppable = gmLeft or gmRight or gmUp or gmDown or gmAttack or gmPrecise;
 
     cMaxSlotIndex       = 9;
@@ -257,11 +266,15 @@ const
     ammoprop_Utility      = $00001000;
     ammoprop_Effect       = $00002000;
     ammoprop_SetBounce    = $00004000;
+    ammoprop_NeedUpDown   = $00008000;//Used by TouchInterface to show or hide up/down widgets 
+    ammoprop_OscAim       = $00010000;
+    ammoprop_NoMoveAfter  = $00020000;
+    ammoprop_Track        = $00040000;
     ammoprop_NoRoundEnd   = $10000000;
 
     AMMO_INFINITE = 100;
 
-    EXPLAllDamageInRadius = $00000001;
+    //EXPLAllDamageInRadius = $00000001;  Completely unused for ages
     EXPLAutoSound         = $00000002;
     EXPLNoDamage          = $00000004;
     EXPLDoNotTouchHH      = $00000008;
@@ -287,8 +300,33 @@ const
     htHealth      = $04;
     htTransparent = $08;
 
+    AMAnimDuration = 200;
+    AMHidden    = 0;//AMState values
+    AMShowingUp = 1;
+    AMShowing   = 2;
+    AMHiding    = 3;
+
+    AMTypeMaskX     = $00000001;
+    AMTypeMaskY     = $00000002;
+    AMTypeMaskAlpha = $00000004;
+    AMTypeMaskSlide = $00000008;
 
+{$IFDEF MOBILE}
+    AMSlotSize = 48;
+    AMTITLE = 30;
+{$ELSE}
+    AMSlotSize = 32;
+{$ENDIF}
+    AMSlotPadding = (AMSlotSize - 32) shr 1;
+
+{$IFDEF USE_TOUCH_INTERFACE}
+    FADE_ANIM_TIME = 500;
+    MOVE_ANIM_TIME = 500;
+{$ENDIF}
 
+    cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
+    cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
+       
 implementation
 
 end.
diff --git a/hedgewars/uCursor.pas b/hedgewars/uCursor.pas
index 4547598..a4c50fd 100644
--- a/hedgewars/uCursor.pas
+++ b/hedgewars/uCursor.pas
@@ -24,7 +24,8 @@ begin
         CursorPoint.X:= CursorPoint.X + x - cScreenWidth div 2;
         CursorPoint.Y:= CursorPoint.Y - y + cScreenHeight div 2;
 
-        if cHasFocus then SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
+        if cHasFocus then
+            SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
         end
 end;
 
diff --git a/hedgewars/uDebug.pas b/hedgewars/uDebug.pas
index d136028..cf5c68c 100644
--- a/hedgewars/uDebug.pas
+++ b/hedgewars/uDebug.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -42,12 +42,18 @@ end;
 
 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean);
 begin
-if not Assert then OutError(Msg, isFatal)
+if not Assert then
+    OutError(Msg, isFatal)
 end;
 
 procedure SDLTry(Assert: boolean; isFatal: boolean);
+var s: shortstring;
 begin
-if not Assert then OutError(SDL_GetError, isFatal)
+if not Assert then
+    begin
+    s:= SDL_GetError();
+    OutError(s, isFatal)
+    end
 end;
 
 end.
diff --git a/hedgewars/uFloat.pas b/hedgewars/uFloat.pas
index 7fe476e..d2c50e9 100644
--- a/hedgewars/uFloat.pas
+++ b/hedgewars/uFloat.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -42,18 +42,18 @@ interface
 {$IFDEF FPC}
 {$IFDEF ENDIAN_LITTLE}
 type hwFloat = record
-               isNegative: boolean;
-               case byte of
-               0: (Frac, Round: Longword);
-               1: (QWordValue : QWord);
-               end;
+    isNegative: boolean;
+    case byte of
+        0: (Frac, Round: Longword);
+        1: (QWordValue : QWord);
+        end;
 {$ELSE}
 type hwFloat = record
-               isNegative: boolean;
-               case byte of
-               0: (Round, Frac: Longword);
-               1: (QWordValue : QWord);
-               end;
+    isNegative: boolean;
+    case byte of
+    0: (Round, Frac: Longword);
+    1: (QWordValue : QWord);
+    end;
 {$ENDIF}
 
 // Returns an hwFloat that represents the value of integer parameter i
@@ -62,6 +62,10 @@ function hwFloat2Float (const i: hwFloat) : extended; inline;
 
 // The implemented operators
 
+operator = (const z1, z2: hwFloat) z : boolean; inline;
+{$IFDEF PAS2C}
+operator <> (const z1, z2: hwFloat) z : boolean; inline;
+{$ENDIF}
 operator + (const z1, z2: hwFloat) z : hwFloat; inline;
 operator - (const z1, z2: hwFloat) z : hwFloat; inline;
 operator - (const z1: hwFloat) z : hwFloat; inline;
@@ -81,14 +85,17 @@ function cstr(const z: hwFloat): shortstring; // Returns a shortstring represent
 function hwRound(const t: hwFloat): LongInt; inline; // Does NOT really round but returns the integer representation of the hwFloat without fractional digits. (-_0_9 -> -0, _1_5 -> _1)
 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign.
 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t.
+function hwPow(const t: hwFloat; p: LongWord): hwFloat; inline; // Returns the power of the value
 function hwSqrt(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t.
 function Distance(const dx, dy: hwFloat): hwFloat; // Returns the distance between two points in 2-dimensional space, of which the parameters are the horizontal and vertical distance.
 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
 function AngleSin(const Angle: Longword): hwFloat;
 function AngleCos(const Angle: Longword): hwFloat;
+function vector2Angle(const x, y: hwFloat): LongInt;
 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
 function hwSign(r: hwFloat): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
-
+function hwSignf(r: real): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
+function isZero(const z: hwFloat): boolean; inline;
 {$IFDEF FPC}
 {$J-}
 {$ENDIF}
@@ -109,10 +116,12 @@ const  _1div1024: hwFloat = (isNegative: false; QWordValue:     4194304);
          _0_0005: hwFloat = (isNegative: false; QWordValue:     2147484);
           _0_001: hwFloat = (isNegative: false; QWordValue:     4294967);
           _0_003: hwFloat = (isNegative: false; QWordValue:    12884902);
+         _0_0032: hwFloat = (isNegative: false; QWordValue:    13743895);
           _0_004: hwFloat = (isNegative: false; QWordValue:    17179869);
           _0_005: hwFloat = (isNegative: false; QWordValue:    21474836);
           _0_008: hwFloat = (isNegative: false; QWordValue:    34359738);
            _0_01: hwFloat = (isNegative: false; QWordValue:    42949673);
+         _0_0128: hwFloat = (isNegative: false; QWordValue:    54975581);
            _0_02: hwFloat = (isNegative: false; QWordValue:    85899345);
            _0_03: hwFloat = (isNegative: false; QWordValue:   128849018);
            _0_07: hwFloat = (isNegative: false; QWordValue:   300647710);
@@ -142,13 +151,21 @@ const  _1div1024: hwFloat = (isNegative: false; QWordValue:     4194304);
           _0_999: hwFloat = (isNegative: false; QWordValue:  4290672328);
               _0: hwFloat = (isNegative: false; QWordValue:           0);
               _1: hwFloat = (isNegative: false; QWordValue:  4294967296);
+            _1_2: hwFloat = (isNegative: false; QWordValue:  1288490189*4);
             _1_5: hwFloat = (isNegative: false; QWordValue:  4294967296 * 3 div 2);
+            _1_6: hwFloat = (isNegative: false; QWordValue:  4294967296 * 8 div 5);
             _1_9: hwFloat = (isNegative: false; QWordValue:  8160437862);
               _2: hwFloat = (isNegative: false; QWordValue:  4294967296 * 2);
+            _2_4: hwFloat = (isNegative: false; QWordValue:  4294967296 * 12 div 5);
               _3: hwFloat = (isNegative: false; QWordValue:  4294967296 * 3);
+            _3_2: hwFloat = (isNegative: false; QWordValue:  3435973837*4);
+             _PI: hwFloat = (isNegative: false; QWordValue: 13493037704);
               _4: hwFloat = (isNegative: false; QWordValue:  4294967296 * 4);
+            _4_5: hwFloat = (isNegative: false; QWordValue:  4294967296 * 9 div 2);
               _5: hwFloat = (isNegative: false; QWordValue:  4294967296 * 5);
               _6: hwFloat = (isNegative: false; QWordValue:  4294967296 * 6);
+            _6_4: hwFloat = (isNegative: false; QWordValue:  3435973837 * 8);
+              _7: hwFloat = (isNegative: false; QWordValue:  4294967296 * 7);
              _10: hwFloat = (isNegative: false; QWordValue:  4294967296 * 10);
              _12: hwFloat = (isNegative: false; QWordValue:  4294967296 * 12);
              _16: hwFloat = (isNegative: false; QWordValue:  4294967296 * 16);
@@ -157,12 +174,17 @@ const  _1div1024: hwFloat = (isNegative: false; QWordValue:     4194304);
              _25: hwFloat = (isNegative: false; QWordValue:  4294967296 * 25);
              _30: hwFloat = (isNegative: false; QWordValue:  4294967296 * 30);
              _40: hwFloat = (isNegative: false; QWordValue:  4294967296 * 40);
+             _41: hwFloat = (isNegative: false; QWordValue:  4294967296 * 41);
+             _49: hwFloat = (isNegative: false; QWordValue:  4294967296 * 49);
              _50: hwFloat = (isNegative: false; QWordValue:  4294967296 * 50);
              _70: hwFloat = (isNegative: false; QWordValue:  4294967296 * 70);
+             _90: hwFloat = (isNegative: false; QWordValue:  4294967296 * 90);
             _128: hwFloat = (isNegative: false; QWordValue:  4294967296 * 128);
+            _180: hwFloat = (isNegative: false; QWordValue:  4294967296 * 180);
             _250: hwFloat = (isNegative: false; QWordValue:  4294967296 * 250);
             _256: hwFloat = (isNegative: false; QWordValue:  4294967296 * 256);
             _300: hwFloat = (isNegative: false; QWordValue:  4294967296 * 300);
+            _360: hwFloat = (isNegative: false; QWordValue:  4294967296 * 360);
             _450: hwFloat = (isNegative: false; QWordValue:  4294967296 * 450);
            _1000: hwFloat = (isNegative: false; QWordValue:  4294967296 * 1000);
            _1024: hwFloat = (isNegative: false; QWordValue:  4294967296 * 1024);
@@ -185,144 +207,264 @@ uses uSinTable;
 
 {$IFDEF FPC}
 
-function int2hwFloat (const i: LongInt) : hwFloat;
+function int2hwFloat (const i: LongInt) : hwFloat; inline;
 begin
 int2hwFloat.isNegative:= i < 0;
 int2hwFloat.Round:= abs(i);
 int2hwFloat.Frac:= 0
 end;
 
-function hwFloat2Float (const i: hwFloat) : extended;
+function hwFloat2Float (const i: hwFloat) : extended; inline;
+begin
+hwFloat2Float:= i.Frac / $100000000 + i.Round;
+if i.isNegative then
+    hwFloat2Float:= -hwFloat2Float;
+end;
+
+{$IFNDEF WEB}
+operator = (const z1, z2: hwFloat) z : boolean; inline;
 begin
-hwFloat2Float:= i.QWordValue / $100000000;
-if i.isNegative then hwFloat2Float:= -hwFloat2Float;
+    z:= (z1.isNegative = z2.isNegative) and (z1.QWordValue = z2.QWordValue);
 end;
 
-operator + (const z1, z2: hwFloat) z : hwFloat;
+{$IFDEF PAS2C}
+operator <> (const z1, z2: hwFloat) z : boolean; inline;
+begin
+    z:= (z1.isNegative <> z2.isNegative) or (z1.QWordValue <> z2.QWordValue);
+end;
+{$ENDIF}
+
+operator + (const z1, z2: hwFloat) z : hwFloat; inline;
 begin
 if z1.isNegative = z2.isNegative then
-   begin
-   z.isNegative:= z1.isNegative;
-   z.QWordValue:= z1.QWordValue + z2.QWordValue
-   end
+    begin
+    z.isNegative:= z1.isNegative;
+    z.QWordValue:= z1.QWordValue + z2.QWordValue
+    end
 else
-   if z1.QWordValue > z2.QWordValue then
-      begin
-      z.isNegative:= z1.isNegative;
-      z.QWordValue:= z1.QWordValue - z2.QWordValue
-      end else
-      begin
-      z.isNegative:= z2.isNegative;
-      z.QWordValue:= z2.QWordValue - z1.QWordValue
-      end
+    if z1.QWordValue > z2.QWordValue then
+        begin
+        z.isNegative:= z1.isNegative;
+        z.QWordValue:= z1.QWordValue - z2.QWordValue
+        end
+    else
+        begin
+        z.isNegative:= z2.isNegative;
+        z.QWordValue:= z2.QWordValue - z1.QWordValue
+        end
 end;
 
-operator - (const z1, z2: hwFloat) z : hwFloat;
+operator - (const z1, z2: hwFloat) z : hwFloat; inline;
 begin
 if z1.isNegative = z2.isNegative then
-   if z1.QWordValue > z2.QWordValue then
-      begin
-      z.isNegative:= z1.isNegative;
-      z.QWordValue:= z1.QWordValue - z2.QWordValue
-      end else
-      begin
-      z.isNegative:= not z2.isNegative;
-      z.QWordValue:= z2.QWordValue - z1.QWordValue
-      end
-else begin
-     z.isNegative:= z1.isNegative;
-     z.QWordValue:= z1.QWordValue + z2.QWordValue
-     end
-end;
-
-operator - (const z1: hwFloat) z : hwFloat;
+    if z1.QWordValue > z2.QWordValue then
+        begin
+        z.isNegative:= z1.isNegative;
+        z.QWordValue:= z1.QWordValue - z2.QWordValue
+        end
+    else
+        begin
+        z.isNegative:= not z2.isNegative;
+        z.QWordValue:= z2.QWordValue - z1.QWordValue
+        end
+else
+    begin
+    z.isNegative:= z1.isNegative;
+    z.QWordValue:= z1.QWordValue + z2.QWordValue
+    end
+end;
+
+function isZero(const z: hwFloat): boolean; inline; 
+begin
+isZero := z.QWordValue = 0;
+end;
+
+operator < (const z1, z2: hwFloat) b : boolean; inline;
+begin
+if z1.isNegative xor z2.isNegative then
+    b:= z1.isNegative
+else
+    if z1.QWordValue = z2.QWordValue then
+        b:= false
+    else
+        b:= not((z1.QWordValue = z2.QWordValue) or ((z2.QWordValue < z1.QWordValue) <> z1.isNegative))
+end;
+
+operator > (const z1, z2: hwFloat) b : boolean; inline;
+begin
+if z1.isNegative xor z2.isNegative then
+    b:= z2.isNegative
+else
+    if z1.QWordValue = z2.QWordValue then
+        b:= false
+    else
+        b:= (z1.QWordValue > z2.QWordValue) <> z2.isNegative
+end;
+{$ENDIF}
+{$IFDEF WEB}
+(*
+    Mostly to be kind to JS as of 2012-08-27 where there is no int64/uint64.  This may change though.
+*)
+operator = (const z1, z2: hwFloat) z : boolean; inline;
+begin
+    z:= (z1.isNegative = z2.isNegative) and (z1.Frac = z2.Frac) and (z1.Round = z2.Round);
+end;
+
+operator <> (const z1, z2: hwFloat) z : boolean; inline;
+begin
+    z:= (z1.isNegative <> z2.isNegative) or (z1.Frac <> z2.Frac) or (z1.Round <> z2.Round);
+end;
+
+operator + (const z1, z2: hwFloat) z : hwFloat; inline;
+begin
+if z1.isNegative = z2.isNegative then
+    begin
+    z:= z1;
+    z.Frac:= z.Frac + z2.Frac;
+    z.Round:= z.Round + z2.Round;
+    if z.Frac<z1.Frac then inc(z.Round)
+    end
+else
+    if (z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then
+        begin
+        z.isNegative:= z1.isNegative;
+        z.Round:= z1.Round - z2.Round;
+        z.Frac:= z1.Frac - z2.Frac;
+        if z2.Frac > z1.Frac then dec(z.Round)
+        end
+    else
+        begin
+        z.isNegative:= z2.isNegative;
+        z.Round:= z2.Round - z1.Round;
+        z.Frac:= z2.Frac-z1.Frac;
+        if z2.Frac < z1.Frac then dec(z.Round)
+        end
+end;
+
+operator - (const z1, z2: hwFloat) z : hwFloat; inline;
+begin
+if z1.isNegative = z2.isNegative then
+    if (z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then
+        begin
+        z.isNegative:= z1.isNegative;
+        z.Round:= z1.Round - z2.Round;
+        z.Frac:= z1.Frac-z2.Frac;
+        if z2.Frac > z1.Frac then dec(z.Round)
+        end
+    else
+        begin
+        z.isNegative:= not z2.isNegative;
+        z.Round:= z2.Round - z1.Round;
+        z.Frac:= z2.Frac-z1.Frac;
+        if z2.Frac < z1.Frac then dec(z.Round)
+        end
+else
+    begin
+    z:= z1;
+    z.Frac:= z.Frac + z2.Frac;
+    z.Round:= z.Round + z2.Round;
+    if z.Frac<z1.Frac then inc(z.Round)
+    end
+end;
+
+operator < (const z1, z2: hwFloat) b : boolean; inline;
+begin
+if z1.isNegative xor z2.isNegative then
+    b:= z1.isNegative
+else
+(*  Not so sure this specialcase is a win w/ Round/Frac. have to do more tests anyway.
+    if (z1.Round = z2.Round and (z1.Frac = z2.Frac)) then
+        b:= false
+    else *)
+        b:= ((z1.Round < z2.Round) or ((z1.Round = z2.Round) and (z1.Frac < z2.Frac))) <> z1.isNegative
+end;
+
+operator > (const z1, z2: hwFloat) b : boolean; inline;
+begin
+if z1.isNegative xor z2.isNegative then
+    b:= z2.isNegative
+else
+(*
+    if z1.QWordValue = z2.QWordValue then
+        b:= false
+    else*)
+        b:= ((z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac))) <> z1.isNegative
+end;
+
+function isZero(const z: hwFloat): boolean; inline; 
+begin
+isZero := (z.Round = 0) and (z.Frac = 0);
+end;
+{$ENDIF}
+
+operator - (const z1: hwFloat) z : hwFloat; inline;
 begin
 z:= z1;
 z.isNegative:= not z.isNegative
 end;
 
 
-operator * (const z1, z2: hwFloat) z : hwFloat;
+operator * (const z1, z2: hwFloat) z : hwFloat; inline;
 begin
 z.isNegative:= z1.isNegative xor z2.isNegative;
-z.QWordValue:= QWord(z1.Round) * z2.Frac +
-               QWord(z1.Frac) * z2.Round +
-               ((QWord(z1.Frac) * z2.Frac) shr 32);
+z.QWordValue:= QWord(z1.Round) * z2.Frac + QWord(z1.Frac) * z2.Round + ((QWord(z1.Frac) * z2.Frac) shr 32);
 z.Round:= z.Round + QWord(z1.Round) * z2.Round;
 end;
 
-operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat;
+operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat; inline;
 begin
 z.isNegative:= z1.isNegative xor (z2 < 0);
 z.QWordValue:= z1.QWordValue * abs(z2)
 end;
 
-operator / (const z1: hwFloat; z2: hwFloat) z : hwFloat;
+operator / (const z1: hwFloat; z2: hwFloat) z : hwFloat; inline;
 var t: hwFloat;
 begin
 z.isNegative:= z1.isNegative xor z2.isNegative;
 z.Round:= z1.QWordValue div z2.QWordValue;
 t:= z1 - z2 * z.Round;
 if t.QWordValue = 0 then
-   z.Frac:= 0
+    z.Frac:= 0
 else
-   begin
-   while ((t.QWordValue and $8000000000000000) = 0) and
-         ((z2.QWordValue and $8000000000000000) = 0) do
-         begin
-         t.QWordValue:= t.QWordValue shl 1;
-         z2.QWordValue:= z2.QWordValue shl 1
-         end;
-   if z2.Round > 0 then z.Frac:= (t.QWordValue) div (z2.Round)
-                   else z.Frac:= 0
-   end
+    begin
+    while ((t.QWordValue and $8000000000000000) = 0) and ((z2.QWordValue and $8000000000000000) = 0) do
+        begin
+        t.QWordValue:= t.QWordValue shl 1;
+        z2.QWordValue:= z2.QWordValue shl 1
+        end;
+    if z2.Round > 0 then
+        z.Frac:= (t.QWordValue) div (z2.Round)
+    else
+        z.Frac:= 0
+    end
 end;
 
-operator / (const z1: hwFloat; const z2: LongInt) z : hwFloat;
+operator / (const z1: hwFloat; const z2: LongInt) z : hwFloat; inline;
 begin
 z.isNegative:= z1.isNegative xor (z2 < 0);
 z.QWordValue:= z1.QWordValue div abs(z2)
 end;
 
-operator < (const z1, z2: hwFloat) b : boolean;
-begin
-if z1.isNegative xor z2.isNegative then
-   b:= z1.isNegative
-else
-   if z1.QWordValue = z2.QWordValue then
-      b:= false
-   else
-      b:= (z1.QWordValue < z2.QWordValue) xor z1.isNegative
-end;
-
-operator > (const z1, z2: hwFloat) b : boolean;
-begin
-if z1.isNegative xor z2.isNegative then
-   b:= z2.isNegative
-else
-   if z1.QWordValue = z2.QWordValue then
-      b:= false
-   else
-      b:= (z1.QWordValue > z2.QWordValue) xor z2.isNegative
-end;
-
 function cstr(const z: hwFloat): shortstring;
 var tmpstr: shortstring;
 begin
 str(z.Round, cstr);
 if z.Frac <> 0 then
-   begin
-   str(z.Frac / $100000000:1:10, tmpstr);
-   delete(tmpstr, 1, 2);
-   cstr:= cstr + '.' + tmpstr
-   end;
-if z.isNegative then cstr:= '-' + cstr
+    begin
+    str(z.Frac / $100000000, tmpstr);
+    delete(tmpstr, 1, 2);
+    cstr:= cstr + '.' + copy(tmpstr, 1, 10)
+    end;
+if z.isNegative then
+    cstr:= '-' + cstr
 end;
 
 function hwRound(const t: hwFloat): LongInt;
 begin
-if t.isNegative then hwRound:= -(t.Round and $7FFFFFFF)
-                else hwRound:= t.Round and $7FFFFFFF
+if t.isNegative then
+    hwRound:= -(t.Round and $7FFFFFFF)
+else
+    hwRound:= t.Round and $7FFFFFFF
 end;
 
 function hwAbs(const t: hwFloat): hwFloat;
@@ -331,35 +473,62 @@ hwAbs:= t;
 hwAbs.isNegative:= false
 end;
 
-function hwSqr(const t: hwFloat): hwFloat;
+function hwSqr(const t: hwFloat): hwFloat; inline;
 begin
 hwSqr.isNegative:= false;
-hwSqr.QWordValue:=
-      ((QWord(t.Round) * t.Round) shl 32)
-    + QWord(t.Round) * t.Frac * 2
-    + ((QWord(t.Frac) * t.Frac) shr 32);
+hwSqr.QWordValue:= ((QWord(t.Round) * t.Round) shl 32) + QWord(t.Round) * t.Frac * 2 + ((QWord(t.Frac) * t.Frac) shr 32);
+end;
+
+function hwPow(const t: hwFloat;p: LongWord): hwFloat;
+begin
+hwPow:= t;
+if p mod 2 = 0 then hwPow.isNegative:= false;
+
+while p > 0 do
+    begin
+    hwPow.QWordValue:= QWord(hwPow.Round) * t.Frac + QWord(hwPow.Frac) * t.Round + ((QWord(hwPow.Frac) * t.Frac) shr 32);
+    dec(p)
+    end
 end;
 
 function hwSqrt(const t: hwFloat): hwFloat;
+const pwr = 8; // even value, feel free to adjust
+      rThreshold = 1 shl (pwr + 32);
+      lThreshold = 1 shl (pwr div 2 + 32);
 var l, r: QWord;
     c: hwFloat;
 begin
 hwSqrt.isNegative:= false;
 
 if t.Round = 0 then
-   begin
-   l:= t.QWordValue;
-   r:= $100000000
-   end else
-   begin
-   l:= $100000000;
-   r:= t.QWordValue div 2 + $80000000; // r:= t / 2 + 0.5
-   if r > $FFFFFFFFFFFF then r:= $FFFFFFFFFFFF
-   end;
+    begin
+    l:= t.QWordValue;
+    r:= $100000000
+    end
+else
+    begin
+    if t.QWordValue > $FFFFFFFFFFFF then // t.Round > 65535.9999
+        begin
+        l:= $10000000000; // 256
+        r:= $FFFFFFFFFFFF; // 65535.9999
+        end else
+        if t.QWordValue >= rThreshold then
+            begin
+            l:= lThreshold;
+            r:= $10000000000; // 256
+            end else
+            begin
+            l:= $100000000;
+            r:= lThreshold;
+            end;
+    end;
 
 repeat
-  c.QWordValue:= (l + r) div 2;
-  if hwSqr(c).QWordValue > t.QWordValue then r:= c.QWordValue else l:= c.QWordValue
+    c.QWordValue:= (l + r) shr 1;
+    if hwSqr(c).QWordValue > t.QWordValue then
+        r:= c.QWordValue
+    else
+        l:= c.QWordValue
 until r - l <= 1;
 
 hwSqrt.QWordValue:= l
@@ -384,7 +553,18 @@ end;
 function hwSign(r: hwFloat): LongInt;
 begin
 // yes, we have negative zero for a reason
-if r.isNegative then hwSign:= -1 else hwSign:= 1
+if r.isNegative then
+    hwSign:= -1
+else
+    hwSign:= 1
+end;
+
+function hwSignf(r: real): LongInt;
+begin
+if r < 0 then
+    hwSignf:= -1
+else
+    hwSignf:= 1
 end;
 
 
@@ -392,16 +572,52 @@ function AngleSin(const Angle: Longword): hwFloat;
 begin
 //TryDo((Angle >= 0) and (Angle <= 2048), 'Sin param exceeds limits', true);
 AngleSin.isNegative:= false;
-if Angle < 1024 then AngleSin.QWordValue:= SinTable[Angle]
-                else AngleSin.QWordValue:= SinTable[2048 - Angle]
+if Angle < 1024 then
+    AngleSin.QWordValue:= SinTable[Angle]
+else
+    AngleSin.QWordValue:= SinTable[2048 - Angle]
 end;
 
 function AngleCos(const Angle: Longword): hwFloat;
 begin
 //TryDo((Angle >= 0) and (Angle <= 2048), 'Cos param exceeds limits', true);
 AngleCos.isNegative:= Angle > 1024;
-if Angle < 1024 then AngleCos.QWordValue:= SinTable[1024 - Angle]
-                else AngleCos.QWordValue:= SinTable[Angle - 1024]
+if Angle < 1024 then
+    AngleCos.QWordValue:= SinTable[1024 - Angle]
+else
+    AngleCos.QWordValue:= SinTable[Angle - 1024]
+end;
+
+function vector2Angle(const x, y: hwFloat): LongInt;
+var d, nf: hwFloat;
+    l, r, c, oc: Longword;
+    n: QWord;
+begin
+    d:= _1 / Distance(x, y);
+
+    nf:= y * d;
+    n:= nf.QWordValue;
+
+    l:= 0;
+    r:= 1024;
+    c:= 0;
+
+    repeat
+        oc:= c;
+
+        c:= (l + r) shr 1;
+
+        if n >= SinTable[c] then
+            l:= c
+        else
+            r:= c;
+
+    until (oc = c);
+
+    if x.isNegative then c:= 2048 - c;
+    if y.isNegative then c:= - c;
+
+    vector2Angle:= c
 end;
 
 {$ENDIF}
diff --git a/hedgewars/uGame.pas b/hedgewars/uGame.pas
index c4ed6ed..a71264a 100644
--- a/hedgewars/uGame.pas
+++ b/hedgewars/uGame.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,54 +24,74 @@ interface
 procedure DoGameTick(Lag: LongInt);
 
 ////////////////////
-   implementation
+    implementation
 ////////////////////
-uses uKeys, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables;
+uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, 
+    uVisualGears, uTypes, uVariables, uCommands, uConsts
+    {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF};
 
 procedure DoGameTick(Lag: LongInt);
 var i: LongInt;
 begin
-if isPaused then exit;
+if isPaused then
+    exit;
 if (not CurrentTeam^.ExtDriven) then
     begin
     NetGetNextCmd; // its for the case of receiving "/say" message
     isInLag:= false;
     SendKeepAliveMessage(Lag)
     end;
-if Lag > 100 then Lag:= 100
-else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then Lag:= 2500;
+if GameType <> gmtRecord then
+    begin
+    if Lag > 100 then
+        Lag:= 100
+    else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then
+        Lag:= 2500;
 
-if (GameType = gmtDemo) then 
-    if isSpeed then Lag:= Lag * 10
-    else
-        if cOnlyStats then Lag:= High(LongInt);
+    if (GameType = gmtDemo) then 
+        if isSpeed then
+        begin
+            i:= RealTicks-SpeedStart;
+            if i < 2000 then Lag:= Lag*5
+            else if i < 4000 then Lag:= Lag*10
+            else if i < 6000 then Lag:= Lag*20
+            else if i < 8000 then Lag:= Lag*40
+            else Lag:= Lag*80;
+        end
+        else
+            if cOnlyStats then
+                Lag:= High(LongInt);
+    end;
 PlayNextVoice;
 i:= 1;
 while (GameState <> gsExit) and (i <= Lag) do
     begin
     if not CurrentTeam^.ExtDriven then
-       begin
-       if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
-       ProcessGears
-       end else
-       begin
-       NetGetNextCmd;
-       if isInLag then
-          case GameType of
+        begin
+        if CurrentHedgehog^.BotLevel <> 0 then
+            ProcessBot;
+        ProcessGears;
+        {$IFDEF SDL13}ProcessTouch;{$ENDIF}
+        end
+    else
+        begin
+        NetGetNextCmd;
+        if isInLag then
+            case GameType of
                 gmtNet: begin
                         // just update the health bars
                         AddVisualGear(0, 0, vgtTeamHealthSorter);
                         break;
                         end;
-               gmtDemo: begin
+                gmtDemo, gmtRecord: begin
                         GameState:= gsExit;
                         exit
                         end;
-               gmtSave: begin
+                gmtSave: begin
                         RestoreTeamsFromSave;
                         SetBinds(CurrentTeam^.Binds);
-                        //CurrentHedgehog^.Gear^.Message:= 0; <- produces bugs with further save restoring and demos
-                        isSoundEnabled:= isSEBackup;
+                        StopMessages(gmLeft or gmRight or gmUp or gmDown);
+                        ResetSound;   // restore previous sound state
                         PlayMusic;
                         GameType:= gmtLocal;
                         AddVisualGear(0, 0, vgtTeamHealthSorter);
@@ -79,9 +99,9 @@ while (GameState <> gsExit) and (i <= Lag) do
                         {$IFDEF IPHONEOS}InitIPC;{$ENDIF}
                         uMobile.SaveLoadingEnded();
                         end;
-               end
-          else ProcessGears
-       end;
+                end
+        else ProcessGears
+        end;
     inc(i)
     end
 end;
diff --git a/hedgewars/uGears.pas b/hedgewars/uGears.pas
index 08bb3d9..7cbc4e3 100644
--- a/hedgewars/uGears.pas
+++ b/hedgewars/uGears.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -37,17 +37,14 @@ uses SDLh, uConsts, uFloat, uTypes;
 
 procedure initModule;
 procedure freeModule;
-function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
-function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword ): PGear;
+function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content, cnt: Longword): PGear;
 function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean ): PGear;
-function  GetAmmo: TAmmoType;
-function  GetUtility: TAmmoType;
-procedure ResurrectHedgehog(gear: PGear);
+function  GetAmmo(Hedgehog: PHedgehog): TAmmoType;
+function  GetUtility(Hedgehog: PHedgehog): TAmmoType;
 procedure HideHog(HH: PHedgehog);
 procedure RestoreHog(HH: PHedgehog);
 procedure ProcessGears;
 procedure EndTurnCleanup;
-procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
 procedure SetAllToActive;
 procedure SetAllHHToActive;
 procedure DrawGears;
@@ -55,621 +52,39 @@ procedure FreeGearsList;
 procedure AddMiscGears;
 procedure AssignHHCoords;
 function  GearByUID(uid : Longword) : PGear;
-procedure InsertGearToList(Gear: PGear);
-procedure RemoveGearFromList(Gear: PGear);
-function  ModifyDamage(dmg: Longword; Gear: PGear): Longword;
-procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt; skipProximity: boolean = false);
-procedure DeleteGear(Gear: PGear); 
+procedure doStepDrowningGear(Gear: PGear);
 
 
 implementation
 uses uStore, uSound, uTeams, uRandom, uCollisions, uIO, uLandGraphics,
-     uAIMisc, uLocale, uAI, uAmmos, uStats, uVisualGears, uScript, GLunit, uMobile, uVariables,
-     uCommands, uUtils, uTextures, uRenderUtils, uGearsRender, uCaptions, uDebug, uLandTexture;
+    uLocale, uAI, uAmmos, uStats, uVisualGears, uScript, GLunit, uMobile, uVariables,
+    uCommands, uUtils, uTextures, uRenderUtils, uGearsRender, uCaptions, uDebug, uLandTexture,
+    uGearsHedgehog, uGearsUtils, uGearsList, uGearsHandlers, uGearsHandlersRope;
 
+var skipFlag: boolean;
 
-procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword; const Tint: LongWord = $FFFFFFFF); forward;
 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward;
 //procedure AmmoFlameWork(Ammo: PGear); forward;
-function  GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): TPGearArray; forward;
-function  CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; forward;
+function  GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS; forward;
 procedure SpawnBoxOfSmth; forward;
-procedure AfterAttack; forward;
-procedure HedgehogStep(Gear: PGear); forward;
-procedure doStepHedgehogMoving(Gear: PGear); forward;
-procedure HedgehogChAngle(HHGear: PGear); forward;
 procedure ShotgunShot(Gear: PGear); forward;
-procedure PickUp(HH, Gear: PGear); forward;
-procedure HHSetWeapon(HHGear: PGear); forward;
 procedure doStepCase(Gear: PGear); forward;
 
+
+var delay: LongWord;
+    delay2: LongWord;
+    step: (stDelay, stChDmg, stSweep, stTurnReact,
+    stAfterDelay, stChWin, stWater, stChWin2, stHealth,
+    stSpawn, stNTurn);
+    upd: Longword;
+    snowLeft,snowRight: LongInt;
+    //SDMusic: shortstring;
+
 // For better maintainability the step handlers of gears are stored in
 // separate files.
 // Note: step handlers of gears that are hedgehogs are in a different file
 //       than the handlers for all other gears.
 {$INCLUDE "GSHandlers.inc"}
-{$INCLUDE "HHHandlers.inc"}
-
-const doStepHandlers: array[TGearType] of TGearStepProcedure = (
-            @doStepBomb,
-            @doStepHedgehog,
-            @doStepShell,
-            @doStepGrave,
-            @doStepBee,
-            @doStepShotgunShot,
-            @doStepPickHammer,
-            @doStepRope,
-            @doStepMine,
-            @doStepCase,
-            @doStepDEagleShot,
-            @doStepDynamite,
-            @doStepBomb,
-            @doStepCluster,
-            @doStepShover,
-            @doStepFlame,
-            @doStepFirePunch,
-            @doStepActionTimer,
-            @doStepActionTimer,
-            @doStepParachute,
-            @doStepAirAttack,
-            @doStepAirBomb,
-            @doStepBlowTorch,
-            @doStepGirder,
-            @doStepTeleport,
-            @doStepSwitcher,
-            @doStepTarget,
-            @doStepMortar,
-            @doStepWhip,
-            @doStepKamikaze,
-            @doStepCake,
-            @doStepSeduction,
-            @doStepBomb,
-            @doStepCluster,
-            @doStepBomb,
-            @doStepWaterUp,
-            @doStepDrill,
-            @doStepBallgun,
-            @doStepBomb,
-            @doStepRCPlane,
-            @doStepSniperRifleShot,
-            @doStepJetpack,
-            @doStepMolotov,
-            @doStepCase,
-            @doStepBirdy,
-            @doStepEggWork,
-            @doStepPortalShot,
-            @doStepPiano,
-            @doStepBomb,
-            @doStepSineGunShot,
-            @doStepFlamethrower,
-            @doStepSMine,
-            @doStepPoisonCloud,
-            @doStepHammer,
-            @doStepHammerHit,
-            @doStepResurrector,
-            @doStepNapalmBomb,
-            @doStepSnowball,
-            @doStepSnowflake,
-            @doStepStructure,
-            @doStepLandGun,
-            @doStepTardis);
-
-procedure InsertGearToList(Gear: PGear);
-var tmp, ptmp: PGear;
-begin
-    tmp:= GearsList;
-    ptmp:= GearsList;
-    while (tmp <> nil) and (tmp^.Z <= Gear^.Z) do
-        begin
-        ptmp:= tmp;
-        tmp:= tmp^.NextGear
-        end;
-
-    if ptmp <> tmp then
-        begin
-        Gear^.NextGear:= ptmp^.NextGear;
-        Gear^.PrevGear:= ptmp;
-        if ptmp^.NextGear <> nil then ptmp^.NextGear^.PrevGear:= Gear;
-        ptmp^.NextGear:= Gear
-        end
-    else
-        begin
-        Gear^.NextGear:= GearsList;
-        if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear;
-        GearsList:= Gear;
-        end;
-end;
-
-procedure RemoveGearFromList(Gear: PGear);
-begin
-if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
-if Gear^.PrevGear <> nil then
-    Gear^.PrevGear^.NextGear:= Gear^.NextGear
-else
-    GearsList:= Gear^.NextGear
-end;
-
-procedure spawnHealthTagForHH(HHGear: PGear; dmg: Longword);
-var tag: PVisualGear;
-begin
-tag:= AddVisualGear(hwRound(HHGear^.X), hwRound(HHGear^.Y), vgtHealthTag, dmg);
-if (tag <> nil) then
-    tag^.Hedgehog:= HHGear^.Hedgehog; // the tag needs the tag to determine the text color
-AllInactive:= false;
-HHGear^.Active:= true;
-end;
-
-function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
-const Counter: Longword = 0;
-var gear: PGear;
-begin
-inc(Counter);
-AddFileLog('AddGear: #' + inttostr(Counter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind));
-
-New(gear);
-FillChar(gear^, sizeof(TGear), 0);
-gear^.X:= int2hwFloat(X);
-gear^.Y:= int2hwFloat(Y);
-gear^.Target.X:= NoPointX;
-gear^.Kind := Kind;
-gear^.State:= State;
-gear^.Active:= true;
-gear^.dX:= dX;
-gear^.dY:= dY;
-gear^.doStep:= doStepHandlers[Kind];
-gear^.CollisionIndex:= -1;
-gear^.Timer:= Timer;
-gear^.FlightTime:= 0;
-gear^.uid:= Counter;
-gear^.SoundChannel:= -1;
-gear^.ImpactSound:= sndNone;
-gear^.nImpactSounds:= 0;
-gear^.Density:= _1;
-// Define ammo association, if any.
-gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
-if Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then gear^.Z:= cHHZ+1
-else gear^.Z:= cUsualZ;
-
-if CurrentHedgehog <> nil then
-    begin
-    gear^.Hedgehog:= CurrentHedgehog;
-    gear^.IntersectGear:= CurrentHedgehog^.Gear
-    end;
-    
-case Kind of
-     gtGrenade,
-     gtClusterBomb,
-     gtGasBomb: begin
-                gear^.ImpactSound:= sndGrenadeImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.AdvBounce:= 1;
-                gear^.Radius:= 5;
-                gear^.Elasticity:= _0_8;
-                gear^.Friction:= _0_8;
-                gear^.Density:= _1_5;
-                gear^.RenderTimer:= true;
-                if gear^.Timer = 0 then gear^.Timer:= 3000
-                end;
-  gtWatermelon: begin
-                gear^.ImpactSound:= sndMelonImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.AdvBounce:= 1;
-                gear^.Radius:= 6;
-                gear^.Elasticity:= _0_8;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _2;
-                gear^.RenderTimer:= true;
-                if gear^.Timer = 0 then gear^.Timer:= 3000
-                end;
-  gtMelonPiece: begin
-                gear^.Density:= _2;
-                end;
-    gtHedgehog: begin
-                gear^.AdvBounce:= 1;
-                gear^.Radius:= cHHRadius;
-                gear^.Elasticity:= _0_35;
-                gear^.Friction:= _0_999;
-                gear^.Angle:= cMaxAngle div 2;
-                gear^.Density:= _3;
-                gear^.Z:= cHHZ;
-                if (GameFlags and gfAISurvival) <> 0 then
-                    if gear^.Hedgehog^.BotLevel > 0 then
-                        gear^.Hedgehog^.Effects[heResurrectable] := true;
-                end;
-       gtShell: begin
-                gear^.Radius:= 4;
-                gear^.Density:= _1;
-                end;
-       gtSnowball: begin
-                gear^.ImpactSound:= sndMudballImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Radius:= 4;
-                gear^.Elasticity:= _1;
-                gear^.Friction:= _1;
-                gear^.Density:= _0_5;
-                end;
-
-     gtFlake: begin
-                with Gear^ do
-                    begin
-                    Pos:= 0;
-                    Radius:= 1;
-                    DirAngle:= random * 360;
-                    if State and gstTmpFlag = 0 then
-                        begin
-                        dx.isNegative:= GetRandom(2) = 0;
-                        dx.QWordValue:= GetRandom(100000000);
-                        dy.isNegative:= false;
-                        dy.QWordValue:= GetRandom(70000000);
-                        if GetRandom(2) = 0 then dx := -dx
-                        end;
-                    State:= State or gstInvisible;
-                    Health:= random(vobFrameTicks);
-                    Timer:= random(vobFramesCount);
-                    Angle:= (random(2) * 2 - 1) * (1 + random(10000)) * vobVelocity
-                    end
-                end;
-       gtGrave: begin
-                gear^.ImpactSound:= sndGraveImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Radius:= 10;
-                gear^.Elasticity:= _0_6;
-                end;
-         gtBee: begin
-                gear^.Radius:= 5;
-                gear^.Timer:= 500;
-                gear^.RenderTimer:= true;
-                gear^.Elasticity:= _0_9;
-                gear^.Tag:= 0;
-                end;
-   gtSeduction: begin
-                gear^.Radius:= 250;
-                end;
- gtShotgunShot: begin
-                gear^.Timer:= 900;
-                gear^.Radius:= 2
-                end;
-  gtPickHammer: begin
-                gear^.Radius:= 10;
-                gear^.Timer:= 4000
-                end;
-   gtHammerHit: begin
-                gear^.Radius:= 8;
-                gear^.Timer:= 125
-                end;
-        gtRope: begin
-                gear^.Radius:= 3;
-                gear^.Friction:= _450 * _0_01 * cRopePercent;
-                RopePoints.Count:= 0;
-                end;
-        gtMine: begin
-                gear^.ImpactSound:= sndMineImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Health:= 10;
-                gear^.State:= gear^.State or gstMoving;
-                gear^.Radius:= 2;
-                gear^.Elasticity:= _0_55;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _0_9;
-                if cMinesTime < 0 then
-                    gear^.Timer:= getrandom(51)*100
-                else
-                    gear^.Timer:= cMinesTime;
-                end;
-       gtSMine: begin
-                gear^.Health:= 10;
-                gear^.State:= gear^.State or gstMoving;
-                gear^.Radius:= 2;
-                gear^.Elasticity:= _0_55;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _0_9;
-                gear^.Timer:= 500;
-                end;
-        gtCase: begin
-                gear^.ImpactSound:= sndGraveImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Radius:= 16;
-                gear^.Elasticity:= _0_3
-                end;
-  gtExplosives: begin
-                gear^.ImpactSound:= sndGrenadeImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Radius:= 16;
-                gear^.Elasticity:= _0_4;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _6;
-                gear^.Health:= cBarrelHealth;
-                gear^.Z:= cHHZ-1
-                end;
-  gtDEagleShot: begin
-                gear^.Radius:= 1;
-                gear^.Health:= 50
-                end;
-  gtSniperRifleShot: begin
-                gear^.Radius:= 1;
-                gear^.Health:= 50
-                end;
-    gtDynamite: begin
-                gear^.Radius:= 3;
-                gear^.Elasticity:= _0_55;
-                gear^.Friction:= _0_03;
-                gear^.Density:= _2;
-                gear^.Timer:= 5000;
-                end;
-     gtCluster: begin
-                gear^.Radius:= 2;
-                gear^.Density:= _1_5;
-                gear^.RenderTimer:= true
-                end;
-      gtShover: gear^.Radius:= 20;
-       gtFlame: begin
-                gear^.Tag:= GetRandom(32);
-                gear^.Radius:= 1;
-                gear^.Health:= 5;
-                gear^.Density:= _1;
-                if (gear^.dY.QWordValue = 0) and (gear^.dX.QWordValue = 0) then
-                    begin
-                    gear^.dY:= (getrandom - _0_8) * _0_03;
-                    gear^.dX:= (getrandom - _0_5) * _0_4
-                    end
-                end;
-   gtFirePunch: begin
-                gear^.Radius:= 15;
-                gear^.Tag:= Y
-                end;
-     gtAirBomb: begin
-                gear^.Radius:= 5;
-                gear^.Density:= _2;
-                end;
-   gtBlowTorch: begin
-                gear^.Radius:= cHHRadius + cBlowTorchC;
-                gear^.Timer:= 7500
-                end;
-    gtSwitcher: begin
-                gear^.Z:= cCurrHHZ
-                end;
-      gtTarget: begin
-                gear^.ImpactSound:= sndGrenadeImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.Radius:= 10;
-                gear^.Elasticity:= _0_3;
-                gear^.Timer:= 0
-                end;
-      gtTardis: begin
-                gear^.Timer:= 0;
-                gear^.Pos:= 1;
-                gear^.Z:= cCurrHHZ+1;
-                end;
-      gtMortar: begin
-                gear^.Radius:= 4;
-                gear^.Elasticity:= _0_2;
-                gear^.Friction:= _0_08;
-                gear^.Density:= _1;
-                end;
-        gtWhip: gear^.Radius:= 20;
-      gtHammer: gear^.Radius:= 20;
-    gtKamikaze: begin
-                gear^.Health:= 2048;
-                gear^.Radius:= 20
-                end;
-        gtCake: begin
-                gear^.Health:= 2048;
-                gear^.Radius:= 7;
-                gear^.Z:= cOnHHZ;
-                gear^.RenderTimer:= true;
-                gear^.DirAngle:= -90 * hwSign(Gear^.dX);
-                if not dX.isNegative then gear^.Angle:= 1 else gear^.Angle:= 3
-                end;
- gtHellishBomb: begin
-                gear^.ImpactSound:= sndHellishImpact1;
-                gear^.nImpactSounds:= 4;
-                gear^.AdvBounce:= 1;
-                gear^.Radius:= 4;
-                gear^.Elasticity:= _0_5;
-                gear^.Friction:= _0_96;
-                gear^.Density:= _1_5;
-                gear^.RenderTimer:= true;
-                gear^.Timer:= 5000
-                end;
-       gtDrill: begin
-                if gear^.Timer = 0 then gear^.Timer:= 5000;
-                // Tag for drill strike. if 1 then first impact occured already
-                gear^.Tag := 0;
-                gear^.Radius:= 4;
-                gear^.Density:= _1;
-                end;
-        gtBall: begin
-                gear^.ImpactSound:= sndGrenadeImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.AdvBounce:= 1;
-                gear^.Radius:= 5;
-                gear^.Tag:= random(8);
-                gear^.Timer:= 5000;
-                gear^.Elasticity:= _0_7;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _1_5;
-                end;
-     gtBallgun: begin
-                gear^.Timer:= 5001;
-                end;
-     gtRCPlane: begin
-                gear^.Timer:= 15000;
-                gear^.Health:= 3;
-                gear^.Radius:= 8
-                end;
-     gtJetpack: begin
-                gear^.Health:= 2000;
-                gear^.Damage:= 100
-                end;
-     gtMolotov: begin
-                gear^.Radius:= 6;
-                gear^.Density:= _2;
-                end;
-       gtBirdy: begin
-                gear^.Radius:= 16; // todo: check
-                gear^.Timer:= 0;
-                gear^.Health := 2000;
-                gear^.FlightTime := 2;
-                end;
-         gtEgg: begin
-                gear^.Radius:= 4;
-                gear^.Elasticity:= _0_6;
-                gear^.Friction:= _0_96;
-                gear^.Density:= _1;
-                if gear^.Timer = 0 then gear^.Timer:= 3000
-                end;
-      gtPortal: begin
-                gear^.ImpactSound:= sndMelonImpact;
-                gear^.nImpactSounds:= 1;
-                gear^.AdvBounce:= 0;
-                gear^.Radius:= 17;
-                // set color
-                gear^.Tag:= 2 * gear^.Timer;
-                gear^.Timer:= 15000;
-                gear^.RenderTimer:= false;
-                gear^.Health:= 100;
-                end;
-       gtPiano: begin
-                gear^.Radius:= 32;
-                gear^.Density:= _50;
-                end;
- gtSineGunShot: begin
-                gear^.Radius:= 5;
-                gear^.Health:= 6000;
-                end;
-gtFlamethrower: begin
-                gear^.Tag:= 10;
-                gear^.Timer:= 10;
-                gear^.Health:= 500;
-                gear^.Damage:= 100;
-                end;
-     gtLandGun: begin
-                gear^.Tag:= 10;
-                gear^.Timer:= 10;
-                gear^.Health:= 1000;
-                gear^.Damage:= 100;
-                end;
- gtPoisonCloud: begin
-                gear^.Timer:= 5000;
-                gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000;
-                end;
- gtResurrector: begin
-                gear^.Radius := 100;
-                gear^.Tag := 0
-                end;
-     gtWaterUp: begin
-                gear^.Tag := 47;
-                end;
-  gtNapalmBomb: begin
-                gear^.Timer:= 1000;
-                gear^.Radius:= 5;
-                gear^.Density:= _1_5;
-                end;
-   gtStructure: begin
-                gear^.Elasticity:= _0_55;
-                gear^.Friction:= _0_995;
-                gear^.Density:= _0_9;
-                gear^.Radius:= 13;
-                gear^.Health:= 200;
-                gear^.Tag:= 3;
-                end;
-    end;
-
-InsertGearToList(gear);
-AddGear:= gear;
-
-ScriptCall('onGearAdd', gear^.uid);
-end;
-
-procedure DeleteGear(Gear: PGear);
-var team: PTeam;
-    t,i: Longword;
-    k: boolean;
-begin
-
-ScriptCall('onGearDelete', gear^.uid);
-
-DeleteCI(Gear);
-
-FreeTexture(Gear^.Tex);
-Gear^.Tex:= nil;
-
-// make sure that portals have their link removed before deletion
-if (Gear^.Kind = gtPortal) then
-    begin
-    if (Gear^.IntersectGear <> nil) then
-        if (Gear^.IntersectGear^.IntersectGear = Gear) then
-            Gear^.IntersectGear^.IntersectGear:= nil;
-    end
-else if Gear^.Kind = gtHedgehog then
-    (*
-    This behaviour dates back to revision 4, and I accidentally encountered it with TARDIS.  I don't think it must apply to any modern weapon, since if it was actually hit, the best the gear could do would be to destroy itself immediately, and you'd still end up with two graves.  I believe it should be removed
-     if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then
-        begin
-        AttackBar:= 0;
-        Gear^.Message:= gmDestroy;
-        CurAmmoGear^.Message:= gmDestroy;
-        exit
-        end
-    else*)
-        begin
-        if (hwRound(Gear^.Y) >= cWaterLine) then
-            begin
-            t:= max(Gear^.Damage, Gear^.Health);
-            Gear^.Damage:= t;
-            if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cWaterOpacity < $FF))) and (hwRound(Gear^.Y) < cWaterLine + 256) then
-                spawnHealthTagForHH(Gear, t);
-            end;
-
-        team:= Gear^.Hedgehog^.Team;
-        if CurrentHedgehog^.Gear = Gear then
-            begin
-            AttackBar:= 0;
-            FreeActionsList; // to avoid ThinkThread on drawned gear
-            if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (CurrentHedgehog^.MultiShootAttacks > 0) then OnUsedAmmo(CurrentHedgehog^);
-            end;
-
-        Gear^.Hedgehog^.Gear:= nil;
-        if Gear^.Hedgehog^.King then
-            begin
-            // are there any other kings left? Just doing nil check.  Presumably a mortally wounded king will get reaped soon enough
-            k:= false;
-            for i:= 0 to Pred(team^.Clan^.TeamsNumber) do
-                if (team^.Clan^.Teams[i]^.Hedgehogs[0].Gear <> nil) then k:= true;
-            if not k then
-                for i:= 0 to Pred(team^.Clan^.TeamsNumber) do
-                    begin
-                    team^.Clan^.Teams[i]^.hasGone:= true;
-                    TeamGoneEffect(team^.Clan^.Teams[i]^)
-                    end
-            end;
-
-        // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
-        // same stand for CheckHHDamage
-        if (Gear^.LastDamage <> nil) then
-            uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
-        else
-            uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);
-
-        inc(KilledHHs);
-        RecountTeamHealth(team);
-        if (CurrentHedgehog <> nil) and CurrentHedgehog^.Effects[heResurrectable] and not Gear^.Hedgehog^.Effects[heResurrectable] then
-            with CurrentHedgehog^ do 
-                begin
-                inc(Team^.stats.AIKills);
-                FreeTexture(Team^.AIKillsTex);
-                Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
-                end
-        end;
-with Gear^ do
-    AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind));
-
-if CurAmmoGear = Gear then CurAmmoGear:= nil;
-if FollowGear = Gear then FollowGear:= nil;
-if lastGearByUID = Gear then lastGearByUID := nil;
-RemoveGearFromList(Gear);
-Dispose(Gear)
-end;
 
 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
 var Gear: PGear;
@@ -679,11 +94,12 @@ CheckNoDamage:= true;
 Gear:= GearsList;
 while Gear <> nil do
     begin
-    if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue) and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then
+    if (Gear^.Kind = gtHedgehog) and (((GameFlags and gfInfAttack) = 0) or ((Gear^.dX.QWordValue < _0_000004.QWordValue)
+    and (Gear^.dY.QWordValue < _0_000004.QWordValue))) then
         begin
-        if (not isInMultiShoot) then inc(Gear^.Damage, Gear^.Karma);
-        if (Gear^.Damage <> 0) and
-        (not Gear^.Invulnerable) then
+        if (not isInMultiShoot) then
+            inc(Gear^.Damage, Gear^.Karma);
+        if (Gear^.Damage <> 0) and (not Gear^.Invulnerable) then
             begin
             CheckNoDamage:= false;
 
@@ -695,13 +111,12 @@ while Gear <> nil do
                 end
             else
                 dec(Gear^.Health, dmg);
-
-            if (Gear^.Hedgehog^.Team = CurrentTeam) and
-               (Gear^.Damage <> Gear^.Karma) and
-                not Gear^.Hedgehog^.King and
-                not Gear^.Hedgehog^.Effects[hePoisoned] and
-                not SuddenDeathDmg then
+(*
+This doesn't fit well w/ the new loser sprite which is cringing from an attack.
+            if (Gear^.Hedgehog^.Team = CurrentTeam) and (Gear^.Damage <> Gear^.Karma)
+            and (not Gear^.Hedgehog^.King) and (Gear^.Hedgehog^.Effects[hePoisoned] = 0) and (not SuddenDeathDmg) then
                 Gear^.State:= Gear^.State or gstLoser;
+*)
 
             spawnHealthTagForHH(Gear, dmg);
 
@@ -709,7 +124,8 @@ while Gear <> nil do
             RecountTeamHealth(Gear^.Hedgehog^.Team);
 
             end;
-        if (not isInMultiShoot) then Gear^.Karma:= 0;
+        if (not isInMultiShoot) then
+            Gear^.Karma:= 0;
         Gear^.Damage:= 0
         end;
     Gear:= Gear^.NextGear
@@ -719,9 +135,9 @@ end;
 procedure HealthMachine;
 var Gear: PGear;
     team: PTeam;
-       i: LongWord;
+    i: LongWord;
     flag: Boolean;
-     tmp: LongWord;
+    tmp: LongWord;
 begin
     Gear:= GearsList;
 
@@ -730,29 +146,31 @@ begin
         if Gear^.Kind = gtHedgehog then
             begin
             tmp:= 0;
-            if Gear^.Hedgehog^.Effects[hePoisoned] then
+            if Gear^.Hedgehog^.Effects[hePoisoned] <> 0 then
                 begin
                 inc(tmp, ModifyDamage(5, Gear));
-                if (GameFlags and gfResetHealth) <> 0 then dec(Gear^.Hedgehog^.InitialHealth)  // does not need a minimum check since <= 1 basically disables it
+                if (GameFlags and gfResetHealth) <> 0 then
+                    dec(Gear^.Hedgehog^.InitialHealth)  // does not need a minimum check since <= 1 basically disables it
                 end;
             if (TotalRounds > cSuddenDTurns - 1) then
                 begin
                 inc(tmp, cHealthDecrease);
-                if (GameFlags and gfResetHealth) <> 0 then dec(Gear^.Hedgehog^.InitialHealth, cHealthDecrease)
+                if (GameFlags and gfResetHealth) <> 0 then
+                    dec(Gear^.Hedgehog^.InitialHealth, cHealthDecrease)
                 end;
             if Gear^.Hedgehog^.King then
                 begin
                 flag:= false;
                 team:= Gear^.Hedgehog^.Team;
                 for i:= 0 to Pred(team^.HedgehogsNumber) do
-                    if (team^.Hedgehogs[i].Gear <> nil) and
-                        (not team^.Hedgehogs[i].King) and
-                        (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage)
-                    then flag:= true;
+                    if (team^.Hedgehogs[i].Gear <> nil) and (not team^.Hedgehogs[i].King)
+                    and (team^.Hedgehogs[i].Gear^.Health > team^.Hedgehogs[i].Gear^.Damage) then
+                        flag:= true;
                 if not flag then
                     begin
                     inc(tmp, 5);
-                    if (GameFlags and gfResetHealth) <> 0 then dec(Gear^.Hedgehog^.InitialHealth, 5)
+                    if (GameFlags and gfResetHealth) <> 0 then
+                        dec(Gear^.Hedgehog^.InitialHealth, 5)
                     end
                 end;
             if tmp > 0 then 
@@ -767,12 +185,7 @@ begin
 end;
 
 procedure ProcessGears;
-const delay: LongWord = 0;
-      delay2: LongWord = 0;
-    step: (stDelay, stChDmg, stSweep, stTurnReact,
-            stAfterDelay, stChWin, stWater, stChWin2, stHealth,
-            stSpawn, stNTurn) = stDelay;
-var Gear, t: PGear;
+var t: PGear;
     i, AliveCount: LongInt;
     s: shortstring;
 begin
@@ -783,7 +196,7 @@ if (StepSoundTimer > 0) and (StepSoundChannel < 0) then
     StepSoundChannel:= LoopSound(sndSteps)
 else if (StepSoundTimer = 0) and (StepSoundChannel > -1) then
     begin
-    StopSound(StepSoundChannel);
+    StopSoundChan(StepSoundChannel);
     StepSoundChannel:= -1
     end;
 
@@ -793,25 +206,39 @@ if StepSoundTimer > 0 then
 t:= GearsList;
 while t <> nil do
     begin
-    Gear:= t;
-    t:= Gear^.NextGear;
+    curHandledGear:= t;
+    t:= curHandledGear^.NextGear;
 
-    if Gear^.Active then
+    if curHandledGear^.Message and gmDelete <> 0 then
+        DeleteGear(curHandledGear)
+    else
         begin
-        if Gear^.RenderTimer and (Gear^.Timer > 500) and ((Gear^.Timer mod 1000) = 0) then
+        if curHandledGear^.Message and gmRemoveFromList <> 0 then 
             begin
-            FreeTexture(Gear^.Tex);
-            Gear^.Tex:= RenderStringTex(inttostr(Gear^.Timer div 1000), cWhiteColor, fntSmall);
+            RemoveGearFromList(curHandledGear);
+            // since I can't think of any good reason this would ever be separate from a remove from list, going to keep it inside this block
+            if curHandledGear^.Message and gmAddToList <> 0 then InsertGearToList(curHandledGear);
+            curHandledGear^.Message:= curHandledGear^.Message and (not (gmRemoveFromList or gmAddToList))
             end;
-        Gear^.doStep(Gear);
-        // might be useful later
-        //ScriptCall('onGearStep', Gear^.uid);
+        if curHandledGear^.Active then
+            begin
+            if curHandledGear^.RenderTimer and (curHandledGear^.Timer > 500) and ((curHandledGear^.Timer mod 1000) = 0) then
+                begin
+                FreeTexture(curHandledGear^.Tex);
+                curHandledGear^.Tex:= RenderStringTex(inttostr(curHandledGear^.Timer div 1000), cWhiteColor, fntSmall);
+                end;
+            curHandledGear^.doStep(curHandledGear);
+            // might be useful later
+            //ScriptCall('onGearStep', Gear^.uid);
+            end
         end
     end;
+curHandledGear:= nil;
 
 if AllInactive then
 case step of
-    stDelay: begin
+    stDelay:
+        begin
         if delay = 0 then
             delay:= cInactDelay
         else
@@ -820,104 +247,133 @@ case step of
         if delay = 0 then
             inc(step)
         end;
-    stChDmg: if CheckNoDamage then inc(step) else step:= stDelay;
-    stSweep: if SweepDirty then
-                begin
-                SetAllToActive;
-                step:= stChDmg
-                end else inc(step);
-    stTurnReact: begin
+        
+    stChDmg:
+    if CheckNoDamage then
+        inc(step)
+    else
+        step:= stDelay;
+        
+    stSweep:
+    if SweepDirty then
+        begin
+        SetAllToActive;
+        step:= stChDmg
+        end
+    else
+        inc(step);
+        
+    stTurnReact:
+        begin
         if (not bBetweenTurns) and (not isInMultiShoot) then
             begin
             uStats.TurnReaction;
             inc(step)
-        end else
+            end
+        else
             inc(step, 2);
         end;
-    stAfterDelay: begin
+        
+    stAfterDelay:
+        begin
         if delay = 0 then
             delay:= cInactDelay
         else
             dec(delay);
 
         if delay = 0 then
-        inc(step)
-        end;
-    stChWin: begin
-            CheckForWin;
             inc(step)
             end;
-    stWater: if (not bBetweenTurns) and (not isInMultiShoot) then
-                begin
-                if TotalRounds = cSuddenDTurns + 1 then bWaterRising:= true;
-
-                if bWaterRising and (cWaterRise > 0) then
-                    AddGear(0, 0, gtWaterUp, 0, _0, _0, 0)^.Tag:= cWaterRise;
+    stChWin:
+        begin
+        CheckForWin();
+        inc(step)
+        end;
+    stWater:
+    if (not bBetweenTurns) and (not isInMultiShoot) then
+        begin
+        if TotalRounds = cSuddenDTurns + 1 then
+            bWaterRising:= true;
+        if bWaterRising and (cWaterRise > 0) then
+            AddGear(0, 0, gtWaterUp, 0, _0, _0, 0)^.Tag:= cWaterRise;
+        inc(step)
+        end
+    else // since we are not raising the water, a second win-check isn't needed
+        inc(step,2);
+    stChWin2:
+        begin
+        CheckForWin;
+        inc(step)
+        end;
 
-                inc(step)
-                end else inc(step);
-    stChWin2: begin
-            CheckForWin;
-            inc(step)
-            end;
-    stHealth: begin
-            if (cWaterRise <> 0) or (cHealthDecrease <> 0) then
+    stHealth:
+        begin
+        if (cWaterRise <> 0) or (cHealthDecrease <> 0) then
+             begin
+            if (TotalRounds = cSuddenDTurns) and (not SuddenDeath) and (not isInMultiShoot) then
                 begin
-                if (TotalRounds = cSuddenDTurns) and not SuddenDeath and not isInMultiShoot then
+                SuddenDeath:= true;
+                if cHealthDecrease <> 0 then
                     begin
-                    SuddenDeath:= true;
-                    if cHealthDecrease <> 0 then
-                        begin
-                        SuddenDeathDmg:= true;
-                        
-                        // flash
-                        ScreenFade:= sfFromWhite;
-                        ScreenFadeValue:= sfMax;
-                        ScreenFadeSpeed:= 1;
+                    SuddenDeathDmg:= true;
                         
-                        ChangeToSDClouds;
-                        ChangeToSDFlakes;
-                        glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99);
-                        end;
-                    AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
-                    playSound(sndSuddenDeath);
-                    MusicFN:= SDMusic;
-                    ChangeMusic
+                    // flash
+                    ScreenFade:= sfFromWhite;
+                    ScreenFadeValue:= sfMax;
+                    ScreenFadeSpeed:= 1;
+                    
+                    ChangeToSDClouds;
+                    ChangeToSDFlakes;
+                    glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99);
+                    Ammoz[amTardis].SkipTurns:= 9999;
+                    Ammoz[amTardis].Probability:= 0;
+                    end;
+                AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
+                playSound(sndSuddenDeath);
+                StopMusic //No SDMusic for now
+                    //ChangeMusic(SDMusic)
                     end
-                else if (TotalRounds < cSuddenDTurns) and not isInMultiShoot then
+                else if (TotalRounds < cSuddenDTurns) and (not isInMultiShoot) then
                     begin
                     i:= cSuddenDTurns - TotalRounds;
                     s:= inttostr(i);
                     if i = 1 then
                         AddCaption(trmsg[sidRoundSD], cWhiteColor, capgrpGameState)
-                    else if i in [2, 5, 10, 15, 20, 25, 50, 100] then
+                    else if (i = 2) or ((i > 0) and ((i mod 50 = 0) or ((i <= 25) and (i mod 5 = 0)))) then
                         AddCaption(Format(trmsg[sidRoundsSD], s), cWhiteColor, capgrpGameState);
                     end;
                 end;
             if bBetweenTurns
-                or isInMultiShoot
-                or (TotalRounds = -1) then inc(step)
-            else begin
+            or isInMultiShoot
+            or (TotalRounds = -1) then
+                inc(step)
+            else
+                begin
                 bBetweenTurns:= true;
                 HealthMachine;
                 step:= stChDmg
                 end
             end;
-    stSpawn: begin
-            if not isInMultiShoot then SpawnBoxOfSmth;
-            inc(step)
-            end;
-    stNTurn: begin
-            if isInMultiShoot then
-                isInMultiShoot:= false
-            else begin
-                // delayed till after 0.9.12
-                // reset to default zoom
-                //ZoomValue:= ZoomDefault;
-                with CurrentHedgehog^ do
-                    if (Gear <> nil)
-                        and ((Gear^.State and gstAttacked) = 0)
-                        and (MultiShootAttacks > 0) then OnUsedAmmo(CurrentHedgehog^);
+    stSpawn:
+        begin
+        if not isInMultiShoot then
+            SpawnBoxOfSmth;
+        inc(step)
+        end;
+    stNTurn:
+        begin
+        if isInMultiShoot then
+            isInMultiShoot:= false
+        else
+            begin
+            // delayed till after 0.9.12
+            // reset to default zoom
+            //ZoomValue:= ZoomDefault;
+            with CurrentHedgehog^ do
+                if (Gear <> nil)
+                and ((Gear^.State and gstAttacked) = 0)
+                and (MultiShootAttacks > 0) then
+                    OnUsedAmmo(CurrentHedgehog^);
 
                 EndTurnCleanup;
 
@@ -940,26 +396,32 @@ else if ((GameFlags and gfInfAttack) <> 0) then
         begin
         dec(delay2);
 
-        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and not CurrentHedgehog^.Unplaced then
+        if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil)
+        and (not CurrentHedgehog^.Unplaced) then
             begin
-            if (CurrentHedgehog^.Gear^.State and gstAttacked <> 0) and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
+            if (CurrentHedgehog^.Gear^.State and gstAttacked <> 0)
+            and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
                 begin
                 CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstHHChooseTarget;
                 isCursorVisible := true
                 end;
-            CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked;
+            CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and (not gstAttacked);
             end;
         if delay2 = 0 then
             begin
-            if (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.State and gstAttacked = 0) and (CurAmmoGear = nil) then SweepDirty;
+            if (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.State and gstAttacked = 0)
+            and (CurAmmoGear = nil) then
+                SweepDirty;
             CheckNoDamage;
             AliveCount:= 0; // shorter version of check for win to allow typical step activity to proceed
             for i:= 0 to Pred(ClansCount) do
-                if ClansArray[i]^.ClanHealth > 0 then inc(AliveCount);
+                if ClansArray[i]^.ClanHealth > 0 then
+                    inc(AliveCount);
             if (AliveCount <= 1) and ((GameFlags and gfOneClanMode) = 0) then
                 begin
                 step:= stChDmg;
-                if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
+                if TagTurnTimeLeft = 0 then
+                    TagTurnTimeLeft:= TurnTimeLeft;
                 TurnTimeLeft:= 0
                 end
             end
@@ -967,29 +429,30 @@ else if ((GameFlags and gfInfAttack) <> 0) then
     end;
 
 if TurnTimeLeft > 0 then
-        if CurrentHedgehog^.Gear <> nil then
-            if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
-                and not isInMultiShoot then
+    if CurrentHedgehog^.Gear <> nil then
+        if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
+            and (not isInMultiShoot) then
                 begin
                 if (TurnTimeLeft = 5000)
-                    and (cHedgehogTurnTime >= 10000)
-                    and (not PlacingHogs)
-                    and (CurrentHedgehog^.Gear <> nil)
-                    and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then
-                        AddVoice(sndHurry, CurrentTeam^.voicepack);
-                if ReadyTimeLeft > 0 then
-                    begin
-                    if ReadyTimeLeft = 2000 then
-                        AddVoice(sndComeonthen, CurrentTeam^.voicepack);
-                    dec(ReadyTimeLeft)
-                    end
-                else
-                    dec(TurnTimeLeft)
-                end;
+                and (cHedgehogTurnTime >= 10000)
+                and (not PlacingHogs)
+                and (CurrentHedgehog^.Gear <> nil)
+                and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then
+                    PlaySoundV(sndHurry, CurrentTeam^.voicepack);
+            if ReadyTimeLeft > 0 then
+                begin
+                if (ReadyTimeLeft = 2000) and (LastVoice.snd = sndNone) then
+                    AddVoice(sndComeonthen, CurrentTeam^.voicepack);
+                dec(ReadyTimeLeft)
+                end
+            else
+                dec(TurnTimeLeft)
+            end;
 
 if skipFlag then
     begin
-    if TagTurnTimeLeft = 0 then TagTurnTimeLeft:= TurnTimeLeft;
+    if TagTurnTimeLeft = 0 then
+        TagTurnTimeLeft:= TurnTimeLeft;
     TurnTimeLeft:= 0;
     skipFlag:= false;
     inc(CurrentHedgehog^.Team^.stats.TurnSkips);
@@ -999,15 +462,16 @@ if ((GameTicks and $FFFF) = $FFFF) then
     begin
     if (not CurrentTeam^.ExtDriven) then
         begin
-        SendIPC('#');
+        SendIPC(_S'#');
         AddFileLog('hiTicks increment message sent')
         end;
 
     if (not CurrentTeam^.ExtDriven) or CurrentTeam^.hasGone then
         inc(hiTicks) // we do not recieve a message for this
     end;
-
+AddRandomness(CheckSum);
 ScriptCall('onGameTick');
+if GameTicks mod 20 = 0 then ScriptCall('onGameTick20');
 inc(GameTicks)
 end;
 
@@ -1067,7 +531,7 @@ begin
         t:= t^.NextGear
         end;
    
-    if ((GameFlags and gfResetWeps) <> 0) and not PlacingHogs then
+    if ((GameFlags and gfResetWeps) <> 0) and (not PlacingHogs) then
         ResetWeapons;
 
     if (GameFlags and gfResetHealth) <> 0 then
@@ -1075,69 +539,6 @@ begin
             RecountTeamHealth(TeamsArray[i])
 end;
 
-procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
-var s: shortstring;
-    vampDmg, tmpDmg, i: Longword;
-    vg: PVisualGear;
-begin
-  if Damage = 0 then exit; // nothing to apply
-
-    if (Gear^.Kind = gtHedgehog) then
-    begin
-    Gear^.LastDamage := AttackerHog;
-
-    Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
-    HHHurt(Gear^.Hedgehog, Source);
-    AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), Damage, Gear^.Hedgehog^.Team^.Clan^.Color);
-    tmpDmg:= min(Damage, max(0,Gear^.Health-Gear^.Damage));
-    if (Gear <> CurrentHedgehog^.Gear) and (CurrentHedgehog^.Gear <> nil) and (tmpDmg >= 1) then
-        begin
-        if cVampiric then
-            begin
-            vampDmg:= hwRound(int2hwFloat(tmpDmg)*_0_8);
-            if vampDmg >= 1 then
-                begin
-                // was considering pulsing on attack, Tiy thinks it should be permanent while in play
-                //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
-                inc(CurrentHedgehog^.Gear^.Health,vampDmg);
-                str(vampDmg, s);
-                s:= '+' + s;
-                AddCaption(s, CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
-                RenderHealth(CurrentHedgehog^);
-                RecountTeamHealth(CurrentHedgehog^.Team);
-                i:= 0;
-                while i < vampDmg do
-                    begin
-                    vg:= AddVisualGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), vgtStraightShot);
-                    if vg <> nil then
-                        with vg^ do
-                            begin
-                            Tint:= $FF0000FF;
-                            State:= ord(sprHealth)
-                            end;
-                    inc(i, 5);
-                    end;
-                end
-            end;
-        if ((GameFlags and gfKarma) <> 0) and
-           ((GameFlags and gfInvulnerable) = 0) and
-           not CurrentHedgehog^.Gear^.Invulnerable then
-           begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
-           inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
-           CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
-           spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
-           end;
-        uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);    
-        end;
-    end else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
-        begin
-        Gear^.Hedgehog:= AttackerHog;
-        end;
-    inc(Gear^.Damage, Damage);
-    
-    ScriptCall('onGearDamage', Gear^.UID, Damage);
-end;
-
 procedure SetAllToActive;
 var t: PGear;
 begin
@@ -1157,7 +558,8 @@ AllInactive:= false;
 t:= GearsList;
 while t <> nil do
     begin
-    if (t^.Kind = gtHedgehog) or (t^.Kind = gtExplosives) then t^.Active:= true;
+    if (t^.Kind = gtHedgehog) or (t^.Kind = gtExplosives) then
+        t^.Active:= true;
     t:= t^.NextGear
     end
 end;
@@ -1170,7 +572,7 @@ begin
 Gear:= GearsList;
 while Gear <> nil do
     begin
-    if Gear^.State and gstInvisible = 0 then
+    if (Gear^.State and gstInvisible = 0) and (Gear^.Message and gmRemoveFromList = 0) then
         begin
         x:= hwRound(Gear^.X) + WorldDx;
         y:= hwRound(Gear^.Y) + WorldDy;
@@ -1194,7 +596,8 @@ begin
 end;
 
 procedure AddMiscGears;
-var i: Longword;
+var i,rx, ry: Longword;
+    rdx, rdy: hwFloat;
     Gear: PGear;
 begin
 AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000);
@@ -1228,139 +631,35 @@ if (GameFlags and gfVampiric) <> 0 then
 
 Gear:= GearsList;
 if (GameFlags and gfInvulnerable) <> 0 then
-   while Gear <> nil do
-       begin
-       Gear^.Invulnerable:= true;  // this is only checked on hogs right now, so no need for gear type check
-       Gear:= Gear^.NextGear
-       end;
+    while Gear <> nil do
+        begin
+        Gear^.Invulnerable:= true;  // this is only checked on hogs right now, so no need for gear type check
+        Gear:= Gear^.NextGear
+        end;
 
 if (GameFlags and gfLaserSight) <> 0 then
     cLaserSighting:= true;
 
 if (GameFlags and gfArtillery) <> 0 then
     cArtillery:= true;
-
-if not hasBorder and ((Theme = 'Snow') or (Theme = 'Christmas')) then
-    for i:= 0 to Pred(vobCount*2) do
-        AddGear(GetRandom(LAND_WIDTH+1024)-512, LAND_HEIGHT - GetRandom(LAND_HEIGHT div 2), gtFlake, 0, _0, _0, 0);
-end;
-
-procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword; const Tint: LongWord);
-var Gear: PGear;
-    dmg, dmgRadius, dmgBase: LongInt;
-    fX, fY: hwFloat;
-    vg: PVisualGear;
-    i, cnt: LongInt;
-begin
-if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');
-if Radius > 25 then KickFlakes(Radius, X, Y);
-
-if ((Mask and EXPLNoGfx) = 0) then
+for i:= GetRandom(10)+30 downto 0 do
     begin
-    vg:= nil;
-    if Radius > 50 then vg:= AddVisualGear(X, Y, vgtBigExplosion)
-    else if Radius > 10 then vg:= AddVisualGear(X, Y, vgtExplosion);
-    if vg <> nil then
-        vg^.Tint:= Tint;
-    end;
-if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);
-
-if (Mask and EXPLAllDamageInRadius) = 0 then
-    dmgRadius:= Radius shl 1
-else
-    dmgRadius:= Radius;
-dmgBase:= dmgRadius + cHHRadius div 2;
-fX:= int2hwFloat(X);
-fY:= int2hwFloat(Y);
-Gear:= GearsList;
-while Gear <> nil do
-    begin
-    dmg:= 0;
-    //dmg:= dmgRadius  + cHHRadius div 2 - hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
-    //if (dmg > 1) and
-    if (Gear^.State and gstNoDamage) = 0 then
-        begin
-        case Gear^.Kind of
-            gtHedgehog,
-                gtMine,
-                gtBall,
-                gtMelonPiece,
-                gtGrenade,
-                gtClusterBomb,
-            //    gtCluster, too game breaking I think
-                gtSMine,
-                gtCase,
-                gtTarget,
-                gtFlame,
-                gtExplosives,
-                gtStructure: begin
-// Run the calcs only once we know we have a type that will need damage
-                        if hwRound(hwAbs(Gear^.X-fX)+hwAbs(Gear^.Y-fY)) < dmgBase then
-                            dmg:= dmgBase - max(hwRound(Distance(Gear^.X - fX, Gear^.Y - fY)),Gear^.Radius);
-                        if dmg > 1 then
-                            begin
-                            dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
-                            //AddFileLog('Damage: ' + inttostr(dmg));
-                            if (Mask and EXPLNoDamage) = 0 then
-                                begin
-                                if not Gear^.Invulnerable then
-                                    ApplyDamage(Gear, AttackingHog, dmg, dsExplosion)
-                                else
-                                    Gear^.State:= Gear^.State or gstWinner;
-                                end;
-                            if ((Mask and EXPLDoNotTouchAny) = 0) and (((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog)) then
-                                begin
-                                DeleteCI(Gear);
-                                if Gear^.Kind <> gtHedgehog then
-                                    begin
-                                    Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX)/Gear^.Density;
-                                    Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY)/Gear^.Density;
-                                    end
-                                else
-                                    begin
-                                    Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX);
-                                    Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY);
-                                    end;
-
-                                Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser);
-                                if not Gear^.Invulnerable then
-                                    Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
-                                Gear^.Active:= true;
-                                if Gear^.Kind <> gtFlame then FollowGear:= Gear
-                                end;
-                            if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and not Gear^.Invulnerable then
-                                Gear^.Hedgehog^.Effects[hePoisoned] := true;
-                            end;
-
-                        end;
-                gtGrave: begin
-// Run the calcs only once we know we have a type that will need damage
-                        if hwRound(hwAbs(Gear^.X-fX)+hwAbs(Gear^.Y-fY)) < dmgBase then
-                            dmg:= dmgBase - hwRound(Distance(Gear^.X - fX, Gear^.Y - fY));
-                        if dmg > 1 then
-                            begin
-                            dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
-                            Gear^.dY:= - _0_004 * dmg;
-                            Gear^.Active:= true
-                            end
-                        end;
-            end;
-        end;
-    Gear:= Gear^.NextGear
+    rx:= GetRandom(rightX-leftX)+leftX;
+    ry:= GetRandom(LAND_HEIGHT-topY)+topY;
+    rdx:= _90-(GetRandomf*_360);
+    rdy:= _90-(GetRandomf*_360);
+    AddGear(rx, ry, gtGenericFaller, gstInvisible, rdx, rdy, $FFFFFFFF);
     end;
 
-if (Mask and EXPLDontDraw) = 0 then
-    if (GameFlags and gfSolidLand) = 0 then
-        begin
-        cnt:= DrawExplosion(X, Y, Radius) div 1608; // approx 2 16x16 circles to erase per chunk
-        if (cnt > 0) and (SpritesData[sprChunk].Texture <> nil) then
-            for i:= 0 to cnt do
-                AddVisualGear(X, Y, vgtChunk)
-        end;
+snowRight:= max(LAND_WIDTH,4096)+512;
+snowLeft:= -(snowRight-LAND_WIDTH);
 
-uAIMisc.AwareOfExplosion(0, 0, 0)
+if (not hasBorder) and ((Theme = 'Snow') or (Theme = 'Christmas')) then
+    for i:= vobCount * Longword(max(LAND_WIDTH,4096)) div 2048 downto 1 do
+        AddGear(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft, LongInt(LAND_HEIGHT + GetRandom(750)) - 1300, gtFlake, 0, _0, _0, 0);
 end;
 
+
 procedure ShotgunShot(Gear: PGear);
 var t: PGear;
     dmg, r, dist: LongInt;
@@ -1374,6 +673,7 @@ while t <> nil do
         gtHedgehog,
             gtMine,
             gtSMine,
+            gtKnife,
             gtCase,
             gtTarget,
             gtExplosives,
@@ -1401,6 +701,7 @@ while t <> nil do
                         t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
                         t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
                         t^.State:= t^.State or gstMoving;
+                        if t^.Kind = gtKnife then t^.State:= t^.State and (not gstCollision);
                         t^.Active:= true;
                         FollowGear:= t
                         end
@@ -1426,20 +727,21 @@ while t <> nil do
         end;
     t:= t^.NextGear
     end;
-if (GameFlags and gfSolidLand) = 0 then DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cShotgunRadius)
+if (GameFlags and gfSolidLand) = 0 then
+    DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cShotgunRadius)
 end;
 
 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt);
 var t: PGearArray;
     Gear: PGear;
-    i, tmpDmg: LongInt;
+    i, j, tmpDmg: LongInt;
     VGear: PVisualGear;
 begin
 t:= CheckGearsCollision(Ammo);
 // Just to avoid hogs on rope dodging fire.
-if (CurAmmoGear <> nil) and ((CurAmmoGear^.Kind = gtRope) or (CurAmmoGear^.Kind = gtJetpack) or (CurAmmoGear^.Kind = gtBirdy)) and
-   (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex = -1) and
-   (sqr(hwRound(Ammo^.X) - hwRound(CurrentHedgehog^.Gear^.X)) + sqr(hwRound(Ammo^.Y) - hwRound(CurrentHedgehog^.Gear^.Y)) <= sqr(cHHRadius + Ammo^.Radius)) then
+if (CurAmmoGear <> nil) and ((CurAmmoGear^.Kind = gtRope) or (CurAmmoGear^.Kind = gtJetpack) or (CurAmmoGear^.Kind = gtBirdy))
+and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex = -1)
+and (sqr(hwRound(Ammo^.X) - hwRound(CurrentHedgehog^.Gear^.X)) + sqr(hwRound(Ammo^.Y) - hwRound(CurrentHedgehog^.Gear^.Y)) <= sqr(cHHRadius + Ammo^.Radius)) then
     begin
     t^.ar[t^.Count]:= CurrentHedgehog^.Gear;
     inc(t^.Count)
@@ -1447,7 +749,8 @@ if (CurAmmoGear <> nil) and ((CurAmmoGear^.Kind = gtRope) or (CurAmmoGear^.Kind
 
 i:= t^.Count;
 
-if (Ammo^.Kind = gtFlame) and (i > 0) then Ammo^.Health:= 0;
+if (Ammo^.Kind = gtFlame) and (i > 0) then
+    Ammo^.Health:= 0;
 while i > 0 do
     begin
     dec(i);
@@ -1459,61 +762,101 @@ while i > 0 do
         if (Ammo^.Kind = gtDEagleShot) or (Ammo^.Kind = gtSniperRifleShot) then 
             begin
             VGear := AddVisualGear(hwround(Ammo^.X), hwround(Ammo^.Y), vgtBulletHit);
-            if VGear <> nil then VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
+            if VGear <> nil then
+                VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
             end;
 
-        if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then Gear^.FlightTime:= 1;
+        if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then
+            Gear^.FlightTime:= 1;
 
         case Gear^.Kind of
             gtHedgehog,
             gtMine,
             gtSMine,
+            gtKnife,
             gtTarget,
             gtCase,
             gtExplosives,
-            gtStructure: begin
-                    if (Ammo^.Kind = gtDrill) then begin Ammo^.Timer:= 0; exit; end;
-                    if (not Gear^.Invulnerable) then
-                        ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg, dsShove)
-                    else
-                        Gear^.State:= Gear^.State or gstWinner;
-                    if (Gear^.Kind = gtExplosives) and (Ammo^.Kind = gtBlowtorch) then 
+            gtStructure:
+            begin
+            if (Ammo^.Kind = gtDrill) then
+                begin
+                Ammo^.Timer:= 0;
+                exit;
+                end;
+            if (not Gear^.Invulnerable) then
+                begin
+                if (Ammo^.Kind = gtKnife) and (tmpDmg > 0) then
+                    for j:= 1 to max(1,min(3,tmpDmg div 5)) do
                         begin
-                        if (Ammo^.Hedgehog^.Gear <> nil) then Ammo^.Hedgehog^.Gear^.State:= Ammo^.Hedgehog^.Gear^.State and not gstNotKickable;
-                        ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch
+                        VGear:= AddVisualGear(hwRound(Ammo^.X-((Ammo^.X-Gear^.X)/_2)), hwRound(Ammo^.Y-((Ammo^.Y-Gear^.Y)/_2)), vgtStraightShot);
+                        if VGear <> nil then
+                            with VGear^ do
+                                begin
+                                Tint:= $FFCC00FF;
+                                Angle:= random(360);
+                                dx:= 0.0005 * (random(100));
+                                dy:= 0.0005 * (random(100));
+                                if random(2) = 0 then
+                                    dx := -dx;
+                                if random(2) = 0 then
+                                    dy := -dy;
+                                FrameTicks:= 600+random(200);
+                                State:= ord(sprStar)
+                                end
                         end;
+                ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg, dsShove)
+                end
+            else
+                Gear^.State:= Gear^.State or gstWinner;
+            if (Gear^.Kind = gtExplosives) and (Ammo^.Kind = gtBlowtorch) then 
+                begin
+                if (Ammo^.Hedgehog^.Gear <> nil) then
+                    Ammo^.Hedgehog^.Gear^.State:= Ammo^.Hedgehog^.Gear^.State and (not gstNotKickable);
+                ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch
+                end;
 
-                    DeleteCI(Gear);
-                    if (Gear^.Kind = gtHedgehog) and Gear^.Hedgehog^.King then
-                        begin
-                        Gear^.dX:= Ammo^.dX * Power * _0_005;
-                        Gear^.dY:= Ammo^.dY * Power * _0_005
-                        end
-                    else
-                        begin
-                        Gear^.dX:= Ammo^.dX * Power * _0_01;
-                        Gear^.dY:= Ammo^.dY * Power * _0_01
-                        end;
+            if (Gear^.Kind = gtHedgehog) and Gear^.Hedgehog^.King then
+                begin
+                Gear^.dX:= Ammo^.dX * Power * _0_005;
+                Gear^.dY:= Ammo^.dY * Power * _0_005
+                end
+            else if ((Ammo^.Kind <> gtFlame) or (Gear^.Kind = gtHedgehog)) and (Power <> 0) then
+                begin
+                Gear^.dX:= Ammo^.dX * Power * _0_01;
+                Gear^.dY:= Ammo^.dY * Power * _0_01
+                end;
 
-                    Gear^.Active:= true;
-                    Gear^.State:= Gear^.State or gstMoving;
+            if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
+                begin
+                Gear^.Active:= true;
+                DeleteCI(Gear);
+                Gear^.State:= Gear^.State or gstMoving;
+                if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and (not gstCollision);
+                // move the gear upwards a bit to throw it over tiny obstacles at start
+                if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
+                    begin
+                    if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
+                    or (TestCollisionYwithGear(Gear, -1) <> 0)) then
+                        Gear^.Y:= Gear^.Y - _1;
+                    if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX))
+                    or (TestCollisionYwithGear(Gear, -1) <> 0)) then
+                        Gear^.Y:= Gear^.Y - _1;
+                    if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX))
+                    or (TestCollisionYwithGear(Gear, -1) <> 0)) then
+                        Gear^.Y:= Gear^.Y - _1;
+                    end
+                end;
 
-                    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
-                        begin
-                        if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
-                            or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-                        if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX))
-                            or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-                        if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX))
-                            or (TestCollisionYwithGear(Gear, -1) <> 0)) then Gear^.Y:= Gear^.Y - _1;
-                        end;
 
-                    if (Ammo^.Kind <> gtFlame) or ((Ammo^.State and gsttmpFlag) = 0) then FollowGear:= Gear
-                    end;
+            if (Ammo^.Kind <> gtFlame) or ((Ammo^.State and gsttmpFlag) = 0) then
+                FollowGear:= Gear
+            end;
         end
         end;
     end;
-if i <> 0 then SetAllToActive
+if i <> 0 then
+    SetAllToActive
 end;
 
 procedure AssignHHCoords;
@@ -1521,7 +864,8 @@ var i, t, p, j: LongInt;
     ar: array[0..Pred(cMaxHHs)] of PHedgehog;
     Count: Longword;
 begin
-if (GameFlags and gfPlaceHog) <> 0 then PlacingHogs:= true;
+if (GameFlags and gfPlaceHog) <> 0 then
+    PlacingHogs:= true;
 if (GameFlags and gfDivideTeams) <> 0 then
     begin
     t:= 0;
@@ -1535,8 +879,10 @@ if (GameFlags and gfDivideTeams) <> 0 then
                         with Hedgehogs[i] do
                             if (Gear <> nil) and (Gear^.X.QWordValue = 0) then
                                 begin
-                                if PlacingHogs then Unplaced:= true
-                                else FindPlace(Gear, false, t, t + LAND_WIDTH div 2);// could make Gear == nil;
+                                if PlacingHogs then
+                                    Unplaced:= true
+                                else
+                                    FindPlace(Gear, false, t, t + LAND_WIDTH div 2, true);// could make Gear == nil;
                                 if Gear <> nil then
                                     begin
                                     Gear^.Pos:= GetRandom(49);
@@ -1566,8 +912,10 @@ if (GameFlags and gfDivideTeams) <> 0 then
     while (Count > 0) do
         begin
         i:= GetRandom(Count);
-        if PlacingHogs then ar[i]^.Unplaced:= true
-        else FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH);
+        if PlacingHogs then
+            ar[i]^.Unplaced:= true
+        else
+            FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH, true);
         if ar[i]^.Gear <> nil then
             begin
             ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > LAND_WIDTH div 2;
@@ -1579,43 +927,30 @@ if (GameFlags and gfDivideTeams) <> 0 then
     end
 end;
 
-function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): TPGearArray;
+var GearsNearArray : TPGearArray;
+function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS;
 var
     t: PGear;
-    l: Longword;
+    s: Longword;
 begin
     r:= r*r;
-    GearsNear := nil;
+    s:= 0;
+    SetLength(GearsNearArray, s);
     t := GearsList;
     while t <> nil do 
         begin
         if (t^.Kind = Kind) 
             and ((X - t^.X)*(X - t^.X) + (Y - t^.Y)*(Y-t^.Y) < int2hwFloat(r)) then
             begin
-            l:= Length(GearsNear);
-            SetLength(GearsNear, l + 1);
-            GearsNear[l] := t;
+            inc(s);
+            SetLength(GearsNearArray, s);
+            GearsNearArray[s - 1] := t;
             end;
         t := t^.NextGear;
     end;
-end;
-
-function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear;
-var t: PGear;
-begin
-t:= GearsList;
-rX:= sqr(rX);
-rY:= sqr(rY);
-
-while t <> nil do
-    begin
-    if (t <> Gear) and (t^.Kind = Kind) then
-        if not((hwSqr(Gear^.X - t^.X) / rX + hwSqr(Gear^.Y - t^.Y) / rY) > _1) then
-        exit(t);
-    t:= t^.NextGear
-    end;
 
-CheckGearNear:= nil
+    GearsNear.size:= s;
+    GearsNear.ar:= @GearsNearArray
 end;
 
 {procedure AmmoFlameWork(Ammo: PGear);
@@ -1638,21 +973,6 @@ while t <> nil do
     end;
 end;}
 
-function CheckGearsNear(mX, mY: LongInt; Kind: TGearsType; rX, rY: LongInt): PGear;
-var t: PGear;
-begin
-t:= GearsList;
-rX:= sqr(rX);
-rY:= sqr(rY);
-while t <> nil do
-    begin
-    if t^.Kind in Kind then
-        if not (hwSqr(int2hwFloat(mX) - t^.X) / rX + hwSqr(int2hwFloat(mY) - t^.Y) / rY > _1) then
-            exit(t);
-    t:= t^.NextGear
-    end;
-CheckGearsNear:= nil
-end;
 
 function CountGears(Kind: TGearType): Longword;
 var t: PGear;
@@ -1662,65 +982,46 @@ begin
 t:= GearsList;
 while t <> nil do
     begin
-    if t^.Kind = Kind then inc(count);
+    if t^.Kind = Kind then
+        inc(count);
     t:= t^.NextGear
     end;
 CountGears:= count;
 end;
 
-procedure ResurrectHedgehog(gear: PGear);
-var tempTeam : PTeam;
-begin
-    AttackBar:= 0;
-    gear^.dX := _0;
-    gear^.dY := _0;
-    gear^.Damage := 0;
-    gear^.Health := gear^.Hedgehog^.InitialHealth;
-    gear^.Hedgehog^.Effects[hePoisoned] := false;
-    if not CurrentHedgehog^.Effects[heResurrectable] then
-        with CurrentHedgehog^ do 
-            begin
-            inc(Team^.stats.AIKills);
-            FreeTexture(Team^.AIKillsTex);
-            Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
-            end;
-    tempTeam := gear^.Hedgehog^.Team;
-    DeleteCI(gear);
-    FindPlace(gear, false, 0, LAND_WIDTH, true); 
-    if gear <> nil then begin
-        RenderHealth(gear^.Hedgehog^);
-        ScriptCall('onGearResurrect', gear^.uid);
-        gear^.State := gstWait;
-    end;
-    RecountTeamHealth(tempTeam);
-end;
-
-function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword): PGear;
+function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content, cnt: Longword): PGear;
 begin
     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
     cCaseFactor := 0;
 
-    if (crate <> HealthCrate) and (content > ord(High(TAmmoType))) then content := ord(High(TAmmoType));
+    if (crate <> HealthCrate) and (content > ord(High(TAmmoType))) then
+        content := ord(High(TAmmoType));
+
+    FollowGear^.Power:= cnt;
 
     case crate of
-        HealthCrate: begin
+        HealthCrate:
+            begin
             FollowGear^.Pos := posCaseHealth;
             FollowGear^.Health := content;
             AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
             end;
-        AmmoCrate: begin
+        AmmoCrate:
+            begin
             FollowGear^.Pos := posCaseAmmo;
             FollowGear^.AmmoType := TAmmoType(content);
             AddCaption(GetEventString(eidNewAmmoPack), cWhiteColor, capgrpAmmoInfo);
             end;
-        UtilityCrate: begin
+        UtilityCrate:
+            begin
             FollowGear^.Pos := posCaseUtility;
             FollowGear^.AmmoType := TAmmoType(content);
             AddCaption(GetEventString(eidNewUtilityPack), cWhiteColor, capgrpAmmoInfo);
             end;
     end;
 
-    if ( (x = 0) and (y = 0) ) then FindPlace(FollowGear, true, 0, LAND_WIDTH);
+    if ( (x = 0) and (y = 0) ) then
+        FindPlace(FollowGear, true, 0, LAND_WIDTH);
 
     SpawnCustomCrateAt := FollowGear;
 end;
@@ -1731,33 +1032,40 @@ begin
     cCaseFactor := 0;
     FollowGear^.Pos := posCaseDummy;
     
-    if explode then FollowGear^.Pos := FollowGear^.Pos + posCaseExplode;
-    if poison then FollowGear^.Pos := FollowGear^.Pos + posCasePoison;
+    if explode then
+        FollowGear^.Pos := FollowGear^.Pos + posCaseExplode;
+    if poison then
+        FollowGear^.Pos := FollowGear^.Pos + posCasePoison;
 
     case crate of
-        HealthCrate: begin
+        HealthCrate:
+            begin
             FollowGear^.Pos := FollowGear^.Pos + posCaseHealth;
             AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
             end;
-        AmmoCrate: begin
+        AmmoCrate:
+            begin
             FollowGear^.Pos := FollowGear^.Pos + posCaseAmmo;
             AddCaption(GetEventString(eidNewAmmoPack), cWhiteColor, capgrpAmmoInfo);
             end;
-        UtilityCrate: begin
+        UtilityCrate:
+            begin
             FollowGear^.Pos := FollowGear^.Pos + posCaseUtility;
             AddCaption(GetEventString(eidNewUtilityPack), cWhiteColor, capgrpAmmoInfo);
             end;
     end;
 
-    if ( (x = 0) and (y = 0) ) then FindPlace(FollowGear, true, 0, LAND_WIDTH);
+    if ( (x = 0) and (y = 0) ) then
+        FindPlace(FollowGear, true, 0, LAND_WIDTH);
 
     SpawnFakeCrateAt := FollowGear;
 end;
 
-function GetAmmo: TAmmoType;
+function GetAmmo(Hedgehog: PHedgehog): TAmmoType;
 var t, aTot: LongInt;
     i: TAmmoType;
 begin
+Hedgehog:= Hedgehog; // avoid hint
 
 aTot:= 0;
 for i:= Low(TAmmoType) to High(TAmmoType) do
@@ -1770,23 +1078,24 @@ if (t > 0) then
     begin
     t:= GetRandom(t);
     while t >= 0 do
-      begin
-      inc(i);
-      if (Ammoz[i].Ammo.Propz and ammoprop_Utility) = 0 then
-          dec(t, Ammoz[i].Probability)
-      end
+        begin
+        inc(i);
+        if (Ammoz[i].Ammo.Propz and ammoprop_Utility) = 0 then
+            dec(t, Ammoz[i].Probability)
+        end
     end;
 GetAmmo:= i
 end;
 
-function GetUtility: TAmmoType;
+function GetUtility(Hedgehog: PHedgehog): TAmmoType;
 var t, uTot: LongInt;
     i: TAmmoType;
 begin
 
 uTot:= 0;
 for i:= Low(TAmmoType) to High(TAmmoType) do
-    if (Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0 then
+    if ((Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0)
+    and ((Hedgehog^.Team^.HedgehogsNumber > 1) or (Ammoz[i].Ammo.AmmoType <> amSwitch)) then
         inc(uTot, Ammoz[i].Probability);
 
 t:= uTot;
@@ -1795,11 +1104,12 @@ if (t > 0) then
     begin
     t:= GetRandom(t);
     while t >= 0 do
-      begin
-      inc(i);
-      if (Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0 then
-          dec(t, Ammoz[i].Probability)
-      end
+        begin
+        inc(i);
+        if ((Ammoz[i].Ammo.Propz and ammoprop_Utility) <> 0) and ((Hedgehog^.Team^.HedgehogsNumber > 1)
+        or (Ammoz[i].Ammo.AmmoType <> amSwitch)) then
+            dec(t, Ammoz[i].Probability)
+        end
     end;
 GetUtility:= i
 end;
@@ -1811,9 +1121,10 @@ var t, aTot, uTot, a, h: LongInt;
     i: TAmmoType;
 begin
 if (PlacingHogs) or
-   (cCaseFactor = 0) or
-   (CountGears(gtCase) >= 5) or
-   (GetRandom(cCaseFactor) <> 0) then exit;
+    (cCaseFactor = 0)
+    or (CountGears(gtCase) >= 5)
+    or (GetRandom(cCaseFactor) <> 0) then
+       exit;
 
 FollowGear:= nil;
 aTot:= 0;
@@ -1886,119 +1197,6 @@ if (FollowGear <> nil) then
     end
 end;
 
-procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt; skipProximity: boolean = false);
-
-    function CountNonZeroz(x, y, r, c: LongInt): LongInt;
-    var i: LongInt;
-        count: LongInt = 0;
-    begin
-    if (y and LAND_HEIGHT_MASK) = 0 then
-        for i:= max(x - r, 0) to min(x + r, LAND_WIDTH - 4) do
-            if Land[y, i] <> 0 then
-               begin
-               inc(count);
-               if count = c then exit(count)
-               end;
-    CountNonZeroz:= count;
-    end;
-
-var x: LongInt;
-    y, sy: LongInt;
-    ar: array[0..511] of TPoint;
-    ar2: array[0..1023] of TPoint;
-    cnt, cnt2: Longword;
-    delta: LongInt;
-    reallySkip, tryAgain: boolean;
-begin
-reallySkip:= false; // try not skipping proximity at first
-tryAgain:= true;
-while tryAgain do
-    begin
-    delta:= 250;
-    cnt2:= 0;
-    repeat
-        x:= Left + LongInt(GetRandom(Delta));
-        repeat
-            inc(x, Delta);
-            cnt:= 0;
-            y:= min(1024, topY) - 2 * Gear^.Radius;
-            while y < cWaterLine do
-                begin
-                repeat
-                    inc(y, 2);
-                until (y >= cWaterLine) or (CountNonZeroz(x, y, Gear^.Radius - 1, 1) = 0);
-
-                sy:= y;
-
-                repeat
-                    inc(y);
-                until (y >= cWaterLine) or (CountNonZeroz(x, y, Gear^.Radius - 1, 1) <> 0);
-
-                if (y - sy > Gear^.Radius * 2) and
-                   (((Gear^.Kind = gtExplosives)
-                       and (y < cWaterLine)
-                       and (reallySkip or (CheckGearsNear(x, y - Gear^.Radius, [gtFlame, gtHedgehog, gtMine, gtCase, gtExplosives], 60, 60) = nil))
-                       and (CountNonZeroz(x, y+1, Gear^.Radius - 1, Gear^.Radius+1) > Gear^.Radius))
-                   or
-                     ((Gear^.Kind <> gtExplosives)
-                       and (y < cWaterLine)
-                       and (reallySkip or (CheckGearsNear(x, y - Gear^.Radius, [gtFlame, gtHedgehog, gtMine, gtCase, gtExplosives], 110, 110) = nil)))) then
-                    begin
-                    ar[cnt].X:= x;
-                    if withFall then ar[cnt].Y:= sy + Gear^.Radius
-                                else ar[cnt].Y:= y - Gear^.Radius;
-                    inc(cnt)
-                    end;
-
-                inc(y, 45)
-                end;
-
-            if cnt > 0 then
-                with ar[GetRandom(cnt)] do
-                    begin
-                    ar2[cnt2].x:= x;
-                    ar2[cnt2].y:= y;
-                    inc(cnt2)
-                    end
-        until (x + Delta > Right);
-
-        dec(Delta, 60)
-    until (cnt2 > 0) or (Delta < 70);
-    if (cnt2 = 0) and skipProximity and not reallySkip then tryAgain:= true
-    else tryAgain:= false;
-    reallySkip:= true;
-    end;
-
-if cnt2 > 0 then
-    with ar2[GetRandom(cnt2)] do
-        begin
-        Gear^.X:= int2hwFloat(x);
-        Gear^.Y:= int2hwFloat(y);
-        AddFileLog('Assigned Gear coordinates (' + inttostr(x) + ',' + inttostr(y) + ')');
-        end
-    else
-    begin
-    OutError('Can''t find place for Gear', false);
-    if Gear^.Kind = gtHedgehog then Gear^.Hedgehog^.Effects[heResurrectable] := false;
-    DeleteGear(Gear);
-    Gear:= nil
-    end
-end;
-
-function ModifyDamage(dmg: Longword; Gear: PGear): Longword;
-var i: hwFloat;
-begin
-(* Invulnerability cannot be placed in here due to still needing kicks
-   Not without a new damage machine.
-   King check should be in here instead of ApplyDamage since Tiy wants them kicked less
-*)
-i:= _1;
-if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then i:= _1_5;
-if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King) then
-   ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5)
-else
-   ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent)
-end;
 
 function GearByUID(uid : Longword) : PGear;
 var gear: PGear;
@@ -2027,7 +1225,8 @@ end;
 procedure chSkip(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if not CurrentTeam^.ExtDriven then SendIPC(',');
+if not isExternalSource then
+    SendIPC(_S',');
 uStats.Skipped;
 skipFlag:= true
 end;
@@ -2046,12 +1245,16 @@ begin
     if x < 4 then
         begin
         t:= byte(s[2]);  // team
-        if Length(s) > 2 then h:= byte(s[3])  // target hog
+        if Length(s) > 2 then
+            h:= byte(s[3])  // target hog
         end;
     // allow targetting a hog by specifying a number as the first portion of the text
-    if (x < 4) and (h > byte('0')) and (h < byte('9')) then i:= h - 48;
-    if i <> 0 then text:= copy(s, 4, Length(s) - 1)
-    else if x < 4 then text:= copy(s, 3, Length(s) - 1)
+    if (x < 4) and (h > byte('0')) and (h < byte('9')) then
+        i:= h - 48;
+    if i <> 0 then
+        text:= copy(s, 4, Length(s) - 1)
+    else if x < 4 then
+        text:= copy(s, 3, Length(s) - 1)
     else text:= copy(s, 2, Length(s) - 1);
 
     (*
@@ -2065,7 +1268,8 @@ begin
     if (x < 4) and (TeamsArray[t] <> nil) then
         begin
             // if team matches current hedgehog team, default to current hedgehog
-            if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
+            if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then
+                hh:= CurrentHedgehog
             else 
                 begin
             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i
@@ -2102,12 +1306,83 @@ begin
 end;
 
 procedure initModule;
+const handlers: array[TGearType] of TGearStepProcedure = (
+            @doStepFlame,
+            @doStepHedgehog,
+            @doStepMine,
+            @doStepCase,
+            @doStepCase,
+            @doStepBomb,
+            @doStepShell,
+            @doStepGrave,
+            @doStepBee,
+            @doStepShotgunShot,
+            @doStepPickHammer,
+            @doStepRope,
+            @doStepDEagleShot,
+            @doStepDynamite,
+            @doStepBomb,
+            @doStepCluster,
+            @doStepShover,
+            @doStepFirePunch,
+            @doStepActionTimer,
+            @doStepActionTimer,
+            @doStepParachute,
+            @doStepAirAttack,
+            @doStepAirBomb,
+            @doStepBlowTorch,
+            @doStepGirder,
+            @doStepTeleport,
+            @doStepSwitcher,
+            @doStepTarget,
+            @doStepMortar,
+            @doStepWhip,
+            @doStepKamikaze,
+            @doStepCake,
+            @doStepSeduction,
+            @doStepBomb,
+            @doStepCluster,
+            @doStepBomb,
+            @doStepWaterUp,
+            @doStepDrill,
+            @doStepBallgun,
+            @doStepBomb,
+            @doStepRCPlane,
+            @doStepSniperRifleShot,
+            @doStepJetpack,
+            @doStepMolotov,
+            @doStepBirdy,
+            @doStepEggWork,
+            @doStepPortalShot,
+            @doStepPiano,
+            @doStepBomb,
+            @doStepSineGunShot,
+            @doStepFlamethrower,
+            @doStepSMine,
+            @doStepPoisonCloud,
+            @doStepHammer,
+            @doStepHammerHit,
+            @doStepResurrector,
+            @doStepNapalmBomb,
+            @doStepSnowball,
+            @doStepSnowflake,
+            @doStepStructure,
+            @doStepLandGun,
+            @doStepTardis,
+            @doStepIceGun,
+            @doStepAddAmmo,
+            @doStepGenericFaller,
+            @doStepKnife);
 begin
-    RegisterVariable('skip', vtCommand, @chSkip, false);
-    RegisterVariable('hogsay', vtCommand, @chHogSay, true );
+    doStepHandlers:= handlers;
+
+    RegisterVariable('skip', @chSkip, false);
+    RegisterVariable('hogsay', @chHogSay, true );
 
     CurAmmoGear:= nil;
     GearsList:= nil;
+    curHandledGear:= nil;
+
     KilledHHs:= 0;
     SuddenDeath:= false;
     SuddenDeathDmg:= false;
@@ -2116,6 +1391,14 @@ begin
 
     AllInactive:= false;
     PrvInactive:= false;
+
+    //typed const
+    delay:= 0;
+    delay2:= 0;
+    step:= stDelay;
+    upd:= 0;
+
+    //SDMusic:= 'hell.ogg';
 end;
 
 procedure freeModule;
diff --git a/hedgewars/uGearsHandlers.pas b/hedgewars/uGearsHandlers.pas
new file mode 100644
index 0000000..9e9abc2
--- /dev/null
+++ b/hedgewars/uGearsHandlers.pas
@@ -0,0 +1,86 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uGearsHandlers;
+interface
+
+uses uTypes;
+
+procedure cakeStep(Gear: PGear);
+
+implementation
+
+uses SDLh, uFloat, uCollisions;
+
+
+
+const dirs: array[0..3] of TPoint =   ((X: 0; Y: -1), (X: 1; Y: 0),(X: 0; Y: 1),(X: -1; Y: 0));
+
+procedure PrevAngle(Gear: PGear; dA: LongInt); inline;
+begin
+    Gear^.Angle := (LongInt(Gear^.Angle) - dA) and 3
+end;
+
+procedure NextAngle(Gear: PGear; dA: LongInt); inline;
+begin
+    Gear^.Angle := (LongInt(Gear^.Angle) + dA) and 3
+end;
+
+procedure cakeStep(Gear: PGear);
+var
+    xx, yy, xxn, yyn: LongInt;
+    dA: LongInt;
+begin
+    dA := hwSign(Gear^.dX);
+    xx := dirs[Gear^.Angle].x;
+    yy := dirs[Gear^.Angle].y;
+    xxn := dirs[(LongInt(Gear^.Angle) + dA) and 3].x;
+    yyn := dirs[(LongInt(Gear^.Angle) + dA) and 3].y;
+
+    if (xx = 0) then
+        if TestCollisionYwithGear(Gear, yy) <> 0 then
+            PrevAngle(Gear, dA)
+    else
+        begin
+        Gear^.Tag := 0;
+        Gear^.Y := Gear^.Y + int2hwFloat(yy);
+        if not TestCollisionXwithGear(Gear, xxn) then
+            begin
+            Gear^.X := Gear^.X + int2hwFloat(xxn);
+            NextAngle(Gear, dA)
+            end;
+        end;
+
+    if (yy = 0) then
+        if TestCollisionXwithGear(Gear, xx) then
+            PrevAngle(Gear, dA)
+    else
+        begin
+        Gear^.Tag := 0;
+        Gear^.X := Gear^.X + int2hwFloat(xx);
+        if TestCollisionYwithGear(Gear, yyn) = 0 then
+            begin
+            Gear^.Y := Gear^.Y + int2hwFloat(yyn);
+            NextAngle(Gear, dA)
+            end;
+        end;
+end;
+
+end.
diff --git a/hedgewars/uGearsHandlersRope.pas b/hedgewars/uGearsHandlersRope.pas
new file mode 100644
index 0000000..a207f8f
--- /dev/null
+++ b/hedgewars/uGearsHandlersRope.pas
@@ -0,0 +1,463 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+unit uGearsHandlersRope;
+interface
+
+uses uTypes;
+
+procedure doStepRope(Gear: PGear);
+
+implementation
+uses uConsts, uFloat, uCollisions, uVariables, uGearsList, uSound, uGearsUtils,
+    uAmmos, uDebug, uUtils, uGearsHedgehog, uGearsRender;
+
+procedure doStepRopeAfterAttack(Gear: PGear);
+var 
+    HHGear: PGear;
+begin
+    HHGear := Gear^.Hedgehog^.Gear;
+    if ((HHGear^.State and gstHHDriven) = 0)
+    or (CheckGearDrowning(HHGear))
+    or (TestCollisionYwithGear(HHGear, 1) <> 0) then
+        begin
+        DeleteGear(Gear);
+        isCursorVisible := false;
+        ApplyAmmoChanges(HHGear^.Hedgehog^);
+        exit
+        end;
+
+    HedgehogChAngle(HHGear);
+
+    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
+        SetLittle(HHGear^.dX);
+
+    if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then
+        HHGear^.dY := _0;
+    HHGear^.X := HHGear^.X + HHGear^.dX;
+    HHGear^.Y := HHGear^.Y + HHGear^.dY;
+    HHGear^.dY := HHGear^.dY + cGravity;
+    
+    if (GameFlags and gfMoreWind) <> 0 then
+        HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density;
+
+    if (Gear^.Message and gmAttack) <> 0 then
+        begin
+        Gear^.X := HHGear^.X;
+        Gear^.Y := HHGear^.Y;
+
+        ApplyAngleBounds(Gear^.Hedgehog^, amRope);
+
+        Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX);
+        Gear^.dY := -AngleCos(HHGear^.Angle);
+        Gear^.Friction := _4_5 * cRopePercent;
+        Gear^.Elasticity := _0;
+        Gear^.State := Gear^.State and (not gsttmpflag);
+        Gear^.doStep := @doStepRope;
+        end
+end;
+
+procedure RopeDeleteMe(Gear, HHGear: PGear);
+begin
+    with HHGear^ do
+        begin
+        Message := Message and (not gmAttack);
+        State := (State or gstMoving) and (not gstWinner);
+        end;
+    DeleteGear(Gear)
+end;
+
+procedure RopeWaitCollision(Gear, HHGear: PGear);
+begin
+    with HHGear^ do
+        begin
+        Message := Message and (not gmAttack);
+        State := State or gstMoving;
+        end;
+    RopePoints.Count := 0;
+    Gear^.Elasticity := _0;
+    Gear^.doStep := @doStepRopeAfterAttack
+end;
+
+procedure doStepRopeWork(Gear: PGear);
+var 
+    HHGear: PGear;
+    len, tx, ty, nx, ny, ropeDx, ropeDy, mdX, mdY: hwFloat;
+    lx, ly, cd: LongInt;
+    haveCollision,
+    haveDivided: boolean;
+
+begin
+    if GameTicks mod 4 <> 0 then exit;
+
+    HHGear := Gear^.Hedgehog^.Gear;
+
+    if ((HHGear^.State and gstHHDriven) = 0)
+       or (CheckGearDrowning(HHGear)) or (Gear^.PortalCounter <> 0) then
+        begin
+        PlaySound(sndRopeRelease);
+        RopeDeleteMe(Gear, HHGear);
+        exit
+        end;
+
+    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shl 2;
+    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shl 2;
+    if (Gear^.Message and gmLeft  <> 0) and (not TestCollisionXwithGear(HHGear, -1)) then
+        HHGear^.dX := HHGear^.dX - _0_0032;
+
+    if (Gear^.Message and gmRight <> 0) and (not TestCollisionXwithGear(HHGear,  1)) then
+        HHGear^.dX := HHGear^.dX + _0_0032;
+
+    // vector between hedgehog and rope attaching point
+    ropeDx := HHGear^.X - Gear^.X;
+    ropeDy := HHGear^.Y - Gear^.Y;
+
+    if TestCollisionYwithGear(HHGear, 1) = 0 then
+        begin
+
+        // depending on the rope vector we know which X-side to check for collision
+        // in order to find out if the hog can still be moved by gravity
+        if ropeDx.isNegative = RopeDy.IsNegative then
+            cd:= -1
+        else
+            cd:= 1;
+
+        // apply gravity if there is no obstacle
+        if not TestCollisionXwithGear(HHGear, cd) then
+            HHGear^.dY := HHGear^.dY + cGravity * 16;
+
+        if (GameFlags and gfMoreWind) <> 0 then
+            // apply wind if there's no obstacle
+            if not TestCollisionXwithGear(HHGear, hwSign(cWindSpeed)) then
+                HHGear^.dX := HHGear^.dX + cWindSpeed * 16 / HHGear^.Density;
+        end;
+
+    mdX := ropeDx + HHGear^.dX;
+    mdY := ropeDy + HHGear^.dY;
+    len := _1 / Distance(mdX, mdY);
+    // rope vector plus hedgehog direction vector normalized
+    mdX := mdX * len;
+    mdY := mdY * len;
+
+    // for visual purposes only
+    Gear^.dX := mdX;
+    Gear^.dY := mdY;
+
+    /////
+    tx := HHGear^.X;
+    ty := HHGear^.Y;
+
+    if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
+        if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
+        or (TestCollisionYwithGear(HHGear, hwSign(ropeDy)) <> 0)) then
+            Gear^.Elasticity := Gear^.Elasticity + _1_2;
+
+    if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
+        if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
+        or (TestCollisionYwithGear(HHGear, -hwSign(ropeDy)) <> 0)) then
+            Gear^.Elasticity := Gear^.Elasticity - _1_2;
+
+    HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
+    HHGear^.Y := Gear^.Y + mdY * Gear^.Elasticity;
+
+    HHGear^.dX := HHGear^.X - tx;
+    HHGear^.dY := HHGear^.Y - ty;
+    ////
+
+
+    haveDivided := false;
+    // check whether rope needs dividing
+
+    len := Gear^.Elasticity - _5;
+    nx := Gear^.X + mdX * len;
+    ny := Gear^.Y + mdY * len;
+    tx := mdX * _1_2; // should be the same as increase step
+    ty := mdY * _1_2;
+
+    while len > _3 do
+        begin
+        lx := hwRound(nx);
+        ly := hwRound(ny);
+        if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and ((Land[ly, lx] and $FF00) <> 0) then
+            begin
+            ny := _1 / Distance(ropeDx, ropeDy);
+            // old rope pos
+            nx := ropeDx * ny;
+            ny := ropeDy * ny;
+
+            with RopePoints.ar[RopePoints.Count] do
+                begin
+                X := Gear^.X;
+                Y := Gear^.Y;
+                if RopePoints.Count = 0 then
+                    RopePoints.HookAngle := DxDy2Angle(Gear^.dY, Gear^.dX);
+                b := (nx * HHGear^.dY) > (ny * HHGear^.dX);
+                dLen := len
+                end;
+                
+            with RopePoints.rounded[RopePoints.Count] do
+                begin
+                X := hwRound(Gear^.X);
+                Y := hwRound(Gear^.Y);
+                end;
+
+            Gear^.X := Gear^.X + nx * len;
+            Gear^.Y := Gear^.Y + ny * len;
+            inc(RopePoints.Count);
+            TryDo(RopePoints.Count <= MAXROPEPOINTS, 'Rope points overflow', true);
+            Gear^.Elasticity := Gear^.Elasticity - len;
+            Gear^.Friction := Gear^.Friction - len;
+            haveDivided := true;
+            break
+            end;
+        nx := nx - tx;
+        ny := ny - ty;
+
+        // len := len - _1_2 // should be the same as increase step
+        len.QWordValue := len.QWordValue - _1_2.QWordValue;
+        end;
+
+    if not haveDivided then
+        if RopePoints.Count > 0 then // check whether the last dividing point could be removed
+            begin
+            tx := RopePoints.ar[Pred(RopePoints.Count)].X;
+            ty := RopePoints.ar[Pred(RopePoints.Count)].Y;
+            mdX := tx - Gear^.X;
+            mdY := ty - Gear^.Y;
+            if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * (ty - HHGear^.Y) > (tx - HHGear^.X) * mdY) then
+                begin
+                dec(RopePoints.Count);
+                Gear^.X := RopePoints.ar[RopePoints.Count].X;
+                Gear^.Y := RopePoints.ar[RopePoints.Count].Y;
+                Gear^.Elasticity := Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen;
+                Gear^.Friction := Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen;
+
+                // restore hog position
+                len := _1 / Distance(mdX, mdY);
+                mdX := mdX * len;
+                mdY := mdY * len;
+
+                HHGear^.X := Gear^.X - mdX * Gear^.Elasticity;
+                HHGear^.Y := Gear^.Y - mdY * Gear^.Elasticity;
+                end
+            end;
+
+    haveCollision := false;
+    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
+        begin
+        HHGear^.dX := -_0_6 * HHGear^.dX;
+        haveCollision := true
+        end;
+    if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0 then
+        begin
+        HHGear^.dY := -_0_6 * HHGear^.dY;
+        haveCollision := true
+        end;
+
+    if haveCollision and (Gear^.Message and (gmLeft or gmRight) <> 0) and (Gear^.Message and (gmUp or gmDown) <> 0) then
+        begin
+        HHGear^.dX := SignAs(hwAbs(HHGear^.dX) + _0_8, HHGear^.dX);
+        HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_8, HHGear^.dY)
+        end;
+
+    len := hwSqr(HHGear^.dX) + hwSqr(HHGear^.dY);
+    if len > _10 then
+        begin
+        len := _3_2 / hwSqrt(len);
+        HHGear^.dX := HHGear^.dX * len;
+        HHGear^.dY := HHGear^.dY * len;
+        end;
+
+    haveCollision:= ((hwRound(Gear^.Y) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y), hwRound(Gear^.X)]) <> 0);
+
+    if not haveCollision then
+        begin
+        // backup gear location
+        tx:= Gear^.X;
+        ty:= Gear^.Y;
+
+        if RopePoints.Count > 0 then
+            begin
+            // set gear location to the remote end of the rope, the attachment point
+            Gear^.X:= RopePoints.ar[0].X;
+            Gear^.Y:= RopePoints.ar[0].Y;
+            end;
+
+        CheckCollision(Gear);
+        // if we haven't found any collision yet then check the other side too
+        if (Gear^.State and gstCollision) = 0 then
+            begin
+            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
+            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
+            CheckCollision(Gear);
+            Gear^.dX.isNegative:= not Gear^.dX.isNegative;
+            Gear^.dY.isNegative:= not Gear^.dY.isNegative;
+            end;
+
+        haveCollision:= (Gear^.State and gstCollision) <> 0;
+
+        // restore gear location
+        Gear^.X:= tx;
+        Gear^.Y:= ty;
+        end;
+
+    // if the attack key is pressed, lose rope contact as well
+    if (Gear^.Message and gmAttack) <> 0 then
+        haveCollision:= false;
+
+    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shr 2;
+    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shr 2;
+    if (not haveCollision) and ((Gear^.State and gsttmpFlag) <> 0) then
+        begin
+            begin
+            PlaySound(sndRopeRelease);
+            if Gear^.Hedgehog^.CurAmmoType <> amParachute then
+                RopeWaitCollision(Gear, HHGear)
+            else
+                RopeDeleteMe(Gear, HHGear)
+            end
+        end
+    else
+        if (Gear^.State and gsttmpFlag) = 0 then
+            Gear^.State := Gear^.State or gsttmpFlag;
+end;
+
+procedure RopeRemoveFromAmmo(Gear, HHGear: PGear);
+begin
+    if (Gear^.State and gstAttacked) = 0 then
+        begin
+        OnUsedAmmo(HHGear^.Hedgehog^);
+        Gear^.State := Gear^.State or gstAttacked
+        end;
+    ApplyAmmoChanges(HHGear^.Hedgehog^)
+end;
+
+procedure doStepRopeAttach(Gear: PGear);
+var 
+    HHGear: PGear;
+    tx, ty, tt: hwFloat;
+begin
+    Gear^.X := Gear^.X - Gear^.dX;
+    Gear^.Y := Gear^.Y - Gear^.dY;
+    Gear^.Elasticity := Gear^.Elasticity + _1;
+
+    HHGear := Gear^.Hedgehog^.Gear;
+    DeleteCI(HHGear);
+
+    if (HHGear^.State and gstMoving) <> 0 then
+        begin
+        if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
+            SetLittle(HHGear^.dX);
+        if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then
+            HHGear^.dY := _0;
+
+        HHGear^.X := HHGear^.X + HHGear^.dX;
+        Gear^.X := Gear^.X + HHGear^.dX;
+
+        if TestCollisionYwithGear(HHGear, 1) <> 0 then
+            begin
+            CheckHHDamage(HHGear);
+            HHGear^.dY := _0
+            //HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump));
+            end
+        else
+            begin
+            HHGear^.Y := HHGear^.Y + HHGear^.dY;
+            Gear^.Y := Gear^.Y + HHGear^.dY;
+            HHGear^.dY := HHGear^.dY + cGravity;
+            if (GameFlags and gfMoreWind) <> 0 then
+                HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density
+            end;
+
+        tt := Gear^.Elasticity;
+        tx := _0;
+        ty := _0;
+        while tt > _20 do
+            begin
+            if ((hwRound(Gear^.Y+ty) and LAND_HEIGHT_MASK) = 0) and ((hwRound(Gear^.X+tx) and LAND_WIDTH_MASK) = 0) and ((Land[hwRound(Gear^.Y+ty), hwRound(Gear^.X+tx)] and $FF00) <> 0) then
+                begin
+                Gear^.X := Gear^.X + tx;
+                Gear^.Y := Gear^.Y + ty;
+                Gear^.Elasticity := tt;
+                Gear^.doStep := @doStepRopeWork;
+                PlaySound(sndRopeAttach);
+                with HHGear^ do
+                    begin
+                    State := State and (not (gstAttacking or gstHHJumping or gstHHHJump));
+                    Message := Message and (not gmAttack)
+                    end;
+
+                RopeRemoveFromAmmo(Gear, HHGear);
+
+                tt := _0;
+                exit
+                end;
+            tx := tx + Gear^.dX + Gear^.dX;
+            ty := ty + Gear^.dY + Gear^.dY;
+            tt := tt - _2;
+            end;
+        end;
+
+    if Gear^.Elasticity < _20 then Gear^.CollisionMask:= $FF00
+    else Gear^.CollisionMask:= $FF7F;
+    CheckCollision(Gear);
+
+    if (Gear^.State and gstCollision) <> 0 then
+        if Gear^.Elasticity < _10 then
+            Gear^.Elasticity := _10000
+    else
+        begin
+        Gear^.doStep := @doStepRopeWork;
+        PlaySound(sndRopeAttach);
+        with HHGear^ do
+            begin
+            State := State and (not (gstAttacking or gstHHJumping or gstHHHJump));
+            Message := Message and (not gmAttack)
+            end;
+
+        RopeRemoveFromAmmo(Gear, HHGear);
+
+        exit
+        end;
+
+    if (Gear^.Elasticity > Gear^.Friction)
+        or ((Gear^.Message and gmAttack) = 0)
+        or ((HHGear^.State and gstHHDriven) = 0)
+        or (HHGear^.Damage > 0) then
+            begin
+            with Gear^.Hedgehog^.Gear^ do
+                begin
+                State := State and (not gstAttacking);
+                Message := Message and (not gmAttack)
+                end;
+        DeleteGear(Gear);
+        exit;
+        end;
+    if CheckGearDrowning(HHGear) then DeleteGear(Gear)
+end;
+
+procedure doStepRope(Gear: PGear);
+begin
+    Gear^.dX := - Gear^.dX;
+    Gear^.dY := - Gear^.dY;
+    Gear^.doStep := @doStepRopeAttach;
+    PlaySound(sndRopeShot)
+end;
+
+end.
diff --git a/hedgewars/uGearsHedgehog.pas b/hedgewars/uGearsHedgehog.pas
new file mode 100644
index 0000000..a107747
--- /dev/null
+++ b/hedgewars/uGearsHedgehog.pas
@@ -0,0 +1,1251 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uGearsHedgehog;
+interface
+uses uTypes;
+
+procedure doStepHedgehog(Gear: PGear);
+procedure AfterAttack; 
+procedure HedgehogStep(Gear: PGear); 
+procedure doStepHedgehogMoving(Gear: PGear); 
+procedure HedgehogChAngle(HHGear: PGear); 
+procedure PickUp(HH, Gear: PGear);
+procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord);
+
+implementation
+uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, 
+    uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript,
+    uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, 
+    uGearsUtils;
+
+var GHStepTicks: LongWord = 0;
+
+// Shouldn't more of this ammo switching stuff be moved to uAmmos ?
+function ChangeAmmo(HHGear: PGear): boolean;
+var slot, i: Longword;
+    ammoidx: LongInt;
+    prevAmmo: TAmmoType;
+begin
+ChangeAmmo:= false;
+slot:= HHGear^.MsgParam;
+
+with HHGear^.Hedgehog^ do
+    begin
+    HHGear^.Message:= HHGear^.Message and (not gmSlot);
+    prevAmmo:= CurAmmoType;
+    ammoidx:= 0;
+    if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0)
+    or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0))
+    or ((HHGear^.State and gstHHDriven) = 0) then
+        exit;
+    ChangeAmmo:= true;
+
+    while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do
+        inc(ammoidx);
+
+    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (MultiShootAttacks > 0) then
+        OnUsedAmmo(HHGear^.Hedgehog^);
+
+    MultiShootAttacks:= 0;
+    HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump));
+    
+    if Ammoz[CurAmmoType].Slot = slot then
+        begin
+        i:= 0;
+        repeat
+        inc(ammoidx);
+        if (ammoidx > cMaxSlotAmmoIndex) then
+            begin
+            inc(i);
+            CurAmmoType:= amNothing;
+            ammoidx:= -1;
+            //TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
+            end;
+        until (i = 1) or ((Ammo^[slot, ammoidx].Count > 0)
+        and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns))
+        
+        end 
+    else
+        begin
+        i:= 0;
+        // check whether there is ammo in slot
+        while (i <= cMaxSlotAmmoIndex) and ((Ammo^[slot, i].Count = 0)
+        or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns))
+            do inc(i);
+
+        if i <= cMaxSlotAmmoIndex then
+            ammoidx:= i
+        else ammoidx:= -1
+        end;
+        if ammoidx >= 0 then
+            CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
+    if (prevAmmo <> CurAmmoType) then
+        begin
+        if CurAmmoType = amKnife then
+            LoadHedgehogHat(HHGear^.Hedgehog^, 'Reserved/chef')
+        else if prevAmmo = amKnife then
+            LoadHedgehogHat(HHGear^.Hedgehog^, Hat);
+        end
+    end
+end;
+
+procedure HHSetWeapon(HHGear: PGear);
+var t: LongInt;
+    weap: TAmmoType;
+    Hedgehog: PHedgehog;
+    s: boolean;
+begin
+s:= false;
+
+weap:= TAmmoType(HHGear^.MsgParam);
+Hedgehog:= HHGear^.Hedgehog;
+
+if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then
+    exit; // weapon is not activated yet
+
+HHGear^.MsgParam:= Ammoz[weap].Slot;
+
+t:= cMaxSlotAmmoIndex;
+
+HHGear^.Message:= HHGear^.Message and (not gmWeapon);
+
+with Hedgehog^ do
+    while (CurAmmoType <> weap) and (t >= 0) do
+        begin
+        s:= ChangeAmmo(HHGear);
+        dec(t)
+        end;
+
+if s then
+    ApplyAmmoChanges(HHGear^.Hedgehog^)
+end;
+
+procedure HHSetTimer(Gear: PGear);
+var CurWeapon: PAmmo;
+    color: LongWord;
+begin
+Gear^.Message:= Gear^.Message and (not gmTimer);
+CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^);
+with Gear^.Hedgehog^ do
+    if ((Gear^.Message and gmPrecise) <> 0) and ((CurWeapon^.Propz and ammoprop_SetBounce) <> 0) then
+        begin
+        color:= Gear^.Hedgehog^.Team^.Clan^.Color;
+        case Gear^.MsgParam of
+            1: begin
+               AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce1]), color, capgrpAmmostate);
+               CurWeapon^.Bounciness:= 350;
+               end;
+            2: begin
+               AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce2]), color, capgrpAmmostate);
+               CurWeapon^.Bounciness:= 700;
+               end;
+            3: begin
+               AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce3]), color, capgrpAmmostate);
+               CurWeapon^.Bounciness:= 1000;
+               end;
+            4: begin
+               AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce4]), color, capgrpAmmostate);
+               CurWeapon^.Bounciness:= 2000;
+               end;
+            5: begin
+               AddCaption(FormatA(trmsg[sidBounce], trmsg[sidBounce5]), color, capgrpAmmostate);
+               CurWeapon^.Bounciness:= 4000;
+               end
+            end
+        end
+    else if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
+        begin
+        CurWeapon^.Timer:= 1000 * Gear^.MsgParam;
+        with CurrentTeam^ do
+            ApplyAmmoChanges(Hedgehogs[CurrHedgehog]);
+        end;
+end;
+
+
+procedure Attack(Gear: PGear);
+var xx, yy, newDx, newDy, lx, ly: hwFloat;
+    speech: PVisualGear;
+    newGear:  PGear;
+    CurWeapon: PAmmo;
+    altUse: boolean;
+    elastic: hwFloat;
+begin
+newGear:= nil;
+bShowFinger:= false;
+CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^);
+with Gear^,
+    Gear^.Hedgehog^ do
+        begin
+        if ((State and gstHHDriven) <> 0) and ((State and (gstAttacked or gstHHChooseTarget)) = 0) and (((State and gstMoving) = 0)
+        or (Power > 0)
+        or (CurAmmoType = amTeleport)
+        or 
+        // Allow attacks while moving on ammo with AltAttack
+        ((CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0))
+        or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackInMove) <> 0))
+        and ((TargetPoint.X <> NoPointX) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) = 0)) then
+            begin
+            State:= State or gstAttacking;
+            if Power = cMaxPower then
+                Message:= Message and (not gmAttack)
+            else if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) = 0 then
+                Message:= Message and (not gmAttack)
+            else
+                begin
+                if Power = 0 then
+                    begin
+                    AttackBar:= CurrentTeam^.AttackBar;
+                    PlaySound(sndThrowPowerUp)
+                    end;
+                inc(Power)
+                end;
+        if ((Message and gmAttack) <> 0) then
+            exit;
+
+        if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0 then
+            begin
+            StopSound(sndThrowPowerUp);
+            PlaySound(sndThrowRelease);
+            end;
+
+        xx:= SignAs(AngleSin(Angle), dX);
+        yy:= -AngleCos(Angle);
+
+        lx:= X + int2hwfloat(round(GetLaunchX(CurAmmoType, hwSign(dX), Angle)));
+        ly:= Y + int2hwfloat(round(GetLaunchY(CurAmmoType, Angle)));
+
+        if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then
+            xx:= - xx;
+        if Ammoz[CurAmmoType].Ammo.AttackVoice <> sndNone then
+            AddVoice(Ammoz[CurAmmoType].Ammo.AttackVoice, CurrentTeam^.voicepack);
+
+// Initiating alt attack
+        if  (CurAmmoGear <> nil)
+        and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
+        and ((Gear^.Message and gmLJump) <> 0)
+        and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+            begin
+            newDx:= dX; 
+            newDy:= dY;
+            altUse:= true
+            end
+        else
+            begin
+            newDx:= xx*Power/cPowerDivisor;
+            newDy:= yy*Power/cPowerDivisor;
+            altUse:= false
+            end;
+
+             case CurAmmoType of
+                      amGrenade: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGrenade,         0, newDx, newDy, CurWeapon^.Timer);
+                      amMolotov: newGear:= AddGear(hwRound(lx), hwRound(ly), gtMolotov,      0, newDx, newDy, 0);
+                  amClusterBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtClusterBomb,  0, newDx, newDy, CurWeapon^.Timer);
+                      amGasBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGasBomb,      0, newDx, newDy, CurWeapon^.Timer);
+                      amBazooka: newGear:= AddGear(hwRound(lx), hwRound(ly), gtShell,        0, newDx, newDy, 0);
+                     amSnowball: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSnowball,     0, newDx, newDy, 0);
+                          amBee: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBee,          0, newDx, newDy, 0);
+                      amShotgun: begin
+                                 PlaySound(sndShotgunReload);
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtShotgunShot,  0, xx * _0_5, yy * _0_5, 0);
+                                 end;
+                   amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0);
+                         amSkip: ParseCommand('/skip', true);
+                         amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0);
+                         amMine: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000);
+                        amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
+                        amKnife: begin 
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtKnife,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
+                                 newGear^.State:= newGear^.State or gstMoving; 
+                                 newGear^.Radius:= 6 // temporarily shrink so it doesn't instantly embed in the ground
+                                 end;
+                       amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
+                      amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0);
+                    amPortalGun: begin
+                                 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 
+                                 // set selected color
+                                 CurWeapon^.Pos);
+                                 end;
+                  amSniperRifle: begin
+                                 PlaySound(sndSniperReload);
+                                 newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0);
+                                 end;
+                     amDynamite: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
+                    amFirePunch: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtFirePunch, 0, xx, _0, 0);
+                         amWhip: begin
+                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtWhip, 0, SignAs(_1, dX), - _0_8, 0);
+                                 PlaySound(sndWhipCrack)
+                                 end;
+                       amHammer: begin
+                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtHammer, 0, SignAs(_1, dX), - _0_8, 0);
+                                 PlaySound(sndWhack)
+                                 end;
+                  amBaseballBat: begin
+                                 newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtShover, gsttmpFlag, xx * _0_5, yy * _0_5, 0);
+                                 PlaySound(sndBaseballBat) // TODO: Only play if something is hit?
+                                 end;
+                    amParachute: begin
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtParachute, 0, _0, _0, 0);
+                                 PlaySound(sndParachute)
+                                 end;
+                    // we save CurWeapon^.Pos (in this case: cursor direction) by using it as (otherwise irrelevant) X value of the new gear.
+                    amAirAttack: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 0, _0, _0, 0);
+                   amMineStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 1, _0, _0, 0);
+                  amDrillStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 3, _0, _0, CurWeapon^.Timer);
+                       amNapalm: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 2, _0, _0, 0);
+                    amBlowTorch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBlowTorch, 0, SignAs(_0_5, dX), _0, 0);
+                       amGirder: newGear:= AddGear(0, 0, gtGirder, CurWeapon^.Pos, _0, _0, 0);
+                     amTeleport: newGear:= AddGear(CurWeapon^.Pos, 0, gtTeleport, 0, _0, _0, 0);
+                       amSwitch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSwitcher, 0, _0, _0, 0);
+                       amMortar: begin
+                                 playSound(sndMortar);
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtMortar,  0, xx*cMaxPower/cPowerDivisor, yy*cMaxPower/cPowerDivisor, 0);
+                                 end;
+                      amRCPlane: begin
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtRCPlane,  0, xx * cMaxPower / cPowerDivisor / 4, yy * cMaxPower / cPowerDivisor / 4, 0);
+                                 newGear^.SoundChannel:= LoopSound(sndRCPlane)
+                                 end;
+                     amKamikaze: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
+                         amCake: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 3, hwRound(ly), gtCake, 0, SignAs(cLittle, xx), _0, 0);
+                    amSeduction: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSeduction, 0, _0, _0, 0);
+                   amWatermelon: newGear:= AddGear(hwRound(lx), hwRound(ly), gtWatermelon,  0, newDx, newDy, CurWeapon^.Timer);
+                  amHellishBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtHellishBomb,    0, newDx, newDy, 0);
+                        amDrill: newGear:= AddGear(hwRound(lx), hwRound(ly), gtDrill, 0, newDx, newDy, 0);
+                      amBallgun: newGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun,  0, xx * _0_5, yy * _0_5, 0);
+                      amJetpack: newGear:= AddGear(hwRound(lx), hwRound(ly), gtJetpack, 0, _0, _0, 0);
+                        amBirdy: begin
+                             PlaySound(sndWhistle);
+                             newGear:= AddGear(hwRound(lx), hwRound(ly) - 32, gtBirdy, 0, _0, _0, 0);
+                             end;
+                   amLowGravity: begin
+                                 PlaySound(sndLowGravity);
+                                 cGravity:= cMaxWindSpeed;
+                                 cGravityf:= 0.00025
+                                 end;
+                  amExtraDamage: begin 
+                                 PlaySound(sndHellishImpact4);
+                                 cDamageModifier:= _1_5
+                                 end;
+                 amInvulnerable: Invulnerable:= true;
+                    amExtraTime: begin
+                                 PlaySound(sndSwitchHog);
+                                 TurnTimeLeft:= TurnTimeLeft + 30000
+                                 end;
+                   amLaserSight: cLaserSighting:= true;
+                     amVampiric: begin
+                                 PlaySoundV(sndOw1, Team^.voicepack);
+                                 cVampiric:= true;
+                                 end;
+                        amPiano: begin
+                                 // Tuck the hedgehog away until the piano attack is completed
+                                 Unplaced:= true;
+                                 X:= _0;
+                                 Y:= _0;
+                                 newGear:= AddGear(TargetPoint.X, 0, gtPiano, 0, _0, _0, 0);
+                                 PauseMusic
+                                 end;
+                 amFlamethrower: newGear:= AddGear(hwRound(X), hwRound(Y), gtFlamethrower,  0, xx * _0_5, yy * _0_5, 0);
+                      amLandGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtLandGun,  0, xx * _0_5, yy * _0_5, 0);
+                  amResurrector: begin
+                                 newGear:= AddGear(hwRound(lx), hwRound(ly), gtResurrector, 0, _0, _0, 0);
+                                 newGear^.SoundChannel := LoopSound(sndResurrector);
+                                 end;
+                    amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
+                       amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
+                       amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
+             end;
+             if altUse and (newGear <> nil) then
+                begin
+                newGear^.dX:= newDx / newGear^.Density;
+                newGear^.dY:= newDY / newGear^.Density
+                end;
+             
+             case CurAmmoType of
+                      amGrenade, amMolotov, 
+                  amClusterBomb, amGasBomb, 
+                      amBazooka, amSnowball, 
+                          amBee, amSMine,
+                       amMortar, amWatermelon,
+                  amHellishBomb, amDrill: FollowGear:= newGear;
+
+                      amShotgun, amPickHammer,
+                         amRope, amDEagle,
+                      amSineGun, amSniperRifle,
+                    amFirePunch, amWhip,
+                       amHammer, amBaseballBat,
+                    amParachute, amBlowTorch,
+                       amGirder, amTeleport,
+                       amSwitch, amRCPlane,
+                     amKamikaze, amCake,
+                    amSeduction, amBallgun,
+                      amJetpack, amBirdy,
+                 amFlamethrower, amLandGun,
+                  amResurrector, amStructure,
+                       amTardis, amPiano,
+                       amIceGun: CurAmmoGear:= newGear;
+             end;
+             
+            if ((CurAmmoType = amMine) or (CurAmmoType = amSMine)) and (GameFlags and gfInfAttack <> 0) then
+                newGear^.FlightTime:= GameTicks + 1000
+            else if CurAmmoType = amDrill then
+                newGear^.FlightTime:= GameTicks + 250;
+        if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then
+            begin
+            newGear^.Target.X:= TargetPoint.X;
+            newGear^.Target.Y:= TargetPoint.Y
+            end;
+        if (newGear <> nil) and (newGear^.CollisionMask and $80 <> 0) then newGear^.CollisionMask:= newGear^.CollisionMask and (not $80);
+
+        // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement
+        if altUse then
+            FollowGear:= nil;
+
+        if (newGear <> nil) and ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then
+            begin
+            elastic:=  int2hwfloat(CurWeapon^.Bounciness) / _1000;
+
+            if elastic < _1 then
+                newGear^.Elasticity:= newGear^.Elasticity * elastic
+            else if elastic > _1 then
+                newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic);
+(* Experimented with friction modifier. Didn't seem helpful 
+            fric:= int2hwfloat(CurWeapon^.Bounciness) / _250;
+            if fric < _1 then newGear^.Friction:= newGear^.Friction * fric
+            else if fric > _1 then newGear^.Friction:= _1 - ((_1-newGear^.Friction) / fric)*)
+            end;
+
+
+        uStats.AmmoUsed(CurAmmoType);
+
+        if not (SpeechText = '') then
+            begin
+            speech:= AddVisualGear(0, 0, vgtSpeechBubble);
+            if speech <> nil then
+                begin
+                speech^.Text:= SpeechText;
+                speech^.Hedgehog:= Gear^.Hedgehog;
+                speech^.FrameTicks:= SpeechType;
+                end;
+            SpeechText:= ''
+            end;
+
+        Power:= 0;
+        if (CurAmmoGear <> nil)
+            and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) = 0){check for dropping ammo from rope} then
+            begin
+            Message:= Message or gmAttack;
+            CurAmmoGear^.Message:= Message
+            end
+        else
+            begin
+            if not CurrentTeam^.ExtDriven
+            and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0) then
+                SendIPC(_S'a');
+            AfterAttack;
+            end
+        end
+    else 
+        Message:= Message and (not gmAttack);
+    end;
+    TargetPoint.X := NoPointX;
+    ScriptCall('onHogAttack');
+end;
+
+procedure AfterAttack;
+var s: shortstring;
+    a: TAmmoType;
+    HHGear: PGear;
+begin
+with CurrentHedgehog^ do
+    begin
+    HHGear:= Gear;
+    a:= CurAmmoType;
+    if HHGear <> nil then HHGear^.State:= HHGear^.State and (not gstAttacking);
+    if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then
+        begin
+        Inc(MultiShootAttacks);
+        
+        if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then
+            begin
+            s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1);
+            AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate);
+            end;
+        
+        if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks)
+        or ((GameFlags and gfMultiWeapon) <> 0) then
+            begin
+            isInMultiShoot:= true
+            end
+        else
+            begin
+            OnUsedAmmo(CurrentHedgehog^);
+            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (((GameFlags and gfInfAttack) = 0) or PlacingHogs) then
+                begin
+                if TagTurnTimeLeft = 0 then
+                    TagTurnTimeLeft:= TurnTimeLeft;
+                TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
+                end;
+            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then 
+                HHGear^.State:= HHGear^.State or gstAttacked;
+            if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then
+                ApplyAmmoChanges(CurrentHedgehog^)
+            end;
+        end
+    else
+        begin
+        OnUsedAmmo(CurrentHedgehog^);
+        ApplyAmmoChanges(CurrentHedgehog^);
+        end;
+    AttackBar:= 0
+    end
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepHedgehogDead(Gear: PGear);
+const frametime = 200;
+      timertime = frametime * 6;
+begin
+if Gear^.Hedgehog^.Unplaced then
+    exit;
+if Gear^.Timer > 1 then
+    begin
+    AllInactive:= false;
+    dec(Gear^.Timer);
+    if (Gear^.Timer mod frametime) = 0 then
+        inc(Gear^.Pos)
+    end 
+else if Gear^.Timer = 1 then
+    begin
+    Gear^.State:= Gear^.State or gstNoDamage;
+    doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, CurrentHedgehog, EXPLAutoSound);
+    AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtGrave, 0, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
+    DeleteGear(Gear);
+    SetAllToActive
+    end 
+else // Gear^.Timer = 0
+    begin
+    AllInactive:= false;
+    Gear^.Z:= cCurrHHZ;
+    RemoveGearFromList(Gear);
+    InsertGearToList(Gear);
+    PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
+    Gear^.Pos:= 0;
+    Gear^.Timer:= timertime
+    end
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepHedgehogGone(Gear: PGear);
+const frametime = 65;
+      timertime = frametime * 11;
+begin
+if Gear^.Hedgehog^.Unplaced then
+    exit;
+if Gear^.Timer > 1 then
+    begin
+    AllInactive:= false;
+    dec(Gear^.Timer);
+    if (Gear^.Timer mod frametime) = 0 then
+        inc(Gear^.Pos)
+    end
+else
+if Gear^.Timer = 1 then
+    begin
+    DeleteGear(Gear);
+    SetAllToActive
+    end
+else // Gear^.Timer = 0
+    begin
+    AllInactive:= false;
+    Gear^.Z:= cCurrHHZ;
+    RemoveGearFromList(Gear);
+    InsertGearToList(Gear);
+    PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
+    PlaySound(sndWarp);
+    Gear^.Pos:= 0;
+    Gear^.Timer:= timertime
+    end
+end;
+
+procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord);
+var s: shortstring;
+    vga: PVisualGear;
+begin
+    if cnt <> 0 then AddAmmo(HH, ammo, cnt)
+    else AddAmmo(HH, ammo);
+
+    if (not (HH.Team^.ExtDriven 
+    or (HH.BotLevel > 0)))
+    or (HH.Team^.Clan^.ClanIndex = LocalClan)
+    or (GameType = gmtDemo)  then
+        begin
+        if cnt <> 0 then
+            s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(cnt) + ')'
+        else
+            s:= trammo[Ammoz[ammo].NameId] + ' (+' + IntToStr(Ammoz[ammo].NumberInCase) + ')';
+        AddCaption(s, HH.Team^.Clan^.Color, capgrpAmmoinfo);
+
+        // show ammo icon
+        vga:= AddVisualGear(X, Y, vgtAmmo);
+        if vga <> nil then
+            vga^.Frame:= Longword(ammo);
+        end;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure PickUp(HH, Gear: PGear);
+var s: shortstring;
+    i: LongInt;
+    vga: PVisualGear;
+    ag, gi: PGear;
+begin
+Gear^.Message:= gmDestroy;
+if (Gear^.Pos and posCaseExplode) <> 0 then
+    if (Gear^.Pos and posCasePoison) <> 0 then
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned)
+    else
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound)
+else if (Gear^.Pos and posCasePoison) <> 0 then
+    doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage)
+else
+case Gear^.Pos of
+       posCaseUtility,
+       posCaseAmmo: begin
+                    PlaySound(sndShotgunReload);
+                    if Gear^.AmmoType <> amNothing then 
+                        begin
+                        AddPickup(HH^.Hedgehog^, Gear^.AmmoType, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
+                        end
+                    else
+                        begin
+// Add spawning here...
+                        AddRandomness(GameTicks);
+                        
+                        gi := GearsList;
+                        while gi <> nil do
+                            begin
+                            if gi^.Kind = gtGenericFaller then
+                                begin
+                                gi^.Active:= true;
+                                gi^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX);
+                                gi^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY);
+                                gi^.dX:= _90-(GetRandomf*_360);
+                                gi^.dY:= _90-(GetRandomf*_360)
+                                end;
+                            gi := gi^.NextGear
+                            end;
+                        ag:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAddAmmo, gstInvisible, _0, _0, GetRandom(125)+25);
+                        ag^.Pos:= Gear^.Pos;
+                        ag^.Power:= Gear^.Power
+                        end;
+                    end;
+     posCaseHealth: begin
+                    PlaySound(sndShotgunReload);
+                    inc(HH^.Health, Gear^.Health);
+                    HH^.Hedgehog^.Effects[hePoisoned] := 0;
+                    str(Gear^.Health, s);
+                    s:= '+' + s;
+                    AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
+                    RenderHealth(HH^.Hedgehog^);
+                    RecountTeamHealth(HH^.Hedgehog^.Team);
+
+                    i:= 0;
+                    while i < Gear^.Health do
+                        begin
+                        vga:= AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtStraightShot);
+                        if vga <> nil then
+                            with vga^ do
+                                begin
+                                Tint:= $00FF00FF;
+                                State:= ord(sprHealth)
+                                end;
+                        inc(i, 5);
+                        end;
+                    end;
+     end
+end;
+
+procedure HedgehogStep(Gear: PGear);
+var PrevdX: LongInt;
+    CurWeapon: PAmmo;
+begin
+CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^);
+if ((Gear^.State and (gstAttacking or gstMoving)) = 0) then
+    begin
+    if isCursorVisible then
+        with Gear^.Hedgehog^ do
+            with CurWeapon^ do
+                begin
+                if (Gear^.Message and gmLeft  ) <> 0 then
+                    Pos:= (Pos - 1 + Ammoz[AmmoType].PosCount) mod Ammoz[AmmoType].PosCount
+                else
+                    if (Gear^.Message and gmRight ) <> 0 then
+                        Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount
+    else
+        exit;
+    GHStepTicks:= 200;
+    exit
+    end;
+
+    if ((Gear^.Message and gmAnimate) <> 0) then
+        begin
+        Gear^.Message:= 0;
+        Gear^.State:= Gear^.State or gstAnimation;
+        Gear^.Tag:= Gear^.MsgParam;
+        Gear^.Timer:= 0;
+        Gear^.Pos:= 0
+        end;
+
+    if ((Gear^.Message and gmLJump ) <> 0) then
+        begin
+        Gear^.Message:= Gear^.Message and (not gmLJump);
+        DeleteCI(Gear);
+        if TestCollisionYwithGear(Gear, -1) = 0 then
+            if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then
+                Gear^.Y:= Gear^.Y - _2
+            else
+                if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then
+                    Gear^.Y:= Gear^.Y - _1;
+            if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX))
+            or   (TestCollisionYwithGear(Gear, -1) <> 0)) then
+                begin
+                Gear^.dY:= -_0_15;
+                if not cArtillery then
+                    Gear^.dX:= SignAs(_0_15, Gear^.dX);
+                Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
+                PlaySoundV(sndJump1, Gear^.Hedgehog^.Team^.voicepack);
+        exit
+        end;
+    end;
+
+    if ((Gear^.Message and gmHJump ) <> 0) then
+        begin
+        DeleteCI(Gear);
+        Gear^.Message:= Gear^.Message and (not gmHJump);
+
+        Gear^.dY:= -_0_2;
+        SetLittle(Gear^.dX);
+        Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
+        PlaySoundV(sndJump3, Gear^.Hedgehog^.Team^.voicepack);
+        exit
+        end;
+
+    PrevdX:= hwSign(Gear^.dX);
+    if (Gear^.Message and gmLeft  )<>0 then
+        Gear^.dX:= -cLittle else
+    if (Gear^.Message and gmRight )<>0 then
+        Gear^.dX:=  cLittle 
+        else exit;
+
+    StepSoundTimer:= cHHStepTicks;
+
+    GHStepTicks:= cHHStepTicks;
+    if PrevdX <> hwSign(Gear^.dX) then
+        begin
+        FollowGear:= Gear;
+        exit
+        end;
+    DeleteCI(Gear); // must be after exit!! (see previous line)
+
+    Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7;
+
+    if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) then
+        MakeHedgehogsStep(Gear);
+
+    SetAllHHToActive;
+    AddGearCI(Gear)
+    end
+end;
+
+procedure HedgehogChAngle(HHGear: PGear);
+var da: LongWord;
+begin
+with HHGear^.Hedgehog^ do
+    if ((CurAmmoType = amRope) and ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving))
+    or ((CurAmmoType = amPortalGun) and ((HHGear^.State and gstMoving) <> 0)) then
+        da:= 2
+    else da:= 1;
+
+if (((HHGear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then
+    if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then
+        dec(HHGear^.Angle, da)
+    else
+        if ((HHGear^.Message and gmDown) <> 0) and (HHGear^.Angle + da <= CurMaxAngle) then
+            inc(HHGear^.Angle, da)
+end;
+
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepHedgehogMoving(Gear: PGear);
+var isFalling, isUnderwater: boolean;
+    land: Word;
+begin
+land:= 0;
+isUnderwater:= cWaterLine < hwRound(Gear^.Y) + Gear^.Radius;
+if Gear^.dX.QWordValue > 8160437862 then
+    Gear^.dX.QWordValue:= 8160437862;
+if Gear^.dY.QWordValue > 8160437862 then
+    Gear^.dY.QWordValue:= 8160437862;
+
+if Gear^.Hedgehog^.Unplaced then
+    begin
+    Gear^.dY:= _0;
+    Gear^.dX:= _0;
+    Gear^.State:= Gear^.State and (not gstMoving);
+    exit
+    end;
+isFalling:= (Gear^.dY.isNegative) or (not TestCollisionYKick(Gear, 1));
+if isFalling then
+    begin
+    if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then
+        Gear^.dY:= _0;
+    Gear^.State:= Gear^.State or gstMoving;
+    if (CurrentHedgehog^.Gear = Gear)
+        and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then 
+        begin
+        // TODO: why so aggressive at setting FollowGear when falling?
+        FollowGear:= Gear;
+        end;
+    if isUnderwater then
+       Gear^.dY:= Gear^.dY + cGravity / _2
+    else
+        begin
+        Gear^.dY:= Gear^.dY + cGravity;
+// this set of circumstances could be less complex if jumping was more clearly identified
+        if ((GameFlags and gfMoreWind) <> 0) and (((Gear^.Damage <> 0)
+        or ((CurAmmoGear <> nil) and ((CurAmmoGear^.AmmoType = amJetpack) or (CurAmmoGear^.AmmoType = amBirdy)))
+        or ((Gear^.dY.QWordValue + Gear^.dX.QWordValue) > _0_55.QWordValue))) then
+            Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
+        end
+    end 
+else
+    begin
+    land:= TestCollisionYwithGear(Gear, 1);
+    if ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_55.QWordValue) and ((land and lfIce) = 0)
+    and ((Gear^.State and gstHHJumping) <> 0) then
+        SetLittle(Gear^.dX);
+
+    if not Gear^.dY.isNegative then
+        begin
+        CheckHHDamage(Gear);
+
+        if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery)
+        and (Gear^.dX.QWordValue < _0_02.QWordValue) then
+            Gear^.dX.isNegative:= not Gear^.dX.isNegative; // landing after high jump
+        Gear^.State:= Gear^.State and (not (gstHHJumping or gstHHHJump));
+        Gear^.dY:= _0;
+        end
+    else
+        Gear^.dY:= Gear^.dY + cGravity;
+
+    if ((Gear^.State and gstMoving) <> 0) then
+        begin
+        if land and lfIce <> 0 then
+            begin
+            Gear^.dX:= Gear^.dX * (_1 - (_1 - Gear^.Friction) / _2)
+            end
+        else
+            Gear^.dX:= Gear^.dX * Gear^.Friction;
+        end
+    end;
+
+if (Gear^.State <> 0) then
+    DeleteCI(Gear);
+
+if isUnderwater then
+   begin
+   Gear^.dY:= Gear^.dY * _0_999;
+   Gear^.dX:= Gear^.dX * _0_999;
+   end;
+
+if (Gear^.State and gstMoving) <> 0 then
+    if TestCollisionXKick(Gear, hwSign(Gear^.dX)) then
+        if not isFalling then
+            if hwAbs(Gear^.dX) > _0_01 then
+                if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) then
+                    begin
+                    Gear^.X:= Gear^.X + Gear^.dX;
+                    Gear^.dX:= Gear^.dX * _0_96;
+                    Gear^.Y:= Gear^.Y - _1
+                    end
+                else
+                    if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) then
+                        begin
+                        Gear^.X:= Gear^.X + Gear^.dX;
+                        Gear^.dX:= Gear^.dX * _0_93;
+                        Gear^.Y:= Gear^.Y - _2
+                        end 
+                    else
+                        if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) then
+                        begin
+                        Gear^.X:= Gear^.X + Gear^.dX;
+                        Gear^.dX:= Gear^.dX * _0_9 ;
+                        Gear^.Y:= Gear^.Y - _3
+                        end
+                    else
+                        if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) then
+                            begin
+                            Gear^.X:= Gear^.X + Gear^.dX;
+                            Gear^.dX:= Gear^.dX * _0_87;
+                            Gear^.Y:= Gear^.Y - _4
+                            end
+                    else
+                        if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) then
+                            begin
+                            Gear^.X:= Gear^.X + Gear^.dX;
+                            Gear^.dX:= Gear^.dX * _0_84;
+                            Gear^.Y:= Gear^.Y - _5
+                            end
+                    else
+                        if hwAbs(Gear^.dX) > _0_02 then
+                            Gear^.dX:= -Gear^.Elasticity * Gear^.dX
+                        else
+                            begin
+                            Gear^.State:= Gear^.State and (not gstMoving);
+                            while TestCollisionYWithGear(Gear,1) = 0 do
+                                Gear^.Y:= Gear^.Y+_1;
+                            SetLittle(Gear^.dX)
+                            end
+            else
+                begin
+                Gear^.State:= Gear^.State and (not gstMoving);
+                while TestCollisionYWithGear(Gear,1) = 0 do
+                    Gear^.Y:= Gear^.Y+_1;
+                SetLittle(Gear^.dX)
+                end
+        else if (hwAbs(Gear^.dX) > cLittle)
+        and ((Gear^.State and gstHHJumping) = 0) then
+            Gear^.dX:= -Gear^.Elasticity * Gear^.dX
+        else
+            SetLittle(Gear^.dX);
+
+if (not isFalling)
+  and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
+    begin
+    Gear^.State:= Gear^.State and (not gstWinner);
+    Gear^.State:= Gear^.State and (not gstMoving);
+    while (TestCollisionYWithGear(Gear,1) = 0) and (not CheckGearDrowning(Gear)) do
+        Gear^.Y:= Gear^.Y+_1;
+    SetLittle(Gear^.dX);
+    Gear^.dY:= _0
+    end
+else
+    Gear^.State:= Gear^.State or gstMoving;
+
+if (Gear^.State and gstMoving) <> 0 then
+    begin
+    Gear^.State:= Gear^.State and (not gstAnimation);
+// ARTILLERY but not being moved by explosions
+    Gear^.X:= Gear^.X + Gear^.dX;
+    Gear^.Y:= Gear^.Y + Gear^.dY;
+    if (not Gear^.dY.isNegative) and (not TestCollisionYKick(Gear, 1)) 
+    and TestCollisionYwithXYShift(Gear, 0, 1, 1) then
+        begin
+        CheckHHDamage(Gear);
+        Gear^.dY:= _0;
+        Gear^.Y:= Gear^.Y + _1
+        end;
+    CheckGearDrowning(Gear);
+    // hide target cursor if current hog is drowning
+    if (Gear^.State and gstDrowning) <> 0 then
+        if (CurrentHedgehog^.Gear = Gear) then
+            isCursorVisible:= false
+    end;
+if (not isZero(Gear^.dY)) and (Gear^.FlightTime > 0) and ((GameFlags and gfLowGravity) = 0) then
+    begin
+    inc(Gear^.FlightTime);
+    if (Gear^.FlightTime > 1500) and ((hwRound(Gear^.X) < leftX-250) or (hwRound(Gear^.X) > rightX+250))  then
+        begin
+        Gear^.FlightTime:= 0;
+        AddCaption(GetEventString(eidHomerun), cWhiteColor, capgrpMessage);
+        PlaySound(sndHomerun)
+        end;
+    end
+else
+    begin
+    uStats.hedgehogFlight(Gear, Gear^.FlightTime);
+    Gear^.FlightTime:= 0;
+    end;
+
+end;
+
+procedure doStepHedgehogDriven(HHGear: PGear);
+var t: PGear;
+    wasJumping: boolean;
+    Hedgehog: PHedgehog;
+begin
+Hedgehog:= HHGear^.Hedgehog;
+if isInMultiShoot then
+    HHGear^.Message:= 0;
+
+if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Utility) <> 0) and isInMultiShoot then 
+    AllInactive:= true
+else if not isInMultiShoot then
+    AllInactive:= false;
+
+if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) then
+    begin
+    if TagTurnTimeLeft = 0 then
+        TagTurnTimeLeft:= TurnTimeLeft;
+    TurnTimeLeft:= 0;
+    isCursorVisible:= false;
+    HHGear^.State:= HHGear^.State and (not (gstHHDriven or gstAnimation or gstAttacking));
+    AttackBar:= 0;
+    if HHGear^.Damage > 0 then
+        HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump));
+    exit
+    end;
+
+if (HHGear^.State and gstAnimation) <> 0 then
+    begin
+    HHGear^.Message:= 0;
+    if (HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].VoiceDelay) and (HHGear^.Timer = 0) then
+        PlaySoundV(Wavez[TWave(HHGear^.Tag)].Voice, Hedgehog^.Team^.voicepack);
+    inc(HHGear^.Timer);
+    if HHGear^.Timer = Wavez[TWave(HHGear^.Tag)].Interval then
+        begin
+        HHGear^.Timer:= 0;
+        inc(HHGear^.Pos);
+        if HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].FramesCount then
+            HHGear^.State:= HHGear^.State and (not gstAnimation)
+        end;
+    exit
+    end;
+
+if ((HHGear^.State and gstMoving) <> 0)
+or (GHStepTicks = cHHStepTicks)
+or (CurAmmoGear <> nil) then // we are moving
+    begin
+    with Hedgehog^ do
+        if (CurAmmoGear = nil)
+        and (HHGear^.dY > _0_39)
+        and (CurAmmoType = amParachute) then
+            HHGear^.Message:= HHGear^.Message or gmAttack;
+    // check for case with ammo
+    t:= CheckGearNear(HHGear, gtCase, 36, 36);
+    if t <> nil then
+        PickUp(HHGear, t)
+    end;
+
+if (CurAmmoGear = nil) then
+    if (((HHGear^.Message and gmAttack) <> 0)
+    or ((HHGear^.State and gstAttacking) <> 0)) then
+        Attack(HHGear) // should be before others to avoid desync with '/put' msg and changing weapon msgs
+    else
+else 
+    with Hedgehog^ do
+        if ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
+        and ((HHGear^.Message and gmLJump) <> 0)
+        and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
+            begin
+            Attack(HHGear);
+            HHGear^.Message:= HHGear^.Message and (not gmLJump)
+            end;
+
+if (CurAmmoGear = nil)
+or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) 
+or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) then
+    begin
+    if ((HHGear^.Message and gmSlot) <> 0) then
+        if ChangeAmmo(HHGear) then ApplyAmmoChanges(Hedgehog^);
+
+    if ((HHGear^.Message and gmWeapon) <> 0) then
+        HHSetWeapon(HHGear);
+
+    if ((HHGear^.Message and gmTimer) <> 0) then
+        HHSetTimer(HHGear);
+    end;
+
+if CurAmmoGear <> nil then
+    begin
+    CurAmmoGear^.Message:= HHGear^.Message;
+    exit
+    end;
+
+if not isInMultiShoot then
+    HedgehogChAngle(HHGear);
+
+if (HHGear^.State and gstMoving) <> 0 then
+    begin
+    wasJumping:= ((HHGear^.State and gstHHJumping) <> 0);
+
+    if ((HHGear^.Message and gmHJump) <> 0) and wasJumping and ((HHGear^.State and gstHHHJump) = 0) then
+        if (not (hwAbs(HHGear^.dX) > cLittle)) and (HHGear^.dY < -_0_02) then
+            begin
+            HHGear^.State:= HHGear^.State or gstHHHJump;
+            HHGear^.dY:= -_0_25;
+            if not cArtillery then
+                HHGear^.dX:= -SignAs(_0_02, HHGear^.dX);
+            PlaySoundV(sndJump2, Hedgehog^.Team^.voicepack)
+            end;
+
+    HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump));
+
+    if (not cArtillery) and wasJumping and TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
+        SetLittle(HHGear^.dX);
+
+    if Hedgehog^.Gear <> nil then
+        doStepHedgehogMoving(HHGear);
+
+    if ((HHGear^.State and (gstMoving or gstDrowning)) = 0) then
+        begin
+        AddGearCI(HHGear);
+        if wasJumping then
+            GHStepTicks:= 410
+        else
+            GHStepTicks:= 95
+        end;
+    exit
+    end;
+
+    if not isInMultiShoot and (Hedgehog^.Gear <> nil) then
+        begin
+        if GHStepTicks > 0 then
+            dec(GHStepTicks);
+        if (GHStepTicks = 0) then
+            HedgehogStep(HHGear)
+        end
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepHedgehogFree(Gear: PGear);
+var prevState: Longword;
+begin
+prevState:= Gear^.State;
+
+doStepHedgehogMoving(Gear);
+
+if (Gear^.State and (gstMoving or gstDrowning)) <> 0 then
+    begin
+    if Gear^.Damage > 0 then
+        CalcRotationDirAngle(Gear);
+    AllInactive:= false;
+    exit
+    end;
+
+if (Gear^.Health = 0) then
+    begin
+    if PrvInactive or ((GameFlags and gfInfAttack) <> 0) then
+        begin
+        Gear^.Timer:= 0;
+        FollowGear:= Gear;
+        PrvInactive:= false;
+        AllInactive:= false;
+
+        if (Gear^.State and gstHHGone) = 0 then
+            begin
+            Gear^.Hedgehog^.Effects[hePoisoned] := 0;
+            if Gear^.Hedgehog^.Effects[heResurrectable] <> 0 then
+                begin
+                ResurrectHedgehog(Gear);
+                end
+            else 
+                begin
+                Gear^.State:= (Gear^.State or gstHHDeath) and (not gstAnimation);
+                Gear^.doStep:= @doStepHedgehogDead;
+                // Death message
+                AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
+                end;
+            end
+        else
+            begin
+            Gear^.State:= Gear^.State and (not gstAnimation);
+            Gear^.doStep:= @doStepHedgehogGone;
+
+            // Gone message
+            AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
+            end
+        end;
+    exit
+    end;
+
+if ((Gear^.State and gstWait) = 0) and
+    (prevState <> Gear^.State) then
+    begin
+    Gear^.State:= Gear^.State or gstWait;
+    Gear^.Timer:= 150
+    end
+else
+    begin
+    if Gear^.Timer = 0 then
+        begin
+        Gear^.State:= Gear^.State and (not (gstWait or gstLoser or gstWinner or gstAttacked or gstNotKickable or gstHHChooseTarget));
+        Gear^.Active:= false;
+        AddGearCI(Gear);
+        exit
+        end
+    else dec(Gear^.Timer)
+    end;
+
+AllInactive:= false
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+procedure doStepHedgehog(Gear: PGear);
+(*
+var x,y,tx,ty: LongInt;
+    tdX, tdY, slope: hwFloat; 
+    land: Word; *)
+var slope: hwFloat; 
+begin
+CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel;
+if (Gear^.Message and gmDestroy) <> 0 then
+    begin
+    DeleteGear(Gear);
+    exit
+    end;
+
+if (Gear^.State and gstHHDriven) = 0 then
+    doStepHedgehogFree(Gear)
+else
+    begin
+    with Gear^.Hedgehog^ do
+        if Team^.hasGone then
+            TeamGoneEffect(Team^)
+        else
+            doStepHedgehogDriven(Gear)
+    end;
+if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0)
+and (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0)
+and (not Gear^.dY.isNegative) and (GameTicks mod (100*LongWOrd(hwRound(cMaxWindSpeed*2/cGravity))) = 0)
+and (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
+    begin
+    slope:= CalcSlopeBelowGear(Gear);
+    Gear^.dX:=Gear^.dX+slope*_0_07;
+    if slope.QWordValue <> 0 then
+        Gear^.State:= Gear^.State or gstMoving;
+(*
+    x:= hwRound(Gear^.X);
+    y:= hwRound(Gear^.Y);
+    AddVisualGear(x, y, vgtSmokeTrace);
+    AddVisualGear(x - hwRound(_5*slope), y + hwRound(_5*slope), vgtSmokeTrace);
+    AddVisualGear(x + hwRound(_5*slope), y - hwRound(_5*slope), vgtSmokeTrace);
+    AddVisualGear(x - hwRound(_20 * slope), y + hwRound(_20 * slope), vgtSmokeTrace);
+    AddVisualGear(x + hwRound(_20 * slope), y - hwRound(_20 * slope), vgtSmokeTrace);
+    AddVisualGear(x - hwRound(_30 * slope), y + hwRound(_30 * slope), vgtSmokeTrace);
+    AddVisualGear(x + hwRound(_30 * slope), y - hwRound(_30 * slope), vgtSmokeTrace);
+    AddVisualGear(x - hwRound(_40 * slope), y + hwRound(_40 * slope), vgtSmokeTrace);
+    AddVisualGear(x + hwRound(_40 * slope), y - hwRound(_40 * slope), vgtSmokeTrace);
+    AddVisualGear(x - hwRound(_50 * slope), y + hwRound(_50 * slope), vgtSmokeTrace);
+    AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *)
+    end
+end;
+
+end.
diff --git a/hedgewars/uGearsList.pas b/hedgewars/uGearsList.pas
new file mode 100644
index 0000000..2a0cf6d
--- /dev/null
+++ b/hedgewars/uGearsList.pas
@@ -0,0 +1,593 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+unit uGearsList;
+
+interface
+uses uFloat, uTypes;
+
+function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
+procedure DeleteGear(Gear: PGear);
+procedure InsertGearToList(Gear: PGear);
+procedure RemoveGearFromList(Gear: PGear);
+
+var curHandledGear: PGear;
+
+implementation
+
+uses uRandom, uUtils, uConsts, uVariables, uAmmos, uTeams, uStats,
+    uTextures, uScript, uRenderUtils, uAI, uCollisions,
+    uGearsRender, uGearsUtils, uDebug;
+
+var GCounter: LongWord = 0; // this does not get re-initialized, but should be harmless
+
+procedure InsertGearToList(Gear: PGear);
+var tmp, ptmp: PGear;
+begin
+    tmp:= GearsList;
+    ptmp:= GearsList;
+    while (tmp <> nil) and (tmp^.Z < Gear^.Z) do
+        begin
+        ptmp:= tmp;
+        tmp:= tmp^.NextGear
+        end;
+
+    if ptmp <> tmp then
+        begin
+        Gear^.NextGear:= ptmp^.NextGear;
+        Gear^.PrevGear:= ptmp;
+        if ptmp^.NextGear <> nil then
+            ptmp^.NextGear^.PrevGear:= Gear;
+        ptmp^.NextGear:= Gear
+        end
+    else
+        begin
+        Gear^.NextGear:= GearsList;
+        if Gear^.NextGear <> nil then
+            Gear^.NextGear^.PrevGear:= Gear;
+        GearsList:= Gear;
+        end;
+end;
+
+
+procedure RemoveGearFromList(Gear: PGear);
+begin
+TryDo((curHandledGear = nil) or (Gear = curHandledGear), 'You''re doing it wrong', true);
+
+if Gear^.NextGear <> nil then
+    Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
+if Gear^.PrevGear <> nil then
+    Gear^.PrevGear^.NextGear:= Gear^.NextGear
+else
+    GearsList:= Gear^.NextGear
+end;
+
+
+function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
+var gear: PGear;
+begin
+inc(GCounter);
+AddFileLog('AddGear: #' + inttostr(GCounter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind));
+
+New(gear);
+FillChar(gear^, sizeof(TGear), 0);
+gear^.X:= int2hwFloat(X);
+gear^.Y:= int2hwFloat(Y);
+gear^.Target.X:= NoPointX;
+gear^.Kind := Kind;
+gear^.State:= State;
+gear^.Active:= true;
+gear^.dX:= dX;
+gear^.dY:= dY;
+gear^.doStep:= doStepHandlers[Kind];
+gear^.CollisionIndex:= -1;
+gear^.Timer:= Timer;
+gear^.uid:= GCounter;
+gear^.SoundChannel:= -1;
+gear^.ImpactSound:= sndNone;
+gear^.Density:= _1;
+// Define ammo association, if any.
+gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
+gear^.CollisionMask:= $FFFF;
+
+if CurrentHedgehog <> nil then 
+    begin
+    gear^.Hedgehog:= CurrentHedgehog;
+    if (CurrentHedgehog^.Gear <> nil) and (hwRound(CurrentHedgehog^.Gear^.X) = X) and (hwRound(CurrentHedgehog^.Gear^.Y) = Y) then
+        gear^.CollisionMask:= $FF7F
+    end;
+
+if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
+    gear^.Z:= cHHZ+1
+else gear^.Z:= cUsualZ;
+
+    
+case Kind of
+     gtGrenade,
+     gtClusterBomb,
+     gtGasBomb: begin
+                gear^.ImpactSound:= sndGrenadeImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= 5;
+                gear^.Elasticity:= _0_8;
+                gear^.Friction:= _0_8;
+                gear^.Density:= _1_5;
+                gear^.RenderTimer:= true;
+                if gear^.Timer = 0 then
+                    gear^.Timer:= 3000
+                end;
+  gtWatermelon: begin
+                gear^.ImpactSound:= sndMelonImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= 6;
+                gear^.Elasticity:= _0_8;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _2;
+                gear^.RenderTimer:= true;
+                if gear^.Timer = 0 then
+                    gear^.Timer:= 3000
+                end;
+  gtMelonPiece: begin
+                gear^.Density:= _2;
+                end;
+    gtHedgehog: begin
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= cHHRadius;
+                gear^.Elasticity:= _0_35;
+                gear^.Friction:= _0_999;
+                gear^.Angle:= cMaxAngle div 2;
+                gear^.Density:= _3;
+                gear^.Z:= cHHZ;
+                if (GameFlags and gfAISurvival) <> 0 then
+                    if gear^.Hedgehog^.BotLevel > 0 then
+                        gear^.Hedgehog^.Effects[heResurrectable] := 1;
+                end;
+       gtShell: begin
+                gear^.Radius:= 4;
+                gear^.Density:= _1;
+                end;
+       gtSnowball: begin
+                gear^.ImpactSound:= sndMudballImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Radius:= 4;
+                gear^.Elasticity:= _1;
+                gear^.Friction:= _1;
+                gear^.Density:= _0_5;
+                end;
+
+     gtFlake: begin
+                with Gear^ do
+                    begin
+                    Pos:= 0;
+                    Radius:= 1;
+                    DirAngle:= random(360);
+                    if State and gstTmpFlag = 0 then
+                        begin
+                        dx.isNegative:= GetRandom(2) = 0;
+                        dx.QWordValue:= $40DA * GetRandom(10000) * 8;
+                        dy.isNegative:= false;
+                        dy.QWordValue:= $3AD3 * GetRandom(7000) * 8;
+                        if GetRandom(2) = 0 then
+                            dx := -dx
+                        end;
+                    State:= State or gstInvisible;
+                    Health:= random(vobFrameTicks);
+                    Timer:= random(vobFramesCount);
+                    Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
+                    end
+                end;
+       gtGrave: begin
+                gear^.ImpactSound:= sndGraveImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Radius:= 10;
+                gear^.Elasticity:= _0_6;
+                end;
+         gtBee: begin
+                gear^.Radius:= 5;
+                gear^.Timer:= 500;
+                gear^.RenderTimer:= true;
+                gear^.Elasticity:= _0_9;
+                gear^.Tag:= 0;
+                end;
+   gtSeduction: begin
+                gear^.Radius:= 250;
+                end;
+ gtShotgunShot: begin
+                gear^.Timer:= 900;
+                gear^.Radius:= 2
+                end;
+  gtPickHammer: begin
+                gear^.Radius:= 10;
+                gear^.Timer:= 4000
+                end;
+   gtHammerHit: begin
+                gear^.Radius:= 8;
+                gear^.Timer:= 125
+                end;
+        gtRope: begin
+                gear^.Radius:= 3;
+                gear^.Friction:= _450 * _0_01 * cRopePercent;
+                RopePoints.Count:= 0;
+                end;
+        gtMine: begin
+                gear^.ImpactSound:= sndMineImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Health:= 10;
+                gear^.State:= gear^.State or gstMoving;
+                gear^.Radius:= 2;
+                gear^.Elasticity:= _0_55;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _1;
+                if cMinesTime < 0 then
+                    gear^.Timer:= getrandom(51)*100
+                else
+                    gear^.Timer:= cMinesTime;
+                end;
+       gtSMine: begin
+                gear^.Health:= 10;
+                gear^.State:= gear^.State or gstMoving;
+                gear^.Radius:= 2;
+                gear^.Elasticity:= _0_55;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _1_6;
+                gear^.Timer:= 500;
+                end;
+       gtKnife: begin
+                gear^.Density:= _4;
+                gear^.Radius:= 16
+                end;
+        gtCase: begin
+                gear^.ImpactSound:= sndGraveImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Radius:= 16;
+                gear^.Elasticity:= _0_3;
+                gear^.Timer:= 500
+                end;
+  gtExplosives: begin
+                gear^.ImpactSound:= sndGrenadeImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Radius:= 16;
+                gear^.Elasticity:= _0_4;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _6;
+                gear^.Health:= cBarrelHealth;
+                gear^.Z:= cHHZ-1
+                end;
+  gtDEagleShot: begin
+                gear^.Radius:= 1;
+                gear^.Health:= 50
+                end;
+  gtSniperRifleShot: begin
+                gear^.Radius:= 1;
+                gear^.Health:= 50
+                end;
+    gtDynamite: begin
+                gear^.Radius:= 3;
+                gear^.Elasticity:= _0_55;
+                gear^.Friction:= _0_03;
+                gear^.Density:= _2;
+                gear^.Timer:= 5000;
+                end;
+     gtCluster: begin
+                gear^.Radius:= 2;
+                gear^.Density:= _1_5;
+                gear^.RenderTimer:= true
+                end;
+      gtShover: gear^.Radius:= 20;
+       gtFlame: begin
+                gear^.Tag:= GetRandom(32);
+                gear^.Radius:= 1;
+                gear^.Health:= 5;
+                gear^.Density:= _1;
+                if (gear^.dY.QWordValue = 0) and (gear^.dX.QWordValue = 0) then
+                    begin
+                    gear^.dY:= (getrandomf - _0_8) * _0_03;
+                    gear^.dX:= (getrandomf - _0_5) * _0_4
+                    end
+                end;
+   gtFirePunch: begin
+                gear^.Radius:= 15;
+                gear^.Tag:= Y
+                end;
+   gtAirAttack: gear^.Z:= cHHZ+2;
+     gtAirBomb: begin
+                gear^.Radius:= 5;
+                gear^.Density:= _2;
+                end;
+   gtBlowTorch: begin
+                gear^.Radius:= cHHRadius + cBlowTorchC;
+                gear^.Timer:= 7500
+                end;
+    gtSwitcher: begin
+                gear^.Z:= cCurrHHZ
+                end;
+      gtTarget: begin
+                gear^.ImpactSound:= sndGrenadeImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.Radius:= 10;
+                gear^.Elasticity:= _0_3;
+                gear^.Timer:= 0
+                end;
+      gtTardis: begin
+                gear^.Timer:= 0;
+                gear^.Pos:= 1;
+                gear^.Z:= cCurrHHZ+1;
+                end;
+      gtMortar: begin
+                gear^.Radius:= 4;
+                gear^.Elasticity:= _0_2;
+                gear^.Friction:= _0_08;
+                gear^.Density:= _1;
+                end;
+        gtWhip: gear^.Radius:= 20;
+      gtHammer: gear^.Radius:= 20;
+    gtKamikaze: begin
+                gear^.Health:= 2048;
+                gear^.Radius:= 20
+                end;
+        gtCake: begin
+                gear^.Health:= 2048;
+                gear^.Radius:= 7;
+                gear^.Z:= cOnHHZ;
+                gear^.RenderTimer:= true;
+                gear^.DirAngle:= -90 * hwSign(Gear^.dX);
+                if not dX.isNegative then
+                    gear^.Angle:= 1
+                else
+                    gear^.Angle:= 3
+                end;
+ gtHellishBomb: begin
+                gear^.ImpactSound:= sndHellishImpact1;
+                gear^.nImpactSounds:= 4;
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= 4;
+                gear^.Elasticity:= _0_5;
+                gear^.Friction:= _0_96;
+                gear^.Density:= _1_5;
+                gear^.RenderTimer:= true;
+                gear^.Timer:= 5000
+                end;
+       gtDrill: begin
+                if gear^.Timer = 0 then
+                    gear^.Timer:= 5000;
+                // Tag for drill strike. if 1 then first impact occured already
+                gear^.Tag := 0;
+                gear^.Radius:= 4;
+                gear^.Density:= _1;
+                end;
+        gtBall: begin
+                gear^.ImpactSound:= sndGrenadeImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= 5;
+                gear^.Tag:= random(8);
+                gear^.Timer:= 5000;
+                gear^.Elasticity:= _0_7;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _1_5;
+                end;
+     gtBallgun: begin
+                gear^.Timer:= 5001;
+                end;
+     gtRCPlane: begin
+                gear^.Timer:= 15000;
+                gear^.Health:= 3;
+                gear^.Radius:= 8
+                end;
+     gtJetpack: begin
+                gear^.Health:= 2000;
+                gear^.Damage:= 100
+                end;
+     gtMolotov: begin
+                gear^.Radius:= 6;
+                gear^.Density:= _2;
+                end;
+       gtBirdy: begin
+                gear^.Radius:= 16; // todo: check
+                gear^.Timer:= 0;
+                gear^.Health := 2000;
+                gear^.FlightTime := 2;
+                end;
+         gtEgg: begin
+                gear^.Radius:= 4;
+                gear^.Elasticity:= _0_6;
+                gear^.Friction:= _0_96;
+                gear^.Density:= _1;
+                if gear^.Timer = 0 then
+                    gear^.Timer:= 3000
+                end;
+      gtPortal: begin
+                gear^.ImpactSound:= sndMelonImpact;
+                gear^.nImpactSounds:= 1;
+                gear^.AdvBounce:= 0;
+                gear^.Radius:= 17;
+                // set color
+                gear^.Tag:= 2 * gear^.Timer;
+                gear^.Timer:= 15000;
+                gear^.RenderTimer:= false;
+                gear^.Health:= 100;
+                end;
+       gtPiano: begin
+                gear^.Radius:= 32;
+                gear^.Density:= _50;
+                end;
+ gtSineGunShot: begin
+                gear^.Radius:= 5;
+                gear^.Health:= 6000;
+                end;
+gtFlamethrower: begin
+                gear^.Tag:= 10;
+                gear^.Timer:= 10;
+                gear^.Health:= 500;
+                gear^.Damage:= 100;
+                end;
+     gtLandGun: begin
+                gear^.Tag:= 10;
+                gear^.Timer:= 10;
+                gear^.Health:= 1000;
+                gear^.Damage:= 100;
+                end;
+ gtPoisonCloud: begin
+                gear^.Timer:= 5000;
+                gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000;
+                end;
+ gtResurrector: begin
+                gear^.Radius := 100;
+                gear^.Tag := 0
+                end;
+     gtWaterUp: begin
+                gear^.Tag := 47;
+                end;
+  gtNapalmBomb: begin
+                gear^.Timer:= 1000;
+                gear^.Radius:= 5;
+                gear^.Density:= _1_5;
+                end;
+   gtStructure: begin
+                gear^.Elasticity:= _0_55;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _0_9;
+                gear^.Radius:= 13;
+                gear^.Health:= 200;
+                gear^.Timer:= 0;
+                gear^.Tag:= TotalRounds + 3;
+                gear^.Pos:= 1;
+                end;
+      gtIceGun: gear^.Health:= 1000;
+gtGenericFaller:begin
+                gear^.AdvBounce:= 1;
+                gear^.Radius:= 1;
+                gear^.Elasticity:= _0_9;
+                gear^.Friction:= _0_995;
+                gear^.Density:= _1;
+                end;
+    end;
+
+InsertGearToList(gear);
+AddGear:= gear;
+
+ScriptCall('onGearAdd', gear^.uid);
+end;
+
+procedure DeleteGear(Gear: PGear);
+var team: PTeam;
+    t,i: Longword;
+    k: boolean;
+begin
+
+ScriptCall('onGearDelete', gear^.uid);
+
+DeleteCI(Gear);
+
+FreeTexture(Gear^.Tex);
+Gear^.Tex:= nil;
+
+// make sure that portals have their link removed before deletion
+if (Gear^.Kind = gtPortal) then
+    begin
+    if (Gear^.LinkedGear <> nil) then
+        if (Gear^.LinkedGear^.LinkedGear = Gear) then
+            Gear^.LinkedGear^.LinkedGear:= nil;
+    end
+else if Gear^.Kind = gtHedgehog then
+    (*
+    This behaviour dates back to revision 4, and I accidentally encountered it with TARDIS.  I don't think it must apply to any modern weapon, since if it was actually hit, the best the gear could do would be to destroy itself immediately, and you'd still end up with two graves.  I believe it should be removed
+     if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then
+        begin
+        AttackBar:= 0;
+        Gear^.Message:= gmDestroy;
+        CurAmmoGear^.Message:= gmDestroy;
+        exit
+        end
+    else*)
+        begin
+        if (Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtKamikaze) then
+            Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
+        if (hwRound(Gear^.Y) >= cWaterLine) then
+            begin
+            t:= max(Gear^.Damage, Gear^.Health);
+            Gear^.Damage:= t;
+            if ((not SuddenDeathDmg and (WaterOpacity < $FF)) or (SuddenDeathDmg and (WaterOpacity < $FF)))
+            and (hwRound(Gear^.Y) < cWaterLine + 256) then
+                spawnHealthTagForHH(Gear, t);
+            end;
+
+        team:= Gear^.Hedgehog^.Team;
+        if CurrentHedgehog^.Gear = Gear then
+            begin
+            AttackBar:= 0;
+            FreeActionsList; // to avoid ThinkThread on drawned gear
+            if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0)
+            and (CurrentHedgehog^.MultiShootAttacks > 0) then
+                OnUsedAmmo(CurrentHedgehog^);
+            end;
+
+        Gear^.Hedgehog^.Gear:= nil;
+        if Gear^.Hedgehog^.King then
+            begin
+            // are there any other kings left? Just doing nil check.  Presumably a mortally wounded king will get reaped soon enough
+            k:= false;
+            for i:= 0 to Pred(team^.Clan^.TeamsNumber) do
+                if (team^.Clan^.Teams[i]^.Hedgehogs[0].Gear <> nil) then
+                    k:= true;
+            if not k then
+                for i:= 0 to Pred(team^.Clan^.TeamsNumber) do
+                    begin
+                    team^.Clan^.Teams[i]^.hasGone:= true;
+                    TeamGoneEffect(team^.Clan^.Teams[i]^)
+                    end
+            end;
+
+        // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog
+        // same stand for CheckHHDamage
+        if (Gear^.LastDamage <> nil) then
+            uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
+        else
+            uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);
+
+        inc(KilledHHs);
+        RecountTeamHealth(team);
+        if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Effects[heResurrectable] <> 0)  and
+        //(Gear^.Hedgehog^.Effects[heResurrectable] = 0) then
+        (Gear^.Hedgehog^.Team^.Clan <> CurrentHedgehog^.Team^.Clan) then
+            with CurrentHedgehog^ do 
+                begin
+                inc(Team^.stats.AIKills);
+                FreeTexture(Team^.AIKillsTex);
+                Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
+                end
+        end;
+with Gear^ do
+    begin
+    AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind));
+    AddRandomness(X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac)
+    end;
+if CurAmmoGear = Gear then
+    CurAmmoGear:= nil;
+if FollowGear = Gear then
+    FollowGear:= nil;
+if lastGearByUID = Gear then
+    lastGearByUID := nil;
+RemoveGearFromList(Gear);
+Dispose(Gear)
+end;
+
+end.
diff --git a/hedgewars/uGearsRender.pas b/hedgewars/uGearsRender.pas
index a0ba5a0..a9c28b4 100644
--- a/hedgewars/uGearsRender.pas
+++ b/hedgewars/uGearsRender.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,15 +29,15 @@ var RopePoints: record
                 Count: Longword;
                 HookAngle: GLfloat;
                 ar: array[0..MAXROPEPOINTS] of record
-                                  X, Y: hwFloat;
-                                  dLen: hwFloat;
-                                  b: boolean;
-                                  end;
+                                X, Y: hwFloat;
+                                dLen: hwFloat;
+                                b: boolean;
+                                end;
                 rounded: array[0..MAXROPEPOINTS + 2] of TVertex2f;
                 end;
 
 implementation
-uses uRender, uUtils, uVariables, uAmmos, Math;
+uses uRender, uUtils, uVariables, uAmmos, Math, uVisualGears;
 
 procedure DrawRopeLinesRQ(Gear: PGear);
 begin
@@ -74,71 +74,80 @@ if (RopePoints.Count > 0) or (Gear^.Elasticity.QWordValue > 0) then
 end;
 
 
-procedure DrawRope(Gear: PGear);
-var roplen: LongInt;
-    i: Longword;
-
-    procedure DrawRopeLine(X1, Y1, X2, Y2: LongInt);
-    var  eX, eY, dX, dY: LongInt;
-        i, sX, sY, x, y, d: LongInt;
-        b: boolean;
-    begin
+function DrawRopeLine(X1, Y1, X2, Y2, roplen: LongInt): LongInt;
+var  eX, eY, dX, dY: LongInt;
+    i, sX, sY, x, y, d: LongInt;
+    b: boolean;
+begin
     if (X1 = X2) and (Y1 = Y2) then
-    begin
-    //OutError('WARNING: zero length rope line!', false);
-    exit
-    end;
+        begin
+        //OutError('WARNING: zero length rope line!', false);
+        exit
+        end;
     eX:= 0;
     eY:= 0;
     dX:= X2 - X1;
     dY:= Y2 - Y1;
 
-    if (dX > 0) then sX:= 1
+    if (dX > 0) then
+        sX:= 1
     else
-    if (dX < 0) then
-        begin
-        sX:= -1;
-        dX:= -dX
-        end else sX:= dX;
+        if (dX < 0) then
+            begin
+            sX:= -1;
+            dX:= -dX
+            end
+        else sX:= dX;
 
-    if (dY > 0) then sY:= 1
+    if (dY > 0) then 
+        sY:= 1
     else
-    if (dY < 0) then
-        begin
-        sY:= -1;
-        dY:= -dY
-        end else sY:= dY;
+        if (dY < 0) then
+            begin
+            sY:= -1;
+            dY:= -dY
+            end
+        else 
+            sY:= dY;
 
-        if (dX > dY) then d:= dX
-                    else d:= dY;
+    if (dX > dY) then
+        d:= dX
+    else
+        d:= dY;
 
-        x:= X1;
-        y:= Y1;
+    x:= X1;
+    y:= Y1;
 
-        for i:= 0 to d do
+    for i:= 0 to d do
+        begin
+        inc(eX, dX);
+        inc(eY, dY);
+        b:= false;
+        if (eX > d) then
             begin
-            inc(eX, dX);
-            inc(eY, dY);
-            b:= false;
-            if (eX > d) then
-                begin
-                dec(eX, d);
-                inc(x, sX);
-                b:= true
-                end;
-            if (eY > d) then
-                begin
-                dec(eY, d);
-                inc(y, sY);
-                b:= true
-                end;
-            if b then
-                begin
-                inc(roplen);
-                if (roplen mod 4) = 0 then DrawSprite(sprRopeNode, x - 2, y - 2, 0)
-                end
-        end
+            dec(eX, d);
+            inc(x, sX);
+            b:= true
+            end;
+        if (eY > d) then
+            begin
+            dec(eY, d);
+            inc(y, sY);
+            b:= true
+            end;
+        if b then
+            begin
+            inc(roplen);
+            if (roplen mod 4) = 0 then
+                DrawSprite(sprRopeNode, x - 2, y - 2, 0)
+            end
     end;
+DrawRopeLine:= roplen;
+end;
+
+procedure DrawRope(Gear: PGear);
+var roplen: LongInt;
+    i: Longword;
 begin
     if (cReducedQuality and rqSimpleRope) <> 0 then
         DrawRopeLinesRQ(Gear)
@@ -150,26 +159,27 @@ begin
             i:= 0;
             while i < Pred(RopePoints.Count) do
                     begin
-                    DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy,
-                                hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy);
+                    roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy,
+                                hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy, roplen);
                     inc(i)
                     end;
-            DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy,
-                        hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy);
-            DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
-                        hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy);
-            end else
+            roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy,
+                        hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, roplen);
+            roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
+                        hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen);
+            end
+        else
             if Gear^.Elasticity.QWordValue > 0 then
-            DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
-                        hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy);
+            roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
+                        hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen);
         end;
 
 
 if RopePoints.Count > 0 then
-    DrawRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle)
-    else
+    DrawSpriteRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle)
+else
     if Gear^.Elasticity.QWordValue > 0 then
-        DrawRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+        DrawSpriteRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
 end;
 
 
@@ -188,16 +198,18 @@ end;
 procedure DrawHH(Gear: PGear; ox, oy: LongInt);
 var i, t: LongInt;
     amt: TAmmoType;
-    sign, hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
+    sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
     defaultPos, HatVisible: boolean;
     HH: PHedgehog;
     CurWeapon: PAmmo;
 begin
     HH:= Gear^.Hedgehog;
-    if HH^.Unplaced then exit;
+    if HH^.Unplaced then
+        exit;
     m:= 1;
-    if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1;
+    if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then
+        m:= -1;
     sx:= ox + 1; // this offset is very common
     sy:= oy - 3;
     sign:= hwSign(Gear^.dX);
@@ -212,7 +224,7 @@ begin
         end
     else if (Gear^.State and gstHHGone) <> 0 then
         begin
-        DrawRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
+        DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
         exit
         end;
 
@@ -220,10 +232,10 @@ begin
     HatVisible:= false;
 
 
-    if HH^.Effects[hePoisoned] then
+    if HH^.Effects[hePoisoned] <> 0 then
         begin
         Tint($00, $FF, $40, $40);
-        DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
+        DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
         Tint($FF, $FF, $FF, $FF)
         end;
 
@@ -260,10 +272,10 @@ begin
         begin
         if ((Gear^.State and (gstHHThinking or gstAnimation)) = 0) and
 /// If current ammo is active, and current ammo has alt attack and uses a crosshair  (rope, basically, right now, with no crosshair for parachute/saucer
-           (((CurAmmoGear <> nil) and //((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) and
+            (((CurAmmoGear <> nil) and //((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) and
              ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0)) or
 /// If no current ammo is active, and the selected ammo uses a crosshair
-             ((CurAmmoGear = nil) and ((Ammoz[HH^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0) and ((Gear^.State and gstAttacked) = 0))) then
+            ((CurAmmoGear = nil) and ((Ammoz[HH^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0) and ((Gear^.State and gstAttacked) = 0))) then
             begin
     (* These calculations are a little complex for a few reasons:
     1: I need to draw the laser from weapon origin to nearest land
@@ -304,25 +316,34 @@ begin
                     lx:= lx + ax;
                     ly:= ly + ay;
                     tx:= round(lx);
-                    ty:= round(ly)
+                    ty:= round(ly);
+                    if (abs(tx-hx) > 1000) or (abs(hy-ty) > 1000) then
+                        begin
+                        DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
+                        hx:= tx;
+                        hy:= ty
+                        end
                     end;
                 // reached edge of land. assume infinite beam. Extend it way out past camera
                 if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
                     begin
-                    tx:= round(lx + ax * (LAND_WIDTH div 4));
-                    ty:= round(ly + ay * (LAND_WIDTH div 4));
+                    tx:= round(lx + ax * (max(LAND_WIDTH,4096) div 2));
+                    ty:= round(ly + ay * (max(LAND_WIDTH,4096) div 2));
                     end;
 
                 //if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
+                if (tx <> hx) or (ty <> hy) then
                     begin
                     DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0);
                     end;
                 end;
             // draw crosshair
-            cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
-            cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
-            DrawRotatedTex(HH^.Team^.CrosshairTex,
-                    12, 12, cx + WorldDx, cy + WorldDy, 0,
+            CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
+            CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
+ 
+            
+            DrawTextureRotated(HH^.Team^.CrosshairTex,
+                    12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
             end;
         hx:= ox + 8 * sign;
@@ -333,20 +354,20 @@ begin
             case CurAmmoGear^.Kind of
                 gtShotgunShot: begin
                         if (CurAmmoGear^.State and gstAnimation <> 0) then
-                            DrawRotated(sprShotgun, hx, hy, sign, aangle)
+                            DrawSpriteRotated(sprShotgun, hx, hy, sign, aangle)
                         else
-                            DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
+                            DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle);
                     end;
-                gtDEagleShot: DrawRotated(sprDEagle, hx, hy, sign, aangle);
+                gtDEagleShot: DrawSpriteRotated(sprDEagle, hx, hy, sign, aangle);
                 gtSniperRifleShot: begin
                         if (CurAmmoGear^.State and gstAnimation <> 0) then
-                            DrawRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle)
+                            DrawSpriteRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle)
                         else
-                            DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle)
+                            DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle)
                     end;
-                gtBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
+                gtBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
                 gtRCPlane: begin
-                    DrawRotated(sprHandPlane, hx, hy, sign, 0);
+                    DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
                     defaultPos:= false
                     end;
                 gtRope: begin
@@ -355,38 +376,40 @@ begin
                         dAngle:= 0;
                         hAngle:= 180;
                         i:= 1
-                        end else
+                        end
+                    else
                         begin
                         dAngle:= 180;
                         hAngle:= 0;
                         i:= -1
                         end;
-                if ((Gear^.State and gstWinner) = 0) then
-                    begin
-                    DrawHedgehog(ox, oy,
-                            i,
-                            1,
-                            0,
-                            DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
-                    with HH^ do
-                        if (HatTex <> nil) then
-                            begin
-                            DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
-                                i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
-                            if HatTex^.w > 64 then
+                    if ((Gear^.State and gstWinner) = 0) then
+                        begin
+                        DrawHedgehog(ox, oy,
+                                i,
+                                1,
+                                0,
+                                DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
+                        with HH^ do
+                            if (HatTex <> nil) then
                                 begin
-                                Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
-                                DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
+                                DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
-                                Tint($FF, $FF, $FF, $FF)
+                                if HatTex^.w > 64 then
+                                    begin
+                                    Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
+                                    DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
+                                        i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
+                                    Tint($FF, $FF, $FF, $FF)
+                                    end
                                 end
-                            end
                     end;
                     DrawAltWeapon(Gear, ox, oy);
                     defaultPos:= false
                     end;
-                gtBlowTorch: begin
-                    DrawRotated(sprBlowTorch, hx, hy, sign, aangle);
+                gtBlowTorch:
+                    begin
+                    DrawSpriteRotated(sprBlowTorch, hx, hy, sign, aangle);
                     DrawHedgehog(sx, sy,
                             sign,
                             3,
@@ -419,8 +442,9 @@ begin
                             end;
                     defaultPos:= false
                     end;
-                gtShover: DrawRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
-                gtFirePunch: begin
+                gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
+                gtFirePunch:
+                    begin
                     DrawHedgehog(sx, sy,
                             sign,
                             1,
@@ -428,13 +452,15 @@ begin
                             0);
                     defaultPos:= false
                     end;
-                gtPickHammer: begin
+                gtPickHammer:
+                    begin
                     defaultPos:= false;
                     dec(sy,20);
                     end;
                 gtTeleport: defaultPos:= false;
-                gtWhip: begin
-                    DrawRotatedF(sprWhip,
+                gtWhip:
+                    begin
+                    DrawSpriteRotatedF(sprWhip,
                             sx,
                             sy,
                             1,
@@ -442,8 +468,9 @@ begin
                             0);
                     defaultPos:= false
                     end;
-                gtHammer: begin
-                    DrawRotatedF(sprHammer,
+                gtHammer:
+                    begin
+                    DrawSpriteRotatedF(sprHammer,
                             sx,
                             sy,
                             1,
@@ -451,11 +478,13 @@ begin
                             0);
                     defaultPos:= false
                     end;
-                gtResurrector: begin
-                    DrawRotated(sprHandResurrector, sx, sy, 0, 0);
+                gtResurrector:
+                    begin
+                    DrawSpriteRotated(sprHandResurrector, sx, sy, 0, 0);
                     defaultPos:= false
                     end;
-                gtKamikaze: begin
+                gtKamikaze:
+                    begin
                     if CurAmmoGear^.Pos = 0 then
                         DrawHedgehog(sx, sy,
                                 sign,
@@ -463,14 +492,15 @@ begin
                                 6,
                                 0)
                     else
-                        DrawRotatedF(sprKamikaze,
+                        DrawSpriteRotatedF(sprKamikaze,
                                 ox, oy,
                                 CurAmmoGear^.Pos - 1,
                                 sign,
                                 aangle);
                     defaultPos:= false
                     end;
-                gtSeduction: begin
+                gtSeduction:
+                    begin
                     if CurAmmoGear^.Pos >= 6 then
                         DrawHedgehog(sx, sy,
                                 sign,
@@ -479,7 +509,7 @@ begin
                                 0)
                     else
                         begin
-                        DrawRotatedF(sprDress,
+                        DrawSpriteRotatedF(sprDress,
                                 ox, oy,
                                 CurAmmoGear^.Pos,
                                 sign,
@@ -488,12 +518,21 @@ begin
                         end;
                     defaultPos:= false
                     end;
-                gtFlamethrower: begin
-                    DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
-                    if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
+                gtFlamethrower:
+                    begin
+                    DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
+                    if CurAmmoGear^.Tex <> nil then
+                        DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
+                    end;
+                gtLandGun:
+                    begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                    if CurAmmoGear^.Tex <> nil then
+                        DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
                     end;
-                gtLandGun: begin DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
-                    if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
+                gtIceGun:
+                    begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                    if CurAmmoGear^.Tex <> nil then
+                        DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
                     end;
             end;
 
@@ -501,12 +540,9 @@ begin
                 gtShotgunShot,
                 gtDEagleShot,
                 gtSniperRifleShot,
-                gtShover: begin
-                    DrawHedgehog(sx, sy,
-                            sign,
-                            0,
-                            4,
-                            0);
+                gtShover:
+                    begin
+                    DrawHedgehog(sx, sy, sign, 0, 4, 0);
                     defaultPos:= false;
                     HatVisible:= true
                 end
@@ -540,11 +576,11 @@ begin
             begin
             if (TWave(Gear^.Tag) < Low(TWave)) or (TWave(Gear^.Tag) > High(TWave)) then
                 begin
-                Gear^.State:= Gear^.State and not gstAnimation;
+                Gear^.State:= Gear^.State and (not gstAnimation);
                 end
             else
                 begin
-                DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
+                DrawSpriteRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
                         sx,
                         sy,
                         Gear^.Pos,
@@ -559,54 +595,61 @@ begin
             if HH^.Timer > 0 then
                 begin
                 // There must be a tidier way to do this. Anyone?
-                if aangle <= 90 then aangle:= aangle+360;
-                if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10)
-                else aangle:= aangle+((240-aangle)*HH^.Timer/10);
+                if aangle <= 90 then
+                    aangle:= aangle+360;
+                if Gear^.dX > _0 then
+                    aangle:= aangle-((aangle-240)*HH^.Timer/10)
+                else
+                    aangle:= aangle+((240-aangle)*HH^.Timer/10);
                 dec(HH^.Timer)
                 end;
             amt:= CurrentHedgehog^.CurAmmoType;
-            CurWeapon:= GetAmmoEntry(HH^);
+            CurWeapon:= GetCurAmmoEntry(HH^);
             case amt of
-                amBazooka: DrawRotated(sprHandBazooka, hx, hy, sign, aangle);
-                amSnowball: DrawRotated(sprHandSnowball, hx, hy, sign, aangle);
-                amMortar: DrawRotated(sprHandMortar, hx, hy, sign, aangle);
-                amMolotov: DrawRotated(sprHandMolotov, hx, hy, sign, aangle);
-                amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
-                amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle);
-                amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle);
-                amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
-                amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle);
-                amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle);
-                amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
-                                DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
-                        else
-                                DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
-                amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
-                amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, sign, aangle);
-                amCake: DrawRotated(sprHandCake, hx, hy, sign, aangle);
-                amGrenade: DrawRotated(sprHandGrenade, hx, hy, sign, aangle);
-                amWatermelon: DrawRotated(sprHandMelon, hx, hy, sign, aangle);
-                amSkip: DrawRotated(sprHandSkip, hx, hy, sign, aangle);
-                amClusterBomb: DrawRotated(sprHandCluster, hx, hy, sign, aangle);
-                amDynamite: DrawRotated(sprHandDynamite, hx, hy, sign, aangle);
-                amHellishBomb: DrawRotated(sprHandHellish, hx, hy, sign, aangle);
-                amGasBomb: DrawRotated(sprHandCheese, hx, hy, sign, aangle);
-                amMine: DrawRotated(sprHandMine, hx, hy, sign, aangle);
-                amSMine: DrawRotated(sprHandSMine, hx, hy, sign, aangle);
+                amBazooka: DrawSpriteRotated(sprHandBazooka, hx, hy, sign, aangle);
+                amSnowball: DrawSpriteRotated(sprHandSnowball, hx, hy, sign, aangle);
+                amMortar: DrawSpriteRotated(sprHandMortar, hx, hy, sign, aangle);
+                amMolotov: DrawSpriteRotated(sprHandMolotov, hx, hy, sign, aangle);
+                amBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                amDrill: DrawSpriteRotated(sprHandDrill, hx, hy, sign, aangle);
+                amRope: DrawSpriteRotated(sprHandRope, hx, hy, sign, aangle);
+                amShotgun: DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle);
+                amDEagle: DrawSpriteRotated(sprHandDEagle, hx, hy, sign, aangle);
+                amSineGun: DrawSpriteRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle);
+                
+                amPortalGun:
+                    if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
+                        DrawSpriteRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
+                    else
+                        DrawSpriteRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
+                        
+                amSniperRifle: DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
+                amBlowTorch: DrawSpriteRotated(sprHandBlowTorch, hx, hy, sign, aangle);
+                amCake: DrawSpriteRotated(sprHandCake, hx, hy, sign, aangle);
+                amGrenade: DrawSpriteRotated(sprHandGrenade, hx, hy, sign, aangle);
+                amWatermelon: DrawSpriteRotated(sprHandMelon, hx, hy, sign, aangle);
+                amSkip: DrawSpriteRotated(sprHandSkip, hx, hy, sign, aangle);
+                amClusterBomb: DrawSpriteRotated(sprHandCluster, hx, hy, sign, aangle);
+                amDynamite: DrawSpriteRotated(sprHandDynamite, hx, hy, sign, aangle);
+                amHellishBomb: DrawSpriteRotated(sprHandHellish, hx, hy, sign, aangle);
+                amGasBomb: DrawSpriteRotated(sprHandCheese, hx, hy, sign, aangle);
+                amMine: DrawSpriteRotated(sprHandMine, hx, hy, sign, aangle);
+                amSMine: DrawSpriteRotated(sprHandSMine, hx, hy, sign, aangle);
+                amKnife: DrawSpriteRotatedF(sprHandKnife, hx, hy, 0, sign, aangle);
                 amSeduction: begin
-                             DrawRotated(sprHandSeduction, hx, hy, sign, aangle);
+                             DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle);
                              DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); 
                              //Tint($FF, $0, $0, $AA);
                              //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10);
                              //Tint($FF, $FF, $FF, $FF);
                              end;
-                amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
+                amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
                 amRCPlane: begin
-                    DrawRotated(sprHandPlane, hx, hy, sign, 0);
+                    DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
                     defaultPos:= false
                     end;
                 amGirder: begin
-                    DrawRotated(sprHandConstruction, hx, hy, sign, aangle);
+                    DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle);
                     DrawSpriteClipped(sprGirder,
                                     ox-256,
                                     oy-256,
@@ -615,34 +658,35 @@ begin
                                     cWaterLine+WorldDy,
                                     LongInt(leftX)+WorldDx)
                     end;
-                amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
-                amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
-                amLandGun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
+                amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
+                amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
+                amLandGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
+                amIceGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
                 amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here
             end;
 
             case amt of
                 amAirAttack,
                 amMineStrike,
-                amDrillStrike: DrawRotated(sprHandAirAttack, sx, oy, sign, 0);
+                amDrillStrike: DrawSpriteRotated(sprHandAirAttack, sx, oy, sign, 0);
                 amPickHammer: DrawHedgehog(sx, sy,
                             sign,
                             1,
                             2,
                             0);
-                amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, sign, 0);
+                amTeleport: DrawSpriteRotatedF(sprTeleport, sx, sy, 0, sign, 0);
                 amKamikaze: DrawHedgehog(sx, sy,
                             sign,
                             1,
                             5,
                             0);
-                amWhip: DrawRotatedF(sprWhip,
+                amWhip: DrawSpriteRotatedF(sprWhip,
                             sx,
                             sy,
                             0,
                             sign,
                             0);
-                amHammer: DrawRotatedF(sprHammer,
+                amHammer: DrawSpriteRotatedF(sprHammer,
                             sx,
                             sy,
                             0,
@@ -670,7 +714,7 @@ begin
             end;
 
             case amt of
-                amBaseballBat: DrawRotated(sprHandBaseball,
+                amBaseballBat: DrawSpriteRotated(sprHandBaseball,
                         sx - 4 * sign,
                         sy + 9, sign, aangle);
             end;
@@ -706,7 +750,7 @@ begin
         begin
         if defaultPos then
             begin
-            DrawRotatedF(sprHHIdle,
+            DrawSpriteRotatedF(sprHHIdle,
                 sx,
                 sy,
                 (RealTicks div 128 + Gear^.Pos) mod 19,
@@ -790,11 +834,15 @@ begin
                         DrawSprite(sprJetpack, sx-32, sy-32, 0);
                         if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then
                             begin
-                            if (CurAmmoGear^.MsgParam and gmUp) <> 0 then DrawSprite(sprJetpack, sx-32, sy-28, 1);
-                            if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then DrawSprite(sprJetpack, sx-28, sy-28, 2);
-                            if (CurAmmoGear^.MsgParam and gmRight) <> 0 then DrawSprite(sprJetpack, sx-36, sy-28, 3)
+                            if (CurAmmoGear^.MsgParam and gmUp) <> 0 then
+                                DrawSprite(sprJetpack, sx-32, sy-28, 1);
+                            if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then
+                                DrawSprite(sprJetpack, sx-28, sy-28, 2);
+                            if (CurAmmoGear^.MsgParam and gmRight) <> 0 then
+                                DrawSprite(sprJetpack, sx-36, sy-28, 3)
                             end;
-                        if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex);
+                        if CurAmmoGear^.Tex <> nil then
+                            DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
                         DrawAltWeapon(Gear, sx, sy)
                         end;
                 end;
@@ -803,7 +851,7 @@ begin
 
     with HH^ do
         begin
-        if ((Gear^.State and not gstWinner) = 0)
+        if ((Gear^.State and (not gstWinner)) = 0)
             or ((Gear^.State = gstWait) and (Gear^.dY.QWordValue = 0))
             or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
             begin
@@ -813,17 +861,17 @@ begin
             if ((cTagsMask and htHealth) <> 0) then
                 begin
                 dec(t, HealthTagTex^.h + 2);
-                DrawCentered(ox, t, HealthTagTex)
+                DrawTextureCentered(ox, t, HealthTagTex)
                 end;
             if (cTagsMask and htName) <> 0 then
                 begin
                 dec(t, NameTagTex^.h + 2);
-                DrawCentered(ox, t, NameTagTex)
+                DrawTextureCentered(ox, t, NameTagTex)
                 end;
             if (cTagsMask and htTeamName) <> 0 then
                 begin
                 dec(t, Team^.NameTagTex^.h + 2);
-                DrawCentered(ox, t, Team^.NameTagTex)
+                DrawTextureCentered(ox, t, Team^.NameTagTex)
                 end;
             if (cTagsMask and htTransparent) <> 0 then
                 Tint($FF, $FF, $FF, $FF)
@@ -831,7 +879,7 @@ begin
         if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
             begin
             if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then
-                DrawCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
+                DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
 
             if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
                 DrawSprite(sprFinger, ox - 16, oy - 64,
@@ -843,12 +891,12 @@ begin
             end
         end;
 
-    if HH^.Effects[hePoisoned] then
+    if HH^.Effects[hePoisoned] <> 0 then
         begin
         Tint($00, $FF, $40, $80);
-        DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
+        DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
         end;
-    if HH^.Effects[heResurrected] then
+    if HH^.Effects[heResurrected] <> 0 then
         begin
         Tint($f5, $db, $35, $20);
         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
@@ -873,55 +921,54 @@ end;
 procedure RenderGear(Gear: PGear; x, y: LongInt);
 var
     HHGear: PGear;
+    vg: PVisualGear;
     i: Longword;
+    aAngle: real;
     startX, endX, startY, endY: LongInt;
 begin
     if Gear^.Target.X <> NoPointX then
         if Gear^.AmmoType = amBee then
-            DrawRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
-        else
-            DrawRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+            DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+	else if Gear^.AmmoType = amIceGun then
+	    //DrawSprite(sprSnowDust, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8)
+        //DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360)
+        DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1/(1+(RealTicks shr 8) mod 5), 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360)
+    else
+        DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
 
     case Gear^.Kind of
-          gtGrenade: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle);
-      gtSnowball: DrawRotated(sprSnowball, x, y, 0, Gear^.DirAngle);
-       gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle);
+          gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle);
+      gtSnowball: DrawSpriteRotated(sprSnowball, x, y, 0, Gear^.DirAngle);
+       gtGasBomb: DrawSpriteRotated(sprCheese, x, y, 0, Gear^.DirAngle);
                   
        gtMolotov: if (Gear^.State and gstDrowning) = 0 then
-                       DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX))
+                       DrawSpriteRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX))
                   else DrawSprite(sprMolotov, x, y, 8);
 
        gtRCPlane: begin
+                  aangle:= Gear^.Angle * 360 / 4096;
+                  if Gear^.Tag < 0 then aangle:= 360-aangle;
                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
-                  if Gear^.Tag = -1 then
-                      begin
-                      DrawRotatedF(sprPlane, x, y, 0, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90);
-                      Tint($FF, $FF, $FF, $FF);
-                      DrawRotatedF(sprPlane, x, y, 1, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90)
-                      end
-                  else
-                      begin
-                      DrawRotatedF(sprPlane, x, y, 0, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
-                      Tint($FF, $FF, $FF, $FF);
-                      DrawRotatedF(sprPlane, x, y, 1, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
-                      end
+                  DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
+                  Tint($FF, $FF, $FF, $FF);
+                  DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
                   end;
-       gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
+       gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
 
        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
-                 or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked?
-                 or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving?
-                      DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
-                 else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
+                 or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked?
+                 or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving?
+                      DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
+                 else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
 
            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
-                        DrawRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
+                        DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
                     else
-                        DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+                        DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
 
         gtHedgehog: DrawHH(Gear, x, y);
 
-           gtShell: DrawRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+           gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
 
            gtGrave: begin
                     DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32);
@@ -934,52 +981,72 @@ begin
                         Tint($FF, $FF, $FF, $FF)
                         end
                     end;
-             gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+             gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
             gtRope: DrawRope(Gear);
+            
             gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
-                           DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
-                       else if Gear^.Health <> 0 then DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
-                       else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
+                           DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
+                       else if Gear^.Health <> 0 then
+                           DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
+                       else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
+                       
            gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
-                           DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
-                       else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
-                       else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
-            gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then
+                           DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
+                       else if Gear^.Health <> 0 then
+                           DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
+                       else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
+           gtKnife: DrawSpriteRotatedF(sprKnife, x, y, 0, hwSign(Gear^.dX), Gear^.DirAngle);
+                       
+            gtCase: begin
+                    if Gear^.Timer > 1000 then
                         begin
-                        i:= (GameTicks shr 6) mod 64;
-                        if i > 18 then i:= 0;
-                        DrawSprite(sprCase, x - 24, y - 24, i);
-                        end
-                    else if ((Gear^.Pos and posCaseHealth) <> 0) then
+                        if ((Gear^.Pos and posCaseAmmo) <> 0) then
+                            begin
+                            i:= (GameTicks shr 6) mod 64;
+                            if i > 18 then
+                                i:= 0;
+                            DrawSprite(sprCase, x - 24, y - 24, i);
+                            end
+                        else if ((Gear^.Pos and posCaseHealth) <> 0) then
+                            begin
+                            i:= ((GameTicks shr 6) + 38) mod 64;
+                            if i > 13 then
+                                i:= 0;
+                            DrawSprite(sprFAid, x - 24, y - 24, i);
+                            end
+                        else if ((Gear^.Pos and posCaseUtility) <> 0) then
+                            begin
+                            i:= (GameTicks shr 6) mod 70;
+                            if i > 23 then
+                                i:= 0;
+                            i:= i mod 12;
+                            DrawSprite(sprUtility, x - 24, y - 24, i);
+                            end;
+                        end;
+                    if Gear^.Timer < 1833 then
                         begin
-                        i:= ((GameTicks shr 6) + 38) mod 64;
-                        if i > 13 then i:= 0;
-                        DrawSprite(sprFAid, x - 24, y - 24, i);
+                        DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0,
+                                            x, LongInt(Gear^.Angle) + WorldDy - 16, 4 + Gear^.Tag, 1, 32, 32, 270);
                         end
-                    else if ((Gear^.Pos and posCaseUtility) <> 0) then
-                        begin
-                        i:= (GameTicks shr 6) mod 70;
-                        if i > 23 then i:= 0;
-                        i:= i mod 12;
-                        DrawSprite(sprUtility, x - 24, y - 24, i);
-                        end;
+                    end;
       gtExplosives: begin
                     if ((Gear^.State and gstDrowning) <> 0) then
                         DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0)
                     else if Gear^.State and gstAnimation = 0 then
                         begin
                         i:= (GameTicks shr 6 + Gear^.uid*3) mod 64;
-                        if i > 18 then i:= 0;
+                        if i > 18 then
+                            i:= 0;
                         DrawSprite(sprExplosives, x - 24, y - 24, i)
                         end
                     else if Gear^.State and gsttmpFlag = 0 then
-                        DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle)
+                        DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle)
                     else
-                        DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle);
+                        DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle);
                     end;
-        gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
-     gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
+        gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
+     gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
            gtFlame: if Gear^.Tag and 1 = 0 then
                          DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16)
@@ -990,15 +1057,16 @@ begin
                     end;
        gtAirAttack: begin
                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
-                    DrawRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
+                    DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
                     Tint($FF, $FF, $FF, $FF);
-                    DrawRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
+                    DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
                     end;
-         gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+         gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
         gtTeleport: begin
                     HHGear:= Gear^.Hedgehog^.Gear;
-                    if not Gear^.Hedgehog^.Unplaced then DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
-                    DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
+                    if not Gear^.Hedgehog^.Unplaced then
+                        DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
+                    DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
                     end;
         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
           gtTarget: begin
@@ -1006,15 +1074,17 @@ begin
                     DrawSprite(sprTarget, x - 16, y - 16, 0);
                     Tint($FF, $FF, $FF, $FF);
                     end;
-          gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+          gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
           gtCake: if Gear^.Pos = 6 then
-                     DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
+                     DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
                   else
-                     DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90);
-       gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0);
-      gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle);
-      gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle);
-     gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle);
+                     DrawSpriteRotatedF(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90);
+       gtSeduction: if Gear^.Pos >= 14 then
+           DrawSprite(sprSeduction, x - 16, y - 16, 0);
+           
+      gtWatermelon: DrawSpriteRotatedF(sprWatermelon, x, y, 0, 0, Gear^.DirAngle);
+      gtMelonPiece: DrawSpriteRotatedF(sprWatermelon, x, y, 1, 0, Gear^.DirAngle);
+     gtHellishBomb: DrawSpriteRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle);
            gtBirdy: begin
                     if Gear^.State and gstAnimation = gstAnimation then
                         begin
@@ -1023,9 +1093,9 @@ begin
                             endX:= x - WorldDx;
                             endY:= y - WorldDy;
                             if Gear^.Tag < 0 then
-                                startX:= max(LAND_WIDTH + 1024, endX + 2048)
+                                startX:= max(max(LAND_WIDTH,4096) + 1024, endX + 2048)
                             else
-                                startX:= max(-LAND_WIDTH - 1024, endX - 2048);
+                                startX:= max(-max(LAND_WIDTH,4096) - 1024, endX - 2048);
                             startY:= endY - 256;
                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2)))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
                             end
@@ -1034,9 +1104,9 @@ begin
                             startX:= x - WorldDx;
                             startY:= y - WorldDy;
                             if Gear^.Tag > 0 then
-                                endX:= max(LAND_WIDTH + 1024, startX + 2048)
+                                endX:= max(max(LAND_WIDTH,4096) + 1024, startX + 2048)
                             else
-                                endX:= max(-LAND_WIDTH - 1024, startX - 2048);
+                                endX:= max(-max(LAND_WIDTH,4096) - 1024, startX - 2048);
                             endY:= startY + 256;
                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY))) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
                             end;
@@ -1049,7 +1119,7 @@ begin
                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
                         end;
                     end;
-             gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle);
+             gtEgg: DrawTextureRotatedF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle);
            gtPiano: begin
                     if (Gear^.State and gstDrowning) = 0 then
                         begin
@@ -1067,61 +1137,96 @@ begin
                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
                     else
                         Tint($C0, $C0, $00, $C0);
-                    DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
+                    DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
                     Tint($FF, $FF, $FF, $FF)
                     end;
      gtResurrector: begin
-                    DrawRotated(sprCross, x, y, 0, 0);
+                    DrawSpriteRotated(sprCross, x, y, 0, 0);
                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
                     Tint($FF, $FF, $FF, $FF);
                     end;
-      gtNapalmBomb: DrawRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
+      gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
                         begin
-                        Tint((cExplosionBorderColor shr RShift) and $FF, 
-                             (cExplosionBorderColor shr GShift) and $FF, 
-                             (cExplosionBorderColor shr BShift) and $FF, 
+                        Tint((ExplosionBorderColor shr RShift) and $FF, 
+                             (ExplosionBorderColor shr GShift) and $FF, 
+                             (ExplosionBorderColor shr BShift) and $FF, 
                              $FF);
                         // Needs a nicer white texture to tint
-                        DrawRotatedTextureF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
-                        //DrawRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
+                        DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
+                        //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
                         Tint($FF, $FF, $FF, $FF);
                         end
                     else //if not isInLag then
                         begin
-                        if isInLag and (Gear^.FlightTime < 256) then inc(Gear^.FlightTime, 8)
-                        else if not isInLag and (Gear^.FlightTime > 0) then dec(Gear^.FlightTime, 8);
-                        if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime));
+                        if isInLag and (Gear^.FlightTime < 256) then
+                            inc(Gear^.FlightTime, 8)
+                        else if not isInLag and (Gear^.FlightTime > 0) then
+                            dec(Gear^.FlightTime, 8);
+                        if Gear^.FlightTime > 0 then
+                            Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime));
                         if vobVelocity = 0 then
                             DrawSprite(sprFlake, x, y, Gear^.Timer)
                         else
-                            DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
+                            DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
-//DrawRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
-                        if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF);
+//DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
+                        if Gear^.FlightTime > 0 then
+                            Tint($FF, $FF, $FF, $FF);
                         end;
        gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
           gtTardis: if Gear^.Pos <> 4 then
                         begin
-                        if Gear^.Pos = 2 then Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF)
-                        else Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
+                        if Gear^.Pos = 2 then
+                            Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF)
+                        else 
+                            Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
                         DrawSprite(sprTardis, x-24, y-63,0);
-                        if Gear^.Pos = 2 then Tint($FF, $FF, $FF, $FF)
-			else Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
+                        if Gear^.Pos = 2 then
+                            Tint($FF, $FF, $FF, $FF)
+                        else
+                            Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
                         DrawSprite(sprTardis, x-24, y-63,1);
-                        if Gear^.Pos <> 2 then Tint($FF, $FF, $FF, $FF)
+                        if Gear^.Pos <> 2 then
+                            Tint($FF, $FF, $FF, $FF)
 (*
                         Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250))));
                         DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25);
                         Tint($FF, $FF, $FF, $FF)
 *)
                         end;
-
-
+            gtIceGun: begin
+                      HHGear := Gear^.Hedgehog^.Gear;
+                      if HHGear <> nil then
+                          begin
+                          i:= hwRound(hwSqr(Gear^.X - HHGear^.X) + hwSqr(Gear^.Y - HHGear^.Y));
+                          if RealTicks mod max(1,50 - (round(sqrt(i)) div 4)) = 0 then // experiment in "intensifying" might not get used
+                            begin
+                            vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
+                            if vg <> nil then
+                                begin
+                                i:= random(100) + 155;
+                                vg^.Tint:= i shl 24 or i shl 16 or $FF shl 8 or Longword(random(200) + 55);
+                                vg^.Angle:= random(360);
+                                vg^.dx:= 0.001 * random(80);
+                                vg^.dy:= 0.001 * random(80)
+                                end
+                            end;
+                          if RealTicks mod 2 = 0 then
+                                begin
+                                i:= random(100)+100;
+                                if Gear^.Target.X <> NoPointX then
+                                    DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40)
+                                else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40);
+                                end
+                          end
+                      end;
+            gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF);  // debug
          end;
-      if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(x + 8, y + 8, Gear^.Tex);
+      if Gear^.RenderTimer and (Gear^.Tex <> nil) then
+          DrawTextureCentered(x + 8, y + 8, Gear^.Tex);
 end;
 
 end.
diff --git a/hedgewars/uGearsUtils.pas b/hedgewars/uGearsUtils.pas
new file mode 100644
index 0000000..2c23467
--- /dev/null
+++ b/hedgewars/uGearsUtils.pas
@@ -0,0 +1,759 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uGearsUtils;
+interface
+uses uTypes;
+
+procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword); inline;
+procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword; const Tint: LongWord); 
+
+function  ModifyDamage(dmg: Longword; Gear: PGear): Longword;
+procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
+procedure spawnHealthTagForHH(HHGear: PGear; dmg: Longword);
+procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource);
+procedure CheckHHDamage(Gear: PGear);
+procedure CalcRotationDirAngle(Gear: PGear);
+procedure ResurrectHedgehog(gear: PGear);
+
+procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt); inline;
+procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt; skipProximity: boolean);
+
+function  CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear;
+function  CheckGearDrowning(Gear: PGear): boolean;
+procedure CheckCollision(Gear: PGear); inline;
+procedure CheckCollisionWithLand(Gear: PGear); inline;
+
+function MakeHedgehogsStep(Gear: PGear) : boolean;
+
+var doStepHandlers: array[TGearType] of TGearStepProcedure;
+
+
+implementation
+uses uFloat, uSound, uCollisions, uUtils, uConsts, uVisualGears, uAIMisc,
+    uVariables, uLandGraphics, uScript, uStats, uCaptions, uTeams, uStore,
+    uLocale, uTextures, uRenderUtils, uRandom, SDLh, uDebug, uGears,
+    uGearsList, Math;
+
+procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword); inline;
+begin
+    doMakeExplosion(X, Y, Radius, AttackingHog, Mask, $FFFFFFFF);
+end;
+
+procedure doMakeExplosion(X, Y, Radius: LongInt; AttackingHog: PHedgehog; Mask: Longword; const Tint: LongWord);
+var Gear: PGear;
+    dmg, dmgBase: LongInt;
+    fX, fY, tdX, tdY: hwFloat;
+    vg: PVisualGear;
+    i, cnt: LongInt;
+begin
+if Radius > 4 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');
+if Radius > 25 then KickFlakes(Radius, X, Y);
+
+if ((Mask and EXPLNoGfx) = 0) then
+    begin
+    vg:= nil;
+    if Radius > 50 then vg:= AddVisualGear(X, Y, vgtBigExplosion)
+    else if Radius > 10 then vg:= AddVisualGear(X, Y, vgtExplosion);
+    if vg <> nil then
+        vg^.Tint:= Tint;
+    end;
+if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);
+
+(*if (Mask and EXPLAllDamageInRadius) = 0 then
+    dmgRadius:= Radius shl 1
+else
+    dmgRadius:= Radius;
+dmgBase:= dmgRadius + cHHRadius div 2;*)
+dmgBase:= Radius shl 1 + cHHRadius div 2;
+fX:= int2hwFloat(X);
+fY:= int2hwFloat(Y);
+Gear:= GearsList;
+while Gear <> nil do
+    begin
+    dmg:= 0;
+    //dmg:= dmgRadius  + cHHRadius div 2 - hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
+    //if (dmg > 1) and
+    if (Gear^.State and gstNoDamage) = 0 then
+        begin
+        case Gear^.Kind of
+            gtHedgehog,
+                gtMine,
+                gtBall,
+                gtMelonPiece,
+                gtGrenade,
+                gtClusterBomb,
+            //    gtCluster, too game breaking I think
+                gtSMine,
+                gtCase,
+                gtTarget,
+                gtFlame,
+                gtKnife,
+                gtExplosives,
+                gtStructure: begin
+// Run the calcs only once we know we have a type that will need damage
+                        tdX:= Gear^.X-fX;
+                        tdY:= Gear^.Y-fY;
+                        if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
+                            dmg:= dmgBase - hwRound(Distance(tdX, tdY));
+                        if dmg > 1 then
+                            begin
+                            dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
+                            //AddFileLog('Damage: ' + inttostr(dmg));
+                            if (Mask and EXPLNoDamage) = 0 then
+                                begin
+                                if not Gear^.Invulnerable then
+                                    ApplyDamage(Gear, AttackingHog, dmg, dsExplosion)
+                                else
+                                    Gear^.State:= Gear^.State or gstWinner;
+                                end;
+                            if ((Mask and EXPLDoNotTouchAny) = 0) and (((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog)) then
+                                begin
+                                DeleteCI(Gear);
+                                Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, tdX)/(Gear^.Density/_3);
+                                Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, tdY)/(Gear^.Density/_3);
+
+                                Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser);
+                                if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and (not gstCollision);
+                                if not Gear^.Invulnerable then
+                                    Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
+                                Gear^.Active:= true;
+                                if Gear^.Kind <> gtFlame then FollowGear:= Gear
+                                end;
+                            if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) then
+                                Gear^.Hedgehog^.Effects[hePoisoned] := 1;
+                            end;
+
+                        end;
+                gtGrave: begin
+// Run the calcs only once we know we have a type that will need damage
+                        tdX:= Gear^.X-fX;
+                        tdY:= Gear^.Y-fY;
+                        if LongInt(tdX.Round + tdY.Round + 2) < dmgBase then
+                            dmg:= dmgBase - hwRound(Distance(tdX, tdY));
+                        if dmg > 1 then
+                            begin
+                            dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);
+                            Gear^.dY:= - _0_004 * dmg;
+                            Gear^.Active:= true
+                            end
+                        end;
+            end;
+        end;
+    Gear:= Gear^.NextGear
+    end;
+
+if (Mask and EXPLDontDraw) = 0 then
+    if (GameFlags and gfSolidLand) = 0 then
+        begin
+        cnt:= DrawExplosion(X, Y, Radius) div 1608; // approx 2 16x16 circles to erase per chunk
+        if (cnt > 0) and (SpritesData[sprChunk].Texture <> nil) then
+            for i:= 0 to cnt do
+                AddVisualGear(X, Y, vgtChunk)
+        end;
+
+uAIMisc.AwareOfExplosion(0, 0, 0)
+end;
+
+function ModifyDamage(dmg: Longword; Gear: PGear): Longword;
+var i: hwFloat;
+begin
+(* Invulnerability cannot be placed in here due to still needing kicks
+   Not without a new damage machine.
+   King check should be in here instead of ApplyDamage since Tiy wants them kicked less
+*)
+i:= _1;
+if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then
+    i:= _1_5;
+if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King) then
+    ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5)
+else
+    ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent)
+end;
+
+procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
+var s: shortstring;
+    vampDmg, tmpDmg, i: Longword;
+    vg: PVisualGear;
+begin
+    if Damage = 0 then
+        exit; // nothing to apply
+
+    if (Gear^.Kind = gtHedgehog) then
+        begin
+        Gear^.LastDamage := AttackerHog;
+
+        Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
+        HHHurt(Gear^.Hedgehog, Source);
+        AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), Damage, Gear^.Hedgehog^.Team^.Clan^.Color);
+        tmpDmg:= min(Damage, max(0,Gear^.Health-Gear^.Damage));
+        if (Gear <> CurrentHedgehog^.Gear) and (CurrentHedgehog^.Gear <> nil) and (tmpDmg >= 1) then
+            begin
+            if cVampiric then
+                begin
+                vampDmg:= hwRound(int2hwFloat(tmpDmg)*_0_8);
+                if vampDmg >= 1 then
+                    begin
+                    // was considering pulsing on attack, Tiy thinks it should be permanent while in play
+                    //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric;
+                    inc(CurrentHedgehog^.Gear^.Health,vampDmg);
+                    str(vampDmg, s);
+                    s:= '+' + s;
+                    AddCaption(s, CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
+                    RenderHealth(CurrentHedgehog^);
+                    RecountTeamHealth(CurrentHedgehog^.Team);
+                    i:= 0;
+                    while i < vampDmg do
+                        begin
+                        vg:= AddVisualGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), vgtStraightShot);
+                        if vg <> nil then
+                            with vg^ do
+                                begin
+                                Tint:= $FF0000FF;
+                                State:= ord(sprHealth)
+                                end;
+                        inc(i, 5);
+                        end;
+                    end
+                end;
+        if ((GameFlags and gfKarma) <> 0) and 
+        ((GameFlags and gfInvulnerable) = 0)
+        and (not CurrentHedgehog^.Gear^.Invulnerable) then
+            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
+            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
+            CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
+            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
+            end;
+        uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);    
+        end;
+    end
+    else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
+        Gear^.Hedgehog:= AttackerHog;
+    inc(Gear^.Damage, Damage);
+    
+    ScriptCall('onGearDamage', Gear^.UID, Damage);
+end;
+
+procedure spawnHealthTagForHH(HHGear: PGear; dmg: Longword);
+var tag: PVisualGear;
+begin
+tag:= AddVisualGear(hwRound(HHGear^.X), hwRound(HHGear^.Y), vgtHealthTag, dmg);
+if (tag <> nil) then
+    tag^.Hedgehog:= HHGear^.Hedgehog; // the tag needs the tag to determine the text color
+AllInactive:= false;
+HHGear^.Active:= true;
+end;
+    
+procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource);
+begin
+if (Source = dsFall) or (Source = dsExplosion) then
+    case random(3) of
+        0: PlaySoundV(sndOoff1, Hedgehog^.Team^.voicepack);
+        1: PlaySoundV(sndOoff2, Hedgehog^.Team^.voicepack);
+        2: PlaySoundV(sndOoff3, Hedgehog^.Team^.voicepack);
+    end
+else if (Source = dsPoison) then
+    case random(2) of
+        0: PlaySoundV(sndPoisonCough, Hedgehog^.Team^.voicepack);
+        1: PlaySoundV(sndPoisonMoan, Hedgehog^.Team^.voicepack);
+    end
+else
+    case random(4) of
+        0: PlaySoundV(sndOw1, Hedgehog^.Team^.voicepack);
+        1: PlaySoundV(sndOw2, Hedgehog^.Team^.voicepack);
+        2: PlaySoundV(sndOw3, Hedgehog^.Team^.voicepack);
+        3: PlaySoundV(sndOw4, Hedgehog^.Team^.voicepack);
+    end
+end;
+
+procedure CheckHHDamage(Gear: PGear);
+var 
+    dmg: Longword;
+    i: LongInt;
+    particle: PVisualGear;
+begin
+    if _0_4 < Gear^.dY then
+        begin
+        dmg := ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear);
+        PlaySound(sndBump);
+        if dmg < 1 then
+            exit;
+
+        for i:= min(12, (3 + dmg div 10)) downto 0 do
+            begin
+            particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
+            if particle <> nil then
+                particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480);
+            end;
+
+        if (Gear^.Invulnerable) then
+            exit;
+
+        //if _0_6 < Gear^.dY then
+        //    PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack)
+        //else
+        //    PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack);
+
+        if Gear^.LastDamage <> nil then
+            ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall)
+        else
+            ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall);
+    end
+end;
+
+
+procedure CalcRotationDirAngle(Gear: PGear);
+var 
+    dAngle: real;
+begin
+    // Frac/Round to be kind to JS as of 2012-08-27 where there is yet no int64/uint64
+    //dAngle := (Gear^.dX.QWordValue + Gear^.dY.QWordValue) / $80000000;
+    dAngle := (Gear^.dX.Round + Gear^.dY.Round) / 2 + (Gear^.dX.Frac/$100000000+Gear^.dY.Frac/$100000000);
+    if not Gear^.dX.isNegative then
+        Gear^.DirAngle := Gear^.DirAngle + dAngle
+    else
+        Gear^.DirAngle := Gear^.DirAngle - dAngle;
+
+    if Gear^.DirAngle < 0 then
+        Gear^.DirAngle := Gear^.DirAngle + 360
+    else if 360 < Gear^.DirAngle then
+        Gear^.DirAngle := Gear^.DirAngle - 360
+end;
+
+function CheckGearDrowning(Gear: PGear): boolean;
+var 
+    skipSpeed, skipAngle, skipDecay: hwFloat;
+    i, maxDrops, X, Y: LongInt;
+    vdX, vdY: real;
+    particle, splash: PVisualGear;
+    isSubmersible: boolean;
+begin
+    // probably needs tweaking. might need to be in a case statement based upon gear type
+    Y:= hwRound(Gear^.Y);
+    if cWaterLine < Y + Gear^.Radius then
+        begin
+        if Gear^.State and gstInvisible <> 0 then
+            begin
+            if Gear^.Kind = gtGenericFaller then
+                begin
+                Gear^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX);
+                Gear^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY);
+                Gear^.dX:= _90-(GetRandomf*_360);
+                Gear^.dY:= _90-(GetRandomf*_360)
+                end
+            else DeleteGear(Gear);
+            exit
+            end;
+        isSubmersible:= (Gear = CurrentHedgehog^.Gear) and (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack);
+        skipSpeed := _0_25;
+        skipAngle := _1_9;
+        skipDecay := _0_87;
+        X:= hwRound(Gear^.X);
+        vdX:= hwFloat2Float(Gear^.dX);
+        vdY:= hwFloat2Float(Gear^.dY);
+        // this could perhaps be a tiny bit higher.
+        if  (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed)
+        and (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then
+            begin
+            Gear^.dY.isNegative := true;
+            Gear^.dY := Gear^.dY * skipDecay;
+            Gear^.dX := Gear^.dX * skipDecay;
+            CheckGearDrowning := false;
+            PlaySound(sndSkip)
+            end
+        else
+            begin
+            if not isSubmersible then
+                begin
+                CheckGearDrowning := true;
+                Gear^.State := gstDrowning;
+                Gear^.RenderTimer := false;
+                if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot)
+                and (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then
+                    if Gear^.Kind = gtHedgehog then
+                        begin
+                        if Gear^.Hedgehog^.Effects[heResurrectable] <> 0 then
+                            ResurrectHedgehog(Gear)
+                        else
+                            begin
+                            Gear^.doStep := @doStepDrowningGear;
+                            Gear^.State := Gear^.State and (not gstHHDriven);
+                            AddCaption(Format(GetEventString(eidDrowned), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
+                            end
+                        end
+                    else
+                        Gear^.doStep := @doStepDrowningGear;
+                        if Gear^.Kind = gtFlake then
+                            exit // skip splashes 
+                end;
+            if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
+            or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
+            and (CurAmmoGear^.dY < _0_01))) then
+                if Gear^.Density * Gear^.dY > _1 then
+                    PlaySound(sndSplash)
+                else if Gear^.Density * Gear^.dY > _0_5 then 
+                    PlaySound(sndSkip)
+                else
+                    PlaySound(sndDroplet2);
+            end;
+
+        if ((cReducedQuality and rqPlainSplash) = 0)
+        and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
+        or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
+        and (CurAmmoGear^.dY < _0_01)))) then
+            begin
+            splash:= AddVisualGear(X, cWaterLine, vgtSplash);
+            if splash <> nil then 
+                with splash^ do
+                begin
+                Scale:= hwFloat2Float(Gear^.Density / _3 * Gear^.dY);
+                if Scale > 1 then Scale:= power(Scale,0.3333)
+                else Scale:= Scale + ((1-Scale) / 2);
+                if Scale > 1 then Timer:= round(min(Scale*0.0005/cGravityf,4))
+                else Timer:= 1;
+                // Low Gravity
+                FrameTicks:= FrameTicks*Timer;
+                end;
+
+            maxDrops := (hwRound(Gear^.Density) * 3) div 2 + round(vdX * hwRound(Gear^.Density) * 6) + round(vdY * hwRound(Gear^.Density) * 6);
+            for i:= max(maxDrops div 3, min(32, Random(maxDrops))) downto 0 do
+                begin
+                particle := AddVisualGear(X - 3 + Random(7), cWaterLine, vgtDroplet);
+                if particle <> nil then
+                    with particle^ do
+                        begin
+                        dX := dX - vdX / 10;
+                        dY := dY - vdY / 5;
+                        if splash <> nil then
+                            begin
+                            if splash^.Scale > 1 then 
+                                begin
+                                dX:= dX * power(splash^.Scale,0.3333); // tone down the droplet height further
+                                dY:= dY * power(splash^.Scale, 0.3333)
+                                end
+                            else 
+                                begin
+                                dX:= dX * splash^.Scale;
+                                dY:= dY * splash^.Scale
+                                end
+                            end
+                        end
+                end
+            end;
+        if isSubmersible and (CurAmmoGear^.Pos = 0) then
+            CurAmmoGear^.Pos := 1000
+        end
+    else
+        CheckGearDrowning := false;
+end;
+
+
+procedure ResurrectHedgehog(gear: PGear);
+var tempTeam : PTeam;
+    sparkles: PVisualGear;
+    gX, gY: LongInt;
+begin
+    if (Gear^.LastDamage <> nil) then
+        uStats.HedgehogDamaged(Gear, Gear^.LastDamage, 0, true)
+    else
+        uStats.HedgehogDamaged(Gear, CurrentHedgehog, 0, true);
+    AttackBar:= 0;
+    gear^.dX := _0;
+    gear^.dY := _0;
+    gear^.Damage := 0;
+    gear^.Health := gear^.Hedgehog^.InitialHealth;
+    gear^.Hedgehog^.Effects[hePoisoned] := 0;
+    if (CurrentHedgehog^.Effects[heResurrectable] = 0) or ((CurrentHedgehog^.Effects[heResurrectable] <> 0)
+          and (Gear^.Hedgehog^.Team^.Clan <> CurrentHedgehog^.Team^.Clan)) then
+        with CurrentHedgehog^ do 
+            begin
+            inc(Team^.stats.AIKills);
+            FreeTexture(Team^.AIKillsTex);
+            Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
+            end;
+    tempTeam := gear^.Hedgehog^.Team;
+    DeleteCI(gear);
+    gX := hwRound(gear^.X);
+    gY := hwRound(gear^.Y);
+    // might need more sparkles for a column
+    sparkles:= AddVisualGear(gX, gY, vgtDust, 1);
+    if sparkles <> nil then
+        begin
+        sparkles^.Tint:= tempTeam^.Clan^.Color shl 8 or $FF;
+        //sparkles^.Angle:= random(360);
+        end;
+    FindPlace(gear, false, 0, LAND_WIDTH, true); 
+    if gear <> nil then
+        begin
+        AddVisualGear(hwRound(gear^.X), hwRound(gear^.Y), vgtExplosion);
+        PlaySound(sndWarp);
+        RenderHealth(gear^.Hedgehog^);
+        ScriptCall('onGearResurrect', gear^.uid);
+        gear^.State := gstWait;
+    end;
+    RecountTeamHealth(tempTeam);
+end;
+
+function CountNonZeroz(x, y, r, c: LongInt; mask: LongWord): LongInt;
+var i: LongInt;
+    count: LongInt = 0;
+begin
+    if (y and LAND_HEIGHT_MASK) = 0 then
+        for i:= max(x - r, 0) to min(x + r, LAND_WIDTH - 4) do
+            if Land[y, i] and mask <> 0 then
+            begin
+                inc(count);
+                if count = c then
+                begin
+                    CountNonZeroz:= count;
+                    exit
+                end;
+            end;
+    CountNonZeroz:= count;
+end;
+
+
+function NoGearsToAvoid(mX, mY: LongInt; rX, rY: LongInt): boolean;
+var t: PGear;
+begin
+NoGearsToAvoid:= false;
+t:= GearsList;
+rX:= sqr(rX);
+rY:= sqr(rY);
+while t <> nil do
+    begin
+    if t^.Kind <= gtExplosives then
+        if not (hwSqr(int2hwFloat(mX) - t^.X) / rX + hwSqr(int2hwFloat(mY) - t^.Y) / rY > _1) then
+            exit;
+    t:= t^.NextGear
+    end;
+NoGearsToAvoid:= true
+end;
+
+procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt); inline;
+begin
+    FindPlace(Gear, withFall, Left, Right, false);
+end;
+
+procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt; skipProximity: boolean);
+var x: LongInt;
+    y, sy: LongInt;
+    ar: array[0..511] of TPoint;
+    ar2: array[0..1023] of TPoint;
+    cnt, cnt2: Longword;
+    delta: LongInt;
+    ignoreNearObjects, ignoreOverlap, tryAgain: boolean;
+begin
+ignoreNearObjects:= false; // try not skipping proximity at first
+ignoreOverlap:= false; // this not only skips proximity, but allows overlapping objects (barrels, mines, hogs, crates).  Saving it for a 3rd pass.  With this active, winning AI Survival goes back to virtual impossibility
+tryAgain:= true;
+while tryAgain do
+    begin
+    delta:= 250;
+    cnt2:= 0;
+    repeat
+        x:= Left + LongInt(GetRandom(Delta));
+        repeat
+            inc(x, Delta);
+            cnt:= 0;
+            y:= min(1024, topY) - 2 * Gear^.Radius;
+            while y < cWaterLine do
+                begin
+                repeat
+                    inc(y, 2);
+                until (y >= cWaterLine) or
+                        (not ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or 
+                        (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) = 0));
+
+                sy:= y;
+
+                repeat
+                    inc(y);
+                until (y >= cWaterLine) or
+                        (not ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or 
+                        (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FF00) <> 0)); 
+
+                if (y - sy > Gear^.Radius * 2)
+                    and (((Gear^.Kind = gtExplosives)
+                    and (y < cWaterLine)
+                    and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))
+                    and (CountNonZeroz(x, y+1, Gear^.Radius - 1, Gear^.Radius+1, $FFFF) > Gear^.Radius))
+                or
+                    ((Gear^.Kind <> gtExplosives)
+                    and (y < cWaterLine)
+                    and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 110, 110))
+                    )) then
+                    begin
+                    ar[cnt].X:= x;
+                    if withFall then
+                        ar[cnt].Y:= sy + Gear^.Radius
+                    else
+                        ar[cnt].Y:= y - Gear^.Radius;
+                    inc(cnt)
+                    end;
+
+                inc(y, 10)
+                end;
+
+            if cnt > 0 then
+                with ar[GetRandom(cnt)] do
+                    begin
+                    ar2[cnt2].x:= x;
+                    ar2[cnt2].y:= y;
+                    inc(cnt2)
+                    end
+        until (x + Delta > Right);
+
+        dec(Delta, 60)
+    until (cnt2 > 0) or (Delta < 70);
+    // if either of these has not been tried, do another pass
+    if (cnt2 = 0) and skipProximity and (not ignoreOverlap) then
+        tryAgain:= true
+    else tryAgain:= false;
+    if ignoreNearObjects then ignoreOverlap:= true;
+    ignoreNearObjects:= true;
+    end;
+
+if cnt2 > 0 then
+    with ar2[GetRandom(cnt2)] do
+        begin
+        Gear^.X:= int2hwFloat(x);
+        Gear^.Y:= int2hwFloat(y);
+        AddFileLog('Assigned Gear coordinates (' + inttostr(x) + ',' + inttostr(y) + ')');
+        end
+    else
+    begin
+    OutError('Can''t find place for Gear', false);
+    if Gear^.Kind = gtHedgehog then
+        Gear^.Hedgehog^.Effects[heResurrectable] := 0;
+    DeleteGear(Gear);
+    Gear:= nil
+    end
+end;
+
+function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear;
+var t: PGear;
+begin
+t:= GearsList;
+rX:= sqr(rX);
+rY:= sqr(rY);
+
+while t <> nil do
+    begin
+    if (t <> Gear) and (t^.Kind = Kind) then
+        if not((hwSqr(Gear^.X - t^.X) / rX + hwSqr(Gear^.Y - t^.Y) / rY) > _1) then
+        begin
+            CheckGearNear:= t;
+            exit;
+        end;
+    t:= t^.NextGear
+    end;
+
+CheckGearNear:= nil
+end;
+
+procedure CheckCollision(Gear: PGear); inline;
+begin
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX))
+    or (TestCollisionYwithGear(Gear, hwSign(Gear^.dY)) <> 0) then
+        Gear^.State := Gear^.State or gstCollision
+    else
+        Gear^.State := Gear^.State and (not gstCollision)
+end;
+
+procedure CheckCollisionWithLand(Gear: PGear); inline;
+begin
+    if TestCollisionX(Gear, hwSign(Gear^.dX))
+    or TestCollisionY(Gear, hwSign(Gear^.dY)) then
+        Gear^.State := Gear^.State or gstCollision
+    else 
+        Gear^.State := Gear^.State and (not gstCollision)
+end;
+
+function MakeHedgehogsStep(Gear: PGear) : boolean;
+begin
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then if (TestCollisionYwithGear(Gear, -1) = 0) then
+        begin
+        Gear^.Y:= Gear^.Y - _1;
+        if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
+            Gear^.Y:= Gear^.Y + _6
+        end else Gear^.Y:= Gear^.Y + _5 else
+        end else Gear^.Y:= Gear^.Y + _4 else
+        end else Gear^.Y:= Gear^.Y + _3 else
+        end else Gear^.Y:= Gear^.Y + _2 else
+        end else Gear^.Y:= Gear^.Y + _1
+        end;
+
+    if not TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
+        begin
+        Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX);
+        MakeHedgehogsStep:= true
+        end else
+        MakeHedgehogsStep:= false;
+
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y + _1;
+    if TestCollisionYwithGear(Gear, 1) = 0 then
+        begin
+        Gear^.Y:= Gear^.Y - _6;
+        Gear^.dY:= _0;
+        Gear^.State:= Gear^.State or gstMoving;
+        exit
+        end;
+        end
+        end
+        end
+        end
+        end
+        end;
+end;
+
+end.
diff --git a/hedgewars/uIO.pas b/hedgewars/uIO.pas
index 650e7ed..b704553 100644
--- a/hedgewars/uIO.pas
+++ b/hedgewars/uIO.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,6 +25,7 @@ uses SDLh, uTypes;
 procedure initModule;
 procedure freeModule;
 
+procedure InitIPC;
 procedure SendIPC(s: shortstring);
 procedure SendIPCXY(cmd: char; X, Y: SmallInt);
 procedure SendIPCRaw(p: pointer; len: Longword);
@@ -34,8 +35,6 @@ procedure LoadRecordFromFile(fileName: shortstring);
 procedure SendStat(sit: TStatInfoType; s: shortstring);
 procedure IPCWaitPongEvent;
 procedure IPCCheckSock;
-procedure InitIPC;
-procedure CloseIPC;
 procedure NetGetNextCmd;
 procedure doPut(putX, putY: LongInt; fromAI: boolean);
 
@@ -56,6 +55,7 @@ type PCmd = ^TCmd;
 var IPCSock: PTCPSocket;
     fds: PSDLNet_SocketSet;
     isPonged: boolean;
+    SocketString: shortstring;
 
     headcmd: PCmd;
     lastcmd: PCmd;
@@ -71,14 +71,15 @@ command^.loTime:= Time;
 command^.str:= str;
 if command^.cmd <> 'F' then dec(command^.len, 2); // cut timestamp
 if headcmd = nil then
-   begin
-   headcmd:= command;
-   lastcmd:= command
-   end else
-   begin
-   lastcmd^.Next:= command;
-   lastcmd:= command
-   end;
+    begin
+    headcmd:= command;
+    lastcmd:= command
+    end
+else
+    begin
+    lastcmd^.Next:= command;
+    lastcmd:= command
+    end;
 AddCmd:= command;
 end;
 
@@ -88,7 +89,8 @@ begin
 TryDo(headcmd <> nil, 'Engine bug: headcmd = nil', true);
 tmp:= headcmd;
 headcmd:= headcmd^.Next;
-if headcmd = nil then lastcmd:= nil;
+if headcmd = nil then
+    lastcmd:= nil;
 dispose(tmp)
 end;
 
@@ -102,26 +104,19 @@ begin
     WriteLnToConsole(msgOK);
     WriteToConsole('Establishing IPC connection to tcp 127.0.0.1:' + IntToStr(ipcPort) + ' ');
     {$HINTS OFF}
-    SDLTry(SDLNet_ResolveHost(ipaddr, '127.0.0.1', ipcPort) = 0, true);
+    SDLTry(SDLNet_ResolveHost(ipaddr, PChar('127.0.0.1'), ipcPort) = 0, true);
     {$HINTS ON}
     IPCSock:= SDLNet_TCP_Open(ipaddr);
     SDLTry(IPCSock <> nil, true);
     WriteLnToConsole(msgOK)
 end;
 
-procedure CloseIPC;
-begin
-    SDLNet_FreeSocketSet(fds);
-    SDLNet_TCP_Close(IPCSock);
-    SDLNet_Quit();
-end;
-
 procedure ParseIPCCommand(s: shortstring);
 var loTicks: Word;
 begin
 case s[1] of
      '!': begin AddFileLog('Ping? Pong!'); isPonged:= true; end;
-     '?': SendIPC('!');
+     '?': SendIPC(_S'!');
      'e': ParseCommand(copy(s, 2, Length(s) - 1), true);
      'E': OutError(copy(s, 2, Length(s) - 1), true);
      'W': OutError(copy(s, 2, Length(s) - 1), false);
@@ -131,7 +126,12 @@ case s[1] of
                'D': GameType:= gmtDemo;
                'N': GameType:= gmtNet;
                'S': GameType:= gmtSave;
+               'V': GameType:= gmtRecord;
                else OutError(errmsgIncorrectUse + ' IPC "T" :' + s[2], true) end;
+     'V': begin
+              if s[2] = '.' then
+                  ParseCommand('campvar ' + copy(s, 3, length(s) - 2), true);
+          end
      else
      loTicks:= SDLNet_Read16(@s[byte(s[0]) - 1]);
      AddCmd(loTicks, s);
@@ -140,30 +140,30 @@ case s[1] of
 end;
 
 procedure IPCCheckSock;
-const ss: shortstring = '';
 var i: LongInt;
-    buf: array[0..255] of byte;
-    s: shortstring absolute buf;
+    s: shortstring;
 begin
-if IPCSock = nil then
-   exit;
+    if IPCSock = nil then
+        exit;
 
-fds^.numsockets:= 0;
-SDLNet_AddSocket(fds, IPCSock);
+    fds^.numsockets:= 0;
+    SDLNet_AddSocket(fds, IPCSock);
 
-while SDLNet_CheckSockets(fds, 0) > 0 do
+    while SDLNet_CheckSockets(fds, 0) > 0 do
     begin
-    i:= SDLNet_TCP_Recv(IPCSock, @buf[1], 255 - Length(ss));
-    if i > 0 then
+        i:= SDLNet_TCP_Recv(IPCSock, @s[1], 255 - Length(SocketString));
+        if i > 0 then
         begin
-        buf[0]:= i;
-        ss:= ss + s;
-        while (Length(ss) > 1) and (Length(ss) > byte(ss[1])) do
+            s[0]:= char(i);
+            SocketString:= SocketString + s;
+            while (Length(SocketString) > 1) and (Length(SocketString) > byte(SocketString[1])) do
             begin
-            ParseIPCCommand(copy(ss, 2, byte(ss[1])));
-            Delete(ss, 1, Succ(byte(ss[1])))
+                ParseIPCCommand(copy(SocketString, 2, byte(SocketString[1])));
+                Delete(SocketString, 1, Succ(byte(SocketString[1])))
             end
-        end else OutError('IPC connection lost', true)
+        end
+    else
+        OutError('IPC connection lost', true)
     end;
 end;
 
@@ -171,8 +171,7 @@ procedure LoadRecordFromFile(fileName: shortstring);
 var f: file;
     ss: shortstring = '';
     i: LongInt;
-    buf: array[0..255] of byte;
-    s: shortstring absolute buf;
+    s: shortstring;
 begin
 
 // set RDNLY on file open
@@ -184,12 +183,12 @@ reset(f, 1);
 tryDo(IOResult = 0, 'Error opening file ' + fileName, true);
 
 i:= 0; // avoid compiler hints
-buf[0]:= 0;
+s[0]:= #0;
 repeat
-    BlockRead(f, buf[1], 255 - Length(ss), i);
+    BlockRead(f, s[1], 255 - Length(ss), i);
     if i > 0 then
         begin
-        buf[0]:= i;
+        s[0]:= char(i);
         ss:= ss + s;
         while (Length(ss) > 1)and(Length(ss) > byte(ss[1])) do
             begin
@@ -204,7 +203,7 @@ close(f)
 end;
 
 procedure SendStat(sit: TStatInfoType; s: shortstring);
-const stc: array [TStatInfoType] of char = 'rDkKHTPsSB';
+const stc: array [TStatInfoType] of char = ('r', 'D', 'k', 'K', 'H', 'T', 'P', 's', 'S', 'B');
 var buf: shortstring;
 begin
 buf:= 'i' + stc[sit] + s;
@@ -217,7 +216,9 @@ begin
 if IPCSock <> nil then
     begin
     SendEmptyPacketTicks:= 0;
-    if s[0]>#251 then s[0]:= #251;
+    if s[0]>#251 then
+        s[0]:= #251;
+        
     SDLNet_Write16(GameTicks, @s[Succ(byte(s[0]))]);
     AddFileLog('[IPC out] '+ s[1]);
     inc(s[0], 2);
@@ -228,9 +229,9 @@ end;
 procedure SendIPCRaw(p: pointer; len: Longword);
 begin
 if IPCSock <> nil then
-   begin
-   SDLNet_TCP_Send(IPCSock, p, len)
-   end
+    begin
+    SDLNet_TCP_Send(IPCSock, p, len)
+    end
 end;
 
 procedure SendIPCXY(cmd: char; X, Y: SmallInt);
@@ -247,15 +248,15 @@ procedure IPCWaitPongEvent;
 begin
 isPonged:= false;
 repeat
-   IPCCheckSock;
-   SDL_Delay(1)
+    IPCCheckSock;
+    SDL_Delay(1)
 until isPonged
 end;
 
 procedure SendIPCAndWaitReply(s: shortstring);
 begin
 SendIPC(s);
-SendIPC('?');
+SendIPC(_S'?');
 IPCWaitPongEvent
 end;
 
@@ -263,7 +264,7 @@ procedure SendKeepAliveMessage(Lag: Longword);
 begin
 inc(SendEmptyPacketTicks, Lag);
 if (SendEmptyPacketTicks >= cSendEmptyPacketTime) then
-    SendIPC('+')
+    SendIPC(_S'+')
 end;
 
 procedure NetGetNextCmd;
@@ -307,28 +308,29 @@ while (headcmd <> nil)
         'c': begin
             s:= copy(headcmd^.str, 2, Pred(headcmd^.len));
             ParseCommand('gencmd ' + s, true);
-            end;
+             end;
         's': begin
             s:= copy(headcmd^.str, 2, Pred(headcmd^.len));
             ParseCommand('chatmsg ' + s, true);
             WriteLnToConsole(s)
-            end;
+             end;
         'b': begin
             s:= copy(headcmd^.str, 2, Pred(headcmd^.len));
-            ParseCommand('chatmsg '#4 + s, true);
+            ParseCommand('chatmsg ' + #4 + s, true);
             WriteLnToConsole(s)
-            end;
+             end;
 // TODO: deprecate 'F'
         'F': ParseCommand('teamgone ' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true);
         'N': begin
             tmpflag:= false;
+            lastTurnChecksum:= SDLNet_Read32(@headcmd^.str[2]);
             AddFileLog('got cmd "N": time '+IntToStr(hiTicks shl 16 + headcmd^.loTime))
-            end;
+             end;
         'p': begin
             x16:= SDLNet_Read16(@(headcmd^.X));
             y16:= SDLNet_Read16(@(headcmd^.Y));
             doPut(x16, y16, false)
-            end;
+             end;
         'P': begin
             // these are equations solved for CursorPoint
             // SDLNet_Read16(@(headcmd^.X)) == CursorPoint.X - WorldDx;
@@ -338,14 +340,16 @@ while (headcmd <> nil)
                CursorPoint.X:= SmallInt(SDLNet_Read16(@(headcmd^.X))) + WorldDx;
                CursorPoint.Y:= cScreenHeight - SmallInt(SDLNet_Read16(@(headcmd^.Y))) - WorldDy
                end
-            end;
+             end;
         'w': ParseCommand('setweap ' + headcmd^.str[2], true);
         't': ParseCommand('taunt ' + headcmd^.str[2], true);
         'h': ParseCommand('hogsay ' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true);
         '1'..'5': ParseCommand('timer ' + headcmd^.cmd, true);
-        #128..char(128 + cMaxSlotIndex): ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true)
         else
-            OutError('Unexpected protocol command: ' + headcmd^.cmd, True)
+            if (headcmd^.cmd >= #128) and (headcmd^.cmd <= char(128 + cMaxSlotIndex)) then
+                ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true)
+                else
+                OutError('Unexpected protocol command: ' + headcmd^.cmd, True)
         end;
     RemoveCmd
     end;
@@ -369,7 +373,8 @@ end;
 
 procedure doPut(putX, putY: LongInt; fromAI: boolean);
 begin
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused then
+    exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven and bShowAmmoMenu then
     begin
@@ -388,7 +393,8 @@ with CurrentHedgehog^.Gear^,
                 begin
                 TargetPoint.X:= putX;
                 TargetPoint.Y:= putY
-                end else
+                end
+            else
                 begin
                 TargetPoint.X:= CursorPoint.X - WorldDx;
                 TargetPoint.Y:= cScreenHeight - CursorPoint.Y - WorldDy;
@@ -401,7 +407,7 @@ with CurrentHedgehog^.Gear^,
             TargetPoint.Y:= putY
             end;
         AddFileLog('put: ' + inttostr(TargetPoint.X) + ', ' + inttostr(TargetPoint.Y));
-        State:= State and not gstHHChooseTarget;
+        State:= State and (not gstHHChooseTarget);
         if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackingPut) <> 0 then
             Message:= Message or (gmAttack and InputMask);
         end
@@ -412,21 +418,25 @@ end;
 
 procedure initModule;
 begin
-    RegisterVariable('fatal', vtCommand, @chFatalError, true );
+    RegisterVariable('fatal', @chFatalError, true );
 
     IPCSock:= nil;
 
     headcmd:= nil;
     lastcmd:= nil;
-    isPonged:= false;   // was const
-
+    isPonged:= false;
+    SocketString:= '';
+    
     hiTicks:= 0;
     SendEmptyPacketTicks:= 0;
 end;
 
 procedure freeModule;
 begin
-while headcmd <> nil do RemoveCmd
+    while headcmd <> nil do RemoveCmd;
+    SDLNet_FreeSocketSet(fds);
+    SDLNet_TCP_Close(IPCSock);
+    SDLNet_Quit();
 end;
 
 end.
diff --git a/hedgewars/uInputHandler.pas b/hedgewars/uInputHandler.pas
new file mode 100644
index 0000000..ea1a85b
--- /dev/null
+++ b/hedgewars/uInputHandler.pas
@@ -0,0 +1,457 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uInputHandler;
+interface
+uses SDLh, uTypes;
+
+procedure initModule;
+procedure freeModule;
+
+function  KeyNameToCode(name: shortstring): LongInt; inline;
+function  KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt;
+//procedure MaskModifier(var code: LongInt; modifier: LongWord);
+procedure MaskModifier(Modifier: shortstring; var code: LongInt);
+procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
+procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
+procedure ProcessKey(code: LongInt; KeyDown: boolean);
+
+procedure ResetKbd;
+procedure FreezeEnterKey;
+procedure InitKbdKeyTable;
+
+procedure SetBinds(var binds: TBinds);
+procedure SetDefaultBinds;
+
+procedure ControllerInit;
+procedure ControllerAxisEvent(joy, axis: Byte; value: Integer);
+procedure ControllerHatEvent(joy, hat, value: Byte);
+procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
+
+implementation
+uses uConsole, uCommands, uMisc, uVariables, uConsts, uUtils, uDebug;
+
+const
+    LSHIFT = $0200;
+    RSHIFT = $0400;
+    LALT   = $0800;
+    RALT   = $1000;
+    LCTRL  = $2000;
+    RCTRL  = $4000; 
+
+var tkbd: array[0..cKbdMaxIndex] of boolean;
+    quitKeyCode, closeKeyCode: Byte;
+    KeyNames: array [0..cKeyMaxIndex] of string[15];
+    CurrentBinds: TBinds;
+
+function  KeyNameToCode(name: shortstring): LongInt; inline;
+begin
+    KeyNameToCode:= KeyNameToCode(name, '');
+end;
+
+function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt;
+var code: LongInt;
+begin
+    name:= LowerCase(name);
+    code:= cKeyMaxIndex;
+    while (code > 0) and (KeyNames[code] <> name) do dec(code);
+
+    MaskModifier(Modifier, code);
+    KeyNameToCode:= code;
+end;
+(*
+procedure MaskModifier(var code: LongInt; Modifier: LongWord);
+begin
+    if(Modifier and KMOD_LSHIFT) <> 0 then code:= code or LSHIFT; 
+    if(Modifier and KMOD_RSHIFT) <> 0 then code:= code or LSHIFT; 
+    if(Modifier and KMOD_LALT) <> 0 then code:= code or LALT; 
+    if(Modifier and KMOD_RALT) <> 0 then code:= code or LALT; 
+    if(Modifier and KMOD_LCTRL) <> 0 then code:= code or LCTRL; 
+    if(Modifier and KMOD_RCTRL) <> 0 then code:= code or LCTRL; 
+end;
+*)
+procedure MaskModifier(Modifier: shortstring; var code: LongInt);
+var mod_ : shortstring;
+    ModifierCount, i: LongInt;
+begin
+if Modifier = '' then exit;
+ModifierCount:= 0;
+
+for i:= 1 to Length(Modifier) do
+    if(Modifier[i] = ':') then inc(ModifierCount);
+
+SplitByChar(Modifier, mod_, ':');//remove the first mod: part
+Modifier:= mod_;
+for i:= 0 to ModifierCount do
+    begin 
+    mod_:= '';
+    SplitByChar(Modifier, mod_, ':');
+    if (Modifier = 'lshift')                    then code:= code or LSHIFT;
+    if (Modifier = 'rshift')                    then code:= code or RSHIFT;
+    if (Modifier = 'lalt')                      then code:= code or LALT;
+    if (Modifier = 'ralt')                      then code:= code or RALT;
+    if (Modifier = 'lctrl') or (mod_ = 'lmeta') then code:= code or LCTRL;
+    if (Modifier = 'rctrl') or (mod_ = 'rmeta') then code:= code or RCTRL;
+    Modifier:= mod_;
+    end;
+end;
+
+procedure ProcessKey(code: LongInt; KeyDown: boolean);
+var
+    Trusted: boolean;
+    s      : string;
+begin
+if not(tkbd[code] xor KeyDown) then exit;
+tkbd[code]:= KeyDown;
+
+hideAmmoMenu:= false;
+Trusted:= (CurrentTeam <> nil)
+          and (not CurrentTeam^.ExtDriven)
+          and (CurrentHedgehog^.BotLevel = 0);
+
+// ctrl/cmd + q to close engine and frontend
+if(KeyDown and (code = quitKeyCode)) then
+    begin
+{$IFDEF DARWIN}
+    if tkbd[KeyNameToCode('left_meta')] or tkbd[KeyNameToCode('right_meta')] then
+{$ELSE}
+    if tkbd[KeyNameToCode('left_ctrl')] or tkbd[KeyNameToCode('right_ctrl')] then
+{$ENDIF}
+        ParseCommand('halt', true);
+    end;
+
+// ctrl/cmd + w to close engine
+if(KeyDown and (code = closeKeyCode)) then
+    begin
+{$IFDEF DARWIN}
+    // on OS X it this is expected behaviour
+    if tkbd[KeyNameToCode('left_meta')] or tkbd[KeyNameToCode('right_meta')] then
+{$ELSE}
+    // on other systems use this shortcut only if the keys are not bound to any command
+    if tkbd[KeyNameToCode('left_ctrl')] or tkbd[KeyNameToCode('right_ctrl')] then
+        if ((CurrentBinds[KeyNameToCode('left_ctrl')] = '') or
+            (CurrentBinds[KeyNameToCode('right_ctrl')] = '')) and
+            (CurrentBinds[closeKeyCode] = '') then
+{$ENDIF}
+        ParseCommand('forcequit', true);
+    end;
+
+if CurrentBinds[code][0] <> #0 then
+    begin
+    if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true;
+
+    if KeyDown then
+        begin
+        ParseCommand(CurrentBinds[code], Trusted);
+        if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
+            ParseCommand('gencmd R', true)
+        end
+    else if (CurrentBinds[code][1] = '+') then
+        begin
+        s:= CurrentBinds[code];
+        s[1]:= '-';
+        ParseCommand(s, Trusted);
+        if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
+            ParseCommand('gencmd R', true)
+        end;
+    end
+end;
+
+procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
+var code: LongInt;
+begin
+    code:= event.keysym.sym;
+    //MaskModifier(code, event.keysym.modifier);
+    ProcessKey(code, event.type_ = SDL_KEYDOWN);
+end;
+
+procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
+begin
+case event.button of
+    SDL_BUTTON_LEFT:
+        ProcessKey(KeyNameToCode('mousel'), ButtonDown);
+    SDL_BUTTON_MIDDLE:
+        ProcessKey(KeyNameToCode('mousem'), ButtonDown);
+    SDL_BUTTON_RIGHT:
+        ProcessKey(KeyNameToCode('mouser'), ButtonDown);
+    SDL_BUTTON_WHEELDOWN:
+        ProcessKey(KeyNameToCode('wheeldown'), ButtonDown);
+    SDL_BUTTON_WHEELUP:
+        ProcessKey(KeyNameToCode('wheelup'), ButtonDown);
+    end;
+end;
+
+procedure ResetKbd;
+var t: LongInt;
+begin
+for t:= 0 to cKbdMaxIndex do
+    if tkbd[t] then
+        ProcessKey(t, False);
+end;
+
+procedure InitKbdKeyTable;
+var i, j, k, t: LongInt;
+    s: string[15];
+begin
+//TODO in sdl13 this overrides some values (A and B) change indices to some other values at the back perhaps?
+KeyNames[1]:= 'mousel';
+KeyNames[2]:= 'mousem';
+KeyNames[3]:= 'mouser';
+KeyNames[4]:= 'wheelup';
+KeyNames[5]:= 'wheeldown';
+
+for i:= 6 to cKeyMaxIndex do
+    begin
+    s:= shortstring(sdl_getkeyname(i));
+    //WriteLnToConsole('uInputHandler - ' + IntToStr(i) + ': ' + s + ' ' + IntToStr(cKeyMaxIndex));
+    if s = 'unknown key' then KeyNames[i]:= ''
+    else 
+        begin
+        for t:= 1 to Length(s) do
+            if s[t] = ' ' then
+                s[t]:= '_';
+        KeyNames[i]:= LowerCase(s)
+        end;
+    end;
+
+quitKeyCode:= KeyNameToCode(_S'q');
+closeKeyCode:= KeyNameToCode(_S'w');
+
+// get the size of keyboard array
+SDL_GetKeyState(@k);
+
+// Controller(s)
+for j:= 0 to Pred(ControllerNumControllers) do
+    begin
+    for i:= 0 to Pred(ControllerNumAxes[j]) do
+        begin
+        keynames[k + 0]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'u';
+        keynames[k + 1]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'd';
+        inc(k, 2);
+        end;
+    for i:= 0 to Pred(ControllerNumHats[j]) do
+        begin
+        keynames[k + 0]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'u';
+        keynames[k + 1]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'r';
+        keynames[k + 2]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'd';
+        keynames[k + 3]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'l';
+        inc(k, 4);
+        end;
+    for i:= 0 to Pred(ControllerNumButtons[j]) do
+        begin
+        keynames[k]:= 'j' + IntToStr(j) + 'b' + IntToStr(i);
+        inc(k, 1);
+        end;
+    end;
+
+DefaultBinds[KeyNameToCode('escape')]:= 'quit';
+DefaultBinds[KeyNameToCode(_S'`')]:= 'history';
+DefaultBinds[KeyNameToCode('delete')]:= 'rotmask';
+
+//numpad
+//DefaultBinds[265]:= '+volup';
+//DefaultBinds[256]:= '+voldown';
+
+DefaultBinds[KeyNameToCode(_S'0')]:= '+volup';
+DefaultBinds[KeyNameToCode(_S'9')]:= '+voldown';
+DefaultBinds[KeyNameToCode(_S'8')]:= 'mute';
+DefaultBinds[KeyNameToCode(_S'c')]:= 'capture';
+DefaultBinds[KeyNameToCode(_S'r')]:= 'record';
+DefaultBinds[KeyNameToCode(_S'h')]:= 'findhh';
+DefaultBinds[KeyNameToCode(_S'p')]:= 'pause';
+DefaultBinds[KeyNameToCode(_S's')]:= '+speedup';
+DefaultBinds[KeyNameToCode(_S't')]:= 'chat';
+DefaultBinds[KeyNameToCode(_S'y')]:= 'confirm';
+
+DefaultBinds[KeyNameToCode('mousem')]:= 'zoomreset';
+DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomin';
+DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomout';
+
+DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
+
+
+DefaultBinds[KeyNameToCode('mousel')]:= '/put';
+DefaultBinds[KeyNameToCode('mouser')]:= 'ammomenu';
+DefaultBinds[KeyNameToCode('backspace')]:= 'hjump';
+DefaultBinds[KeyNameToCode('tab')]:= 'switch';
+DefaultBinds[KeyNameToCode('return')]:= 'ljump';
+DefaultBinds[KeyNameToCode('space')]:= '+attack';
+DefaultBinds[KeyNameToCode('up')]:= '+up';
+DefaultBinds[KeyNameToCode('down')]:= '+down';
+DefaultBinds[KeyNameToCode('left')]:= '+left';
+DefaultBinds[KeyNameToCode('right')]:= '+right';
+DefaultBinds[KeyNameToCode('left_shift')]:= '+precise';
+
+
+DefaultBinds[KeyNameToCode('j0a0u')]:= '+left';
+DefaultBinds[KeyNameToCode('j0a0d')]:= '+right';
+DefaultBinds[KeyNameToCode('j0a1u')]:= '+up';
+DefaultBinds[KeyNameToCode('j0a1d')]:= '+down';
+for i:= 1 to 10 do DefaultBinds[KeyNameToCode('f'+IntToStr(i))]:= 'slot '+IntToStr(i);
+for i:= 1 to 5  do DefaultBinds[KeyNameToCode(IntToStr(i))]:= 'timer '+IntToStr(i);
+
+SetDefaultBinds();
+end;
+
+procedure SetBinds(var binds: TBinds);
+{$IFNDEF MOBILE}
+var
+    t: LongInt;
+{$ENDIF}
+begin
+{$IFDEF MOBILE}
+    binds:= binds; // avoid hint
+    CurrentBinds:= DefaultBinds;
+{$ELSE}
+for t:= 0 to cKbdMaxIndex do
+    if (CurrentBinds[t] <> binds[t]) and tkbd[t] then
+        ProcessKey(t, False);
+
+    CurrentBinds:= binds;
+{$ENDIF}
+end;
+
+procedure SetDefaultBinds;
+begin
+    CurrentBinds:= DefaultBinds;
+end;
+
+procedure FreezeEnterKey;
+begin
+    tkbd[3]:= True;
+    tkbd[13]:= True;
+    tkbd[27]:= True;
+    tkbd[271]:= True;
+end;
+
+var Controller: array [0..5] of PSDL_Joystick;
+
+procedure ControllerInit;
+var i, j: Integer;
+begin
+ControllerEnabled:= 0;
+{$IFDEF IPHONE}
+exit; // joystick subsystem disabled on iPhone
+{$ENDIF}
+
+SDL_InitSubSystem(SDL_INIT_JOYSTICK);
+ControllerNumControllers:= SDL_NumJoysticks();
+
+if ControllerNumControllers > 6 then
+    ControllerNumControllers:= 6;
+
+WriteLnToConsole('Number of game controllers: ' + IntToStr(ControllerNumControllers));
+
+if ControllerNumControllers > 0 then
+    begin
+    for j:= 0 to pred(ControllerNumControllers) do
+        begin
+        WriteLnToConsole('Using game controller: ' + shortstring(SDL_JoystickName(j)));
+        Controller[j]:= SDL_JoystickOpen(j);
+        if Controller[j] = nil then
+            WriteLnToConsole('* Failed to open game controller!')
+        else
+            begin
+            ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]);
+            //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]);
+            ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]);
+            ControllerNumButtons[j]:= SDL_JoystickNumButtons(Controller[j]);
+            WriteLnToConsole('* Number of axes: ' + IntToStr(ControllerNumAxes[j]));
+            //WriteLnToConsole('* Number of balls: ' + IntToStr(ControllerNumBalls[j]));
+            WriteLnToConsole('* Number of hats: ' + IntToStr(ControllerNumHats[j]));
+            WriteLnToConsole('* Number of buttons: ' + IntToStr(ControllerNumButtons[j]));
+            ControllerEnabled:= 1;
+
+            if ControllerNumAxes[j] > 20 then
+                ControllerNumAxes[j]:= 20;
+            //if ControllerNumBalls[j] > 20 then ControllerNumBalls[j]:= 20;
+            
+            if ControllerNumHats[j] > 20 then
+                ControllerNumHats[j]:= 20;
+                
+            if ControllerNumButtons[j] > 20 then
+                ControllerNumButtons[j]:= 20;
+
+            // reset all buttons/axes
+            for i:= 0 to pred(ControllerNumAxes[j]) do
+                ControllerAxes[j][i]:= 0;
+            (*for i:= 0 to pred(ControllerNumBalls[j]) do
+                begin
+                ControllerBalls[j][i][0]:= 0;
+                ControllerBalls[j][i][1]:= 0;
+                end;*)
+            for i:= 0 to pred(ControllerNumHats[j]) do
+                ControllerHats[j][i]:= SDL_HAT_CENTERED;
+            for i:= 0 to pred(ControllerNumButtons[j]) do
+                ControllerButtons[j][i]:= 0;
+            end;
+        end;
+    // enable event generation/controller updating
+    SDL_JoystickEventState(1);
+    end
+else
+    WriteLnToConsole('Not using any game controller');
+end;
+
+procedure ControllerAxisEvent(joy, axis: Byte; value: Integer);
+var
+    k: LongInt;
+begin
+    SDL_GetKeyState(@k);
+    k:= k + joy * (ControllerNumAxes[joy]*2 + ControllerNumHats[joy]*4 + ControllerNumButtons[joy]*2);
+    ProcessKey(k +  axis*2, value > 20000);
+    ProcessKey(k + (axis*2)+1, value < -20000);
+end;
+
+procedure ControllerHatEvent(joy, hat, value: Byte);
+var
+    k: LongInt;
+begin
+    SDL_GetKeyState(@k);
+    k:= k + joy * (ControllerNumAxes[joy]*2 + ControllerNumHats[joy]*4 + ControllerNumButtons[joy]*2);
+    ProcessKey(k +  ControllerNumAxes[joy]*2 + hat*4 + 0, (value and SDL_HAT_UP)   <> 0);
+    ProcessKey(k +  ControllerNumAxes[joy]*2 + hat*4 + 1, (value and SDL_HAT_RIGHT)<> 0);
+    ProcessKey(k +  ControllerNumAxes[joy]*2 + hat*4 + 2, (value and SDL_HAT_DOWN) <> 0);
+    ProcessKey(k +  ControllerNumAxes[joy]*2 + hat*4 + 3, (value and SDL_HAT_LEFT) <> 0);
+end;
+
+procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
+var
+    k: LongInt;
+begin
+    SDL_GetKeyState(@k);
+    k:= k + joy * (ControllerNumAxes[joy]*2 + ControllerNumHats[joy]*4 + ControllerNumButtons[joy]*2);
+    ProcessKey(k +  ControllerNumAxes[joy]*2 + ControllerNumHats[joy]*4 + button, pressed);
+end;
+
+procedure initModule;
+begin
+end;
+
+procedure freeModule;
+var j: LongInt;
+begin
+    // close gamepad controllers
+    if ControllerEnabled > 0 then
+        for j:= 0 to pred(ControllerNumControllers) do
+            SDL_JoystickClose(Controller[j]);
+end;
+
+end.
diff --git a/hedgewars/uKeys.pas b/hedgewars/uKeys.pas
deleted file mode 100644
index db92d96..0000000
--- a/hedgewars/uKeys.pas
+++ /dev/null
@@ -1,516 +0,0 @@
-(*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *)
-
-{$INCLUDE "options.inc"}
-
-unit uKeys;
-interface
-uses SDLh, uTypes;
-
-procedure initModule;
-procedure freeModule;
-
-function  KeyNameToCode(name: shortstring): word;
-procedure ProcessKbd;
-procedure ResetKbd;
-procedure FreezeEnterKey;
-procedure InitKbdKeyTable;
-
-procedure SetBinds(var binds: TBinds);
-procedure SetDefaultBinds;
-
-procedure ControllerInit;
-procedure ControllerClose;
-procedure ControllerAxisEvent(joy, axis: Byte; value: Integer);
-procedure ControllerHatEvent(joy, hat, value: Byte);
-procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
-
-{$IFDEF IPHONEOS}
-procedure setiPhoneBinds;
-{$ENDIF}
-
-implementation
-uses uConsole, uCommands, uMisc, uVariables, uConsts, uUtils, uDebug;
-
-var tkbd, tkbdn: TKeyboardState;
-    KeyNames: array [0..cKeyMaxIndex] of string[15];
-
-function KeyNameToCode(name: shortstring): word;
-var code: Word;
-begin
-    code:= cKeyMaxIndex;
-    while (code > 0) and (KeyNames[code] <> name) do dec(code);
-    KeyNameToCode:= code;
-end;
-
-
-procedure ProcessKbd;
-var  i, j, k: LongInt;
-     s: shortstring;
-     Trusted: boolean;
-{$IFNDEF IPHONEOS}pkbd: PByteArray;{$ENDIF}
-begin
-hideAmmoMenu:= false;
-Trusted:= (CurrentTeam <> nil)
-          and (not CurrentTeam^.ExtDriven)
-          and (CurrentHedgehog^.BotLevel = 0);
-
-// move cursor/camera
-// TODO: Scale on screen dimensions and/or axis value (game controller)?
-movecursor(5 * CursorMovementX, 5 * CursorMovementY);
-
-k:= SDL_GetMouseState(nil, nil);
-
-{$IFDEF IPHONEOS}
-SDL_GetKeyState(@j);
-{$ELSE}
-pkbd:= SDL_GetKeyState(@j);
-for i:= 6 to pred(j) do // first 6 will be overwritten
-    tkbdn[i]:= pkbd^[i];
-{$ENDIF}
-
-// mouse buttons
-{$IFDEF DARWIN}
-tkbdn[1]:= ((k and 1) and not (tkbdn[306] or tkbdn[305]));
-tkbdn[3]:= ((k and 1) and (tkbdn[306] or tkbdn[305])) or (k and 4);
-{$ELSE}
-tkbdn[1]:= (k and 1);
-tkbdn[3]:= ((k shr 2) and 1);
-{$ENDIF}
-tkbdn[2]:= ((k shr 1) and 1);
-
-// mouse wheels
-tkbdn[4]:= ord(wheelDown);
-tkbdn[5]:= ord(wheelUp);
-wheelUp:= false;
-wheelDown:= false;
-
-{$IFDEF IPHONEOS}
-setiPhoneBinds();
-{$ELSE}
-// Controller(s)
-k:= j; // should we test k for hitting the limit? sounds rather unlikely to ever reach it
-for j:= 0 to Pred(ControllerNumControllers) do
-    begin
-    for i:= 0 to Pred(ControllerNumAxes[j]) do
-        begin
-        if ControllerAxes[j][i] > 20000 then tkbdn[k + 0]:= 1 else tkbdn[k + 0]:= 0;
-        if ControllerAxes[j][i] < -20000 then tkbdn[k + 1]:= 1 else tkbdn[k + 1]:= 0;
-        inc(k, 2);
-        end;
-    for i:= 0 to Pred(ControllerNumHats[j]) do
-        begin
-        tkbdn[k + 0]:= ControllerHats[j][i] and SDL_HAT_UP;
-        tkbdn[k + 1]:= ControllerHats[j][i] and SDL_HAT_RIGHT;
-        tkbdn[k + 2]:= ControllerHats[j][i] and SDL_HAT_DOWN;
-        tkbdn[k + 3]:= ControllerHats[j][i] and SDL_HAT_LEFT;
-        inc(k, 4);
-        end;
-    for i:= 0 to Pred(ControllerNumButtons[j]) do
-        begin
-        tkbdn[k]:= ControllerButtons[j][i];
-        inc(k, 1);
-        end;
-    end;
-{$ENDIF}
-
-// ctrl/cmd + q to close engine and frontend
-{$IFDEF DARWIN}
-    if ((tkbdn[KeyNameToCode('left_meta')] = 1) or (tkbdn[KeyNameToCode('right_meta')] = 1)) then
-{$ELSE}
-    if ((tkbdn[KeyNameToCode('left_ctrl')] = 1) or (tkbdn[KeyNameToCode('right_ctrl')] = 1)) then
-{$ENDIF}
-    begin
-        if tkbdn[KeyNameToCode('q')] = 1 then ParseCommand ('halt', true)
-    end;
-
-// now process strokes
-for i:= 0 to cKeyMaxIndex do
-if CurrentBinds[i][0] <> #0 then
-    begin
-    if (i > 3) and (tkbdn[i] <> 0) and not ((CurrentBinds[i] = 'put') or (CurrentBinds[i] = 'ammomenu') or (CurrentBinds[i] = '+cur_u') or (CurrentBinds[i] = '+cur_d') or (CurrentBinds[i] = '+cur_l') or (CurrentBinds[i] = '+cur_r')) then hideAmmoMenu:= true;
-    if (tkbd[i] = 0) and (tkbdn[i] <> 0) then
-         begin
-         ParseCommand(CurrentBinds[i], Trusted);
-         if (CurrentTeam <> nil) and not CurrentTeam^.ExtDriven and (ReadyTimeLeft > 1) then ParseCommand('gencmd R', true)
-         end
-    else if (CurrentBinds[i][1] = '+')
-            and (tkbdn[i] = 0)
-            and (tkbd[i] <> 0) then
-            begin
-            s:= CurrentBinds[i];
-            s[1]:= '-';
-            ParseCommand(s, Trusted);
-            if (CurrentTeam <> nil) and not CurrentTeam^.ExtDriven and (ReadyTimeLeft > 1) then ParseCommand('gencmd R', true)
-            end;
-    tkbd[i]:= tkbdn[i]
-    end
-end;
-
-procedure ResetKbd;
-var j, k, t: LongInt;
-{$IFNDEF IPHONEOS}
-    i: LongInt;
-    pkbd: PByteArray;
-{$ENDIF}
-begin
-
-k:= SDL_GetMouseState(nil, nil);
-{$IFNDEF IPHONEOS}pkbd:={$ENDIF}SDL_GetKeyState(@j);
-
-TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + IntToStr(j) + ')', true);
-
-{$IFNDEF IPHONEOS}
-for i:= 1 to pred(j) do
-    tkbdn[i]:= pkbd^[i];
-{$ENDIF}
-
-// mouse buttons
-{$IFDEF DARWIN}
-tkbdn[1]:= ((k and 1) and not (tkbdn[306] or tkbdn[305]));
-tkbdn[3]:= ((k and 1) and (tkbdn[306] or tkbdn[305])) or (k and 4);
-{$ELSE}
-tkbdn[1]:= (k and 1);
-tkbdn[3]:= ((k shr 2) and 1);
-{$ENDIF}
-tkbdn[2]:= ((k shr 1) and 1);
-
-// mouse wheels
-tkbdn[4]:= ord(wheelDown);
-tkbdn[5]:= ord(wheelUp);
-wheelUp:= false;
-wheelDown:= false;
-
-{$IFDEF IPHONEOS}
-setiPhoneBinds();
-{$ELSE}
-// Controller(s)
-k:= j; // should we test k for hitting the limit? sounds rather unlikely to ever reach it
-for j:= 0 to Pred(ControllerNumControllers) do
-    begin
-    for i:= 0 to Pred(ControllerNumAxes[j]) do
-        begin
-        if ControllerAxes[j][i] > 20000 then tkbdn[k + 0]:= 1 else tkbdn[k + 0]:= 0;
-        if ControllerAxes[j][i] < -20000 then tkbdn[k + 1]:= 1 else tkbdn[k + 1]:= 0;
-        inc(k, 2);
-        end;
-    for i:= 0 to Pred(ControllerNumHats[j]) do
-        begin
-        tkbdn[k + 0]:= ControllerHats[j][i] and SDL_HAT_UP;
-        tkbdn[k + 1]:= ControllerHats[j][i] and SDL_HAT_RIGHT;
-        tkbdn[k + 2]:= ControllerHats[j][i] and SDL_HAT_DOWN;
-        tkbdn[k + 3]:= ControllerHats[j][i] and SDL_HAT_LEFT;
-        inc(k, 4);
-        end;
-    for i:= 0 to Pred(ControllerNumButtons[j]) do
-        begin
-        tkbdn[k]:= ControllerButtons[j][i];
-        inc(k, 1);
-        end;
-    end;
-{$ENDIF}
-
-// what is this final loop for?
-for t:= 0 to cKeyMaxIndex do
-    tkbd[t]:= tkbdn[t]
-end;
-
-procedure InitKbdKeyTable;
-var i, j, k, t: LongInt;
-    s: string[15];
-begin
-KeyNames[1]:= 'mousel';
-KeyNames[2]:= 'mousem';
-KeyNames[3]:= 'mouser';
-KeyNames[4]:= 'wheelup';
-KeyNames[5]:= 'wheeldown';
-
-for i:= 6 to cKeyMaxIndex do
-    begin
-    s:= shortstring(sdl_getkeyname(i));
-    //writeln(stdout,IntToStr(i) + ': ' + s);
-    if s = 'unknown key' then KeyNames[i]:= ''
-    else 
-        begin
-        for t:= 1 to Length(s) do
-            if s[t] = ' ' then s[t]:= '_';
-        KeyNames[i]:= s
-        end;
-    end;
-
-//for i:= 0 to cKeyMaxIndex do writeln(stdout,IntToStr(i) + ': ' + KeyNames[i]);
-
-// get the size of keyboard array
-SDL_GetKeyState(@k);
-
-// Controller(s)
-for j:= 0 to Pred(ControllerNumControllers) do
-    begin
-    for i:= 0 to Pred(ControllerNumAxes[j]) do
-        begin
-        keynames[k + 0]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'u';
-        keynames[k + 1]:= 'j' + IntToStr(j) + 'a' + IntToStr(i) + 'd';
-        inc(k, 2);
-        end;
-    for i:= 0 to Pred(ControllerNumHats[j]) do
-        begin
-        keynames[k + 0]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'u';
-        keynames[k + 1]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'r';
-        keynames[k + 2]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'd';
-        keynames[k + 3]:= 'j' + IntToStr(j) + 'h' + IntToStr(i) + 'l';
-        inc(k, 4);
-        end;
-    for i:= 0 to Pred(ControllerNumButtons[j]) do
-        begin
-        keynames[k]:= 'j' + IntToStr(j) + 'b' + IntToStr(i);
-        inc(k, 1);
-        end;
-    end;
-
-DefaultBinds[ 27]:= 'quit';
-DefaultBinds[ 96]:= 'history';
-DefaultBinds[127]:= 'rotmask';
-
-//numpad
-//DefaultBinds[265]:= '+volup';
-//DefaultBinds[256]:= '+voldown';
-
-DefaultBinds[KeyNameToCode('0')]:= '+volup';
-DefaultBinds[KeyNameToCode('9')]:= '+voldown';
-DefaultBinds[KeyNameToCode('c')]:= 'capture';
-DefaultBinds[KeyNameToCode('h')]:= 'findhh';
-DefaultBinds[KeyNameToCode('p')]:= 'pause';
-DefaultBinds[KeyNameToCode('s')]:= '+speedup';
-DefaultBinds[KeyNameToCode('t')]:= 'chat';
-DefaultBinds[KeyNameToCode('y')]:= 'confirm';
-
-DefaultBinds[KeyNameToCode('mousem')]:= 'zoomreset';
-DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomout';
-DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomin';
-
-DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
-
-
-DefaultBinds[ 1]:= '/put';
-DefaultBinds[ 3]:= 'ammomenu';
-DefaultBinds[ 8]:= 'hjump';
-DefaultBinds[ 9]:= 'switch';
-DefaultBinds[13]:= 'ljump';
-DefaultBinds[32]:= '+attack';
-{$IFDEF IPHONEOS}
-DefaultBinds[23]:= '+up';
-DefaultBinds[24]:= '+down';
-DefaultBinds[25]:= '+left';
-DefaultBinds[26]:= '+right';
-DefaultBinds[27]:= '+precise';
-DefaultBinds[44]:= 'chat';
-DefaultBinds[55]:= 'pause';
-{$ELSE}
-DefaultBinds[KeyNameToCode('up')]:= '+up';
-DefaultBinds[KeyNameToCode('down')]:= '+down';
-DefaultBinds[KeyNameToCode('left')]:= '+left';
-DefaultBinds[KeyNameToCode('right')]:= '+right';
-DefaultBinds[KeyNameToCode('left_shift')]:= '+precise';
-{$ENDIF}
-
-for i:= 1 to 10 do DefaultBinds[KeyNameToCode('f'+IntToStr(i))]:= 'slot '+IntToStr(i);
-
-SetDefaultBinds();
-end;
-
-procedure SetBinds(var binds: TBinds);
-begin
-{$IFDEF IPHONEOS}
-    binds:= binds; // avoid hint
-    CurrentBinds:= DefaultBinds;
-{$ELSE}
-    CurrentBinds:= binds;
-{$ENDIF}
-end;
-
-procedure SetDefaultBinds;
-begin
-    CurrentBinds:= DefaultBinds;
-end;
-
-{$IFDEF IPHONEOS}
-procedure setiPhoneBinds;
-begin
-    tkbdn[ 1]:= ord(leftClick);
-    tkbdn[ 2]:= ord(middleClick);
-    tkbdn[ 3]:= ord(rightClick);
-
-    tkbdn[23]:= ord(upKey);
-    tkbdn[24]:= ord(downKey);
-    tkbdn[25]:= ord(leftKey);
-    tkbdn[26]:= ord(rightKey);
-    tkbdn[27]:= ord(preciseKey);
-
-    tkbdn[ 8]:= ord(backspaceKey);
-    tkbdn[ 9]:= ord(tabKey);
-    tkbdn[13]:= ord(enterKey);
-    tkbdn[32]:= ord(spaceKey);
-
-    tkbdn[44]:= ord(chatAction);
-    tkbdn[55]:= ord(pauseAction);
-
-    // set to false the keys that only need one stoke
-    leftClick:= false;
-    middleClick:= false;
-    rightClick:= false;
-
-    tabKey:= false;
-    enterKey:= false;
-    backspaceKey:= false;
-
-    chatAction:= false;
-    pauseAction:= false;
-end;
-{$ENDIF}
-
-procedure FreezeEnterKey;
-begin
-    tkbd[3]:= 1;
-    tkbd[13]:= 1;
-    tkbd[27]:= 1;
-    tkbd[271]:= 1;
-end;
-
-var Controller: array [0..5] of PSDL_Joystick;
-
-procedure ControllerInit;
-var i, j: Integer;
-begin
-ControllerEnabled:= 0;
-{$IFDEF IPHONEOS}
-exit; // joystick subsystem disabled on iPhone
-{$ENDIF}
-
-SDL_InitSubSystem(SDL_INIT_JOYSTICK);
-ControllerNumControllers:= SDL_NumJoysticks();
-if ControllerNumControllers > 6 then ControllerNumControllers:= 6;
-
-WriteLnToConsole('Number of game controllers: ' + IntToStr(ControllerNumControllers));
-
-if ControllerNumControllers > 0 then
-    begin
-    for j:= 0 to pred(ControllerNumControllers) do
-        begin
-        WriteLnToConsole('Using game controller: ' + SDL_JoystickName(j));
-        Controller[j]:= SDL_JoystickOpen(j);
-        if Controller[j] = nil then
-            WriteLnToConsole('* Failed to open game controller!')
-        else
-            begin
-            ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]);
-            //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]);
-            ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]);
-            ControllerNumButtons[j]:= SDL_JoystickNumButtons(Controller[j]);
-            WriteLnToConsole('* Number of axes: ' + IntToStr(ControllerNumAxes[j]));
-            //WriteLnToConsole('* Number of balls: ' + IntToStr(ControllerNumBalls[j]));
-            WriteLnToConsole('* Number of hats: ' + IntToStr(ControllerNumHats[j]));
-            WriteLnToConsole('* Number of buttons: ' + IntToStr(ControllerNumButtons[j]));
-            ControllerEnabled:= 1;
-
-            if ControllerNumAxes[j] > 20 then ControllerNumAxes[j]:= 20;
-            //if ControllerNumBalls[j] > 20 then ControllerNumBalls[j]:= 20;
-            if ControllerNumHats[j] > 20 then ControllerNumHats[j]:= 20;
-            if ControllerNumButtons[j] > 20 then ControllerNumButtons[j]:= 20;
-
-            // reset all buttons/axes
-            for i:= 0 to pred(ControllerNumAxes[j]) do
-                ControllerAxes[j][i]:= 0;
-            (*for i:= 0 to pred(ControllerNumBalls[j]) do
-                begin
-                ControllerBalls[j][i][0]:= 0;
-                ControllerBalls[j][i][1]:= 0;
-                end;*)
-            for i:= 0 to pred(ControllerNumHats[j]) do
-                ControllerHats[j][i]:= SDL_HAT_CENTERED;
-            for i:= 0 to pred(ControllerNumButtons[j]) do
-                ControllerButtons[j][i]:= 0;
-            end;
-        end;
-    // enable event generation/controller updating
-    SDL_JoystickEventState(1);
-    end
-else
-    WriteLnToConsole('Not using any game controller');
-end;
-
-procedure ControllerClose;
-var j: Integer;
-begin
-    if ControllerEnabled > 0 then
-        for j:= 0 to pred(ControllerNumControllers) do
-            SDL_JoystickClose(Controller[j]);
-end;
-
-procedure ControllerAxisEvent(joy, axis: Byte; value: Integer);
-begin
-    ControllerAxes[joy][axis]:= value;
-end;
-
-procedure ControllerHatEvent(joy, hat, value: Byte);
-begin
-    ControllerHats[joy][hat]:= value;
-end;
-
-procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
-begin
-    if pressed then ControllerButtons[joy][button]:= 1
-    else ControllerButtons[joy][button]:= 0;
-end;
-
-procedure initModule;
-begin
-    wheelUp:= false;
-    wheelDown:= false;
-{$IFDEF HWLIBRARY}
-    // this function is called by HW_allKeysUp so be careful
-
-    // mouse emulation
-    leftClick:= false;
-    middleClick:= false;
-    rightClick:= false;
-
-    // arrow key emulation
-    upKey:= false;
-    downKey:= false;
-    rightKey:= false;
-    leftKey:= false;
-    preciseKey:= false;
-
-    // action key emulation
-    backspaceKey:= false;
-    spaceKey:= false;
-    enterKey:= false;
-    tabKey:= false;
-
-    // other key emulation
-    chatAction:= false;
-    pauseAction:= false;
-{$ENDIF}
-end;
-
-procedure freeModule;
-begin
-
-end;
-
-end.
diff --git a/hedgewars/uLand.pas b/hedgewars/uLand.pas
index 96e5db9..cad6cd0 100644
--- a/hedgewars/uLand.pas
+++ b/hedgewars/uLand.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,263 +20,41 @@
 
 unit uLand;
 interface
-uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes;
-
-type direction = record x, y: LongInt; end;
-const DIR_N: direction = (x: 0; y: -1);
-    DIR_E: direction = (x: 1; y: 0);
-    DIR_S: direction = (x: 0; y: 1);
-    DIR_W: direction = (x: -1; y: 0);
+uses SDLh, uLandTemplates, uFloat, uConsts, GLunit, uTypes, uAILandMarks;
 
 procedure initModule;
 procedure freeModule;
 procedure DrawBottomBorder;
 procedure GenMap;
-function  GenPreview: TPreview;
+procedure GenPreview(out Preview: TPreview);
 
 implementation
-uses uConsole, uStore, uRandom, uLandObjects, uIO, uLandTexture, sysutils,
-     uVariables, uUtils, uCommands, Adler32, uDebug, uLandPainted, uTextures;
-
-operator=(const a, b: direction) c: Boolean;
-begin
-    c := (a.x = b.x) and (a.y = b.y);
-end;
-
-type TPixAr = record
-              Count: Longword;
-              ar: array[0..Pred(cMaxEdgePoints)] of TPoint;
-              end;
-
-procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
-var
-  eX, eY, dX, dY: LongInt;
-  i, sX, sY, x, y, d: LongInt;
-begin
-eX:= 0;
-eY:= 0;
-dX:= X2 - X1;
-dY:= Y2 - Y1;
-
-if (dX > 0) then sX:= 1
-else
-  if (dX < 0) then
-     begin
-     sX:= -1;
-     dX:= -dX
-     end else sX:= dX;
-
-if (dY > 0) then sY:= 1
-  else
-  if (dY < 0) then
-     begin
-     sY:= -1;
-     dY:= -dY
-     end else sY:= dY;
-
-if (dX > dY) then d:= dX
-             else d:= dY;
-
-x:= X1;
-y:= Y1;
-
-for i:= 0 to d do
+uses uConsole, uStore, uRandom, uLandObjects, uIO, uLandTexture, SysUtils,
+     uVariables, uUtils, uCommands, adler32, uDebug, uLandPainted, uTextures,
+     uLandGenMaze, uLandOutline;
+
+var digest: shortstring;
+
+procedure ResizeLand(width, height: LongWord);
+var potW, potH: LongWord;
+begin 
+potW:= toPowerOf2(width);
+potH:= toPowerOf2(height);
+if (potW <> LAND_WIDTH) or (potH <> LAND_HEIGHT) then
     begin
-    inc(eX, dX);
-    inc(eY, dY);
-    if (eX > d) then
-       begin
-       dec(eX, d);
-       inc(x, sX);
-       end;
-    if (eY > d) then
-       begin
-       dec(eY, d);
-       inc(y, sY);
-       end;
-
-    if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then
-       Land[y, x]:= Color;
-    end
-end;
-
-procedure DrawEdge(var pa: TPixAr; Color: Longword);
-var i: LongInt;
-begin
-i:= 0;
-with pa do
-while i < LongInt(Count) - 1 do
-    if (ar[i + 1].X = NTPX) then inc(i, 2)
-       else begin
-       DrawLine(ar[i].x, ar[i].y, ar[i + 1].x, ar[i + 1].y, Color);
-       inc(i)
-       end
-end;
-
-procedure Vector(p1, p2, p3: TPoint; var Vx, Vy: hwFloat);
-var d1, d2, d: hwFloat;
-begin
-Vx:= int2hwFloat(p1.X - p3.X);
-Vy:= int2hwFloat(p1.Y - p3.Y);
-d:= DistanceI(p2.X - p1.X, p2.Y - p1.Y);
-d1:= DistanceI(p2.X - p3.X, p2.Y - p3.Y);
-d2:= Distance(Vx, Vy);
-if d1 < d then d:= d1;
-if d2 < d then d:= d2;
-d:= d * _1div3;
-if d2.QWordValue = 0 then
-   begin
-   Vx:= _0;
-   Vy:= _0
-   end else
-   begin
-   d2:= _1 / d2;
-   Vx:= Vx * d2;
-   Vy:= Vy * d2;
-
-   Vx:= Vx * d;
-   Vy:= Vy * d
-   end
-end;
-
-procedure AddLoopPoints(var pa, opa: TPixAr; StartI, EndI: LongInt; Delta: hwFloat);
-var i, pi, ni: LongInt;
-    NVx, NVy, PVx, PVy: hwFloat;
-    x1, x2, y1, y2: LongInt;
-    tsq, tcb, t, r1, r2, r3, cx1, cx2, cy1, cy2: hwFloat;
-    X, Y: LongInt;
-begin
-pi:= EndI;
-i:= StartI;
-ni:= Succ(StartI);
-{$HINTS OFF}
-Vector(opa.ar[pi], opa.ar[i], opa.ar[ni], NVx, NVy);
-{$HINTS ON}
-repeat
-    inc(pi);
-    if pi > EndI then pi:= StartI;
-    inc(i);
-    if i > EndI then i:= StartI;
-    inc(ni);
-    if ni > EndI then ni:= StartI;
-    PVx:= NVx;
-    PVy:= NVy;
-    Vector(opa.ar[pi], opa.ar[i], opa.ar[ni], NVx, NVy);
-
-    x1:= opa.ar[pi].x;
-    y1:= opa.ar[pi].y;
-    x2:= opa.ar[i].x;
-    y2:= opa.ar[i].y;
-    cx1:= int2hwFloat(x1) - PVx;
-    cy1:= int2hwFloat(y1) - PVy;
-    cx2:= int2hwFloat(x2) + NVx;
-    cy2:= int2hwFloat(y2) + NVy;
-    t:= _0;
-    while t.Round = 0 do
-          begin
-          tsq:= t * t;
-          tcb:= tsq * t;
-          r1:= (_1 - t*3 + tsq*3 - tcb);
-          r2:= (     t*3 - tsq*6 + tcb*3);
-          r3:= (           tsq*3 - tcb*3);
-          X:= hwRound(r1 * x1 + r2 * cx1 + r3 * cx2 + tcb * x2);
-          Y:= hwRound(r1 * y1 + r2 * cy1 + r3 * cy2 + tcb * y2);
-          t:= t + Delta;
-          pa.ar[pa.Count].x:= X;
-          pa.ar[pa.Count].y:= Y;
-          inc(pa.Count);
-          TryDo(pa.Count <= cMaxEdgePoints, 'Edge points overflow', true)
-          end;
-until i = StartI;
-pa.ar[pa.Count].x:= opa.ar[StartI].X;
-pa.ar[pa.Count].y:= opa.ar[StartI].Y;
-inc(pa.Count)
-end;
-
-procedure BezierizeEdge(var pa: TPixAr; Delta: hwFloat);
-var i, StartLoop: LongInt;
-    opa: TPixAr;
-begin
-opa:= pa;
-pa.Count:= 0;
-i:= 0;
-StartLoop:= 0;
-while i < LongInt(opa.Count) do
-    if (opa.ar[i + 1].X = NTPX) then
-       begin
-       AddLoopPoints(pa, opa, StartLoop, i, Delta);
-       inc(i, 2);
-       StartLoop:= i;
-       pa.ar[pa.Count].X:= NTPX;
-       pa.ar[pa.Count].Y:= 0;
-       inc(pa.Count);
-       end else inc(i)
-end;
-
-procedure FillLand(x, y: LongInt);
-var Stack: record
-           Count: Longword;
-           points: array[0..8192] of record
-                                     xl, xr, y, dir: LongInt;
-                                     end
-           end;
-
-    procedure Push(_xl, _xr, _y, _dir: LongInt);
-    begin
-    TryDo(Stack.Count <= 8192, 'FillLand: stack overflow', true);
-    _y:= _y + _dir;
-    if (_y < 0) or (_y >= LAND_HEIGHT) then exit;
-    with Stack.points[Stack.Count] do
-         begin
-         xl:= _xl;
-         xr:= _xr;
-         y:= _y;
-         dir:= _dir
-         end;
-    inc(Stack.Count)
-    end;
+    LAND_WIDTH:= potW;
+    LAND_HEIGHT:= potH;
+    LAND_WIDTH_MASK:= not(LAND_WIDTH-1);
+    LAND_HEIGHT_MASK:= not(LAND_HEIGHT-1);
+    cWaterLine:= LAND_HEIGHT;
+    if (cReducedQuality and rqBlurryLand) = 0 then
+        SetLength(LandPixels, LAND_HEIGHT, LAND_WIDTH)
+    else
+        SetLength(LandPixels, LAND_HEIGHT div 2, LAND_WIDTH div 2);
 
-    procedure Pop(var _xl, _xr, _y, _dir: LongInt);
-    begin
-    dec(Stack.Count);
-    with Stack.points[Stack.Count] do
-         begin
-         _xl:= xl;
-         _xr:= xr;
-         _y:= y;
-         _dir:= dir
-         end
+    SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
+    SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
     end;
-
-var xl, xr, dir: LongInt;
-begin
-Stack.Count:= 0;
-xl:= x - 1;
-xr:= x;
-Push(xl, xr, y, -1);
-Push(xl, xr, y,  1);
-dir:= 0;
-while Stack.Count > 0 do
-      begin
-      Pop(xl, xr, y, dir);
-      while (xl > 0) and (Land[y, xl] <> 0) do dec(xl);
-      while (xr < LAND_WIDTH - 1) and (Land[y, xr] <> 0) do inc(xr);
-      while (xl < xr) do
-            begin
-            while (xl <= xr) and (Land[y, xl] = 0) do inc(xl);
-            x:= xl;
-            while (xl <= xr) and (Land[y, xl] <> 0) do
-                  begin
-                  Land[y, xl]:= 0;
-                  inc(xl)
-                  end;
-            if x < xl then
-               begin
-               Push(x, Pred(xl), y, dir);
-               Push(x, Pred(xl), y,-dir);
-               end;
-            end;
-      end;
 end;
 
 procedure ColorizeLand(Surface: PSDL_Surface);
@@ -284,8 +62,7 @@ var tmpsurf: PSDL_Surface;
     r, rr: TSDL_Rect;
     x, yd, yu: LongInt;
 begin
-    tmpsurf:= LoadImage(UserPathz[ptCurrTheme] + '/LandTex', ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/LandTex', ifCritical or ifIgnoreCaps);
+    tmpsurf:= LoadDataImage(ptCurrTheme, 'LandTex', ifCritical or ifIgnoreCaps);
     r.y:= 0;
     while r.y < LAND_HEIGHT do
     begin
@@ -300,21 +77,21 @@ begin
     SDL_FreeSurface(tmpsurf);
 
     // freed in freeModule() below
-    LandBackSurface:= LoadImage(UserPathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent);
-    if LandBackSurface = nil then LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent);
-    if (LandBackSurface <> nil) and cGrayScale then Surface2GrayScale(LandBackSurface);
+    LandBackSurface:= LoadDataImage(ptCurrTheme, 'LandBackTex', ifIgnoreCaps or ifTransparent);
+    if (LandBackSurface <> nil) and GrayScale then Surface2GrayScale(LandBackSurface);
 
-    tmpsurf:= LoadImage(UserPathz[ptCurrTheme] + '/Border', ifIgnoreCaps or ifTransparent);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Border', ifCritical or ifIgnoreCaps or ifTransparent);
+    tmpsurf:= LoadDataImage(ptCurrTheme, 'Border', ifCritical or ifIgnoreCaps or ifTransparent);
     for x:= 0 to LAND_WIDTH - 1 do
     begin
         yd:= LAND_HEIGHT - 1;
         repeat
             while (yd > 0) and (Land[yd, x] =  0) do dec(yd);
 
-            if (yd < 0) then yd:= 0;
+            if (yd < 0) then
+                yd:= 0;
 
-            while (yd < LAND_HEIGHT) and (Land[yd, x] <> 0) do inc(yd);
+            while (yd < LAND_HEIGHT) and (Land[yd, x] <> 0) do
+                inc(yd);
             dec(yd);
             yu:= yd;
 
@@ -322,7 +99,7 @@ begin
             while (yu < yd ) and (Land[yu, x] =  0) do inc(yu);
 
             if (yd < LAND_HEIGHT - 1) and ((yd - yu) >= 16) then
-            begin
+                begin
                 rr.x:= x;
                 rr.y:= yd - 15;
                 r.x:= x mod tmpsurf^.w;
@@ -330,9 +107,9 @@ begin
                 r.w:= 1;
                 r.h:= 16;
                 SDL_UpperBlit(tmpsurf, @r, Surface, @rr);
-            end;
+                end;
             if (yu > 0) then
-            begin
+                begin
                 rr.x:= x;
                 rr.y:= yu;
                 r.x:= x mod tmpsurf^.w;
@@ -340,7 +117,7 @@ begin
                 r.w:= 1;
                 r.h:= Min(16, yd - yu + 1);
                 SDL_UpperBlit(tmpsurf, @r, Surface, @rr);
-            end;
+                end;
             yd:= yu - 1;
         until yd < 0;
     end;
@@ -351,25 +128,25 @@ procedure SetPoints(var Template: TEdgeTemplate; var pa: TPixAr);
 var i: LongInt;
 begin
 with Template do
-     begin
-     pa.Count:= BasePointsCount;
-     for i:= 0 to pred(pa.Count) do
-         begin
-         pa.ar[i].x:= BasePoints^[i].x + LongInt(GetRandom(BasePoints^[i].w));
-         if pa.ar[i].x <> NTPX then
-            pa.ar[i].x:= pa.ar[i].x + ((LAND_WIDTH - Template.TemplateWidth) div 2);
-         pa.ar[i].y:= BasePoints^[i].y + LongInt(GetRandom(BasePoints^[i].h)) + LAND_HEIGHT - LongInt(Template.TemplateHeight)
-         end;
-
-     if canMirror then
+    begin
+    pa.Count:= BasePointsCount;
+    for i:= 0 to pred(pa.Count) do
+        begin
+        pa.ar[i].x:= BasePoints^[i].x + LongInt(GetRandom(BasePoints^[i].w));
+        if pa.ar[i].x <> NTPX then
+           pa.ar[i].x:= pa.ar[i].x + ((LAND_WIDTH - Template.TemplateWidth) div 2);
+        pa.ar[i].y:= BasePoints^[i].y + LongInt(GetRandom(BasePoints^[i].h)) + LAND_HEIGHT - LongInt(Template.TemplateHeight)
+        end;
+
+    if canMirror then
         if getrandom(2) = 0 then
-           begin
-           for i:= 0 to pred(BasePointsCount) do
-             if pa.ar[i].x <> NTPX then
-               pa.ar[i].x:= LAND_WIDTH - 1 - pa.ar[i].x;
-           for i:= 0 to pred(FillPointsCount) do
-               FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
-           end;
+            begin
+            for i:= 0 to pred(BasePointsCount) do
+               if pa.ar[i].x <> NTPX then
+                   pa.ar[i].x:= LAND_WIDTH - 1 - pa.ar[i].x;
+            for i:= 0 to pred(FillPointsCount) do
+                FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
+            end;
 
 (*  Experiment in making this option more useful
      if ((not isNegative) and (cTemplateFilter = 4)) or
@@ -391,108 +168,30 @@ with Template do
      end
 *)
 // template recycling.  Pull these off the floor a bit
-     if (not isNegative) and (cTemplateFilter = 4) then
-           begin
-           for i:= 0 to pred(BasePointsCount) do
-               begin
-               dec(pa.ar[i].y, 100);
-               if pa.ar[i].y < 0 then
-                   pa.ar[i].y:= 0;
-               end;
-           for i:= 0 to pred(FillPointsCount) do
-               begin
-               dec(FillPoints^[i].y, 100);
-               if FillPoints^[i].y < 0 then
-                   FillPoints^[i].y:= 0;
-               end;
-           end;
-
-     if (canFlip and (getrandom(2) = 0)) then
-           begin
-           for i:= 0 to pred(BasePointsCount) do
-               pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
-           for i:= 0 to pred(FillPointsCount) do
-               FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y;
-           end;
-     end
-end;
-
-function CheckIntersect(V1, V2, V3, V4: TPoint): boolean;
-var c1, c2, dm: LongInt;
-begin
-dm:= (V4.y - V3.y) * (V2.x - V1.x) - (V4.x - V3.x) * (V2.y - V1.y);
-c1:= (V4.x - V3.x) * (V1.y - V3.y) - (V4.y - V3.y) * (V1.x - V3.x);
-if dm = 0 then exit(false);
-
-c2:= (V2.x - V3.x) * (V1.y - V3.y) - (V2.y - V3.y) * (V1.x - V3.x);
-if dm > 0 then
-   begin
-   if (c1 < 0) or (c1 > dm) then exit(false);
-   if (c2 < 0) or (c2 > dm) then exit(false)
-   end else
-   begin
-   if (c1 > 0) or (c1 < dm) then exit(false);
-   if (c2 > 0) or (c2 < dm) then exit(false)
-   end;
-
-//AddFileLog('1  (' + inttostr(V1.x) + ',' + inttostr(V1.y) + ')x(' + inttostr(V2.x) + ',' + inttostr(V2.y) + ')');
-//AddFileLog('2  (' + inttostr(V3.x) + ',' + inttostr(V3.y) + ')x(' + inttostr(V4.x) + ',' + inttostr(V4.y) + ')');
-CheckIntersect:= true
-end;
-
-function CheckSelfIntersect(var pa: TPixAr; ind: Longword): boolean;
-var i: Longword;
-begin
-if (ind <= 0) or (ind >= Pred(pa.Count)) then exit(false);
-for i:= 1 to pa.Count - 3 do
-    if (i <= ind - 1) or (i >= ind + 2) then
-      begin
-      if (i <> ind - 1) and
-         CheckIntersect(pa.ar[ind], pa.ar[ind - 1], pa.ar[i], pa.ar[i - 1]) then exit(true);
-      if (i <> ind + 2) and
-         CheckIntersect(pa.ar[ind], pa.ar[ind + 1], pa.ar[i], pa.ar[i - 1]) then exit(true);
-      end;
-CheckSelfIntersect:= false
-end;
+    if (not isNegative) and (cTemplateFilter = 4) then
+        begin
+        for i:= 0 to pred(BasePointsCount) do
+            begin
+            dec(pa.ar[i].y, 100);
+            if pa.ar[i].y < 0 then
+                pa.ar[i].y:= 0;
+            end;
+        for i:= 0 to pred(FillPointsCount) do
+            begin
+            dec(FillPoints^[i].y, 100);
+            if FillPoints^[i].y < 0 then
+                FillPoints^[i].y:= 0;
+            end;
+        end;
 
-procedure RandomizePoints(var pa: TPixAr);
-const cEdge = 55;
-      cMinDist = 8;
-var radz: array[0..Pred(cMaxEdgePoints)] of LongInt;
-    i, k, dist, px, py: LongInt;
-begin
-for i:= 0 to Pred(pa.Count) do
-  begin
-  radz[i]:= 0;
-  with pa.ar[i] do
-    if x <> NTPX then
-      begin
-      radz[i]:= Min(Max(x - cEdge, 0), Max(LAND_WIDTH - cEdge - x, 0));
-      radz[i]:= Min(radz[i], Min(Max(y - cEdge, 0), Max(LAND_HEIGHT - cEdge - y, 0)));
-      if radz[i] > 0 then
-        for k:= 0 to Pred(i) do
-          begin
-          dist:= Max(abs(x - pa.ar[k].x), abs(y - pa.ar[k].y));
-          radz[k]:= Max(0, Min((dist - cMinDist) div 2, radz[k]));
-          radz[i]:= Max(0, Min(dist - radz[k] - cMinDist, radz[i]))
-        end
-      end;
-  end;
-
-for i:= 0 to Pred(pa.Count) do
-  with pa.ar[i] do
-    if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then
-      begin
-      px:= x;
-      py:= y;
-      x:= x + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3;
-      y:= y + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3;
-      if CheckSelfIntersect(pa, i) then
-         begin
-         x:= px;
-         y:= py
-         end;
-      end
+    if (canFlip and (getrandom(2) = 0)) then
+        begin
+        for i:= 0 to pred(BasePointsCount) do
+            pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
+        for i:= 0 to pred(FillPointsCount) do
+            FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y;
+        end;
+    end
 end;
 
 
@@ -501,6 +200,7 @@ var pa: TPixAr;
     i: Longword;
     y, x: Longword;
 begin
+    ResizeLand(Template.TemplateWidth, Template.TemplateHeight);
     for y:= 0 to LAND_HEIGHT - 1 do
         for x:= 0 to LAND_WIDTH - 1 do
             Land[y, x]:= lfBasic;
@@ -513,7 +213,8 @@ begin
         RandomizePoints(pa);
         RandomizePoints(pa)
         end;
-    for i:= 1 to Template.RandPassesCount do RandomizePoints(pa);
+    for i:= 1 to Template.RandPassesCount do
+        RandomizePoints(pa);
     BezierizeEdge(pa, _0_1);
 
 
@@ -535,9 +236,9 @@ begin
     topY:= LAND_HEIGHT - playHeight;
 
     // HACK: force to only cavern even if a cavern map is invertable if cTemplateFilter = 4 ?
-    if (cTemplateFilter = 4) or
-    (Template.canInvert and (getrandom(2) = 0)) or
-        (not Template.canInvert and Template.isNegative) then
+    if (cTemplateFilter = 4)
+    or (Template.canInvert and (getrandom(2) = 0))
+    or (not Template.canInvert and Template.isNegative) then
         begin
         hasBorder:= true;
         for y:= 0 to LAND_HEIGHT - 1 do
@@ -545,17 +246,18 @@ begin
                 if (y < topY) or (x < leftX) or (x > rightX) then
                     Land[y, x]:= 0
                 else
-                begin
-                if Land[y, x] = 0 then
-                    Land[y, x]:= lfBasic
-                else if Land[y, x] = lfBasic then
-                    Land[y, x]:= 0;
-                end;
+                    begin
+                    if Land[y, x] = 0 then
+                        Land[y, x]:= lfBasic
+                    else if Land[y, x] = lfBasic then
+                        Land[y, x]:= 0;
+                    end;
         end;
 end;
 
 procedure GenDrawnMap;
 begin
+    ResizeLand(4096, 2048);
     uLandPainted.Draw;
 
     MaxHedgehogs:= 48;
@@ -579,6 +281,11 @@ begin
         3: SelectTemplate:= LargeTemplates[getrandom(Succ(High(LargeTemplates)))];
         4: SelectTemplate:= CavernTemplates[getrandom(Succ(High(CavernTemplates)))];
         5: SelectTemplate:= WackyTemplates[getrandom(Succ(High(WackyTemplates)))];
+// For lua only!
+        6: begin
+           SelectTemplate:= min(LuaTemplateNumber,High(EdgeTemplates));
+           GetRandom(2) // burn 1
+           end;
     end;
 
     WriteLnToConsole('Selected template #'+inttostr(SelectTemplate)+' using filter #'+inttostr(cTemplateFilter));
@@ -599,9 +306,9 @@ for y:= 0 to LAND_HEIGHT - 1 do
     for x:= 0 to LAND_WIDTH - 1 do
     if Land[y, x] <> 0 then
         if (cReducedQuality and rqBlurryLand) = 0 then
-             LandPixels[y, x]:= p^[x] or AMask
+            LandPixels[y, x]:= p^[x] or AMask
         else
-             LandPixels[y div 2, x div 2]:= p^[x] or AMask;
+            LandPixels[y div 2, x div 2]:= p^[x] or AMask;
 
     p:= @(p^[Surface^.pitch div 4]);
     end;
@@ -610,437 +317,6 @@ if SDL_MustLock(Surface) then
     SDL_UnlockSurface(Surface);
 end;
 
-procedure GenMaze;
-const small_cell_size = 128;
-    medium_cell_size = 192;
-    large_cell_size = 256;
-    braidness = 10;
-
-var x, y: LongInt;
-    cellsize: LongInt; //selected by the user in the gui
-    seen_cells_x, seen_cells_y: LongInt; //number of cells that can be visited by the generator, that is every second cell in x and y direction. the cells between there are walls that will be removed when we move from one cell to another
-    num_edges_x, num_edges_y: LongInt; //number of resulting edges that need to be vertexificated
-    num_cells_x, num_cells_y: LongInt; //actual number of cells, depending on cell size
-    seen_list: array of array of LongInt;
-    xwalls: array of array of Boolean;
-    ywalls: array of array of Boolean;
-    x_edge_list: array of array of Boolean;
-    y_edge_list: array of array of Boolean;
-    maze: array of array of Boolean;
-    pa: TPixAr;
-    num_vertices: LongInt;
-    off_y: LongInt;
-    num_steps: LongInt;
-    current_step: LongInt;
-    step_done: array of Boolean;
-    done: Boolean;
-    last_cell: array of record x, y: LongInt; end;
-    came_from: array of array of record x, y: LongInt; end;
-    came_from_pos: array of LongInt;
-    maze_inverted: Boolean;
-
-function when_seen(x: LongInt; y: LongInt): LongInt;
-begin
-if (x < 0) or (x >= seen_cells_x) or (y < 0) or (y >= seen_cells_y) then
-    when_seen := current_step
-else
-    when_seen := seen_list[x, y];
-end;
-
-function is_x_edge(x, y: LongInt): Boolean;
-begin
-if (x < 0) or (x > num_edges_x) or (y < 0) or (y > num_cells_y) then
-    is_x_edge := false
-else
-    is_x_edge := x_edge_list[x, y];
-end;
-
-function is_y_edge(x, y: LongInt): Boolean;
-begin
-if (x < 0) or (x > num_cells_x) or (y < 0) or (y > num_edges_y) then
-    is_y_edge := false
-else
-    is_y_edge := y_edge_list[x, y];
-end;
-
-procedure see_cell;
-var dir: direction;
-    tries: LongInt;
-    x, y: LongInt;
-    found_cell: Boolean;
-    next_dir_clockwise: Boolean;
-
-begin
-x := last_cell[current_step].x;
-y := last_cell[current_step].y;
-seen_list[x, y] := current_step;
-case GetRandom(4) of
-    0: dir := DIR_N;
-    1: dir := DIR_E;
-    2: dir := DIR_S;
-    3: dir := DIR_W;
-end;
-tries := 0;
-found_cell := false;
-if getrandom(2) = 1 then next_dir_clockwise := true
-else next_dir_clockwise := false;
-
-while (tries < 5) and not found_cell do
-begin
-    if when_seen(x + dir.x, y + dir.y) = current_step then //we are seeing ourselves, try another direction
-    begin
-        //we have already seen the target cell, decide if we should remove the wall anyway
-        //(or put a wall there if maze_inverted, but we are not doing that right now)
-        if not maze_inverted and (GetRandom(braidness) = 0) then
-        //or just warn that inverted+braid+indestructible terrain != good idea
-        begin
-            case dir.x of
-                -1: if x > 0 then ywalls[x-1, y] := false;
-                1: if x < seen_cells_x - 1 then ywalls[x, y] := false;
-            end;
-            case dir.y of
-                -1: if y > 0 then xwalls[x, y-1] := false;
-                1: if y < seen_cells_y - 1 then xwalls[x, y] := false;
-            end;
-        end;
-        if next_dir_clockwise then
-        begin
-            if dir = DIR_N then
-                dir := DIR_E
-            else if dir = DIR_E then
-                dir := DIR_S
-            else if dir = DIR_S then
-                dir := DIR_W
-            else
-                dir := DIR_N;
-        end
-        else
-        begin
-            if dir = DIR_N then
-                dir := DIR_W
-            else if dir = DIR_E then
-                dir := DIR_N
-            else if dir = DIR_S then
-                dir := DIR_E
-            else
-                dir := DIR_S;
-        end
-    end
-    else if when_seen(x + dir.x, y + dir.y) = -1 then //cell was not seen yet, go there
-    begin
-        case dir.y of
-            -1: xwalls[x, y-1] := false;
-            1: xwalls[x, y] := false;
-        end;
-        case dir.x of
-            -1: ywalls[x-1, y] := false;
-            1: ywalls[x, y] := false;
-        end;
-        last_cell[current_step].x := x+dir.x;
-        last_cell[current_step].y := y+dir.y;
-        came_from_pos[current_step] := came_from_pos[current_step] + 1;
-        came_from[current_step, came_from_pos[current_step]].x := x;
-        came_from[current_step, came_from_pos[current_step]].y := y;
-        found_cell := true;
-    end
-    else //we are seeing someone else, quit
-    begin
-        step_done[current_step] := true;
-        found_cell := true;
-    end;
-
-    tries := tries + 1;
-end;
-if not found_cell then
-begin
-    last_cell[current_step].x := came_from[current_step, came_from_pos[current_step]].x;
-    last_cell[current_step].y := came_from[current_step, came_from_pos[current_step]].y;
-    came_from_pos[current_step] := came_from_pos[current_step] - 1;
-    if came_from_pos[current_step] >= 0 then see_cell
-    else step_done[current_step] := true;
-end;
-end;
-
-procedure add_vertex(x, y: LongInt);
-var tmp_x, tmp_y: LongInt;
-begin
-if x = NTPX then
-begin
-    if pa.ar[num_vertices - 6].x = NTPX then
-    begin
-        num_vertices := num_vertices - 6;
-    end
-    else
-    begin
-        pa.ar[num_vertices].x := NTPX;
-        pa.ar[num_vertices].y := 0;
-    end
-end
-else
-begin
-    if maze_inverted or (x mod 2 = 0) then tmp_x := cellsize
-    else tmp_x := cellsize * 2 div 3;
-    if maze_inverted or (y mod 2 = 0) then tmp_y := cellsize
-    else tmp_y := cellsize * 2 div 3;
-
-    pa.ar[num_vertices].x := (x-1)*cellsize + tmp_x;
-    pa.ar[num_vertices].y := (y-1)*cellsize + tmp_y + off_y;
-end;
-num_vertices := num_vertices + 1;
-end;
-
-procedure add_edge(x, y: LongInt; dir: direction);
-var i: LongInt;
-begin
-if dir = DIR_N then
-begin
-    dir := DIR_W
-end
-else if dir = DIR_E then
-begin
-    dir := DIR_N
-end
-else if dir = DIR_S then
-begin
-    dir := DIR_E
-end
-else
-begin
-    dir := DIR_S;
-end;
-
-for i := 0 to 3 do
-begin
-        if dir = DIR_N then
-            dir := DIR_E
-        else if dir = DIR_E then
-            dir := DIR_S
-        else if dir = DIR_S then
-            dir := DIR_W
-        else
-            dir := DIR_N;
-
-    if (dir = DIR_N) and is_x_edge(x, y) then
-        begin
-            x_edge_list[x, y] := false;
-            add_vertex(x+1, y);
-            add_edge(x, y-1, DIR_N);
-            break;
-        end;
-
-    if (dir = DIR_E) and is_y_edge(x+1, y) then
-        begin
-            y_edge_list[x+1, y] := false;
-            add_vertex(x+2, y+1);
-            add_edge(x+1, y, DIR_E);
-            break;
-        end;
-
-    if (dir = DIR_S) and is_x_edge(x, y+1) then
-        begin
-            x_edge_list[x, y+1] := false;
-            add_vertex(x+1, y+2);
-            add_edge(x, y+1, DIR_S);
-            break;
-        end;
-
-    if (dir = DIR_W) and is_y_edge(x, y) then
-        begin
-            y_edge_list[x, y] := false;
-            add_vertex(x, y+1);
-            add_edge(x-1, y, DIR_W);
-            break;
-        end;
-end;
-
-end;
-
-begin
-case cTemplateFilter of
-    0: begin
-        cellsize := small_cell_size;
-        maze_inverted := false;
-    end;
-    1: begin
-        cellsize := medium_cell_size;
-        maze_inverted := false;
-    end;
-    2: begin
-        cellsize := large_cell_size;
-        maze_inverted := false;
-    end;
-    3: begin
-        cellsize := small_cell_size;
-        maze_inverted := true;
-    end;
-    4: begin
-        cellsize := medium_cell_size;
-        maze_inverted := true;
-    end;
-    5: begin
-        cellsize := large_cell_size;
-        maze_inverted := true;
-    end;
-end;
-
-num_cells_x := LAND_WIDTH div cellsize;
-if not odd(num_cells_x) then num_cells_x := num_cells_x - 1; //needs to be odd
-num_cells_y := LAND_HEIGHT div cellsize;
-if not odd(num_cells_y) then num_cells_y := num_cells_y - 1;
-num_edges_x := num_cells_x - 1;
-num_edges_y := num_cells_y - 1;
-seen_cells_x := num_cells_x div 2;
-seen_cells_y := num_cells_y div 2;
-
-if maze_inverted then
-    num_steps := 3 //TODO randomize, between 3 and 5?
-else
-    num_steps := 1;
-SetLength(step_done, num_steps);
-SetLength(last_cell, num_steps);
-SetLength(came_from_pos, num_steps);
-SetLength(came_from, num_steps, num_cells_x*num_cells_y);
-done := false;
-for current_step := 0 to num_steps - 1 do
-    step_done[current_step] := false;
-    came_from_pos[current_step] := 0;
-current_step := 0;
-
-SetLength(seen_list, seen_cells_x, seen_cells_y);
-SetLength(xwalls, seen_cells_x, seen_cells_y - 1);
-SetLength(ywalls, seen_cells_x - 1, seen_cells_y);
-SetLength(x_edge_list, num_edges_x, num_cells_y);
-SetLength(y_edge_list, num_cells_x, num_edges_y);
-SetLength(maze, num_cells_x, num_cells_y);
-
-num_vertices := 0;
-
-playHeight := num_cells_y * cellsize;
-playWidth := num_cells_x * cellsize;
-off_y := LAND_HEIGHT - playHeight;
-
-for x := 0 to playWidth do
-    for y := 0 to off_y - 1 do
-        Land[y, x] := 0;
-
-for x := 0 to playWidth do
-    for y := off_y to LAND_HEIGHT - 1 do
-        Land[y, x] := lfBasic;
-
-for y := 0 to num_cells_y - 1 do
-    for x := 0 to num_cells_x - 1 do
-        maze[x, y] := false;
-
-for x := 0 to seen_cells_x - 1 do
-    for y := 0 to seen_cells_y - 2 do
-        xwalls[x, y] := true;
-
-for x := 0 to seen_cells_x - 2 do
-    for y := 0 to seen_cells_y - 1 do
-        ywalls[x, y] := true;
-
-for x := 0 to seen_cells_x - 1 do
-    for y := 0 to seen_cells_y - 1 do
-        seen_list[x, y] := -1;
-
-for x := 0 to num_edges_x - 1 do
-    for y := 0 to num_cells_y - 1 do
-        x_edge_list[x, y] := false;
-
-for x := 0 to num_cells_x - 1 do
-    for y := 0 to num_edges_y - 1 do
-        y_edge_list[x, y] := false;
-
-for current_step := 0 to num_steps-1 do
-begin
-    x := GetRandom(seen_cells_x - 1) div LongWord(num_steps);
-    last_cell[current_step].x := x + current_step * seen_cells_x div num_steps;
-    last_cell[current_step].y := GetRandom(seen_cells_y);
-end;
-
-while not done do
-begin
-    done := true;
-    for current_step := 0 to num_steps-1 do
-    begin
-        if not step_done[current_step] then
-        begin
-            see_cell;
-            done := false;
-        end;
-    end;
-end;
-
-for x := 0 to seen_cells_x - 1 do
-    for y := 0 to seen_cells_y - 1 do
-        if seen_list[x, y] > -1 then
-            maze[(x+1)*2-1, (y+1)*2-1] := true;
-
-for x := 0 to seen_cells_x - 1 do
-    for y := 0 to seen_cells_y - 2 do
-        if not xwalls[x, y] then
-            maze[x*2 + 1, y*2 + 2] := true;
-
-
-for x := 0 to seen_cells_x - 2 do
-     for y := 0 to seen_cells_y - 1 do
-        if not ywalls[x, y] then
-            maze[x*2 + 2, y*2 + 1] := true;
-
-for x := 0 to num_edges_x - 1 do
-    for y := 0 to num_cells_y - 1 do
-        if maze[x, y] xor maze[x+1, y] then
-            x_edge_list[x, y] := true
-        else
-            x_edge_list[x, y] := false;
-
-for x := 0 to num_cells_x - 1 do
-    for y := 0 to num_edges_y - 1 do
-        if maze[x, y] xor maze[x, y+1] then
-            y_edge_list[x, y] := true
-        else
-            y_edge_list[x, y] := false;
-
-for x := 0 to num_edges_x - 1 do
-    for y := 0 to num_cells_y - 1 do
-        if x_edge_list[x, y] then
-        begin
-            x_edge_list[x, y] := false;
-            add_vertex(x+1, y+1);
-            add_vertex(x+1, y);
-            add_edge(x, y-1, DIR_N);
-            add_vertex(NTPX, 0);
-        end;
-
-pa.count := num_vertices;
-
-RandomizePoints(pa);
-BezierizeEdge(pa, _0_25);
-RandomizePoints(pa);
-BezierizeEdge(pa, _0_25);
-
-DrawEdge(pa, 0);
-
-if maze_inverted then
-    FillLand(1, 1+off_y)
-else
-begin
-    x := 0;
-    while Land[cellsize div 2 + cellsize + off_y, x] = lfBasic do
-        x := x + 1;
-    while Land[cellsize div 2 + cellsize + off_y, x] = 0 do
-        x := x + 1;
-    FillLand(x+1, cellsize div 2 + cellsize + off_y);
-end;
-
-MaxHedgehogs:= 32;
-if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false
-else hasGirders := true;
-leftX:= 0;
-rightX:= playWidth;
-topY:= off_y;
-hasBorder := false;
-end;
 
 procedure GenLandSurface;
 var tmpsurf: PSDL_Surface;
@@ -1049,7 +325,7 @@ begin
     WriteLnToConsole('Generating land...');
     case cMapGen of
         0: GenBlank(EdgeTemplates[SelectTemplate]);
-        1: GenMaze;
+        1: begin ResizeLand(4096,2048); GenMaze; end;
         2: GenDrawnMap;
     else
         OutError('Unknown mapgen', true);
@@ -1072,11 +348,20 @@ begin
             begin
                 if (cReducedQuality and rqBlurryLand) = 0 then
                     begin
-                    if (Land[y, x-1] = lfBasic) and (LandPixels[y, x-1] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y, x-1]
-                    else if (Land[y, x+1] = lfBasic) and (LandPixels[y, x+1] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y, x+1]
-                    else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1, x] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y-1, x]
-                    else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1, x] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y+1, x];
-                    if (((LandPixels[y,x] and AMask) shr AShift) > 10) then LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (128 shl AShift)
+                    if (Land[y, x-1] = lfBasic) and (LandPixels[y, x-1] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y, x-1]
+                        
+                    else if (Land[y, x+1] = lfBasic) and (LandPixels[y, x+1] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y, x+1]
+                        
+                    else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1, x] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y-1, x]
+                        
+                    else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1, x] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y+1, x];
+                        
+                    if (((LandPixels[y,x] and AMask) shr AShift) > 10) then
+                        LandPixels[y,x]:= (LandPixels[y,x] and (not AMask)) or (128 shl AShift)
                     end;
                 Land[y,x]:= lfObject
             end
@@ -1089,14 +374,27 @@ begin
                     ((Land[y-1, x] = lfBasic) and (Land[y-1,x+1] = lfBasic) and (Land[y,x+2] = lfBasic)) or
                     ((Land[y+1, x] = lfBasic) and (Land[y+1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic)) or
                     ((Land[y-1, x] = lfBasic) and (Land[y-1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic))) then
-            begin
+                    
+                begin
+                
                 if (cReducedQuality and rqBlurryLand) = 0 then
+                
                     begin
-                    if (Land[y, x-1] = lfBasic) and (LandPixels[y,x-1] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y, x-1]
-                    else if (Land[y, x+1] = lfBasic) and (LandPixels[y,x+1] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y, x+1]
-                    else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1,x] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y+1, x]
-                    else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1,x] and AMask <> 0) then LandPixels[y, x]:= LandPixels[y-1, x];
-                    if (((LandPixels[y,x] and AMask) shr AShift) > 10) then LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (64 shl AShift)
+                    
+                    if (Land[y, x-1] = lfBasic) and (LandPixels[y,x-1] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y, x-1]
+                        
+                    else if (Land[y, x+1] = lfBasic) and (LandPixels[y,x+1] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y, x+1]
+                        
+                    else if (Land[y+1, x] = lfBasic) and (LandPixels[y+1,x] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y+1, x]
+                        
+                    else if (Land[y-1, x] = lfBasic) and (LandPixels[y-1,x] and AMask <> 0) then
+                        LandPixels[y, x]:= LandPixels[y-1, x];
+                        
+                    if (((LandPixels[y,x] and AMask) shr AShift) > 10) then
+                        LandPixels[y,x]:= (LandPixels[y,x] and (not AMask)) or (64 shl AShift)
                     end;
                 Land[y,x]:= lfObject
             end;
@@ -1107,6 +405,7 @@ end;
 procedure MakeFortsMap;
 var tmpsurf: PSDL_Surface;
 begin
+ResizeLand(4096,2048);
 MaxHedgehogs:= 32;
 // For now, defining a fort is playable area as 3072x1200 - there are no tall forts.  The extra height is to avoid triggering border with current code, also if user turns on a border, it will give a bit more maneuvering room.
 playHeight:= 1200;
@@ -1117,13 +416,11 @@ topY:= LAND_HEIGHT - playHeight;
 
 WriteLnToConsole('Generating forts land...');
 
-tmpsurf:= LoadImage(UserPathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', ifAlpha or ifTransparent or ifIgnoreCaps);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[0]^.Teams[0]^.FortName + 'L', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
+tmpsurf:= LoadDataImage(ptForts, ClansArray[0]^.Teams[0]^.FortName + 'L', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
 BlitImageAndGenerateCollisionInfo(leftX+150, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf);
 SDL_FreeSurface(tmpsurf);
 
-tmpsurf:= LoadImage(UserPathz[ptForts] + '/' + ClansArray[1]^.Teams[0]^.FortName + 'R', ifAlpha or ifTransparent or ifIgnoreCaps);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptForts] + '/' + ClansArray[1]^.Teams[0]^.FortName + 'R', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
+tmpsurf:= LoadDataImage(ptForts, ClansArray[1]^.Teams[0]^.FortName + 'R', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
 BlitImageAndGenerateCollisionInfo(rightX - 150 - tmpsurf^.w, LAND_HEIGHT - tmpsurf^.h, tmpsurf^.w, tmpsurf);
 SDL_FreeSurface(tmpsurf);
 end;
@@ -1134,18 +431,16 @@ var tmpsurf: PSDL_Surface;
     p: PLongwordArray;
     x, y, cpX, cpY: Longword;
 begin
-tmpsurf:= LoadImage(UserPathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps);
+tmpsurf:= LoadDataImage(ptMapCurrent, 'mask', ifAlpha or ifTransparent or ifIgnoreCaps);
 if tmpsurf = nil then
     begin
     mapName:= ExtractFileName(Pathz[ptMapCurrent]);
-    tmpsurf:= LoadImage(UserPathz[ptMissionMaps] + '/' + mapName + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps);
+    tmpsurf:= LoadDataImage(ptMissionMaps, mapName + '/mask', ifAlpha or ifTransparent or ifIgnoreCaps);
     end;
 
 
 if (tmpsurf <> nil) and (tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT) and (tmpsurf^.format^.BytesPerPixel = 4) then
-begin
+    begin
     disableLandBack:= true;
 
     cpX:= (LAND_WIDTH - tmpsurf^.w) div 2;
@@ -1158,19 +453,22 @@ begin
         begin
             for x:= 0 to Pred(tmpsurf^.w) do
             begin
-                if ((AMask and p^[x]) = 0) then
+                // this an if instead of masking colours to avoid confusing map creators
+                if ((AMask and p^[x]) = 0) then 
                     Land[cpY + y, cpX + x]:= 0
-                else if p^[x] = $FFFFFFFF then
+                else if p^[x] = $FFFFFFFF then                  // white
                     Land[cpY + y, cpX + x]:= lfObject
-                else if p^[x] = (AMask or RMask) then
-                    Land[cpY + y, cpX + x]:= lfIndestructible
-                else if p^[x] = AMask then
+                else if p^[x] = AMask then                      // black
                     begin
                     Land[cpY + y, cpX + x]:= lfBasic;
                     disableLandBack:= false
                     end
-                else if p^[x] = (AMask or BMask) then
+                else if p^[x] = (AMask or RMask) then           // red
+                    Land[cpY + y, cpX + x]:= lfIndestructible
+                else if p^[x] = (AMask or BMask) then           // blue
                     Land[cpY + y, cpX + x]:= lfObject or lfIce
+                else if p^[x] = (AMask or GMask) then           // green
+                    Land[cpY + y, cpX + x]:= lfObject or lfBouncy
             end;
             p:= @(p^[tmpsurf^.pitch div 4]);
         end;
@@ -1180,9 +478,9 @@ begin
     if not disableLandBack then
         begin
         // freed in freeModule() below
-        LandBackSurface:= LoadImage(UserPathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent);
-        if LandBackSurface = nil then LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent);
-        if (LandBackSurface <> nil) and cGrayScale then Surface2GrayScale(LandBackSurface)
+        LandBackSurface:= LoadDataImage(ptCurrTheme, 'LandBackTex', ifIgnoreCaps or ifTransparent);
+        if (LandBackSurface <> nil) and GrayScale then
+            Surface2GrayScale(LandBackSurface)
         end;
 end;
 if (tmpsurf <> nil) then
@@ -1196,37 +494,40 @@ var tmpsurf: PSDL_Surface;
     f: textfile;
     mapName: shortstring = '';
 begin
-isMap:= true;
 WriteLnToConsole('Loading land from file...');
 AddProgress;
-tmpsurf:= LoadImage(UserPathz[ptMapCurrent] + '/map', ifAlpha or ifTransparent or ifIgnoreCaps);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', ifAlpha or ifTransparent or ifIgnoreCaps);
+tmpsurf:= LoadDataImage(ptMapCurrent, 'map', ifAlpha or ifTransparent or ifIgnoreCaps);
 if tmpsurf = nil then
     begin
     mapName:= ExtractFileName(Pathz[ptMapCurrent]);
-    tmpsurf:= LoadImage(UserPathz[ptMissionMaps] + '/' + mapName + '/map', ifAlpha or ifTransparent or ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptMissionMaps] + '/' + mapName + '/map', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
+    tmpsurf:= LoadDataImage(ptMissionMaps, mapName + '/map', ifAlpha or ifCritical or ifTransparent or ifIgnoreCaps);
     end;
-TryDo((tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT), 'Map dimensions too big!', true);
+// (bare) Sanity check. Considering possible LongInt comparisons as well as just how much system memoery it would take
+TryDo((tmpsurf^.w < $40000000) and (tmpsurf^.h < $40000000) and (tmpsurf^.w * tmpsurf^.h < 6*1024*1024*1024), 'Map dimensions too big!', true);
+
+ResizeLand(tmpsurf^.w, tmpsurf^.h);
 
 // unC0Rr - should this be passed from the GUI? I am not sure which layer does what
 s:= UserPathz[ptMapCurrent] + '/map.cfg';
-if not FileExists(s) then s:= Pathz[ptMapCurrent] + '/map.cfg';
+if not FileExists(s) then
+    s:= Pathz[ptMapCurrent] + '/map.cfg';
 WriteLnToConsole('Fetching map HH limit');
 {$I-}
 Assign(f, s);
 filemode:= 0; // readonly
 Reset(f);
 if IOResult <> 0 then
-begin
+    begin
     s:= Pathz[ptMissionMaps] + '/' + mapName + '/map.cfg';
     Assign(f, s);
     Reset(f);
-end;
+    end;
 Readln(f);
-if not eof(f) then Readln(f, MaxHedgehogs);
+if not eof(f) then
+    Readln(f, MaxHedgehogs);
 {$I+}
-if (MaxHedgehogs = 0) then MaxHedgehogs:= 18;
+if (MaxHedgehogs = 0) then
+    MaxHedgehogs:= 18;
 
 playHeight:= tmpsurf^.h;
 playWidth:= tmpsurf^.w;
@@ -1271,7 +572,6 @@ begin
     hasBorder:= false;
 
     LoadThemeConfig;
-    isMap:= false;
 
     // is this not needed any more? lets hope setlength sets also 0s
     //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then
@@ -1297,7 +597,7 @@ else
             if Land[y, x] <> 0 then
                 begin
                 inc(c);
-                if c > 200 then // avoid accidental triggering
+                if c > 1000 then // avoid accidental triggering
                     begin
                     hasBorder:= true;
                     break;
@@ -1351,18 +651,21 @@ if hasBorder then
         end;
     end;
 
-if (GameFlags and gfBottomBorder) <> 0 then DrawBottomBorder;
+if (GameFlags and gfBottomBorder) <> 0 then
+    DrawBottomBorder;
 
-if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false;
+if (GameFlags and gfDisableGirders) <> 0 then
+    hasGirders:= false;
 
-if ((GameFlags and gfForts) = 0)
-    and (Pathz[ptMapCurrent] = '')
-    then AddObjects
-else AddProgress();
+if ((GameFlags and gfForts) = 0) and (Pathz[ptMapCurrent] = '') then
+    AddObjects
+    
+else
+    AddProgress();
 
 FreeLandObjects;
 
-if cGrayScale then
+if GrayScale then
     begin
     if (cReducedQuality and rqBlurryLand) = 0 then
         for x:= leftX to rightX do
@@ -1372,7 +675,8 @@ if cGrayScale then
                 w:= round(((w shr RShift and $FF) * RGB_LUMINANCE_RED +
                       (w shr BShift and $FF) * RGB_LUMINANCE_GREEN +
                       (w shr GShift and $FF) * RGB_LUMINANCE_BLUE));
-                if w > 255 then w:= 255;
+                if w > 255 then
+                    w:= 255;
                 w:= (w and $FF shl RShift) or (w and $FF shl BShift) or (w and $FF shl GShift) or (LandPixels[y,x] and AMask);
                 LandPixels[y,x]:= w or (LandPixels[y, x] and AMask)
                 end
@@ -1382,30 +686,41 @@ if cGrayScale then
                 begin
                 w:= LandPixels[y div 2,x div 2];
                 w:= ((w shr RShift and $FF) +  (w shr BShift and $FF) + (w shr GShift and $FF)) div 3;
-                if w > 255 then w:= 255;
-               w:= (w and $FF shl RShift) or (w and $FF shl BShift) or (w and $FF shl GShift) or (LandPixels[y div 2,x div 2] and AMask);
+                if w > 255 then
+                    w:= 255;
+                w:= (w and $FF shl RShift) or (w and $FF shl BShift) or (w and $FF shl GShift) or (LandPixels[y div 2,x div 2] and AMask);
                 LandPixels[y,x]:= w or (LandPixels[y div 2, x div 2] and AMask)
                 end
     end;
-
-UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT);
 end;
 
-function GenPreview: TPreview;
-var x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
-    Preview: TPreview;
+procedure GenPreview(out Preview: TPreview);
+var rh, rw, ox, oy, x, y, xx, yy, t, bit, cbit, lh, lw: LongInt;
 begin
     WriteLnToConsole('Generating preview...');
     case cMapGen of
         0: GenBlank(EdgeTemplates[SelectTemplate]);
-        1: GenMaze;
+        1: begin ResizeLand(4096,2048); GenMaze; end;
         2: GenDrawnMap;
     else
         OutError('Unknown mapgen', true);
     end;
 
-    lh:= LAND_HEIGHT div 128;
-    lw:= LAND_WIDTH div 32;
+    // strict scaling needed here since preview assumes a rectangle
+    rh:= max(LAND_HEIGHT,2048);
+    rw:= max(LAND_WIDTH,4096);
+    ox:= 0;
+    if rw < rh*2 then
+        begin
+        rw:= rh*2;
+        end;
+    if rh < rw div 2 then rh:= rw * 2;
+    
+    ox:= (rw-LAND_WIDTH) div 2;
+    oy:= rh-LAND_HEIGHT;
+
+    lh:= rh div 128;
+    lw:= rw div 32;
     for y:= 0 to 127 do
         for x:= 0 to 31 do
         begin
@@ -1416,13 +731,13 @@ begin
                 cbit:= bit * 8;
                 for yy:= y * lh to y * lh + 7 do
                     for xx:= x * lw + cbit to x * lw + cbit + 7 do
-                        if Land[yy, xx] <> 0 then inc(t);
+                        if ((yy-oy) and LAND_HEIGHT_MASK = 0) and ((xx-ox) and LAND_WIDTH_MASK = 0) 
+                           and (Land[yy-oy, xx-ox] <> 0) then
+                            inc(t);
                 if t > 8 then
                     Preview[y, x]:= Preview[y, x] or ($80 shr bit);
             end;
         end;
-
-    GenPreview:= Preview
 end;
 
 
@@ -1440,7 +755,7 @@ var adler, i: LongInt;
 begin
     adler:= 1;
     for i:= 0 to LAND_HEIGHT-1 do
-        Adler32Update(adler, @Land[i,0], LAND_WIDTH);
+        adler:= Adler32Update(adler, @Land[i,0], LAND_WIDTH);
     s:= 'M' + IntToStr(adler) + cScriptName;
 
     chLandCheck(s);
@@ -1449,12 +764,14 @@ end;
 
 procedure initModule;
 begin
-    RegisterVariable('landcheck', vtCommand, @chLandCheck, false);
-    RegisterVariable('sendlanddigest', vtCommand, @chSendLandDigest, false);
+    RegisterVariable('landcheck', @chLandCheck, false);
+    RegisterVariable('sendlanddigest', @chSendLandDigest, false);
 
     LandBackSurface:= nil;
     digest:= '';
-
+    LAND_WIDTH:= 0;
+    LAND_HEIGHT:= 0;
+(*
     if (cReducedQuality and rqBlurryLand) = 0 then
         SetLength(LandPixels, LAND_HEIGHT, LAND_WIDTH)
     else
@@ -1462,13 +779,14 @@ begin
 
     SetLength(Land, LAND_HEIGHT, LAND_WIDTH);
     SetLength(LandDirty, (LAND_HEIGHT div 32), (LAND_WIDTH div 32));
+*)
 end;
 
 procedure freeModule;
 begin
-    Land:= nil;
-    LandPixels:= nil;
-    LandDirty:= nil;
+    SetLength(Land, 0, 0);
+    SetLength(LandPixels, 0, 0);
+    SetLength(LandDirty, 0, 0);
 end;
 
 end.
diff --git a/hedgewars/uLandGenMaze.pas b/hedgewars/uLandGenMaze.pas
new file mode 100644
index 0000000..3cd92be
--- /dev/null
+++ b/hedgewars/uLandGenMaze.pas
@@ -0,0 +1,485 @@
+unit uLandGenMaze;
+
+interface
+
+procedure GenMaze;
+
+implementation
+
+uses uRandom, uLandOutline, uLandTemplates, uVariables, uFloat, uConsts;
+
+type direction = record x, y: LongInt; end;
+const DIR_N: direction = (x: 0; y: -1);
+    DIR_E: direction = (x: 1; y: 0);
+    DIR_S: direction = (x: 0; y: 1);
+    DIR_W: direction = (x: -1; y: 0);
+
+
+operator = (const a, b: direction) c: Boolean;
+begin
+    c := (a.x = b.x) and (a.y = b.y);
+end;
+
+const small_cell_size = 128;
+    medium_cell_size = 192;
+    large_cell_size = 256;
+    braidness = 10;
+
+var x, y: LongInt;
+    cellsize: LongInt; //selected by the user in the gui
+    seen_cells_x, seen_cells_y: LongInt; //number of cells that can be visited by the generator, that is every second cell in x and y direction. the cells between there are walls that will be removed when we move from one cell to another
+    num_edges_x, num_edges_y: LongInt; //number of resulting edges that need to be vertexificated
+    num_cells_x, num_cells_y: LongInt; //actual number of cells, depending on cell size
+    seen_list: array of array of LongInt;
+    xwalls: array of array of Boolean;
+    ywalls: array of array of Boolean;
+    x_edge_list: array of array of Boolean;
+    y_edge_list: array of array of Boolean;
+    maze: array of array of Boolean;
+    pa: TPixAr;
+    num_vertices: LongInt;
+    off_y: LongInt;
+    num_steps: LongInt;
+    current_step: LongInt;
+    step_done: array of Boolean;
+    done: Boolean;
+    last_cell: array of record x, y: LongInt; end;
+    came_from: array of array of record x, y: LongInt; end;
+    came_from_pos: array of LongInt;
+    maze_inverted: Boolean;
+
+function when_seen(x: LongInt; y: LongInt): LongInt;
+begin
+if (x < 0) or (x >= seen_cells_x) or (y < 0) or (y >= seen_cells_y) then
+    when_seen := current_step
+else
+    when_seen := seen_list[x, y];
+end;
+
+function is_x_edge(x, y: LongInt): Boolean;
+begin
+if (x < 0) or (x > num_edges_x) or (y < 0) or (y > num_cells_y) then
+    is_x_edge := false
+else
+    is_x_edge := x_edge_list[x, y];
+end;
+
+function is_y_edge(x, y: LongInt): Boolean;
+begin
+if (x < 0) or (x > num_cells_x) or (y < 0) or (y > num_edges_y) then
+    is_y_edge := false
+else
+    is_y_edge := y_edge_list[x, y];
+end;
+
+procedure see_cell;
+var dir: direction;
+    tries: LongInt;
+    x, y: LongInt;
+    found_cell: Boolean;
+    next_dir_clockwise: Boolean;
+
+begin
+x := last_cell[current_step].x;
+y := last_cell[current_step].y;
+seen_list[x, y] := current_step;
+case GetRandom(4) of
+    0: dir := DIR_N;
+    1: dir := DIR_E;
+    2: dir := DIR_S;
+    3: dir := DIR_W;
+end;
+tries := 0;
+found_cell := false;
+if getrandom(2) = 1 then
+    next_dir_clockwise := true
+else
+    next_dir_clockwise := false;
+
+while (tries < 5) and (not found_cell) do
+begin
+    if when_seen(x + dir.x, y + dir.y) = current_step then //we are seeing ourselves, try another direction
+    begin
+        //we have already seen the target cell, decide if we should remove the wall anyway
+        //(or put a wall there if maze_inverted, but we are not doing that right now)
+        if not maze_inverted and (GetRandom(braidness) = 0) then
+        //or just warn that inverted+braid+indestructible terrain != good idea
+        begin
+            case dir.x of
+            
+                -1:
+                if x > 0 then
+                    ywalls[x-1, y] := false;
+                1:
+                if x < seen_cells_x - 1 then
+                    ywalls[x, y] := false;
+            end;
+            case dir.y of
+                -1:
+                if y > 0 then
+                    xwalls[x, y-1] := false;
+                1:
+                if y < seen_cells_y - 1 then
+                    xwalls[x, y] := false;
+            end;
+        end;
+        if next_dir_clockwise then
+        begin
+            if dir = DIR_N then
+                dir := DIR_E
+            else if dir = DIR_E then
+                dir := DIR_S
+            else if dir = DIR_S then
+                dir := DIR_W
+            else
+                dir := DIR_N;
+        end
+        else
+        begin
+            if dir = DIR_N then
+                dir := DIR_W
+            else if dir = DIR_E then
+                dir := DIR_N
+            else if dir = DIR_S then
+                dir := DIR_E
+            else
+                dir := DIR_S;
+        end
+    end
+    else if when_seen(x + dir.x, y + dir.y) = -1 then //cell was not seen yet, go there
+        begin
+        case dir.y of
+            -1: xwalls[x, y-1] := false;
+            1: xwalls[x, y] := false;
+        end;
+        case dir.x of
+            -1: ywalls[x-1, y] := false;
+            1: ywalls[x, y] := false;
+        end;
+        last_cell[current_step].x := x+dir.x;
+        last_cell[current_step].y := y+dir.y;
+        came_from_pos[current_step] := came_from_pos[current_step] + 1;
+        came_from[current_step, came_from_pos[current_step]].x := x;
+        came_from[current_step, came_from_pos[current_step]].y := y;
+        found_cell := true;
+        end
+    else //we are seeing someone else, quit
+        begin
+        step_done[current_step] := true;
+        found_cell := true;
+        end;
+
+    tries := tries + 1;
+end;
+if not found_cell then
+    begin
+    last_cell[current_step].x := came_from[current_step, came_from_pos[current_step]].x;
+    last_cell[current_step].y := came_from[current_step, came_from_pos[current_step]].y;
+    came_from_pos[current_step] := came_from_pos[current_step] - 1;
+    
+    if came_from_pos[current_step] >= 0 then
+        see_cell
+        
+    else
+        step_done[current_step] := true;
+    end;
+end;
+
+procedure add_vertex(x, y: LongInt);
+var tmp_x, tmp_y: LongInt;
+begin
+if x = NTPX then
+begin
+    if pa.ar[num_vertices - 6].x = NTPX then
+    begin
+        num_vertices := num_vertices - 6;
+    end
+    else
+    begin
+        pa.ar[num_vertices].x := NTPX;
+        pa.ar[num_vertices].y := 0;
+    end
+end
+else
+begin
+    if maze_inverted or (x mod 2 = 0) then
+        tmp_x := cellsize
+    else
+        tmp_x := cellsize * 2 div 3;
+        
+    if maze_inverted or (y mod 2 = 0) then
+        tmp_y := cellsize
+    else
+        tmp_y := cellsize * 2 div 3;
+
+    pa.ar[num_vertices].x := (x-1)*cellsize + tmp_x;
+    pa.ar[num_vertices].y := (y-1)*cellsize + tmp_y + off_y;
+end;
+num_vertices := num_vertices + 1;
+end;
+
+procedure add_edge(x, y: LongInt; dir: direction);
+var i: LongInt;
+begin
+if dir = DIR_N then
+    begin
+    dir := DIR_W
+    end
+else if dir = DIR_E then
+    begin
+    dir := DIR_N
+    end
+else if dir = DIR_S then
+    begin
+    dir := DIR_E
+    end
+else
+    begin
+    dir := DIR_S;
+    end;
+
+for i := 0 to 3 do
+    begin
+    if dir = DIR_N then
+        dir := DIR_E
+    else if dir = DIR_E then
+        dir := DIR_S
+    else if dir = DIR_S then
+        dir := DIR_W
+    else
+        dir := DIR_N;
+
+if (dir = DIR_N) and is_x_edge(x, y) then
+    begin
+        x_edge_list[x, y] := false;
+        add_vertex(x+1, y);
+        add_edge(x, y-1, DIR_N);
+        break;
+    end;
+
+if (dir = DIR_E) and is_y_edge(x+1, y) then
+    begin
+        y_edge_list[x+1, y] := false;
+        add_vertex(x+2, y+1);
+        add_edge(x+1, y, DIR_E);
+        break;
+    end;
+
+if (dir = DIR_S) and is_x_edge(x, y+1) then
+    begin
+        x_edge_list[x, y+1] := false;
+        add_vertex(x+1, y+2);
+        add_edge(x, y+1, DIR_S);
+        break;
+    end;
+
+if (dir = DIR_W) and is_y_edge(x, y) then
+    begin
+        y_edge_list[x, y] := false;
+        add_vertex(x, y+1);
+        add_edge(x-1, y, DIR_W);
+        break;
+    end;
+end;
+
+end;
+
+procedure GenMaze;
+begin
+case cTemplateFilter of
+    0: begin
+        cellsize := small_cell_size;
+        maze_inverted := false;
+    end;
+    1: begin
+        cellsize := medium_cell_size;
+        maze_inverted := false;
+    end;
+    2: begin
+        cellsize := large_cell_size;
+        maze_inverted := false;
+    end;
+    3: begin
+        cellsize := small_cell_size;
+        maze_inverted := true;
+    end;
+    4: begin
+        cellsize := medium_cell_size;
+        maze_inverted := true;
+    end;
+    5: begin
+        cellsize := large_cell_size;
+        maze_inverted := true;
+    end;
+end;
+
+num_cells_x := LAND_WIDTH div cellsize;
+if not odd(num_cells_x) then
+    num_cells_x := num_cells_x - 1; //needs to be odd
+    
+num_cells_y := LAND_HEIGHT div cellsize;
+if not odd(num_cells_y) then
+    num_cells_y := num_cells_y - 1;
+    
+num_edges_x := num_cells_x - 1;
+num_edges_y := num_cells_y - 1;
+
+seen_cells_x := num_cells_x div 2;
+seen_cells_y := num_cells_y div 2;
+
+if maze_inverted then
+    num_steps := 3 //TODO randomize, between 3 and 5?
+else
+    num_steps := 1;
+    
+SetLength(step_done, num_steps);
+SetLength(last_cell, num_steps);
+SetLength(came_from_pos, num_steps);
+SetLength(came_from, num_steps, num_cells_x*num_cells_y);
+done := false;
+
+for current_step := 0 to num_steps - 1 do
+    step_done[current_step] := false;
+    came_from_pos[current_step] := 0;
+    
+current_step := 0;
+
+SetLength(seen_list, seen_cells_x, seen_cells_y);
+SetLength(xwalls, seen_cells_x, seen_cells_y - 1);
+SetLength(ywalls, seen_cells_x - 1, seen_cells_y);
+SetLength(x_edge_list, num_edges_x, num_cells_y);
+SetLength(y_edge_list, num_cells_x, num_edges_y);
+SetLength(maze, num_cells_x, num_cells_y);
+
+num_vertices := 0;
+
+playHeight := num_cells_y * cellsize;
+playWidth := num_cells_x * cellsize;
+off_y := LAND_HEIGHT - playHeight;
+
+for x := 0 to playWidth do
+    for y := 0 to off_y - 1 do
+        Land[y, x] := 0;
+
+for x := 0 to playWidth do
+    for y := off_y to LAND_HEIGHT - 1 do
+        Land[y, x] := lfBasic;
+
+for y := 0 to num_cells_y - 1 do
+    for x := 0 to num_cells_x - 1 do
+        maze[x, y] := false;
+
+for x := 0 to seen_cells_x - 1 do
+    for y := 0 to seen_cells_y - 2 do
+        xwalls[x, y] := true;
+
+for x := 0 to seen_cells_x - 2 do
+    for y := 0 to seen_cells_y - 1 do
+        ywalls[x, y] := true;
+
+for x := 0 to seen_cells_x - 1 do
+    for y := 0 to seen_cells_y - 1 do
+        seen_list[x, y] := -1;
+
+for x := 0 to num_edges_x - 1 do
+    for y := 0 to num_cells_y - 1 do
+        x_edge_list[x, y] := false;
+
+for x := 0 to num_cells_x - 1 do
+    for y := 0 to num_edges_y - 1 do
+        y_edge_list[x, y] := false;
+
+for current_step := 0 to num_steps-1 do
+    begin
+    x := GetRandom(seen_cells_x - 1) div LongWord(num_steps);
+    last_cell[current_step].x := x + current_step * seen_cells_x div num_steps;
+    last_cell[current_step].y := GetRandom(seen_cells_y);
+end;
+
+while not done do
+    begin
+    done := true;
+    for current_step := 0 to num_steps-1 do
+    begin
+        if not step_done[current_step] then
+        begin
+            see_cell;
+            done := false;
+        end;
+    end;
+end;
+
+for x := 0 to seen_cells_x - 1 do
+    for y := 0 to seen_cells_y - 1 do
+        if seen_list[x, y] > -1 then
+            maze[(x+1)*2-1, (y+1)*2-1] := true;
+
+for x := 0 to seen_cells_x - 1 do
+    for y := 0 to seen_cells_y - 2 do
+        if not xwalls[x, y] then
+            maze[x*2 + 1, y*2 + 2] := true;
+
+
+for x := 0 to seen_cells_x - 2 do
+     for y := 0 to seen_cells_y - 1 do
+        if not ywalls[x, y] then
+            maze[x*2 + 2, y*2 + 1] := true;
+
+for x := 0 to num_edges_x - 1 do
+    for y := 0 to num_cells_y - 1 do
+        if maze[x, y] xor maze[x+1, y] then
+            x_edge_list[x, y] := true
+        else
+            x_edge_list[x, y] := false;
+
+for x := 0 to num_cells_x - 1 do
+    for y := 0 to num_edges_y - 1 do
+        if maze[x, y] xor maze[x, y+1] then
+            y_edge_list[x, y] := true
+        else
+            y_edge_list[x, y] := false;
+
+for x := 0 to num_edges_x - 1 do
+    for y := 0 to num_cells_y - 1 do
+        if x_edge_list[x, y] then
+            begin
+            x_edge_list[x, y] := false;
+            add_vertex(x+1, y+1);
+            add_vertex(x+1, y);
+            add_edge(x, y-1, DIR_N);
+            add_vertex(NTPX, 0);
+            end;
+
+pa.count := num_vertices;
+
+RandomizePoints(pa);
+BezierizeEdge(pa, _0_25);
+RandomizePoints(pa);
+BezierizeEdge(pa, _0_25);
+
+DrawEdge(pa, 0);
+
+if maze_inverted then
+    FillLand(1, 1+off_y)
+else
+    begin
+    x := 0;
+    while Land[cellsize div 2 + cellsize + off_y, x] = lfBasic do
+        x := x + 1;
+    while Land[cellsize div 2 + cellsize + off_y, x] = 0 do
+        x := x + 1;
+    FillLand(x+1, cellsize div 2 + cellsize + off_y);
+    end;
+
+MaxHedgehogs:= 32;
+if (GameFlags and gfDisableGirders) <> 0 then
+    hasGirders:= false
+else
+    hasGirders := true;
+leftX:= 0;
+rightX:= playWidth;
+topY:= off_y;
+hasBorder := false;
+end;
+
+end.
diff --git a/hedgewars/uLandGraphics.pas b/hedgewars/uLandGraphics.pas
index 9529f58..566040a 100644
--- a/hedgewars/uLandGraphics.pas
+++ b/hedgewars/uLandGraphics.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,10 +22,10 @@ unit uLandGraphics;
 interface
 uses uFloat, uConsts, uTypes;
 
-type PRangeArray = ^TRangeArray;
-     TRangeArray = array[0..31] of record
+type TRangeArray = array[0..31] of record
                                    Left, Right: LongInt;
                                    end;
+     PRangeArray = ^TRangeArray;
 
 function  addBgColor(OldColor, NewColor: LongWord): LongWord;
 function  SweepDirty: boolean;
@@ -36,8 +36,11 @@ function  DrawExplosion(X, Y, Radius: LongInt): Longword;
 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte);
 procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt);
 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword);
-procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean);
+procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean);
 function  LandBackPixel(x, y: LongInt): LongWord;
+procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
+procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
+procedure DumpLandToLog(x, y, r: LongInt);
 
 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
 
@@ -56,7 +59,7 @@ begin
         begin
         addBgColor:= NewColor;
         exit
-        end; 
+        end;
     // Get colors
     oRed   := (OldColor shr RShift);
     oGreen := (OldColor shr GShift);
@@ -69,7 +72,7 @@ begin
     // Mix colors
     nRed   := min(255,((nRed*nAlpha) div 255) + ((oRed*oAlpha*byte(255-nAlpha)) div 65025));
     nGreen := min(255,((nGreen*nAlpha) div 255) + ((oGreen*oAlpha*byte(255-nAlpha)) div 65025));
-    nBlue  := min(255,((nBlue*nAlpha) div 255) + ((oBlue*oAlpha*byte(255-nAlpha)) div 65025)); 
+    nBlue  := min(255,((nBlue*nAlpha) div 255) + ((oBlue*oAlpha*byte(255-nAlpha)) div 65025));
     nAlpha := min(255, oAlpha + nAlpha);
 
     addBgColor := (nAlpha shl AShift) or (nRed shl RShift) or (nGreen shl GShift) or (nBlue shl BShift);
@@ -83,7 +86,7 @@ if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
         if (Land[y + dy, i] and lfIndestructible) = 0 then
             Land[y + dy, i]:= Value;
 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+    for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
         if (Land[y - dy, i] and lfIndestructible) = 0 then
             Land[y - dy, i]:= Value;
 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
@@ -96,82 +99,107 @@ if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
             Land[y - dx, i]:= Value;
 end;
 
-procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean);
+procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean);
 var i: LongInt;
 begin
 if not doSet then
-   begin
-   if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-          if (Land[y + dy, i] > 0) and (Land[y + dy, i] < 256) then dec(Land[y + dy, i]); // check > 0 because explosion can erase collision data
-   if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-          if (Land[y - dy, i] > 0) and (Land[y - dy, i] < 256) then dec(Land[y - dy, i]);
-   if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-          if (Land[y + dx, i] > 0) and (Land[y + dx, i] < 256) then dec(Land[y + dx, i]);
-   if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-          if (Land[y - dx, i] > 0) and (Land[y - dx, i] < 256) then dec(Land[y - dx, i]);
-   end else
-   begin
-   if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-          if (Land[y + dy, i] < 256) then
-              inc(Land[y + dy, i]);
-   if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-          if (Land[y - dy, i] < 256) then
-              inc(Land[y - dy, i]);
-   if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-          if (Land[y + dx, i] < 256) then
-              inc(Land[y + dx, i]);
-   if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
-      for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-          if (Land[y - dx, i] < 256) then
-              inc(Land[y - dx, i]);
-   end
+    begin
+    if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y + dy, i]:= Land[y + dy, i] and $FF7F
+            else if Land[y + dy, i] and $007F > 0 then
+                Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1);
+    if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y - dy, i]:= Land[y - dy, i] and $FF7F
+            else if Land[y - dy, i] and $007F > 0 then
+                Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1);
+    if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y + dx, i]:= Land[y + dx, i] and $FF7F
+            else if Land[y + dx, i] and $007F > 0 then
+                Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1);
+    if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y - dx, i]:= Land[y - dx, i] and $FF7F
+            else if Land[y - dx, i] and $007F > 0 then
+                Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1)
+    end
+else
+    begin
+    if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y + dy, i]:= Land[y + dy, i] or $80
+            else if Land[y + dy, i] and $007F < 127 then
+                Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1);
+    if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y - dy, i]:= Land[y - dy, i] or $80
+            else if Land[y - dy, i] and $007F < 127 then
+                Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1);
+    if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y + dx, i]:= Land[y + dx, i] or $80
+            else if Land[y + dx, i] and $007F < 127 then
+                Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1);
+    if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
+        for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+            if isCurrent then
+                Land[y - dx, i]:= Land[y - dx, i] or $80
+            else if Land[y - dx, i] and $007F < 127 then
+                Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1)
+    end
 end;
 
 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword);
 var dx, dy, d: LongInt;
 begin
-  dx:= 0;
-  dy:= Radius;
-  d:= 3 - 2 * Radius;
-  while (dx < dy) do
-     begin
-     FillCircleLines(x, y, dx, dy, Value);
-     if (d < 0)
-     then d:= d + 4 * dx + 6
-     else begin
-          d:= d + 4 * (dx - dy) + 10;
-          dec(dy)
-          end;
-     inc(dx)
-     end;
-  if (dx = dy) then FillCircleLines(x, y, dx, dy, Value);
+dx:= 0;
+dy:= Radius;
+d:= 3 - 2 * Radius;
+while (dx < dy) do
+    begin
+    FillCircleLines(x, y, dx, dy, Value);
+    if (d < 0) then
+        d:= d + 4 * dx + 6
+    else
+        begin
+        d:= d + 4 * (dx - dy) + 10;
+        dec(dy)
+        end;
+    inc(dx)
+    end;
+if (dx = dy) then
+    FillCircleLines(x, y, dx, dy, Value);
 end;
 
-procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet: boolean);
+procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean);
 var dx, dy, d: LongInt;
 begin
-  dx:= 0;
-  dy:= Radius;
-  d:= 3 - 2 * Radius;
-  while (dx < dy) do
-     begin
-     ChangeCircleLines(x, y, dx, dy, doSet);
-     if (d < 0)
-     then d:= d + 4 * dx + 6
-     else begin
-          d:= d + 4 * (dx - dy) + 10;
-          dec(dy)
-          end;
-     inc(dx)
-     end;
-  if (dx = dy) then ChangeCircleLines(x, y, dx, dy, doSet)
+dx:= 0;
+dy:= Radius;
+d:= 3 - 2 * Radius;
+while (dx < dy) do
+    begin
+    ChangeCircleLines(x, y, dx, dy, doSet, isCurrent);
+    if (d < 0) then
+        d:= d + 4 * dx + 6
+    else
+        begin
+        d:= d + 4 * (dx - dy) + 10;
+        dec(dy)
+        end;
+    inc(dx)
+    end;
+if (dx = dy) then
+    ChangeCircleLines(x, y, dx, dy, doSet, isCurrent)
 end;
 
 procedure FillLandCircleLines0(x, y, dx, dy: LongInt);
@@ -222,90 +250,90 @@ begin
 cnt:= 0;
 t:= y + dy;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-       if (Land[t, i] and lfIndestructible) = 0 then
-           begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-               begin
-               by:= t; bx:= i;
-               end
-           else
-               begin
-               by:= t div 2; bx:= i div 2;
-               end;
-           if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
-               begin
-               inc(cnt);
-               LandPixels[by, bx]:= LandBackPixel(i, t)
-               end
-           else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then 
-               LandPixels[by, bx]:= 0
-           end;
+    for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+        if (Land[t, i] and lfIndestructible) = 0 then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                begin
+                by:= t; bx:= i;
+                end
+            else
+                begin
+                by:= t div 2; bx:= i div 2;
+                end;
+            if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
+                begin
+                inc(cnt);
+                LandPixels[by, bx]:= LandBackPixel(i, t)
+                end
+            else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
+                LandPixels[by, bx]:= 0
+            end;
 
 t:= y - dy;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-       if (Land[t, i] and lfIndestructible) = 0 then
-           begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-               begin
-               by:= t; bx:= i;
-               end
-           else
-               begin
-               by:= t div 2; bx:= i div 2;
-               end;
-           if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
-               begin
-               inc(cnt);
-               LandPixels[by, bx]:= LandBackPixel(i, t)
-               end
-           else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then 
-               LandPixels[by, bx]:= 0
-           end;
+    for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+        if (Land[t, i] and lfIndestructible) = 0 then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                begin
+                by:= t; bx:= i;
+                end
+            else
+                begin
+                by:= t div 2; bx:= i div 2;
+                end;
+            if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
+                begin
+                inc(cnt);
+                LandPixels[by, bx]:= LandBackPixel(i, t)
+                end
+            else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
+                LandPixels[by, bx]:= 0
+            end;
 
 t:= y + dx;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-       if (Land[t, i] and lfIndestructible) = 0 then
-           begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-               begin
-               by:= t; bx:= i;
-               end
-           else
-               begin
-               by:= t div 2; bx:= i div 2;
-               end;
-           if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
-               begin
-               inc(cnt);
-               LandPixels[by, bx]:= LandBackPixel(i, t)
-               end
-           else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then 
-               LandPixels[by, bx]:= 0
-           end;
+    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+        if (Land[t, i] and lfIndestructible) = 0 then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                begin
+                by:= t; bx:= i;
+                end
+            else
+                begin
+                by:= t div 2; bx:= i div 2;
+                end;
+            if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
+                begin
+                inc(cnt);
+                LandPixels[by, bx]:= LandBackPixel(i, t)
+                end
+            else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
+                LandPixels[by, bx]:= 0
+            end;
 t:= y - dx;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-       if (Land[t, i] and lfIndestructible) = 0 then
-           begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-               begin
-               by:= t; bx:= i;
-               end
-           else
-               begin
-               by:= t div 2; bx:= i div 2;
-               end;
-           if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and not (disableLandBack) then
-               begin
-               inc(cnt);
-               LandPixels[by, bx]:= LandBackPixel(i, t)
-               end
-           else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then 
-               LandPixels[by, bx]:= 0
-           end;
+    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+        if (Land[t, i] and lfIndestructible) = 0 then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                begin
+                by:= t; bx:= i;
+                end
+            else
+                begin
+                by:= t div 2; bx:= i div 2;
+                end;
+            if ((Land[t, i] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
+                begin
+                inc(cnt);
+                LandPixels[by, bx]:= LandBackPixel(i, t)
+                end
+            else if ((Land[t, i] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
+                LandPixels[by, bx]:= 0
+            end;
 FillLandCircleLinesBG:= cnt;
 end;
 
@@ -314,62 +342,62 @@ var i, t: LongInt;
 begin
 t:= y + dy;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-       if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
-          begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-            LandPixels[t, i]:= cExplosionBorderColor
-          else
-            LandPixels[t div 2, i div 2]:= cExplosionBorderColor;
-
-          Land[t, i]:= Land[t, i] or lfDamaged;
-          //Despeckle(i, t);
-          LandDirty[t div 32, i div 32]:= 1;
-          end;
+    for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+        if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                LandPixels[t, i]:= ExplosionBorderColor
+            else
+                LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
+
+            Land[t, i]:= Land[t, i] or lfDamaged;
+            //Despeckle(i, t);
+            LandDirty[t div 32, i div 32]:= 1;
+            end;
 
 t:= y - dy;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
-       if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
-          begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-              LandPixels[t, i]:= cExplosionBorderColor
+    for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do
+        if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                LandPixels[t, i]:= ExplosionBorderColor
             else
-              LandPixels[t div 2, i div 2]:= cExplosionBorderColor;
-          Land[t, i]:= Land[t, i] or lfDamaged;
-          //Despeckle(i, t);
-          LandDirty[t div 32, i div 32]:= 1;
-          end;
+                LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
+            Land[t, i]:= Land[t, i] or lfDamaged;
+            //Despeckle(i, t);
+            LandDirty[t div 32, i div 32]:= 1;
+            end;
 
 t:= y + dx;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-       if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
-           begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-           LandPixels[t, i]:= cExplosionBorderColor
+    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+        if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                LandPixels[t, i]:= ExplosionBorderColor
             else
-           LandPixels[t div 2, i div 2]:= cExplosionBorderColor;
+               LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
 
-           Land[t, i]:= Land[t, i] or lfDamaged;
-           //Despeckle(i, t);
-           LandDirty[t div 32, i div 32]:= 1;
-           end;
+            Land[t, i]:= Land[t, i] or lfDamaged;
+            //Despeckle(i, t);
+            LandDirty[t div 32, i div 32]:= 1;
+            end;
 
 t:= y - dx;
 if (t and LAND_HEIGHT_MASK) = 0 then
-   for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
-       if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
-          begin
-           if (cReducedQuality and rqBlurryLand) = 0 then
-          LandPixels[t, i]:= cExplosionBorderColor
+    for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do
+        if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then
+            begin
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                LandPixels[t, i]:= ExplosionBorderColor
             else
-          LandPixels[t div 2, i div 2]:= cExplosionBorderColor;
+                LandPixels[t div 2, i div 2]:= ExplosionBorderColor;
 
-          Land[t, i]:= Land[t, i] or lfDamaged;
-          //Despeckle(i, y - dy);
-          LandDirty[t div 32, i div 32]:= 1;
-          end;
+            Land[t, i]:= Land[t, i] or lfDamaged;
+            //Despeckle(i, y - dy);
+            LandDirty[t div 32, i div 32]:= 1;
+            end;
 end;
 
 function DrawExplosion(X, Y, Radius: LongInt): Longword;
@@ -387,15 +415,17 @@ begin
     while (dx < dy) do
         begin
         inc(cnt, FillLandCircleLinesBG(x, y, dx, dy));
-        if (d < 0)
-        then d:= d + 4 * dx + 6
-        else begin
+        if (d < 0) then
+            d:= d + 4 * dx + 6
+        else
+            begin
             d:= d + 4 * (dx - dy) + 10;
             dec(dy)
             end;
         inc(dx)
         end;
-    if (dx = dy) then inc(cnt, FillLandCircleLinesBG(x, y, dx, dy));
+    if (dx = dy) then
+        inc(cnt, FillLandCircleLinesBG(x, y, dx, dy));
     end;
 
 // draw a hole in land
@@ -408,15 +438,17 @@ if Radius > 20 then
     while (dx < dy) do
         begin
         FillLandCircleLines0(x, y, dx, dy);
-        if (d < 0)
-        then d:= d + 4 * dx + 6
-        else begin
+        if (d < 0) then
+            d:= d + 4 * dx + 6
+        else
+            begin
             d:= d + 4 * (dx - dy) + 10;
             dec(dy)
             end;
         inc(dx)
         end;
-    if (dx = dy) then FillLandCircleLines0(x, y, dx, dy);
+    if (dx = dy) then
+        FillLandCircleLines0(x, y, dx, dy);
     end;
 
   // FillRoundInLand after erasing land pixels to allow Land 0 check for mask.png to function
@@ -431,22 +463,24 @@ if Radius > 20 then
     while (dx < dy) do
         begin
         FillLandCircleLinesEBC(x, y, dx, dy);
-        if (d < 0)
-        then d:= d + 4 * dx + 6
-        else begin
+        if (d < 0) then
+            d:= d + 4 * dx + 6
+        else
+            begin
             d:= d + 4 * (dx - dy) + 10;
             dec(dy)
             end;
         inc(dx)
         end;
-    if (dx = dy) then FillLandCircleLinesEBC(x, y, dx, dy);
+    if (dx = dy) then
+        FillLandCircleLinesEBC(x, y, dx, dy);
     end;
 
 tx:= Max(X - Radius - 1, 0);
 dx:= Min(X + Radius + 1, LAND_WIDTH) - tx;
 ty:= Max(Y - Radius - 1, 0);
 dy:= Min(Y + Radius + 1, LAND_HEIGHT) - ty;
-UpdateLandTexture(tx, dx, ty, dy);
+UpdateLandTexture(tx, dx, ty, dy, false);
 DrawExplosion:= cnt
 end;
 
@@ -470,7 +504,7 @@ for i:= 0 to Pred(Count) do
                     end;
                 if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
                     LandPixels[by, bx]:= LandBackPixel(tx, ty)
-                else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then 
+                else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
                     LandPixels[by, bx]:= 0
                 end
             end;
@@ -486,10 +520,10 @@ for i:= 0 to Pred(Count) do
         for tx:= Max(0, ar^[i].Left - Radius) to Min(LAND_WIDTH, ar^[i].Right + Radius) do
             if ((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0) then
                 begin
-                    if (cReducedQuality and rqBlurryLand) = 0 then
-                        LandPixels[ty, tx]:= cExplosionBorderColor
-                    else
-                        LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor;
+                 if (cReducedQuality and rqBlurryLand) = 0 then
+                    LandPixels[ty, tx]:= ExplosionBorderColor
+                else
+                    LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor;
 
                 Land[ty, tx]:= Land[ty, tx] or lfDamaged;
                 LandDirty[ty div 32, tx div 32]:= 1;
@@ -498,7 +532,7 @@ for i:= 0 to Pred(Count) do
     end;
 
 
-UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT)
+UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false)
 end;
 
 //
@@ -529,19 +563,19 @@ for i:= 0 to 7 do
     Y:= Y + dY;
     tx:= hwRound(X);
     ty:= hwRound(Y);
-    if ((ty and LAND_HEIGHT_MASK) = 0) and
-       ((tx and LAND_WIDTH_MASK) = 0) and
-       (((Land[ty, tx] and lfBasic) <> 0) or
-       ((Land[ty, tx] and lfObject) <> 0)) then
+    if ((ty and LAND_HEIGHT_MASK) = 0)
+    and ((tx and LAND_WIDTH_MASK) = 0)
+    and (((Land[ty, tx] and lfBasic) <> 0) or ((Land[ty, tx] and lfObject) <> 0)) then
         begin
-        if despeckle then 
+        if despeckle then
             begin
             Land[ty, tx]:= Land[ty, tx] or lfDamaged;
             LandDirty[ty div 32, tx div 32]:= 1
             end;
         if (cReducedQuality and rqBlurryLand) = 0 then
-            LandPixels[ty, tx]:= cExplosionBorderColor
-        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
+            LandPixels[ty, tx]:= ExplosionBorderColor
+        else
+            LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor
         end
     end;
     nx:= nx - dY;
@@ -553,23 +587,23 @@ for i:= -HalfWidth to HalfWidth do
     X:= nx - dX8;
     Y:= ny - dY8;
     for t:= 0 to 7 do
-    begin
-    X:= X + dX;
-    Y:= Y + dY;
-    tx:= hwRound(X);
-    ty:= hwRound(Y);
-    if ((ty and LAND_HEIGHT_MASK) = 0) and
-       ((tx and LAND_WIDTH_MASK) = 0) and
-       (((Land[ty, tx] and lfBasic) <> 0) or
-       ((Land[ty, tx] and lfObject) <> 0)) then
         begin
-        Land[ty, tx]:= Land[ty, tx] or lfDamaged;
-        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
-        if (cReducedQuality and rqBlurryLand) = 0 then
-            LandPixels[ty, tx]:= cExplosionBorderColor
-        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
-        end
-    end;
+        X:= X + dX;
+        Y:= Y + dY;
+        tx:= hwRound(X);
+        ty:= hwRound(Y);
+        if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
+        or ((Land[ty, tx] and lfObject) <> 0)) then
+            begin
+            Land[ty, tx]:= Land[ty, tx] or lfDamaged;
+            if despeckle then
+                LandDirty[ty div 32, tx div 32]:= 1;
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                LandPixels[ty, tx]:= ExplosionBorderColor
+            else
+                LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor
+            end
+        end;
     X:= nx;
     Y:= ny;
     for t:= 0 to ticks do
@@ -601,18 +635,18 @@ for i:= -HalfWidth to HalfWidth do
     Y:= Y + dY;
     tx:= hwRound(X);
     ty:= hwRound(Y);
-    if ((ty and LAND_HEIGHT_MASK) = 0) and
-       ((tx and LAND_WIDTH_MASK) = 0) and
-       (((Land[ty, tx] and lfBasic) <> 0) or
-       ((Land[ty, tx] and lfObject) <> 0)) then
+    if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
+    or ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
-        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
+        if despeckle then
+            LandDirty[ty div 32, tx div 32]:= 1;
         if (cReducedQuality and rqBlurryLand) = 0 then
-            LandPixels[ty, tx]:= cExplosionBorderColor
-        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
+            LandPixels[ty, tx]:= ExplosionBorderColor
+        else
+            LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor
         end
-    end;
+        end;
     nx:= nx - dY;
     ny:= ny + dX;
     end;
@@ -627,16 +661,16 @@ for i:= 0 to 7 do
     Y:= Y + dY;
     tx:= hwRound(X);
     ty:= hwRound(Y);
-    if ((ty and LAND_HEIGHT_MASK) = 0) and
-       ((tx and LAND_WIDTH_MASK) = 0) and
-       (((Land[ty, tx] and lfBasic) <> 0) or
-       ((Land[ty, tx] and lfObject) <> 0)) then
+    if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) and (((Land[ty, tx] and lfBasic) <> 0)
+    or ((Land[ty, tx] and lfObject) <> 0)) then
         begin
         Land[ty, tx]:= Land[ty, tx] or lfDamaged;
-        if despeckle then LandDirty[ty div 32, tx div 32]:= 1;
+        if despeckle then
+            LandDirty[ty div 32, tx div 32]:= 1;
         if (cReducedQuality and rqBlurryLand) = 0 then
-            LandPixels[ty, tx]:= cExplosionBorderColor
-        else LandPixels[ty div 2, tx div 2]:= cExplosionBorderColor
+            LandPixels[ty, tx]:= ExplosionBorderColor
+        else
+            LandPixels[ty div 2, tx div 2]:= ExplosionBorderColor
         end
     end;
     nx:= nx - dY;
@@ -648,7 +682,7 @@ ty:= Max(stY - HalfWidth * 2 - 4 - abs(hwRound(dY * ticks)), 0);
 ddx:= Min(stX + HalfWidth * 2 + 4 + abs(hwRound(dX * ticks)), LAND_WIDTH) - tx;
 ddy:= Min(stY + HalfWidth * 2 + 4 + abs(hwRound(dY * ticks)), LAND_HEIGHT) - ty;
 
-UpdateLandTexture(tx, ddx, ty, ddy)
+UpdateLandTexture(tx, ddx, ty, ddy, false)
 end;
 
 function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
@@ -656,6 +690,7 @@ var X, Y, bpp, h, w, row, col, gx, gy, numFramesFirstCol: LongInt;
     p: PByteArray;
     Image: PSDL_Surface;
 begin
+TryPlaceOnLand:= false;
 numFramesFirstCol:= SpritesData[Obj].imageHeight div SpritesData[Obj].Height;
 
 TryDo(SpritesData[Obj].Surface <> nil, 'Assert SpritesData[Obj].Surface failed', true);
@@ -666,205 +701,220 @@ row:= Frame mod numFramesFirstCol;
 col:= Frame div numFramesFirstCol;
 
 if SDL_MustLock(Image) then
-   SDLTry(SDL_LockSurface(Image) >= 0, true);
+    SDLTry(SDL_LockSurface(Image) >= 0, true);
 
 bpp:= Image^.format^.BytesPerPixel;
 TryDo(bpp = 4, 'It should be 32 bpp sprite', true);
 // Check that sprite fits free space
 p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);
 case bpp of
-     4: for y:= 0 to Pred(h) do
-            begin
-            for x:= 0 to Pred(w) do
-                if PLongword(@(p^[x * 4]))^ <> 0 then
-                   if ((cpY + y) <= Longint(topY)) or
-                      ((cpY + y) >= LAND_HEIGHT) or
-                      ((cpX + x) <= Longint(leftX)) or
-                      ((cpX + x) >= Longint(rightX)) or
-                      (Land[cpY + y, cpX + x] <> 0) then
-                      begin
-                      if SDL_MustLock(Image) then
-                         SDL_UnlockSurface(Image);
-                      exit(false)
-                      end;
-            p:= @(p^[Image^.pitch]);
-            end;
-     end;
+    4: for y:= 0 to Pred(h) do
+        begin
+        for x:= 0 to Pred(w) do
+            if (PLongword(@(p^[x * 4]))^) <> 0 then
+                if ((cpY + y) <= Longint(topY)) or ((cpY + y) >= LAND_HEIGHT) or
+                   ((cpX + x) <= Longint(leftX)) or ((cpX + x) >= Longint(rightX)) or (Land[cpY + y, cpX + x] <> 0) then
+                    begin
+                        if SDL_MustLock(Image) then
+                            SDL_UnlockSurface(Image);
+                        exit;
+                    end;
+        p:= @(p^[Image^.pitch]);
+        end;
+    end;
 
 TryPlaceOnLand:= true;
 if not doPlace then
-   begin
-   if SDL_MustLock(Image) then
-      SDL_UnlockSurface(Image);
-   exit
-   end;
+    begin
+    if SDL_MustLock(Image) then
+        SDL_UnlockSurface(Image);
+    exit
+    end;
 
 // Checked, now place
 p:= @(PByteArray(Image^.pixels)^[ Image^.pitch * row * h + col * w * 4 ]);
 case bpp of
-     4: for y:= 0 to Pred(h) do
-            begin
-            for x:= 0 to Pred(w) do
-                if PLongword(@(p^[x * 4]))^ <> 0 then
+    4: for y:= 0 to Pred(h) do
+        begin
+        for x:= 0 to Pred(w) do
+            if (PLongword(@(p^[x * 4]))^) <> 0 then
                    begin
-                   if (cReducedQuality and rqBlurryLand) = 0 then
-                       begin
-                       gX:= cpX + x;
-                       gY:= cpY + y;
-                       end
-                   else
-                       begin
-                       gX:= (cpX + x) div 2;
-                       gY:= (cpY + y) div 2;
-                       end;
-                   if indestructible then
-                       Land[cpY + y, cpX + x]:= lfIndestructible
-                   else if (LandPixels[gY, gX] and AMask) shr AShift = 255 then  // This test assumes lfBasic and lfObject differ only graphically
-                       Land[cpY + y, cpX + x]:= lfBasic
-                   else
-                       Land[cpY + y, cpX + x]:= lfObject;
-                   // For testing only. Intent is to flag this on objects with masks, or use it for an ice ray gun
-                   if (Theme = 'Snow') or (Theme = 'Christmas') then Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or lfIce;
-                   LandPixels[gY, gX]:= PLongword(@(p^[x * 4]))^
-                   end;
-            p:= @(p^[Image^.pitch]);
-            end;
-     end;
+                if (cReducedQuality and rqBlurryLand) = 0 then
+                    begin
+                    gX:= cpX + x;
+                    gY:= cpY + y;
+                    end
+                else
+                     begin
+                     gX:= (cpX + x) div 2;
+                     gY:= (cpY + y) div 2;
+                    end;
+                if indestructible then
+                    Land[cpY + y, cpX + x]:= lfIndestructible
+                else if (LandPixels[gY, gX] and AMask) shr AShift = 255 then  // This test assumes lfBasic and lfObject differ only graphically
+                    Land[cpY + y, cpX + x]:= lfBasic
+                else
+                    Land[cpY + y, cpX + x]:= lfObject;
+                // For testing only. Intent is to flag this on objects with masks, or use it for an ice ray gun
+                if (Theme = 'Snow') or (Theme = 'Christmas') then
+                    Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or lfIce;
+                    LandPixels[gY, gX]:= PLongword(@(p^[x * 4]))^
+                end;
+        p:= @(p^[Image^.pitch]);
+        end;
+    end;
 if SDL_MustLock(Image) then
-   SDL_UnlockSurface(Image);
+    SDL_UnlockSurface(Image);
 
 x:= Max(cpX, leftX);
 w:= Min(cpX + Image^.w, LAND_WIDTH) - x;
 y:= Max(cpY, topY);
 h:= Min(cpY + Image^.h, LAND_HEIGHT) - y;
-UpdateLandTexture(x, w, y, h)
+UpdateLandTexture(x, w, y, h, true)
 end;
 
 function Despeckle(X, Y: LongInt): boolean;
 var nx, ny, i, j, c, xx, yy: LongInt;
     pixelsweep: boolean;
 begin
-if (cReducedQuality and rqBlurryLand) = 0 then
-   begin
-   xx:= X;
-   yy:= Y;
-   end
-else
-   begin
-   xx:= X div 2;
-   yy:= Y div 2;
-   end;
-pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0);
-if (((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
+    Despeckle:= true;
+
+    if (cReducedQuality and rqBlurryLand) = 0 then
+    begin
+        xx:= X;
+        yy:= Y;
+    end
+    else
+    begin
+        xx:= X div 2;
+        yy:= Y div 2;
+    end;
+
+    pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0);
+    if (((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
     begin
-    c:= 0;
-    for i:= -1 to 1 do
-        for j:= -1 to 1 do
-            if (i <> 0) or (j <> 0) then
+        c:= 0;
+        for i:= -1 to 1 do
+            for j:= -1 to 1 do
+                if (i <> 0) or (j <> 0) then
                 begin
-                ny:= Y + i;
-                nx:= X + j;
-                if ((ny and LAND_HEIGHT_MASK) = 0) and ((nx and LAND_WIDTH_MASK) = 0) then
+                    ny:= Y + i;
+                    nx:= X + j;
+                    if ((ny and LAND_HEIGHT_MASK) = 0) and ((nx and LAND_WIDTH_MASK) = 0) then
                     begin
-                    if pixelsweep then
+                        if pixelsweep then
                         begin
-                        if ((cReducedQuality and rqBlurryLand) <> 0) then
+                            if ((cReducedQuality and rqBlurryLand) <> 0) then
                             begin
-                            nx:= nx div 2;
-                            ny:= ny div 2
+                                nx:= nx div 2;
+                                ny:= ny div 2
                             end;
-                        if LandPixels[ny, nx] <> 0 then inc(c);
+                            if LandPixels[ny, nx] <> 0 then
+                                inc(c);
                         end
-                    else if Land[ny, nx] > 255 then inc(c);
+                    else if Land[ny, nx] > 255 then
+                        inc(c);
                     end
                 end;
 
-    if c < 4 then // 0-3 neighbours
+        if c < 4 then // 0-3 neighbours
         begin
-        if ((Land[Y, X] and lfBasic) <> 0) and not disableLandBack then
-            LandPixels[yy, xx]:= LandBackPixel(X, Y)
-        else
-            LandPixels[yy, xx]:= 0;
+            if ((Land[Y, X] and lfBasic) <> 0) and (not disableLandBack) then
+                LandPixels[yy, xx]:= LandBackPixel(X, Y)
+            else
+                LandPixels[yy, xx]:= 0;
 
-        Land[Y, X]:= 0;
-        if not pixelsweep then exit(true);
+            if not pixelsweep then
+            begin
+                Land[Y, X]:= 0;
+                exit
+            end
         end;
     end;
-Despeckle:= false
+    Despeckle:= false
 end;
 
 procedure Smooth(X, Y: LongInt);
 begin
 // a bit of AA for explosions
-if (Land[Y, X] = 0) and (Y > LongInt(topY) + 1) and 
-   (Y < LAND_HEIGHT-2) and (X > LongInt(leftX) + 1) and (X < LongInt(rightX) - 1) then
+if (Land[Y, X] = 0) and (Y > LongInt(topY) + 1) and
+    (Y < LAND_HEIGHT-2) and (X > LongInt(leftX) + 1) and (X < LongInt(rightX) - 1) then
     begin
-    if ((((Land[y, x-1] and lfDamaged) <> 0) and (((Land[y+1,x] and lfDamaged) <> 0)) or ((Land[y-1,x] and lfDamaged) <> 0)) or
-       (((Land[y, x+1] and lfDamaged) <> 0) and (((Land[y-1,x] and lfDamaged) <> 0) or ((Land[y+1,x] and lfDamaged) <> 0)))) then
+    if ((((Land[y, x-1] and lfDamaged) <> 0) and (((Land[y+1,x] and lfDamaged) <> 0)) or ((Land[y-1,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and (((Land[y-1,x] and lfDamaged) <> 0) or ((Land[y+1,x] and lfDamaged) <> 0)))) then
         begin
         if (cReducedQuality and rqBlurryLand) = 0 then
             begin
-            if ((LandPixels[y,x] and AMask) shr AShift) < 10 then LandPixels[y,x]:= (cExplosionBorderColor and not AMask) or (128 shl AShift)
+            if ((LandPixels[y,x] and AMask) shr AShift) < 10 then
+                LandPixels[y,x]:= (ExplosionBorderColor and (not AMask)) or (128 shl AShift)
             else
                 LandPixels[y,x]:=
-                                (((((LandPixels[y,x] and RMask shr RShift) div 2)+((cExplosionBorderColor and RMask) shr RShift) div 2) and $FF) shl RShift) or
-                                (((((LandPixels[y,x] and GMask shr GShift) div 2)+((cExplosionBorderColor and GMask) shr GShift) div 2) and $FF) shl GShift) or
-                                (((((LandPixels[y,x] and BMask shr BShift) div 2)+((cExplosionBorderColor and BMask) shr BShift) div 2) and $FF) shl BShift) or ($FF shl AShift)
+                                (((((LandPixels[y,x] and RMask shr RShift) div 2)+((ExplosionBorderColor and RMask) shr RShift) div 2) and $FF) shl RShift) or
+                                (((((LandPixels[y,x] and GMask shr GShift) div 2)+((ExplosionBorderColor and GMask) shr GShift) div 2) and $FF) shl GShift) or
+                                (((((LandPixels[y,x] and BMask shr BShift) div 2)+((ExplosionBorderColor and BMask) shr BShift) div 2) and $FF) shl BShift) or ($FF shl AShift)
             end;
-        if (Land[y, x-1] = lfObject) then Land[y,x]:= lfObject
-        else if (Land[y, x+1] = lfObject) then Land[y,x]:= lfObject
-        else Land[y,x]:= lfBasic;
+        if (Land[y, x-1] = lfObject) then
+            Land[y,x]:= lfObject
+        else if (Land[y, x+1] = lfObject) then
+            Land[y,x]:= lfObject
+        else
+            Land[y,x]:= lfBasic;
         end
-    else if ((((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0)) or
-            (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0)) or
-            (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0)) or
-            (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0)) or
-            (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))) then
+    else if ((((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0))
+    or (((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0))
+    or (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0))
+    or (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0))
+    or (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))
+    or (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))) then
         begin
         if (cReducedQuality and rqBlurryLand) = 0 then
             begin
-            if ((LandPixels[y,x] and AMask) shr AShift) < 10 then LandPixels[y,x]:= (cExplosionBorderColor and not AMask) or (64 shl AShift)
+            if ((LandPixels[y,x] and AMask) shr AShift) < 10 then
+                LandPixels[y,x]:= (ExplosionBorderColor and (not AMask)) or (64 shl AShift)
             else
                 LandPixels[y,x]:=
-                                (((((LandPixels[y,x] and RMask shr RShift) * 3 div 4)+((cExplosionBorderColor and RMask) shr RShift) div 4) and $FF) shl RShift) or
-                                (((((LandPixels[y,x] and GMask shr GShift) * 3 div 4)+((cExplosionBorderColor and GMask) shr GShift) div 4) and $FF) shl GShift) or
-                                (((((LandPixels[y,x] and BMask shr BShift) * 3 div 4)+((cExplosionBorderColor and BMask) shr BShift) div 4) and $FF) shl BShift) or ($FF shl AShift)
+                                (((((LandPixels[y,x] and RMask shr RShift) * 3 div 4)+((ExplosionBorderColor and RMask) shr RShift) div 4) and $FF) shl RShift) or
+                                (((((LandPixels[y,x] and GMask shr GShift) * 3 div 4)+((ExplosionBorderColor and GMask) shr GShift) div 4) and $FF) shl GShift) or
+                                (((((LandPixels[y,x] and BMask shr BShift) * 3 div 4)+((ExplosionBorderColor and BMask) shr BShift) div 4) and $FF) shl BShift) or ($FF shl AShift)
             end;
-        if (Land[y, x-1] = lfObject) then Land[y, x]:= lfObject
-        else if (Land[y, x+1] = lfObject) then Land[y, x]:= lfObject
-        else if (Land[y+1, x] = lfObject) then Land[y, x]:= lfObject
-        else if (Land[y-1, x] = lfObject) then Land[y, x]:= lfObject
+        if (Land[y, x-1] = lfObject) then
+            Land[y, x]:= lfObject
+        else if (Land[y, x+1] = lfObject) then
+            Land[y, x]:= lfObject
+        else if (Land[y+1, x] = lfObject) then
+            Land[y, x]:= lfObject
+        else if (Land[y-1, x] = lfObject) then
+        Land[y, x]:= lfObject
         else Land[y,x]:= lfBasic
         end
     end
-else if ((cReducedQuality and rqBlurryLand) = 0) and (LandPixels[Y, X] and AMask = 255) and
-    ((Land[Y, X] and (lfDamaged or lfBasic) = lfBasic) or (Land[Y, X] and (lfDamaged or lfBasic) = lfBasic)) and 
-    (Y > LongInt(topY) + 1) and (Y < LAND_HEIGHT-2) and (X > LongInt(leftX) + 1) and (X < LongInt(rightX) - 1) then
+else if ((cReducedQuality and rqBlurryLand) = 0) and (LandPixels[Y, X] and AMask = 255)
+and ((Land[Y, X] and (lfDamaged or lfBasic) = lfBasic) or (Land[Y, X] and (lfDamaged or lfBasic) = lfBasic))
+and (Y > LongInt(topY) + 1) and (Y < LAND_HEIGHT-2) and (X > LongInt(leftX) + 1) and (X < LongInt(rightX) - 1) then
     begin
-    if ((((Land[y, x-1] and lfDamaged) <> 0) and (((Land[y+1,x] and lfDamaged) <> 0)) or ((Land[y-1,x] and lfDamaged) <> 0)) or
-       (((Land[y, x+1] and lfDamaged) <> 0) and (((Land[y-1,x] and lfDamaged) <> 0) or ((Land[y+1,x] and lfDamaged) <> 0)))) then
+    if ((((Land[y, x-1] and lfDamaged) <> 0) and (((Land[y+1,x] and lfDamaged) <> 0)) or ((Land[y-1,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and (((Land[y-1,x] and lfDamaged) <> 0) or ((Land[y+1,x] and lfDamaged) <> 0)))) then
         begin
         LandPixels[y,x]:=
-                        (((((LandPixels[y,x] and RMask shr RShift) div 2)+((cExplosionBorderColor and RMask) shr RShift) div 2) and $FF) shl RShift) or
-                        (((((LandPixels[y,x] and GMask shr GShift) div 2)+((cExplosionBorderColor and GMask) shr GShift) div 2) and $FF) shl GShift) or
-                        (((((LandPixels[y,x] and BMask shr BShift) div 2)+((cExplosionBorderColor and BMask) shr BShift) div 2) and $FF) shl BShift) or ($FF shl AShift)
+                        (((((LandPixels[y,x] and RMask shr RShift) div 2)+((ExplosionBorderColor and RMask) shr RShift) div 2) and $FF) shl RShift) or
+                        (((((LandPixels[y,x] and GMask shr GShift) div 2)+((ExplosionBorderColor and GMask) shr GShift) div 2) and $FF) shl GShift) or
+                        (((((LandPixels[y,x] and BMask shr BShift) div 2)+((ExplosionBorderColor and BMask) shr BShift) div 2) and $FF) shl BShift) or ($FF shl AShift)
         end
-    else if ((((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0)) or
-            (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0)) or
-            (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0)) or
-            (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0)) or
-            (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0)) or
-            (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))) then
+    else if ((((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0))
+    or (((Land[y, x-1] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y+2,x] and lfDamaged) <> 0))
+    or (((Land[y, x+1] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y-2,x] and lfDamaged) <> 0))
+    or (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0))
+    or (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x+1] and lfDamaged) <> 0) and ((Land[y,x+2] and lfDamaged) <> 0))
+    or (((Land[y+1, x] and lfDamaged) <> 0) and ((Land[y+1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))
+    or (((Land[y-1, x] and lfDamaged) <> 0) and ((Land[y-1,x-1] and lfDamaged) <> 0) and ((Land[y,x-2] and lfDamaged) <> 0))) then
         begin
         LandPixels[y,x]:=
-                        (((((LandPixels[y,x] and RMask shr RShift) * 3 div 4)+((cExplosionBorderColor and RMask) shr RShift) div 4) and $FF) shl RShift) or
-                        (((((LandPixels[y,x] and GMask shr GShift) * 3 div 4)+((cExplosionBorderColor and GMask) shr GShift) div 4) and $FF) shl GShift) or
-                        (((((LandPixels[y,x] and BMask shr BShift) * 3 div 4)+((cExplosionBorderColor and BMask) shr BShift) div 4) and $FF) shl BShift) or ($FF shl AShift)
+                        (((((LandPixels[y,x] and RMask shr RShift) * 3 div 4)+((ExplosionBorderColor and RMask) shr RShift) div 4) and $FF) shl RShift) or
+                        (((((LandPixels[y,x] and GMask shr GShift) * 3 div 4)+((ExplosionBorderColor and GMask) shr GShift) div 4) and $FF) shl GShift) or
+                        (((((LandPixels[y,x] and BMask shr BShift) * 3 div 4)+((ExplosionBorderColor and BMask) shr BShift) div 4) and $FF) shl BShift) or ($FF shl AShift)
         end
     end
 end;
@@ -921,7 +971,8 @@ while recheck do
                                     end
                                 end;
                     end;
-                if updateBlock then UpdateLandTexture(tx, 32, ty, 32);
+                if updateBlock then
+                    UpdateLandTexture(tx, 32, ty, 32, false);
                 LandDirty[y, x]:= 2;
                 end;
             end;
@@ -947,19 +998,204 @@ end;
 // Return true if outside of land or not the value tested, used right now for some X/Y movement that does not use normal hedgehog movement in GSHandlers.inc
 function CheckLandValue(X, Y: LongInt; LandFlag: Word): boolean; inline;
 begin
-     CheckLandValue:= ((X and LAND_WIDTH_MASK <> 0) or (Y and LAND_HEIGHT_MASK <> 0)) or ((Land[Y, X] and LandFlag) = 0)
+    CheckLandValue:= ((X and LAND_WIDTH_MASK <> 0) or (Y and LAND_HEIGHT_MASK <> 0)) or ((Land[Y, X] and LandFlag) = 0)
 end;
 
 function LandBackPixel(x, y: LongInt): LongWord; inline;
 var p: PLongWordArray;
 begin
-    if LandBackSurface = nil then LandBackPixel:= 0
+    if LandBackSurface = nil then
+        LandBackPixel:= 0
     else
-    begin
+        begin
         p:= LandBackSurface^.pixels;
         LandBackPixel:= p^[LandBackSurface^.w * (y mod LandBackSurface^.h) + (x mod LandBackSurface^.w)];// or $FF000000;
+        end
+end;
+
+
+procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword);
+var
+  eX, eY, dX, dY: LongInt;
+  i, sX, sY, x, y, d: LongInt;
+begin
+eX:= 0;
+eY:= 0;
+dX:= X2 - X1;
+dY:= Y2 - Y1;
+
+if (dX > 0) then
+    sX:= 1
+else
+    if (dX < 0) then
+        begin
+        sX:= -1;
+        dX:= -dX
+        end
+    else
+        sX:= dX;
+
+if (dY > 0) then
+    sY:= 1
+else
+    if (dY < 0) then
+        begin
+        sY:= -1;
+        dY:= -dY
+        end
+    else
+        sY:= dY;
+
+if (dX > dY) then
+    d:= dX
+else
+    d:= dY;
+
+x:= X1;
+y:= Y1;
+
+for i:= 0 to d do
+    begin
+    inc(eX, dX);
+    inc(eY, dY);
+    if (eX > d) then
+        begin
+        dec(eX, d);
+        inc(x, sX);
+        end;
+    if (eY > d) then
+        begin
+        dec(eY, d);
+        inc(y, sY);
+        end;
+
+    if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then
+        Land[y, x]:= Color;
     end
 end;
 
+procedure DrawDots(x, y, xx, yy: Longint; Color: Longword); inline;
+begin
+    if (((x + xx) and LAND_WIDTH_MASK) = 0) and (((y + yy) and LAND_HEIGHT_MASK) = 0) then Land[y + yy, x + xx]:= Color;
+    if (((x + xx) and LAND_WIDTH_MASK) = 0) and (((y - yy) and LAND_HEIGHT_MASK) = 0) then Land[y - yy, x + xx]:= Color;
+    if (((x - xx) and LAND_WIDTH_MASK) = 0) and (((y + yy) and LAND_HEIGHT_MASK) = 0) then Land[y + yy, x - xx]:= Color;
+    if (((x - xx) and LAND_WIDTH_MASK) = 0) and (((y - yy) and LAND_HEIGHT_MASK) = 0) then Land[y - yy, x - xx]:= Color;
+    if (((x + yy) and LAND_WIDTH_MASK) = 0) and (((y + xx) and LAND_HEIGHT_MASK) = 0) then Land[y + xx, x + yy]:= Color;
+    if (((x + yy) and LAND_WIDTH_MASK) = 0) and (((y - xx) and LAND_HEIGHT_MASK) = 0) then Land[y - xx, x + yy]:= Color;
+    if (((x - yy) and LAND_WIDTH_MASK) = 0) and (((y + xx) and LAND_HEIGHT_MASK) = 0) then Land[y + xx, x - yy]:= Color;
+    if (((x - yy) and LAND_WIDTH_MASK) = 0) and (((y - xx) and LAND_HEIGHT_MASK) = 0) then Land[y - xx, x - yy]:= Color;
+end;
+
+procedure DrawLines(X1, Y1, X2, Y2, XX, YY: LongInt; color: Longword);
+var
+  eX, eY, dX, dY: LongInt;
+  i, sX, sY, x, y, d: LongInt;
+  f: boolean;
+begin
+    eX:= 0;
+    eY:= 0;
+    dX:= X2 - X1;
+    dY:= Y2 - Y1;
+
+    if (dX > 0) then
+        sX:= 1
+    else
+        if (dX < 0) then
+            begin
+            sX:= -1;
+            dX:= -dX
+            end
+        else
+            sX:= dX;
+
+    if (dY > 0) then
+        sY:= 1
+    else
+        if (dY < 0) then
+            begin
+            sY:= -1;
+            dY:= -dY
+            end
+        else
+            sY:= dY;
+
+    if (dX > dY) then
+        d:= dX
+    else
+        d:= dY;
+
+    x:= X1;
+    y:= Y1;
+
+    for i:= 0 to d do
+        begin
+        inc(eX, dX);
+        inc(eY, dY);
+
+        f:= eX > d;
+        if f then
+            begin
+            dec(eX, d);
+            inc(x, sX);
+            DrawDots(x, y, xx, yy, color)
+            end;
+        if (eY > d) then
+            begin
+            dec(eY, d);
+            inc(y, sY);
+            f:= true;
+            DrawDots(x, y, xx, yy, color)
+            end;
+
+        if not f then
+            DrawDots(x, y, xx, yy, color)
+        end
+end;
+
+procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
+var dx, dy, d: LongInt;
+begin
+    dx:= 0;
+    dy:= Radius;
+    d:= 3 - 2 * Radius;
+    while (dx < dy) do
+        begin
+        DrawLines(x1, y1, x2, y2, dx, dy, color);
+        if (d < 0) then
+            d:= d + 4 * dx + 6
+        else
+            begin
+            d:= d + 4 * (dx - dy) + 10;
+            dec(dy)
+            end;
+        inc(dx)
+        end;
+    if (dx = dy) then
+        DrawLines(x1, y1, x2, y2, dx, dy, color);
+end;
+
+
+procedure DumpLandToLog(x, y, r: LongInt);
+var xx, yy, dx: LongInt;
+    s: shortstring;
+begin
+    s[0]:= char(r * 2 + 1);
+    for yy:= y - r to y + r do
+        begin
+        for dx:= 0 to r*2 do
+            begin
+            xx:= dx - r + x;
+            if (xx = x) and (yy = y) then
+                s[dx + 1]:= 'X'
+            else if Land[yy, xx] > 255 then
+                s[dx + 1]:= 'O'
+            else if Land[yy, xx] > 0 then
+                s[dx + 1]:= '*'
+            else
+                s[dx + 1]:= '.'
+            end;
+        AddFileLog('Land dump: ' + s);
+        end;
+end;
 
 end.
diff --git a/hedgewars/uLandObjects.pas b/hedgewars/uLandObjects.pas
index ccbac0c..aa59bfd 100644
--- a/hedgewars/uLandObjects.pas
+++ b/hedgewars/uLandObjects.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -25,36 +25,37 @@ uses SDLh;
 procedure AddObjects();
 procedure FreeLandObjects();
 procedure LoadThemeConfig;
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word = 0);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline;
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
 procedure AddOnLandObjects(Surface: PSDL_Surface);
 
 implementation
 uses uStore, uConsts, uConsole, uRandom, uSound, GLunit,
-     uTypes, uVariables, uUtils, uDebug, sysutils;
+     uTypes, uVariables, uUtils, uDebug, SysUtils;
 
 const MaxRects = 512;
       MAXOBJECTRECTS = 16;
       MAXTHEMEOBJECTS = 32;
 
-type PRectArray = ^TRectsArray;
-     TRectsArray = array[0..MaxRects] of TSDL_Rect;
+type TRectsArray = array[0..MaxRects] of TSDL_Rect;
+     PRectArray = ^TRectsArray;
      TThemeObject = record
-                    Surf: PSDL_Surface;
-                    inland: TSDL_Rect;
-                    outland: array[0..Pred(MAXOBJECTRECTS)] of TSDL_Rect;
-                    rectcnt: Longword;
-                    Width, Height: Longword;
-                    Maxcnt: Longword;
-                    end;
+                     Surf: PSDL_Surface;
+                     inland: TSDL_Rect;
+                     outland: array[0..Pred(MAXOBJECTRECTS)] of TSDL_Rect;
+                     rectcnt: Longword;
+                     Width, Height: Longword;
+                     Maxcnt: Longword;
+                     end;
      TThemeObjects = record
                      Count: LongInt;
                      objs: array[0..Pred(MAXTHEMEOBJECTS)] of TThemeObject;
                      end;
      TSprayObject = record
-                    Surf: PSDL_Surface;
-                    Width, Height: Longword;
-                    Maxcnt: Longword;
-                    end;
+                     Surf: PSDL_Surface;
+                     Width, Height: Longword;
+                     Maxcnt: Longword;
+                     end;
      TSprayObjects = record
                      Count: LongInt;
                      objs: array[0..Pred(MAXTHEMEOBJECTS)] of TSprayObject
@@ -65,8 +66,12 @@ var Rects: PRectArray;
     ThemeObjects: TThemeObjects;
     SprayObjects: TSprayObjects;
 
-
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word = 0);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline;
+begin
+    BlitImageAndGenerateCollisionInfo(cpX, cpY, Width, Image, 0);
+end;
+    
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
 var p: PLongwordArray;
     x, y: Longword;
     bpp: LongInt;
@@ -74,52 +79,53 @@ begin
 WriteToConsole('Generating collision info... ');
 
 if SDL_MustLock(Image) then
-   SDLTry(SDL_LockSurface(Image) >= 0, true);
+    SDLTry(SDL_LockSurface(Image) >= 0, true);
 
 bpp:= Image^.format^.BytesPerPixel;
 TryDo(bpp = 4, 'Land object should be 32bit', true);
 
-if Width = 0 then Width:= Image^.w;
+if Width = 0 then
+    Width:= Image^.w;
 
 p:= Image^.pixels;
 for y:= 0 to Pred(Image^.h) do
     begin
     for x:= 0 to Pred(Width) do
-        begin
-            if (cReducedQuality and rqBlurryLand) = 0 then
+        if (p^[x] and AMask) <> 0 then
             begin
-                if (LandPixels[cpY + y, cpX + x] = 0) or 
-		   (((p^[x] and AMask) <> 0) and (((LandPixels[cpY + y, cpX + x] and AMask) shr AShift) < 255)) then
+            if (cReducedQuality and rqBlurryLand) = 0 then
+                begin
+                if (LandPixels[cpY + y, cpX + x] = 0)
+                or (((p^[x] and AMask) <> 0) and (((LandPixels[cpY + y, cpX + x] and AMask) shr AShift) < 255)) then
                     LandPixels[cpY + y, cpX + x]:= p^[x];
-            end
+                end
             else
                 if LandPixels[(cpY + y) div 2, (cpX + x) div 2] = 0 then 
                     LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x];
 
-
-        if ((Land[cpY + y, cpX + x] and $FF00) = 0) and ((p^[x] and AMask) <> 0) then
-            begin
-            Land[cpY + y, cpX + x]:= lfObject;
-            Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or extraFlags
+            if ((Land[cpY + y, cpX + x] and $FF00) = 0) and ((p^[x] and AMask) <> 0) then
+                begin
+                Land[cpY + y, cpX + x]:= lfObject;
+                Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or extraFlags
+                end;
             end;
-        end;
     p:= @(p^[Image^.pitch shr 2])
     end;
 
 if SDL_MustLock(Image) then
-   SDL_UnlockSurface(Image);
+    SDL_UnlockSurface(Image);
 WriteLnToConsole(msgOK)
 end;
 
 procedure AddRect(x1, y1, w1, h1: LongInt);
 begin
 with Rects^[RectCount] do
-     begin
-     x:= x1;
-     y:= y1;
-     w:= w1;
-     h:= h1
-     end;
+    begin
+    x:= x1;
+    y:= y1;
+    w:= w1;
+    h:= h1
+    end;
 inc(RectCount);
 TryDo(RectCount < MaxRects, 'AddRect: overflow', true)
 end;
@@ -142,31 +148,31 @@ begin
 
 i:= 0;
 if RectCount > 0 then
-   repeat
-   with Rects^[i] do
-        res:= (x < x1 + w1) and (x1 < x + w) and
-                 (y < y1 + h1) and (y1 < y + h);
-   inc(i)
-   until (i = RectCount) or (res);
+    repeat
+    with Rects^[i] do
+        res:= (x < x1 + w1) and (x1 < x + w) and (y < y1 + h1) and (y1 < y + h);
+    inc(i)
+    until (i = RectCount) or (res);
 CheckIntersect:= res;
 end;
 
-function AddGirder(gX: LongInt): boolean;
-var tmpsurf: PSDL_Surface;
-    x1, x2, y, k, i: LongInt;
-    rr: TSDL_Rect;
-    bRes: boolean;
 
-    function CountNonZeroz(x, y: LongInt): Longword;
-    var i: LongInt;
-        lRes: Longword;
-    begin
+function CountNonZeroz(x, y: LongInt): Longword;
+var i: LongInt;
+    lRes: Longword;
+begin
     lRes:= 0;
     for i:= y to y + 15 do
-        if Land[i, x] <> 0 then inc(lRes);
+        if Land[i, x] <> 0 then
+            inc(lRes);
     CountNonZeroz:= lRes;
-    end;
+end;
 
+function AddGirder(gX: LongInt): boolean;
+var tmpsurf: PSDL_Surface;
+    x1, x2, y, k, i: LongInt;
+    rr: TSDL_Rect;
+    bRes: boolean;
 begin
 y:= topY+150;
 repeat
@@ -174,7 +180,8 @@ repeat
     x1:= gX;
     x2:= gX;
 
-    while (x1 > Longint(leftX)+150) and (CountNonZeroz(x1, y) = 0) do dec(x1, 2);
+    while (x1 > Longint(leftX)+150) and (CountNonZeroz(x1, y) = 0) do
+        dec(x1, 2);
 
     i:= x1 - 12;
     repeat
@@ -185,14 +192,17 @@ repeat
     inc(x1, 2);
     if k = 16 then
         begin
-        while (x2 < (rightX-150)) and (CountNonZeroz(x2, y) = 0) do inc(x2, 2);
+        while (x2 < (rightX-150)) and (CountNonZeroz(x2, y) = 0) do
+            inc(x2, 2);
         i:= x2 + 12;
         repeat
         inc(x2, 2);
         k:= CountNonZeroz(x2, y)
         until (x2 >= (rightX-150)) or (k = 0) or (k = 16) or (x2 > i) or (x2 - x1 >= 768);
+        
         if (x2 < (rightX - 150)) and (k = 16) and (x2 - x1 > 250) and (x2 - x1 < 768)
-            and not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144) then break;
+        and (not CheckIntersect(x1 - 32, y - 64, x2 - x1 + 64, 144)) then
+                break;
         end;
 x1:= 0;
 until y > (LAND_HEIGHT-125);
@@ -200,10 +210,7 @@ until y > (LAND_HEIGHT-125);
 if x1 > 0 then
 begin
     bRes:= true;
-    tmpsurf:= LoadImage(UserPathz[ptCurrTheme] + '/Girder', ifTransparent or ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Girder', ifTransparent or ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(UserPathz[ptGraphics] + '/Girder', ifTransparent or ifIgnoreCaps);
-    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptGraphics] + '/Girder', ifCritical or ifTransparent or ifIgnoreCaps);
+    tmpsurf:= LoadDataImageAltPath(ptCurrTheme, ptGraphics, 'Girder', ifCritical or ifTransparent or ifIgnoreCaps);
 
     rr.x:= x1;
     while rr.x < x2 do
@@ -236,25 +243,25 @@ by:= rect.y + rect.h;
 tmpx:= rect.x;
 tmpx2:= bx;
 while (tmpx <= bx - rect.w div 2 - 1) and bRes do
-      begin
-      bRes:= ((rect.y and LAND_HEIGHT_MASK) = 0) and ((by and LAND_HEIGHT_MASK) = 0) and
-             ((tmpx and LAND_WIDTH_MASK) = 0) and ((tmpx2 and LAND_WIDTH_MASK) = 0) and
-             (Land[rect.y, tmpx] = Color) and (Land[by, tmpx] = Color) and
-             (Land[rect.y, tmpx2] = Color) and (Land[by, tmpx2] = Color);
-      inc(tmpx);
-      dec(tmpx2)
-      end;
+    begin
+    bRes:= ((rect.y and LAND_HEIGHT_MASK) = 0) and ((by and LAND_HEIGHT_MASK) = 0)
+    and ((tmpx and LAND_WIDTH_MASK) = 0) and ((tmpx2 and LAND_WIDTH_MASK) = 0)
+    and (Land[rect.y, tmpx] = Color) and (Land[by, tmpx] = Color)
+    and (Land[rect.y, tmpx2] = Color) and (Land[by, tmpx2] = Color);
+    inc(tmpx);
+    dec(tmpx2)
+    end;
 tmpy:= rect.y+1;
 tmpy2:= by-1;
 while (tmpy <= by - rect.h div 2 - 1) and bRes do
-      begin
-      bRes:= ((tmpy and LAND_HEIGHT_MASK) = 0) and ((tmpy2 and LAND_HEIGHT_MASK) = 0) and
-             ((rect.x and LAND_WIDTH_MASK) = 0) and ((bx and LAND_WIDTH_MASK) = 0) and
-             (Land[tmpy, rect.x] = Color) and (Land[tmpy, bx] = Color) and
-             (Land[tmpy2, rect.x] = Color) and (Land[tmpy2, bx] = Color);
-      inc(tmpy);
-      dec(tmpy2)
-      end;
+    begin
+    bRes:= ((tmpy and LAND_HEIGHT_MASK) = 0) and ((tmpy2 and LAND_HEIGHT_MASK) = 0)
+    and ((rect.x and LAND_WIDTH_MASK) = 0) and ((bx and LAND_WIDTH_MASK) = 0)
+    and (Land[tmpy, rect.x] = Color) and (Land[tmpy, bx] = Color)
+    and (Land[tmpy2, rect.x] = Color) and (Land[tmpy2, bx] = Color);
+    inc(tmpy);
+    dec(tmpy2)
+    end;
 {$WARNINGS ON}
 CheckLand:= bRes;
 end;
@@ -264,18 +271,19 @@ var i: Longword;
     bRes: boolean;
 begin
 with Obj do
-     if CheckLand(inland, x, y, lfBasic) then
+    if CheckLand(inland, x, y, lfBasic) then
         begin
         bRes:= true;
         i:= 1;
         while bRes and (i <= rectcnt) do
-              begin
-              bRes:= CheckLand(outland[i], x, y, 0);
-              inc(i)
-              end;
+            begin
+            bRes:= CheckLand(outland[i], x, y, 0);
+            inc(i)
+            end;
         if bRes then
-           bRes:= not CheckIntersect(x, y, Width, Height)
-        end else
+            bRes:= not CheckIntersect(x, y, Width, Height)
+        end
+    else
         bRes:= false;
 CheckCanPlace:= bRes;
 end;
@@ -287,39 +295,41 @@ var x, y: Longword;
     cnt, i: Longword;
     bRes: boolean;
 begin
+TryPut:= false;
 cnt:= 0;
 with Obj do
-     begin
-     if Maxcnt = 0 then
-        exit(false);
-     x:= 0;
-     repeat
-         y:= topY+32; // leave room for a hedgie to teleport in
-         repeat
-             if CheckCanPlace(x, y, Obj) then
+    begin
+    if Maxcnt = 0 then
+        exit;
+    x:= 0;
+    repeat
+        y:= topY+32; // leave room for a hedgie to teleport in
+        repeat
+            if CheckCanPlace(x, y, Obj) then
                 begin
                 ar[cnt].x:= x;
                 ar[cnt].y:= y;
                 inc(cnt);
                 if cnt > MaxPointsIndex then // buffer is full, do not check the rest land
-                   begin
-                   y:= 5000;
-                   x:= 5000;
-                   end
+                    begin
+                    y:= 5000;
+                    x:= 5000;
+                    end
                 end;
-             inc(y, 3);
-         until y >= LAND_HEIGHT - Height;
-         inc(x, getrandom(6) + 3)
-     until x >= LAND_WIDTH - Width;
-     bRes:= cnt <> 0;
-     if bRes then
+            inc(y, 3);
+        until y >= LAND_HEIGHT - Height;
+        inc(x, getrandom(6) + 3)
+    until x >= LAND_WIDTH - Width;
+    bRes:= cnt <> 0;
+    if bRes then
         begin
         i:= getrandom(cnt);
         BlitImageAndGenerateCollisionInfo(ar[i].x, ar[i].y, 0, Obj.Surf);
         AddRect(ar[i].x, ar[i].y, Width, Height);
         dec(Maxcnt)
-        end else Maxcnt:= 0
-     end;
+        end
+    else Maxcnt:= 0
+    end;
 TryPut:= bRes;
 end;
 
@@ -331,11 +341,12 @@ var x, y: Longword;
     r: TSDL_Rect;
     bRes: boolean;
 begin
+TryPut:= false;
 cnt:= 0;
 with Obj do
     begin
     if Maxcnt = 0 then
-        exit(false);
+        exit;
     x:= 0;
     r.x:= 0;
     r.y:= 0;
@@ -345,17 +356,17 @@ with Obj do
         y:= 8;
         repeat
             if CheckLand(r, x, y - 8, lfBasic)
-            and not CheckIntersect(x, y, Width, Height) then
-            begin
-            ar[cnt].x:= x;
-            ar[cnt].y:= y;
-            inc(cnt);
-            if cnt > MaxPointsIndex then // buffer is full, do not check the rest land
+            and (not CheckIntersect(x, y, Width, Height)) then
                 begin
-                y:= 5000;
-                x:= 5000;
-                end
-            end;
+                ar[cnt].x:= x;
+                ar[cnt].y:= y;
+                inc(cnt);
+                if cnt > MaxPointsIndex then // buffer is full, do not check the rest land
+                    begin
+                    y:= 5000;
+                    x:= 5000;
+                    end
+                end;
             inc(y, 12);
         until y >= LAND_HEIGHT - Height - 8;
         inc(x, getrandom(12) + 12)
@@ -371,34 +382,38 @@ with Obj do
         SDL_UpperBlit(Obj.Surf, nil, Surface, @r);
         AddRect(ar[i].x - 32, ar[i].y - 32, Width + 64, Height + 64);
         dec(Maxcnt)
-        end else Maxcnt:= 0
+        end
+    else Maxcnt:= 0
     end;
 TryPut:= bRes;
 end;
 
+
+procedure CheckRect(Width, Height, x, y, w, h: LongWord);
+begin
+    if (x + w > Width) then 
+        OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
+    if (y + h > Height) then 
+        OutError('Object''s rectangle exceeds image: y + h (' + inttostr(y) + ' + ' + inttostr(h) + ') > Height (' + inttostr(Height) + ')', true);
+end;
+
 procedure ReadThemeInfo(var ThemeObjects: TThemeObjects; var SprayObjects: TSprayObjects);
 var s, key: shortstring;
     f: textfile;
     i: LongInt;
     ii, t: Longword;
     c2: TSDL_Color;
-
-    procedure CheckRect(Width, Height, x, y, w, h: LongWord);
-    begin
-    if (x + w > Width) then OutError('Object''s rectangle exceeds image: x + w (' + inttostr(x) + ' + ' + inttostr(w) + ') > Width (' + inttostr(Width) + ')', true);
-    if (y + h > Height) then OutError('Object''s rectangle exceeds image: y + h (' + inttostr(y) + ' + ' + inttostr(h) + ') > Height (' + inttostr(Height) + ')', true);
-    end;
-
 begin
 
 AddProgress;
 // Set default water greyscale values
-if cGrayScale then
+if GrayScale then
     begin
     for i:= 0 to 3 do
         begin
         t:= round(SDWaterColorArray[i].r * RGB_LUMINANCE_RED + SDWaterColorArray[i].g * RGB_LUMINANCE_GREEN + SDWaterColorArray[i].b * RGB_LUMINANCE_BLUE);
-        if t > 255 then t:= 255;
+        if t > 255 then
+            t:= 255;
         SDWaterColorArray[i].r:= t;
         SDWaterColorArray[i].g:= t;
         SDWaterColorArray[i].b:= t
@@ -406,7 +421,8 @@ if cGrayScale then
     for i:= 0 to 1 do
         begin
         t:= round(WaterColorArray[i].r * RGB_LUMINANCE_RED + WaterColorArray[i].g * RGB_LUMINANCE_GREEN + WaterColorArray[i].b * RGB_LUMINANCE_BLUE);
-        if t > 255 then t:= 255;
+        if t > 255 then
+            t:= 255;
         WaterColorArray[i].r:= t;
         WaterColorArray[i].g:= t;
         WaterColorArray[i].b:= t
@@ -414,7 +430,8 @@ if cGrayScale then
     end;
 
 s:= UserPathz[ptCurrTheme] + '/' + cThemeCFGFilename;
-if not FileExists(s) then s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
+if not FileExists(s) then
+    s:= Pathz[ptCurrTheme] + '/' + cThemeCFGFilename;
 WriteLnToConsole('Reading objects info...');
 Assign(f, s);
 {$I-}
@@ -427,8 +444,10 @@ SprayObjects.Count:= 0;
 while not eof(f) do
     begin
     Readln(f, s);
-    if Length(s) = 0 then continue;
-    if s[1] = ';' then continue;
+    if Length(s) = 0 then
+        continue;
+    if s[1] = ';' then
+        continue;
 
     i:= Pos('=', s);
     key:= Trim(Copy(s, 1, Pred(i)));
@@ -443,10 +462,12 @@ while not eof(f) do
         SkyColor.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
         SkyColor.b:= StrToInt(Trim(s));
-        if cGrayScale then
+        if GrayScale
+            then
             begin
             t:= round(SkyColor.r * RGB_LUMINANCE_RED + SkyColor.g * RGB_LUMINANCE_GREEN + SkyColor.b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             SkyColor.r:= t;
             SkyColor.g:= t;
             SkyColor.b:= t
@@ -465,15 +486,16 @@ while not eof(f) do
         c2.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
         c2.b:= StrToInt(Trim(s));
-        if cGrayScale then
+        if GrayScale then
             begin
             t:= round(SkyColor.r * RGB_LUMINANCE_RED + SkyColor.g * RGB_LUMINANCE_GREEN + SkyColor.b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             c2.r:= t;
             c2.g:= t;
             c2.b:= t
             end;
-        cExplosionBorderColor:= c2.value or AMask;
+        ExplosionBorderColor:= (c2.r shl RShift) or (c2.g shl GShift) or (c2.b shl BShift) or AMask; 
         end
     else if key = 'water-top' then
         begin
@@ -485,10 +507,11 @@ while not eof(f) do
         Delete(s, 1, i);
         WaterColorArray[0].b:= StrToInt(Trim(s));
         WaterColorArray[0].a := 255;
-        if cGrayScale then
+        if GrayScale then
             begin
             t:= round(WaterColorArray[0].r * RGB_LUMINANCE_RED + WaterColorArray[0].g * RGB_LUMINANCE_GREEN + WaterColorArray[0].b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             WaterColorArray[0].r:= t;
             WaterColorArray[0].g:= t;
             WaterColorArray[0].b:= t
@@ -505,10 +528,11 @@ while not eof(f) do
         Delete(s, 1, i);
         WaterColorArray[2].b:= StrToInt(Trim(s));
         WaterColorArray[2].a := 255;
-        if cGrayScale then
+        if GrayScale then
             begin
             t:= round(WaterColorArray[2].r * RGB_LUMINANCE_RED + WaterColorArray[2].g * RGB_LUMINANCE_GREEN + WaterColorArray[2].b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             WaterColorArray[2].r:= t;
             WaterColorArray[2].g:= t;
             WaterColorArray[2].b:= t
@@ -517,13 +541,14 @@ while not eof(f) do
         end
     else if key = 'water-opacity' then
         begin
-        cWaterOpacity:= StrToInt(Trim(s));
-        cSDWaterOpacity:= cWaterOpacity
+        WaterOpacity:= StrToInt(Trim(s));
+        SDWaterOpacity:= WaterOpacity
         end
-    else if key = 'music' then MusicFN:= Trim(s)
+    else if key = 'music' then
+        SetMusicName(Trim(s))
     else if key = 'clouds' then
         begin
-        cCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH;
+        cCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div 4096;
         cSDCloudsNumber:= cCloudsNumber
         end
     else if key = 'object' then
@@ -532,15 +557,15 @@ while not eof(f) do
         with ThemeObjects.objs[Pred(ThemeObjects.Count)] do
             begin
             i:= Pos(',', s);
-            Surf:= LoadImage(UserPathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
-            if Surf = nil then Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifCritical or ifTransparent or ifIgnoreCaps);
+            Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
             Width:= Surf^.w;
             Height:= Surf^.h;
             Delete(s, 1, i);
             i:= Pos(',', s);
             Maxcnt:= StrToInt(Trim(Copy(s, 1, Pred(i))));
             Delete(s, 1, i);
-            if (Maxcnt < 1) or (Maxcnt > MAXTHEMEOBJECTS) then OutError('Object''s max count should be between 1 and '+ inttostr(MAXTHEMEOBJECTS) +' (it was '+ inttostr(Maxcnt) +').', true);
+            if (Maxcnt < 1) or (Maxcnt > MAXTHEMEOBJECTS) then
+                OutError('Object''s max count should be between 1 and '+ inttostr(MAXTHEMEOBJECTS) +' (it was '+ inttostr(Maxcnt) +').', true);
             with inland do
                 begin
                 i:= Pos(',', s);
@@ -572,7 +597,8 @@ while not eof(f) do
                     i:= Pos(',', s);
                     w:= StrToInt(Trim(Copy(s, 1, Pred(i))));
                     Delete(s, 1, i);
-                    if ii = rectcnt then h:= StrToInt(Trim(s))
+                    if ii = rectcnt then
+                        h:= StrToInt(Trim(s))
                     else
                         begin
                         i:= Pos(',', s);
@@ -589,8 +615,7 @@ while not eof(f) do
         with SprayObjects.objs[Pred(SprayObjects.Count)] do
             begin
             i:= Pos(',', s);
-            Surf:= LoadImage(UserPathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
-            if Surf = nil then Surf:= LoadImage(Pathz[ptCurrTheme] + '/' + Trim(Copy(s, 1, Pred(i))), ifCritical or ifTransparent or ifIgnoreCaps);
+            Surf:= LoadDataImage(ptCurrTheme, Trim(Copy(s, 1, Pred(i))), ifTransparent or ifIgnoreCaps);
             Width:= Surf^.w;
             Height:= Surf^.h;
             Delete(s, 1, i);
@@ -616,8 +641,10 @@ while not eof(f) do
             vobFallSpeed:= StrToInt(Trim(s));
             end;
         end
-    else if key = 'flatten-flakes' then cFlattenFlakes:= true
-    else if key = 'flatten-clouds' then cFlattenClouds:= true
+    else if key = 'flatten-flakes' then
+        cFlattenFlakes:= true
+    else if key = 'flatten-clouds' then
+        cFlattenClouds:= true
     else if key = 'sd-water-top' then
         begin
         i:= Pos(',', s);
@@ -628,10 +655,11 @@ while not eof(f) do
         Delete(s, 1, i);
         SDWaterColorArray[0].b:= StrToInt(Trim(s));
         SDWaterColorArray[0].a := 255;
-        if cGrayScale then
+        if GrayScale then
             begin
             t:= round(SDWaterColorArray[0].r * RGB_LUMINANCE_RED + SDWaterColorArray[0].g * RGB_LUMINANCE_GREEN + SDWaterColorArray[0].b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             SDWaterColorArray[0].r:= t;
             SDWaterColorArray[0].g:= t;
             SDWaterColorArray[0].b:= t
@@ -648,18 +676,21 @@ while not eof(f) do
         Delete(s, 1, i);
         SDWaterColorArray[2].b:= StrToInt(Trim(s));
         SDWaterColorArray[2].a := 255;
-        if cGrayScale then
+        if GrayScale then
             begin
             t:= round(SDWaterColorArray[2].r * RGB_LUMINANCE_RED + SDWaterColorArray[2].g * RGB_LUMINANCE_GREEN + SDWaterColorArray[2].b * RGB_LUMINANCE_BLUE);
-            if t > 255 then t:= 255;
+            if t > 255 then
+                t:= 255;
             SDWaterColorArray[2].r:= t;
             SDWaterColorArray[2].g:= t;
             SDWaterColorArray[2].b:= t
             end;
         SDWaterColorArray[3]:= SDWaterColorArray[2];
         end
-    else if key = 'sd-water-opacity' then cSDWaterOpacity:= StrToInt(Trim(s))
-    else if key = 'sd-clouds' then cSDCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div LAND_WIDTH
+    else if key = 'sd-water-opacity' then
+        SDWaterOpacity:= StrToInt(Trim(s))
+    else if key = 'sd-clouds' then
+        cSDCloudsNumber:= Word(StrToInt(Trim(s))) * cScreenSpace div 4096
     else if key = 'sd-flakes' then
         begin
         i:= Pos(',', s);
@@ -690,10 +721,11 @@ while not eof(f) do
             RQSkyColor.g:= StrToInt(Trim(Copy(s, 1, Pred(i))));
             Delete(s, 1, i);
             RQSkyColor.b:= StrToInt(Trim(s));
-            if cGrayScale then
+            if GrayScale then
                 begin
                 t:= round(RQSkyColor.r * RGB_LUMINANCE_RED + RQSkyColor.g * RGB_LUMINANCE_GREEN + RQSkyColor.b * RGB_LUMINANCE_BLUE);
-                if t > 255 then t:= 255;
+                if t > 255 then
+                    t:= 255;
                 RQSkyColor.r:= t;
                 RQSkyColor.g:= t;
                 RQSkyColor.b:= t
@@ -716,7 +748,8 @@ procedure AddThemeObjects(var ThemeObjects: TThemeObjects);
 var i, ii, t: LongInt;
     b: boolean;
 begin
-    if ThemeObjects.Count = 0 then exit;
+    if ThemeObjects.Count = 0 then
+        exit;
     WriteLnToConsole('Adding theme objects...');
 
     for i:=0 to ThemeObjects.Count do
@@ -739,7 +772,8 @@ procedure AddSprayObjects(Surface: PSDL_Surface; var SprayObjects: TSprayObjects
 var i, ii, t: LongInt;
     b: boolean;
 begin
-    if SprayObjects.Count = 0 then exit;
+    if SprayObjects.Count = 0 then
+        exit;
     WriteLnToConsole('Adding spray objects...');
 
     for i:=0 to SprayObjects.Count do
@@ -759,19 +793,20 @@ begin
 end;
 
 procedure AddObjects();
-var i, int: Longword;
+var i, g: Longword;
 begin
 InitRects;
 if hasGirders then
     begin
-    int:= max(playWidth div 8, 256);
-    i:=leftX+int;
+    g:= max(playWidth div 8, 256);
+    i:= leftX + g;
     repeat
         AddGirder(i);
-        i:=i+int;
-    until (i>rightX-int);
+        i:=i + g;
+    until (i > rightX - g);
     end;
-if (GameFlags and gfDisableLandObjects) = 0 then AddThemeObjects(ThemeObjects);
+if (GameFlags and gfDisableLandObjects) = 0 then
+    AddThemeObjects(ThemeObjects);
 AddProgress();
 FreeRects();
 end;
diff --git a/hedgewars/uLandOutline.pas b/hedgewars/uLandOutline.pas
new file mode 100644
index 0000000..3bc58b8
--- /dev/null
+++ b/hedgewars/uLandOutline.pas
@@ -0,0 +1,311 @@
+unit uLandOutline;
+
+interface
+
+uses uConsts, SDLh, uFloat;
+
+type TPixAr = record
+              Count: Longword;
+              ar: array[0..Pred(cMaxEdgePoints)] of TPoint;
+              end;
+
+procedure DrawEdge(var pa: TPixAr; Color: Longword);
+procedure FillLand(x, y: LongInt);
+procedure BezierizeEdge(var pa: TPixAr; Delta: hwFloat);
+procedure RandomizePoints(var pa: TPixAr);
+
+implementation
+
+uses uLandGraphics, uDebug, uVariables, uLandTemplates, uRandom, uUtils;
+
+
+
+var Stack: record
+           Count: Longword;
+           points: array[0..8192] of record
+                                     xl, xr, y, dir: LongInt;
+                                     end
+           end;
+
+procedure Push(_xl, _xr, _y, _dir: LongInt);
+begin
+    TryDo(Stack.Count <= 8192, 'FillLand: stack overflow', true);
+    _y:= _y + _dir;
+    if (_y < 0) or (_y >= LAND_HEIGHT) then
+        exit;
+    with Stack.points[Stack.Count] do
+        begin
+        xl:= _xl;
+        xr:= _xr;
+        y:= _y;
+        dir:= _dir
+        end;
+    inc(Stack.Count)
+end;
+
+procedure Pop(var _xl, _xr, _y, _dir: LongInt);
+begin
+    dec(Stack.Count);
+    with Stack.points[Stack.Count] do
+        begin
+        _xl:= xl;
+        _xr:= xr;
+        _y:= y;
+        _dir:= dir
+        end
+end;
+
+procedure FillLand(x, y: LongInt);
+var xl, xr, dir: LongInt;
+begin
+    Stack.Count:= 0;
+    xl:= x - 1;
+    xr:= x;
+    Push(xl, xr, y, -1);
+    Push(xl, xr, y,  1);
+    dir:= 0;
+    while Stack.Count > 0 do
+        begin
+        Pop(xl, xr, y, dir);
+        while (xl > 0) and (Land[y, xl] <> 0) do
+            dec(xl);
+        while (xr < LAND_WIDTH - 1) and (Land[y, xr] <> 0) do
+            inc(xr);
+        while (xl < xr) do
+            begin
+            while (xl <= xr) and (Land[y, xl] = 0) do
+                inc(xl);
+            x:= xl;
+            while (xl <= xr) and (Land[y, xl] <> 0) do
+                begin
+                Land[y, xl]:= 0;
+                inc(xl)
+                end;
+            if x < xl then
+                begin
+                Push(x, Pred(xl), y, dir);
+                Push(x, Pred(xl), y,-dir);
+                end;
+            end;
+        end;
+end;
+
+procedure DrawEdge(var pa: TPixAr; Color: Longword);
+var i: LongInt;
+begin
+    i:= 0;
+    with pa do
+        while i < LongInt(Count) - 1 do
+            if (ar[i + 1].X = NTPX) then 
+                inc(i, 2)
+            else 
+                begin
+                DrawLine(ar[i].x, ar[i].y, ar[i + 1].x, ar[i + 1].y, Color);
+                inc(i)
+                end
+end;
+
+
+procedure Vector(p1, p2, p3: TPoint; var Vx, Vy: hwFloat);
+var d1, d2, d: hwFloat;
+begin
+    Vx:= int2hwFloat(p1.X - p3.X);
+    Vy:= int2hwFloat(p1.Y - p3.Y);
+
+    d:= DistanceI(p2.X - p1.X, p2.Y - p1.Y);
+    d1:= DistanceI(p2.X - p3.X, p2.Y - p3.Y);
+    d2:= Distance(Vx, Vy);
+
+    if d1 < d then
+        d:= d1;
+    if d2 < d then
+        d:= d2;
+
+    d:= d * _1div3;
+
+    if d2.QWordValue = 0 then
+        begin
+        Vx:= _0;
+        Vy:= _0
+        end 
+    else
+        begin
+        d2:= _1 / d2;
+        Vx:= Vx * d2;
+        Vy:= Vy * d2;
+
+        Vx:= Vx * d;
+        Vy:= Vy * d
+        end
+end;
+
+procedure AddLoopPoints(var pa, opa: TPixAr; StartI, EndI: LongInt; Delta: hwFloat);
+var i, pi, ni: LongInt;
+    NVx, NVy, PVx, PVy: hwFloat;
+    x1, x2, y1, y2: LongInt;
+    tsq, tcb, t, r1, r2, r3, cx1, cx2, cy1, cy2: hwFloat;
+    X, Y: LongInt;
+begin
+pi:= EndI;
+i:= StartI;
+ni:= Succ(StartI);
+{$HINTS OFF}
+Vector(opa.ar[pi], opa.ar[i], opa.ar[ni], NVx, NVy);
+{$HINTS ON}
+repeat
+    inc(pi);
+    if pi > EndI then
+        pi:= StartI;
+    inc(i);
+    if i > EndI then
+        i:= StartI;
+    inc(ni);
+    if ni > EndI then
+        ni:= StartI;
+    PVx:= NVx;
+    PVy:= NVy;
+    Vector(opa.ar[pi], opa.ar[i], opa.ar[ni], NVx, NVy);
+
+    x1:= opa.ar[pi].x;
+    y1:= opa.ar[pi].y;
+    x2:= opa.ar[i].x;
+    y2:= opa.ar[i].y;
+    cx1:= int2hwFloat(x1) - PVx;
+    cy1:= int2hwFloat(y1) - PVy;
+    cx2:= int2hwFloat(x2) + NVx;
+    cy2:= int2hwFloat(y2) + NVy;
+    t:= _0;
+    while t.Round = 0 do
+        begin
+        tsq:= t * t;
+        tcb:= tsq * t;
+        r1:= (_1 - t*3 + tsq*3 - tcb);
+        r2:= (     t*3 - tsq*6 + tcb*3);
+        r3:= (           tsq*3 - tcb*3);
+        X:= hwRound(r1 * x1 + r2 * cx1 + r3 * cx2 + tcb * x2);
+        Y:= hwRound(r1 * y1 + r2 * cy1 + r3 * cy2 + tcb * y2);
+        t:= t + Delta;
+        pa.ar[pa.Count].x:= X;
+        pa.ar[pa.Count].y:= Y;
+        inc(pa.Count);
+        TryDo(pa.Count <= cMaxEdgePoints, 'Edge points overflow', true)
+        end;
+until i = StartI;
+pa.ar[pa.Count].x:= opa.ar[StartI].X;
+pa.ar[pa.Count].y:= opa.ar[StartI].Y;
+inc(pa.Count)
+end;
+
+procedure BezierizeEdge(var pa: TPixAr; Delta: hwFloat);
+var i, StartLoop: LongInt;
+    opa: TPixAr;
+begin
+opa:= pa;
+pa.Count:= 0;
+i:= 0;
+StartLoop:= 0;
+while i < LongInt(opa.Count) do
+    if (opa.ar[i + 1].X = NTPX) then
+        begin
+        AddLoopPoints(pa, opa, StartLoop, i, Delta);
+        inc(i, 2);
+        StartLoop:= i;
+        pa.ar[pa.Count].X:= NTPX;
+        pa.ar[pa.Count].Y:= 0;
+        inc(pa.Count);
+        end else inc(i)
+end;
+
+
+function CheckIntersect(V1, V2, V3, V4: TPoint): boolean;
+var c1, c2, dm: LongInt;
+begin
+    CheckIntersect:= false;
+    dm:= (V4.y - V3.y) * (V2.x - V1.x) - (V4.x - V3.x) * (V2.y - V1.y);
+    c1:= (V4.x - V3.x) * (V1.y - V3.y) - (V4.y - V3.y) * (V1.x - V3.x);
+    if dm = 0 then
+        exit;
+
+    CheckIntersect:= true;
+    c2:= (V2.x - V3.x) * (V1.y - V3.y) - (V2.y - V3.y) * (V1.x - V3.x);
+    if dm > 0 then
+    begin
+        if (c1 < 0) or (c1 > dm) then
+            CheckIntersect:= false
+        else if (c2 < 0) or (c2 > dm) then
+            CheckIntersect:= false;
+    end 
+    else
+    begin
+        if (c1 > 0) or (c1 < dm) then
+            CheckIntersect:= false
+        else if (c2 > 0) or (c2 < dm) then
+            CheckIntersect:= false;
+    end;
+
+    //AddFileLog('1  (' + inttostr(V1.x) + ',' + inttostr(V1.y) + ')x(' + inttostr(V2.x) + ',' + inttostr(V2.y) + ')');
+    //AddFileLog('2  (' + inttostr(V3.x) + ',' + inttostr(V3.y) + ')x(' + inttostr(V4.x) + ',' + inttostr(V4.y) + ')');
+end;
+
+
+function CheckSelfIntersect(var pa: TPixAr; ind: Longword): boolean;
+var i: Longword;
+begin
+    CheckSelfIntersect:= false;
+    if (ind <= 0) or (ind >= Pred(pa.Count)) then
+        exit;
+
+    CheckSelfIntersect:= true;
+    for i:= 1 to pa.Count - 3 do
+        if (i <= ind - 1) or (i >= ind + 2) then
+        begin
+            if (i <> ind - 1) and CheckIntersect(pa.ar[ind], pa.ar[ind - 1], pa.ar[i], pa.ar[i - 1]) then
+                exit;
+            if (i <> ind + 2) and CheckIntersect(pa.ar[ind], pa.ar[ind + 1], pa.ar[i], pa.ar[i - 1]) then
+                exit;
+        end;
+    CheckSelfIntersect:= false
+end;
+
+procedure RandomizePoints(var pa: TPixAr);
+const cEdge = 55;
+      cMinDist = 8;
+var radz: array[0..Pred(cMaxEdgePoints)] of LongInt;
+    i, k, dist, px, py: LongInt;
+begin
+    for i:= 0 to Pred(pa.Count) do
+    begin
+    radz[i]:= 0;
+        with pa.ar[i] do
+            if x <> NTPX then
+            begin
+            radz[i]:= Min(Max(x - cEdge, 0), Max(LAND_WIDTH - cEdge - x, 0));
+            radz[i]:= Min(radz[i], Min(Max(y - cEdge, 0), Max(LAND_HEIGHT - cEdge - y, 0)));
+            if radz[i] > 0 then
+                for k:= 0 to Pred(i) do
+                begin
+                dist:= Max(abs(x - pa.ar[k].x), abs(y - pa.ar[k].y));
+                radz[k]:= Max(0, Min((dist - cMinDist) div 2, radz[k]));
+                radz[i]:= Max(0, Min(dist - radz[k] - cMinDist, radz[i]))
+                end
+            end;
+    end;
+
+    for i:= 0 to Pred(pa.Count) do
+        with pa.ar[i] do
+            if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then
+            begin
+            px:= x;
+            py:= y;
+            x:= x + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3;
+            y:= y + LongInt(GetRandom(7) - 3) * (radz[i] * 5 div 7) div 3;
+            if CheckSelfIntersect(pa, i) then
+                begin
+                x:= px;
+                y:= py
+                end;
+            end
+end;
+
+
+end.
diff --git a/hedgewars/uLandPainted.pas b/hedgewars/uLandPainted.pas
index e35db29..d472e08 100644
--- a/hedgewars/uLandPainted.pas
+++ b/hedgewars/uLandPainted.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -27,7 +27,7 @@ procedure initModule;
 procedure freeModule;
 
 implementation
-uses uLandGraphics, uConsts, uUtils, SDLh, uCommands, uDebug;
+uses uLandGraphics, uConsts, uVariables, uUtils, SDLh, uCommands, uDebug;
 
 type PointRec = packed record
     X, Y: SmallInt;
@@ -43,69 +43,6 @@ type
 
 var pointsListHead, pointsListLast: PPointEntry;
 
-procedure DrawLineOnLand(X1, Y1, X2, Y2: LongInt);
-var  eX, eY, dX, dY: LongInt;
-    i, sX, sY, x, y, d: LongInt;
-    b: boolean;
-    len: LongWord;
-begin
-    len:= 0;
-    if (X1 = X2) and (Y1 = Y2) then
-        begin
-        exit
-        end;
-    eX:= 0;
-    eY:= 0;
-    dX:= X2 - X1;
-    dY:= Y2 - Y1;
-
-    if (dX > 0) then sX:= 1
-    else
-    if (dX < 0) then
-        begin
-        sX:= -1;
-        dX:= -dX
-        end else sX:= dX;
-
-    if (dY > 0) then sY:= 1
-    else
-    if (dY < 0) then
-        begin
-        sY:= -1;
-        dY:= -dY
-        end else sY:= dY;
-
-        if (dX > dY) then d:= dX
-                    else d:= dY;
-
-        x:= X1;
-        y:= Y1;
-
-        for i:= 0 to d do
-            begin
-            inc(eX, dX);
-            inc(eY, dY);
-            b:= false;
-            if (eX > d) then
-                begin
-                dec(eX, d);
-                inc(x, sX);
-                b:= true
-                end;
-            if (eY > d) then
-                begin
-                dec(eY, d);
-                inc(y, sY);
-                b:= true
-                end;
-            if b then
-                begin
-                inc(len);
-                if (len mod 4) = 0 then FillRoundInLand(X, Y, 34, lfBasic)
-                end
-        end
-end;
-
 procedure chDraw(var s: shortstring);
 var rec: PointRec;
     prec: ^PointRec;
@@ -120,8 +57,12 @@ begin
         rec:= prec^;
         rec.X:= SDLNet_Read16(@rec.X);
         rec.Y:= SDLNet_Read16(@rec.Y);
+        if rec.X < -318 then rec.X:= -318;
+        if rec.X > 4096+318 then rec.X:= 4096+318;
+        if rec.Y < -318 then rec.Y:= -318;
+        if rec.Y > 2048+318 then rec.Y:= 2048+318;
 
-        pe:= new(PPointEntry);
+        new(pe);
         if pointsListLast = nil then
             pointsListHead:= pe
         else
@@ -138,10 +79,13 @@ end;
 procedure Draw;
 var pe: PPointEntry;
     prevPoint: PointRec;
+    radius: LongInt;
+    color: Longword;
 begin
     // shutup compiler
     prevPoint.X:= 0;
     prevPoint.Y:= 0;
+    radius:= 0;
 
     pe:= pointsListHead;
     TryDo((pe = nil) or (pe^.point.flags and $80 <> 0), 'Corrupted draw data', true);
@@ -150,13 +94,19 @@ begin
         begin
         if (pe^.point.flags and $80 <> 0) then
             begin
-            AddFileLog('[DRAW] Move to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+')');
-            FillRoundInLand(pe^.point.X, pe^.point.Y, 34, lfBasic)
+            if (pe^.point.flags and $40 <> 0) then
+                color:= 0
+                else
+                color:= lfBasic;
+            radius:= (pe^.point.flags and $3F) * 5 + 3;
+            AddFileLog('[DRAW] Move to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+'), radius = '+inttostr(radius));
+            FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color)
             end
             else
             begin
-            AddFileLog('[DRAW] Line to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+')');
-            DrawLineOnLand(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y);
+            AddFileLog('[DRAW] Line to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+'), radius = '+inttostr(radius));
+            DrawThickLine(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color);
+            FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color)
             end;
 
         prevPoint:= pe^.point;
@@ -169,7 +119,7 @@ begin
     pointsListHead:= nil;
     pointsListLast:= nil;
 
-    RegisterVariable('draw', vtCommand, @chDraw, false);
+    RegisterVariable('draw', @chDraw, false);
 end;
 
 procedure freeModule;
diff --git a/hedgewars/uLandTemplates.pas b/hedgewars/uLandTemplates.pas
index a4479fa..aaa625d 100644
--- a/hedgewars/uLandTemplates.pas
+++ b/hedgewars/uLandTemplates.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -22,10 +22,10 @@ unit uLandTemplates;
 interface
 uses SDLh;
 
-const NTPX = Low(TSDL_Rect.x);
+const NTPX = Low(SmallInt);
 
-type PPointArray = ^TPointArray;
-     TPointArray = array[0..64] of TSDL_Rect;
+type TPointArray = array[0..64] of TSDL_Rect;
+     PPointArray = ^TPointArray;
      TEdgeTemplate = record
                      BasePoints: PPointArray;
                      BasePointsCount: Longword;
@@ -65,7 +65,7 @@ const Template0Points: array[0..18] of TSDL_Rect =
       );
       Template0FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template1Points: array[0..15] of TSDL_Rect =
@@ -89,7 +89,7 @@ const Template1Points: array[0..15] of TSDL_Rect =
       );
       Template1FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template2Points: array[0..21] of TSDL_Rect =
@@ -119,7 +119,7 @@ const Template2Points: array[0..21] of TSDL_Rect =
       );
       Template2FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template3Points: array[0..16] of TSDL_Rect =
@@ -144,7 +144,7 @@ const Template3Points: array[0..16] of TSDL_Rect =
       );
       Template3FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template4Points: array[0..22] of TSDL_Rect =
@@ -175,7 +175,7 @@ const Template4Points: array[0..22] of TSDL_Rect =
       );
       Template4FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template5Points: array[0..15] of TSDL_Rect =
@@ -199,7 +199,7 @@ const Template5Points: array[0..15] of TSDL_Rect =
        );
       Template5FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template6Points: array[0..13] of TSDL_Rect =
@@ -221,7 +221,7 @@ const Template6Points: array[0..13] of TSDL_Rect =
        );
       Template6FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template7Points: array[0..5] of TSDL_Rect =
@@ -235,7 +235,7 @@ const Template7Points: array[0..5] of TSDL_Rect =
       );
       Template7FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 
@@ -264,7 +264,7 @@ const Template8Points: array[0..19] of TSDL_Rect =
       );
       Template8FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template9Points: array[0..31] of TSDL_Rect =
@@ -304,7 +304,7 @@ const Template9Points: array[0..31] of TSDL_Rect =
       );
       Template9FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template10Points: array[0..13] of TSDL_Rect =
@@ -326,7 +326,7 @@ const Template10Points: array[0..13] of TSDL_Rect =
       );
       Template10FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template11Points: array[0..9] of TSDL_Rect =
@@ -344,7 +344,7 @@ const Template11Points: array[0..9] of TSDL_Rect =
       );
       Template11FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template12Points: array[0..13] of TSDL_Rect =
@@ -366,7 +366,7 @@ const Template12Points: array[0..13] of TSDL_Rect =
       );
       Template12FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template13Points: array[0..15] of TSDL_Rect =
@@ -390,7 +390,7 @@ const Template13Points: array[0..15] of TSDL_Rect =
       );
       Template13FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template14Points: array[0..13] of TSDL_Rect =
@@ -412,7 +412,7 @@ const Template14Points: array[0..13] of TSDL_Rect =
       );
       Template14FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template15Points: array[0..23] of TSDL_Rect =
@@ -444,7 +444,7 @@ const Template15Points: array[0..23] of TSDL_Rect =
       );
       Template15FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template16Points: array[0..28] of TSDL_Rect =
@@ -481,7 +481,7 @@ const Template16Points: array[0..28] of TSDL_Rect =
       );
       Template16FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 
 const Template17Points: array[0..13] of TSDL_Rect =
@@ -503,7 +503,7 @@ const Template17Points: array[0..13] of TSDL_Rect =
       );
       Template17FPoints: array[0..0] of TPoint =
       (
-       (x: 1023; y:    0)
+       (X: 1023; Y:    0)
       );
 //////////////////// MIXING AND MATCHING ORIGINAL //////////////////////////////////////
 const Template18Points: array[0..32] of TSDL_Rect =
@@ -544,7 +544,7 @@ const Template18Points: array[0..32] of TSDL_Rect =
       );
       Template18FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template19Points: array[0..44] of TSDL_Rect =
@@ -597,7 +597,7 @@ const Template19Points: array[0..44] of TSDL_Rect =
       );
       Template19FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template20Points: array[0..45] of TSDL_Rect =
@@ -651,7 +651,7 @@ const Template20Points: array[0..45] of TSDL_Rect =
       );
       Template20FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template21Points: array[0..30] of TSDL_Rect =
@@ -690,7 +690,7 @@ const Template21Points: array[0..30] of TSDL_Rect =
       );
       Template21FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template22Points: array[0..38] of TSDL_Rect =
@@ -737,7 +737,7 @@ const Template22Points: array[0..38] of TSDL_Rect =
       );
       Template22FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template23Points: array[0..29] of TSDL_Rect =
@@ -775,7 +775,7 @@ const Template23Points: array[0..29] of TSDL_Rect =
        );
       Template23FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template24Points: array[0..23] of TSDL_Rect =
@@ -807,7 +807,7 @@ const Template24Points: array[0..23] of TSDL_Rect =
        );
       Template24FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template25Points: array[0..19] of TSDL_Rect =
@@ -835,7 +835,7 @@ const Template25Points: array[0..19] of TSDL_Rect =
       );
       Template25FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 
@@ -896,7 +896,7 @@ const Template26Points: array[0..51] of TSDL_Rect =
       );
       Template26FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template27Points: array[0..42] of TSDL_Rect =
@@ -947,7 +947,7 @@ const Template27Points: array[0..42] of TSDL_Rect =
       );
       Template27FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template28Points: array[0..29] of TSDL_Rect =
@@ -985,7 +985,7 @@ const Template28Points: array[0..29] of TSDL_Rect =
       );
       Template28FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template29Points: array[0..37] of TSDL_Rect =
@@ -1031,7 +1031,7 @@ const Template29Points: array[0..37] of TSDL_Rect =
       );
       Template29FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template30Points: array[0..30] of TSDL_Rect =
@@ -1070,7 +1070,7 @@ const Template30Points: array[0..30] of TSDL_Rect =
       );
       Template30FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template31Points: array[0..32] of TSDL_Rect =
@@ -1111,7 +1111,7 @@ const Template31Points: array[0..32] of TSDL_Rect =
       );
       Template31FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template32Points: array[0..29] of TSDL_Rect =
@@ -1149,7 +1149,7 @@ const Template32Points: array[0..29] of TSDL_Rect =
       );
       Template32FPoints: array[0..0] of TPoint =
       (
-         (x: 2047; y:    0)
+         (X: 2047; Y:    0)
       );
 
 const Template33Points: array[0..45] of TSDL_Rect =
@@ -1203,7 +1203,7 @@ const Template33Points: array[0..45] of TSDL_Rect =
       );
       Template33FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template34Points: array[0..25] of TSDL_Rect =
@@ -1237,7 +1237,7 @@ const Template34Points: array[0..25] of TSDL_Rect =
       );
       Template34FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 const Template35Points: array[0..48] of TSDL_Rect =
@@ -1294,7 +1294,7 @@ const Template35Points: array[0..48] of TSDL_Rect =
       );
       Template35FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 ///////////////////////// CAVERNS ///////////////////////////////////
@@ -1322,7 +1322,7 @@ const Template36Points: array[0..18] of TSDL_Rect =
       );
       Template36FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 ////////////////////////////// ... Silly ...  ////////////////////////////////
 /// Ok. Tiy does not care for these.  Perhaps they could be saved.
@@ -1363,7 +1363,7 @@ const Template37Points: array[0..27] of TSDL_Rect =
       );
       Template37FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 // attempt to make a series of moderate hills/valleys - was before I really figured out the whole probabilities thing
 const Template38Points: array[0..16] of TSDL_Rect =
@@ -1388,7 +1388,7 @@ const Template38Points: array[0..16] of TSDL_Rect =
       );
       Template38FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 
 // 8 tiny islands
@@ -1437,7 +1437,7 @@ const Template39Points: array[0..39] of TSDL_Rect =
       );
       Template39FPoints: array[0..0] of TPoint =
       (
-       (x: 512; y:    0)
+       (X: 512; Y:    0)
       );
 const Template40Points: array[0..7] of TSDL_Rect =
       (
@@ -1452,102 +1452,102 @@ const Template40Points: array[0..7] of TSDL_Rect =
       );
       Template40FPoints: array[0..0] of TPoint =
       (
-       (x: 512; y:    0)
+       (X: 512; Y:    0)
       );
 // Many islands
 const Template41Points: array[0..86] of TSDL_Rect =
       (
-       (x:   95; y: 500; w:   1; h:   1),
-       (x:  100; y: 275; w:  25; h: 100),
-       (x:  325; y: 275; w:  25; h: 100),
-       (x:  330; y: 500; w:   1; h:   1),
+       (x:   95; y: 500; w:  26; h:  26),
+       (x:  100; y: 275; w:  50; h: 125),
+       (x:  325; y: 275; w:  50; h: 125),
+       (x:  330; y: 500; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x:  725; y: 125; w:   1; h:   1),
-       (x:  725; y:  25; w:   5; h:  25),
-       (x:  825; y:  35; w:   5; h:  10),
-       (x:  825; y: 135; w:   1; h:   1),
+       (x:  725; y: 125; w:  26; h:  26),
+       (x:  725; y:  25; w:  30; h:  50),
+       (x:  825; y:  35; w:  30; h:  35),
+       (x:  825; y: 135; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 1150; y: 550; w:  25; h:  50),
-       (x: 1250; y: 300; w:  25; h:  50),
-       (x: 1350; y: 300; w:  25; h:  50),
-       (x: 1400; y: 575; w:  25; h:  50),
+       (x: 1150; y: 550; w:  50; h:  75),
+       (x: 1250; y: 300; w:  50; h:  75),
+       (x: 1350; y: 300; w:  50; h:  75),
+       (x: 1400; y: 575; w:  50; h:  75),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x:  525; y:1050; w:  50; h:  50),
-       (x:  700; y: 800; w: 100; h: 150),
-       (x:  950; y: 900; w: 100; h: 150),
-       (x: 1100; y:1100; w:  50; h:  50),
+       (x:  525; y:1050; w:  75; h:  75),
+       (x:  700; y: 800; w: 125; h: 175),
+       (x:  950; y: 900; w: 125; h: 175),
+       (x: 1100; y:1100; w:  75; h:  75),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x:  175; y:1500; w:   1; h:   1),
-       (x:  210; y:1400; w:   5; h:  25),
-       (x:  240; y:1400; w:   5; h:  25),
-       (x:  275; y:1510; w:   1; h:   1),
+       (x:  175; y:1500; w:  26; h:  26),
+       (x:  210; y:1400; w:  30; h:  50),
+       (x:  240; y:1400; w:  30; h:  50),
+       (x:  275; y:1510; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x:  450; y:1800; w: 100; h: 100),
-       (x:  600; y:1750; w: 100; h: 100),
-       (x:  750; y:1750; w: 100; h: 100),
-       (x:  950; y:1850; w: 100; h: 100),
+       (x:  450; y:1800; w: 125; h: 125),
+       (x:  600; y:1750; w: 125; h: 125),
+       (x:  750; y:1750; w: 125; h: 125),
+       (x:  950; y:1850; w: 125; h: 125),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 1075; y:1450; w:   1; h:   1),
-       (x: 1110; y:1300; w:   5; h:  25),
-       (x: 1140; y:1300; w:   5; h:  25),
-       (x: 1175; y:1430; w:   1; h:   1),
+       (x: 1075; y:1450; w:  26; h:  26),
+       (x: 1110; y:1300; w:  30; h:  50),
+       (x: 1140; y:1300; w:  30; h:  50),
+       (x: 1175; y:1430; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 1600; y:1250; w:  25; h: 100),
-       (x: 1700; y:1150; w:  25; h: 100),
-       (x: 1850; y: 500; w:  50; h: 100),
-       (x: 1950; y: 550; w:  50; h: 150),
-       (x: 2250; y:1150; w:  25; h: 100),
-       (x: 2350; y:1250; w:  25; h: 100),
+       (x: 1600; y:1250; w:  50; h: 125),
+       (x: 1700; y:1150; w:  50; h: 125),
+       (x: 1850; y: 500; w:  75; h: 125),
+       (x: 1950; y: 550; w:  75; h: 175),
+       (x: 2250; y:1150; w:  50; h: 125),
+       (x: 2350; y:1250; w:  50; h: 125),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 1750; y:2010; w:   1; h:   1),
-       (x: 1900; y:1870; w:  50; h:  50),
-       (x: 2050; y:1870; w:  50; h:  50),
-       (x: 2175; y:2010; w:   1; h:   1),
+       (x: 1750; y:2010; w:  26; h:  26),
+       (x: 1900; y:1870; w:  75; h:  75),
+       (x: 2050; y:1870; w:  75; h:  75),
+       (x: 2175; y:2010; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 2500; y:1700; w:   1; h:   1),
-       (x: 2575; y:1500; w:  10; h:  50),
-       (x: 2650; y:1500; w:  10; h:  50),
-       (x: 2700; y:1690; w:   1; h:   1),
+       (x: 2500; y:1700; w:  26; h:  26),
+       (x: 2575; y:1500; w:  35; h:  75),
+       (x: 2650; y:1500; w:  35; h:  75),
+       (x: 2700; y:1690; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 2000; y: 125; w:   1; h:   1),
-       (x: 2050; y:  50; w:  25; h:  25),
-       (x: 2100; y:  50; w:  25; h:  25),
-       (x: 2150; y: 150; w:   1; h:   1),
+       (x: 2000; y: 125; w:  26; h:  26),
+       (x: 2050; y:  50; w:  50; h:  50),
+       (x: 2100; y:  50; w:  50; h:  50),
+       (x: 2150; y: 150; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 2600; y: 250; w:  25; h: 100),
-       (x: 2750; y: 400; w:  50; h:  50),
-       (x: 2900; y: 525; w:  50; h:  50),
-       (x: 3150; y: 550; w:  50; h: 100),
+       (x: 2600; y: 250; w:  50; h: 125),
+       (x: 2750; y: 400; w:  75; h:  75),
+       (x: 2900; y: 525; w:  75; h:  75),
+       (x: 3150; y: 550; w:  75; h: 125),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 2800; y:1150; w:   1; h:   1),
-       (x: 2840; y: 950; w:  25; h:  25),
-       (x: 2880; y: 950; w:  25; h:  25),
-       (x: 2900; y:1150; w:   1; h:   1),
+       (x: 2800; y:1150; w:  26; h:  26),
+       (x: 2840; y: 950; w:  50; h:  50),
+       (x: 2880; y: 950; w:  50; h:  50),
+       (x: 2900; y:1150; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 3075; y:1985; w:   1; h:   1),
-       (x: 3325; y:1700; w:  50; h: 100),
-       (x: 3475; y:1700; w:  50; h: 100),
-       (x: 3625; y:1985; w:   1; h:   1),
+       (x: 3075; y:1985; w:  26; h:  26),
+       (x: 3325; y:1700; w:  75; h: 125),
+       (x: 3475; y:1700; w:  75; h: 125),
+       (x: 3625; y:1985; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 3200; y:1450; w:   1; h:   1),
-       (x: 3240; y:1350; w:  25; h:  25),
-       (x: 3280; y:1350; w:  25; h:  25),
-       (x: 3300; y:1450; w:   1; h:   1),
+       (x: 3200; y:1450; w:  26; h:  26),
+       (x: 3240; y:1350; w:  50; h:  50),
+       (x: 3280; y:1350; w:  50; h:  50),
+       (x: 3300; y:1450; w:  26; h:  26),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 3500; y:1050; w:  25; h:  50),
-       (x: 3650; y: 600; w:  50; h: 100),
-       (x: 3800; y: 600; w:  50; h: 100),
-       (x: 3900; y:1000; w:  25; h:  50),
+       (x: 3500; y:1050; w:  50; h:  75),
+       (x: 3650; y: 600; w:  75; h: 125),
+       (x: 3800; y: 600; w:  75; h: 125),
+       (x: 3900; y:1000; w:  50; h:  75),
        (x: NTPX; y:   0; w:   1; h:   1),
-       (x: 3800; y: 200; w:  25; h:  50),
-       (x: 3875; y: 100; w:  50; h:  50),
-       (x: 3925; y:  50; w:  50; h:  25),
-       (x: 4050; y: 125; w:  25; h:  50),
+       (x: 3800; y: 200; w:  50; h:  75),
+       (x: 3875; y: 100; w:  75; h:  75),
+       (x: 3925; y:  50; w:  75; h:  50),
+       (x: 4050; y: 125; w:  50; h:  75),
        (x: NTPX; y:   0; w:   1; h:   1)
       );
       Template41FPoints: array[0..0] of TPoint =
       (
-       (x: 2047; y:    0)
+       (X: 2047; Y:    0)
       );
 // 2 tiny islands
 const Template42Points: array[0..13] of TSDL_Rect =
@@ -1569,11 +1569,245 @@ const Template42Points: array[0..13] of TSDL_Rect =
       );
       Template42FPoints: array[0..0] of TPoint =
       (
-       (x: 512; y:    0)
+       (X: 512; Y:    0)
+      );
+// Many islands
+const Template43Points: array[0..173] of TSDL_Rect =
+      (
+       (x:   95; y: 500; w:  26; h:  26),
+       (x:  100; y: 275; w:  50; h: 125),
+       (x:  325; y: 275; w:  50; h: 125),
+       (x:  330; y: 500; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:  725; y: 125; w:  26; h:  26),
+       (x:  725; y:  25; w:  30; h:  50),
+       (x:  825; y:  35; w:  30; h:  35),
+       (x:  825; y: 135; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 1150; y: 550; w:  50; h:  75),
+       (x: 1250; y: 300; w:  50; h:  75),
+       (x: 1350; y: 300; w:  50; h:  75),
+       (x: 1400; y: 575; w:  50; h:  75),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:  525; y:1050; w:  75; h:  75),
+       (x:  700; y: 800; w: 125; h: 175),
+       (x:  950; y: 900; w: 125; h: 175),
+       (x: 1100; y:1100; w:  75; h:  75),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:  175; y:1500; w:  26; h:  26),
+       (x:  210; y:1400; w:  30; h:  50),
+       (x:  240; y:1400; w:  30; h:  50),
+       (x:  275; y:1510; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:  450; y:1800; w: 125; h: 125),
+       (x:  600; y:1750; w: 125; h: 125),
+       (x:  750; y:1750; w: 125; h: 125),
+       (x:  950; y:1850; w: 125; h: 125),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 1075; y:1450; w:  26; h:  26),
+       (x: 1110; y:1300; w:  30; h:  50),
+       (x: 1140; y:1300; w:  30; h:  50),
+       (x: 1175; y:1430; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 1600; y:1250; w:  50; h: 125),
+       (x: 1700; y:1150; w:  50; h: 125),
+       (x: 1850; y: 500; w:  75; h: 125),
+       (x: 1950; y: 550; w:  75; h: 175),
+       (x: 2250; y:1150; w:  50; h: 125),
+       (x: 2350; y:1250; w:  50; h: 125),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 1750; y:2010; w:  26; h:  26),
+       (x: 1900; y:1870; w:  75; h:  75),
+       (x: 2050; y:1870; w:  75; h:  75),
+       (x: 2175; y:2010; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 2500; y:1700; w:  26; h:  26),
+       (x: 2575; y:1500; w:  35; h:  75),
+       (x: 2650; y:1500; w:  35; h:  75),
+       (x: 2700; y:1690; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 2000; y: 125; w:  26; h:  26),
+       (x: 2050; y:  50; w:  50; h:  50),
+       (x: 2100; y:  50; w:  50; h:  50),
+       (x: 2150; y: 150; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 2600; y: 250; w:  50; h: 125),
+       (x: 2750; y: 400; w:  75; h:  75),
+       (x: 2900; y: 525; w:  75; h:  75),
+       (x: 3150; y: 550; w:  75; h: 125),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 2800; y:1150; w:  26; h:  26),
+       (x: 2840; y: 950; w:  50; h:  50),
+       (x: 2880; y: 950; w:  50; h:  50),
+       (x: 2900; y:1150; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 3075; y:1985; w:  26; h:  26),
+       (x: 3325; y:1700; w:  75; h: 125),
+       (x: 3475; y:1700; w:  75; h: 125),
+       (x: 3625; y:1985; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 3200; y:1450; w:  26; h:  26),
+       (x: 3240; y:1350; w:  50; h:  50),
+       (x: 3280; y:1350; w:  50; h:  50),
+       (x: 3300; y:1450; w:  26; h:  26),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 3500; y:1050; w:  50; h:  75),
+       (x: 3650; y: 600; w:  75; h: 125),
+       (x: 3800; y: 600; w:  75; h: 125),
+       (x: 3900; y:1000; w:  50; h:  75),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 3800; y: 200; w:  50; h:  75),
+       (x: 3875; y: 100; w:  75; h:  75),
+       (x: 3925; y:  50; w:  75; h:  50),
+       (x: 4050; y: 125; w:  50; h:  75),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:   95; y:2548; w:  26; h:  26),
+       (x:  100; y:2323; w:  50; h: 125),
+       (x:  325; y:2323; w:  50; h: 125),
+       (x:  330; y:2548; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x:  725; y:2173; w:  26; h:  26),
+       (x:  725; y:2073; w:  30; h:  50),
+       (x:  825; y:2083; w:  30; h:  35),
+       (x:  825; y:2183; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 1150; y:2598; w:  50; h:  75),
+       (x: 1250; y:2348; w:  50; h:  75),
+       (x: 1350; y:2348; w:  50; h:  75),
+       (x: 1400; y:2623; w:  50; h:  75),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x:  525; y:3098; w:  75; h:  75),
+       (x:  700; y:2848; w: 125; h: 175),
+       (x:  950; y:2948; w: 125; h: 175),
+       (x: 1100; y:3148; w:  75; h:  75),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x:  175; y:3548; w:  26; h:  26),
+       (x:  210; y:3448; w:  30; h:  50),
+       (x:  240; y:3448; w:  30; h:  50),
+       (x:  275; y:3558; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x:  450; y:3848; w: 125; h: 125),
+       (x:  600; y:3798; w: 125; h: 125),
+       (x:  750; y:3798; w: 125; h: 125),
+       (x:  950; y:3898; w: 125; h: 125),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 1075; y:3498; w:  26; h:  26),
+       (x: 1110; y:3348; w:  30; h:  50),
+       (x: 1140; y:3348; w:  30; h:  50),
+       (x: 1175; y:3478; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 1600; y:3298; w:  50; h: 125),
+       (x: 1700; y:3198; w:  50; h: 125),
+       (x: 1850; y:2548; w:  75; h: 125),
+       (x: 1950; y:2598; w:  75; h: 175),
+       (x: 2250; y:3198; w:  50; h: 125),
+       (x: 2350; y:3298; w:  50; h: 125),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 1750; y:4058; w:  26; h:  26),
+       (x: 1900; y:3918; w:  75; h:  75),
+       (x: 2050; y:3918; w:  75; h:  75),
+       (x: 2175; y:4058; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 2500; y:3748; w:  26; h:  26),
+       (x: 2575; y:3548; w:  35; h:  75),
+       (x: 2650; y:3548; w:  35; h:  75),
+       (x: 2700; y:3738; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 2000; y:2173; w:  26; h:  26),
+       (x: 2050; y:2098; w:  50; h:  50),
+       (x: 2100; y:2098; w:  50; h:  50),
+       (x: 2150; y:2198; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 2600; y:2298; w:  50; h: 125),
+       (x: 2750; y:2448; w:  75; h:  75),
+       (x: 2900; y:2573; w:  75; h:  75),
+       (x: 3150; y:2598; w:  75; h: 125),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 2800; y:3198; w:  26; h:  26),
+       (x: 2840; y:2998; w:  50; h:  50),
+       (x: 2880; y:2998; w:  50; h:  50),
+       (x: 2900; y:3198; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 3075; y:4033; w:  26; h:  26),
+       (x: 3325; y:3748; w:  75; h: 125),
+       (x: 3475; y:3748; w:  75; h: 125),
+       (x: 3625; y:4033; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 3200; y:3498; w:  26; h:  26),
+       (x: 3240; y:3398; w:  50; h:  50),
+       (x: 3280; y:3398; w:  50; h:  50),
+       (x: 3300; y:3498; w:  26; h:  26),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 3500; y:3098; w:  50; h:  75),
+       (x: 3650; y:2648; w:  75; h: 125),
+       (x: 3800; y:2648; w:  75; h: 125),
+       (x: 3900; y:3048; w:  50; h:  75),
+       (x: NTPX; y:2048; w:   1; h:   1),
+       (x: 3800; y:2248; w:  50; h:  75),
+       (x: 3875; y:2148; w:  75; h:  75),
+       (x: 3925; y:2098; w:  75; h:  50),
+       (x: 4050; y:2173; w:  50; h:  75),
+       (x: NTPX; y:2048; w:   1; h:   1)
+      );
+      Template43FPoints: array[0..0] of TPoint =
+      (
+       (X: 4095; Y:    0)
+      );
+
+// 3 large caverns
+const Template44Points: array[0..14] of TSDL_Rect =
+      (
+       (x:    0; y: 100; w:   1; h:  50),
+       (x: 4095; y: 100; w:   1; h:  50),
+       (x: 4095; y: 400; w:   1; h:  50),
+       (x:    0; y: 360; w:   1; h:  50),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:    0; y: 750; w:   1; h:  50),
+       (x: 4095; y: 750; w:   1; h:  50),
+       (x: 4095; y:1100; w:   1; h:  50),
+       (x:    0; y:1100; w:   1; h:  50),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x:    0; y:1300; w:   1; h: 250),
+       (x: 4095; y:1300; w:   1; h: 250),
+       (x: 4095; y:1800; w:   1; h: 200),
+       (x:    0; y:1800; w:   1; h: 200),
+       (x: NTPX; y:   0; w:   1; h:   1)
+      );
+      Template44FPoints: array[0..5] of TSDL_Rect =
+      (
+       (X:   1; Y:  90; w:   0; h:   0),
+       (X:   1; Y: 500; w:   0; h:   0),
+       (X:4095; Y: 500; w:   0; h:   0),
+       (X:   1; Y:1200; w:   0; h:   0),
+       (X:4095; Y:1200; w:   0; h:   0),
+       (X:   1; Y:2010; w:   0; h:   0)
+      );
+
+// large caverns with an island
+const Template45Points: array[0..11] of TSDL_Rect =
+      (
+       (x:  500; y: 100; w:   1; h: 300),
+       (x: 3700; y: 100; w:   1; h: 300),
+       (x: 3700; y: 900; w: 200; h: 300),
+       (x: 3700; y:1700; w:   1; h: 250),
+       (x:  500; y:1700; w:   1; h: 250),
+       (x:  300; y: 900; w: 200; h: 250),
+       (x: NTPX; y:   0; w:   1; h:   1),
+       (x: 1000; y: 800; w:   1; h:   1),
+       (x: 2700; y: 800; w: 600; h: 100),
+       (x: 2700; y:1200; w: 600; h: 200),
+       (x: 1000; y:1200; w: 200; h: 200),
+       (x: NTPX; y:   0; w:   1; h:   1)
+      );
+      Template45FPoints: array[0..2] of TSDL_Rect =
+      (
+       (X:   1; Y:   1; w:   0; h:   0),
+       (X:   1; Y:2047; w:   0; h:   0),
+       (X:1005; Y: 805; w:   0; h:   0)
       );
 
 ////////////////////////////////////////////////////////////////////////
-const EdgeTemplates: array[0..42] of TEdgeTemplate =
+var EdgeTemplates: array[0..45] of TEdgeTemplate =
       (
        (BasePoints: @Template0Points;
         BasePointsCount: Succ(High(Template0Points));
@@ -1584,7 +1818,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template1Points;
         BasePointsCount: Succ(High(Template1Points));
@@ -1595,7 +1829,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template2Points;
         BasePointsCount: Succ(High(Template2Points));
@@ -1606,7 +1840,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template3Points;
         BasePointsCount: Succ(High(Template3Points));
@@ -1617,7 +1851,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template4Points;
         BasePointsCount: Succ(High(Template4Points));
@@ -1628,7 +1862,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template5Points;
         BasePointsCount: Succ(High(Template5Points));
@@ -1639,7 +1873,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template6Points;
         BasePointsCount: Succ(High(Template6Points));
@@ -1650,7 +1884,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template7Points;
         BasePointsCount: Succ(High(Template7Points));
@@ -1661,7 +1895,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template8Points;
         BasePointsCount: Succ(High(Template8Points));
@@ -1672,7 +1906,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template9Points;
         BasePointsCount: Succ(High(Template9Points));
@@ -1683,7 +1917,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template10Points;
         BasePointsCount: Succ(High(Template10Points));
@@ -1694,7 +1928,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template11Points;
         BasePointsCount: Succ(High(Template11Points));
@@ -1705,7 +1939,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template12Points;
         BasePointsCount: Succ(High(Template12Points));
@@ -1716,7 +1950,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template13Points;
         BasePointsCount: Succ(High(Template13Points));
@@ -1727,7 +1961,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template14Points;
         BasePointsCount: Succ(High(Template14Points));
@@ -1738,7 +1972,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template15Points;
         BasePointsCount: Succ(High(Template15Points));
@@ -1749,7 +1983,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template16Points;
         BasePointsCount: Succ(High(Template16Points));
@@ -1760,7 +1994,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template17Points;
         BasePointsCount: Succ(High(Template17Points));
@@ -1771,7 +2005,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 2848;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 18;
+        MaxHedgeHogs: 18;
        ),
        (BasePoints: @Template18Points;
         BasePointsCount: Succ(High(Template18Points));
@@ -1782,7 +2016,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template19Points;
         BasePointsCount: Succ(High(Template19Points));
@@ -1793,7 +2027,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template20Points;
         BasePointsCount: Succ(High(Template20Points));
@@ -1804,7 +2038,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template21Points;
         BasePointsCount: Succ(High(Template21Points));
@@ -1815,7 +2049,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template22Points;
         BasePointsCount: Succ(High(Template22Points));
@@ -1826,7 +2060,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template23Points;
         BasePointsCount: Succ(High(Template23Points));
@@ -1837,7 +2071,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template24Points;
         BasePointsCount: Succ(High(Template24Points));
@@ -1848,7 +2082,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template25Points;
         BasePointsCount: Succ(High(Template25Points));
@@ -1859,7 +2093,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template26Points;
         BasePointsCount: Succ(High(Template26Points));
@@ -1870,7 +2104,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template27Points;
         BasePointsCount: Succ(High(Template27Points));
@@ -1881,7 +2115,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template28Points;
         BasePointsCount: Succ(High(Template28Points));
@@ -1892,7 +2126,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template29Points;
         BasePointsCount: Succ(High(Template29Points));
@@ -1903,7 +2137,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template30Points;
         BasePointsCount: Succ(High(Template30Points));
@@ -1914,7 +2148,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template31Points;
         BasePointsCount: Succ(High(Template31Points));
@@ -1925,7 +2159,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template32Points;
         BasePointsCount: Succ(High(Template32Points));
@@ -1936,7 +2170,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template33Points;
         BasePointsCount: Succ(High(Template33Points));
@@ -1947,7 +2181,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template34Points;
         BasePointsCount: Succ(High(Template34Points));
@@ -1958,7 +2192,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template35Points;
         BasePointsCount: Succ(High(Template35Points));
@@ -1969,7 +2203,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1424; TemplateWidth: 3900;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 36;
+        MaxHedgeHogs: 36;
        ),
        (BasePoints: @Template36Points;
         BasePointsCount: Succ(High(Template36Points));
@@ -1980,7 +2214,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1024; TemplateWidth: 4096;
         canMirror: true; canFlip: false; isNegative: true; canInvert: false;
         hasGirders: false;
-        MaxHedgehogs: 32;
+        MaxHedgeHogs: 32;
        ),
        (BasePoints: @Template37Points;
         BasePointsCount: Succ(High(Template37Points));
@@ -1991,7 +2225,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 2048; TemplateWidth: 4096;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 48;
+        MaxHedgeHogs: 48;
        ),
        (BasePoints: @Template38Points;
         BasePointsCount: Succ(High(Template38Points));
@@ -2002,7 +2236,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 2048; TemplateWidth: 4096;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 48;
+        MaxHedgeHogs: 48;
        ),
        (BasePoints: @Template39Points;
         BasePointsCount: Succ(High(Template39Points));
@@ -2013,7 +2247,7 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 512; TemplateWidth: 1536;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: false;
-        MaxHedgehogs: 8;
+        MaxHedgeHogs: 8;
        ),
        (BasePoints: @Template40Points;
         BasePointsCount: Succ(High(Template40Points));
@@ -2024,18 +2258,18 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 1024; TemplateWidth: 1024;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: false;
-        MaxHedgehogs: 8;
+        MaxHedgeHogs: 8;
        ),
        (BasePoints: @Template41Points;
         BasePointsCount: Succ(High(Template41Points));
         FillPoints: @Template41FPoints;
         FillPointsCount: Succ(High(Template41FPoints));
-        BezierizeCount: 3;
-        RandPassesCount: 5;
+        BezierizeCount: 2;
+        RandPassesCount: 9;
         TemplateHeight: 2048; TemplateWidth: 4096;
         canMirror: true; canFlip: true; isNegative: false; canInvert: false;
         hasGirders: true;
-        MaxHedgehogs: 48;
+        MaxHedgeHogs: 48;
        ),
        (BasePoints: @Template42Points;
         BasePointsCount: Succ(High(Template42Points));
@@ -2046,20 +2280,53 @@ const EdgeTemplates: array[0..42] of TEdgeTemplate =
         TemplateHeight: 512; TemplateWidth: 1536;
         canMirror: true; canFlip: false; isNegative: false; canInvert: false;
         hasGirders: false;
-        MaxHedgehogs: 8;
+        MaxHedgeHogs: 8;
+       ),
+       (BasePoints: @Template43Points;
+        BasePointsCount: Succ(High(Template43Points));
+        FillPoints: @Template43FPoints;
+        FillPointsCount: Succ(High(Template43FPoints));
+        BezierizeCount: 2;
+        RandPassesCount: 9;
+        TemplateHeight: 4096; TemplateWidth: 4096;
+        canMirror: true; canFlip: true; isNegative: false; canInvert: false;
+        hasGirders: true;
+        MaxHedgeHogs: 48;
+       ),
+       (BasePoints: @Template44Points;
+        BasePointsCount: Succ(High(Template44Points));
+        FillPoints: @Template44FPoints;
+        FillPointsCount: Succ(High(Template44FPoints));
+        BezierizeCount: 5;
+        RandPassesCount: 3;
+        TemplateHeight: 2048; TemplateWidth: 4096;
+        canMirror: false; canFlip: false; isNegative: true; canInvert: false;
+        hasGirders: false;
+        MaxHedgeHogs: 48;
+       ),
+       (BasePoints: @Template45Points;
+        BasePointsCount: Succ(High(Template45Points));
+        FillPoints: @Template45FPoints;
+        FillPointsCount: Succ(High(Template45FPoints));
+        BezierizeCount: 5;
+        RandPassesCount: 7;
+        TemplateHeight: 2048; TemplateWidth: 4096;
+        canMirror: false; canFlip: false; isNegative: true; canInvert: false;
+        hasGirders: false;
+        MaxHedgeHogs: 48;
        )
       );
 const SmallTemplates: array[0..2] of Longword = ( 39, 40, 42 );
 const MediumTemplates: array[0..17] of Longword =
       ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 );
-const LargeTemplates: array[0..19] of Longword =
+const LargeTemplates: array[0..20] of Longword =
       (
         18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
-        28, 29, 30, 31, 32, 33, 34, 35, 37, 38
+        28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 43
       );
-const CavernTemplates: array[0..4] of Longword = (36, 2, 3, 21, 29);
+const CavernTemplates: array[0..5] of Longword = (36, 2, 3, 21, 29, 45);
 //const WackyTemplates: array[0..4] of Longword = (37, 38, 39, 40, 41);
-const WackyTemplates: array[0..2] of Longword = (37, 38, 41);
+const WackyTemplates: array[0..4] of Longword = (37, 38, 41, 43, 44);
 
 implementation
 
diff --git a/hedgewars/uLandTexture.pas b/hedgewars/uLandTexture.pas
index 5443889..d5c713d 100644
--- a/hedgewars/uLandTexture.pas
+++ b/hedgewars/uLandTexture.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,17 +24,18 @@ uses SDLh;
 
 procedure initModule;
 procedure freeModule;
-procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
+procedure UpdateLandTexture(X, Width, Y, Height: LongInt; landAdded: boolean);
 procedure DrawLand(dX, dY: LongInt);
 procedure ResetLand;
+procedure SetLandTexture;
 
 implementation
 uses uConsts, GLunit, uTypes, uVariables, uTextures, uDebug, uRender;
 
-const TEXSIZE = 512;
+const TEXSIZE = 128;
 
 type TLandRecord = record
-            shouldUpdate: boolean;
+            shouldUpdate, landAdded: boolean;
             tex: PTexture;
             end;
 
@@ -62,10 +63,11 @@ for ty:= 0 to TEXSIZE - 1 do
 Pixels2:= @tmpPixels
 end;
 
-procedure UpdateLandTexture(X, Width, Y, Height: LongInt);
+procedure UpdateLandTexture(X, Width, Y, Height: LongInt; landAdded: boolean);
 var tx, ty: Longword;
 begin
-    if (Width <= 0) or (Height <= 0) then exit;
+    if (Width <= 0) or (Height <= 0) then
+        exit;
     TryDo((X >= 0) and (X < LAND_WIDTH), 'UpdateLandTexture: wrong X parameter', true);
     TryDo(X + Width <= LAND_WIDTH, 'UpdateLandTexture: wrong Width parameter', true);
     TryDo((Y >= 0) and (Y < LAND_HEIGHT), 'UpdateLandTexture: wrong Y parameter', true);
@@ -74,34 +76,95 @@ begin
     if (cReducedQuality and rqBlurryLand) = 0 then
         for ty:= Y div TEXSIZE to (Y + Height - 1) div TEXSIZE do
             for tx:= X div TEXSIZE to (X + Width - 1) div TEXSIZE do
-                LandTextures[tx, ty].shouldUpdate:= true
+                begin
+                LandTextures[tx, ty].shouldUpdate:= true;
+                LandTextures[tx, ty].landAdded:= landAdded
+                end
     else
         for ty:= (Y div TEXSIZE) div 2 to ((Y + Height - 1) div TEXSIZE) div 2 do
             for tx:= (X div TEXSIZE) div 2 to ((X + Width - 1) div TEXSIZE) div 2 do
+                begin
                 LandTextures[tx, ty].shouldUpdate:= true;
+                LandTextures[tx, ty].landAdded:= landAdded
+                end
 end;
 
 procedure RealLandTexUpdate;
-var x, y: LongWord;
+var x, y, ty, tx, lx, ly : LongWord;
+    isEmpty: boolean;
 begin
+(*
 if LandTextures[0, 0].tex = nil then
     for x:= 0 to LANDTEXARW -1 do
         for y:= 0 to LANDTEXARH - 1 do
             with LandTextures[x, y] do
                 begin
-                    tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
-                    glBindTexture(GL_TEXTURE_2D, tex^.id);
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, tpHigh);
+                tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
+                glBindTexture(GL_TEXTURE_2D, tex^.id);
+                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, tpHigh);
                 end
 else
+*)
     for x:= 0 to LANDTEXARW -1 do
         for y:= 0 to LANDTEXARH - 1 do
             with LandTextures[x, y] do
                 if shouldUpdate then
                     begin
                     shouldUpdate:= false;
-                    glBindTexture(GL_TEXTURE_2D, tex^.id);
-                    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE, TEXSIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, Pixels(x,y));
+                    isEmpty:= not landAdded;
+                    landAdded:= false;
+                    ty:= 0;
+                    tx:= 1;
+                    ly:= y * TEXSIZE;
+                    lx:= x * TEXSIZE;
+                    // first check edges
+                    while isEmpty and (ty < TEXSIZE) do
+                        begin
+                        isEmpty:= LandPixels[ly + ty, lx] and AMask = 0;
+                        if isEmpty then isEmpty:= LandPixels[ly + ty, lx + TEXSIZE-1] and AMask = 0;
+                        inc(ty)
+                        end;
+                    while isEmpty and (tx < TEXSIZE-1) do
+                        begin
+                        isEmpty:= LandPixels[ly, lx + tx] and AMask = 0;
+                        if isEmpty then isEmpty:= LandPixels[ly + TEXSIZE-1, lx + tx] and AMask = 0;
+                        inc(tx)
+                        end;
+                    // then search every other remaining. does this sort of stuff defeat compiler opts?
+                    ty:= 2;
+                    while isEmpty and (ty < TEXSIZE-1) do
+                        begin
+                        tx:= 2;
+                        while isEmpty and (tx < TEXSIZE-1) do
+                            begin
+                            isEmpty:= LandPixels[ly + ty, lx + tx] and AMask = 0;
+                            inc(tx,2)
+                            end;
+                        inc(ty,2);
+                        end;
+                    // and repeat
+                    ty:= 1;
+                    while isEmpty and (ty < TEXSIZE-1) do
+                        begin
+                        tx:= 1;
+                        while isEmpty and (tx < TEXSIZE-1) do
+                            begin
+                            isEmpty:= LandPixels[ly + ty, lx + tx] and AMask = 0;
+                            inc(tx,2)
+                            end;
+                        inc(ty,2);
+                        end;
+                    if not isEmpty then
+                        begin
+                        if tex = nil then tex:= NewTexture(TEXSIZE, TEXSIZE, Pixels(x, y));
+                        glBindTexture(GL_TEXTURE_2D, tex^.id);
+                        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE, TEXSIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, Pixels(x,y));
+                        end
+                    else if tex <> nil then
+                        begin
+                        FreeTexture(tex);
+                        tex:= nil
+                        end;
                     end
 end;
 
@@ -113,14 +176,15 @@ RealLandTexUpdate;
 for x:= 0 to LANDTEXARW -1 do
     for y:= 0 to LANDTEXARH - 1 do
         with LandTextures[x, y] do
-            if (cReducedQuality and rqBlurryLand) = 0 then
-                DrawTexture(dX + x * TEXSIZE, dY + y * TEXSIZE, tex)
-            else
-                DrawTexture(dX + x * TEXSIZE * 2, dY + y * TEXSIZE * 2, tex, 2.0)
+            if tex <> nil then
+                if (cReducedQuality and rqBlurryLand) = 0 then
+                    DrawTexture(dX + x * TEXSIZE, dY + y * TEXSIZE, tex)
+                else
+                    DrawTexture(dX + x * TEXSIZE * 2, dY + y * TEXSIZE * 2, tex, 2.0)
 
 end;
 
-procedure initModule;
+procedure SetLandTexture;
 begin
     if (cReducedQuality and rqBlurryLand) = 0 then
         begin
@@ -136,6 +200,10 @@ begin
     SetLength(LandTextures, LANDTEXARW, LANDTEXARH);
 end;
 
+procedure initModule;
+begin
+end;
+
 procedure ResetLand;
 var x, y: LongInt;
 begin
@@ -143,8 +211,11 @@ begin
         for y:= 0 to LANDTEXARH - 1 do
             with LandTextures[x, y] do
                 begin
-                FreeTexture(tex);
-                tex:= nil;
+                if tex <> nil then
+                    begin
+                    FreeTexture(tex);
+                    tex:= nil
+                    end
                 end;
 end;
 
@@ -154,6 +225,6 @@ begin
     if LandBackSurface <> nil then
         SDL_FreeSurface(LandBackSurface);
     LandBackSurface:= nil;
-    LandTextures:= nil;
+    SetLength(LandTextures, 0, 0);
 end;
 end.
diff --git a/hedgewars/uLocale.pas b/hedgewars/uLocale.pas
index c7cccba..e04aa50 100644
--- a/hedgewars/uLocale.pas
+++ b/hedgewars/uLocale.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -26,9 +26,13 @@ const MAX_EVENT_STRINGS = 100;
 
 procedure LoadLocale(FileName: shortstring);
 function  Format(fmt: shortstring; var arg: shortstring): shortstring;
-function  Format(fmt: ansistring; var arg: ansistring): ansistring;
+function  FormatA(fmt: ansistring; var arg: ansistring): ansistring;
 function  GetEventString(e: TEventId): ansistring;
 
+{$IFDEF HWLIBRARY}
+procedure LoadLocaleWrapper(str: pchar); cdecl; export;
+{$ENDIF}
+
 implementation
 uses uRandom, uUtils, uVariables, uDebug;
 
@@ -44,48 +48,58 @@ var s: ansistring;
     loaded: boolean;
 begin
 loaded:= false;
-for e:= Low(TEventId) to High(TEventId) do first[e]:= true;
+for e:= Low(TEventId) to High(TEventId) do
+    first[e]:= true;
 
 {$I-} // iochecks off
 Assign(f, FileName);
 filemode:= 0; // readonly
 Reset(f);
-if IOResult = 0 then loaded:= true;
+if IOResult = 0 then
+    loaded:= true;
 TryDo(loaded, 'Cannot load locale "' + FileName + '"', false);
 if loaded then
-   begin
-   while not eof(f) do
-       begin
-       readln(f, s);
-       if Length(s) = 0 then continue;
-       if not (s[1] in ['0'..'9']) then continue;
-       TryDo(Length(s) > 6, 'Load locale: empty string', true);
-       val(s[1]+s[2], a, c);
-       TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true);
-       TryDo(s[3] = ':', 'Load locale: ":" expected', true);
-       val(s[4]+s[5], b, c);
-       TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true);
-       TryDo(s[6] = '=', 'Load locale: "=" expected', true);
-       Delete(s, 1, 6);
-       case a of
-           0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammo[TAmmoStrId(b)]:= s;
-           1: if (b >=0) and (b <= ord(High(TMsgStrId))) then trmsg[TMsgStrId(b)]:= s;
-           2: if (b >=0) and (b <= ord(High(TEventId))) then begin
-               TryDo(trevt_n[TEventId(b)] < MAX_EVENT_STRINGS, 'Too many event strings in ' + IntToStr(a) + ':' + IntToStr(b), false);
-               if first[TEventId(b)] then
-                   begin
-                   trevt_n[TEventId(b)]:= 0;
-                   first[TEventId(b)]:= false;
-                   end;
-               trevt[TEventId(b)][trevt_n[TEventId(b)]]:= s;
-               inc(trevt_n[TEventId(b)]);
-               end;
-           3: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammoc[TAmmoStrId(b)]:= s;
-           4: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammod[TAmmoStrId(b)]:= s;
-           5: if (b >=0) and (b <= ord(High(TGoalStrId))) then trgoal[TGoalStrId(b)]:= s;
+    begin
+    while not eof(f) do
+        begin
+        readln(f, s);
+        if Length(s) = 0 then
+            continue;
+        if (s[1] < '0') or (s[1] > '9') then
+            continue;
+        TryDo(Length(s) > 6, 'Load locale: empty string', true);
+        val(s[1]+s[2], a, c);
+        TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true);
+        TryDo(s[3] = ':', 'Load locale: ":" expected', true);
+        val(s[4]+s[5], b, c);
+        TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true);
+        TryDo(s[6] = '=', 'Load locale: "=" expected', true);
+        Delete(s, 1, 6);
+        case a of
+            0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then
+                trammo[TAmmoStrId(b)]:= s;
+            1: if (b >=0) and (b <= ord(High(TMsgStrId))) then
+                trmsg[TMsgStrId(b)]:= s;
+            2: if (b >=0) and (b <= ord(High(TEventId))) then
+                begin
+                TryDo(trevt_n[TEventId(b)] < MAX_EVENT_STRINGS, 'Too many event strings in ' + IntToStr(a) + ':' + IntToStr(b), false);
+                if first[TEventId(b)] then
+                    begin
+                    trevt_n[TEventId(b)]:= 0;
+                    first[TEventId(b)]:= false;
+                    end;
+                trevt[TEventId(b)][trevt_n[TEventId(b)]]:= s;
+                inc(trevt_n[TEventId(b)]);
+                end;
+            3: if (b >=0) and (b <= ord(High(TAmmoStrId))) then
+                trammoc[TAmmoStrId(b)]:= s;
+            4: if (b >=0) and (b <= ord(High(TAmmoStrId))) then
+                trammod[TAmmoStrId(b)]:= s;
+            5: if (b >=0) and (b <= ord(High(TGoalStrId))) then
+                trgoal[TGoalStrId(b)]:= s;
            end;
        end;
-   Close(f)
+   Close(f);
    end;
 {$I+}
 end;
@@ -102,21 +116,27 @@ function Format(fmt: shortstring; var arg: shortstring): shortstring;
 var i: LongInt;
 begin
 i:= Pos('%1', fmt);
-if i = 0 then Format:= fmt
-         else Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
+if i = 0 then
+    Format:= fmt
+else
+    Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
 end;
 
-function Format(fmt: ansistring; var arg: ansistring): ansistring;
+function FormatA(fmt: ansistring; var arg: ansistring): ansistring;
 var i: LongInt;
 begin
 i:= Pos('%1', fmt);
-if i = 0 then Format:= fmt
-         else Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
+if i = 0 then
+    FormatA:= fmt
+else
+    FormatA:= copy(fmt, 1, i - 1) + arg + FormatA(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
 end;
 
+{$IFDEF HWLIBRARY}
 procedure LoadLocaleWrapper(str: pchar); cdecl; export;
 begin
     LoadLocale(Strpas(str));
 end;
+{$ENDIF}
 
 end.
diff --git a/hedgewars/uMisc.pas b/hedgewars/uMisc.pas
index e85334f..3b76379 100644
--- a/hedgewars/uMisc.pas
+++ b/hedgewars/uMisc.pas
@@ -1,20 +1,20 @@
 (*
-* Hedgewars, a free turn based strategy game
-* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at 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; version 2 of the License
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-*)
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
 
 {$INCLUDE "options.inc"}
 
@@ -23,16 +23,33 @@ interface
 
 uses SDLh, uConsts, GLunit, uTypes;
 
+procedure initModule;
+procedure freeModule;
+
 procedure movecursor(dx, dy: LongInt);
 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
-function  MakeScreenshot(filename: shortstring): boolean;
+function  MakeScreenshot(filename: shortstring; k: LongInt): boolean;
 function  GetTeamStatString(p: PTeam): shortstring;
-
-procedure initModule;
-procedure freeModule;
+{$IFDEF SDL13}
+function  SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
+{$ELSE}
+function  SDL_RectMake(x, y: SmallInt; width, height: Word): TSDL_Rect; inline;
+{$ENDIF}
 
 implementation
-uses typinfo, sysutils, uVariables, uUtils;
+uses SysUtils, uVariables, uUtils
+     {$IFDEF PNG_SCREENSHOTS}, PNGh, png {$ENDIF}
+     {$IFNDEF USE_SDLTHREADS} {$IFDEF UNIX}, cthreads{$ENDIF} {$ENDIF};
+
+type PScreenshot = ^TScreenshot;
+     TScreenshot = record
+         buffer: PByte;
+         filename: shortstring;
+         width, height: LongInt;
+         size: QWord;
+         end;
+
+var conversionFormat: PSDL_PixelFormat;
 
 procedure movecursor(dx, dy: LongInt);
 var x, y: LongInt;
@@ -45,12 +62,65 @@ Inc(y, dy);
 SDL_WarpMouse(x, y);
 end;
 
-// captures and saves the screen. returns true on success.
-function MakeScreenshot(filename: shortstring): Boolean;
-var success: boolean;
-    p: Pointer;
-    size: QWord;
+{$IFDEF PNG_SCREENSHOTS}
+// this funtion will be executed in separate thread
+function SaveScreenshot(screenshot: pointer): PtrInt;
+var i: LongInt;
+    png_ptr: ^png_struct;
+    info_ptr: ^png_info;
     f: file;
+    image: PScreenshot;
+begin
+image:= PScreenshot(screenshot);
+
+png_ptr := png_create_write_struct(png_get_libpng_ver(nil), nil, nil, nil);
+if png_ptr = nil then
+begin
+    // AddFileLog('Error: Could not create png write struct.');
+    SaveScreenshot:= 0;
+    exit;
+end;
+
+info_ptr := png_create_info_struct(png_ptr);
+if info_ptr = nil then
+begin
+    png_destroy_write_struct(@png_ptr, nil);
+    // AddFileLog('Error: Could not create png info struct.');
+    SaveScreenshot:= 0;
+    exit;
+end;
+
+{$IOCHECKS OFF}
+Assign(f, image^.filename);
+Rewrite(f, 1);
+if IOResult = 0 then
+    begin
+    png_init_pascal_io(png_ptr, at f);
+    png_set_IHDR(png_ptr, info_ptr, image^.width, image^.height,
+                 8, // bit depth
+                 PNG_COLOR_TYPE_RGBA, PNG_INTERLACE_NONE,
+                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+    png_write_info(png_ptr, info_ptr);
+    // glReadPixels and libpng number rows in different order
+    for i:= image^.height-1 downto 0 do
+        png_write_row(png_ptr, image^.buffer + i*4*image^.width);
+    png_write_end(png_ptr, info_ptr);
+    Close(f);
+    end;
+{$IOCHECKS ON}
+
+// free everything
+png_destroy_write_struct(@png_ptr, @info_ptr);
+FreeMem(image^.buffer, image^.size);
+Dispose(image);
+SaveScreenshot:= 0;
+end;
+
+{$ELSE} // no PNG_SCREENSHOTS
+
+// this funtion will be executed in separate thread
+function SaveScreenshot(screenshot: pointer): PtrInt;
+var f: file;
     // Windows Bitmap Header
     head: array[0..53] of Byte = (
     $42, $4D,       // identifier ("BM")
@@ -69,81 +139,162 @@ var success: boolean;
     0, 0, 0, 0,     // number of colors (all)
     0, 0, 0, 0      // number of important colors
     );
+    image: PScreenshot;
+    size: QWord;
 begin
-// flash
-ScreenFade:= sfFromWhite;
-ScreenFadeValue:= sfMax;
-ScreenFadeSpeed:= 5;
-
-size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 4;
-p:= GetMem(size);
-
-// memory could not be allocated
-if p = nil then
-begin
-    AddFileLog('Error: Could not allocate memory for screenshot.');
-    exit(false);
-end;
+image:= PScreenshot(screenshot);
 
-// update header information and file name
-filename:= UserPathPrefix + '/Screenshots/' + filename + '.bmp';
+size:= image^.Width*image^.Height*4;
 
 head[$02]:= (size + 54) and $ff;
 head[$03]:= ((size + 54) shr 8) and $ff;
 head[$04]:= ((size + 54) shr 16) and $ff;
 head[$05]:= ((size + 54) shr 24) and $ff;
-head[$12]:= cScreenWidth and $ff;
-head[$13]:= (cScreenWidth shr 8) and $ff;
-head[$14]:= (cScreenWidth shr 16) and $ff;
-head[$15]:= (cScreenWidth shr 24) and $ff;
-head[$16]:= cScreenHeight and $ff;
-head[$17]:= (cScreenHeight shr 8) and $ff;
-head[$18]:= (cScreenHeight shr 16) and $ff;
-head[$19]:= (cScreenHeight shr 24) and $ff;
+head[$12]:= image^.Width and $ff;
+head[$13]:= (image^.Width shr 8) and $ff;
+head[$14]:= (image^.Width shr 16) and $ff;
+head[$15]:= (image^.Width shr 24) and $ff;
+head[$16]:= image^.Height and $ff;
+head[$17]:= (image^.Height shr 8) and $ff;
+head[$18]:= (image^.Height shr 16) and $ff;
+head[$19]:= (image^.Height shr 24) and $ff;
 head[$22]:= size and $ff;
 head[$23]:= (size shr 8) and $ff;
 head[$24]:= (size shr 16) and $ff;
 head[$25]:= (size shr 24) and $ff;
 
-// read pixel from the front buffer
-glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGRA, GL_UNSIGNED_BYTE, p);
-
 {$IOCHECKS OFF}
-Assign(f, filename);
+Assign(f, image^.filename);
 Rewrite(f, 1);
 if IOResult = 0 then
     begin
     BlockWrite(f, head, sizeof(head));
-    BlockWrite(f, p^, size);
+    BlockWrite(f, image^.buffer^, size);
     Close(f);
-    success:= true;
     end
 else
     begin
-    AddFileLog('Error: Could not write to ' + filename);
-    success:= false;
+    //AddFileLog('Error: Could not write to ' + filename);
     end;
 {$IOCHECKS ON}
 
-FreeMem(p, size);
-MakeScreenshot:= success;
+// free everything
+FreeMem(image^.buffer, image^.size);
+Dispose(image);
+SaveScreenshot:= 0;
+end;
+
+{$ENDIF} // no PNG_SCREENSHOTS
+
+{$IFDEF USE_VIDEO_RECORDING}
+// make image k times smaller (useful for saving thumbnails)
+procedure ReduceImage(img: PByte; width, height, k: LongInt);
+var i, j, i0, j0, w, h, r, g, b: LongInt;
+begin
+    w:= width  div k;
+    h:= height div k;
+
+    // rescale inplace
+    if k <> 1 then
+    begin
+        for i:= 0 to h-1 do
+            for j:= 0 to w-1 do
+            begin
+                r:= 0;
+                g:= 0;
+                b:= 0;
+                for i0:= 0 to k-1 do
+                    for j0:= 0 to k-1 do
+                    begin
+                        inc(r, img[4*(width*(i*k+i0) + j*k+j0)+0]);
+                        inc(g, img[4*(width*(i*k+i0) + j*k+j0)+1]);
+                        inc(b, img[4*(width*(i*k+i0) + j*k+j0)+2]);
+                    end;
+                img[4*(w*i + j)+0]:= r div (k*k);
+                img[4*(w*i + j)+1]:= g div (k*k);
+                img[4*(w*i + j)+2]:= b div (k*k);
+                img[4*(w*i + j)+3]:= 255;
+            end;
+    end;
+end;
+{$ENDIF}
+
+// captures and saves the screen. returns true on success.
+// saved image will be k times smaller than original (useful for saving thumbnails).
+function MakeScreenshot(filename: shortstring; k: LongInt): Boolean;
+var p: Pointer;
+    size: QWord;
+    image: PScreenshot;
+    format: GLenum;
+    ext: string[4];
+begin
+{$IFDEF PNG_SCREENSHOTS}
+format:= GL_RGBA;
+ext:= '.png';
+{$ELSE}
+format:= GL_BGRA;
+ext:= '.bmp';
+{$ENDIF}
+
+size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 4;
+p:= GetMem(size); // will be freed in SaveScreenshot()
+
+// memory could not be allocated
+if p = nil then
+begin
+    AddFileLog('Error: Could not allocate memory for screenshot.');
+    MakeScreenshot:= false;
+    exit;
+end;
+
+// read pixels from the front buffer
+glReadPixels(0, 0, cScreenWidth, cScreenHeight, format, GL_UNSIGNED_BYTE, p);
+
+{$IFDEF USE_VIDEO_RECORDING}
+ReduceImage(p, cScreenWidth, cScreenHeight, k);
+{$ENDIF}
+
+// allocate and fill structure that will be passed to new thread
+New(image); // will be disposed in SaveScreenshot()
+image^.filename:= UserPathPrefix + filename + ext;
+image^.width:= cScreenWidth div k;
+image^.height:= cScreenHeight div k;
+image^.size:= size;
+image^.buffer:= p;
+
+{$IFDEF USE_SDLTHREADS}
+SDL_CreateThread(@SaveScreenshot{$IFDEF SDL13}, nil{$ENDIF}, image);
+{$ELSE}
+BeginThread(@SaveScreenshot, image);
+{$ENDIF}
+MakeScreenshot:= true; // possibly it is not true but we will not wait for thread to terminate
 end;
 
 // http://www.idevgames.com/forums/thread-5602-post-21860.html#pid21860
 function doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
 var convertedSurf: PSDL_Surface;
 begin
+    doSurfaceConversion:= tmpsurf;
     if ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) or
        (tmpsurf^.format^.bitsperpixel = 24) then
-        begin
+    begin
         convertedSurf:= SDL_ConvertSurface(tmpsurf, conversionFormat, SDL_SWSURFACE);
         SDL_FreeSurface(tmpsurf);
-        exit(convertedSurf);
-        end;
-
-    exit(tmpsurf);
+        doSurfaceConversion:= convertedSurf;
+    end;
 end;
 
+{$IFDEF SDL13}
+function SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
+{$ELSE}
+function SDL_RectMake(x, y: SmallInt; width, height: Word): TSDL_Rect; inline;
+{$ENDIF}
+begin
+    SDL_RectMake.x:= x;
+    SDL_RectMake.y:= y;
+    SDL_RectMake.w:= width;
+    SDL_RectMake.h:= height;
+end;
 
 function GetTeamStatString(p: PTeam): shortstring;
 var s: ansistring;
@@ -153,14 +304,13 @@ begin
 end;
 
 procedure initModule;
-const SDL_PIXELFORMAT_ABGR8888 = ((1 shl 31) or (6 shl 24) or (7 shl 20) or (6 shl 16) or (32 shl 8) or 4);
+const SDL_PIXELFORMAT_ABGR8888 = (1 shl 31) or (6 shl 24) or (7 shl 20) or (6 shl 16) or (32 shl 8) or 4;
 begin
     conversionFormat:= SDL_AllocFormat(SDL_PIXELFORMAT_ABGR8888);
 end;
 
 procedure freeModule;
 begin
-    recordFileName:= '';
     SDL_FreeFormat(conversionFormat);
 end;
 
diff --git a/hedgewars/uMobile.pas b/hedgewars/uMobile.pas
index 2eec6c5..23cab7a 100644
--- a/hedgewars/uMobile.pas
+++ b/hedgewars/uMobile.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -18,51 +18,71 @@
 
 {$INCLUDE "options.inc"}
 
+(*
+ * This unit contains a lot of useful functions when hw is running on mobile
+ * Unlike HwLibrary when you declare functions that you will call from your code,
+ * here you need to provide functions that Pascall code will call.
+ *)
+
 unit uMobile;
 interface
 
-{$IFDEF IPHONEOS}
-(*  iOS calls written in ObjcExports.m  *)
-procedure clearView; cdecl; external;
-procedure startLoadingIndicator; cdecl; external;
-procedure stopLoadingIndicator; cdecl; external;
-procedure saveFinishedSynching; cdecl; external;
-procedure updateVisualsNewTurn; cdecl; external;
-function  isApplePhone: Boolean; cdecl; external;
-procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
-{$ENDIF}
 function  isPhone: Boolean; inline;
+function  getScreenDPI: Double; inline;
 procedure performRumble; inline;
 
 procedure GameLoading; inline;
 procedure GameLoaded; inline;
-procedure AmmoUpdate; // do not inline
-procedure NewTurnBeginning; inline;
 procedure SaveLoadingEnded; inline;
 
 implementation
-uses uVariables;
+uses uVariables, uConsole, SDLh;
+
+// add here any external call that you need
+{$IFDEF IPHONEOS}
+(*  iOS calls written in ObjcExports.m  *)
+procedure startLoadingIndicator; cdecl; external;
+procedure stopLoadingIndicator; cdecl; external;
+procedure saveFinishedSynching; cdecl; external;
+function  isApplePhone: Boolean; cdecl; external;
+procedure AudioServicesPlaySystemSound(num: LongInt); cdecl; external;
+{$ENDIF}
 
 // this function is just to determine whether we are running on a limited screen device
 function isPhone: Boolean; inline;
 begin
+    isPhone:= false;
 {$IFDEF IPHONEOS}
-    exit(isApplePhone());
+    isPhone:= isApplePhone();
+{$ENDIF}
+{$IFDEF ANDROID}
+    //nasty nasty hack. TODO: implement callback to java to have a unified way of determining if it is a tablet
+    if (cScreenWidth < 1000) and (cScreenHeight < 500) then
+        isPhone:= true;
+{$ENDIF}
+end;
+
+function getScreenDPI: Double; inline;
+begin
+{$IFDEF ANDROID}
+//    getScreenDPI:= Android_JNI_getDensity();
+    getScreenDPI:= 1;
+{$ELSE}
+    getScreenDPI:= 1;
 {$ENDIF}
-    exit(false);
 end;
 
 // this function should make the device vibrate in some way
-procedure performRumble; inline;
-const kSystemSoundID_Vibrate = $00000FFF;
+procedure PerformRumble; inline;
+{$IFDEF IPHONEOS}const kSystemSoundID_Vibrate = $00000FFF;{$ENDIF}
 begin
     // do not vibrate while synchronising a demo/save
     if not fastUntilLag then
-        begin
+    begin
 {$IFDEF IPHONEOS}
         AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
 {$ENDIF}
-        end;
+    end;
 end;
 
 procedure GameLoading; inline;
@@ -79,25 +99,6 @@ begin
 {$ENDIF}
 end;
 
-procedure AmmoUpdate; // do not inline
-begin
-{$IFDEF IPHONEOS}
-    if (CurrentTeam = nil) or
-       (CurrentTeam^.ExtDriven) or
-       (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
-        exit(); // the other way around throws a compiler error
-    updateVisualsNewTurn();
-{$ENDIF}
-end;
-
-procedure NewTurnBeginning; inline;
-begin
-{$IFDEF IPHONEOS}
-    clearView();
-{$ENDIF}
-    AmmoUpdate();
-end;
-
 procedure SaveLoadingEnded; inline;
 begin
 {$IFDEF IPHONEOS}
diff --git a/hedgewars/uRandom.pas b/hedgewars/uRandom.pas
index 230e029..32c79ca 100644
--- a/hedgewars/uRandom.pas
+++ b/hedgewars/uRandom.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -29,22 +29,26 @@ unit uRandom;
  *)
 interface
 uses uFloat;
-{$INCLUDE "config.inc"}
-
-procedure initModule;
-procedure freeModule;
 
 procedure SetRandomSeed(Seed: shortstring); // Sets the seed that should be used for generating pseudo-random values.
-function  GetRandom: hwFloat; overload; // Returns a pseudo-random hwFloat.
-function  GetRandom(m: LongWord): LongWord; overload; // Returns a positive pseudo-random integer smaller than m.
+function  GetRandomf: hwFloat; overload; // Returns a pseudo-random hwFloat.
+function  GetRandom(m: LongWord): LongWord; overload; inline; // Returns a positive pseudo-random integer smaller than m.
+procedure AddRandomness(r: LongWord); inline;
 function  rndSign(num: hwFloat): hwFloat; // Returns num with a random chance of having a inverted sign.
 
+
 implementation
 
 var cirbuf: array[0..63] of Longword;
     n: byte;
 
-function GetNext: Longword;
+procedure AddRandomness(r: LongWord); inline;
+begin
+n:= (n + 1) and $3F;
+cirbuf[n]:= cirbuf[n] xor r
+end;
+
+function GetNext: Longword; inline;
 begin
 n:= (n + 1) and $3F;
 cirbuf[n]:=
@@ -60,7 +64,8 @@ var i: Longword;
 begin
 n:= 54;
 
-if Length(Seed) > 54 then Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf
+if Length(Seed) > 54 then
+    Seed:= copy(Seed, 1, 54); // not 55 to ensure we have odd numbers in cirbuf
 
 for i:= 0 to Pred(Length(Seed)) do
     cirbuf[i]:= byte(Seed[i + 1]);
@@ -68,17 +73,18 @@ for i:= 0 to Pred(Length(Seed)) do
 for i:= Length(Seed) to 54 do
     cirbuf[i]:= $A98765 + 68; // odd number
 
-for i:= 0 to 1023 do GetNext
+for i:= 0 to 1023 do
+    GetNext
 end;
 
-function GetRandom: hwFloat;
+function GetRandomf: hwFloat;
 begin
 GetNext;
-GetRandom.isNegative:= false;
-GetRandom.QWordValue:= GetNext
+GetRandomf.isNegative:= false;
+GetRandomf.QWordValue:= GetNext
 end;
 
-function GetRandom(m: LongWord): LongWord;
+function GetRandom(m: LongWord): LongWord; inline;
 begin
 GetNext;
 GetRandom:= GetNext mod m
@@ -90,15 +96,4 @@ num.isNegative:= odd(GetNext);
 rndSign:= num
 end;
 
-procedure initModule;
-begin
-    n:= 54;
-    FillChar(cirbuf, 64*sizeof(Longword), 0);
-end;
-
-procedure freeModule;
-begin
-
-end;
-
 end.
diff --git a/hedgewars/uRender.pas b/hedgewars/uRender.pas
index a87e177..f978358 100644
--- a/hedgewars/uRender.pas
+++ b/hedgewars/uRender.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,49 +24,58 @@ interface
 
 uses SDLh, uTypes, GLunit, uConsts;
 
-procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
-procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
-procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
-procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
-procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
-procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt);
-procedure DrawTexture(X, Y: LongInt; Texture: PTexture; Scale: GLfloat = 1.0);
-procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt);
-procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
-procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
-procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
-procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
-procedure DrawCentered(X, Top: LongInt; Source: PTexture);
-procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
-procedure DrawFillRect(r: TSDL_Rect);
-procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
-procedure DrawCircle(X, Y, Radius, Width: LongInt);
-procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
-procedure Tint(r, g, b, a: Byte); inline;
-procedure Tint(c: Longword); inline;
+procedure DrawSprite            (Sprite: TSprite; X, Y, Frame: LongInt);
+procedure DrawSprite            (Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
+procedure DrawSpriteFromRect    (Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
+procedure DrawSpriteClipped     (Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt);
+procedure DrawSpriteRotated     (Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
+procedure DrawSpriteRotatedF    (Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
+
+procedure DrawTexture           (X, Y: LongInt; Texture: PTexture); inline;
+procedure DrawTexture           (X, Y: LongInt; Texture: PTexture; Scale: GLfloat);
+procedure DrawTextureFromRect   (X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
+procedure DrawTextureFromRect   (X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
+procedure DrawTextureCentered   (X, Top: LongInt; Source: PTexture);
+procedure DrawTextureF          (Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt);
+procedure DrawTextureRotated    (Texture: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
+procedure DrawTextureRotatedF   (Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
+
+procedure DrawCircle            (X, Y, Radius, Width: LongInt);
+procedure DrawCircle            (X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
+
+procedure DrawLine              (X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
+procedure DrawFillRect          (r: TSDL_Rect);
+procedure DrawHedgehog          (X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
+procedure DrawScreenWidget      (widget: POnScreenWidget);
+
+procedure Tint                  (r, g, b, a: Byte); inline;
+procedure Tint                  (c: Longword); inline;
 
 
 implementation
 uses uVariables;
 
+var LastTint: LongWord = 0;
+
 procedure DrawSpriteFromRect(Sprite: TSprite; r: TSDL_Rect; X, Y, Height, Position: LongInt);
 begin
 r.y:= r.y + Height * Position;
 r.h:= Height;
-DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
+DrawTextureFromRect(X, Y, @r, SpritesData[Sprite].Texture)
 end;
 
-procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
+procedure DrawTextureFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
 begin
-DrawFromRect(X, Y, r^.w, r^.h, r, SourceTexture)
+DrawTextureFromRect(X, Y, r^.w, r^.h, r, SourceTexture)
 end;
 
-procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
+procedure DrawTextureFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
 var rr: TSDL_Rect;
     _l, _r, _t, _b: real;
     VertexBuffer, TextureBuffer: array [0..3] of TVertex2f;
 begin
-if (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then exit;
+if (SourceTexture^.h = 0) or (SourceTexture^.w = 0) then
+    exit;
 
 // do not draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs)
 if (abs(X) > W) and ((abs(X + W / 2) - W / 2) > cScreenWidth / cScaleFactor) then
@@ -104,12 +113,15 @@ TextureBuffer[2].Y:= _b;
 TextureBuffer[3].X:= _l;
 TextureBuffer[3].Y:= _b;
 
-
 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
 glTexCoordPointer(2, GL_FLOAT, 0, @TextureBuffer[0]);
 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
 end;
 
+procedure DrawTexture(X, Y: LongInt; Texture: PTexture); inline;
+begin
+    DrawTexture(X, Y, Texture, 1.0);
+end;
 
 procedure DrawTexture(X, Y: LongInt; Texture: PTexture; Scale: GLfloat);
 begin
@@ -129,10 +141,10 @@ end;
 
 procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, w, h: LongInt);
 begin
-    DrawRotatedTextureF(Texture, Scale, 0, 0, X, Y, Frame, Dir, w, h, 0)
+    DrawTextureRotatedF(Texture, Scale, 0, 0, X, Y, Frame, Dir, w, h, 0)
 end;
 
-procedure DrawRotatedTextureF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
+procedure DrawTextureRotatedF(Texture: PTexture; Scale, OffsetX, OffsetY: GLfloat; X, Y, Frame, Dir, w, h: LongInt; Angle: real);
 var ft, fb, fl, fr: GLfloat;
     hw, nx, ny: LongInt;
     VertexBuffer, TextureBuffer: array [0..3] of TVertex2f;
@@ -192,31 +204,32 @@ glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
 glPopMatrix
 end;
 
-procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
+procedure DrawSpriteRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
 begin
-    DrawRotatedTex(SpritesData[Sprite].Texture,
+    DrawTextureRotated(SpritesData[Sprite].Texture,
         SpritesData[Sprite].Width,
         SpritesData[Sprite].Height,
         X, Y, Dir, Angle)
 end;
 
-procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
+procedure DrawSpriteRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real);
 begin
 glPushMatrix;
 glTranslatef(X, Y, 0);
 
 if Dir < 0 then
-   glRotatef(Angle, 0, 0, -1)
+    glRotatef(Angle, 0, 0, -1)
 else
-   glRotatef(Angle, 0, 0,  1);
-if Dir < 0 then glScalef(-1.0, 1.0, 1.0);
+    glRotatef(Angle, 0, 0,  1);
+if Dir < 0 then
+    glScalef(-1.0, 1.0, 1.0);
 
 DrawSprite(Sprite, -SpritesData[Sprite].Width div 2, -SpritesData[Sprite].Height div 2, Frame);
 
 glPopMatrix
 end;
 
-procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
+procedure DrawTextureRotated(Texture: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
 var VertexBuffer: array [0..3] of TVertex2f;
 begin
 // do not draw anything outside the visible screen space (first check fixes some sprite drawing, e.g. hedgehogs)
@@ -229,14 +242,15 @@ glPushMatrix;
 glTranslatef(X, Y, 0);
 
 if Dir < 0 then
-   begin
-   hw:= - hw;
-   glRotatef(Angle, 0, 0, -1);
-   end else
-   glRotatef(Angle, 0, 0,  1);
+    begin
+    hw:= - hw;
+    glRotatef(Angle, 0, 0, -1);
+    end
+else
+    glRotatef(Angle, 0, 0,  1);
 
 
-glBindTexture(GL_TEXTURE_2D, Tex^.id);
+glBindTexture(GL_TEXTURE_2D, Texture^.id);
 
 VertexBuffer[0].X:= -hw;
 VertexBuffer[0].Y:= -hh;
@@ -248,20 +262,31 @@ VertexBuffer[3].X:= -hw;
 VertexBuffer[3].Y:= hh;
 
 glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]);
-glTexCoordPointer(2, GL_FLOAT, 0, @Tex^.tb);
+glTexCoordPointer(2, GL_FLOAT, 0, @Texture^.tb);
 glDrawArrays(GL_TRIANGLE_FAN, 0, Length(VertexBuffer));
 
 glPopMatrix
 end;
 
-procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
+procedure DrawSprite(Sprite: TSprite; X, Y, Frame: LongInt);
 var row, col, numFramesFirstCol: LongInt;
 begin
-if SpritesData[Sprite].imageHeight = 0 then exit;
-numFramesFirstCol:= SpritesData[Sprite].imageHeight div SpritesData[Sprite].Height;
-row:= Frame mod numFramesFirstCol;
-col:= Frame div numFramesFirstCol;
-DrawSprite2 (Sprite, X, Y, col, row);
+    if SpritesData[Sprite].imageHeight = 0 then
+        exit;
+    numFramesFirstCol:= SpritesData[Sprite].imageHeight div SpritesData[Sprite].Height;
+    row:= Frame mod numFramesFirstCol;
+    col:= Frame div numFramesFirstCol;
+    DrawSprite(Sprite, X, Y, col, row);
+end;
+
+procedure DrawSprite(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
+var r: TSDL_Rect;
+begin
+    r.x:= FrameX * SpritesData[Sprite].Width;
+    r.w:= SpritesData[Sprite].Width;
+    r.y:= FrameY * SpritesData[Sprite].Height;
+    r.h:= SpritesData[Sprite].Height;
+    DrawTextureFromRect(X, Y, @r, SpritesData[Sprite].Texture)
 end;
 
 procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt);
@@ -285,20 +310,10 @@ if (X + SpritesData[Sprite].Width > RightX) then
 dec(r.h, r.y);
 dec(r.w, r.x);
 
-DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture)
-end;
-
-procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt);
-var r: TSDL_Rect;
-begin
-    r.x:= FrameX * SpritesData[Sprite].Width;
-    r.w:= SpritesData[Sprite].Width;
-    r.y:= FrameY * SpritesData[Sprite].Height;
-    r.h:= SpritesData[Sprite].Height;
-    DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
+DrawTextureFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture)
 end;
 
-procedure DrawCentered(X, Top: LongInt; Source: PTexture);
+procedure DrawTextureCentered(X, Top: LongInt; Source: PTexture);
 var scale: GLfloat;
 begin
     if (Source^.w + 20) > cScreenWidth then
@@ -393,10 +408,10 @@ end;
 
 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
 const VertexBuffer: array [0..3] of TVertex2f = (
-        (x: -16; y: -16),
-        (x:  16; y: -16),
-        (x:  16; y:  16),
-        (x: -16; y:  16));
+        (X: -16; Y: -16),
+        (X:  16; Y: -16),
+        (X:  16; Y:  16),
+        (X: -16; Y:  16));
 var l, r, t, b: real;
     TextureBuffer: array [0..3] of TVertex2f;
 begin
@@ -410,13 +425,14 @@ begin
     b:= (Pos + 1) * 32 / HHTexture^.h;
 
     if Dir = -1 then
-    begin
-    l:= (Step + 1) * 32 / HHTexture^.w;
-    r:= Step * 32 / HHTexture^.w
-    end else
-    begin
-    l:= Step * 32 / HHTexture^.w;
-    r:= (Step + 1) * 32 / HHTexture^.w
+        begin
+        l:= (Step + 1) * 32 / HHTexture^.w;
+        r:= Step * 32 / HHTexture^.w
+        end
+    else
+        begin
+        l:= Step * 32 / HHTexture^.w;
+        r:= (Step + 1) * 32 / HHTexture^.w
     end;
 
 
@@ -442,34 +458,78 @@ begin
     glPopMatrix
 end;
 
+procedure DrawScreenWidget(widget: POnScreenWidget);
+{$IFDEF USE_TOUCH_INTERFACE}
+var alpha: byte = $FF;
+begin
+with widget^ do
+    begin
+    if (fadeAnimStart <> 0) then
+        begin
+        if RealTicks > (fadeAnimStart + FADE_ANIM_TIME) then
+            fadeAnimStart:= 0
+        else
+            if show then 
+                alpha:= Byte(trunc((RealTicks - fadeAnimStart)/FADE_ANIM_TIME * $FF))
+            else 
+                alpha:= Byte($FF - trunc((RealTicks - fadeAnimStart)/FADE_ANIM_TIME * $FF));
+        end;
+
+    with moveAnim do
+        if animate then
+            if RealTicks > (startTime + MOVE_ANIM_TIME) then
+                begin
+                startTime:= 0;
+                animate:= false;
+                frame.x:= target.x;
+                frame.y:= target.y;
+                active.x:= active.x + (target.x - source.x);
+                active.y:= active.y + (target.y - source.y);
+                end
+            else
+                begin
+                frame.x:= source.x + Round((target.x - source.x) * ((RealTicks - startTime) / MOVE_ANIM_TIME));
+                frame.y:= source.y + Round((target.y - source.y) * ((RealTicks - startTime) / MOVE_ANIM_TIME));
+                end;
+
+    if show or (fadeAnimStart <> 0) then
+        begin
+        Tint($FF, $FF, $FF, alpha);
+        DrawTexture(frame.x, frame.y, spritesData[sprite].Texture, buttonScale);
+        Tint($FF, $FF, $FF, $FF);
+        end;
+    end;
+{$ELSE}
+begin
+widget:= widget; // avoid hint
+{$ENDIF}
+end;
 
 procedure Tint(r, g, b, a: Byte); inline;
-const 
-    lastTint: Longword = 0;
-var 
-    nc, tw: Longword;
+var nc, tw: Longword;
 begin
-nc:= (a shl 24) or (b shl 16) or (g shl 8) or r;
-
-if nc = lastTint then
-    exit;
+    nc:= (a shl 24) or (b shl 16) or (g shl 8) or r;
 
-if cGrayScale then
-    begin
-    tw:= round(r * RGB_LUMINANCE_RED + g * RGB_LUMINANCE_GREEN + b * RGB_LUMINANCE_BLUE);
-    if tw > 255 then tw:= 255;
-    r:= tw;
-    g:= tw;
-    b:= tw
-    end;
+    if nc = lastTint then
+        exit;
 
-glColor4ub(r, g, b, a);
-lastTint:= nc;
+    if GrayScale then
+        begin
+        tw:= round(r * RGB_LUMINANCE_RED + g * RGB_LUMINANCE_GREEN + b * RGB_LUMINANCE_BLUE);
+        if tw > 255 then
+            tw:= 255;
+        r:= tw;
+        g:= tw;
+        b:= tw
+        end;
+
+    glColor4ub(r, g, b, a);
+    lastTint:= nc;
 end;
 
 procedure Tint(c: Longword); inline;
 begin
-Tint(((c shr 24) and $FF), ((c shr 16) and $FF), (c shr 8) and $FF, (c and $FF))
+    Tint(((c shr 24) and $FF), ((c shr 16) and $FF), (c shr 8) and $FF, (c and $FF))
 end;
 
 end.
diff --git a/hedgewars/uRenderUtils.pas b/hedgewars/uRenderUtils.pas
index 60368bc..3e5282a 100644
--- a/hedgewars/uRenderUtils.pas
+++ b/hedgewars/uRenderUtils.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,20 +24,29 @@ interface
 uses SDLh, uTypes;
 
 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);
+
 procedure copyRotatedSurface(src, dest: PSDL_Surface); // this is necessary since width/height are read only in SDL
-procedure copyToXY(src, dest: PSDL_Surface; destX, destY: LongInt);
+procedure copyToXY(src, dest: PSDL_Surface; destX, destY: LongInt); inline;
+procedure copyToXYFromRect(src, dest: PSDL_Surface; srcX, srcY, srcW, srcH, destX, destY: LongInt);
+
+procedure DrawSprite2Surf(sprite: TSprite; dest: PSDL_Surface; x,y: LongInt); inline;
+procedure DrawSpriteFrame2Surf(sprite: TSprite; dest: PSDL_Surface; x,y: LongInt; frame: LongInt);
+procedure DrawLine2Surf(dest: PSDL_Surface; x0,y0,x1,y1:LongInt; r,g,b: byte);
+procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
+
 function  RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
+function  RenderStringTexLim(s: ansistring; Color: Longword; font: THWFont; maxLength: LongWord): PTexture;
 function  RenderSpeechBubbleTex(s: ansistring; SpeechType: Longword; font: THWFont): PTexture;
-procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
 
 implementation
-uses uUtils, uVariables, uConsts, uTextures, sysutils, uDebug;
+uses uUtils, uVariables, uConsts, uTextures, SysUtils, uDebug;
 
 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
 var r: TSDL_Rect;
 begin
     r:= rect^;
-    if Clear then SDL_FillRect(Surface, @r, 0);
+    if Clear then
+        SDL_FillRect(Surface, @r, 0);
 
     BorderColor:= SDL_MapRGB(Surface^.format, BorderColor shr 16, BorderColor shr 8, BorderColor and $FF);
     FillColor:= SDL_MapRGB(Surface^.format, FillColor shr 16, FillColor shr 8, FillColor and $FF);
@@ -61,32 +70,42 @@ begin
     r.h:= rect^.h - 4;
     SDL_FillRect(Surface, @r, FillColor)
 end;
-
+(*
 function WriteInRoundRect(Surface: PSDL_Surface; X, Y: LongInt; Color: LongWord; Font: THWFont; s: ansistring): TSDL_Rect;
+begin
+    WriteInRoundRect:= WriteInRoundRect(Surface, X, Y, Color, Font, s, 0);
+end;*)
+
+function WriteInRoundRect(Surface: PSDL_Surface; X, Y: LongInt; Color: LongWord; Font: THWFont; s: ansistring; maxLength: LongWord): TSDL_Rect;
 var w, h: LongInt;
     tmpsurf: PSDL_Surface;
     clr: TSDL_Color;
-    finalRect: TSDL_Rect;
+    finalRect, textRect: TSDL_Rect;
 begin
     TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h);
+    if (maxLength <> 0) and (w > maxLength) then w := maxLength;
     finalRect.x:= X;
     finalRect.y:= Y;
-    finalRect.w:= w + FontBorder * 2 + 4;
-    finalRect.h:= h + FontBorder * 2;
-    DrawRoundRect(@finalRect, cWhiteColor, endian(cNearBlackColorChannels.value), Surface, true);
+    finalRect.w:= w + cFontBorder * 2 + 4;
+    finalRect.h:= h + cFontBorder * 2;
+    textRect.x:= X;
+    textRect.y:= Y;
+    textRect.w:= w;
+    textRect.h:= h;
+    DrawRoundRect(@finalRect, cWhiteColor, cNearBlackColor, Surface, true);
     clr.r:= (Color shr 16) and $FF;
     clr.g:= (Color shr 8) and $FF;
     clr.b:= Color and $FF;
     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr);
-    finalRect.x:= X + FontBorder + 2;
-    finalRect.y:= Y + FontBorder;
+    finalRect.x:= X + cFontBorder + 2;
+    finalRect.y:= Y + cFontBorder;
     SDLTry(tmpsurf <> nil, true);
-    SDL_UpperBlit(tmpsurf, nil, Surface, @finalRect);
+    SDL_UpperBlit(tmpsurf, @textRect, Surface, @finalRect);
     SDL_FreeSurface(tmpsurf);
     finalRect.x:= X;
     finalRect.y:= Y;
-    finalRect.w:= w + FontBorder * 2 + 4;
-    finalRect.h:= h + FontBorder * 2;
+    finalRect.w:= w + cFontBorder * 2 + 4;
+    finalRect.h:= h + cFontBorder * 2;
     WriteInRoundRect:= finalRect;
 end;
 
@@ -119,21 +138,27 @@ begin
             end;
 end;
 
-procedure copyToXY(src, dest: PSDL_Surface; destX, destY: LongInt);
-var srcX, srcY, i, j, maxDest: LongInt;
+procedure copyToXY(src, dest: PSDL_Surface; destX, destY: LongInt); inline;
+begin
+    copyToXYFromRect(src, dest, 0, 0, src^.w, src^.h, destX, destY);
+end;
+
+procedure copyToXYFromRect(src, dest: PSDL_Surface; srcX, srcY, srcW, srcH, destX, destY: LongInt);
+var i, j, maxDest, maxSrc, iX, iY: LongInt;
     srcPixels, destPixels: PLongWordArray;
     r0, g0, b0, a0, r1, g1, b1, a1: Byte;
 begin
     maxDest:= (dest^.pitch div 4) * dest^.h;
+    maxSrc:= (src^.pitch div 4) * src^.h;
     srcPixels:= src^.pixels;
     destPixels:= dest^.pixels;
 
-    for srcX:= 0 to src^.w - 1 do
-    for srcY:= 0 to src^.h - 1 do
+    for iX:= 0 to srcW - 1 do
+    for iY:= 0 to srcH - 1 do
         begin
-        i:= (destY + srcY) * (dest^.pitch div 4) + destX + srcX;
-        j:= srcY * (src^.pitch div 4) + srcX;
-        if (i < maxDest) and (srcPixels^[j] and AMask <> 0) then
+        i:= (destY + iY) * (dest^.pitch div 4) + (destX + iX);
+        j:= (srcY  + iY) * (src^.pitch  div 4) + (srcX  + iX);
+        if (i < maxDest) and (j < maxSrc) and (srcPixels^[j] and AMask <> 0) then
             begin
             SDL_GetRGBA(destPixels^[i], dest^.format, @r0, @g0, @b0, @a0);
             SDL_GetRGBA(srcPixels^[j], src^.format, @r1, @g1, @b1, @a1);
@@ -146,6 +171,63 @@ begin
         end;
 end;
 
+procedure DrawSprite2Surf(sprite: TSprite; dest: PSDL_Surface; x,y: LongInt); inline;
+begin
+    DrawSpriteFrame2Surf(sprite, dest, x, y, 0);
+end;
+
+procedure DrawSpriteFrame2Surf(sprite: TSprite; dest: PSDL_Surface; x,y,frame: LongInt);
+var numFramesFirstCol, row, col: LongInt;
+begin
+    numFramesFirstCol:= SpritesData[sprite].imageHeight div SpritesData[sprite].Height;
+    row:= Frame mod numFramesFirstCol;
+    col:= Frame div numFramesFirstCol;
+    
+    copyToXYFromRect(SpritesData[sprite].Surface, dest, 
+             col*SpritesData[sprite].Width, 
+             row*SpritesData[sprite].Height, 
+             SpritesData[sprite].Width, 
+             spritesData[sprite].Height, 
+             x,y);
+end;
+
+procedure DrawLine2Surf(dest: PSDL_Surface; x0, y0,x1,y1: LongInt; r,g,b: byte);
+var
+    dx,dy,err,e2,sx,sy: LongInt;
+    yMax: LongInt;
+    destPixels: PLongwordArray;
+begin
+    //max:= (dest^.pitch div 4) * dest^.h;
+    yMax:= dest^.pitch div 4;
+    destPixels:= dest^.pixels;
+
+    dx:= abs(x1-x0);
+    dy:= abs(y1-y0);
+    if x0 < x1 then sx:= 1 else sx:= -1;
+    if y0 < y1 then sy:= 1 else sy:= -1;
+    err:= dx-dy; 
+
+    while(true) do
+        begin
+        destPixels^[(y0 * yMax) + x0]:= SDL_MapRGB(dest^.format, r,g,b); //But will it blend? no
+
+        if (x0 = x1) and (y0 = y1) then break;
+
+        e2:= 2*err;
+        if e2 > -dy then
+            begin
+            err:= err - dy;
+            x0 := x0 + sx;
+            end;
+
+        if e2 < dx then
+            begin
+            err:= err + dx;
+            y0:=y0+sy
+            end;
+        end; 
+end;
+
 procedure copyRotatedSurface(src, dest: PSDL_Surface); // this is necessary since width/height are read only in SDL, apparently
 var y, x, i, j: LongInt;
     srcPixels, destPixels: PLongWordArray;
@@ -166,25 +248,31 @@ begin
             end;
 end;
 
-function  RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
+function RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
+begin
+    RenderStringTex:= RenderStringTexLim(s, Color, font, 0);
+end;
+
+function RenderStringTexLim(s: ansistring; Color: Longword; font: THWFont; maxLength: LongWord): PTexture;
 var w, h: LongInt;
     finalSurface: PSDL_Surface;
 begin
-    if length(s) = 0 then s:= ' ';
+    if length(s) = 0 then s:= _S' ';
     font:= CheckCJKFont(s, font);
     w:= 0; h:= 0; // avoid compiler hints
     TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h);
+    if (maxLength <> 0) and (w > maxLength) then w := maxLength;
 
-    finalSurface:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + FontBorder * 2 + 4, h + FontBorder * 2,
+    finalSurface:= SDL_CreateRGBSurface(SDL_SWSURFACE, w + cFontBorder * 2 + 4, h + cFontBorder * 2,
             32, RMask, GMask, BMask, AMask);
 
     TryDo(finalSurface <> nil, 'RenderString: fail to create surface', true);
 
-    WriteInRoundRect(finalSurface, 0, 0, Color, font, s);
+    WriteInRoundRect(finalSurface, 0, 0, Color, font, s, maxLength);
 
     TryDo(SDL_SetColorKey(finalSurface, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
 
-    RenderStringTex:= Surface2Tex(finalSurface, false);
+    RenderStringTexLim:= Surface2Tex(finalSurface, false);
 
     SDL_FreeSurface(finalSurface);
 end;
@@ -226,11 +314,13 @@ begin
 
     numLines:= 0;
 
-    if length(s) = 0 then s:= '...';
+    if length(s) = 0 then
+        s:= '...';
     font:= CheckCJKFont(s, font);
     w:= 0; h:= 0; // avoid compiler hints
     TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(s), @w, @h);
-    if w<8 then w:= 8;
+    if w<8 then
+        w:= 8;
     j:= 0;
     if (length(s) > 20) then
         begin
@@ -249,7 +339,8 @@ begin
                 substr:= copy(s, prevpos+1, pos-prevpos-1);
                 i:= 0; j:= 0;
                 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(substr), @i, @j);
-                if i > w then w:= i;
+                if i > w then
+                    w:= i;
                 prevpos:= pos;
                 end;
             inc(pos);
@@ -347,22 +438,24 @@ begin
         begin
         if (s[pos] = #1) or (pos = length(s)) then
             begin
-            if s[pos] <> #1 then inc(pos);
-            while s[prevpos+1] = ' 'do inc(prevpos);
+            if s[pos] <> #1 then
+                inc(pos);
+            while s[prevpos+1] = ' 'do
+                inc(prevpos);
             substr:= copy(s, prevpos+1, pos-prevpos-1);
             if Length(substr) <> 0 then
-            begin
-            tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColorChannels);
-            rect.x:= edgeHeight + 1 + ((i - w) div 2);
-            // trying to more evenly position the text, vertically
-            rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
-            SDLTry(tmpsurf <> nil, true);
-            SDL_UpperBlit(tmpsurf, nil, finalSurface, @rect);
-            SDL_FreeSurface(tmpsurf);
-            inc(line);
-            prevpos:= pos;
-            end;
-            end;
+                begin
+                tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColorChannels);
+                rect.x:= edgeHeight + 1 + ((i - w) div 2);
+                // trying to more evenly position the text, vertically
+                rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
+                SDLTry(tmpsurf <> nil, true);
+                SDL_UpperBlit(tmpsurf, nil, finalSurface, @rect);
+                SDL_FreeSurface(tmpsurf);
+                inc(line);
+                prevpos:= pos;
+                end;
+                end;
         inc(pos);
         end;
 
diff --git a/hedgewars/uScript.pas b/hedgewars/uScript.pas
index 2cb60d1..1888fe8 100644
--- a/hedgewars/uScript.pas
+++ b/hedgewars/uScript.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -36,7 +36,7 @@ procedure ScriptClearStack;
 
 procedure ScriptLoad(name : shortstring);
 procedure ScriptOnGameInit;
-procedure ScriptOnScreenResize();
+procedure ScriptOnScreenResize;
 
 procedure ScriptCall(fname : shortstring);
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
@@ -45,19 +45,25 @@ function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
 function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 function ScriptExists(fname : shortstring) : boolean;
 
+
+//function ParseCommandOverride(key, value : shortstring) : shortstring;  This did not work out well
+
 procedure initModule;
 procedure freeModule;
 
 implementation
-{$IFNDEF LUA_DISABLED}
-uses LuaPas in 'LuaPas.pas',
+{$IFDEF USE_LUA_SCRIPT}
+uses LuaPas,
     uConsole,
     uConsts,
     uVisualGears,
     uGears,
+    uGearsList,
+    uGearsUtils,
     uFloat,
     uWorld,
     uAmmos,
+    uTeams,
     uSound,
     uChat,
     uStats,
@@ -74,7 +80,8 @@ uses LuaPas in 'LuaPas.pas',
     uTextures,
     uLandGraphics,
     SDLh,
-    sysutils; 
+    SysUtils, 
+    uIO;
 
 var luaState : Plua_State;
     ScriptAmmoLoadout : shortstring;
@@ -107,7 +114,8 @@ begin
         LuaError('Lua: Wrong number of parameters passed to band!');
         lua_pushnil(L);
         end
-    else lua_pushinteger(L, lua_tointeger(L, 2) and lua_tointeger(L, 1));
+    else
+        lua_pushinteger(L, lua_tointeger(L, 2) and lua_tointeger(L, 1));
     lc_band := 1;
 end;
 
@@ -118,7 +126,8 @@ begin
         LuaError('Lua: Wrong number of parameters passed to bor!');
         lua_pushnil(L);
         end
-    else lua_pushinteger(L, lua_tointeger(L, 2) or lua_tointeger(L, 1));
+    else
+        lua_pushinteger(L, lua_tointeger(L, 2) or lua_tointeger(L, 1));
     lc_bor := 1;
 end;
 
@@ -129,15 +138,29 @@ begin
         LuaError('Lua: Wrong number of parameters passed to bnot!');
         lua_pushnil(L);
         end
-    else lua_pushinteger(L, not lua_tointeger(L, 1));
+    else
+        lua_pushinteger(L, not lua_tointeger(L, 1));
     lc_bnot := 1;
 end;
 
+function lc_div(L: PLua_State): LongInt; Cdecl;
+begin
+    if lua_gettop(L) <> 2 then 
+        begin
+        LuaError('Lua: Wrong number of parameters passed to div!');
+        lua_pushnil(L);
+        end
+    else
+        lua_pushinteger(L, lua_tointeger(L, 1) div lua_tointeger(L, 2));
+    lc_div := 1;
+end;
+
 function lc_getinputmask(L : Plua_State) : LongInt; Cdecl;
 begin
     if lua_gettop(L) <> 0 then
         LuaError('Lua: Wrong number of parameters passed to GetInputMask!')
-    else lua_pushinteger(L, InputMask);
+    else
+        lua_pushinteger(L, InputMask);
     lc_getinputmask:= 1
 end;
 
@@ -145,7 +168,8 @@ function lc_setinputmask(L : Plua_State) : LongInt; Cdecl;
 begin
     if lua_gettop(L) <> 1 then
         LuaError('Lua: Wrong number of parameters passed to SetInputMask!')
-    else InputMask:= lua_tointeger(L, 1);
+    else
+        InputMask:= lua_tointeger(L, 1);
     lc_setinputmask:= 0
 end;
 
@@ -161,10 +185,19 @@ begin
 end;
 
 function lc_parsecommand(L : Plua_State) : LongInt; Cdecl;
+var t: PChar;
+    i,c: LongWord;
+    s: shortstring;
 begin
     if lua_gettop(L) = 1 then
         begin
-        ParseCommand(lua_tostring(L ,1), true);
+        t:= lua_tolstring(L,1, at c);
+
+        for i:= 1 to c do s[i]:= t[i-1];
+        s[0]:= char(c);
+
+        ParseCommand(s, true, true);
+
         end
     else
         LuaError('Lua: Wrong number of parameters passed to ParseCommand!');
@@ -227,45 +260,51 @@ end;
 function lc_spawnfakehealthcrate(L: Plua_State) : LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 4 then begin
+    if lua_gettop(L) <> 4 then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeHealthCrate!');
         lua_pushnil(L);
-    end
-    else begin
+        end
+    else
+        begin
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            HealthCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
+        HealthCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
-    end;
+        end;
     lc_spawnfakehealthcrate := 1;        
 end;
 
 function lc_spawnfakeammocrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 4 then begin
+    if lua_gettop(L) <> 4 then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeAmmoCrate!');
         lua_pushnil(L);
-    end
-    else begin
+        end
+    else
+        begin
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            AmmoCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
+        AmmoCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
-    end;
+        end;
     lc_spawnfakeammocrate := 1;
 end;
 
 function lc_spawnfakeutilitycrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 4 then begin
+    if lua_gettop(L) <> 4 then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeUtilityCrate!');
         lua_pushnil(L);
-    end
-    else begin  
+        end
+    else
+        begin  
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            UtilityCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
+        UtilityCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
-    end;
+        end;
     lc_spawnfakeutilitycrate := 1;
 end;
 
@@ -273,48 +312,65 @@ function lc_spawnhealthcrate(L: Plua_State) : LongInt; Cdecl;
 var gear: PGear;
 var health: LongInt;
 begin
-    if (lua_gettop(L) < 2) or (lua_gettop(L) > 3) then begin
+    if (lua_gettop(L) < 2) or (lua_gettop(L) > 3) then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnHealthCrate!');
         lua_pushnil(L);
-    end
-    else begin
-        if lua_gettop(L) = 3 then health:= lua_tointeger(L, 3)
-        else health:= cHealthCaseAmount;
-        gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), HealthCrate, health);
-        if gear <> nil then lua_pushinteger(L, gear^.uid)
-        else lua_pushnil(L);
-    end;
+        end
+    else
+        begin
+        if lua_gettop(L) = 3 then
+            health:= lua_tointeger(L, 3)
+        else
+            health:= cHealthCaseAmount;
+        gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), HealthCrate, health, 0);
+        if gear <> nil then
+            lua_pushinteger(L, gear^.uid)
+        else
+            lua_pushnil(L);
+        end;
     lc_spawnhealthcrate := 1;        
 end;
 
 function lc_spawnammocrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 3 then begin
+    if (lua_gettop(L) <> 3) and (lua_gettop(L) <> 4) then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnAmmoCrate!');
         lua_pushnil(L);
-    end
-    else begin
-        gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3));
-        if gear <> nil then lua_pushinteger(L, gear^.uid)
-        else lua_pushnil(L);
-    end;
+        end
+    else
+        begin
+        if (lua_gettop(L) = 3) then 
+             gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), 0)
+        else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), AmmoCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
+        if gear <> nil then
+            lua_pushinteger(L, gear^.uid)
+        else
+            lua_pushnil(L);
+        end;
     lc_spawnammocrate := 1;
 end;
 
 function lc_spawnutilitycrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 3 then begin
+    if (lua_gettop(L) <> 3) and (lua_gettop(L) <> 4) then
+        begin
         LuaError('Lua: Wrong number of parameters passed to SpawnUtilityCrate!');
         lua_pushnil(L);
-    end
-    else begin  
-        gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            UtilityCrate, lua_tointeger(L, 3));
-        if gear <> nil then lua_pushinteger(L, gear^.uid)
-        else lua_pushnil(L);
-    end;
+        end
+    else
+        begin
+        if (lua_gettop(L) = 3) then
+             gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), 0)
+        else gear := SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), UtilityCrate, lua_tointeger(L, 3), lua_tointeger(L, 4));
+        if gear <> nil then
+            lua_pushinteger(L, gear^.uid)
+        else
+            lua_pushnil(L);
+       end;
     lc_spawnutilitycrate := 1;
 end;
 
@@ -356,7 +412,8 @@ begin
     else
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
-        if gear <> nil then DeleteGear(gear);
+        if gear <> nil then
+            gear^.Message:= gear^.Message or gmDelete;
         end;
     lc_deletegear:= 0
 end;
@@ -386,7 +443,8 @@ begin
             lastVisualGearByUID:= vg;
             lua_pushinteger(L, vg^.uid)
             end
-        else lua_pushinteger(L, 0)
+        else
+            lua_pushinteger(L, 0)
         end;
     lc_addvisualgear:= 1; // 1 return value
 end;
@@ -401,7 +459,8 @@ begin
     else
         begin
         vg:= VisualGearByUID(lua_tointeger(L, 1));
-        if vg <> nil then DeleteVisualGear(vg);
+        if vg <> nil then
+            DeleteVisualGear(vg);
         end;
     lc_deletevisualgear:= 0
 end;
@@ -459,7 +518,8 @@ begin
             vg^.dY:= lua_tonumber(L, 5);
             vg^.Angle:= lua_tonumber(L, 6);
             vg^.Frame:= lua_tointeger(L, 7);
-            if lua_tointeger(L, 8) <> 0 then vg^.FrameTicks:= lua_tointeger(L, 8);  // find a better way to do this. maybe need to break all these up.
+            if lua_tointeger(L, 8) <> 0 then
+                vg^.FrameTicks:= lua_tointeger(L, 8);  // find a better way to do this. maybe need to break all these up.
             vg^.State:= lua_tointeger(L, 9);
             vg^.Timer:= lua_tointeger(L, 10);
             vg^.Tint:= lua_tointeger(L, 11);
@@ -554,12 +614,79 @@ begin
     lc_setgearmessage:= 0
 end;
 
+function lc_getgearpos(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 1 then
+        begin
+        LuaError('Lua: Wrong number of parameters passed to GetGearPos!');
+        lua_pushnil(L); // return value on stack (nil)
+        end
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        if gear <> nil then
+            lua_pushinteger(L, gear^.Pos)
+        else
+            lua_pushnil(L);
+        end;
+    lc_getgearpos:= 1
+end;
+
+function lc_setgearpos(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 2 then
+        LuaError('Lua: Wrong number of parameters passed to SetGearPos!')
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        if gear <> nil then
+            gear^.Pos:= lua_tointeger(L, 2);
+        end;
+    lc_setgearpos:= 0
+end;
+
+function lc_getgearcollisionmask(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 1 then
+        begin
+        LuaError('Lua: Wrong number of parameters passed to GetGearCollisionMask!');
+        lua_pushnil(L); // return value on stack (nil)
+        end
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        if gear <> nil then
+            lua_pushinteger(L, gear^.CollisionMask)
+        else
+            lua_pushnil(L);
+        end;
+    lc_getgearcollisionmask:= 1
+end;
+
+function lc_setgearcollisionmask(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 2 then
+        LuaError('Lua: Wrong number of parameters passed to SetGearCollisionMask!')
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        if gear <> nil then
+            gear^.CollisionMask:= lua_tointeger(L, 2);
+        end;
+    lc_setgearcollisionmask:= 0
+end;
+
 function lc_gethoglevel(L : Plua_State): LongInt; Cdecl;
 var gear : PGear;
 begin
     if lua_gettop(L) <> 1 then
         LuaError('Lua: Wrong number of parameters passed to GetHogLevel!')
-    else begin
+    else
+        begin
         gear := GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
             lua_pushinteger(L, gear^.Hedgehog^.BotLevel)
@@ -651,7 +778,7 @@ begin
             TryDo(texsurf <> nil, errmsgCreateSurface, true);
             TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
 
-            DrawRoundRect(@r, cWhiteColor, cNearBlackColorChannels.value, texsurf, true);
+            DrawRoundRect(@r, cWhiteColor, cNearBlackColor, texsurf, true);
             rr:= r;
             inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
             DrawRoundRect(@rr, clan^.Color, clan^.Color, texsurf, false);
@@ -721,10 +848,10 @@ begin
         gear:= GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
 
-	    hogName:= lua_tostring(L, 2);
+        hogName:= lua_tostring(L, 2);
             gear^.Hedgehog^.Name:= hogName;
 
-	    FreeTexture(gear^.Hedgehog^.NameTagTex);
+        FreeTexture(gear^.Hedgehog^.NameTagTex);
         gear^.Hedgehog^.NameTagTex:= RenderStringTex(gear^.Hedgehog^.Name, gear^.Hedgehog^.Team^.Clan^.Color, fnt16);
 
         end;
@@ -847,8 +974,10 @@ var gear : PGear;
    vgear : PVisualGear;
        s : LongWord;
 begin
-    if lua_gettop(L) = 4 then s:= lua_tointeger(L, 4)
-    else s:= 0;
+    if lua_gettop(L) = 4 then
+        s:= lua_tointeger(L, 4)
+    else
+        s:= 0;
 
     if (lua_gettop(L) = 4) or (lua_gettop(L) = 3) then
         begin
@@ -861,11 +990,13 @@ begin
                vgear^.Text:= lua_tostring(L, 2);
                vgear^.Hedgehog:= gear^.Hedgehog;
                vgear^.FrameTicks:= lua_tointeger(L, 3);
-               if (vgear^.FrameTicks < 1) or (vgear^.FrameTicks > 3) then vgear^.FrameTicks:= 1;
+               if (vgear^.FrameTicks < 1) or (vgear^.FrameTicks > 3) then
+                   vgear^.FrameTicks:= 1;
                lua_pushinteger(L, vgear^.Uid)
                end
             end
-            else lua_pushnil(L)
+            else
+                lua_pushnil(L)
         end
     else LuaError('Lua: Wrong number of parameters passed to HogSay!');
     lc_hogsay:= 1
@@ -883,21 +1014,21 @@ begin
         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) and (CurrentHedgehog <> nil) then
             begin
             prevgear := CurrentHedgehog^.Gear;
-            prevgear^.Active := false;
-            prevgear^.State:= prevgear^.State and not gstHHDriven;
-            prevgear^.Z := cHHZ;
-            RemoveGearFromList(prevgear);
-            InsertGearToList(prevgear);
-
-            CurrentHedgehog := gear^.Hedgehog;
-// yes, this will muck up turn sequence
-            CurrentTeam := gear^.Hedgehog^.Team;
+            if prevgear <> nil then
+                begin
+                prevgear^.Active := false;
+                prevgear^.State:= prevgear^.State and (not gstHHDriven);
+                prevgear^.Z := cHHZ;
+                prevgear^.Message:= prevgear^.Message or gmRemoveFromList or gmAddToList;
+                end;
+            
+            SwitchCurrentHedgehog(gear^.Hedgehog);
+            CurrentTeam:= CurrentHedgehog^.Team;
 
             gear^.State:= gear^.State or gstHHDriven;
             gear^.Active := true;
             gear^.Z := cCurrHHZ;
-            RemoveGearFromList(gear);
-            InsertGearToList(gear);
+            gear^.Message:= gear^.Message or gmRemoveFromList or gmAddToList;
             end
         end;
     lc_switchhog:= 0
@@ -909,19 +1040,19 @@ begin
 
     if lua_gettop(L) = 3 then
     begin
-	gear:= GearByUID(lua_tointeger(L, 1));
+    gear:= GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Hedgehog <> nil) then
             AddAmmoAmount(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L,3) );
     end else
     
     if lua_gettop(L) = 2 then
     begin
-	gear:= GearByUID(lua_tointeger(L, 1));
+    gear:= GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Hedgehog <> nil) then
             AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)));
     end else
     begin
-    	LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
+        LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
     end;
 
     lc_addammo:= 0;
@@ -935,8 +1066,10 @@ begin
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Hedgehog <> nil) then
-            if lua_gettop(L) = 2 then AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)))
-            else AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L, 3))
+            if lua_gettop(L) = 2 then
+                AddAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)))
+            else
+                SetAmmo(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)), lua_tointeger(L, 3))
         end
     else LuaError('Lua: Wrong number of parameters passed to AddAmmo!');
     lc_addammo:= 0
@@ -952,8 +1085,10 @@ begin
         if (gear <> nil) and (gear^.Hedgehog <> nil) then 
             begin
             ammo:= GetAmmoEntry(gear^.Hedgehog^, TAmmoType(lua_tointeger(L, 2)));
-            if ammo^.AmmoType = amNothing then lua_pushinteger(L, 0)
-            else lua_pushinteger(L, ammo^.Count)
+            if ammo^.AmmoType = amNothing then
+                lua_pushinteger(L, 0)
+            else
+                lua_pushinteger(L, ammo^.Count)
             end
         else lua_pushinteger(L, 0)
         end
@@ -979,9 +1114,10 @@ begin
             begin
             gear^.Health:= lua_tointeger(L, 2);
 
-	    if (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
             begin  
-		RenderHealth(gear^.Hedgehog^);
+            RenderHealth(gear^.Hedgehog^);
+            RecountTeamHealth(gear^.Hedgehog^.Team)
             end;
 
             SetAllToActive;
@@ -1013,7 +1149,7 @@ begin
     else begin
         gear := GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Hedgehog <> nil) then
-            gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))]:= lua_toboolean(L, 3);
+            gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))]:= lua_tointeger(L, 3);
     end;
     lc_seteffect := 0;
 end;
@@ -1028,9 +1164,9 @@ begin
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
         if (gear <> nil) and (gear^.Hedgehog <> nil) then
-            lua_pushboolean(L, gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))])
+            lua_pushinteger(L, gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))])
         else
-            lua_pushboolean(L, false)
+            lua_pushinteger(L, 0)
         end;
     lc_geteffect:= 1
 end;
@@ -1072,6 +1208,25 @@ begin
     lc_getstate:= 1
 end;
 
+function lc_gettag(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 1 then
+        begin
+        LuaError('Lua: Wrong number of parameters passed to GetX!');
+        lua_pushnil(L); // return value on stack (nil)
+        end
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        if gear <> nil then
+            lua_pushinteger(L, gear^.Tag)
+        else
+            lua_pushnil(L);
+        end;
+    lc_gettag:= 1
+end;
+
 function lc_settag(L : Plua_State) : LongInt; Cdecl;
 var gear : PGear;
 begin
@@ -1113,11 +1268,14 @@ begin
         fall:= lua_toboolean(L, 2);
         left:= lua_tointeger(L, 3);
         right:= lua_tointeger(L, 4);
-        if lua_gettop(L) = 5 then tryhard:= lua_toboolean(L, 5);
+        if lua_gettop(L) = 5 then
+            tryhard:= lua_toboolean(L, 5);
         if gear <> nil then
             FindPlace(gear, fall, left, right, tryhard);
-        if gear <> nil then lua_pushinteger(L, gear^.uid)
-        else lua_pushnil(L);
+        if gear <> nil then
+            lua_pushinteger(L, gear^.uid)
+        else
+            lua_pushnil(L);
         end;
     lc_findplace:= 1
 end;
@@ -1148,11 +1306,11 @@ begin
         end
     else
         begin
-        ParseCommand('addteam x ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true);
-        ParseCommand('grave ' + lua_tostring(L, 3), true);
-        ParseCommand('fort ' + lua_tostring(L, 4), true);
-        ParseCommand('voicepack ' + lua_tostring(L, 5), true);
-        if (np = 6) then ParseCommand('flag ' + lua_tostring(L, 6), true);
+        ParseCommand('addteam x ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true, true);
+        ParseCommand('grave ' + lua_tostring(L, 3), true, true);
+        ParseCommand('fort ' + lua_tostring(L, 4), true, true);
+        ParseCommand('voicepack ' + lua_tostring(L, 5), true, true);
+        if (np = 6) then ParseCommand('flag ' + lua_tostring(L, 6), true, true);
         CurrentTeam^.Binds:= DefaultBinds
         // fails on x64
         //lua_pushinteger(L, LongInt(CurrentTeam));
@@ -1171,8 +1329,8 @@ begin
     else
         begin
         temp:= lua_tostring(L, 4);
-        ParseCommand('addhh ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 3) + ' ' + lua_tostring(L, 1), true);
-        ParseCommand('hat ' + temp, true);
+        ParseCommand('addhh ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 3) + ' ' + lua_tostring(L, 1), true, true);
+        ParseCommand('hat ' + temp, true, true);
         lua_pushinteger(L, CurrentHedgehog^.Gear^.uid);
         end;
     lc_addhog:= 1;
@@ -1235,10 +1393,12 @@ begin
             col:= gear^.CollisionIndex >= 0;
             x:= lua_tointeger(L, 2);
             y:= lua_tointeger(L, 3);
-            if col then DeleteCI(gear);
+            if col then
+                DeleteCI(gear);
             gear^.X:= int2hwfloat(x);
             gear^.Y:= int2hwfloat(y);
-            if col then AddGearCI(gear);
+            if col then
+                AddGearCI(gear);
             SetAllToActive
             end
         end;
@@ -1290,6 +1450,7 @@ end;
 
 function lc_getgearvelocity(L : Plua_State) : LongInt; Cdecl;
 var gear: PGear;
+var t: LongInt;
 begin
     if lua_gettop(L) <> 1 then
         begin
@@ -1302,7 +1463,10 @@ begin
         gear:= GearByUID(lua_tointeger(L, 1));
         if gear <> nil then
             begin
-            lua_pushinteger(L, hwRound(gear^.dX * 1000000));
+            t:= hwRound(gear^.dX * 1000000);
+            // gear dX determines hog orientation
+            if (gear^.dX.isNegative) and (t = 0) then t:= -1;
+            lua_pushinteger(L, t);
             lua_pushinteger(L, hwRound(gear^.dY * 1000000))
             end
         end;
@@ -1334,8 +1498,10 @@ begin
     else
         begin
         ZoomValue:= lua_tonumber(L, 1);
-        if ZoomValue < cMaxZoomLevel then ZoomValue:= cMaxZoomLevel;
-        if ZoomValue > cMinZoomLevel then ZoomValue:= cMinZoomLevel;
+        if ZoomValue < cMaxZoomLevel then
+            ZoomValue:= cMaxZoomLevel;
+        if ZoomValue > cMinZoomLevel then
+            ZoomValue:= cMinZoomLevel;
         end;
     lc_setzoom:= 0
 end;
@@ -1365,6 +1531,22 @@ begin
     lc_setammo:= 0
 end;
 
+function lc_setammostore(L : Plua_State) : LongInt; Cdecl;
+var np: LongInt;
+begin
+    np:= lua_gettop(L);
+    if (np <> 4) then
+        LuaError('Lua: Wrong number of parameters passed to SetAmmoStore!')
+    else
+        begin
+        ScriptAmmoLoadout:= lua_tostring(L, 1);
+        ScriptAmmoProbability:= lua_tostring(L, 2);
+        ScriptAmmoDelay:= lua_tostring(L, 3);
+        ScriptAmmoReinforcement:= lua_tostring(L, 4);
+        end;
+    lc_setammostore:= 0
+end;
+
 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
 var m : LongInt;
 begin
@@ -1487,7 +1669,11 @@ begin
         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
             hat:= lua_tostring(L, 2);
             gear^.Hedgehog^.Hat:= hat;
-            LoadHedgehogHat(gear, hat);
+AddFileLog('Changed hat to: '+hat);
+            if (Length(hat) > 39) and (Copy(hat,1,8) = 'Reserved') and (Copy(hat,9,32) = gear^.Hedgehog^.Team^.PlayerHash) then
+                LoadHedgehogHat(gear^.Hedgehog^, 'Reserved/' + Copy(hat,9,Length(hat)-8))
+            else
+                LoadHedgehogHat(gear^.Hedgehog^, hat);
         end;
     lc_sethoghat:= 0;
 end;
@@ -1513,6 +1699,68 @@ begin
     lc_getcurammotype := 1;
 end;
 
+function lc_savecampaignvar(L : Plua_State): LongInt; Cdecl;
+begin
+    if lua_gettop(L) <> 2 then
+        LuaError('Lua: Wrong number of parameters passed to SaveCampaignVar!')
+    else begin
+        SendIPC('V!' + lua_tostring(L, 1) + ' ' + lua_tostring(L, 2) + #0);
+    end;
+    lc_savecampaignvar := 0;
+end;
+
+function lc_getcampaignvar(L : Plua_State): LongInt; Cdecl;
+begin
+    if (lua_gettop(L) <> 1) then
+        LuaError('Lua: Wrong number of parameters passed to GetCampaignVar!')
+    else
+        SendIPCAndWaitReply('V?' + lua_tostring(L, 1));
+    lua_pushstring(L, str2pchar(CampaignVariable));
+    lc_getcampaignvar := 1;
+end;
+
+function lc_hidehog(L: Plua_State): LongInt; Cdecl;
+var gear: PGear;
+begin
+    if lua_gettop(L) <> 1 then
+        LuaError('Lua: Wrong number of parameters passed to HideHog!')
+    else
+        begin
+        gear:= GearByUID(lua_tointeger(L, 1));
+        hiddenHedgehogs[hiddenHedgehogsNumber]:=gear^.hedgehog;
+        inc(hiddenHedgehogsNumber);
+        HideHog(gear^.hedgehog);
+        end;
+    lc_hidehog := 0;
+end;
+
+function lc_restorehog(L: Plua_State): LongInt; Cdecl;
+var hog: PHedgehog;
+    i, j: LongInt;
+begin
+    if lua_gettop(L) <> 1 then
+        LuaError('Lua: Wrong number of parameters passed to RestoreHog!')
+    else
+        begin
+          i := 0;
+          while (i < hiddenHedgehogsNumber) do
+            begin
+            if hiddenHedgehogs[i]^.gearHidden^.uid = LongWord(lua_tointeger(L, 1)) then
+              begin
+                hog := hiddenHedgehogs[i];
+                RestoreHog(hog);
+                dec(hiddenHedgehogsNumber);
+                for j := i to hiddenHedgehogsNumber - 1 do
+                  hiddenHedgehogs[j] := hiddenHedgehogs[j + 1];
+                lc_restorehog := 0;
+                exit;
+              end;
+            inc(i);
+            end;
+        end;
+    lc_restorehog := 0;
+end;
+
 // boolean TestRectForObstacle(x1, y1, x2, y2, landOnly)
 function lc_testrectforobstacle(L : Plua_State) : LongInt; Cdecl;
 var rtn: Boolean;
@@ -1553,52 +1801,54 @@ end;
 
 procedure ScriptClearStack;
 begin
-lua_settop(luaState, 0)
+    lua_settop(luaState, 0)
 end;
 
 procedure ScriptSetNil(name : shortstring);
 begin
-lua_pushnil(luaState);
-lua_setglobal(luaState, Str2PChar(name));
+    lua_pushnil(luaState);
+    lua_setglobal(luaState, Str2PChar(name));
 end;
 
 procedure ScriptSetInteger(name : shortstring; value : LongInt);
 begin
-lua_pushinteger(luaState, value);
-lua_setglobal(luaState, Str2PChar(name));
+    lua_pushinteger(luaState, value);
+    lua_setglobal(luaState, Str2PChar(name));
 end;
 
 procedure ScriptSetString(name : shortstring; value : shortstring);
 begin
-lua_pushstring(luaState, Str2PChar(value));
-lua_setglobal(luaState, Str2PChar(name));
+    lua_pushstring(luaState, Str2PChar(value));
+    lua_setglobal(luaState, Str2PChar(name));
 end;
 
 function ScriptGetInteger(name : shortstring) : LongInt;
 begin
-lua_getglobal(luaState, Str2PChar(name));
-ScriptGetInteger:= lua_tointeger(luaState, -1);
-lua_pop(luaState, 1);
+    lua_getglobal(luaState, Str2PChar(name));
+    ScriptGetInteger:= lua_tointeger(luaState, -1);
+    lua_pop(luaState, 1);
 end;
 
 function ScriptGetString(name : shortstring) : shortstring;
 begin
-lua_getglobal(luaState, Str2PChar(name));
-ScriptGetString:= lua_tostring(luaState, -1);
-lua_pop(luaState, 1);
+    lua_getglobal(luaState, Str2PChar(name));
+    ScriptGetString:= lua_tostring(luaState, -1);
+    lua_pop(luaState, 1);
 end;
 
 procedure ScriptOnGameInit;
+var i, j, k: LongInt;
 begin
 // not required if there is no script to run
 if not ScriptLoaded then
     exit;
 
 // push game variables so they may be modified by the script
-ScriptSetInteger('BorderColor', cExplosionBorderColor);
+ScriptSetInteger('BorderColor', ExplosionBorderColor);
 ScriptSetInteger('GameFlags', GameFlags);
 ScriptSetString('Seed', cSeed);
 ScriptSetInteger('TemplateFilter', cTemplateFilter);
+ScriptSetInteger('TemplateNumber', LuaTemplateNumber);
 ScriptSetInteger('MapGen', cMapGen);
 ScriptSetInteger('ScreenHeight', cScreenHeight);
 ScriptSetInteger('ScreenWidth', cScreenWidth);
@@ -1607,6 +1857,7 @@ ScriptSetInteger('CaseFreq', cCaseFactor);
 ScriptSetInteger('HealthCaseProb', cHealthCaseProb);
 ScriptSetInteger('HealthCaseAmount', cHealthCaseAmount);
 ScriptSetInteger('DamagePercent', cDamagePercent);
+ScriptSetInteger('RopePercent', cRopePercent);
 ScriptSetInteger('MinesNum', cLandMines);
 ScriptSetInteger('MinesTime', cMinesTime);
 ScriptSetInteger('MineDudPercent', cMineDudPercent);
@@ -1616,15 +1867,17 @@ ScriptSetInteger('Ready', cReadyDelay);
 ScriptSetInteger('SuddenDeathTurns', cSuddenDTurns);
 ScriptSetInteger('WaterRise', cWaterRise);
 ScriptSetInteger('HealthDecrease', cHealthDecrease);
-ScriptSetString('Map', 'CHANGE_ME');
+ScriptSetString('Map', cMapName);
+
 ScriptSetString('Theme', '');
 ScriptSetString('Goals', '');
 
 ScriptCall('onGameInit');
 
 // pop game variables
-ParseCommand('seed ' + ScriptGetString('Seed'), true);
+ParseCommand('seed ' + ScriptGetString('Seed'), true, true);
 cTemplateFilter  := ScriptGetInteger('TemplateFilter');
+LuaTemplateNumber:= ScriptGetInteger('TemplateNumber');
 cMapGen          := ScriptGetInteger('MapGen');
 GameFlags        := ScriptGetInteger('GameFlags');
 cHedgehogTurnTime:= ScriptGetInteger('TurnTime');
@@ -1632,6 +1885,7 @@ cCaseFactor      := ScriptGetInteger('CaseFreq');
 cHealthCaseProb  := ScriptGetInteger('HealthCaseProb');
 cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount');
 cDamagePercent   := ScriptGetInteger('DamagePercent');
+cRopePercent     := ScriptGetInteger('RopePercent');
 cLandMines       := ScriptGetInteger('MinesNum');
 cMinesTime       := ScriptGetInteger('MinesTime');
 cMineDudPercent  := ScriptGetInteger('MineDudPercent');
@@ -1642,16 +1896,49 @@ cSuddenDTurns    := ScriptGetInteger('SuddenDeathTurns');
 cWaterRise       := ScriptGetInteger('WaterRise');
 cHealthDecrease  := ScriptGetInteger('HealthDecrease');
 
-if ScriptGetString('Map') <> 'CHANGE_ME' then
-    ParseCommand('map ' + ScriptGetString('Map'), true);
+if cMapName <> ScriptGetString('Map') then
+    ParseCommand('map ' + ScriptGetString('Map'), true, true);
 if ScriptGetString('Theme') <> '' then
-    ParseCommand('theme ' + ScriptGetString('Theme'), true);
+    ParseCommand('theme ' + ScriptGetString('Theme'), true, true);
 LuaGoals:= ScriptGetString('Goals');
 
-if ScriptExists('onAmmoStoreInit') then
+// Support lua changing the ammo layout - assume all hogs have same ammo, note this might leave a few ammo stores lying around.
+k:= 0;
+if (GameFlags and gfSharedAmmo) <> 0 then
+    for i:= 0 to Pred(ClansCount) do
+        for j:= 0 to Pred(ClansArray[i]^.TeamsNumber) do
+            for k:= 0 to Pred(ClansArray[i]^.Teams[j]^.HedgehogsNumber) do
+                ClansArray[i]^.Teams[j]^.Hedgehogs[k].AmmoStore:= i
+else if (GameFlags and gfPerHogAmmo) <> 0 then
+    for i:= 0 to Pred(TeamsCount) do
+        for j:= 0 to Pred(TeamsArray[i]^.HedgehogsNumber) do
+            begin
+            TeamsArray[i]^.Hedgehogs[j].AmmoStore:= k;
+            if StoreCnt-1 < k then AddAmmoStore;
+            inc(k)
+            end
+else 
+    for i:= 0 to Pred(TeamsCount) do
+        begin
+        for j:= 0 to Pred(TeamsArray[i]^.HedgehogsNumber) do
+            TeamsArray[i]^.Hedgehogs[j].AmmoStore:= k;
+        if StoreCnt-1 < k then AddAmmoStore;
+        inc(k)
+        end;
+if ScriptExists('onAmmoStoreInit') or ScriptExists('onNewAmmoStore') then
     begin
-    ScriptPrepareAmmoStore;
-    ScriptCall('onAmmoStoreInit');
+    // reset ammostore (quite unclean, but works?)
+    uAmmos.freeModule;
+    uAmmos.initModule;
+    if ScriptExists('onAmmoStoreInit') then
+        begin
+        ScriptPrepareAmmoStore;
+        ScriptCall('onAmmoStoreInit');
+        SetAmmoLoadout(ScriptAmmoLoadout);
+        SetAmmoProbability(ScriptAmmoProbability);
+        SetAmmoDelay(ScriptAmmoDelay);
+        SetAmmoReinforcement(ScriptAmmoReinforcement)
+        end;
     ScriptApplyAmmoStore
     end;
 
@@ -1674,8 +1961,10 @@ var ret : LongInt;
       s : shortstring;
 begin
 s:= UserPathz[ptData] + '/' + name;
-if not FileExists(s) then s:= Pathz[ptData] + '/' + name;
-if not FileExists(s) then exit;
+if not FileExists(s) then
+    s:= Pathz[ptData] + '/' + name;
+if not FileExists(s) then
+    exit;
 
 ret:= luaL_loadfile(luaState, Str2PChar(s));
 if ret <> 0 then
@@ -1699,6 +1988,14 @@ ScriptSetInteger('GameTime', GameTicks);
 ScriptSetInteger('RealTime', RealTicks);
 ScriptSetInteger('TotalRounds', TotalRounds);
 ScriptSetInteger('WaterLine', cWaterLine);
+if GameTicks = 0 then
+    begin
+    ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
+    ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
+    ScriptSetInteger('LeftX', leftX);
+    ScriptSetInteger('RightX', rightX);
+    ScriptSetInteger('TopY', topY)
+    end;
 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
     ScriptSetInteger('CurrentHedgehog', CurrentHedgehog^.Gear^.UID)
 else
@@ -1712,7 +2009,7 @@ end;
 
 procedure ScriptCall(fname : shortstring);
 begin
-if not ScriptLoaded or not ScriptExists(fname) then
+if not ScriptLoaded or (not ScriptExists(fname)) then
     exit;
 SetGlobals;
 lua_getglobal(luaState, Str2PChar(fname));
@@ -1724,6 +2021,28 @@ if lua_pcall(luaState, 0, 0, 0) <> 0 then
 GetGlobals;
 end;
 
+(*
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+begin
+ParseCommandOverride:= value;
+if not ScriptExists('ParseCommandOverride') then
+    exit;
+lua_getglobal(luaState, Str2PChar('ParseCommandOverride'));
+lua_pushstring(luaState, Str2PChar(key));
+lua_pushstring(luaState, Str2PChar(value));
+if lua_pcall(luaState, 2, 1, 0) <> 0 then
+    begin
+    LuaError('Lua: Error while calling ParseCommandOverride: ' + lua_tostring(luaState, -1));
+    lua_pop(luaState, 1)
+    end
+else
+    begin
+    ParseCommandOverride:= lua_tostring(luaState, -1);
+    lua_pop(luaState, 1)
+    end;
+end;
+*)
+
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
 ScriptCall:= ScriptCall(fname, par1, 0, 0, 0)
@@ -1741,7 +2060,7 @@ end;
 
 function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 begin
-if not ScriptLoaded or not ScriptExists(fname) then
+if not ScriptLoaded or (not ScriptExists(fname)) then
     exit;
 SetGlobals;
 lua_getglobal(luaState, Str2PChar(fname));
@@ -1778,9 +2097,6 @@ end;
 procedure ScriptPrepareAmmoStore;
 var i: ShortInt;
 begin
-// reset ammostore (quite unclean, but works?)
-uAmmos.freeModule;
-uAmmos.initModule;
 ScriptAmmoLoadout:= '';
 ScriptAmmoDelay:= '';
 ScriptAmmoProbability:= '';
@@ -1806,23 +2122,57 @@ ScriptAmmoReinforcement[ord(ammo)]:= inttostr(reinforcement)[1];
 end;
 
 procedure ScriptApplyAmmoStore;
-var i, j : LongInt;
+var i, j, k : LongInt;
 begin
-SetAmmoLoadout(ScriptAmmoLoadout);
-SetAmmoProbability(ScriptAmmoProbability);
-SetAmmoDelay(ScriptAmmoDelay);
-SetAmmoReinforcement(ScriptAmmoReinforcement);
-
 if (GameFlags and gfSharedAmmo) <> 0 then
     for i:= 0 to Pred(ClansCount) do
-        AddAmmoStore
+        begin
+        if ScriptExists('onNewAmmoStore') then
+            begin
+            ScriptPrepareAmmoStore;
+            ScriptCall('onNewAmmoStore',i,-1);
+            SetAmmoLoadout(ScriptAmmoLoadout);
+            SetAmmoProbability(ScriptAmmoProbability);
+            SetAmmoDelay(ScriptAmmoDelay);
+            SetAmmoReinforcement(ScriptAmmoReinforcement)
+            end;
+        AddAmmoStore;
+        for j:= 0 to Pred(ClansArray[i]^.TeamsNumber) do
+            for k:= 0 to Pred(ClansArray[i]^.Teams[j]^.HedgehogsNumber) do
+                ClansArray[i]^.Teams[j]^.Hedgehogs[k].AmmoStore:= StoreCnt - 1
+        end
 else if (GameFlags and gfPerHogAmmo) <> 0 then
     for i:= 0 to Pred(TeamsCount) do
         for j:= 0 to Pred(TeamsArray[i]^.HedgehogsNumber) do
-            AddAmmoStore
+            begin
+            if ScriptExists('onNewAmmoStore') then
+                begin
+                ScriptPrepareAmmoStore;
+                ScriptCall('onNewAmmoStore',i,j);
+                SetAmmoLoadout(ScriptAmmoLoadout);
+                SetAmmoProbability(ScriptAmmoProbability);
+                SetAmmoDelay(ScriptAmmoDelay);
+                SetAmmoReinforcement(ScriptAmmoReinforcement)
+                end;
+            AddAmmoStore;
+            TeamsArray[i]^.Hedgehogs[j].AmmoStore:= StoreCnt - 1
+            end
 else 
     for i:= 0 to Pred(TeamsCount) do
-        AddAmmoStore
+        begin
+        if ScriptExists('onNewAmmoStore') then
+            begin
+            ScriptPrepareAmmoStore;
+            ScriptCall('onNewAmmoStore',i,-1);
+            SetAmmoLoadout(ScriptAmmoLoadout);
+            SetAmmoProbability(ScriptAmmoProbability);
+            SetAmmoDelay(ScriptAmmoDelay);
+            SetAmmoReinforcement(ScriptAmmoReinforcement)
+            end;
+        AddAmmoStore;
+        for j:= 0 to Pred(TeamsArray[i]^.HedgehogsNumber) do
+            TeamsArray[i]^.Hedgehogs[j].AmmoStore:= StoreCnt - 1
+        end
 end;
 
 procedure initModule;
@@ -1844,9 +2194,7 @@ luaopen_math(luaState);
 luaopen_table(luaState);
 
 // import some variables
-ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
-ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
-ScriptSetString('L', cLocale);
+ScriptSetString(_S'L', cLocale);
 
 // import game flags
 ScriptSetInteger('gfForts', gfForts);
@@ -1940,86 +2288,97 @@ ScriptSetInteger('gstHHGone'         ,$00100000);
 ScriptSetInteger('gstInvisible'      ,$00200000);
 
 // register functions
-lua_register(luaState, 'band', @lc_band);
-lua_register(luaState, 'bor', @lc_bor);
-lua_register(luaState, 'bnot', @lc_bnot);
-lua_register(luaState, 'GetInputMask', @lc_getinputmask);
-lua_register(luaState, 'SetInputMask', @lc_setinputmask);
-lua_register(luaState, 'AddGear', @lc_addgear);
-lua_register(luaState, 'DeleteGear', @lc_deletegear);
-lua_register(luaState, 'AddVisualGear', @lc_addvisualgear);
-lua_register(luaState, 'DeleteVisualGear', @lc_deletevisualgear);
-lua_register(luaState, 'GetVisualGearValues', @lc_getvisualgearvalues);
-lua_register(luaState, 'SetVisualGearValues', @lc_setvisualgearvalues);
-lua_register(luaState, 'SpawnHealthCrate', @lc_spawnhealthcrate);
-lua_register(luaState, 'SpawnAmmoCrate', @lc_spawnammocrate);
-lua_register(luaState, 'SpawnUtilityCrate', @lc_spawnutilitycrate);
-lua_register(luaState, 'SpawnFakeHealthCrate', @lc_spawnfakehealthcrate);
-lua_register(luaState, 'SpawnFakeAmmoCrate', @lc_spawnfakeammocrate);
-lua_register(luaState, 'SpawnFakeUtilityCrate', @lc_spawnfakeutilitycrate);
-lua_register(luaState, 'WriteLnToConsole', @lc_writelntoconsole);
-lua_register(luaState, 'GetGearType', @lc_getgeartype);
-lua_register(luaState, 'EndGame', @lc_endgame);
-lua_register(luaState, 'FindPlace', @lc_findplace);
-lua_register(luaState, 'SetGearPosition', @lc_setgearposition);
-lua_register(luaState, 'GetGearPosition', @lc_getgearposition);
-lua_register(luaState, 'SetGearTarget', @lc_setgeartarget);
-lua_register(luaState, 'GetGearTarget', @lc_getgeartarget);
-lua_register(luaState, 'SetGearVelocity', @lc_setgearvelocity);
-lua_register(luaState, 'GetGearVelocity', @lc_getgearvelocity);
-lua_register(luaState, 'ParseCommand', @lc_parsecommand);
-lua_register(luaState, 'ShowMission', @lc_showmission);
-lua_register(luaState, 'HideMission', @lc_hidemission);
-lua_register(luaState, 'AddCaption', @lc_addcaption);
-lua_register(luaState, 'SetAmmo', @lc_setammo);
-lua_register(luaState, 'PlaySound', @lc_playsound);
-lua_register(luaState, 'AddTeam', @lc_addteam);
-lua_register(luaState, 'AddHog', @lc_addhog);
-lua_register(luaState, 'AddAmmo', @lc_addammo);
-lua_register(luaState, 'GetAmmoCount', @lc_getammocount);
-lua_register(luaState, 'SetHealth', @lc_sethealth);
-lua_register(luaState, 'GetHealth', @lc_gethealth);
-lua_register(luaState, 'SetEffect', @lc_seteffect);
-lua_register(luaState, 'GetEffect', @lc_geteffect);
-lua_register(luaState, 'GetHogClan', @lc_gethogclan);
-lua_register(luaState, 'GetClanColor', @lc_getclancolor);
-lua_register(luaState, 'SetClanColor', @lc_setclancolor);
-lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname);
-lua_register(luaState, 'GetHogName', @lc_gethogname);
-lua_register(luaState, 'SetHogName', @lc_sethogname);
-lua_register(luaState, 'GetHogLevel', @lc_gethoglevel);
-lua_register(luaState, 'SetHogLevel', @lc_sethoglevel);
-lua_register(luaState, 'GetX', @lc_getx);
-lua_register(luaState, 'GetY', @lc_gety);
-lua_register(luaState, 'CopyPV', @lc_copypv);
-lua_register(luaState, 'FollowGear', @lc_followgear);
-lua_register(luaState, 'GetFollowGear', @lc_getfollowgear);
-lua_register(luaState, 'SetState', @lc_setstate);
-lua_register(luaState, 'GetState', @lc_getstate);
-lua_register(luaState, 'SetTag', @lc_settag);
-lua_register(luaState, 'SetTimer', @lc_settimer);
-lua_register(luaState, 'GetTimer', @lc_gettimer);
-lua_register(luaState, 'SetZoom', @lc_setzoom);
-lua_register(luaState, 'GetZoom', @lc_getzoom);
-lua_register(luaState, 'HogSay', @lc_hogsay);
-lua_register(luaState, 'SwitchHog', @lc_switchhog);
-lua_register(luaState, 'HogTurnLeft', @lc_hogturnleft);
-lua_register(luaState, 'CampaignLock', @lc_campaignlock);
-lua_register(luaState, 'CampaignUnlock', @lc_campaignunlock);
-lua_register(luaState, 'GetGearElasticity', @lc_getgearelasticity);
-lua_register(luaState, 'GetGearRadius', @lc_getgearradius);
-lua_register(luaState, 'GetGearMessage', @lc_getgearmessage);
-lua_register(luaState, 'SetGearMessage', @lc_setgearmessage);
-lua_register(luaState, 'GetRandom', @lc_getrandom);
-lua_register(luaState, 'SetWind', @lc_setwind);
-lua_register(luaState, 'GetDataPath', @lc_getdatapath);
-lua_register(luaState, 'GetUserDataPath', @lc_getuserdatapath);
-lua_register(luaState, 'MapHasBorder', @lc_maphasborder);
-lua_register(luaState, 'GetHogHat', @lc_gethoghat);
-lua_register(luaState, 'SetHogHat', @lc_sethoghat);
-lua_register(luaState, 'PlaceGirder', @lc_placegirder);
-lua_register(luaState, 'GetCurAmmoType', @lc_getcurammotype);
-lua_register(luaState, 'TestRectForObstacle', @lc_testrectforobstacle);
+lua_register(luaState, _P'HideHog', @lc_hidehog);
+lua_register(luaState, _P'RestoreHog', @lc_restorehog);
+lua_register(luaState, _P'SaveCampaignVar', @lc_savecampaignvar);
+lua_register(luaState, _P'GetCampaignVar', @lc_getcampaignvar);
+lua_register(luaState, _P'band', @lc_band);
+lua_register(luaState, _P'bor', @lc_bor);
+lua_register(luaState, _P'bnot', @lc_bnot);
+lua_register(luaState, _P'div', @lc_div);
+lua_register(luaState, _P'GetInputMask', @lc_getinputmask);
+lua_register(luaState, _P'SetInputMask', @lc_setinputmask);
+lua_register(luaState, _P'AddGear', @lc_addgear);
+lua_register(luaState, _P'DeleteGear', @lc_deletegear);
+lua_register(luaState, _P'AddVisualGear', @lc_addvisualgear);
+lua_register(luaState, _P'DeleteVisualGear', @lc_deletevisualgear);
+lua_register(luaState, _P'GetVisualGearValues', @lc_getvisualgearvalues);
+lua_register(luaState, _P'SetVisualGearValues', @lc_setvisualgearvalues);
+lua_register(luaState, _P'SpawnHealthCrate', @lc_spawnhealthcrate);
+lua_register(luaState, _P'SpawnAmmoCrate', @lc_spawnammocrate);
+lua_register(luaState, _P'SpawnUtilityCrate', @lc_spawnutilitycrate);
+lua_register(luaState, _P'SpawnFakeHealthCrate', @lc_spawnfakehealthcrate);
+lua_register(luaState, _P'SpawnFakeAmmoCrate', @lc_spawnfakeammocrate);
+lua_register(luaState, _P'SpawnFakeUtilityCrate', @lc_spawnfakeutilitycrate);
+lua_register(luaState, _P'WriteLnToConsole', @lc_writelntoconsole);
+lua_register(luaState, _P'GetGearType', @lc_getgeartype);
+lua_register(luaState, _P'EndGame', @lc_endgame);
+lua_register(luaState, _P'FindPlace', @lc_findplace);
+lua_register(luaState, _P'SetGearPosition', @lc_setgearposition);
+lua_register(luaState, _P'GetGearPosition', @lc_getgearposition);
+lua_register(luaState, _P'SetGearTarget', @lc_setgeartarget);
+lua_register(luaState, _P'GetGearTarget', @lc_getgeartarget);
+lua_register(luaState, _P'SetGearVelocity', @lc_setgearvelocity);
+lua_register(luaState, _P'GetGearVelocity', @lc_getgearvelocity);
+lua_register(luaState, _P'ParseCommand', @lc_parsecommand);
+lua_register(luaState, _P'ShowMission', @lc_showmission);
+lua_register(luaState, _P'HideMission', @lc_hidemission);
+lua_register(luaState, _P'AddCaption', @lc_addcaption);
+lua_register(luaState, _P'SetAmmo', @lc_setammo);
+lua_register(luaState, _P'SetAmmoStore', @lc_setammostore);
+lua_register(luaState, _P'PlaySound', @lc_playsound);
+lua_register(luaState, _P'AddTeam', @lc_addteam);
+lua_register(luaState, _P'AddHog', @lc_addhog);
+lua_register(luaState, _P'AddAmmo', @lc_addammo);
+lua_register(luaState, _P'GetAmmoCount', @lc_getammocount);
+lua_register(luaState, _P'SetHealth', @lc_sethealth);
+lua_register(luaState, _P'GetHealth', @lc_gethealth);
+lua_register(luaState, _P'SetEffect', @lc_seteffect);
+lua_register(luaState, _P'GetEffect', @lc_geteffect);
+lua_register(luaState, _P'GetHogClan', @lc_gethogclan);
+lua_register(luaState, _P'GetClanColor', @lc_getclancolor);
+lua_register(luaState, _P'SetClanColor', @lc_setclancolor);
+lua_register(luaState, _P'GetHogTeamName', @lc_gethogteamname);
+lua_register(luaState, _P'GetHogName', @lc_gethogname);
+lua_register(luaState, _P'SetHogName', @lc_sethogname);
+lua_register(luaState, _P'GetHogLevel', @lc_gethoglevel);
+lua_register(luaState, _P'SetHogLevel', @lc_sethoglevel);
+lua_register(luaState, _P'GetX', @lc_getx);
+lua_register(luaState, _P'GetY', @lc_gety);
+lua_register(luaState, _P'CopyPV', @lc_copypv);
+lua_register(luaState, _P'FollowGear', @lc_followgear);
+lua_register(luaState, _P'GetFollowGear', @lc_getfollowgear);
+lua_register(luaState, _P'SetState', @lc_setstate);
+lua_register(luaState, _P'GetState', @lc_getstate);
+lua_register(luaState, _P'GetTag', @lc_gettag);
+lua_register(luaState, _P'SetTag', @lc_settag);
+lua_register(luaState, _P'SetTimer', @lc_settimer);
+lua_register(luaState, _P'GetTimer', @lc_gettimer);
+lua_register(luaState, _P'SetZoom', @lc_setzoom);
+lua_register(luaState, _P'GetZoom', @lc_getzoom);
+lua_register(luaState, _P'HogSay', @lc_hogsay);
+lua_register(luaState, _P'SwitchHog', @lc_switchhog);
+lua_register(luaState, _P'HogTurnLeft', @lc_hogturnleft);
+lua_register(luaState, _P'CampaignLock', @lc_campaignlock);
+lua_register(luaState, _P'CampaignUnlock', @lc_campaignunlock);
+lua_register(luaState, _P'GetGearElasticity', @lc_getgearelasticity);
+lua_register(luaState, _P'GetGearRadius', @lc_getgearradius);
+lua_register(luaState, _P'GetGearMessage', @lc_getgearmessage);
+lua_register(luaState, _P'SetGearMessage', @lc_setgearmessage);
+lua_register(luaState, _P'GetGearPos', @lc_getgearpos);
+lua_register(luaState, _P'SetGearPos', @lc_setgearpos);
+lua_register(luaState, _P'GetGearCollisionMask', @lc_getgearcollisionmask);
+lua_register(luaState, _P'SetGearCollisionMask', @lc_setgearcollisionmask);
+lua_register(luaState, _P'GetRandom', @lc_getrandom);
+lua_register(luaState, _P'SetWind', @lc_setwind);
+lua_register(luaState, _P'GetDataPath', @lc_getdatapath);
+lua_register(luaState, _P'GetUserDataPath', @lc_getuserdatapath);
+lua_register(luaState, _P'MapHasBorder', @lc_maphasborder);
+lua_register(luaState, _P'GetHogHat', @lc_gethoghat);
+lua_register(luaState, _P'SetHogHat', @lc_sethoghat);
+lua_register(luaState, _P'PlaceGirder', @lc_placegirder);
+lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype);
+lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
 
 
 ScriptClearStack; // just to be sure stack is empty
@@ -2042,6 +2401,7 @@ end;
 
 procedure ScriptLoad(name : shortstring);
 begin
+    name:= name; // avoid hint
 end;
 
 procedure ScriptOnGameInit;
@@ -2050,31 +2410,64 @@ end;
 
 procedure ScriptCall(fname : shortstring);
 begin
+    fname:= fname; // avoid hint
 end;
 
 function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 begin
-ScriptCall:= 0
+    // avoid hints
+    fname:= fname;
+    par1:= par1;
+    par2:= par2;
+    par3:= par3;
+    par4:= par4;
+    ScriptCall:= 0
 end;
 
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
-ScriptCall:= 0
+    // avoid hints
+    fname:= fname;
+    par1:= par1;
+    ScriptCall:= 0
 end;
 
 function ScriptCall(fname : shortstring; par1, par2: LongInt) : LongInt;
 begin
-ScriptCall:= 0
+    // avoid hints
+    fname:= fname;
+    par1:= par1;
+    par2:= par2;
+    ScriptCall:= 0
 end;
 
 function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
 begin
-ScriptCall:= 0
+    // avoid hints
+    fname:= fname;
+    par1:= par1;
+    par2:= par2;
+    par3:= par3;
+    ScriptCall:= 0
 end;
 
 function ScriptExists(fname : shortstring) : boolean;
 begin
-ScriptExists:= false
+    fname:= fname; // avoid hint
+    ScriptExists:= false
+end;
+(*
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+begin
+    // avoid hints
+    key:= key;
+    value:= value;
+    ParseCommandOverride:= ''
+end;
+*)
+
+procedure ScriptOnScreenResize;
+begin
 end;
 
 procedure initModule;
diff --git a/hedgewars/uSinTable.pas b/hedgewars/uSinTable.pas
index 037346f..449651b 100644
--- a/hedgewars/uSinTable.pas
+++ b/hedgewars/uSinTable.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -1045,7 +1045,7 @@ const SinTable: array[0..1024] of QWord = (
      $FFFF4E59,
      $FFFFB10B,
      $FFFFEC43,
-    $100000000
+     $100000000
      );
 
 implementation
diff --git a/hedgewars/uSound.pas b/hedgewars/uSound.pas
index c2cd7c9..3c601af 100644
--- a/hedgewars/uSound.pas
+++ b/hedgewars/uSound.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -33,25 +33,27 @@ unit uSound;
  *                   The channel id can be used to stop a specific sound loop.
  *)
 interface
-uses SDLh, uConsts, uTypes, sysutils;
-
-var MusicFN: shortstring; // music file name
+uses SDLh, uConsts, uTypes, SysUtils;
 
+procedure preInitModule;
 procedure initModule;
 procedure freeModule;
 
-procedure InitSound; // Initiates sound-system if isSoundEnabled.
-procedure ReleaseSound(complete: boolean); // Releases sound-system and used resources.
-procedure SoundLoad; // Preloads some sounds for performance reasons.
-
+procedure InitSound;                            // Initiates sound-system if isSoundEnabled.
+procedure ReleaseSound(complete: boolean);      // Releases sound-system and used resources.
+procedure ResetSound;                           // Reset sound state to the previous state.
+procedure SetSound(enabled: boolean);           // Enable/disable sound-system and backup status.
 
 // MUSIC
 
-// Obvious music commands for music track specified in MusicFN.
-procedure PlayMusic;
-procedure PauseMusic;
-procedure ResumeMusic;
-procedure ChangeMusic; // Replaces music track with current MusicFN and plays it.
+// Obvious music commands for music track
+procedure SetMusic(enabled: boolean);           // Enable/disable music.
+procedure SetMusicName(musicname: shortstring); // Set name of the file to play.
+procedure PlayMusic;                            // Play music from the start.
+procedure PauseMusic;                           // Pause music.
+procedure ResumeMusic;                          // Resume music from pause point.
+procedure ChangeMusic(musicname: shortstring);  // Replaces music track with musicname and plays it.
+procedure StopMusic;                            // Stops and releases the current track.
 
 
 // SOUNDS
@@ -61,28 +63,41 @@ procedure ChangeMusic; // Replaces music track with current MusicFN and plays it
 // then the sound's playback won't be interrupted if asked to play again.
 procedure PlaySound(snd: TSound);
 procedure PlaySound(snd: TSound; keepPlaying: boolean);
-procedure PlaySound(snd: TSound; voicepack: PVoicepack);
-procedure PlaySound(snd: TSound; voicepack: PVoicepack; keepPlaying: boolean);
+procedure PlaySoundV(snd: TSound; voicepack: PVoicepack);
+procedure PlaySoundV(snd: TSound; voicepack: PVoicepack; keepPlaying: boolean);
 
 // Plays sound snd [of voicepack] in a loop, but starts with fadems milliseconds of fade-in.
 // Returns sound channel of the looped sound.
 function  LoopSound(snd: TSound): LongInt;
 function  LoopSound(snd: TSound; fadems: LongInt): LongInt;
-function  LoopSound(snd: TSound; voicepack: PVoicepack): LongInt; // WTF?
-function  LoopSound(snd: TSound; voicepack: PVoicepack; fadems: LongInt): LongInt;
+function  LoopSoundV(snd: TSound; voicepack: PVoicepack): LongInt; // WTF?
+function  LoopSoundV(snd: TSound; voicepack: PVoicepack; fadems: LongInt): LongInt;
 
 // Stops the normal/looped sound of the given type/in the given channel
 // [with a fade-out effect for fadems milliseconds].
 procedure StopSound(snd: TSound);
-procedure StopSound(chn: LongInt);
-procedure StopSound(chn, fadems: LongInt);
+procedure StopSoundChan(chn: LongInt);
+procedure StopSoundChan(chn, fadems: LongInt);
 
 procedure AddVoice(snd: TSound; voicepack: PVoicepack);
 procedure PlayNextVoice;
 
 
+// GLOBAL FUNCTIONS
+
+// Drastically lower the volume when we lose focus (and restore the previous value).
+procedure DampenAudio;
+procedure UndampenAudio;
+
+// Mute/Unmute audio
+procedure MuteAudio;
+
+
 // MISC
 
+// Set the initial volume
+procedure SetVolume(vol: LongInt);
+
 // Modifies the sound volume of the game by voldelta and returns the new volume level.
 function  ChangeVolume(voldelta: LongInt): LongInt;
 
@@ -95,10 +110,17 @@ uses uVariables, uConsole, uUtils, uCommands, uDebug;
 
 const chanTPU = 32;
 var Volume: LongInt;
+    cInitVolume: LongInt;
+    previousVolume: LongInt; // cached volume value
     lastChan: array [TSound] of LongInt;
     voicepacks: array[0..cMaxTeams] of TVoicepack;
     defVoicepack: PVoicepack;
-    Mus: PMixMusic = nil;
+    Mus: PMixMusic; // music pointer
+    MusicFN: shortstring; // music file name
+    isMusicEnabled: boolean;
+    isSoundEnabled: boolean;
+    isSEBackup: boolean;
+
 
 function  AskForVoicepack(name: shortstring): Pointer;
 var i: Longword;
@@ -110,20 +132,25 @@ i:= 0;
         begin
         locName:= name+'_'+cLocale;
         path:= UserPathz[ptVoices] + '/' + locName;
-        if DirectoryExists(path) then name:= locName
+        if DirectoryExists(path) then
+            name:= locName
         else
             begin
             path:= Pathz[ptVoices] + '/' + locName;
-            if DirectoryExists(path) then name:= locName
-            else if Length(cLocale) > 2 then
+            if DirectoryExists(path) then
+                name:= locName
+            else if Length(cLocale) > 2
+                then
                 begin
                 locName:= name+'_'+Copy(cLocale,1,2);
                 path:= UserPathz[ptVoices] + '/' + locName;
-                if DirectoryExists(path) then name:= locName
+                if DirectoryExists(path) then
+                    name:= locName
                 else
                     begin
                     path:= Pathz[ptVoices] + '/' + locName;
-                    if DirectoryExists(path) then name:= locName
+                    if DirectoryExists(path) then
+                        name:= locName
                     end
                 end
             end
@@ -141,43 +168,42 @@ i:= 0;
 end;
 
 procedure InitSound;
-var i: TSound;
-    channels: LongInt;
+const channels: LongInt = {$IFDEF MOBILE}1{$ELSE}2{$ENDIF};
 begin
-    if not isSoundEnabled then exit;
+    if not isSoundEnabled then
+        exit;
     WriteToConsole('Init sound...');
     isSoundEnabled:= SDL_InitSubSystem(SDL_INIT_AUDIO) >= 0;
 
-{$IFDEF IPHONEOS}
-    channels:= 1;
-{$ELSE}
-    channels:= 2;
-{$ENDIF}
-
     if isSoundEnabled then
         isSoundEnabled:= Mix_OpenAudio(44100, $8010, channels, 1024) = 0;
 
-    WriteToConsole('Init SDL_mixer... ');
-    SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
-    WriteLnToConsole(msgOK);
-
     if isSoundEnabled then
         WriteLnToConsole(msgOK)
     else
         WriteLnToConsole(msgFailed);
 
+    WriteToConsole('Init SDL_mixer... ');
+    SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
+    WriteLnToConsole(msgOK);
+
     Mix_AllocateChannels(Succ(chanTPU));
-    if isMusicEnabled then
-        Mix_VolumeMusic(50);
-    for i:= Low(TSound) to High(TSound) do
-        lastChan[i]:= -1;
+    ChangeVolume(cInitVolume);	
+end;
 
-    Volume:= 0;
-    ChangeVolume(cInitVolume)
+procedure ResetSound;
+begin
+    isSoundEnabled:= isSEBackup;
+end;
+
+procedure SetSound(enabled: boolean);
+begin
+    isSEBackup:= isSoundEnabled;
+    isSoundEnabled:= enabled;
 end;
 
 // when complete is false, this procedure just releases some of the chucks on inactive channels
-// this way music is not stopped, nor are chucks currently being plauyed
+// in this way music is not stopped, nor are chucks currently being played
 procedure ReleaseSound(complete: boolean);
 var i: TSound;
     t: Longword;
@@ -213,56 +239,22 @@ begin
         end;
 end;
 
-procedure SoundLoad;
-var i: TSound;
-    t: Longword;
-    s:shortstring;
-begin
-    if not isSoundEnabled then exit;
-
-    defVoicepack:= AskForVoicepack('Default');
-
-    // initialize all voices to nil so that they can be loaded when needed
-    for t:= 0 to cMaxTeams do
-        if voicepacks[t].name <> '' then
-            for i:= Low(TSound) to High(TSound) do
-                voicepacks[t].chunks[i]:= nil;
-
-    // preload all the big sound files (>32k) that would otherwise lockup the game
-    for i:= Low(TSound) to High(TSound) do
-    begin
-        defVoicepack^.chunks[i]:= nil;
-        if (i in [sndBeeWater, sndBee, sndCake, sndHellishImpact1, sndHellish, sndHomerun,
-                  sndMolotov, sndMortar, sndRideOfTheValkyries, sndYoohoo])
-            and (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then
-        begin
-            s:= UserPathz[Soundz[i].Path] + '/' + Soundz[i].FileName;
-            if not FileExists(s) then s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName;
-            WriteToConsole(msgLoading + s + ' ');
-            defVoicepack^.chunks[i]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1);
-            TryDo(defVoicepack^.chunks[i] <> nil, msgFailed, true);
-            WriteLnToConsole(msgOK);
-        end;
-    end;
-
-end;
-
 procedure PlaySound(snd: TSound);
 begin
-    PlaySound(snd, nil, false);
+    PlaySoundV(snd, nil, false);
 end;
 
 procedure PlaySound(snd: TSound; keepPlaying: boolean);
 begin
-    PlaySound(snd, nil, keepPlaying);
+    PlaySoundV(snd, nil, keepPlaying);
 end;
 
-procedure PlaySound(snd: TSound; voicepack: PVoicepack);
+procedure PlaySoundV(snd: TSound; voicepack: PVoicepack);
 begin
-    PlaySound(snd, voicepack, false);
+    PlaySoundV(snd, voicepack, false);
 end;
 
-procedure PlaySound(snd: TSound; voicepack: PVoicepack; keepPlaying: boolean);
+procedure PlaySoundV(snd: TSound; voicepack: PVoicepack; keepPlaying: boolean);
 var s:shortstring;
 begin
     if (not isSoundEnabled) or fastUntilLag then
@@ -276,9 +268,10 @@ begin
         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
             begin
             s:= UserPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
-            if not FileExists(s) then s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
+            if not FileExists(s) then
+                s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
             WriteToConsole(msgLoading + s + ' ');
-            voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1);
+            voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
             if voicepack^.chunks[snd] = nil then
                 WriteLnToConsole(msgFailed)
             else
@@ -291,10 +284,11 @@ begin
         if (defVoicepack^.chunks[snd] = nil) and (Soundz[snd].Path <> ptVoices) and (Soundz[snd].FileName <> '') then
             begin
             s:= UserPathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
-            if not FileExists(s) then s:= Pathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
+            if not FileExists(s) then
+                s:= Pathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
             WriteToConsole(msgLoading + s + ' ');
-            defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1);
-            TryDo(defVoicepack^.chunks[snd] <> nil, msgFailed, true);
+            defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
+            SDLTry(defVoicepack^.chunks[snd] <> nil, true);
             WriteLnToConsole(msgOK);
             end;
         lastChan[snd]:= Mix_PlayChannelTimed(-1, defVoicepack^.chunks[snd], 0, -1)
@@ -304,19 +298,23 @@ end;
 procedure AddVoice(snd: TSound; voicepack: PVoicepack);
 var i : LongInt;
 begin
-    if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd = snd) and  (LastVoice.voicepack = voicepack)) then exit;
+    if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd = snd) and  (LastVoice.voicepack = voicepack)) then
+        exit;
     if (snd = sndVictory) or (snd = sndFlawless) then
         begin
         Mix_FadeOutChannel(-1, 800);
-        for i:= 0 to 7 do VoiceList[i].snd:= sndNone;
+        for i:= 0 to 7 do
+            VoiceList[i].snd:= sndNone;
         LastVoice.snd:= sndNone;
         end;
 
     i:= 0;
-    while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i);
+    while (i<8) and (VoiceList[i].snd <> sndNone) do
+        inc(i);
 
     // skip playing same sound for same hog twice
-    if (i>0) and (VoiceList[i-1].snd = snd) and (VoiceList[i-1].voicepack = voicepack) then exit;
+    if (i>0) and (VoiceList[i-1].snd = snd) and (VoiceList[i-1].voicepack = voicepack) then
+        exit;
     VoiceList[i].snd:= snd;
     VoiceList[i].voicepack:= voicepack;
 end;
@@ -324,100 +322,107 @@ end;
 procedure PlayNextVoice;
 var i : LongInt;
 begin
-    if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd <> sndNone) and (lastChan[LastVoice.snd] <> -1) and (Mix_Playing(lastChan[LastVoice.snd]) <> 0)) then exit;
+    if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd <> sndNone) and (lastChan[LastVoice.snd] <> -1) and (Mix_Playing(lastChan[LastVoice.snd]) <> 0)) then
+        exit;
     i:= 0;
-    while (i<8) and (VoiceList[i].snd = sndNone) do inc(i);
+    while (i<8) and (VoiceList[i].snd = sndNone) do
+        inc(i);
     
     if (VoiceList[i].snd <> sndNone) then
         begin
         LastVoice.snd:= VoiceList[i].snd;
         LastVoice.voicepack:= VoiceList[i].voicepack;
         VoiceList[i].snd:= sndNone;
-        PlaySound(LastVoice.snd, LastVoice.voicepack)
+        PlaySoundV(LastVoice.snd, LastVoice.voicepack)
         end
     else LastVoice.snd:= sndNone;
 end;
 
 function LoopSound(snd: TSound): LongInt;
 begin
-    LoopSound:= LoopSound(snd, nil)
+    LoopSound:= LoopSoundV(snd, nil)
 end;
 
 function LoopSound(snd: TSound; fadems: LongInt): LongInt;
 begin
-    LoopSound:= LoopSound(snd, nil, fadems)
+    LoopSound:= LoopSoundV(snd, nil, fadems)
 end;
 
-function LoopSound(snd: TSound; voicepack: PVoicepack): LongInt;
+function LoopSoundV(snd: TSound; voicepack: PVoicepack): LongInt;
 begin
     voicepack:= voicepack;    // avoid compiler hint
-    LoopSound:= LoopSound(snd, nil, 0)
+    LoopSoundV:= LoopSoundV(snd, nil, 0)
 end;
 
-function LoopSound(snd: TSound; voicepack: PVoicepack; fadems: LongInt): LongInt;
+function LoopSoundV(snd: TSound; voicepack: PVoicepack; fadems: LongInt): LongInt;
 var s: shortstring;
 begin
     if (not isSoundEnabled) or fastUntilLag then
-    begin
-        LoopSound:= -1;
+        begin
+        LoopSoundV:= -1;
         exit
-    end;
+        end;
 
     if (voicepack <> nil) then
-    begin
-        if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
         begin
+        if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
+           begin
             s:= UserPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
-            if not FileExists(s) then s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
+            if not FileExists(s) then
+                s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
             WriteToConsole(msgLoading + s + ' ');
-            voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1);
+            voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
             if voicepack^.chunks[snd] = nil then
                 WriteLnToConsole(msgFailed)
             else
                 WriteLnToConsole(msgOK)
-        end;
-        LoopSound:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], -1, -1)
-    end
+            end;
+        LoopSoundV:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], -1, -1)
+        end
     else
-    begin
-        if (defVoicepack^.chunks[snd] = nil) and (Soundz[snd].Path <> ptVoices) and (Soundz[snd].FileName <> '') then
         begin
+        if (defVoicepack^.chunks[snd] = nil) and (Soundz[snd].Path <> ptVoices) and (Soundz[snd].FileName <> '') then
+            begin
             s:= UserPathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
-            if not FileExists(s) then s:= Pathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
+            if not FileExists(s) then
+                s:= Pathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName;
             WriteToConsole(msgLoading + s + ' ');
-            defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1);
-            TryDo(defVoicepack^.chunks[snd] <> nil, msgFailed, true);
+            defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
+            SDLTry(defVoicepack^.chunks[snd] <> nil, true);
             WriteLnToConsole(msgOK);
-        end;
+            end;
         if fadems > 0 then
-            LoopSound:= Mix_FadeInChannelTimed(-1, defVoicepack^.chunks[snd], -1, fadems, -1)
+            LoopSoundV:= Mix_FadeInChannelTimed(-1, defVoicepack^.chunks[snd], -1, fadems, -1)
         else
-            LoopSound:= Mix_PlayChannelTimed(-1, defVoicepack^.chunks[snd], -1, -1);
-    end;
+            LoopSoundV:= Mix_PlayChannelTimed(-1, defVoicepack^.chunks[snd], -1, -1);
+        end;
 end;
 
 procedure StopSound(snd: TSound);
 begin
-    if not isSoundEnabled then exit;
+    if not isSoundEnabled then
+        exit;
 
     if (lastChan[snd] <> -1) and (Mix_Playing(lastChan[snd]) <> 0) then
-    begin
+        begin
         Mix_HaltChannel(lastChan[snd]);
         lastChan[snd]:= -1;
-    end;
+        end;
 end;
 
-procedure StopSound(chn: LongInt);
+procedure StopSoundChan(chn: LongInt);
 begin
-    if not isSoundEnabled then exit;
+    if not isSoundEnabled then
+        exit;
 
     if (chn <> -1) and (Mix_Playing(chn) <> 0) then
         Mix_HaltChannel(chn);
 end;
 
-procedure StopSound(chn, fadems: LongInt);
+procedure StopSoundChan(chn, fadems: LongInt);
 begin
-    if not isSoundEnabled then exit;
+    if not isSoundEnabled then
+        exit;
 
     if (chn <> -1) and (Mix_Playing(chn) <> 0) then
         Mix_FadeOutChannel(chn, fadems);
@@ -430,27 +435,91 @@ begin
         exit;
 
     s:= UserPathPrefix + '/Data/Music/' + MusicFN;
-    if not FileExists(s) then s:= PathPrefix + '/Music/' + MusicFN;
+    if not FileExists(s) then
+        s:= PathPrefix + '/Music/' + MusicFN;
     WriteToConsole(msgLoading + s + ' ');
 
     Mus:= Mix_LoadMUS(Str2PChar(s));
-    TryDo(Mus <> nil, msgFailed, false);
+    SDLTry(Mus <> nil, false);
     WriteLnToConsole(msgOK);
 
     SDLTry(Mix_FadeInMusic(Mus, -1, 3000) <> -1, false)
 end;
 
+procedure SetVolume(vol: LongInt);
+begin
+    cInitVolume:= vol;
+end;
+
 function ChangeVolume(voldelta: LongInt): LongInt;
 begin
-    if not isSoundEnabled then
-        exit(0);
+    ChangeVolume:= 0;
+    if (not isSoundEnabled) or ((voldelta = 0) and not (cInitVolume = 0)) then
+        exit;
 
     inc(Volume, voldelta);
-    if Volume < 0 then Volume:= 0;
+    if Volume < 0 then
+        Volume:= 0;
+    // apply Volume to all channels
     Mix_Volume(-1, Volume);
+    // get assigned Volume
     Volume:= Mix_Volume(-1, -1);
-    if isMusicEnabled then Mix_VolumeMusic(Volume * 4 div 8);
-    ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME
+    if isMusicEnabled then
+        Mix_VolumeMusic(Volume * 4 div 8);
+    ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME;
+
+    if (isMusicEnabled) then
+        if (Volume = 0) then
+            PauseMusic
+            else
+            ResumeMusic;
+
+    isAudioMuted:= (Volume = 0);
+end;
+
+procedure DampenAudio;
+begin
+    if (isAudioMuted) then
+        exit;
+    previousVolume:= Volume;
+    ChangeVolume(-Volume * 7 div 9);
+end;
+
+procedure UndampenAudio;
+begin
+     if (isAudioMuted) then
+        exit;
+    ChangeVolume(previousVolume - Volume);
+end;
+
+procedure MuteAudio;
+begin
+    if (not isSoundEnabled) then
+        exit;
+
+    if (isAudioMuted) then
+    begin
+        ResumeMusic;
+        ChangeVolume(previousVolume);
+    end
+    else
+    begin
+        PauseMusic;
+        previousVolume:= Volume;
+        ChangeVolume(-Volume);
+    end;
+
+    // isAudioMuted is updated in ChangeVolume
+end;
+
+procedure SetMusic(enabled: boolean);
+begin
+    isMusicEnabled:= enabled;
+end;
+
+procedure SetMusicName(musicname: shortstring);
+begin
+    MusicFN:= musicname;
 end;
 
 procedure PauseMusic;
@@ -458,7 +527,8 @@ begin
     if (MusicFN = '') or (not isMusicEnabled) then
         exit;
 
-    Mix_PauseMusic(Mus);
+    if Mus <> nil then
+        Mix_PauseMusic(Mus);
 end;
 
 procedure ResumeMusic;
@@ -466,33 +536,83 @@ begin
     if (MusicFN = '') or (not isMusicEnabled) then
         exit;
 
-    Mix_ResumeMusic(Mus);
+    if Mus <> nil then
+        Mix_ResumeMusic(Mus);
+end;
+
+procedure ChangeMusic(musicname: shortstring);
+begin
+    MusicFN:= musicname;
+    if (MusicFN = '') or (not isMusicEnabled) then
+        exit;
+
+    StopMusic;
+    PlayMusic;
 end;
 
-procedure ChangeMusic;
+procedure StopMusic;
 begin
     if (MusicFN = '') or (not isMusicEnabled) then
         exit;
 
-    // get rid of current music
     if Mus <> nil then
+        begin
         Mix_FreeMusic(Mus);
-
-    PlayMusic;
+        Mus:= nil;
+        end
 end;
 
 procedure chVoicepack(var s: shortstring);
 begin
-    if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/voicepack"', true);
+    if CurrentTeam = nil then
+        OutError(errmsgIncorrectUse + ' "/voicepack"', true);
     if s[1]='"' then Delete(s, 1, 1);
-    if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
+    if s[byte(s[0])]='"' then
+        Delete(s, byte(s[0]), 1);
     CurrentTeam^.voicepack:= AskForVoicepack(s)
 end;
 
+procedure chMute(var s: shortstring);
+begin
+    s:= s; // avoid compiler hint
+    MuteAudio;
+end;
+
+procedure preInitModule;
+begin
+    isMusicEnabled:= true;
+    isSoundEnabled:= true;
+    cInitVolume:= 100;
+end;
+
 procedure initModule;
+var t: LongInt;
+    i: TSound;
 begin
-    RegisterVariable('voicepack', vtCommand, @chVoicepack, false);
+    RegisterVariable('voicepack', @chVoicepack, false);
+    RegisterVariable('mute'     , @chMute     , true );
+
     MusicFN:='';
+    Mus:= nil;
+    isAudioMuted:= false;
+    isSEBackup:= isSoundEnabled;
+    Volume:= 0;
+    defVoicepack:= AskForVoicepack('Default');
+
+    for i:= Low(TSound) to High(TSound) do
+        lastChan[i]:= -1;
+
+    // initialize all voices to nil so that they can be loaded lazily
+    for t:= 0 to cMaxTeams do
+        if voicepacks[t].name <> '' then
+            for i:= Low(TSound) to High(TSound) do
+                voicepacks[t].chunks[i]:= nil;
+
+    (* on MOBILE SDL_mixer has to be compiled against Tremor (USE_OGG_TREMOR)
+       or sound files bigger than 32k will lockup the game *)
+    for i:= Low(TSound) to High(TSound) do
+        defVoicepack^.chunks[i]:= nil;
+
 end;
 
 procedure freeModule;
diff --git a/hedgewars/uStats.pas b/hedgewars/uStats.pas
index e2d4700..9cc51b9 100644
--- a/hedgewars/uStats.pas
+++ b/hedgewars/uStats.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -71,13 +71,15 @@ if killed then
     inc(Kills);
     inc(KillsTotal);
     inc(Attacker^.Team^.stats.Kills);
-    if (Attacker^.Team^.TeamName =
-            Gear^.Hedgehog^.Team^.TeamName) then begin
+    if (Attacker^.Team^.TeamName = Gear^.Hedgehog^.Team^.TeamName) then
+        begin
         inc(Attacker^.Team^.stats.TeamKills);
         inc(Attacker^.Team^.stats.TeamDamage, Gear^.Damage);
     end;
-    if Gear = Attacker^.Gear then inc(Attacker^.Team^.stats.Suicides);
-    if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then inc(KillsClan);
+    if Gear = Attacker^.Gear then
+        inc(Attacker^.Team^.stats.Suicides);
+    if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
+        inc(KillsClan);
     end;
 
 inc(DamageTotal, Damage)
@@ -130,7 +132,7 @@ if FinishedTurnsTotal <> 0 then
     else if AmmoDamagingUsed then
         AddVoice(sndMissed, PreviousTeam^.voicepack)
     else if (AmmoUsedCount > 0) and (not isTurnSkipped) then
-        // nothing ?
+        begin end// nothing ?
     else if isTurnSkipped then
         begin
         AddVoice(sndBoring, PreviousTeam^.voicepack);
@@ -148,9 +150,12 @@ for t:= 0 to Pred(TeamsCount) do // send even on zero turn
                 begin
                 inc(DamageRecv, StepDamageRecv);
                 inc(DamageGiven, StepDamageGiven);
-                if StepDamageRecv > MaxStepDamageRecv then MaxStepDamageRecv:= StepDamageRecv;
-                if StepDamageGiven > MaxStepDamageGiven then MaxStepDamageGiven:= StepDamageGiven;
-                if StepKills > MaxStepKills then MaxStepKills:= StepKills;
+                if StepDamageRecv > MaxStepDamageRecv then
+                    MaxStepDamageRecv:= StepDamageRecv;
+                if StepDamageGiven > MaxStepDamageGiven then
+                    MaxStepDamageGiven:= StepDamageGiven;
+                if StepKills > MaxStepKills then
+                    MaxStepKills:= StepKills;
                 StepKills:= 0;
                 StepDamageRecv:= 0;
                 StepDamageGiven:= 0
@@ -180,10 +185,10 @@ procedure hedgehogFlight(Gear: PGear; time: Longword);
 begin
 if time > 4000 then
     begin
-    writeln('FLIGHT');
-    writeln(Gear^.Hedgehog^.Team^.TeamName);
-    writeln(time);
-    writeln;
+    writeln(stdout, 'FLIGHT');
+    writeln(stdout, Gear^.Hedgehog^.Team^.TeamName);
+    writeln(stdout, inttostr(time));
+    writeln(stdout, '');
     end
 end;
 
@@ -212,7 +217,8 @@ for t:= 0 to Pred(TeamsCount) do
     begin
         if not ExtDriven then
             SendStat(siTeamStats, GetTeamStatString(TeamsArray[t]));
-        for i:= 0 to cMaxHHIndex do begin
+        for i:= 0 to cMaxHHIndex do
+            begin
             if Hedgehogs[i].stats.MaxStepDamageGiven > msd then
                 begin
                 msdhh:= @Hedgehogs[i];
@@ -230,22 +236,26 @@ for t:= 0 to Pred(TeamsCount) do
         end;
 
         { send player stats for winner teams }
-        if Clan^.ClanHealth > 0 then begin
+        if Clan^.ClanHealth > 0 then
+            begin
             winnersClan:= Clan;
             SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' +
                 IntToStr(stats.Kills) + ' ' + TeamName);
         end;
 
         { determine maximum values of TeamKills, TurnSkips, TeamDamage }
-        if stats.TeamKills > maxTeamKills then begin
+        if stats.TeamKills > maxTeamKills then
+            begin
             maxTeamKills := stats.TeamKills;
             maxTeamKillsName := TeamName;
         end;
-        if stats.TurnSkips > maxTurnSkips then begin
+        if stats.TurnSkips > maxTurnSkips then
+            begin
             maxTurnSkips := stats.TurnSkips;
             maxTurnSkipsName := TeamName;
         end;
-        if stats.TeamDamage > maxTeamDamage then begin
+        if stats.TeamDamage > maxTeamDamage then
+            begin
             maxTeamDamage := stats.TeamDamage;
             maxTeamDamageName := TeamName;
         end;
@@ -253,9 +263,12 @@ for t:= 0 to Pred(TeamsCount) do
     end;
 
 { now send player stats for loser teams }
-for t:= 0 to Pred(TeamsCount) do begin
-    with TeamsArray[t]^ do begin
-        if Clan^.ClanHealth = 0 then begin
+for t:= 0 to Pred(TeamsCount) do
+    begin
+    with TeamsArray[t]^ do
+        begin
+        if Clan^.ClanHealth = 0 then
+            begin
             SendStat(siPlayerKills, IntToStr(Clan^.Color) + ' ' +
                 IntToStr(stats.Kills) + ' ' + TeamName);
         end;
@@ -274,18 +287,20 @@ if maxTurnSkips > 2 then
 if maxTeamDamage > 30 then
     SendStat(siMaxTeamDamage, IntToStr(maxTeamDamage) + ' ' + maxTeamDamageName);
 
-if KilledHHs > 0 then SendStat(siKilledHHs, IntToStr(KilledHHs));
+if KilledHHs > 0 then
+    SendStat(siKilledHHs, IntToStr(KilledHHs));
 
 // now to console
 if winnersClan <> nil then 
     begin
-    writeln('WINNERS');
+    writeln(stdout, 'WINNERS');
     for t:= 0 to winnersClan^.TeamsNumber - 1 do
-        writeln(winnersClan^.Teams[t]^.TeamName);
-    end else
-    writeln('DRAW');
+        writeln(stdout, winnersClan^.Teams[t]^.TeamName);
+    end
+else
+    writeln(stdout, 'DRAW');
 
-writeln;
+writeln(stdout, '');
 end;
 
 procedure initModule;
@@ -296,7 +311,6 @@ end;
 
 procedure freeModule;
 begin
-
 end;
 
 end.
diff --git a/hedgewars/uStore.pas b/hedgewars/uStore.pas
index 5cf1372..0b9f27c 100644
--- a/hedgewars/uStore.pas
+++ b/hedgewars/uStore.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,18 +21,26 @@
 
 unit uStore;
 interface
-uses sysutils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat;
+uses {$IFNDEF PAS2C} StrUtils, {$ENDIF}SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat;
 
 procedure initModule;
 procedure freeModule;
 
-procedure StoreLoad(reload: boolean = false);
-procedure StoreRelease(reload: boolean = false);
+procedure StoreLoad(reload: boolean);
+procedure StoreRelease(reload: boolean);
 procedure RenderHealth(var Hedgehog: THedgehog);
 procedure AddProgress;
 procedure FinishProgress;
 function  LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
-procedure LoadHedgehogHat(HHGear: PGear; newHat: shortstring);
+
+// loads an image from the game's data files
+function  LoadDataImage(const path: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
+// like LoadDataImage but uses altPath as fallback-path if file not found/loadable in path
+function  LoadDataImageAltPath(const path, altPath: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
+// like LoadDataImage but uses altFile as fallback-filename if file cannot be loaded
+function  LoadDataImageAltFile(const path: TPathType; const filename, altFile: shortstring; imageFlags: LongInt): PSDL_Surface;
+
+procedure LoadHedgehogHat(var HH: THedgehog; newHat: shortstring);
 procedure SetupOpenGL;
 procedure SetScale(f: GLfloat);
 function  RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture;
@@ -40,14 +48,27 @@ procedure RenderWeaponTooltip(atype: TAmmoType);
 procedure ShowWeaponTooltip(x, y: LongInt);
 procedure FreeWeaponTooltip;
 procedure MakeCrossHairs;
+{$IFDEF USE_VIDEO_RECORDING}
+procedure InitOffscreenOpenGL;
+{$ENDIF}
+
+procedure WarpMouse(x, y: Word); inline;
+procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF};
 
 implementation
-uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, uDebug, uWorld;
+uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands,
+     uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF}
+     {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF};
 
 //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple);
 
 var MaxTextureSize: LongInt;
-//    cGPUVendor: TGPUVendor;
+{$IFDEF SDL13}
+    SDLwindow: PSDL_Window;
+    SDLGLcontext: PSDL_GLContext;
+{$ELSE}
+    SDLPrimSurface: PSDL_Surface;
+{$ENDIF}
 
 function WriteInRect(Surface: PSDL_Surface; X, Y: LongInt; Color: LongWord; Font: THWFont; s: ansistring): TSDL_Rect;
 var w, h: LongInt;
@@ -57,10 +78,10 @@ var w, h: LongInt;
 begin
 w:= 0; h:= 0; // avoid compiler hints
 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h);
-finalRect.x:= X + FontBorder + 2;
-finalRect.y:= Y + FontBorder;
-finalRect.w:= w + FontBorder * 2 + 4;
-finalRect.h:= h + FontBorder * 2;
+finalRect.x:= X + cFontBorder + 2;
+finalRect.y:= Y + cFontBorder;
+finalRect.w:= w + cFontBorder * 2 + 4;
+finalRect.h:= h + cFontBorder * 2;
 clr.r:= Color shr 16;
 clr.g:= (Color shr 8) and $FF;
 clr.b:= Color and $FF;
@@ -71,8 +92,8 @@ SDL_UpperBlit(tmpsurf, nil, Surface, @finalRect);
 SDL_FreeSurface(tmpsurf);
 finalRect.x:= X;
 finalRect.y:= Y;
-finalRect.w:= w + FontBorder * 2 + 4;
-finalRect.h:= h + FontBorder * 2;
+finalRect.w:= w + cFontBorder * 2 + 4;
+finalRect.h:= h + cFontBorder * 2;
 WriteInRect:= finalRect
 end;
 
@@ -80,11 +101,8 @@ procedure MakeCrossHairs;
 var t: LongInt;
     tmpsurf, texsurf: PSDL_Surface;
     Color, i: Longword;
-    s : shortstring;
 begin
-s:= UserPathz[ptGraphics] + '/' + cCHFileName;
-if not FileExists(s+'.png') then s:= Pathz[ptGraphics] + '/' + cCHFileName;
-tmpsurf:= LoadImage(s, ifAlpha or ifCritical);
+tmpsurf:= LoadDataImage(ptGraphics, cCHFileName, ifAlpha or ifCritical);
 
 for t:= 0 to Pred(TeamsCount) do
     with TeamsArray[t]^ do
@@ -105,7 +123,8 @@ for t:= 0 to Pred(TeamsCount) do
 
     // make black pixel be alpha-transparent
     for i:= 0 to texsurf^.w * texsurf^.h - 1 do
-        if PLongwordArray(texsurf^.pixels)^[i] = AMask then PLongwordArray(texsurf^.pixels)^[i]:= (RMask or GMask or BMask) and Color;
+        if PLongwordArray(texsurf^.pixels)^[i] = AMask then
+            PLongwordArray(texsurf^.pixels)^[i]:= (RMask or GMask or BMask) and Color;
 
     if SDL_MustLock(texsurf) then
         SDL_UnlockSurface(texsurf);
@@ -118,23 +137,22 @@ for t:= 0 to Pred(TeamsCount) do
 SDL_FreeSurface(tmpsurf)
 end;
 
-procedure StoreLoad(reload: boolean);
-var s: shortstring;
 
-    procedure WriteNames(Font: THWFont);
-    var t: LongInt;
-        i: LongInt;
-        r, rr: TSDL_Rect;
-        drY: LongInt;
-        texsurf, flagsurf, iconsurf: PSDL_Surface;
-    begin
-    r.x:= 0;
-    r.y:= 0;
-    drY:= - 4;
-    for t:= 0 to Pred(TeamsCount) do
-        with TeamsArray[t]^ do
+procedure WriteNames(Font: THWFont);
+var t: LongInt;
+    i, maxLevel: LongInt;
+    r, rr: TSDL_Rect;
+    drY: LongInt;
+    texsurf, flagsurf, iconsurf: PSDL_Surface;
+    foundBot: boolean;
+begin
+r.x:= 0;
+r.y:= 0;
+drY:= - 4;
+for t:= 0 to Pred(TeamsCount) do
+    with TeamsArray[t]^ do
         begin
-        NameTagTex:= RenderStringTex(TeamName, Clan^.Color, Font);
+        NameTagTex:= RenderStringTexLim(TeamName, Clan^.Color, Font, cTeamHealthWidth);
 
         r.w:= cTeamHealthWidth + 5;
         r.h:= NameTagTex^.h;
@@ -143,7 +161,7 @@ var s: shortstring;
         TryDo(texsurf <> nil, errmsgCreateSurface, true);
         TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
 
-        DrawRoundRect(@r, cWhiteColor, cNearBlackColorChannels.value, texsurf, true);
+        DrawRoundRect(@r, cWhiteColor, cNearBlackColor, texsurf, true);
         rr:= r;
         inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4);
         DrawRoundRect(@rr, Clan^.Color, Clan^.Color, texsurf, false);
@@ -164,26 +182,52 @@ var s: shortstring;
         DrawRoundRect(@r, cWhiteColor, cNearBlackColor, texsurf, true);
 
         // overwrite flag for cpu teams and keep players from using it
-        if (Hedgehogs[0].Gear <> nil) and (Hedgehogs[0].BotLevel > 0) then
-            if Flag = 'hedgewars' then Flag:= 'cpu'
-        else if Flag = 'cpu' then
-            Flag:= 'hedgewars';
-
-        flagsurf:= LoadImage(UserPathz[ptFlags] + '/' + Flag, ifNone);
-        if flagsurf = nil then flagsurf:= LoadImage(Pathz[ptFlags] + '/' + Flag, ifNone);
-        if flagsurf = nil then flagsurf:= LoadImage(UserPathz[ptFlags] + '/hedgewars', ifNone);
-        if flagsurf = nil then flagsurf:= LoadImage(Pathz[ptFlags] + '/hedgewars', ifNone);
+        foundBot:= false;
+        maxLevel:= -1;
+        for i:= 0 to cMaxHHIndex do
+            with Hedgehogs[i] do
+                if (Gear <> nil) and (BotLevel > 0) then
+                    begin
+                    foundBot:= true;
+                    // initially was going to do the highest botlevel of the team, but for now, just apply if entire team has same bot level
+                    if maxLevel = -1 then maxLevel:= BotLevel
+                    else if (maxLevel > 0) and (maxLevel <> BotLevel) then maxLevel:= 0; 
+                    //if (maxLevel > 0) and (BotLevel < maxLevel) then maxLevel:= BotLevel
+                    end
+                else if Gear <> nil then  maxLevel:= 0;
+
+        if foundBot then
+            begin
+            // disabled the plain flag - I think it looks ok even w/ full bars obscuring CPU
+            //if (maxLevel > 0) and (maxLevel < 3) then Flag:= 'cpu_plain' else 
+            Flag:= 'cpu'
+            end
+        else if (Flag = 'cpu') or (Flag = 'cpu_plain') then
+                Flag:= 'hedgewars';
+
+        flagsurf:= LoadDataImageAltFile(ptFlags, Flag, 'hedgewars', ifNone);
         TryDo(flagsurf <> nil, 'Failed to load flag "' + Flag + '" as well as the default flag', true);
+
+        case maxLevel of
+            1: copyToXY(SpritesData[sprBotlevels].Surface, flagsurf, 0, 0); 
+            2: copyToXYFromRect(SpritesData[sprBotlevels].Surface, flagsurf, 5, 2, 17, 13, 5, 2); 
+            3: copyToXYFromRect(SpritesData[sprBotlevels].Surface, flagsurf, 9, 5, 13, 10, 9, 5); 
+            4: copyToXYFromRect(SpritesData[sprBotlevels].Surface, flagsurf, 13, 9, 9, 6, 13, 9); 
+            5: copyToXYFromRect(SpritesData[sprBotlevels].Surface, flagsurf, 17, 11, 5, 4, 17, 11)
+            end;
+
         copyToXY(flagsurf, texsurf, 2, 2);
         SDL_FreeSurface(flagsurf);
         flagsurf:= nil;
 
+
         // restore black border pixels inside the flag
         PLongwordArray(texsurf^.pixels)^[32 * 2 +  2]:= cNearBlackColor;
         PLongwordArray(texsurf^.pixels)^[32 * 2 + 23]:= cNearBlackColor;
         PLongwordArray(texsurf^.pixels)^[32 * 16 +  2]:= cNearBlackColor;
         PLongwordArray(texsurf^.pixels)^[32 * 16 + 23]:= cNearBlackColor;
 
+
         FlagTex:= Surface2Tex(texsurf, false);
         SDL_FreeSurface(texsurf);
         texsurf:= nil;
@@ -192,22 +236,21 @@ var s: shortstring;
 
         dec(drY, r.h + 2);
         DrawHealthY:= drY;
-        for i:= 0 to 7 do
+        for i:= 0 to cMaxHHIndex do
             with Hedgehogs[i] do
                 if Gear <> nil then
                     begin
-                    NameTagTex:= RenderStringTex(Name, Clan^.Color, fnt16);
+                    NameTagTex:= RenderStringTexLim(Name, Clan^.Color, fnt16, cTeamHealthWidth);
                     if Hat <> 'NoHat' then
                         begin
                         if (Length(Hat) > 39) and (Copy(Hat,1,8) = 'Reserved') and (Copy(Hat,9,32) = PlayerHash) then
-                            LoadHedgehogHat(Gear, 'Reserved/' + Copy(Hat,9,Length(s)-8))
+                            LoadHedgehogHat(Hedgehogs[i], 'Reserved/' + Copy(Hat,9,Length(Hat)-8))
                         else
-                            LoadHedgehogHat(Gear, Hat);
+                            LoadHedgehogHat(Hedgehogs[i], Hat);
                         end
                     end;
         end;
-    MissionIcons:= LoadImage(UserPathz[ptGraphics] + '/missions', ifNone);
-    if MissionIcons = nil then MissionIcons:= LoadImage(Pathz[ptGraphics] + '/missions', ifCritical);
+    MissionIcons:= LoadDataImage(ptGraphics, 'missions', ifCritical);
     iconsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, 28, 28, 32, RMask, GMask, BMask, AMask);
     if iconsurf <> nil then
         begin
@@ -220,44 +263,44 @@ var s: shortstring;
         SDL_FreeSurface(iconsurf);
         iconsurf:= nil;
         end;
-    end;
+end;
 
-    procedure InitHealth;
-    var i, t: LongInt;
-    begin
-    for t:= 0 to Pred(TeamsCount) do
-        if TeamsArray[t] <> nil then
-            with TeamsArray[t]^ do
-                begin
-                for i:= 0 to cMaxHHIndex do
-                    if Hedgehogs[i].Gear <> nil then
-                        RenderHealth(Hedgehogs[i]);
-                end
-    end;
+procedure InitHealth;
+var i, t: LongInt;
+begin
+for t:= 0 to Pred(TeamsCount) do
+    if TeamsArray[t] <> nil then
+        with TeamsArray[t]^ do
+            begin
+            for i:= 0 to cMaxHHIndex do
+                if Hedgehogs[i].Gear <> nil then
+                    RenderHealth(Hedgehogs[i]);
+            end
+end;
 
-    procedure LoadGraves;
-    var t: LongInt;
-        texsurf: PSDL_Surface;
-    begin
-    for t:= 0 to Pred(TeamsCount) do
+procedure LoadGraves;
+var t: LongInt;
+    texsurf: PSDL_Surface;
+begin
+for t:= 0 to Pred(TeamsCount) do
     if TeamsArray[t] <> nil then
         with TeamsArray[t]^ do
             begin
-            if GraveName = '' then GraveName:= 'Statue';
-            texsurf:= LoadImage(UserPathz[ptGraves] + '/' + GraveName, ifTransparent);
-            if texsurf = nil then texsurf:= LoadImage(Pathz[ptGraves] + '/' + GraveName, ifTransparent);
-            if texsurf = nil then texsurf:= LoadImage(UserPathz[ptGraves] + '/Statue', ifTransparent);
-            if texsurf = nil then texsurf:= LoadImage(Pathz[ptGraves] + '/Statue', ifCritical or ifTransparent);
+            if GraveName = '' then
+                GraveName:= 'Statue';
+            texsurf:= LoadDataImageAltFile(ptGraves, GraveName, 'Statue', ifCritical or ifTransparent);
             GraveTex:= Surface2Tex(texsurf, false);
             SDL_FreeSurface(texsurf)
             end
-    end;
+end;
 
-var ii: TSprite;
+procedure StoreLoad(reload: boolean);
+var s: shortstring;
+    ii: TSprite;
     fi: THWFont;
     ai: TAmmoType;
     tmpsurf: PSDL_Surface;
-    i: LongInt;
+    i, imflags: LongInt;
 begin
 AddFileLog('StoreLoad()');
 
@@ -266,7 +309,8 @@ if not reload then
         with Fontz[fi] do
             begin
             s:= UserPathz[ptFonts] + '/' + Name;
-            if not FileExists(s) then s:= Pathz[ptFonts] + '/' + Name;
+            if not FileExists(s) then
+                s:= Pathz[ptFonts] + '/' + Name;
             WriteToConsole(msgLoading + s + ' (' + inttostr(Height) + 'pt)... ');
             Handle:= TTF_OpenFont(Str2PChar(s), Height);
             SDLTry(Handle <> nil, true);
@@ -274,7 +318,6 @@ if not reload then
             WriteLnToConsole(msgOK)
             end;
 
-WriteNames(fnt16);
 MakeCrossHairs;
 LoadGraves;
 if not reload then
@@ -289,35 +332,19 @@ for ii:= Low(TSprite) to High(TSprite) do
            (((cReducedQuality and rqKillFlakes) = 0) or (Theme = 'Snow') or (Theme = 'Christmas') or ((not (ii in [sprFlake, sprSDFlake])))) and
            ((cCloudsNumber > 0) or (ii <> sprCloud)) and
            ((vobCount > 0) or (ii <> sprFlake)) then
-        begin
-            if AltPath = ptNone then
-                if ii in [sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, sprChunk] then // FIXME: hack
-                    begin
-                    if not reload then
-                        begin
-                        tmpsurf:= LoadImage(UserPathz[Path] + '/' + FileName, ifAlpha or ifTransparent);
-                        if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent)
-                        end
-                    else tmpsurf:= Surface
-                    end
-                else
-                    begin
-                    if not reload then
-                        begin
-                        tmpsurf:= LoadImage(UserPathz[Path] + '/' + FileName, ifAlpha or ifTransparent);
-                        if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent or ifCritical)
-                        end
-                    else tmpsurf:= Surface
-                    end
-            else begin
-                if not reload then
-                    begin
-                    tmpsurf:= LoadImage(UserPathz[Path] + '/' + FileName, ifAlpha or ifTransparent);
-                    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, ifAlpha or ifTransparent);
-                    if tmpsurf = nil then tmpsurf:= LoadImage(UserPathz[AltPath] + '/' + FileName, ifAlpha or ifTransparent);
-                    if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[AltPath] + '/' + FileName, ifAlpha or ifCritical or ifTransparent)
-                    end
-                else tmpsurf:= Surface
+            begin
+            if reload then
+                tmpsurf:= Surface
+            else
+                begin
+                imflags := (ifAlpha or ifTransparent);
+
+                // these sprites are optional
+                if not (ii in [sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR, sprChunk]) then // FIXME: hack
+                    imflags := (imflags or ifCritical);
+
+                // load the image
+                tmpsurf := LoadDataImageAltPath(Path, AltPath, FileName, imflags)
                 end;
 
             if tmpsurf <> nil then
@@ -348,10 +375,13 @@ for ii:= Low(TSprite) to High(TSprite) do
 // This should maybe be flagged. It wastes quite a bit of memory.
                 if not reload then
                     begin
-{$IF DEFINED(DARWIN) OR DEFINED(WIN32)}
+{$IFDEF USE_CONTEXT_RESTORE}
                     Surface:= tmpsurf 
 {$ELSE}
-                    if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf)
+                    if saveSurf then
+                        Surface:= tmpsurf
+                    else
+                        SDL_FreeSurface(tmpsurf)
 {$ENDIF}
                     end
                 end
@@ -359,11 +389,13 @@ for ii:= Low(TSprite) to High(TSprite) do
                 Surface:= nil
         end;
 
+WriteNames(fnt16);
+
 if not reload then
     AddProgress;
 
-tmpsurf:= LoadImage(UserPathz[ptGraphics] + '/' + cHHFileName, ifAlpha or ifTransparent);
-if tmpsurf = nil then tmpsurf:= LoadImage(Pathz[ptGraphics] + '/' + cHHFileName, ifAlpha or ifCritical or ifTransparent);
+tmpsurf:= LoadDataImage(ptGraphics, cHHFileName, ifAlpha or ifCritical or ifTransparent);
+
 HHTexture:= Surface2Tex(tmpsurf, false);
 SDL_FreeSurface(tmpsurf);
 
@@ -391,63 +423,88 @@ for ai:= Low(TAmmoType) to High(TAmmoType) do
 
 // number of weapons in ammo menu
 for i:= Low(CountTexz) to High(CountTexz) do
-begin
+    begin
     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(IntToStr(i) + 'x'), cWhiteColorChannels);
     tmpsurf:= doSurfaceConversion(tmpsurf);
     FreeTexture(CountTexz[i]);
     CountTexz[i]:= Surface2Tex(tmpsurf, false);
     SDL_FreeSurface(tmpsurf)
-end;
+    end;
 
 if not reload then
     AddProgress;
 IMG_Quit();
 end;
 
+{$IF NOT DEFINED(S3D_DISABLED) OR DEFINED(USE_VIDEO_RECORDING)}
+procedure CreateFramebuffer(var frame, depth, tex: GLuint);
+begin
+    glGenFramebuffersEXT(1, @frame);
+    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frame);
+    glGenRenderbuffersEXT(1, @depth);
+    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth);
+    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight);
+    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth);
+    glGenTextures(1, @tex);
+    glBindTexture(GL_TEXTURE_2D, tex);
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,  cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0);
+end;
+
+procedure DeleteFramebuffer(var frame, depth, tex: GLuint);
+begin
+    glDeleteTextures(1, @tex);
+    glDeleteRenderbuffersEXT(1, @depth);
+    glDeleteFramebuffersEXT(1, @frame);
+end;
+{$ENDIF}
+
 procedure StoreRelease(reload: boolean);
 var ii: TSprite;
     ai: TAmmoType;
     i, t: LongInt;
 begin
-    for ii:= Low(TSprite) to High(TSprite) do
-        begin
-        FreeTexture(SpritesData[ii].Texture);
-        SpritesData[ii].Texture:= nil;
-        if (SpritesData[ii].Surface <> nil) and not reload then
-            begin
-            SDL_FreeSurface(SpritesData[ii].Surface);
-            SpritesData[ii].Surface:= nil
-            end
-        end;
-    SDL_FreeSurface(MissionIcons);
-
-    // free the textures declared in uVariables
-    FreeTexture(WeaponTooltipTex);
-    WeaponTooltipTex:= nil;
-    FreeTexture(PauseTexture);
-    PauseTexture:= nil;
-    FreeTexture(SyncTexture);
-    SyncTexture:= nil;
-    FreeTexture(ConfirmTexture);
-    ConfirmTexture:= nil;
-    FreeTexture(ropeIconTex);
-    ropeIconTex:= nil;
-    FreeTexture(HHTexture);
-    HHTexture:= nil;
-
-    // free all ammo name textures
-    for ai:= Low(TAmmoType) to High(TAmmoType) do
+for ii:= Low(TSprite) to High(TSprite) do
+    begin
+    FreeTexture(SpritesData[ii].Texture);
+    SpritesData[ii].Texture:= nil;
+    if (SpritesData[ii].Surface <> nil) and (not reload) then
         begin
-        FreeTexture(Ammoz[ai].NameTex);
-        Ammoz[ai].NameTex:= nil
-        end;
+        SDL_FreeSurface(SpritesData[ii].Surface);
+        SpritesData[ii].Surface:= nil
+        end
+    end;
+SDL_FreeSurface(MissionIcons);
 
-    // free all count textures
-    for i:= Low(CountTexz) to High(CountTexz) do
-        begin
-        FreeTexture(CountTexz[i]);
-        CountTexz[i]:= nil
-        end;
+// free the textures declared in uVariables
+FreeTexture(WeaponTooltipTex);
+WeaponTooltipTex:= nil;
+FreeTexture(PauseTexture);
+PauseTexture:= nil;
+FreeTexture(SyncTexture);
+SyncTexture:= nil;
+FreeTexture(ConfirmTexture);
+ConfirmTexture:= nil;
+FreeTexture(ropeIconTex);
+ropeIconTex:= nil;
+FreeTexture(HHTexture);
+HHTexture:= nil;
+
+// free all ammo name textures
+for ai:= Low(TAmmoType) to High(TAmmoType) do
+    begin
+    FreeTexture(Ammoz[ai].NameTex);
+    Ammoz[ai].NameTex:= nil
+    end;
+
+// free all count textures
+for i:= Low(CountTexz) to High(CountTexz) do
+    begin
+    FreeTexture(CountTexz[i]);
+    CountTexz[i]:= nil
+    end;
 
     // free all team and hedgehog textures
     for t:= 0 to Pred(TeamsCount) do
@@ -477,15 +534,15 @@ begin
                 end;
             end;
         end;
+{$IFDEF USE_VIDEO_RECORDING}
+    if defaultFrame <> 0 then
+        DeleteFramebuffer(defaultFrame, depthv, texv);
+{$ENDIF}
 {$IFNDEF S3D_DISABLED}
     if (cStereoMode = smHorizontal) or (cStereoMode = smVertical) or (cStereoMode = smAFR) then
         begin
-        glDeleteTextures(1, @texl);
-        glDeleteRenderbuffersEXT(1, @depthl);
-        glDeleteFramebuffersEXT(1, @framel);
-        glDeleteTextures(1, @texr);
-        glDeleteRenderbuffersEXT(1, @depthr);
-        glDeleteFramebuffersEXT(1, @framer)
+        DeleteFramebuffer(framel, depthl, texl);
+        DeleteFramebuffer(framer, depthr, texr);
         end
 {$ENDIF}
 end;
@@ -494,32 +551,34 @@ end;
 procedure RenderHealth(var Hedgehog: THedgehog);
 var s: shortstring;
 begin
-    str(Hedgehog.Gear^.Health, s);
-    FreeTexture(Hedgehog.HealthTagTex);
-    Hedgehog.HealthTagTex:= RenderStringTex(s, Hedgehog.Team^.Clan^.Color, fnt16)
+str(Hedgehog.Gear^.Health, s);
+FreeTexture(Hedgehog.HealthTagTex);
+Hedgehog.HealthTagTex:= RenderStringTex(s, Hedgehog.Team^.Clan^.Color, fnt16)
 end;
 
-function  LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
+function LoadImage(const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
 var tmpsurf: PSDL_Surface;
     s: shortstring;
 begin
+    LoadImage:= nil;
     WriteToConsole(msgLoading + filename + '.png [flags: ' + inttostr(imageFlags) + '] ');
 
     s:= filename + '.png';
     tmpsurf:= IMG_Load(Str2PChar(s));
 
     if tmpsurf = nil then
-        begin
+    begin
         OutError(msgFailed, (imageFlags and ifCritical) <> 0);
-        exit(nil)
-        end;
+        exit;
+    end;
 
     if ((imageFlags and ifIgnoreCaps) = 0) and ((tmpsurf^.w > MaxTextureSize) or (tmpsurf^.h > MaxTextureSize)) then
     begin
         SDL_FreeSurface(tmpsurf);
         OutError(msgFailedSize, (imageFlags and ifCritical) <> 0);
         // dummy surface to replace non-critical textures that failed to load due to their size
-        exit(SDL_CreateRGBSurface(SDL_SWSURFACE, 2, 2, 32, RMask, GMask, BMask, AMask));
+        LoadImage:= SDL_CreateRGBSurface(SDL_SWSURFACE, 2, 2, 32, RMask, GMask, BMask, AMask);
+        exit;
     end;
 
     tmpsurf:= doSurfaceConversion(tmpsurf);
@@ -532,20 +591,69 @@ begin
     LoadImage:= tmpsurf //Result
 end;
 
-procedure LoadHedgehogHat(HHGear: PGear; newHat: shortstring);
-var texsurf: PSDL_Surface;
+
+function LoadDataImage(const path: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
+var tmpsurf: PSDL_Surface;
+begin
+    // check for file in user dir (never critical)
+    tmpsurf:= LoadImage(UserPathz[path] + '/' + filename, imageFlags and (not ifCritical));
+
+    // if unsuccessful check data dir
+    if (tmpsurf = nil) then
+        tmpsurf:= LoadImage(Pathz[path] + '/' + filename, imageFlags);
+
+    LoadDataImage:= tmpsurf;
+end;
+
+
+function LoadDataImageAltPath(const path, altPath: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface;
+var tmpsurf: PSDL_Surface;
 begin
-    texsurf:= LoadImage(UserPathz[ptHats] + '/' + newHat, ifNone);
-    if texsurf = nil then texsurf:= LoadImage(Pathz[ptHats] + '/' + newHat, ifNone);
+    // if there is no alternative path, just forward and return result
+    if (altPath = ptNone) then
+        exit(LoadDataImage(path, filename, imageFlags));
 
+    // since we have a fallback path this search isn't critical yet
+    tmpsurf:= LoadDataImage(path, filename, imageFlags and (not ifCritical));
+
+    // if image still not found try alternative path
+    if (tmpsurf = nil) then
+        tmpsurf:= LoadDataImage(altPath, filename, imageFlags);
+
+    LoadDataImageAltPath:= tmpsurf;
+end;
+
+function LoadDataImageAltFile(const path: TPathType; const filename, altFile: shortstring; imageFlags: LongInt): PSDL_Surface;
+var tmpsurf: PSDL_Surface;
+begin
+    // if there is no alternative filename, just forward and return result
+    if (altFile = '') then
+        exit(LoadDataImage(path, filename, imageFlags));
+
+    // since we have a fallback filename this search isn't critical yet
+    tmpsurf:= LoadDataImage(path, filename, imageFlags and (not ifCritical));
+
+    // if image still not found try alternative filename
+    if (tmpsurf = nil) then
+        tmpsurf:= LoadDataImage(path, altFile, imageFlags);
+
+    LoadDataImageAltFile:= tmpsurf;
+end;
+
+procedure LoadHedgehogHat(var HH: THedgehog; newHat: shortstring);
+var texsurf: PSDL_Surface;
+begin
+    texsurf:= LoadDataImage(ptHats, newHat, ifNone);
+AddFileLog('Hat => '+newHat);
     // only do something if the hat could be loaded
     if texsurf <> nil then
         begin
+AddFileLog('Got Hat');
         // free the mem of any previously assigned texture
-        FreeTexture(HHGear^.Hedgehog^.HatTex);
+        FreeTexture(HH.HatTex);
 
         // assign new hat to hedgehog
-        HHGear^.Hedgehog^.HatTex:= Surface2Tex(texsurf, true);
+        HH.HatTex:= Surface2Tex(texsurf, true);
 
         // cleanup: free temporary surface mem
         SDL_FreeSurface(texsurf)
@@ -591,14 +699,23 @@ end;
 procedure SetupOpenGL;
 //var vendor: shortstring = '';
 var buf: array[byte] of char;
+{$IFDEF USE_VIDEO_RECORDING}
+    AuxBufNum: LongInt;
+{$ENDIF}
+    tmpstr: AnsiString;
+    tmpint: LongInt;
+    tmpn: LongInt;
 begin
     buf[0]:= char(0); // avoid compiler hint
     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
 
 {$IFDEF SDL13}
     // this function creates an opengles1.1 context by default on mobile devices
-    // use SDL_GL_SetAttribute to change this behaviour
-    SDLGLcontext:=SDL_GL_CreateContext(SDLwindow);
+    // unless you un-comment this two attributes
+    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
+    //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
+    if SDLGLcontext = nil then
+        SDLGLcontext:= SDL_GL_CreateContext(SDLwindow);
     SDLTry(SDLGLcontext <> nil, true);
     SDL_GL_SetSwapInterval(1);
 {$ENDIF}
@@ -638,60 +755,84 @@ begin
     AddFileLog('OpenGL-- Renderer: ' + shortstring(pchar(glGetString(GL_RENDERER))));
     AddFileLog('  |----- Vendor: ' + shortstring(pchar(glGetString(GL_VENDOR))));
     AddFileLog('  |----- Version: ' + shortstring(pchar(glGetString(GL_VERSION))));
-    AddFileLog('  \----- Texture Size: ' + inttostr(MaxTextureSize));
+    AddFileLog('  |----- Texture Size: ' + inttostr(MaxTextureSize));
+{$IFDEF USE_VIDEO_RECORDING}
+    glGetIntegerv(GL_AUX_BUFFERS, @AuxBufNum);
+    AddFileLog('  |----- Number of auxiliary buffers: ' + inttostr(AuxBufNum));
+{$ENDIF}
+    AddFileLog('  \----- Extensions: ');
+{$IFNDEF PAS2C}
+    // fetch extentions and store them in string
+    tmpstr := StrPas(PChar(glGetString(GL_EXTENSIONS)));
+    tmpn := WordCount(tmpstr, [' ']);
+    tmpint := 1;
+
+    repeat
+    begin
+        // print up to 3 extentions per row
+        // ExtractWord will return empty string if index out of range
+        AddFileLog(TrimRight(
+            ExtractWord(tmpint, tmpstr, [' ']) + ' ' +
+            ExtractWord(tmpint+1, tmpstr, [' ']) + ' ' +
+            ExtractWord(tmpint+2, tmpstr, [' '])
+        ));
+        tmpint := tmpint + 3;
+    end;
+    until (tmpint > tmpn);
+{$ELSE}
+    // doesn't seem to print >256 chars
+    AddFileLogRaw(PChar(glGetString(GL_EXTENSIONS)));
+{$ENDIF}
+    AddFileLog('');
+
+    defaultFrame:= 0;
+{$IFDEF USE_VIDEO_RECORDING}
+    if GameType = gmtRecord then
+    begin
+        if glLoadExtension('GL_EXT_framebuffer_object') then
+        begin
+            CreateFramebuffer(defaultFrame, depthv, texv);
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, defaultFrame);
+            AddFileLog('Using framebuffer for video recording.');
+        end
+        else if AuxBufNum > 0 then
+        begin
+            glDrawBuffer(GL_AUX0);
+            glReadBuffer(GL_AUX0);
+            AddFileLog('Using auxiliary buffer for video recording.');
+        end
+        else
+        begin
+            glDrawBuffer(GL_BACK);
+            glReadBuffer(GL_BACK);
+            AddFileLog('Warning: off-screen rendering is not supported; using back buffer but it may not work.');
+        end;
+    end;
+{$ENDIF}
 
 {$IFNDEF S3D_DISABLED}
     if (cStereoMode = smHorizontal) or (cStereoMode = smVertical) or (cStereoMode = smAFR) then
     begin
         // prepare left and right frame buffers and associated textures
         if glLoadExtension('GL_EXT_framebuffer_object') then
-        begin
-            // left
-            glGenFramebuffersEXT(1, @framel);
-            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framel);
-            glGenRenderbuffersEXT(1, @depthl);
-            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthl);
-            glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight);
-            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthl);
-            glGenTextures(1, @texl);
-            glBindTexture(GL_TEXTURE_2D, texl);
-            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,  cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);
-            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-            glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texl, 0);
-
-            // right
-            glGenFramebuffersEXT(1, @framer);
-            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framer);
-            glGenRenderbuffersEXT(1, @depthr);
-            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthr);
-            glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight);
-            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthr);
-            glGenTextures(1, @texr);
-            glBindTexture(GL_TEXTURE_2D, texr);
-            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,  cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);
-            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-            glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texr, 0);
+            begin
+            CreateFramebuffer(framel, depthl, texl);
+            CreateFramebuffer(framer, depthr, texr);
 
             // reset
-            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)
-        end
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, defaultFrame)
+            end
         else
             cStereoMode:= smNone;
     end;
 {$ENDIF}
 
     // set view port to whole window
-    if (rotationQt = 0) or (rotationQt = 180) then
-        glViewport(0, 0, cScreenWidth, cScreenHeight)
-    else
-        glViewport(0, 0, cScreenHeight, cScreenWidth);
+    glViewport(0, 0, cScreenWidth, cScreenHeight);
 
     glMatrixMode(GL_MODELVIEW);
     // prepare default translation/scaling
     glLoadIdentity();
-    glRotatef(rotationQt, 0, 0, 1);
     glScalef(2.0 / cScreenWidth, -2.0 / cScreenHeight, 1.0);
     glTranslatef(0, -cScreenHeight / 2, 0);
 
@@ -710,19 +851,19 @@ end;
 
 procedure SetScale(f: GLfloat);
 begin
-    // leave immediately if scale factor did not change
-    if f = cScaleFactor then exit;
+// leave immediately if scale factor did not change
+    if f = cScaleFactor then
+        exit;
 
     if f = cDefaultZoomLevel then
         glPopMatrix         // "return" to default scaling
     else                    // other scaling
-    begin
+        begin
         glPushMatrix;       // save default scaling
         glLoadIdentity;
-        glRotatef(rotationQt, 0, 0, 1);
         glScalef(f / cScreenWidth, -f / cScreenHeight, 1.0);
         glTranslatef(0, -cScreenHeight / 2, 0);
-    end;
+        end;
 
     cScaleFactor:= f;
 end;
@@ -735,8 +876,7 @@ begin
     if Step = 0 then
     begin
         WriteToConsole(msgLoading + 'progress sprite: ');
-        texsurf:= LoadImage(UserPathz[ptGraphics] + '/Progress', ifTransparent);
-        if texsurf = nil then texsurf:= LoadImage(Pathz[ptGraphics] + '/Progress', ifCritical or ifTransparent);
+        texsurf:= LoadDataImage(ptGraphics, 'Progress', ifCritical or ifTransparent);
 
         ProgrTex:= Surface2Tex(texsurf, false);
 
@@ -745,25 +885,23 @@ begin
         SDL_FreeSurface(texsurf);
 
         uMobile.GameLoading();
-    end;
+        end;
 
     TryDo(ProgrTex <> nil, 'Error - Progress Texure is nil!', true);
 
     glClear(GL_COLOR_BUFFER_BIT);
-    if Step < numsquares then r.x:= 0
-    else r.x:= squaresize;
+    if Step < numsquares then
+        r.x:= 0
+    else
+        r.x:= squaresize;
 
     r.y:= (Step mod numsquares) * squaresize;
     r.w:= squaresize;
     r.h:= squaresize;
 
-    DrawFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex);
+    DrawTextureFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex);
 
-{$IFDEF SDL13}
-    SDL_GL_SwapWindow(SDLwindow);
-{$ELSE}
-    SDL_GL_SwapBuffers();
-{$ENDIF}
+    SwapBuffers;
     inc(Step);
 end;
 
@@ -785,8 +923,10 @@ var tmpsurf: PSDL_SURFACE;
     tmpline, tmpline2, tmpdesc: ansistring;
 begin
 // make sure there is a caption as well as a sub caption - description is optional
-if caption = '' then caption:= '???';
-if subcaption = '' then subcaption:= ' ';
+if caption = '' then
+    caption:= '???';
+if subcaption = '' then
+    subcaption:= _S' ';
 
 font:= CheckCJKFont(caption,fnt16);
 font:= CheckCJKFont(subcaption,font);
@@ -795,8 +935,8 @@ font:= CheckCJKFont(extra,font);
 
 w:= 0;
 h:= 0;
-wa:= FontBorder * 2 + 4;
-ha:= FontBorder * 2;
+wa:= cFontBorder * 2 + 4;
+ha:= cFontBorder * 2;
 
 i:= 0; j:= 0; // avoid compiler hints
 
@@ -811,7 +951,8 @@ h:= j + ha;
 // get sub caption's dimensions
 TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(subcaption), @i, @j);
 // width adds 36 px (image + space)
-if w < (i + 36 + wa) then w:= i + 36 + wa;
+if w < (i + 36 + wa) then
+    w:= i + 36 + wa;
 inc(h, j + ha);
 
 // get description's dimensions
@@ -823,7 +964,8 @@ while tmpdesc <> '' do
     if tmpline <> '' then
         begin
         TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(tmpline), @i, @j);
-        if w < (i + wa) then w:= i + wa;
+        if w < (i + wa) then
+            w:= i + wa;
         inc(h, j + ha)
         end
     end;
@@ -832,7 +974,8 @@ if extra <> '' then
     begin
     // get extra label's dimensions
     TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(extra), @i, @j);
-    if w < (i + wa) then w:= i + wa;
+    if w < (i + wa) then
+        w:= i + wa;
     inc(h, j + ha);
     end;
 
@@ -851,9 +994,9 @@ r.h:= h;
 DrawRoundRect(@r, cWhiteColor, cNearBlackColor, tmpsurf, true);
 
 // render caption
-r:= WriteInRect(tmpsurf, 36 + FontBorder + 2, ha, $ffffffff, font, caption);
+r:= WriteInRect(tmpsurf, 36 + cFontBorder + 2, ha, $ffffffff, font, caption);
 // render sub caption
-r:= WriteInRect(tmpsurf, 36 + FontBorder + 2, r.y + r.h, $ffc7c7c7, font, subcaption);
+r:= WriteInRect(tmpsurf, 36 + cFontBorder + 2, r.y + r.h, $ffc7c7c7, font, subcaption);
 
 // render all description lines
 tmpdesc:= description;
@@ -864,21 +1007,21 @@ while tmpdesc <> '' do
     r2:= r;
     if tmpline <> '' then
         begin
-        r:= WriteInRect(tmpsurf, FontBorder + 2, r.y + r.h, $ff707070, font, tmpline);
+        r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, $ff707070, font, tmpline);
 
         // render highlighted caption (if there is a ':')
-        tmpline2:= '';
+        tmpline2:= _S'';
         SplitByChar(tmpline, tmpline2, ':');
-        if tmpline2 <> '' then
-            WriteInRect(tmpsurf, FontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, tmpline + ':');
+        if tmpline2 <> _S'' then
+            WriteInRect(tmpsurf, cFontBorder + 2, r2.y + r2.h, $ffc7c7c7, font, tmpline + ':');
         end
     end;
 
 if extra <> '' then
-    r:= WriteInRect(tmpsurf, FontBorder + 2, r.y + r.h, extracolor, font, extra);
+    r:= WriteInRect(tmpsurf, cFontBorder + 2, r.y + r.h, extracolor, font, extra);
 
-r.x:= FontBorder + 6;
-r.y:= FontBorder + 4;
+r.x:= cFontBorder + 6;
+r.y:= cFontBorder + 4;
 r.w:= 32;
 r.h:= 32;
 SDL_FillRect(tmpsurf, @r, $ffffffff);
@@ -894,12 +1037,12 @@ var r: TSDL_Rect;
     extra: ansistring;
     extracolor: LongInt;
 begin
-    // don't do anything if the window shouldn't be shown
+// don't do anything if the window shouldn't be shown
     if (cReducedQuality and rqTooltipsOff) <> 0 then
-    begin
+        begin
         WeaponTooltipTex:= nil;
         exit
-    end;
+        end;
 
 // free old texture
 FreeWeaponTooltip;
@@ -912,7 +1055,7 @@ r.w:= 32;
 r.h:= 32;
 
 // default (no extra text)
-extra:= '';
+extra:= _S'';
 extracolor:= 0;
 
 if (CurrentTeam <> nil) and (Ammoz[atype].SkipTurns >= CurrentTeam^.Clan^.TurnNumber) then // weapon or utility is not yet available
@@ -927,7 +1070,7 @@ else if (Ammoz[atype].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then // weapon or
     end
 else
     begin
-    extra:= '';
+    extra:= _S'';
     extracolor:= 0;
     end;
 
@@ -949,50 +1092,97 @@ FreeTexture(WeaponTooltipTex);
 WeaponTooltipTex:= nil
 end;
 
+{$IFDEF USE_VIDEO_RECORDING}
+{$IFDEF SDL13}
+procedure InitOffscreenOpenGL;
+begin
+    // create hidden window
+    SDLwindow:= SDL_CreateWindow('hedgewars (you don''t see this)',
+                                 SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK,
+                                 cScreenWidth, cScreenHeight,
+                                 SDL_WINDOW_HIDDEN or SDL_WINDOW_OPENGL);
+    SDLTry(SDLwindow <> nil, true);
+    SetupOpenGL();
+end;
+{$ELSE}
+procedure InitOffscreenOpenGL;
+var ArgCount: LongInt;
+    PrgName: pchar;
+begin
+    ArgCount:= 1;
+    PrgName:= 'hwengine';
+    glutInit(@ArgCount, @PrgName);
+    glutInitWindowSize(cScreenWidth, cScreenHeight);
+    glutCreateWindow('hedgewars (you don''t see this)'); // we don't need a window, but if this function is not called then OpenGL will not be initialized
+    glutHideWindow();
+    glutDisplayFunc(@SwapBuffers); // we don't need a callback, but it's required for GLUT3
+    SetupOpenGL();
+end;
+{$ENDIF} // SDL13
+{$ENDIF} // USE_VIDEO_RECORDING
+
 procedure chFullScr(var s: shortstring);
 var flags: Longword = 0;
     reinit: boolean = false;
     {$IFNDEF DARWIN}ico: PSDL_Surface;{$ENDIF}
     {$IFDEF SDL13}x, y: LongInt;{$ENDIF}
 begin
-    if Length(s) = 0 then cFullScreen:= not cFullScreen
-    else cFullScreen:= s = '1';
+    if Length(s) = 0 then
+        cFullScreen:= (not cFullScreen)
+    else
+        cFullScreen:= s = '1';
 
     AddFileLog('Preparing to change video parameters...');
-{$IFNDEF IPHONEOS}
+{$IFDEF SDL13}
+    if SDLwindow = nil then
+{$ELSE}
     if SDLPrimSurface = nil then
+{$ENDIF}
         begin
         // set window title
-        SDL_WM_SetCaption('Hedgewars', nil);
+        {$IFNDEF SDL13}SDL_WM_SetCaption(_P'Hedgewars', nil);{$ENDIF}
         WriteToConsole('Init SDL_image... ');
         SDLTry(IMG_Init(IMG_INIT_PNG) <> 0, true);
         WriteLnToConsole(msgOK);
         // load engine icon
-{$IFNDEF DARWIN}
-        ico:= LoadImage(UserPathz[ptGraphics] + '/hwengine', ifIgnoreCaps);
-        if ico = nil then ico:= LoadImage(Pathz[ptGraphics] + '/hwengine', ifIgnoreCaps);
+    {$IFNDEF DARWIN}
+        ico:= LoadDataImage(ptGraphics, 'hwengine', ifIgnoreCaps);
         if ico <> nil then
             begin
             SDL_WM_SetIcon(ico, 0);
             SDL_FreeSurface(ico)
             end;
-{$ENDIF}
+    {$ENDIF}
         end
     else
         begin
+        AmmoMenuInvalidated:= true;
+{$IFDEF IPHONEOS}
+        // chFullScr is called when there is a rotation event and needs the SetScale and SetupOpenGL to set up the new resolution
+        // this 6 gl functions are the relevant ones and are hacked together here for optimisation
+        glMatrixMode(GL_MODELVIEW);
+        glPopMatrix;
+        glLoadIdentity();
+        glScalef(2.0 / cScreenWidth, -2.0 / cScreenHeight, 1.0);
+        glTranslatef(0, -cScreenHeight / 2, 0);
+        glViewport(0, 0, cScreenWidth, cScreenHeight);
+        exit;
+{$ELSE}
         SetScale(cDefaultZoomLevel);
-{$IF DEFINED(DARWIN) OR DEFINED(WIN32)}
+     {$IFDEF USE_CONTEXT_RESTORE}
         reinit:= true;
         StoreRelease(true);
         ResetLand;
         ResetWorldTex;
         //uTextures.freeModule; //DEBUG ONLY
-{$ENDIF}
+    {$ENDIF}
         AddFileLog('Freeing old primary surface...');
+    {$IFNDEF SDL13}        
         SDL_FreeSurface(SDLPrimSurface);
         SDLPrimSurface:= nil;
-        end;
+    {$ENDIF}
 {$ENDIF}
+        end;
 
     // these attributes must be set up before creating the sdl window
 {$IFNDEF WIN32}
@@ -1006,20 +1196,21 @@ begin
     // these values in x and y make the window appear in the center
     x:= SDL_WINDOWPOS_CENTERED_MASK;
     y:= SDL_WINDOWPOS_CENTERED_MASK;
-    flags:= SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN;
-
-{$IFDEF IPHONEOS}
-    // make the sdl window appear on the second monitor when present
-    x:= x or (SDL_GetNumVideoDisplays() - 1);
-    y:= y or (SDL_GetNumVideoDisplays() - 1);
+    // SDL_WINDOW_RESIZABLE makes the window respond to rotation events on mobile devices
+    flags:= SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN or SDL_WINDOW_RESIZABLE;
 
-    SDL_SetHint('SDL_IOS_ORIENTATIONS','LandscapeLeft LandscapeRight');
-    flags:= flags or SDL_WINDOW_BORDERLESS or SDL_WINDOW_RESIZABLE;
-{$ENDIF}
+    {$IFDEF MOBILE}
+    if isPhone() then
+        SDL_SetHint('SDL_IOS_ORIENTATIONS','LandscapeLeft LandscapeRight');
+    // no need for borders on mobile devices
+    flags:= flags or SDL_WINDOW_BORDERLESS;
+    {$ENDIF}
 
     if SDLwindow = nil then
-        if cFullScreen then SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN)
-        else SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags);
+        if cFullScreen then
+            SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN)
+        else
+            SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags);
     SDLTry(SDLwindow <> nil, true);
 {$ELSE}
     flags:= SDL_OPENGL or SDL_RESIZABLE;
@@ -1028,13 +1219,13 @@ begin
 
     if not cOnlyStats then
         begin
-{$IFDEF WIN32}
+    {$IFDEF WIN32}
         s:= SDL_getenv('SDL_VIDEO_CENTERED');
         SDL_putenv('SDL_VIDEO_CENTERED=1');
-{$ENDIF}
+    {$ENDIF}
         SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
         SDLTry(SDLPrimSurface <> nil, true);
-{$IFDEF WIN32}SDL_putenv(str2pchar('SDL_VIDEO_CENTERED=' + s));{$ENDIF}
+    {$IFDEF WIN32}SDL_putenv(str2pchar('SDL_VIDEO_CENTERED=' + s));{$ENDIF}
         end;
 {$ENDIF}
 
@@ -1044,17 +1235,18 @@ begin
         // clean the window from any previous content
         glClear(GL_COLOR_BUFFER_BIT);
         if SuddenDeathDmg then
-             glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99)
+            glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99)
         else if ((cReducedQuality and rqNoBackground) = 0) then 
-             glClearColor(SkyColor.r / 255, SkyColor.g / 255, SkyColor.b / 255, 0.99)
-        else glClearColor(RQSkyColor.r / 255, RQSkyColor.g / 255, RQSkyColor.b / 255, 0.99);
+            glClearColor(SkyColor.r / 255, SkyColor.g / 255, SkyColor.b / 255, 0.99)
+        else
+            glClearColor(RQSkyColor.r / 255, RQSkyColor.g / 255, RQSkyColor.b / 255, 0.99);
 
         // reload everything we had before
         ReloadCaptions(false);
         ReloadLines;
         StoreLoad(true);
         // redraw all land
-        UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT);
+        UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
         end;
 end;
 
@@ -1062,16 +1254,12 @@ procedure initModule;
 var ai: TAmmoType;
     i: LongInt;
 begin
-    RegisterVariable('fullscr', vtCommand, @chFullScr, true);
+    RegisterVariable('fullscr', @chFullScr, true);
 
-    SDLPrimSurface:= nil;
-
-    rotationQt:= 0;
     cScaleFactor:= 2.0;
     Step:= 0;
     ProgrTex:= nil;
     SupportNPOTT:= false;
-//    cGPUVendor:= gvUnknown;
 
     // init all ammo name texture pointers
     for ai:= Low(TAmmoType) to High(TAmmoType) do
@@ -1081,10 +1269,43 @@ begin
     // init all count texture pointers
     for i:= Low(CountTexz) to High(CountTexz) do
         CountTexz[i] := nil;
+{$IFDEF SDL13}
+    SDLwindow:= nil;
+    SDLGLcontext:= nil;
+{$ELSE}
+    SDLPrimSurface:= nil;
+{$ENDIF}
 end;
 
 procedure freeModule;
 begin
+    StoreRelease(false);
+    TTF_Quit();
+{$IFDEF SDL13}
+    SDL_GL_DeleteContext(SDLGLcontext);
+    SDL_DestroyWindow(SDLwindow);
+{$ENDIF}
+    SDL_Quit();
+end;
+
+procedure WarpMouse(x, y: Word); inline;
+begin
+{$IFDEF SDL13}
+    SDL_WarpMouseInWindow(SDLwindow, x, y);
+{$ELSE}
+    x:= x; y:= y; // avoid hints
+{$ENDIF}
+end;
+
+procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF};
+begin
+    if GameType = gmtRecord then
+        exit;
+{$IFDEF SDL13}
+    SDL_GL_SwapWindow(SDLwindow);
+{$ELSE}
+    SDL_GL_SwapBuffers();
+{$ENDIF}
 end;
 
 end.
diff --git a/hedgewars/uTeams.pas b/hedgewars/uTeams.pas
index fb43a6d..223734f 100644
--- a/hedgewars/uTeams.pas
+++ b/hedgewars/uTeams.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -20,7 +20,10 @@
 
 unit uTeams;
 interface
-uses uConsts, uKeys, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit, uSound, uTypes;
+uses uConsts, uInputHandler, uGears, uRandom, uFloat, uStats, uVisualGears, uCollisions, GLunit,
+     uSound, uStore, uTypes
+     {$IFDEF USE_TOUCH_INTERFACE}, uWorld{$ENDIF};
+
 
 procedure initModule;
 procedure freeModule;
@@ -34,17 +37,22 @@ procedure RecountTeamHealth(team: PTeam);
 procedure RestoreTeamsFromSave;
 function  CheckForWin: boolean;
 procedure TeamGoneEffect(var Team: TTeam);
+procedure SwitchCurrentHedgehog(newHog: PHedgehog);
 
 implementation
-uses uLocale, uAmmos, uChat, uMobile, uVariables, uUtils, uIO, uCaptions, uCommands, uDebug, uScript;
+uses uLocale, uAmmos, uChat, uVariables, uUtils, uIO, uCaptions, uCommands, uDebug, uScript,
+    uGearsUtils, uGearsList
+    {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF};
 
-const MaxTeamHealth: LongInt = 0;
+var MaxTeamHealth: LongInt;
+    GameOver: boolean;
 
 function CheckForWin: boolean;
 var AliveClan: PClan;
     s: shortstring;
     t, AliveCount, i, j: LongInt;
 begin
+CheckForWin:= false;
 AliveCount:= 0;
 for t:= 0 to Pred(ClansCount) do
     if ClansArray[t]^.ClanHealth > 0 then
@@ -53,12 +61,17 @@ for t:= 0 to Pred(ClansCount) do
         AliveClan:= ClansArray[t]
         end;
 
-if (AliveCount > 1)
-or ((AliveCount = 1) and ((GameFlags and gfOneClanMode) <> 0)) then exit(false);
+if (AliveCount > 1) or ((AliveCount = 1) and ((GameFlags and gfOneClanMode) <> 0)) then
+    exit;
 CheckForWin:= true;
 
 TurnTimeLeft:= 0;
 ReadyTimeLeft:= 0;
+
+// if the game ends during a multishot, do last TurnReaction
+if (not bBetweenTurns) and isInMultiShoot then
+    TurnReaction();
+
 if not GameOver then
     begin
     if AliveCount = 0 then
@@ -66,7 +79,8 @@ if not GameOver then
         AddCaption(trmsg[sidDraw], cWhiteColor, capgrpGameState);
         SendStat(siGameResult, trmsg[sidDraw]);
         AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000)
-        end else // win
+        end
+    else // win
         with AliveClan^ do
             begin
             if TeamsNumber = 1 then
@@ -108,7 +122,8 @@ with CurrentHedgehog^ do
            begin
            DeleteCI(Gear);
            FindPlace(Gear, false, 0, LAND_WIDTH);
-           if Gear <> nil then AddGearCI(Gear)
+           if Gear <> nil then
+               AddGearCI(Gear)
            end
         end;
 
@@ -133,7 +148,8 @@ with CurrentTeam^ do
         repeat
             begin
             inc(c);
-            if c > cMaxHHIndex then c:= 0
+            if c > cMaxHHIndex then
+                c:= 0
             end
         until (c = CurrHedgehog) or (Hedgehogs[c].Gear <> nil);
         LocalAmmo:= Hedgehogs[c].AmmoStore
@@ -142,7 +158,7 @@ with CurrentTeam^ do
 c:= CurrentTeam^.Clan^.ClanIndex;
 repeat
     with ClansArray[c]^ do
-        if (CurrTeam = TagTeamIndex) and ((GameFlags And gfTagTeam) <> 0) then
+        if (CurrTeam = TagTeamIndex) and ((GameFlags and gfTagTeam) <> 0) then
             begin
             TagTeamIndex:= Pred(TagTeamIndex) mod TeamsNumber;
             CurrTeam:= Pred(CurrTeam) mod TeamsNumber;
@@ -150,11 +166,13 @@ repeat
             NextClan:= true;
             end;
 
-    if (GameFlags And gfTagTeam) = 0 then inc(c);
+    if (GameFlags and gfTagTeam) = 0 then
+        inc(c);
 
     if c = ClansCount then
         begin
-        if not PlacingHogs then inc(TotalRounds);
+        if not PlacingHogs then
+            inc(TotalRounds);
         c:= 0
         end;
 
@@ -171,38 +189,59 @@ repeat
                     CurrHedgehog:= Succ(CurrHedgehog) mod HedgehogsNumber;
                 until (Hedgehogs[CurrHedgehog].Gear <> nil) or (CurrHedgehog = PrevHH)
                 end
-        until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (PrevTeam = CurrTeam) or ((CurrTeam = TagTeamIndex) and ((GameFlags And gfTagTeam) <> 0));
+        until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (PrevTeam = CurrTeam) or ((CurrTeam = TagTeamIndex) and ((GameFlags and gfTagTeam) <> 0));
         end
 until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil);
 
-CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+SwitchCurrentHedgehog(@(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]));
+{$IFDEF USE_TOUCH_INTERFACE}
+if (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
+    begin
+    if not(arrowUp.show) then
+        begin
+        animateWidget(@arrowUp, true, true);
+        animateWidget(@arrowDown, true, true);
+        end;
+    end
+else
+    if arrowUp.show then
+        begin
+        animateWidget(@arrowUp, true, false);
+        animateWidget(@arrowDown, true, false);
+        end;
+{$ENDIF}
+AmmoMenuInvalidated:= true;
 end;
 
 procedure AfterSwitchHedgehog;
 var i, t: LongInt;
     CurWeapon: PAmmo;
+    w: real;
+    vg: PVisualGear;
 
 begin
 if PlacingHogs then
-   begin
-   PlacingHogs:= false;
-   for t:= 0 to Pred(TeamsCount) do
-      for i:= 0 to cMaxHHIndex do
-          if (TeamsArray[t]^.Hedgehogs[i].Gear <> nil) and (TeamsArray[t]^.Hedgehogs[i].Unplaced) then
-             PlacingHogs:= true;
-
-   if not PlacingHogs then // Reset  various things I mucked with
-      begin
-      for i:= 0 to ClansCount do
-         if ClansArray[i] <> nil then ClansArray[i]^.TurnNumber:= 0;
-      ResetWeapons
-      end
-   end;
+    begin
+    PlacingHogs:= false;
+    for t:= 0 to Pred(TeamsCount) do
+        for i:= 0 to cMaxHHIndex do
+            if (TeamsArray[t]^.Hedgehogs[i].Gear <> nil) and (TeamsArray[t]^.Hedgehogs[i].Unplaced) then
+                PlacingHogs:= true;
+
+    if not PlacingHogs then // Reset  various things I mucked with
+        begin
+        for i:= 0 to ClansCount do
+            if ClansArray[i] <> nil then
+                ClansArray[i]^.TurnNumber:= 0;
+        ResetWeapons
+        end
+    end;
 
 inc(CurrentTeam^.Clan^.TurnNumber);
 
-CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
-if CurWeapon^.Count = 0 then CurrentHedgehog^.CurAmmoType:= amNothing;
+CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
+if CurWeapon^.Count = 0 then
+    CurrentHedgehog^.CurAmmoType:= amNothing;
 
 with CurrentHedgehog^ do
     begin
@@ -211,6 +250,7 @@ with CurrentHedgehog^ do
         Z:= cCurrHHZ;
         State:= gstHHDriven;
         Active:= true;
+        Power:= 0;
         LastDamage:= nil
         end;
     RemoveGearFromList(Gear);
@@ -218,34 +258,32 @@ with CurrentHedgehog^ do
     FollowGear:= Gear
     end;
 
-ResetKbd;
-
 if (GameFlags and gfDisableWind) = 0 then
     begin
-    cWindSpeed:= rndSign(GetRandom * 2 * cMaxWindSpeed);
-    // cWindSpeedf:= cWindSpeed.QWordValue / _1.QWordValue throws 'Internal error 200502052' on Darwin
-    // see http://mantis.freepascal.org/view.php?id=17714
-    cWindSpeedf:= SignAs(cWindSpeed,cWindSpeed).QWordValue / SignAs(_1,_1).QWordValue;
-    if cWindSpeed.isNegative then
-        CWindSpeedf := -cWindSpeedf;
-    AddVisualGear(0, 0, vgtSmoothWindBar);
+    cWindSpeed:= rndSign(GetRandomf * 2 * cMaxWindSpeed);
+    w:= hwFloat2Float(cWindSpeed);
+    vg:= AddVisualGear(0, 0, vgtSmoothWindBar);
+    if vg <> nil then vg^.dAngle:= w;
     AddFileLog('Wind = '+FloatToStr(cWindSpeed));
     end;
 
 ApplyAmmoChanges(CurrentHedgehog^);
 
-if (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then SetBinds(CurrentTeam^.Binds);
+if (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
+    SetBinds(CurrentTeam^.Binds);
 
 bShowFinger:= true;
 
 if PlacingHogs then
     begin
-    if CurrentHedgehog^.Unplaced then TurnTimeLeft:= 15000
+    if CurrentHedgehog^.Unplaced then
+        TurnTimeLeft:= 15000
     else TurnTimeLeft:= 0
     end
-else if ((GameFlags And gfTagTeam) <> 0) and not NextClan then
+else if ((GameFlags and gfTagTeam) <> 0) and (not NextClan) then
     begin
-    if TagTurnTimeLeft <> 0 then TurnTimeLeft:= TagTurnTimeLeft;
+    if TagTurnTimeLeft <> 0 then
+        TurnTimeLeft:= TagTurnTimeLeft;
     TagTurnTimeLeft:= 0;
     end
 else
@@ -260,7 +298,8 @@ if (TurnTimeLeft > 0) and (CurrentHedgehog^.BotLevel = 0) then
         AddVoice(sndIllGetYou, CurrentTeam^.voicepack)
     else
         AddVoice(sndYesSir, CurrentTeam^.voicepack);
-    if PlacingHogs or (cHedgehogTurnTime < 1000000) then ReadyTimeLeft:= cReadyDelay;
+    if cHedgehogTurnTime < 1000000 then
+        ReadyTimeLeft:= cReadyDelay;
     AddCaption(Format(shortstring(trmsg[sidReady]), CurrentTeam^.TeamName), cWhiteColor, capgrpGameState)
     end
 else
@@ -270,7 +309,9 @@ else
     ReadyTimeLeft:= 0
     end;
 
-uMobile.NewTurnBeginning();
+{$IFDEF SDL13}
+uTouch.NewTurnBeginning();
+{$ENDIF}
 ScriptCall('onNewTurn');
 end;
 
@@ -292,22 +333,23 @@ inc(TeamsCount);
 c:= Pred(ClansCount);
 while (c >= 0) and (ClansArray[c]^.Color <> TeamColor) do dec(c);
 if c < 0 then
-   begin
-   new(team^.Clan);
-   FillChar(team^.Clan^, sizeof(TClan), 0);
-   ClansArray[ClansCount]:= team^.Clan;
-   inc(ClansCount);
-   with team^.Clan^ do
+    begin
+    new(team^.Clan);
+    FillChar(team^.Clan^, sizeof(TClan), 0);
+    ClansArray[ClansCount]:= team^.Clan;
+    inc(ClansCount);
+    with team^.Clan^ do
         begin
         ClanIndex:= Pred(ClansCount);
         Color:= TeamColor;
         TagTeamIndex:= 0;
         Flawless:= true
         end
-   end else
-   begin
-   team^.Clan:= ClansArray[c];
-   end;
+    end
+else
+    begin
+    team^.Clan:= ClansArray[c];
+    end;
 
 with team^.Clan^ do
     begin
@@ -343,23 +385,26 @@ for t:= 0 to Pred(TeamsCount) do
         th:= 0;
         for i:= 0 to cMaxHHIndex do
             if Hedgehogs[i].Gear <> nil then
-               inc(th, Hedgehogs[i].Gear^.Health);
-        if th > MaxTeamHealth then MaxTeamHealth:= th;
+                inc(th, Hedgehogs[i].Gear^.Health);
+        if th > MaxTeamHealth then
+            MaxTeamHealth:= th;
         // Some initial King buffs
         if (GameFlags and gfKing) <> 0 then
             begin
             Hedgehogs[0].King:= true;
             Hedgehogs[0].Hat:= 'crown';
-            Hedgehogs[0].Effects[hePoisoned] := false;
+            Hedgehogs[0].Effects[hePoisoned] := 0;
             h:= Hedgehogs[0].Gear^.Health;
             Hedgehogs[0].Gear^.Health:= hwRound(int2hwFloat(th)*_0_375);
             if Hedgehogs[0].Gear^.Health > h then
                 begin
                 dec(th, h);
                 inc(th, Hedgehogs[0].Gear^.Health);
-                if th > MaxTeamHealth then MaxTeamHealth:= th
+                if th > MaxTeamHealth then
+                    MaxTeamHealth:= th
                 end
-            else Hedgehogs[0].Gear^.Health:= h;
+            else
+                Hedgehogs[0].Gear^.Health:= h;
             Hedgehogs[0].InitialHealth:= Hedgehogs[0].Gear^.Health
             end;
         end;
@@ -372,7 +417,8 @@ var i, value: Longword;
 begin
 value:= 0;
 for i:= 0 to cMaxHHIndex do
-    if p^.Hedgehogs[i].Gear <> nil then inc(value);
+    if p^.Hedgehogs[i].Gear <> nil then
+        inc(value);
 TeamSize:= value;
 end;
 
@@ -406,7 +452,8 @@ with team^ do
         begin
         MaxTeamHealth:= NewTeamHealthBarWidth;
         RecountAllTeamsHealth;
-        end else if NewTeamHealthBarWidth > 0 then NewTeamHealthBarWidth:= (NewTeamHealthBarWidth * cTeamHealthWidth) div MaxTeamHealth
+        end else if NewTeamHealthBarWidth > 0 then
+            NewTeamHealthBarWidth:= (NewTeamHealthBarWidth * cTeamHealthWidth) div MaxTeamHealth
     end;
 
 RecountClanHealth(team^.Clan);
@@ -435,7 +482,7 @@ with Team do
                 begin
                 Gear^.Invulnerable:= false;
                 Gear^.Damage:= Gear^.Health;
-                Gear^.State:= (Gear^.State or gstHHGone) and not gstHHDriven
+                Gear^.State:= (Gear^.State or gstHHGone) and (not gstHHDriven)
                 end
             end
 end;
@@ -443,102 +490,124 @@ end;
 procedure chAddHH(var id: shortstring);
 var s: shortstring;
     Gear: PGear;
+    c: LongInt;
 begin
-    s:= '';
-    if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
-    with CurrentTeam^ do
+s:= '';
+if (not isDeveloperMode) or (CurrentTeam = nil) then
+    exit;
+with CurrentTeam^ do
+    begin
+    SplitBySpace(id, s);
+    SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]);
+    val(id, CurrentHedgehog^.BotLevel, c);
+    Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);
+    SplitBySpace(s, id);
+    val(s, Gear^.Health, c);
+    TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
+    Gear^.Hedgehog^.Team:= CurrentTeam;
+    if (GameFlags and gfSharedAmmo) <> 0 then
+        CurrentHedgehog^.AmmoStore:= Clan^.ClanIndex
+    else if (GameFlags and gfPerHogAmmo) <> 0 then
         begin
-        SplitBySpace(id, s);
-        CurrentHedgehog:= @Hedgehogs[HedgehogsNumber];
-        val(id, CurrentHedgehog^.BotLevel);
-        Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);
-        SplitBySpace(s, id);
-        val(s, Gear^.Health);
-        TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
-        Gear^.Hedgehog^.Team:= CurrentTeam;
-        if (GameFlags and gfSharedAmmo) <> 0 then CurrentHedgehog^.AmmoStore:= Clan^.ClanIndex
-        else if (GameFlags and gfPerHogAmmo) <> 0 then
-            begin
-            AddAmmoStore;
-            CurrentHedgehog^.AmmoStore:= StoreCnt - 1
-            end
-        else CurrentHedgehog^.AmmoStore:= TeamsCount - 1;
-        CurrentHedgehog^.Gear:= Gear;
-        CurrentHedgehog^.Name:= id;
-        CurrentHedgehog^.InitialHealth:= Gear^.Health;
-        CurrHedgehog:= HedgehogsNumber;
-        inc(HedgehogsNumber)
+        AddAmmoStore;
+        CurrentHedgehog^.AmmoStore:= StoreCnt - 1
         end
+    else CurrentHedgehog^.AmmoStore:= TeamsCount - 1;
+    CurrentHedgehog^.Gear:= Gear;
+    CurrentHedgehog^.Name:= id;
+    CurrentHedgehog^.InitialHealth:= Gear^.Health;
+    CurrHedgehog:= HedgehogsNumber;
+    inc(HedgehogsNumber)
+    end
 end;
 
 procedure chAddTeam(var s: shortstring);
 var Color: Longword;
+    c: LongInt;
     ts, cs: shortstring;
 begin
-    cs:= '';
-    ts:= '';
-    if isDeveloperMode then
-        begin
-        SplitBySpace(s, cs);
-        SplitBySpace(cs, ts);
-        val(cs, Color);
-        TryDo(Color <> 0, 'Error: black team color', true);
-
-        // color is always little endian so the mask must be constant also in big endian archs
-        Color:= Color or $FF000000;
-
-        AddTeam(Color);
-        CurrentTeam^.TeamName:= ts;
-        CurrentTeam^.PlayerHash:= s;
-        if GameType in [gmtDemo, gmtSave] then CurrentTeam^.ExtDriven:= true;
-
-        CurrentTeam^.voicepack:= AskForVoicepack('Default')
-        end
+cs:= '';
+ts:= '';
+if isDeveloperMode then
+    begin
+    SplitBySpace(s, cs);
+    SplitBySpace(cs, ts);
+    val(cs, Color, c);
+    TryDo(Color <> 0, 'Error: black team color', true);
+
+    // color is always little endian so the mask must be constant also in big endian archs
+    Color:= Color or $FF000000;
+    AddTeam(Color);
+    CurrentTeam^.TeamName:= ts;
+    CurrentTeam^.PlayerHash:= s;
+    if GameType in [gmtDemo, gmtSave, gmtRecord] then
+        CurrentTeam^.ExtDriven:= true;
+
+    CurrentTeam^.voicepack:= AskForVoicepack('Default')
+    end
 end;
 
 procedure chSetHHCoords(var x: shortstring);
 var y: shortstring;
-    t: Longint;
+    t, c: Longint;
 begin
 y:= '';
-if (not isDeveloperMode) or (CurrentHedgehog = nil) or (CurrentHedgehog^.Gear = nil) then exit;
+if (not isDeveloperMode) or (CurrentHedgehog = nil) or (CurrentHedgehog^.Gear = nil) then
+    exit;
 SplitBySpace(x, y);
-val(x, t);
+val(x, t, c);
 CurrentHedgehog^.Gear^.X:= int2hwFloat(t);
-val(y, t);
+val(y, t, c);
 CurrentHedgehog^.Gear^.Y:= int2hwFloat(t)
 end;
 
 procedure chBind(var id: shortstring);
-var s: shortstring;
+var KeyName, Modifier, tmp: shortstring;
     b: LongInt;
 begin
-s:= '';
-if CurrentTeam = nil then exit;
-SplitBySpace(id, s);
-if s[1]='"' then Delete(s, 1, 1);
-if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
-b:= KeyNameToCode(id);
-if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false)
-        else CurrentTeam^.Binds[b]:= s
+KeyName:= '';
+Modifier:= '';
+
+if CurrentTeam = nil then
+    exit;
+
+if(Pos('mod:', id) <> 0)then
+    begin
+    tmp:= '';
+    SplitBySpace(id, tmp);
+    Modifier:= id;
+    id:= tmp;
+    end;
+
+SplitBySpace(id, KeyName);
+if KeyName[1]='"' then
+    Delete(KeyName, 1, 1);
+if KeyName[byte(KeyName[0])]='"' then
+    Delete(KeyName, byte(KeyName[0]), 1);
+b:= KeyNameToCode(id, Modifier);
+if b = 0 then
+    OutError(errmsgUnknownVariable + ' "' + id + '"', false)
+else
+    CurrentTeam^.Binds[b]:= KeyName;
 end;
 
 procedure chTeamGone(var s:shortstring);
 var t: LongInt;
 begin
 t:= 0;
-while (t < cMaxTeams)
-    and (TeamsArray[t] <> nil)
-    and (TeamsArray[t]^.TeamName <> s) do inc(t);
-if (t = cMaxTeams) or (TeamsArray[t] = nil) then exit;
+while (t < cMaxTeams) and (TeamsArray[t] <> nil) and (TeamsArray[t]^.TeamName <> s) do
+    inc(t);
+if (t = cMaxTeams) or (TeamsArray[t] = nil) then
+    exit;
 
 with TeamsArray[t]^ do
-    begin
-    AddChatString('** '+ TeamName + ' is gone');
-    hasGone:= true
-    end;
+    if not hasGone then
+        begin
+        AddChatString('** '+ TeamName + ' is gone');
+        hasGone:= true;
 
-RecountTeamHealth(TeamsArray[t])
+        RecountTeamHealth(TeamsArray[t])
+        end;
 end;
 
 
@@ -559,43 +628,64 @@ AddChatString('** Good-bye!');
 RecountAllTeamsHealth();
 end;
 
+procedure SwitchCurrentHedgehog(newHog: PHedgehog);
+var oldCI, newCI: boolean;
+    oldHH: PHedgehog;
+begin
+   if (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = amKnife) then
+       LoadHedgehogHat(CurrentHedgehog^, CurrentHedgehog^.Hat);
+    oldCI:= (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex >= 0);
+    newCI:= (newHog^.Gear <> nil) and (newHog^.Gear^.CollisionIndex >= 0);
+    if oldCI then DeleteCI(CurrentHedgehog^.Gear);
+    if newCI then DeleteCI(newHog^.Gear);
+    oldHH:= CurrentHedgehog;
+    CurrentHedgehog:= newHog;
+   if (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = amKnife) then
+       LoadHedgehogHat(CurrentHedgehog^, 'Reserved/chef');
+    if oldCI then AddGearCI(oldHH^.Gear);
+    if newCI then AddGearCI(newHog^.Gear)
+end;
+
+
 procedure initModule;
 begin
-    RegisterVariable('addhh', vtCommand, @chAddHH, false);
-    RegisterVariable('addteam', vtCommand, @chAddTeam, false);
-    RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false);
-    RegisterVariable('bind', vtCommand, @chBind, true );
-    RegisterVariable('teamgone', vtCommand, @chTeamGone, true );
-    RegisterVariable('finish', vtCommand, @chFinish, true ); // all teams gone
-
-    CurrentTeam:= nil;
-    PreviousTeam:= nil;
-    CurrentHedgehog:= nil;
-    TeamsCount:= 0;
-    ClansCount:= 0;
-    LocalClan:= -1;
-    LocalTeam:= -1;
-    LocalAmmo:= -1;
-    GameOver:= false;
-    NextClan:= true;
+RegisterVariable('addhh', @chAddHH, false);
+RegisterVariable('addteam', @chAddTeam, false);
+RegisterVariable('hhcoords', @chSetHHCoords, false);
+RegisterVariable('bind', @chBind, true );
+RegisterVariable('teamgone', @chTeamGone, true );
+RegisterVariable('finish', @chFinish, true ); // all teams gone
+
+CurrentTeam:= nil;
+PreviousTeam:= nil;
+CurrentHedgehog:= nil;
+TeamsCount:= 0;
+ClansCount:= 0;
+LocalClan:= -1;
+LocalTeam:= -1;
+LocalAmmo:= -1;
+GameOver:= false;
+NextClan:= true;
+MaxTeamHealth:= 0;
 end;
 
 procedure freeModule;
 var i, h: LongWord;
 begin
-   if TeamsCount > 0 then
-     begin
-     for i:= 0 to Pred(TeamsCount) do
+if TeamsCount > 0 then
+    begin
+    for i:= 0 to Pred(TeamsCount) do
         begin
-            for h:= 0 to cMaxHHIndex do
-                if TeamsArray[i]^.Hedgehogs[h].GearHidden <> nil then
-                    Dispose(TeamsArray[i]^.Hedgehogs[h].GearHidden);
-            Dispose(TeamsArray[i]);
-        end;
-     for i:= 0 to Pred(ClansCount) do Dispose(ClansArray[i]);
-     end;
-   TeamsCount:= 0;
-   ClansCount:= 0;
+        for h:= 0 to cMaxHHIndex do
+            if TeamsArray[i]^.Hedgehogs[h].GearHidden <> nil then
+                Dispose(TeamsArray[i]^.Hedgehogs[h].GearHidden);
+        Dispose(TeamsArray[i]);
+    end;
+for i:= 0 to Pred(ClansCount) do
+    Dispose(ClansArray[i]);
+    end;
+TeamsCount:= 0;
+ClansCount:= 0;
 end;
 
 end.
diff --git a/hedgewars/uTextures.pas b/hedgewars/uTextures.pas
index b40679e..dcdb4dd 100644
--- a/hedgewars/uTextures.pas
+++ b/hedgewars/uTextures.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -39,10 +39,10 @@ var TextureList: PTexture;
 procedure SetTextureParameters(enableClamp: Boolean);
 begin
     if enableClamp and ((cReducedQuality and rqClampLess) = 0) then
-    begin
+        begin
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
-    end;
+        end;
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
 end;
@@ -119,6 +119,8 @@ for y:= 0 to Pred(Surf^.h) do
     fromP4:= @(fromP4^[Surf^.pitch div 4])
     end;
 end;
+
+
 function Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
 var tw, th, x, y: Longword;
     tmpp: pointer;
@@ -154,7 +156,8 @@ if SDL_MustLock(surf) then
 
 fromP4:= Surf^.pixels;
 
-if cGrayScale then Surface2GrayScale(Surf);
+if GrayScale then
+    Surface2GrayScale(Surf);
 
 if (not SupportNPOTT) and (not (isPowerOf2(Surf^.w) and isPowerOf2(Surf^.h))) then
     begin
@@ -164,22 +167,25 @@ if (not SupportNPOTT) and (not (isPowerOf2(Surf^.w) and isPowerOf2(Surf^.h))) th
     Surface2Tex^.rx:= Surf^.w / tw;
     Surface2Tex^.ry:= Surf^.h / th;
 
-    GetMem(tmpp, tw * th * surf^.format^.BytesPerPixel);
+    tmpp:= GetMem(tw * th * surf^.format^.BytesPerPixel);
 
     fromP4:= Surf^.pixels;
     toP4:= tmpp;
 
     for y:= 0 to Pred(Surf^.h) do
         begin
-        for x:= 0 to Pred(Surf^.w) do toP4^[x]:= fromP4^[x];
-        for x:= Surf^.w to Pred(tw) do toP4^[x]:= 0;
+        for x:= 0 to Pred(Surf^.w) do
+            toP4^[x]:= fromP4^[x];
+        for x:= Surf^.w to Pred(tw) do
+            toP4^[x]:= 0;
         toP4:= @(toP4^[tw]);
         fromP4:= @(fromP4^[Surf^.pitch div 4])
         end;
 
     for y:= Surf^.h to Pred(th) do
         begin
-        for x:= 0 to Pred(tw) do toP4^[x]:= 0;
+        for x:= 0 to Pred(tw) do
+            toP4^[x]:= 0;
         toP4:= @(toP4^[tw])
         end;
 
@@ -206,17 +212,17 @@ end;
 // if nil is passed nothing is done
 procedure FreeTexture(tex: PTexture);
 begin
-    if tex <> nil then
-        begin
-        if tex^.NextTexture <> nil then
-            tex^.NextTexture^.PrevTexture:= tex^.PrevTexture;
-        if tex^.PrevTexture <> nil then
-            tex^.PrevTexture^.NextTexture:= tex^.NextTexture
-        else
-            TextureList:= tex^.NextTexture;
-        glDeleteTextures(1, @tex^.id);
-        Dispose(tex);
-        end
+if tex <> nil then
+    begin
+    if tex^.NextTexture <> nil then
+        tex^.NextTexture^.PrevTexture:= tex^.PrevTexture;
+    if tex^.PrevTexture <> nil then
+        tex^.PrevTexture^.NextTexture:= tex^.NextTexture
+    else
+        TextureList:= tex^.NextTexture;
+    glDeleteTextures(1, @tex^.id);
+    Dispose(tex);
+    end
 end;
 
 procedure initModule;
@@ -226,7 +232,8 @@ end;
 
 procedure freeModule;
 begin
-    if TextureList <> nil then WriteToConsole('FIXME FIXME FIXME. App shutdown without full cleanup of texture list; read game0.log and please report this problem');
+if TextureList <> nil then
+    WriteToConsole('FIXME FIXME FIXME. App shutdown without full cleanup of texture list; read game0.log and please report this problem');
     while TextureList <> nil do 
         begin
         AddFileLog('Texture not freed: width='+inttostr(LongInt(TextureList^.w))+' height='+inttostr(LongInt(TextureList^.h))+' priority='+inttostr(round(TextureList^.priority*1000)));
diff --git a/hedgewars/uTouch.pas b/hedgewars/uTouch.pas
new file mode 100644
index 0000000..09faeef
--- /dev/null
+++ b/hedgewars/uTouch.pas
@@ -0,0 +1,652 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uTouch;
+
+interface
+
+uses SysUtils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, GLUnit, uTypes, uCaptions, uAmmos, uWorld, uMobile;
+
+
+procedure initModule;
+procedure freeModule;
+
+procedure ProcessTouch;
+procedure NewTurnBeginning;
+
+procedure onTouchDown(x,y: Longword; pointerId: TSDL_FingerId);
+procedure onTouchMotion(x,y: Longword; dx,dy: LongInt; pointerId: TSDL_FingerId);
+procedure onTouchUp(x,y: Longword; pointerId: TSDL_FingerId);
+function convertToCursorX(x: LongInt): LongInt;
+function convertToCursorY(y: LongInt): LongInt;
+function convertToCursorDeltaX(x: LongInt): LongInt;
+function convertToCursorDeltaY(y: LongInt): LongInt;
+function addFinger(x,y: Longword; id: TSDL_FingerId): PTouch_Data;
+function updateFinger(x,y,dx,dy: Longword; id: TSDL_FingerId): PTouch_Data;
+procedure deleteFinger(id: TSDL_FingerId);
+procedure onTouchClick(finger: TTouch_Data);
+procedure onTouchDoubleClick(finger: TTouch_Data);
+procedure onTouchLongClick(finger: TTouch_Data);
+
+function findFinger(id: TSDL_FingerId): PTouch_Data;
+procedure aim(finger: TTouch_Data);
+function isOnCrosshair(finger: TTouch_Data): boolean;
+function isOnCurrentHog(finger: TTouch_Data): boolean;
+procedure convertToWorldCoord(var x,y: LongInt; finger: TTouch_Data);
+procedure convertToFingerCoord(var x,y: LongInt; oldX, oldY: LongInt);
+function fingerHasMoved(finger: TTouch_Data): boolean;
+function calculateDelta(finger1, finger2: TTouch_Data): LongInt;
+function getSecondFinger(finger: TTouch_Data): PTouch_Data;
+function isOnRect(rect: TSDL_Rect; finger: TTouch_Data): boolean;
+function isOnRect(x,y,w,h: LongInt; finger: TTouch_Data): boolean;
+function isOnWidget(widget: TOnScreenWidget; finger: TTouch_Data): boolean;
+procedure printFinger(finger: TTouch_Data);
+implementation
+
+const
+    clickTime = 200;
+    nilFingerId = High(TSDL_FingerId);
+    baseRectSize = 96;
+
+var
+    rectSize, halfRectSize: LongInt;
+
+    pointerCount : Longword;
+    fingers: array of TTouch_Data;
+    moveCursor : boolean;
+    invertCursor : boolean;
+
+    xTouchClick,yTouchClick : LongInt;
+    timeSinceClick : Longword;
+
+    //Pinch to zoom 
+    pinchSize : LongInt;
+    baseZoomValue: GLFloat;
+
+    //aiming
+    aimingCrosshair: boolean;
+    aimingUp, aimingDown: boolean; 
+    targetAngle: LongInt;
+
+    buttonsDown: Longword;
+    targetting, targetted: boolean; //true when targetting an airstrike or the like
+
+procedure onTouchDown(x,y: Longword; pointerId: TSDL_FingerId);
+var 
+    finger: PTouch_Data;
+begin
+{$IFDEF USE_TOUCH_INTERFACE}
+finger := addFinger(x,y,pointerId);
+
+inc(buttonsDown);//inc buttonsDown, if we don't see a button down we'll dec it
+
+if isOnCrosshair(finger^) then
+begin
+    aimingCrosshair:= true;
+    aim(finger^);
+    moveCursor:= false;
+    exit;
+end;
+
+if isOnWidget(fireButton, finger^) then
+    begin
+    ParseTeamCommand('+attack');
+    moveCursor:= false;
+    finger^.pressedWidget:= @fireButton;
+    exit;
+    end;
+if isOnWidget(arrowLeft, finger^) then
+    begin
+    ParseTeamCommand('+left');
+    moveCursor:= false;
+    finger^.pressedWidget:= @arrowLeft;
+    exit;
+    end;
+if isOnWidget(arrowRight, finger^) then
+    begin
+    ParseTeamCommand('+right');
+    moveCursor:= false;
+    finger^.pressedWidget:= @arrowRight;
+    exit;
+    end;
+if isOnWidget(arrowUp, finger^) then
+    begin
+    ParseTeamCommand('+up');
+    aimingUp:= true;
+    moveCursor:= false;
+    finger^.pressedWidget:= @arrowUp;
+    exit;
+    end;
+if isOnWidget(arrowDown, finger^) then
+    begin
+    ParseTeamCommand('+down');
+    aimingDown:= true;
+    moveCursor:= false;
+    finger^.pressedWidget:= @arrowDown;
+    exit;
+    end;
+
+if isOnWidget(pauseButton, finger^) then
+    begin
+    isPaused:= not isPaused;
+    moveCursor:= false;
+    finger^.pressedWidget:= @pauseButton;
+    exit;
+    end;
+
+if isOnWidget(utilityWidget, finger^) then
+    begin
+    finger^.pressedWidget:= @utilityWidget;
+    moveCursor:= false;
+    if(CurrentHedgehog <> nil) then
+        begin
+        if Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Timerable <> 0 then
+            ParseTeamCommand('/timer ' + inttostr((GetCurAmmoEntry(CurrentHedgeHog^)^.Timer div 1000) mod 5 + 1));
+        end;
+    exit;
+    end; 
+dec(buttonsDown);//no buttonsDown, undo the inc() above
+if buttonsDown = 0 then
+    begin
+    moveCursor:= true;
+    case pointerCount of
+        1:
+            targetting:= not(targetted) and (CurrentHedgehog <> nil) and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0);
+        2:
+            begin
+            moveCursor:= false;
+            pinchSize := calculateDelta(finger^, getSecondFinger(finger^)^);
+            baseZoomValue := ZoomValue
+            end;
+        end;
+    end;
+{$ENDIF}
+end;
+
+procedure onTouchMotion(x,y: Longword;dx,dy: LongInt; pointerId: TSDL_FingerId);
+var
+    finger, secondFinger: PTouch_Data;
+    currentPinchDelta, zoom : single;
+begin
+finger:= updateFinger(x,y,dx,dy,pointerId);
+
+if moveCursor then
+    begin
+        if invertCursor then
+        begin
+            CursorPoint.X := CursorPoint.X - finger^.dx;
+            CursorPoint.Y := CursorPoint.Y + finger^.dy;
+        end
+    else
+        begin
+            CursorPoint.X := CursorPoint.X + finger^.dx;
+            CursorPoint.Y := CursorPoint.Y - finger^.dy;
+        end;
+        exit //todo change into switch rather than ugly ifs
+    end;
+    
+if aimingCrosshair then 
+    begin
+        aim(finger^);
+        exit
+    end;
+
+if (buttonsDown = 0) and (pointerCount = 2) then
+    begin
+       secondFinger := getSecondFinger(finger^);
+       currentPinchDelta := calculateDelta(finger^, secondFinger^) - pinchSize;
+       zoom := currentPinchDelta/cScreenWidth;
+       ZoomValue := baseZoomValue - (zoom * cMinMaxZoomLevelDelta);
+       if ZoomValue < cMaxZoomLevel then
+           ZoomValue := cMaxZoomLevel;
+       if ZoomValue > cMinZoomLevel then
+           ZoomValue := cMinZoomLevel;
+    end;
+
+end;
+
+procedure onTouchUp(x,y: Longword; pointerId: TSDL_FingerId);
+var
+    finger: PTouch_Data;
+    widget: POnScreenWidget;
+begin
+{$IFDEF USE_TOUCH_INTERFACE}
+x := x;
+y := y;
+finger:= updateFinger(x,y,0,0,pointerId);
+//Check for onTouchClick event
+if not(fingerHasMoved(finger^)) then
+    begin
+    if (RealTicks - finger^.timeSinceDown) < clickTime then
+        onTouchClick(finger^)
+    else
+            onTouchLongClick(finger^);
+    end;
+
+if aimingCrosshair then
+    begin
+    aimingCrosshair:= false;
+    ParseTeamCommand('-up');
+    ParseTeamCommand('-down');
+    dec(buttonsDown);
+    end;
+
+widget:= finger^.pressedWidget;
+if (buttonsDown > 0) and (widget <> nil) then
+    begin
+    dec(buttonsDown);
+    
+    if widget = @arrowLeft then
+        ParseTeamCommand('-left');
+    
+    if widget = @arrowRight then
+        ParseTeamCommand('-right');
+
+    if widget = @arrowUp then
+        ParseTeamCommand('-up');
+
+    if widget = @arrowDown then
+        ParseTeamCommand('-down');
+
+    if widget = @fireButton then
+        ParseTeamCommand('-attack');
+    
+    if widget = @utilityWidget then
+        if (CurrentHedgehog <> nil)then
+            if(Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0)then
+                begin
+                ParseTeamCommand('put');
+                targetted:= true;
+                end
+            else if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amSwitch) then
+                ParseTeamCommand('switch')
+            else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
+    end;
+        
+if targetting then
+    AddCaption('Press the target button to mark the target', cWhiteColor, capgrpAmmoInfo);
+ 
+deleteFinger(pointerId);
+{$ENDIF}
+end;
+
+procedure onTouchDoubleClick(finger: TTouch_Data);
+begin
+finger := finger;//avoid compiler hint
+end;
+
+procedure onTouchLongClick(finger: TTouch_Data);
+begin
+{$IFDEF USE_TOUCH_INTERFACE}
+if isOnWidget(jumpWidget, finger) then
+    begin
+    ParseTeamCommand('ljump');
+    exit;
+    end;
+
+{$ENDIF}
+end;
+
+procedure onTouchClick(finger: TTouch_Data);
+begin
+//if (RealTicks - timeSinceClick < 300) and (sqrt(sqr(finger.X-xTouchClick) + sqr(finger.Y-yTouchClick)) < 30) then
+//    begin
+//    onTouchDoubleClick(finger);
+//    timeSinceClick:= 0;//we make an assumption there won't be an 'click' in the first 300 ticks(milliseconds) 
+//    exit; 
+//    end;
+
+xTouchClick:= finger.x;
+yTouchClick:= finger.y;
+timeSinceClick:= RealTicks;
+
+if bShowAmmoMenu then
+    begin 
+    if isOnRect(AmmoRect, finger) then
+        begin
+        CursorPoint.X:= finger.x;
+        CursorPoint.Y:= finger.y;
+        ParseTeamCommand('put'); 
+        end
+    else
+        bShowAmmoMenu:= false;
+    exit;
+    end;
+
+{$IFDEF USE_TOUCH_INTERFACE}
+if isOnCurrentHog(finger) or isOnWidget(AMWidget, finger) then
+    begin
+    bShowAmmoMenu := true;
+    exit;
+    end;
+
+if isOnWidget(jumpWidget, finger) then
+    begin
+    ParseTeamCommand('hjump');    
+    exit;
+    end;
+{$ENDIF}
+end;
+
+function addFinger(x,y: Longword; id: TSDL_FingerId): PTouch_Data;
+var 
+    xCursor, yCursor, index : LongInt;
+begin
+    //Check array sizes
+    if length(fingers) < Integer(pointerCount) then 
+    begin
+        setLength(fingers, length(fingers)*2);
+        for index := length(fingers) div 2 to length(fingers) do
+            fingers[index].id := nilFingerId;
+    end;
+    
+    
+    xCursor := convertToCursorX(x);
+    yCursor := convertToCursorY(y);
+    
+    //on removing fingers, all fingers are moved to the left
+    //with dynamic arrays being zero based, the new position of the finger is the old pointerCount
+    fingers[pointerCount].id := id;
+    fingers[pointerCount].historicalX := xCursor;
+    fingers[pointerCount].historicalY := yCursor;
+    fingers[pointerCount].x := xCursor;
+    fingers[pointerCount].y := yCursor;
+    fingers[pointerCount].dx := 0;
+    fingers[pointerCount].dy := 0;
+    fingers[pointerCount].timeSinceDown:= RealTicks;
+    fingers[pointerCount].pressedWidget:= nil;
+ 
+    addFinger:= @fingers[pointerCount];
+    inc(pointerCount);
+end;
+
+function updateFinger(x,y,dx,dy: Longword; id: TSDL_FingerId): PTouch_Data;
+begin
+   updateFinger:= findFinger(id);
+
+   updateFinger^.x:= convertToCursorX(x);
+   updateFinger^.y:= convertToCursorY(y);
+   updateFinger^.dx:= convertToCursorDeltaX(dx);
+   updateFinger^.dy:= convertToCursorDeltaY(dy);
+end;
+
+procedure deleteFinger(id: TSDL_FingerId);
+var
+    index : Longword;
+begin
+    
+    dec(pointerCount);
+    for index := 0 to pointerCount do
+    begin
+        if fingers[index].id = id then
+        begin
+ 
+            //put the last finger into the spot of the finger to be removed, 
+            //so that all fingers are packed to the far left
+            if  pointerCount <> index then
+                begin
+                fingers[index].id := fingers[pointerCount].id;    
+                fingers[index].x := fingers[pointerCount].x;    
+                fingers[index].y := fingers[pointerCount].y;    
+                fingers[index].historicalX := fingers[pointerCount].historicalX;    
+                fingers[index].historicalY := fingers[pointerCount].historicalY;    
+                fingers[index].timeSinceDown := fingers[pointerCount].timeSinceDown;
+
+                fingers[pointerCount].id := nilFingerId;
+            end
+        else fingers[index].id := nilFingerId;
+            break;
+        end;
+    end;
+
+end;
+
+procedure NewTurnBeginning;
+begin
+targetted:= false;
+targetting:= false;
+SetUtilityWidgetState(amNothing);
+end;
+
+
+procedure ProcessTouch;
+var
+    deltaAngle: LongInt;
+begin
+invertCursor := not(bShowAmmoMenu or targetting); 
+if aimingCrosshair then
+    if CurrentHedgehog^.Gear <> nil then
+        begin
+        deltaAngle:= CurrentHedgehog^.Gear^.Angle - targetAngle;
+        if (deltaAngle > -5) and (deltaAngle < 5) then 
+            begin
+                if(aimingUp)then
+                    begin
+                    aimingUp:= false;
+                    ParseTeamCommand('-up');
+                    end;
+                if(aimingDown)then
+                    begin
+                    aimingDown:= false;
+                    ParseTeamCommand('-down');
+                    end
+            end
+        else
+            begin
+            if (deltaAngle < 0) then
+                begin
+                if aimingUp then
+                    begin
+                    aimingUp:= false;
+                    ParseTeamCommand('-up');
+                    end;
+                if(aimingDown)then
+                    begin
+                    aimingDown:= true;
+                    ParseTeamCommand('-down');
+                    end
+                end
+            else
+                begin
+                if aimingDown then
+                    begin
+                    ParseTeamCommand('-down');
+                    aimingDown:= false;
+                    end;
+                if aimingUp then
+                    begin
+                    aimingUp:= true;
+                    ParseTeamCommand('+up');
+                    end;
+                end; 
+            end;
+        end
+    else  
+        begin
+        if aimingUp then
+            begin
+            ParseTeamCommand('-up');
+            aimingUp:= false;
+            end;
+        if aimingDown then
+            begin
+            ParseTeamCommand('-down');
+            aimingDown:= false;
+            end;
+        end;
+end;
+
+function findFinger(id: TSDL_FingerId): PTouch_Data;
+var
+    index: LongWord;
+begin
+    for index := 0 to High(fingers) do
+        if fingers[index].id = id then 
+            begin
+            findFinger := @fingers[index];
+            break;
+            end;
+end;
+
+procedure aim(finger: TTouch_Data);
+var 
+    hogX, hogY, touchX, touchY, deltaX, deltaY: LongInt;
+begin
+    if CurrentHedgehog^.Gear <> nil then
+        begin
+        touchX := 0;//avoid compiler hint
+        touchY := 0;
+        hogX := hwRound(CurrentHedgehog^.Gear^.X);
+        hogY := hwRound(CurrentHedgehog^.Gear^.Y);
+
+        convertToWorldCoord(touchX, touchY, finger);
+        deltaX := abs(TouchX-HogX);
+        deltaY := TouchY-HogY;
+        
+        targetAngle:= (Round(DeltaY / sqrt(sqr(deltaX) + sqr(deltaY)) * 2048) + 2048) div 2;
+        end; //if CurrentHedgehog^.Gear <> nil
+end;
+
+// These 4 convertToCursor functions convert xy coords from the SDL coordinate system to our CursorPoint coor system:
+// - the SDL coordinate system goes from 0 to 32768 on the x axis and 0 to 32768 on the y axis, (0,0) being top left;
+// - the CursorPoint coordinate system goes from -cScreenWidth/2 to cScreenWidth/2 on the x axis
+//   and 0 to cScreenHeight on the x axis, (-cScreenWidth, cScreenHeight) being top left.
+function convertToCursorX(x: LongInt): LongInt;
+begin
+    convertToCursorX := round((x/32768)*cScreenWidth) - (cScreenWidth shr 1);
+end;
+
+function convertToCursorY(y: LongInt): LongInt;
+begin
+    convertToCursorY := cScreenHeight - round((y/32768)*cScreenHeight)
+end;
+
+function convertToCursorDeltaX(x: LongInt): LongInt;
+begin
+    convertToCursorDeltaX := round(x/32768*cScreenWidth)
+end;
+
+function convertToCursorDeltaY(y: LongInt): LongInt;
+begin
+    convertToCursorDeltaY := round(y/32768*cScreenHeight)
+end;
+
+function isOnCrosshair(finger: TTouch_Data): boolean;
+var
+    x,y : LongInt;
+begin
+    x := 0;//avoid compiler hint
+    y := 0;
+    convertToFingerCoord(x, y, CrosshairX, CrosshairY);
+    isOnCrosshair:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger);
+    printFinger(finger);
+    WriteLnToConsole(inttostr(finger.x) + '   ' + inttostr(x));
+    WriteLnToConsole(inttostr(x) + '  ' + inttostr(y) + '   ' + inttostr(round(uMobile.getScreenDPI * 10)));
+end;
+
+function isOnCurrentHog(finger: TTouch_Data): boolean;
+var
+    x,y : LongInt;
+begin
+    x := 0;
+    y := 0;
+    convertToFingerCoord(x,y, hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y));
+    isOnCurrentHog:= isOnRect((x-HalfRectSize), (y-HalfRectSize), RectSize, RectSize, finger);
+end;
+
+procedure convertToFingerCoord(var x,y : LongInt; oldX, oldY: LongInt);
+begin
+    x := oldX + WorldDx;
+    y := cScreenHeight - (oldY + WorldDy);
+end;
+
+procedure convertToWorldCoord(var x,y: LongInt; finger: TTouch_Data);
+begin
+//if x <> nil then 
+    x := finger.x-WorldDx;
+//if y <> nil then 
+    y := (cScreenHeight - finger.y)-WorldDy;
+end;
+
+//Method to calculate the distance this finger has moved since the downEvent
+function fingerHasMoved(finger: TTouch_Data): boolean;
+begin
+    fingerHasMoved := trunc(sqrt(sqr(finger.X-finger.historicalX) + sqr(finger.y-finger.historicalY))) > 30;
+end;
+
+function calculateDelta(finger1, finger2: TTouch_Data): LongInt; inline;
+begin
+    calculateDelta := Round(sqrt(sqr(finger2.x-finger1.x) + sqr(finger2.y-finger1.y)));
+end;
+
+// Under the premise that all pointer ids in pointerIds:TSDL_FingerId are packed to the far left.
+// If the pointer to be ignored is not pointerIds[0] the second must be there
+function getSecondFinger(finger: TTouch_Data): PTouch_Data;
+begin
+    if fingers[0].id = finger.id then
+        getSecondFinger := @fingers[1]
+    else
+        getSecondFinger := @fingers[0];
+end;
+
+function isOnRect(rect: TSDL_Rect; finger: TTouch_Data): boolean;
+begin
+    isOnRect:= isOnRect(rect.x, rect.y, rect.w, rect.h, finger);
+end;
+
+function isOnRect(x,y,w,h: LongInt; finger: TTouch_Data): boolean;
+begin
+    isOnRect:= (finger.x > x)   and
+               (finger.x < x + w) and
+               (cScreenHeight - finger.y > y) and
+               (cScreenHeight - finger.y < y + h);
+end;
+
+function isOnWidget(widget: TOnScreenWidget; finger: TTouch_Data): boolean;
+begin
+    isOnWidget:= widget.show and isOnRect(widget.active, finger);
+end;
+
+procedure printFinger(finger: TTouch_Data);
+begin
+    WriteToConsole(Format('id:%d, (%d,%d), (%d,%d), time: %d', [finger.id, finger.x, finger.y, finger.historicalX, finger.historicalY, finger.timeSinceDown]));
+end;
+
+procedure initModule;
+var
+    index: Longword;
+    //uRenderCoordScaleX, uRenderCoordScaleY: Longword;
+begin
+    buttonsDown:= 0;
+
+    setLength(fingers, 4);
+    for index := 0 to High(fingers) do 
+        fingers[index].id := nilFingerId;
+
+    rectSize:= round(baseRectSize * uMobile.getScreenDPI);
+    halfRectSize:= rectSize shl 1;
+end;
+
+procedure freeModule;
+begin
+end;
+
+begin
+end.
diff --git a/hedgewars/uTypes.pas b/hedgewars/uTypes.pas
index a7c097e..87e2415 100644
--- a/hedgewars/uTypes.pas
+++ b/hedgewars/uTypes.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -39,32 +39,35 @@ type
     TGameState = (gsLandGen, gsStart, gsGame, gsChat, gsConfirm, gsExit, gsSuspend);
 
     // Game types that help determining what the engine is actually supposed to do
-    TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax);
+    TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax, gmtRecord);
 
     // Different files are stored in different folders, this enumeration is used to tell which folder to use
     TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptTeams, ptMaps,
             ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts,
-            ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath);
+            ptLocale, ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps, ptSuddenDeath, ptButtons);
 
     // Available sprites for displaying stuff
     TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
             sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
             sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
             sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
-            sprClusterBomb, sprClusterParticle, sprFlame, sprHorizont,
-            sprHorizontL, sprHorizontR, sprSky, sprSkyL,
-            sprSkyR, sprAMBorderHorizontal, sprAMBorderVertical, sprAMSlot, sprAMAmmos,
-            sprAMSlotKeys, sprAMCorners, sprFinger, sprAirBomb,
-            sprAirplane, sprAmAirplane, sprAmGirder, sprHHTelepMask,
-            sprSwitch, sprParachute, sprTarget, sprRopeNode,
+            sprClusterBomb, sprClusterParticle, sprFlame,
+            sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR,
+            sprAMSlot, sprAMAmmos, sprAMAmmosBW, sprAMSlotKeys, sprAMCorners,
+            sprFinger, sprAirBomb, sprAirplane, sprAmAirplane, sprAmGirder,
+            sprHHTelepMask, sprSwitch, sprParachute, sprTarget, sprRopeNode,
             sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR,
+{$IFDEF USE_TOUCH_INTERFACE}
+            sprFireButton, sprArrowUp, sprArrowDown, sprArrowLeft, sprArrowRight,
+            sprJumpWidget, sprAMWidget, sprPauseButton, sprTimerButton, sprTargetButton,
+{$ENDIF}
             sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
             sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
             sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
             sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
             sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave,
             sprHurrah, sprLemonade, sprShrug, sprJuggle, sprExplPart, sprExplPart2,
-            sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon,
+            sprCakeWalk, sprCakeDown, sprWatermelon,
             sprEvilTrace, sprHellishBomb, sprSeduction, sprDress,
             sprCensored, sprDrill, sprHandDrill, sprHandBallgun, sprBalls,
             sprPlane, sprHandPlane, sprUtility, sprInvulnerable, sprVampiric, sprGirder,
@@ -82,22 +85,25 @@ type
             sprSMineOff, sprSMineOn, sprHandSMine, sprHammer,
             sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
             sprBulletHit, sprSnowball, sprHandSnowball, sprSnow,
-            sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis
+            sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis,
+            sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar
             );
 
     // Gears that interact with other Gears and/or Land
-    TGearType = (gtGrenade, gtHedgehog, gtShell, gtGrave, gtBee, // 4
-            gtShotgunShot, gtPickHammer, gtRope, gtMine, gtCase, // 9
-            gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 14
-            gtFlame, gtFirePunch, gtATStartGame, // 17
-            gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 22
-            gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 27
-            gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 33
-            gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 39
-            gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 44
+    TGearType = ({-->}gtFlame, gtHedgehog, gtMine, gtCase, gtExplosives, // <-- these are gears which should be avoided when searching a spawn place
+            gtGrenade, gtShell, gtGrave, gtBee, // 8
+            gtShotgunShot, gtPickHammer, gtRope,  // 11
+            gtDEagleShot, gtDynamite, gtClusterBomb, gtCluster, gtShover, // 16
+            gtFirePunch, gtATStartGame, // 18
+            gtATFinishGame, gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, // 23
+            gtGirder, gtTeleport, gtSwitcher, gtTarget, gtMortar, // 28
+            gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 34
+            gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
+            gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 44
             gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 50
             gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 55
-            gtNapalmBomb, gtSnowball, gtFlake, gtStructure, gtLandGun, gtTardis); // 61
+            gtNapalmBomb, gtSnowball, gtFlake, gtStructure, gtLandGun, gtTardis, // 61
+            gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife); // 65
 
     // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
@@ -108,8 +114,6 @@ type
             vgtBigExplosion, vgtChunk, vgtNote, vgtLineTrail, vgtBulletHit, vgtCircle,
             vgtSmoothWindBar, vgtStraightShot);
 
-    TGearsType = set of TGearType;
-
     // Damage can be caused by different sources
     TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
 
@@ -147,12 +151,12 @@ type
             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
-            amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun); // 54
+            amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun, amIceGun, amKnife); // 54
 
     // Different kind of crates that e.g. hedgehogs can pick up
     TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
 
-    THWFont = (fnt16, fntBig, fntSmall {$IFNDEF IPHONEOS}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
+    THWFont = (fnt16, fntBig, fntSmall {$IFNDEF MOBILE}, CJKfnt16, CJKfntBig, CJKfntSmall{$ENDIF});
 
     TCapGroup = (capgrpGameState, capgrpAmmoinfo, capgrpVolume,
             capgrpMessage, capgrpMessage2, capgrpAmmostate);
@@ -171,7 +175,7 @@ type
             Handle: PTTF_Font;
             Height: LongInt;
             style: LongInt;
-            Name: string[21];
+            Name: string[31];
             end;
 
     PAmmo = ^TAmmo;
@@ -189,12 +193,12 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             end;
 
     TVertex2f = record
-        X, Y: GLfloat;
-        end;
+            X, Y: GLfloat;
+            end;
 
     TVertex2i = record
-        X, Y: GLint;
-        end;
+            X, Y: GLint;
+            end;
 
     PTexture = ^TTexture;
     TTexture = record
@@ -206,7 +210,7 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             PrevTexture, NextTexture: PTexture;
             end;
 
-    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected);
+    THogEffect = (heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen);
 
     TScreenFade = (sfNone, sfInit, sfToBlack, sfFromBlack, sfToWhite, sfFromWhite);
 
@@ -246,7 +250,8 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             Tag: LongInt;
             Tex: PTexture;
             Z: Longword;
-            IntersectGear: PGear;
+            CollisionMask: Word;
+            LinkedGear: PGear;
             FlightTime: Longword;
             uid: Longword;
             ImpactSound: TSound; // first sound, others have to be after it in the sounds def.
@@ -254,8 +259,12 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             SoundChannel: LongInt;
             PortalCounter: LongWord;  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
             LastDamage: PHedgehog;
+            end;
+    TPGearArray = array of PGear;
+    PGearArrayS = record
+        size: LongWord;
+        ar: ^TPGearArray;
         end;
-    TPGearArray = Array of PGear;
 
     PVisualGear = ^TVisualGear;
     TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword);
@@ -305,7 +314,7 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
         TeamDamage : Longword;
         end;
 
-    TBinds = array[0..cKeyMaxIndex] of shortstring;
+    TBinds = array[0..cKbdMaxIndex] of shortstring;
     TKeyboardState = array[0..cKeyMaxIndex] of Byte;
 
     PVoicepack = ^TVoicepack;
@@ -319,11 +328,11 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
         voicepack: PVoicePack;
         end;
 
-    PHHAmmo = ^THHAmmo;
     THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo;
+    PHHAmmo = ^THHAmmo;
 
     THedgehog = record
-            Name: string[MAXNAMELEN];
+            Name: shortstring;
             Gear: PGear;
             GearHidden: PGear;
             SpeechGear: PVisualGear;
@@ -332,6 +341,8 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             HatTex: PTexture;
             Ammo: PHHAmmo;
             CurAmmoType: TAmmoType;
+            PickUpType: LongWord;
+            PickUpDelay: LongInt;
             AmmoStore: Longword;
             Team: PTeam;
             MultiShootAttacks: Longword;
@@ -344,12 +355,12 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             King: boolean;  // Flag for a bunch of hedgehog attributes
             Unplaced: boolean;  // Flag for hog placing mode
             Timer: Longword;
-            Effects: Array[THogEffect] of boolean;
+            Effects: array[THogEffect] of LongInt;
             end;
 
     TTeam = record
             Clan: PClan;
-            TeamName: string[MAXNAMELEN];
+            TeamName: shortstring;
             ExtDriven: boolean;
             Binds: TBinds;
             Hedgehogs: array[0..cMaxHHIndex] of THedgehog;
@@ -396,29 +407,62 @@ For example, say, a mode where the weaponset is reset each turn, or on sudden de
             sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane,
             sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime,
             sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack,
-            sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, sidSineGun, sidFlamethrower,
-            sidSMine, sidHammer, sidResurrector, sidDrillStrike, sidSnowball, sidNothing, sidTardis, sidStructure, sidLandGun);
+            sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb,
+            sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector,
+            sidDrillStrike, sidSnowball, sidNothing, sidTardis,
+            sidStructure, sidLandGun, sidIceGun, sidKnife);
 
     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
             sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady, 
-            sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce);
+            sidBounce1, sidBounce2, sidBounce3, sidBounce4, sidBounce5, sidBounce,
+            sidMute);
 
     // Events that are important for the course of the game or at least interesting for other reasons
     TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,
-            eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
-            eidHomerun, eidGone);
+            eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped,
+            eidHurtSelf, eidHomerun, eidGone);
 
     TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable,
             gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery,
-            gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, gidRandomMineTimer,
-            gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam);
+            gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, 
+            gidRandomMineTimer, gidDamageModifier, gidResetHealth, gidAISurvival, 
+            gidInfAttack, gidResetWeps, gidPerHogAmmo, gidTagTeam);
 
     TLandArray = packed array of array of LongWord;
     TCollisionArray = packed array of array of Word;
     TPreview  = packed array[0..127, 0..31] of byte;
     TDirtyTag = packed array of array of byte;
 
+    PWidgetMovement = ^TWidgetMovement;
+    TWidgetMovement = record
+        animate   : Boolean;
+        source    : TPoint;
+        target    : TPoint;
+        startTime : Longword;
+        end;
+
+    POnScreenWidget = ^TOnScreenWidget;
+    TOnScreenWidget = record
+        show          : boolean;                      // if false widget will not be drawn
+        sprite        : TSprite;                    // a convenience type
+        frame         : TSDL_Rect;                   // graphical coordinates
+        active        : TSDL_Rect;                  // active touch region
+        fadeAnimStart : Longword;            // time the fade started, 0 means don't fade
+        moveAnim      : TWidgetMovement;          // the animation associated to the widget
+        end;
+
+{$IFDEF SDL13}
+    PTouch_Data = ^TTouch_Data;
+    TTouch_Data = record
+        id                       : TSDL_FingerId;
+        x,y                      : LongInt;
+        dx,dy                    : LongInt;
+        historicalX, historicalY : LongInt;
+        timeSinceDown            : Longword;
+        pressedWidget            : POnScreenWidget;
+        end;
+{$ENDIF}
 
 implementation
 
diff --git a/hedgewars/uUtils.pas b/hedgewars/uUtils.pas
index e3dc925..a1c7787 100644
--- a/hedgewars/uUtils.pas
+++ b/hedgewars/uUtils.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -24,25 +24,29 @@ interface
 uses uTypes, uFloat, GLunit;
 
 procedure SplitBySpace(var a, b: shortstring);
+procedure SplitByChar(var a, b: shortstring; c: char);
 procedure SplitByChar(var a, b: ansistring; c: char);
 
+{$IFNDEF PAS2C}
 function  EnumToStr(const en : TGearType) : shortstring; overload;
 function  EnumToStr(const en : TVisualGearType) : shortstring; overload;
 function  EnumToStr(const en : TSound) : shortstring; overload;
 function  EnumToStr(const en : TAmmoType) : shortstring; overload;
 function  EnumToStr(const en : THogEffect) : shortstring; overload;
 function  EnumToStr(const en : TCapGroup) : shortstring; overload;
+{$ENDIF}
 
 function  Min(a, b: LongInt): LongInt; inline;
 function  Max(a, b: LongInt): LongInt; inline;
 
 function  IntToStr(n: LongInt): shortstring;
+function  StrToInt(s: shortstring): LongInt;
 function  FloatToStr(n: hwFloat): shortstring;
 
-function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
+function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
 function  DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt;
-function  DxDy2AttackAngle(const _dY, _dX: extended): LongInt;
+function  DxDy2AttackAnglef(const _dY, _dX: extended): LongInt;
 
 procedure SetLittle(var r: hwFloat);
 
@@ -57,35 +61,53 @@ function  endian(independent: LongWord): LongWord; inline;
 function  CheckCJKFont(s: ansistring; font: THWFont): THWFont;
 
 procedure AddFileLog(s: shortstring);
+procedure AddFileLogRaw(s: pchar); cdecl;
 
 function  CheckNoTeamOrHH: boolean; inline;
 
 function  GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt;
 function  GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
 
-procedure initModule;
+{$IFNDEF PAS2C}
+procedure Write(var f: textfile; s: shortstring);
+procedure WriteLn(var f: textfile; s: shortstring);
+{$ENDIF}
+
+procedure initModule(isNotPreview: boolean);
 procedure freeModule;
 
 
 implementation
-uses typinfo, Math, uConsts, uVariables, SysUtils;
+uses {$IFNDEF PAS2C}typinfo, {$ENDIF}Math, uConsts, uVariables, SysUtils;
 
 {$IFDEF DEBUGFILE}
 var f: textfile;
+{$IFDEF USE_VIDEO_RECORDING}
+    logMutex: TRTLCriticalSection; // mutex for debug file
 {$ENDIF}
+{$ENDIF}
+var CharArray: array[byte] of Char;
+
+procedure SplitBySpace(var a,b: shortstring);
+begin
+SplitByChar(a,b,' ');
+end;
 
 // should this include "strtolower()" for the split string?
-procedure SplitBySpace(var a, b: shortstring);
+procedure SplitByChar(var a, b: shortstring; c : char);
 var i, t: LongInt;
 begin
-i:= Pos(' ', a);
+i:= Pos(c, a);
 if i > 0 then
     begin
     for t:= 1 to Pred(i) do
-        if (a[t] >= 'A')and(a[t] <= 'Z') then Inc(a[t], 32);
+        if (a[t] >= 'A')and(a[t] <= 'Z') then
+            Inc(a[t], 32);
     b:= copy(a, i + 1, Length(a) - i);
-    byte(a[0]):= Pred(i)
-    end else b:= '';
+    a[0]:= char(Pred(i))
+    end
+else
+    b:= '';
 end;
 
 procedure SplitByChar(var a, b: ansistring; c: char);
@@ -99,6 +121,7 @@ if i > 0 then
     end else b:= '';
 end;
 
+{$IFNDEF PAS2C}
 function EnumToStr(const en : TGearType) : shortstring; overload;
 begin
 EnumToStr:= GetEnumName(TypeInfo(TGearType), ord(en))
@@ -127,16 +150,22 @@ function EnumToStr(const en: TCapGroup) : shortstring; overload;
 begin
 EnumToStr := GetEnumName(TypeInfo(TCapGroup), ord(en))
 end;
-
+{$ENDIF}
 
 function Min(a, b: LongInt): LongInt;
 begin
-if a < b then Min:= a else Min:= b
+if a < b then
+    Min:= a
+else
+    Min:= b
 end;
 
 function Max(a, b: LongInt): LongInt;
 begin
-if a > b then Max:= a else Max:= b
+if a > b then
+    Max:= a
+else
+    Max:= b
 end;
 
 
@@ -145,19 +174,23 @@ begin
 str(n, IntToStr)
 end;
 
+function  StrToInt(s: shortstring): LongInt;
+var c: LongInt;
+begin
+val(s, StrToInt, c)
+end;
+
 function FloatToStr(n: hwFloat): shortstring;
 begin
 FloatToStr:= cstr(n) + '_' + inttostr(Lo(n.QWordValue))
 end;
 
 
-function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
+function DxDy2Angle(const _dY, _dX: hwFloat): GLfloat; inline;
 var dY, dX: Extended;
 begin
-dY:= _dY.QWordValue / $100000000;
-if _dY.isNegative then dY:= - dY;
-dX:= _dX.QWordValue / $100000000;
-if _dX.isNegative then dX:= - dX;
+dY:= hwFloat2Float(_dY);
+dX:= hwFloat2Float(_dX);
 DxDy2Angle:= arctan2(dY, dX) * 180 / pi
 end;
 
@@ -165,10 +198,8 @@ function DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
 const _16divPI: Extended = 16/pi;
 var dY, dX: Extended;
 begin
-dY:= _dY.QWordValue / $100000000;
-if _dY.isNegative then dY:= - dY;
-dX:= _dX.QWordValue / $100000000;
-if _dX.isNegative then dX:= - dX;
+dY:= hwFloat2Float(_dY);
+dX:= hwFloat2Float(_dX);
 DxDy2Angle32:= trunc(arctan2(dY, dX) * _16divPI) and $1f
 end;
 
@@ -176,16 +207,14 @@ function DxDy2AttackAngle(const _dY, _dX: hwFloat): LongInt;
 const MaxAngleDivPI: Extended = cMaxAngle/pi;
 var dY, dX: Extended;
 begin
-dY:= _dY.QWordValue / $100000000;
-if _dY.isNegative then dY:= - dY;
-dX:= _dX.QWordValue / $100000000;
-if _dX.isNegative then dX:= - dX;
+dY:= hwFloat2Float(_dY);
+dX:= hwFloat2Float(_dX);
 DxDy2AttackAngle:= trunc(arctan2(dY, dX) * MaxAngleDivPI)
 end;
 
-function DxDy2AttackAngle(const _dY, _dX: extended): LongInt; inline;
+function DxDy2AttackAnglef(const _dY, _dX: extended): LongInt; inline;
 begin
-DxDy2AttackAngle:= trunc(arctan2(_dY, _dX) * (cMaxAngle/pi))
+DxDy2AttackAnglef:= trunc(arctan2(_dY, _dX) * (cMaxAngle/pi))
 end;
 
 
@@ -215,8 +244,12 @@ c:= 0;
 for i:= 1 to Length(s) do
     begin
     t:= Pos(s[i], table);
-    if s[i] = '=' then inc(c);
-    if t > 0 then byte(s[i]):= t - 1 else byte(s[i]):= 0
+    if s[i] = '=' then
+        inc(c);
+    if t > 0 then
+        s[i]:= char(t - 1)
+    else
+        s[i]:= #0
     end;
 
 i:= 1;
@@ -230,14 +263,14 @@ while i <= length(s) do
     inc(i, 4)
     end;
 
-if c < 3 then t:= t - c;
+if c < 3 then
+    t:= t - c;
 
-byte(DecodeBase64[0]):= t - 1
+DecodeBase64[0]:= char(t - 1)
 end;
 
 
 function Str2PChar(const s: shortstring): PChar;
-const CharArray: array[byte] of Char = '';
 begin
 CharArray:= s;
 CharArray[Length(s)]:= #0;
@@ -262,23 +295,44 @@ procedure AddFileLog(s: shortstring);
 begin
 s:= s;
 {$IFDEF DEBUGFILE}
-writeln(f, GameTicks: 6, ': ', s);
-flush(f)
+{$IFDEF USE_VIDEO_RECORDING}
+EnterCriticalSection(logMutex);
+{$ENDIF}
+writeln(f, inttostr(GameTicks)  + ': ' + s);
+flush(f);
+{$IFDEF USE_VIDEO_RECORDING}
+LeaveCriticalSection(logMutex);
+{$ENDIF}
 {$ENDIF}
 end;
 
+procedure AddFileLogRaw(s: pchar); cdecl;
+begin
+s:= s;
+{$IFDEF DEBUGFILE}
+{$IFDEF USE_VIDEO_RECORDING}
+EnterCriticalSection(logMutex);
+{$ENDIF}
+write(f, s);
+flush(f);
+{$IFDEF USE_VIDEO_RECORDING}
+LeaveCriticalSection(logMutex);
+{$ENDIF}
+{$ENDIF}
+end;
 
 function CheckCJKFont(s: ansistring; font: THWFont): THWFont;
 var l, i : LongInt;
     u: WideChar;
     tmpstr: array[0..256] of WideChar;
 begin
+CheckCJKFont:= font;
 
-{$IFNDEF IPHONEOS}
+{$IFNDEF MOBILE}
 // remove chinese fonts for now
 if (font >= CJKfnt16) or (length(s) = 0) then
 {$ENDIF}
-    exit(font);
+    exit;
 
 l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
 i:= 0;
@@ -297,10 +351,13 @@ while i < l do
        ((#$AC00  <= u) and (u <= #$D7AF))  or // Hangul Syllables
        ((#$F900  <= u) and (u <= #$FAFF))  or // CJK Compatibility Ideographs
        ((#$FE30  <= u) and (u <= #$FE4F)))    // CJK Compatibility Forms
-       then exit(THWFont( ord(font) + ((ord(High(THWFont))+1) div 2) ));
+       then 
+        begin
+            CheckCJKFont:=  THWFont( ord(font) + ((ord(High(THWFont))+1) div 2) );
+            exit;
+        end;
     inc(i)
     end;
-exit(font);
 (* two more to check. pascal WideChar is only 16 bit though
        ((#$20000 <= u) and (u >= #$2A6DF)) or // CJK Unified Ideographs Extension B
        ((#$2F800 <= u) and (u >= #$2FA1F)))   // CJK Compatibility Ideographs Supplement *)
@@ -309,7 +366,7 @@ end;
 
 function GetLaunchX(at: TAmmoType; dir: LongInt; angle: LongInt): LongInt;
 begin
-    GetLaunchX:= 0
+GetLaunchX:= 0
 (*
     if (Ammoz[at].ejectX <> 0) or (Ammoz[at].ejectY <> 0) then
         GetLaunchX:= sign(dir) * (8 + hwRound(AngleSin(angle) * Ammoz[at].ejectX) + hwRound(AngleCos(angle) * Ammoz[at].ejectY))
@@ -319,7 +376,7 @@ end;
 
 function GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
 begin
-    GetLaunchY:= 0
+GetLaunchY:= 0
 (*
     if (Ammoz[at].ejectX <> 0) or (Ammoz[at].ejectY <> 0) then
         GetLaunchY:= hwRound(AngleSin(angle) * Ammoz[at].ejectY) - hwRound(AngleCos(angle) * Ammoz[at].ejectX) - 2
@@ -332,13 +389,41 @@ begin
 CheckNoTeamOrHH:= (CurrentTeam = nil) or (CurrentHedgehog^.Gear = nil);
 end;
 
-procedure initModule;
-{$IFDEF DEBUGFILE}{$IFNDEF IPHONEOS}var i: LongInt;{$ENDIF}{$ENDIF}
+{$IFNDEF PAS2C}
+procedure Write(var f: textfile; s: shortstring);
+begin
+system.write(f, s)
+end;
+
+procedure WriteLn(var f: textfile; s: shortstring);
+begin
+system.writeln(f, s)
+end;
+{$ENDIF}
+
+procedure initModule(isNotPreview: boolean);
+{$IFDEF DEBUGFILE}
+var logfileBase: shortstring;
+{$IFNDEF MOBILE}var i: LongInt;{$ENDIF}
+{$ENDIF}
 begin
 {$IFDEF DEBUGFILE}
+    if isNotPreview then
+    begin
+        if GameType = gmtRecord then
+            logfileBase:= 'rec'
+        else
+            logfileBase:= 'game';
+    end
+    else
+        logfileBase:= 'preview';
+{$IFDEF USE_VIDEO_RECORDING}
+    InitCriticalSection(logMutex);
+{$ENDIF}
 {$I-}
-{$IFDEF IPHONEOS}
-    Assign(f,'../Documents/hw-' + cLogfileBase + '.log');
+{$IFDEF MOBILE}
+    {$IFDEF IPHONEOS} Assign(f, UserPathPrefix + '/hw-' + logfileBase + '.log'); {$ENDIF}
+    {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + logfileBase + '.log'); {$ENDIF}
     Rewrite(f);
 {$ELSE}
     if (UserPathPrefix <> '') then
@@ -346,12 +431,14 @@ begin
             i:= 0;
             while(i < 7) do
             begin
-                assign(f, UserPathPrefix + '/Logs/' + cLogfileBase + inttostr(i) + '.log');
+                assign(f, UserPathPrefix + '/Logs/' + logfileBase + inttostr(i) + '.log');
                 rewrite(f);
-                if IOResult = 0 then break;
+                if IOResult = 0 then
+                    break;
                 inc(i)
             end;
-            if i = 7 then f:= stderr; // if everything fails, write to stderr
+            if i = 7 then
+                f:= stderr; // if everything fails, write to stderr
         end
     else
         f:= stderr;
@@ -363,12 +450,13 @@ end;
 
 procedure freeModule;
 begin
-    recordFileName:= '';
-
 {$IFDEF DEBUGFILE}
-    writeln(f, 'halt at ', GameTicks, ' ticks. TurnTimeLeft = ', TurnTimeLeft);
+    writeln(f, 'halt at ' + inttostr(GameTicks) + ' ticks. TurnTimeLeft = ' + inttostr(TurnTimeLeft));
     flush(f);
     close(f);
+{$IFDEF USE_VIDEO_RECORDING}
+    DoneCriticalSection(logMutex);
+{$ENDIF}
 {$ENDIF}
 end;
 
diff --git a/hedgewars/uVariables.pas b/hedgewars/uVariables.pas
index 0c54d51..9ce625e 100644
--- a/hedgewars/uVariables.pas
+++ b/hedgewars/uVariables.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -16,7 +16,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-{$INCLUDE options.inc}
+{$INCLUDE "options.inc"}
 
 unit uVariables;
 interface
@@ -25,54 +25,58 @@ uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uMobile;
 
 var
 /////// init flags ///////
-    cMinScreenWidth    : LongInt     = 640;
-    cMinScreenHeight   : LongInt     = 480;
-    cScreenWidth       : LongInt     = 1024;
-    cScreenHeight      : LongInt     = 768;
-    cOrigScreenWidth   : LongInt     = 1024;
-    cOrigScreenHeight  : LongInt     = 768;
-    cNewScreenWidth    : LongInt     = 1024;
-    cNewScreenHeight   : LongInt     = 768;
-    cScreenResizeDelay : LongWord    = 0;
-    cBits           : LongInt     = 32;
-    ipcPort         : Word        = 0;
-    cFullScreen     : boolean     = false;
-    isSoundEnabled  : boolean     = true;
-    isMusicEnabled  : boolean     = false;
-    cLocaleFName    : shortstring = 'en.txt';
-    cLocale         : shortstring = 'en';
-    cInitVolume     : LongInt     = 100;
-    cTimerInterval  : LongInt     = 8;
-    PathPrefix      : shortstring = './';
-    UserPathPrefix  : shortstring = './';
-    cShowFPS        : boolean     = false;
-    cFlattenFlakes  : boolean     = false;
-    cFlattenClouds  : boolean     = false;
-    cAltDamage      : boolean     = true;
-    cReducedQuality : LongWord    = rqNone;
-    UserNick        : shortstring = '';
-    recordFileName  : shortstring = '';
-    cReadyDelay     : Longword    = 5000;
-    cLogfileBase    : shortstring = 'debug';
-    cStereoMode     : TStereoMode = smNone;
-    cOnlyStats      : boolean = False;
+    cMinScreenWidth    : LongInt;
+    cMinScreenHeight   : LongInt;
+    cScreenWidth       : LongInt;
+    cScreenHeight      : LongInt;
+    cOrigScreenWidth   : LongInt;
+    cOrigScreenHeight  : LongInt;
+    cNewScreenWidth    : LongInt;
+    cNewScreenHeight   : LongInt;
+    cScreenResizeDelay : LongWord;
+    cBits              : LongInt;
+    ipcPort            : Word;
+    cFullScreen        : boolean;
+    cLocaleFName       : shortstring;
+    cLocale            : shortstring;
+    cTimerInterval     : LongInt;
+    PathPrefix         : shortstring;
+    UserPathPrefix     : shortstring;
+    cShowFPS           : boolean;
+    cFlattenFlakes     : boolean;
+    cFlattenClouds     : boolean;
+    cAltDamage         : boolean;
+    cReducedQuality    : LongWord;
+    UserNick           : shortstring;
+    recordFileName     : shortstring;
+    cReadyDelay        : Longword;
+    cStereoMode        : TStereoMode;
+    cOnlyStats         : boolean;
+{$IFDEF USE_VIDEO_RECORDING}
+    RecPrefix          : shortstring;
+    cAVFormat          : shortstring;
+    cVideoCodec        : shortstring;
+    cVideoFramerateNum : LongInt;
+    cVideoFramerateDen : LongInt;
+    cVideoQuality      : LongInt;
+    cAudioCodec        : shortstring;
+{$ENDIF}
 //////////////////////////
-
-    alsoShutdownFrontend: boolean = false;
-
+    cMapName        : shortstring;
     isCursorVisible : boolean;
-    isTerminated    : boolean;
     isInLag         : boolean;
     isPaused        : boolean;
-
-    isSEBackup      : boolean;
     isInMultiShoot  : boolean;
     isSpeed         : boolean;
-    isFirstFrame    : boolean;
+    SpeedStart      : LongWord;
 
     fastUntilLag    : boolean;
+    fastScrolling   : boolean;
     autoCameraOn    : boolean;
 
+    CheckSum        : LongWord;
+    CampaignVariable: shortstring;
+    GameTicks       : LongWord;
     GameState       : TGameState;
     GameType        : TGameType;
     InputMask       : LongWord;
@@ -106,18 +110,22 @@ var
 
     cWaterLine       : Word;
     cGearScrEdgesDist: LongInt;
+    isAudioMuted     : boolean;
 
-    GameTicks   : LongWord;
+    // originally typed consts
+    ExplosionBorderColor: LongWord;
+    WaterOpacity: byte;
+    SDWaterOpacity: byte;
+    GrayScale: Boolean;
 
     // originally from uConsts
     Pathz: array[TPathType] of shortstring;
     UserPathz: array[TPathType] of shortstring;
-    CountTexz: array[1..Pred(AMMO_INFINITE)] of PTexture;
+    CountTexz: array[0..Pred(AMMO_INFINITE)] of PTexture;
     LAND_WIDTH       : Word;
     LAND_HEIGHT      : Word;
     LAND_WIDTH_MASK  : LongWord;
     LAND_HEIGHT_MASK : LongWord;
-    cMaxCaptions     : LongInt;
 
     cLeftScreenBorder     : LongInt;
     cRightScreenBorder    : LongInt;
@@ -136,7 +144,8 @@ var
     bBetweenTurns   : boolean;
     bWaterRising    : boolean;
 
-    //ShowCrosshair   : boolean;  This variable is inconvenient to set.  Easier to decide when rendering
+    CrosshairX      : LongInt;
+    CrosshairY      : LongInt;
     CursorMovementX : LongInt;
     CursorMovementY : LongInt;
     cDrownSpeed     : hwFloat;
@@ -151,8 +160,12 @@ var
     cVampiric       : boolean;
     cArtillery      : boolean;
     WeaponTooltipTex: PTexture;
+    AmmoMenuTex     : PTexture;
+    AmmoMenuInvalidated: boolean;
+    AmmoRect		: TSDL_Rect;
     HHTexture       : PTexture;
 
+
     flagMakeCapture : boolean;
 
     InitStepsFlags  : Longword;
@@ -161,7 +174,6 @@ var
 
     WaterColorArray : array[0..3] of HwColor4f;
     SDWaterColorArray : array[0..3] of HwColor4f;
-    SDMusic         : shortstring;
     SDTint          : LongInt;
 
     CursorPoint     : TPoint;
@@ -173,12 +185,6 @@ var
 
     Theme           : shortstring;
     disableLandBack : boolean;
-    conversionFormat: PSDL_PixelFormat;
-
-{$IFDEF SDL13}
-    SDLwindow       : PSDL_Window;
-    SDLGLcontext    : PSDL_GLContext;
-{$ENDIF}
 
     WorldDx: LongInt;
     WorldDy: LongInt;
@@ -186,19 +192,41 @@ var
     hiTicks: Word;
 
     LuaGoals        : shortstring;
+    hiddenHedgehogs : array [0..cMaxHHs] of PHedgehog;
+    hiddenHedgehogsNumber : longint;
 
-const
-    cHHFileName = 'Hedgehog';
-    cCHFileName = 'Crosshair';
-    cThemeCFGFilename = 'theme.cfg';
+    LuaTemplateNumber : LongWord;
 
-    FontBorder = 2;
+    VoiceList : array[0..7] of TVoice =  (
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil));
+    LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
+
+/////////////////////////////////////
+//Buttons
+{$IFDEF USE_TOUCH_INTERFACE}
+    buttonScale: GLFloat;
+
+    arrowUp, arrowDown, arrowLeft, arrowRight : TOnScreenWidget;
+    firebutton, jumpWidget, AMWidget          : TOnScreenWidget;
+    pauseButton, utilityWidget                : TOnScreenWidget;
+{$ENDIF}
+
+
+var
+    // these consts are here because they would cause circular dependencies in uConsts/uTypes
     cPathz: array[TPathType] of shortstring = (
         '',                              // ptNone
         '',                              // ptData
         'Graphics',                      // ptGraphics
         'Themes',                        // ptThemes
-        'Themes/avematan',               // ptCurrTheme
+        'Themes/Bamboo',                 // ptCurrTheme
         'Teams',                         // ptTeams
         'Maps',                          // ptMaps
         '',                              // ptMapCurrent
@@ -214,23 +242,10 @@ const
         'Graphics/Hats',                 // ptHats
         'Graphics/Flags',                // ptFlags
         'Missions/Maps',                 // ptMissionMaps
-        'Graphics/SuddenDeath'           // ptSuddenDeath
+        'Graphics/SuddenDeath',           // ptSuddenDeath
+        'Graphics/Buttons'                // ptButton
     );
 
-    cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
-    cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
-
-    VoiceList : array[0..7] of TVoice =  (
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil));
-    LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
-
     Fontz: array[THWFont] of THHFont = (
             (Handle: nil;
             Height: 12;
@@ -244,7 +259,7 @@ const
             Height: 10;
             style: TTF_STYLE_NORMAL;
             Name: 'DejaVuSans-Bold.ttf')
-            {$IFNDEF IPHONEOS}, // remove chinese fonts for now
+            {$IFNDEF MOBILE}, // remove chinese fonts for now
             (Handle: nil;
             Height: 12;
             style: TTF_STYLE_NORMAL;
@@ -260,8 +275,9 @@ const
             {$ENDIF}
             );
 
+var
     SpritesData: array[TSprite] of record
-            FileName: String[16];
+            FileName: string[15];
             Path, AltPath: TPathType;
             Texture: PTexture;
             Surface: PSDL_Surface;
@@ -328,14 +344,12 @@ const
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky
             (FileName:       'SkyR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil;
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky
-            (FileName:  'BorderHorizontal'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 33; Height:  2; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: true),// sprAMBorderHorizontal
-            (FileName:  'BorderVertical'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 2; Height: 33; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: true),// sprAMBorderVertical
             (FileName:   'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 33; Height: 33; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot
+            Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot
             (FileName:      'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMAmmos
+            (FileName:   'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprAMAmmosBW
             (FileName:   'SlotKeys'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlotKeys
             (FileName:  'Corners'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -370,6 +384,28 @@ const
             Width:  80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindL
             (FileName:      'WindR'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindR
+{$IFDEF USE_TOUCH_INTERFACE}
+            (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton
+            (FileName: 'arrowUp'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowUp
+            (FileName: 'arrowDown'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowDown
+            (FileName: 'arrowLeft'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowLeft
+            (FileName: 'arrowRight'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 100; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprArrowRight
+            (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprAMWidget
+            (FileName: 'backjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprJumpWidget
+            (FileName: 'pause'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 120; Height: 100; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprPauseButton
+            (FileName: 'pause'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;//TODO correct image
+            Width: 120; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTimerButton
+            (FileName: 'forwardjump'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;//TODO correct image
+            Width: 120; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprTargetButton
+{$ENDIF}
             (FileName:      'Flake'; Path:ptCurrTheme; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprFlake
             (FileName:     'amRope'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -403,7 +439,7 @@ const
             (FileName:     'Mortar'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMortar
             (FileName:  'TurnsLeft'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprTurnsLeft
+            Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprTurnsLeft
             (FileName: 'amKamikaze'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 128; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprKamikaze
             (FileName:     'amWhip'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -430,8 +466,6 @@ const
             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprCakeWalk
             (FileName:  'Cake_down'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprCakeDown
-            (FileName:   'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprAMAmmosBW
             (FileName: 'Watermelon'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWatermelon
             (FileName:  'EvilTrace'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -579,13 +613,13 @@ const
             (FileName:   'amSMine'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandSMine
             (FileName:  'amHammer'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 128; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprWhip
+            Width: 128; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprHammer
             (FileName: 'amResurrector'; Path: ptHedgehog; AltPath: ptNone;
                 Texture: nil; Surface: nil; Width: 32; Height: 32;
                 imageWidth: 0; imageHeight: 0; saveSurf: false; priority:
                 tpMedium; getDimensions: false; getImageDimensions: true),
             //sprHandResurrector
-            (FileName: 'Cross'; Path: ptGraphics; altPath: ptNone;
+            (FileName: 'Cross'; Path: ptGraphics; AltPath: ptNone;
                 Texture: nil; Surface: nil; Width: 108; Height: 138;
                 imageWidth: 0; imageHeight: 0; saveSurf: false; priority:
                 tpMedium; getDimensions: false; getImageDimensions: true),
@@ -622,15 +656,29 @@ const
             (FileName:  'SDDroplet'; Path: ptCurrTheme; AltPath: ptSuddenDeath; Texture: nil; Surface: nil;
             Width:  16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprSDDroplet
             (FileName:  'TARDIS'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width:  48; Height: 79; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true)// sprTardis
+            Width:  48; Height: 79; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHighest; getDimensions: false; getImageDimensions: true),// sprTardis
+            (FileName:  'slider'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 3; Height: 17; imageWidth: 3; imageHeight: 17; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprSlider
+            (FileName:  'botlevels'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 22; Height: 15; imageWidth: 22; imageHeight: 15; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprBotlevels
+         (*   (FileName:  'amKnife'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandKnife*)
+            (FileName:  'amCleaver'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  64; Height: 64; imageWidth: 64; imageHeight: 64; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: false),// sprHandKnife
+            (*(FileName:  'knife'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 29; Height: 14; imageWidth: 64; imageHeight: 64; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprKnife*)
+            (FileName:  'cleaver'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 64; Height: 64; imageWidth: 64; imageHeight: 128; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprKnife
+            (FileName:  'star'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 12; Height: 12; imageWidth: 12; imageHeight: 12; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprStar
             );
 
-
+const
     Wavez: array [TWave] of record
             Sprite: TSprite;
             FramesCount: Longword;
             Interval: Longword;
-            cmd: String[20];
+            cmd: string[31];
             Voice: TSound;
             VoiceDelay: LongWord;
             end = (
@@ -644,7 +692,7 @@ const
             );
 
     Soundz: array[TSound] of record
-            FileName: String[25];
+            FileName: string[31];
             Path    : TPathType;
             end = (
             (FileName:                         ''; Path: ptNone  ),// sndNone
@@ -759,10 +807,10 @@ const
             (FileName:            'parachute.ogg'; Path: ptSounds),// sndParachute
             (FileName:                 'bump.ogg'; Path: ptSounds),// sndBump
             (FileName:            'hogchant3.ogg'; Path: ptSounds),// sndResurrector
-            (FileName:                'plane.ogg'; Path: ptSounds), // sndPlane
-            (FileName:                'TARDIS.ogg'; Path: ptSounds) // sndTardis
+            (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
+            (FileName:               'TARDIS.ogg'; Path: ptSounds) // sndTardis
             );
-
+var
     Ammoz: array [TAmmoType] of record
             NameId: TAmmoStrId;
             NameTex: PTexture;
@@ -805,7 +853,11 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Timerable or ammoprop_Power or ammoprop_AltUse or ammoprop_SetBounce;
+            Ammo: (Propz: ammoprop_Timerable or 
+                          ammoprop_Power or 
+                          ammoprop_AltUse or 
+                          ammoprop_SetBounce or
+                          ammoprop_NeedUpDown;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 3000;
@@ -829,7 +881,11 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 3;
-            Ammo: (Propz: ammoprop_Timerable or ammoprop_Power or ammoprop_AltUse or ammoprop_SetBounce;
+            Ammo: (Propz: ammoprop_Timerable or 
+                          ammoprop_Power or 
+                          ammoprop_AltUse or 
+                          ammoprop_SetBounce or
+                          ammoprop_NeedUpDown;
                 Count: 5;
                 NumPerTurn: 0;
                 Timer: 3000;
@@ -853,7 +909,9 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Power or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_Power or 
+                          ammoprop_AltUse or
+                          ammoprop_NeedUpDown;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -877,7 +935,10 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Power or ammoprop_NeedTarget or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_Power or 
+                          ammoprop_NeedTarget or 
+                          ammoprop_DontHold or
+                          ammoprop_NeedUpDown;
                 Count: 2;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -901,7 +962,8 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs;
+            Ammo: (Propz: ammoprop_ForwMsgs or
+                          ammoprop_NeedUpDown;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 1;
                 Timer: 0;
@@ -925,7 +987,10 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInMove or ammoprop_NoCrosshair or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_AttackInMove or 
+                          ammoprop_NoCrosshair or 
+                          ammoprop_DontHold;
                 Count: 2;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -949,7 +1014,8 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_NoCrosshair or 
+                          ammoprop_DontHold;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -977,7 +1043,8 @@ const
                           ammoprop_ForwMsgs or
                           ammoprop_AttackInMove or
                           ammoprop_Utility or
-                          ammoprop_AltAttack;
+                          ammoprop_AltAttack or
+                          ammoprop_NeedUpDown;
                     Count: 5;
                     NumPerTurn: 0;
                     Timer: 0;
@@ -1001,7 +1068,11 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_AttackInMove or ammoprop_DontHold or ammoprop_AltUse or ammoprop_SetBounce;
+            Ammo: (Propz: ammoprop_NoCrosshair or 
+                          ammoprop_AttackInMove or 
+                          ammoprop_DontHold or 
+                          ammoprop_AltUse or 
+                          ammoprop_SetBounce;
                 Count: 2;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1025,7 +1096,7 @@ const
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: 0;
+            Ammo: (Propz: ammoprop_NeedUpDown;
                 Count: 3;
                 NumPerTurn: 3;
                 Timer: 0;
@@ -1049,7 +1120,10 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_AttackInMove or ammoprop_DontHold or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_NoCrosshair or 
+                          ammoprop_AttackInMove or 
+                          ammoprop_DontHold or 
+                          ammoprop_AltUse;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1073,7 +1147,9 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_NoCrosshair or ammoprop_ForwMsgs or ammoprop_AttackInMove;
+            Ammo: (Propz: ammoprop_NoCrosshair or 
+                          ammoprop_ForwMsgs or 
+                          ammoprop_AttackInMove;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1083,7 +1159,7 @@ const
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -1107,7 +1183,7 @@ const
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -1121,7 +1197,8 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_DontHold or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1151,7 +1228,8 @@ const
                           ammoprop_NoCrosshair or
                           ammoprop_DontHold or
                           ammoprop_Utility or
-                          ammoprop_AltAttack;
+                          ammoprop_AltAttack or
+                          ammoprop_NeedUpDown;
                 Count: 2;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1176,10 +1254,10 @@ const
             Probability: 100;
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_NoCrosshair or
-                            ammoprop_NeedTarget or
-                            ammoprop_AttackingPut or
-                            ammoprop_DontHold or
-                            ammoprop_NotBorder;
+                          ammoprop_NeedTarget or
+                          ammoprop_AttackingPut or
+                          ammoprop_DontHold or
+                          ammoprop_NotBorder;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1204,10 +1282,10 @@ const
             Probability: 200;
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_NoCrosshair or
-                            ammoprop_NeedTarget or
-                            ammoprop_AttackingPut or
-                            ammoprop_DontHold or
-                            ammoprop_NotBorder;
+                          ammoprop_NeedTarget or
+                          ammoprop_AttackingPut or
+                          ammoprop_DontHold or
+                          ammoprop_NotBorder;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1231,7 +1309,8 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_ForwMsgs;
+            Ammo: (Propz: ammoprop_ForwMsgs or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1364,7 +1443,10 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_DontHold or ammoprop_AttackInMove;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_DontHold or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_AttackInMove;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1388,7 +1470,10 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_NoCrosshair or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_NoCrosshair or 
+                          ammoprop_DontHold or
+                          ammoprop_Track;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1412,7 +1497,9 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_DontHold or ammoprop_NoCrosshair;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_DontHold or
+                          ammoprop_NoCrosshair;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1436,7 +1523,10 @@ const
             NameTex: nil;
             Probability: 400;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Timerable or ammoprop_Power or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_Timerable or 
+                          ammoprop_Power or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_AltUse;
                 Count: 0;
                 NumPerTurn: 0;
                 Timer: 3000;
@@ -1460,7 +1550,9 @@ const
             NameTex: nil;
             Probability: 400;
             NumberInCase: 1;
-            Ammo: (Propz:  ammoprop_Power or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_Power or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_AltUse;
                 Count: 0;
                 NumPerTurn: 0;
                 Timer: 5000;
@@ -1485,10 +1577,10 @@ const
             Probability: 100;
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_NoCrosshair or
-                            ammoprop_NeedTarget or
-                            ammoprop_AttackingPut or
-                            ammoprop_DontHold or
-                            ammoprop_NotBorder;
+                          ammoprop_NeedTarget or
+                          ammoprop_AttackingPut or
+                          ammoprop_DontHold or
+                          ammoprop_NotBorder;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1512,7 +1604,9 @@ const
             NameTex: nil;
             Probability: 300;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Power or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_Power or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_AltUse;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1536,7 +1630,9 @@ const
             NameTex: nil;
             Probability: 400;
             NumberInCase: 1;
-            Ammo: (Propz:  ammoprop_ForwMsgs or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_DontHold;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 5001;
@@ -1560,9 +1656,10 @@ const
             NameTex: nil;
             Probability: 200;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_ForwMsgs{ or
-                            ammoprop_DontHold or
-                            ammoprop_AltAttack};
+            Ammo: (Propz: ammoprop_ForwMsgs or
+                          ammoprop_NeedUpDown{ or
+                          ammoprop_DontHold or
+                          ammoprop_AltAttack};
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1707,6 +1804,7 @@ const
                           ammoprop_DontHold or
                           ammoprop_AltUse or
                           ammoprop_Utility or
+                          ammoprop_NeedUpDown or
                           ammoprop_Effect;
                     Count: 1;
                     NumPerTurn: 0;
@@ -1760,7 +1858,9 @@ const
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: 0;
+            Ammo: (Propz: ammoprop_NeedUpDown or 
+                    ammoprop_OscAim or
+                    ammoprop_NoMoveAfter;
                 Count: 2;
                 NumPerTurn: 1;
                 Timer: 0;
@@ -1790,6 +1890,7 @@ const
                           ammoprop_NoCrosshair or
                           ammoprop_DontHold or
                           ammoprop_Utility or
+                          ammoprop_NeedUpDown or
                           ammoprop_AltAttack;
                 Count: 1;
                 NumPerTurn: 0;
@@ -1814,7 +1915,9 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Power or ammoprop_AltUse;
+            Ammo: (Propz: ammoprop_Power or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_AltUse;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 3000;
@@ -1840,6 +1943,7 @@ const
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_ForwMsgs or
                           ammoprop_NoCrosshair or
+                          ammoprop_NeedUpDown or
                           ammoprop_DontHold;
                 Count: 1;
                 NumPerTurn: 0;
@@ -1867,6 +1971,7 @@ const
             Ammo: (Propz: ammoprop_NoRoundEnd or
                           ammoprop_AttackInMove or
                           ammoprop_DontHold or
+                          ammoprop_NeedUpDown or
                           ammoprop_Utility;
                 Count: 1;
                 NumPerTurn: 3;
@@ -1919,7 +2024,11 @@ const
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Timerable or ammoprop_Power or ammoprop_AltUse or ammoprop_SetBounce;
+            Ammo: (Propz: ammoprop_Timerable or 
+                          ammoprop_Power or 
+                          ammoprop_AltUse or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_SetBounce;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 0;
                 Timer: 3000;
@@ -1943,7 +2052,8 @@ const
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_AttackInMove;
+            Ammo: (Propz: ammoprop_AttackInMove or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 0;
@@ -1967,7 +2077,9 @@ const
             NameTex: nil;
             Probability: 20;
             NumberInCase: 1;
-            Ammo: (Propz:  ammoprop_ForwMsgs or ammoprop_DontHold;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_DontHold;
                 Count: 1;
                 NumPerTurn: 0;
                 Timer: 5001;
@@ -1991,7 +2103,9 @@ const
             NameTex: nil;
             Probability: 100;
             NumberInCase: 1;
-            Ammo: (Propz: ammoprop_Power; //FIXME: enable multishoot at altuse, until then removed ammoprop_AltUse
+            Ammo: (Propz: ammoprop_Power or
+                          ammoprop_AltUse or
+                          ammoprop_NeedUpDown;
                 Count: 1;
                 NumPerTurn: 1;
                 Timer: 0;
@@ -2025,7 +2139,7 @@ const
                 Bounciness: 1000);
             Slot: 3;
             TimeAfterTurn: 3000;
-            MinAngle: 0;
+            minAngle: 0;
             maxAngle: 0;
             isDamaging: true;
             SkipTurns: 0;
@@ -2192,26 +2306,78 @@ const
             PosCount: 1;
             PosSprite: sprWater;
             ejectX: 0; //20;
-            ejectY: -3)
+            ejectY: -3),
+// Freezer
+            (NameId: sidIceGun;
+            NameTex: nil;
+            Probability: 20;
+            NumberInCase: 1;
+            Ammo: (Propz: ammoprop_ForwMsgs or 
+                          ammoprop_NeedUpDown or
+                          ammoprop_DontHold;
+                Count: 1;
+                NumPerTurn: 0;
+                Timer: 5001;
+                Pos: 0;
+                AmmoType: amIceGun;
+                AttackVoice: sndNone;
+                Bounciness: 1000);
+            Slot: 9;
+            TimeAfterTurn: 0;
+            minAngle: 0;
+            maxAngle: 0;
+            isDamaging: true;
+            SkipTurns: 0;
+            PosCount: 1;
+            PosSprite: sprWater;
+            ejectX: 0; //20;
+            ejectY: -3),
+// Knife
+            (NameId: sidKnife;
+            NameTex: nil;
+            Probability: 100;
+            NumberInCase: 1;
+            Ammo: (Propz: ammoprop_Power or
+                          ammoprop_AltUse or
+                          ammoprop_NeedUpDown;
+                Count: 1;
+                NumPerTurn: 1;
+                Timer: 0;
+                Pos: 0;
+                AmmoType: amKnife;
+                AttackVoice: sndNone;
+                Bounciness: 1000);
+            Slot: 6;
+            TimeAfterTurn: 3000;
+            minAngle: 0;
+            maxAngle: 0;
+            isDamaging: true;
+            SkipTurns: 0;
+            PosCount: 1;
+            PosSprite: sprWater;
+            ejectX: 0;
+            ejectY: 0)
         );
 
+const
     GearKindAmmoTypeMap : array [TGearType] of TAmmoType = (    
-(*        gtGrenade *)   amGrenade
+(*          gtFlame *)   amNothing
 (*       gtHedgehog *) , amNothing
+(*           gtMine *) , amMine
+(*           gtCase *) , amNothing
+(*     gtExplosives *) , amNothing
+(*        gtGrenade *) , amGrenade
 (*          gtShell *) , amBazooka
 (*          gtGrave *) , amNothing
 (*            gtBee *) , amBee
 (*    gtShotgunShot *) , amShotgun
 (*     gtPickHammer *) , amPickHammer
 (*           gtRope *) , amRope
-(*           gtMine *) , amNothing
-(*           gtCase *) , amNothing
 (*     gtDEagleShot *) , amDEagle
 (*       gtDynamite *) , amDynamite
 (*    gtClusterBomb *) , amClusterBomb
 (*        gtCluster *) , amClusterBomb
 (*         gtShover *) , amBaseballBat  // Shover is only used for baseball bat right now
-(*          gtFlame *) , amNothing
 (*      gtFirePunch *) , amFirePunch
 (*    gtATStartGame *) , amNothing
 (*   gtATFinishGame *) , amNothing
@@ -2239,7 +2405,6 @@ const
 (*gtSniperRifleShot *) , amSniperRifle
 (*        gtJetpack *) , amJetpack
 (*        gtMolotov *) , amMolotov
-(*     gtExplosives *) , amNothing
 (*          gtBirdy *) , amBirdy
 (*            gtEgg *) , amBirdy
 (*         gtPortal *) , amPortalGun
@@ -2258,6 +2423,10 @@ const
 (*      gtStructure *) , amStructure  // TODO - This will undoubtedly change once there is more than one structure
 (*        gtLandGun *) , amLandGun
 (*         gtTardis *) , amTardis
+(*         gtIceGun *) , amIceGun
+(*        gtAddAmmo *) , amNothing
+(*  gtGenericFaller *) , amNothing
+(*          gtKnife *) , amKnife
     );
 
 var
@@ -2266,10 +2435,8 @@ var
     LandDirty: TDirtyTag;
     hasBorder: boolean;
     hasGirders: boolean;
-    isMap: boolean;
     playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword;  // idea is that a template can specify height/width.  Or, a map, a height/width by the dimensions of the image.  If the map has pixels near top of image, it triggers border.
     LandBackSurface: PSDL_Surface;
-    digest: shortstring;
     CurAmmoGear: PGear;
     lastGearByUID: PGear;
     GearsList: PGear;
@@ -2280,7 +2447,6 @@ var
     SuddenDeathDmg: Boolean;
     SpeechType: Longword;
     SpeechText: shortstring;
-    skipFlag: boolean;
     PlacingHogs: boolean; // a convenience flag to indicate placement of hogs is still in progress
     StepSoundTimer: LongInt;
     StepSoundChannel: LongInt;
@@ -2296,7 +2462,6 @@ var
     LocalTeam: LongInt;  // last non-bot, non-extdriven clan first team
     LocalAmmo: LongInt;  // last non-bot, non-extdriven clan's first team's ammo index, updated to next upcoming hog for per-hog-ammo
     CurMinAngle, CurMaxAngle: Longword;
-    GameOver: boolean;
     NextClan: boolean;
 
     FollowGear: PGear;
@@ -2317,7 +2482,6 @@ var
     bAFRRight: Boolean;
 
 
-    SDLPrimSurface: PSDL_Surface;
     PauseTexture,
     SyncTexture,
     ConfirmTexture: PTexture;
@@ -2329,12 +2493,15 @@ var
     ProgrTex: PTexture;
     MissionIcons: PSDL_Surface;
     ropeIconTex: PTexture;
-    // orientation of the viewport
-    rotationQt: GLfloat;
+
     // stereoscopic framebuffer and textures
     framel, framer, depthl, depthr: GLuint;
     texl, texr: GLuint;
 
+    // video recorder framebuffer and texture
+    defaultFrame, depthv: GLuint;
+    texv: GLuint;
+
     VisualGearLayers: array[0..6] of PVisualGear;
     lastVisualGearByUID: PVisualGear;
     vobFrameTicks, vobFramesCount, vobCount: Longword;
@@ -2342,10 +2509,7 @@ var
     vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword;
     vobSDVelocity, vobSDFallSpeed: LongInt;
 
-
     hideAmmoMenu: boolean;
-    wheelUp: boolean;
-    wheelDown: boolean;
 
     ControllerNumControllers: Integer;
     ControllerEnabled: Integer;
@@ -2358,29 +2522,9 @@ var
     ControllerHats: array[0..5] of array[0..19] of Byte;
     ControllerButtons: array[0..5] of array[0..19] of Byte;
 
-    DefaultBinds, CurrentBinds: TBinds;
+    DefaultBinds : TBinds;
 
-    coeff: LongInt;
-
-{$IFDEF HWLIBRARY}
-    leftClick: boolean;
-    middleClick: boolean;
-    rightClick: boolean;
-
-    upKey: boolean;
-    downKey: boolean;
-    rightKey: boolean;
-    leftKey: boolean;
-    preciseKey: boolean;
-
-    backspaceKey: boolean;
-    spaceKey: boolean;
-    enterKey: boolean;
-    tabKey: boolean;
-
-    chatAction: boolean;
-    pauseAction: boolean;
-{$ENDIF}
+    lastTurnChecksum : Longword;
 
 var trammo:  array[TAmmoStrId] of ansistring;   // name of the weapon
     trammoc: array[TAmmoStrId] of ansistring;   // caption of the weapon
@@ -2388,18 +2532,63 @@ var trammo:  array[TAmmoStrId] of ansistring;   // name of the weapon
     trmsg:   array[TMsgStrId]  of ansistring;   // message of the event
     trgoal:  array[TGoalStrId] of ansistring;   // message of the goal
 
+procedure preInitModule;
 procedure initModule;
 procedure freeModule;
 
 implementation
 
 
+procedure preInitModule;
+begin
+    // initialisation flags - they are going to be overwritten by program args
+
+    cScreenWidth    := 1024;
+    cScreenHeight   := 768;
+    cBits           := 32;
+    cShowFPS        := false;
+    cAltDamage      := true;
+    cTimerInterval  := 8;
+    cReducedQuality := rqNone;
+    cLocaleFName    := 'en.txt';
+    cFullScreen     := false;
+
+    UserPathPrefix  := '';
+    ipcPort         := 0;
+    UserNick        := '';
+    cStereoMode     := smNone;
+    GrayScale       := false;
+    PathPrefix      := './';
+    GameType        := gmtLocal;
+
+{$IFDEF USE_VIDEO_RECORDING}
+    RecPrefix          := '';
+    cAVFormat          := '';
+    cVideoCodec        := '';
+    cVideoFramerateNum := 0;
+    cVideoFramerateDen := 0;
+    cVideoQuality      := 0;
+    cAudioCodec        := '';
+{$ENDIF}
+end;
+
 procedure initModule;
 begin
-    lastVisualGearByUID:= nil;
-    lastGearByUID:= nil;
-    
-    Pathz:= cPathz;
+
+    if (Length(cLocaleFName) > 6) then
+        cLocale := Copy(cLocaleFName,1,5)
+    else
+        cLocale := Copy(cLocaleFName,1,2);
+
+    cFlattenFlakes      := false;
+    cFlattenClouds      := false;
+    cOnlyStats          := False;
+    lastVisualGearByUID := nil;
+    lastGearByUID       := nil;
+    recordFileName      := '';
+    cReadyDelay         := 5000;
+    Pathz               := cPathz;
+
         {*  REFERENCE
       4096 -> $FFFFF000
       2048 -> $FFFFF800
@@ -2430,9 +2619,10 @@ begin
     SDWaterColorArray[2].a := 255;
     SDWaterColorArray[1]:= SDWaterColorArray[0];
     SDWaterColorArray[3]:= SDWaterColorArray[2];
-
-    SDMusic:= 'hell.ogg';
+    SDWaterOpacity:= $80;
     SDTint:= $80;
+    ExplosionBorderColor:= $FF808080;
+    WaterOpacity:= $80;
 
     cDrownSpeed.QWordValue  := 257698038;       // 0.06
     cDrownSpeedf            := 0.06;
@@ -2448,6 +2638,7 @@ begin
     CursorMovementX     := 0;
     CursorMovementY     := 0;
     GameTicks           := 0;
+    CheckSum            := 0;
     cWaterLine          := LAND_HEIGHT;
     cGearScrEdgesDist   := 240;
 
@@ -2481,7 +2672,6 @@ begin
     cExplosives     := 2;
 
     GameState       := Low(TGameState);
-    GameType        := gmtLocal;
     zoom            := cDefaultZoomLevel;
     ZoomValue       := cDefaultZoomLevel;
     WeaponTooltipTex:= nil;
@@ -2492,14 +2682,13 @@ begin
     bBetweenTurns   := false;
     bWaterRising    := false;
     isCursorVisible := false;
-    isTerminated    := false;
     isInLag         := false;
     isPaused        := false;
     isInMultiShoot  := false;
     isSpeed         := false;
+    SpeedStart      := 0;
     fastUntilLag    := false;
-    isFirstFrame    := true;
-    isSEBackup      := true;
+    fastScrolling   := false;
     autoCameraOn    := true;
     cScriptName     := '';
     cSeed           := '';
@@ -2509,23 +2698,18 @@ begin
     ReadyTimeLeft   := 0;
     
     disableLandBack := false;
-
     ScreenFade      := sfNone;
 
-{$IFDEF SDL13}
-    SDLwindow       := nil;
-    SDLGLcontext    := nil;
-{$ENDIF}
-
     // those values still are not perfect
     cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
     cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
     cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
 
-    if isPhone() then
-        cMaxCaptions:= 3
-    else
-        cMaxCaptions:= 4;
+    vobFrameTicks:= 99999;
+    vobFramesCount:= 4;
+    vobCount:= 0;
+    vobVelocity:= 10;
+    vobFallSpeed:= 100;
 
     vobSDFrameTicks:= 99999;
     vobSDFramesCount:= 4;
@@ -2533,34 +2717,24 @@ begin
     vobSDVelocity:= 15;
     vobSDFallSpeed:= 250;
 
+    cMinScreenWidth:= min(cScreenWidth, 640);
+    cMinScreenHeight:= min(cScreenHeight, 480);
+    cOrigScreenWidth:= cScreenWidth;
+    cOrigScreenHeight:= cScreenHeight;
+
+    cNewScreenWidth    := cScreenWidth;
+    cNewScreenHeight   := cScreenHeight;
+    cScreenResizeDelay := 0;
+
     LuaGoals:= '';
+    cMapName:= '';
+
+    LuaTemplateNumber:= 0;
+    hiddenHedgehogsNumber:=0;
 end;
 
 procedure freeModule;
 begin
-    // re-init flags so they will always contain safe values
-    cScreenWidth    := 1024;
-    cScreenHeight   := 768;
-    cBits           := 32;
-    ipcPort         := 0;
-    cFullScreen     := false;
-    isSoundEnabled  := true;
-    isMusicEnabled  := false;
-    cLocaleFName    := 'en.txt';
-    cInitVolume     := 100;
-    cTimerInterval  := 8;
-    PathPrefix      := './';
-    UserPathPrefix  := './';
-    cShowFPS        := false;
-    cFlattenFlakes  := false;
-    cFlattenClouds  := false;
-    cAltDamage      := true;
-    cReducedQuality := rqNone;
-    UserNick        := '';
-    recordFileName  := '';
-    cScriptName     := '';
-    cReadyDelay     := 5000;
-    cStereoMode     := smNone;
 end;
 
 end.
diff --git a/hedgewars/uVideoRec.pas b/hedgewars/uVideoRec.pas
new file mode 100644
index 0000000..1f27973
--- /dev/null
+++ b/hedgewars/uVideoRec.pas
@@ -0,0 +1,382 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+
+{$INCLUDE "options.inc"}
+
+unit uVideoRec;
+
+{$IFNDEF USE_VIDEO_RECORDING}
+interface
+implementation
+end.
+{$ELSE}
+
+{$IFNDEF WIN32}
+    {$LINKLIB ../bin/libavwrapper.a}
+{$ENDIF}
+{$IFDEF DARWIN}
+    {$LINKLIB bz2}
+    {$LINKFRAMEWORK CoreVideo}
+    {$LINKFRAMEWORK VideoDecodeAcceleration}
+{$ENDIF}
+
+interface
+
+var flagPrerecording: boolean = false;
+
+function BeginVideoRecording: Boolean;
+function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
+procedure EncodeFrame;
+procedure StopVideoRecording;
+
+procedure BeginPreRecording;
+procedure StopPreRecording;
+procedure SaveCameraPosition;
+
+procedure initModule;
+procedure freeModule;
+
+implementation
+
+uses uVariables, uUtils, GLunit, SDLh, SysUtils, uIO, uMisc, uTypes;
+
+type TAddFileLogRaw = procedure (s: pchar); cdecl;
+
+procedure AVWrapper_Init(
+              AddLog: TAddFileLogRaw;
+              filename, desc, soundFile, format, vcodec, acodec: PChar;
+              width, height, framerateNum, framerateDen, vquality: LongInt); cdecl; external {$IFDEF WIN32}'libavwrapper.dll'{$ENDIF};
+procedure AVWrapper_Close; cdecl; external {$IFDEF WIN32}'libavwrapper.dll'{$ENDIF};
+procedure AVWrapper_WriteFrame( pY, pCb, pCr: PByte ); cdecl; external {$IFDEF WIN32}'libavwrapper.dll'{$ENDIF};
+
+type TFrame = record
+                  realTicks: LongWord;
+                  gameTicks: LongWord;
+                  CamX, CamY: LongInt;
+                  zoom: single;
+              end;
+
+var YCbCr_Planes: array[0..2] of PByte;
+    RGB_Buffer: PByte;
+    cameraFile: File of TFrame;
+    audioFile: File;
+    numPixels: LongWord;
+    startTime, numFrames, curTime, progress, maxProgress: LongWord;
+    soundFilePath: shortstring;
+    thumbnailSaved : Boolean;
+
+function BeginVideoRecording: Boolean;
+var filename, desc: shortstring;
+begin
+    AddFileLog('BeginVideoRecording');
+
+{$IOCHECKS OFF}
+    // open file with prerecorded camera positions
+    filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.txtin';
+    Assign(cameraFile, filename);
+    Reset(cameraFile);
+    maxProgress:= FileSize(cameraFile);
+    if IOResult <> 0 then
+    begin
+        AddFileLog('Error: Could not read from ' + filename);
+        exit(false);
+    end;
+{$IOCHECKS ON}
+
+    // store some description in output file
+    desc:= '';
+    if UserNick <> '' then
+        desc:= desc + 'Player: ' + UserNick + #10;
+    if recordFileName <> '' then
+        desc:= desc + 'Record: ' + recordFileName + #10;
+    if cMapName <> '' then
+        desc:= desc + 'Map: ' + cMapName + #10;
+    if Theme <> '' then
+        desc:= desc + 'Theme: ' + Theme + #10;
+    desc:= desc + 'prefix[' + RecPrefix + ']prefix';
+
+    filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix;
+    soundFilePath:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.sw';
+
+    AVWrapper_Init(@AddFileLogRaw
+        , PChar(ansistring(filename))
+        , PChar(ansistring(desc))
+        , PChar(ansistring(soundFilePath))
+        , PChar(ansistring(cAVFormat))
+        , PChar(ansistring(cVideoCodec))
+        , PChar(ansistring(cAudioCodec))
+        , cScreenWidth, cScreenHeight, cVideoFramerateNum, cVideoFramerateDen, cVideoQuality);
+
+    numPixels:= cScreenWidth*cScreenHeight;
+    YCbCr_Planes[0]:= GetMem(numPixels);
+    YCbCr_Planes[1]:= GetMem(numPixels div 4);
+    YCbCr_Planes[2]:= GetMem(numPixels div 4);
+
+    if (YCbCr_Planes[0] = nil) or (YCbCr_Planes[1] = nil) or (YCbCr_Planes[2] = nil) then
+    begin
+        AddFileLog('Error: Could not allocate memory for video recording (YCbCr buffer).');
+        exit(false);
+    end;
+
+    RGB_Buffer:= GetMem(4*numPixels);
+    if RGB_Buffer = nil then
+    begin
+        AddFileLog('Error: Could not allocate memory for video recording (RGB buffer).');
+        exit(false);
+    end;
+
+    curTime:= 0;
+    numFrames:= 0;
+    progress:= 0;
+    BeginVideoRecording:= true;
+end;
+
+procedure StopVideoRecording;
+begin
+    AddFileLog('StopVideoRecording');
+    FreeMem(YCbCr_Planes[0], numPixels);
+    FreeMem(YCbCr_Planes[1], numPixels div 4);
+    FreeMem(YCbCr_Planes[2], numPixels div 4);
+    FreeMem(RGB_Buffer, 4*numPixels);
+    Close(cameraFile);
+    AVWrapper_Close();
+    Erase(cameraFile);
+    DeleteFile(soundFilePath);
+    SendIPC(_S'v'); // inform frontend that we finished
+end;
+
+function pixel(x, y, color: LongInt): LongInt;
+begin
+    pixel:= RGB_Buffer[(cScreenHeight-y-1)*cScreenWidth*4 + x*4 + color];
+end;
+
+procedure EncodeFrame;
+var x, y, r, g, b: LongInt;
+    s: shortstring;
+begin
+    // read pixels from OpenGL
+    glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_RGBA, GL_UNSIGNED_BYTE, RGB_Buffer);
+
+    // convert to YCbCr 4:2:0 format
+    // Y
+    for y := 0 to cScreenHeight-1 do
+        for x := 0 to cScreenWidth-1 do
+            YCbCr_Planes[0][y*cScreenWidth + x]:= Byte(16 + ((16828*pixel(x,y,0) + 33038*pixel(x,y,1) + 6416*pixel(x,y,2)) shr 16));
+
+    // Cb and Cr
+    for y := 0 to cScreenHeight div 2 - 1 do
+        for x := 0 to cScreenWidth div 2 - 1 do
+        begin
+            r:= pixel(2*x,2*y,0) + pixel(2*x+1,2*y,0) + pixel(2*x,2*y+1,0) + pixel(2*x+1,2*y+1,0);
+            g:= pixel(2*x,2*y,1) + pixel(2*x+1,2*y,1) + pixel(2*x,2*y+1,1) + pixel(2*x+1,2*y+1,1);
+            b:= pixel(2*x,2*y,2) + pixel(2*x+1,2*y,2) + pixel(2*x,2*y+1,2) + pixel(2*x+1,2*y+1,2);
+            YCbCr_Planes[1][y*(cScreenWidth div 2) + x]:= Byte(128 + ((-2428*r - 4768*g + 7196*b) shr 16));
+            YCbCr_Planes[2][y*(cScreenWidth div 2) + x]:= Byte(128 + (( 7196*r - 6026*g - 1170*b) shr 16));
+        end;
+
+    AVWrapper_WriteFrame(YCbCr_Planes[0], YCbCr_Planes[1], YCbCr_Planes[2]);
+
+    // inform frontend that we have encoded new frame
+    s[0]:= #3;
+    s[1]:= 'p'; // p for progress
+    SDLNet_Write16(progress*10000 div maxProgress, @s[2]);
+    SendIPC(s);
+    inc(numFrames);
+end;
+
+function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
+var frame: TFrame;
+begin
+    // we need to skip or duplicate frames to match target framerate
+    while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
+    begin
+    {$IOCHECKS OFF}
+        if eof(cameraFile) then
+            exit(false);
+        BlockRead(cameraFile, frame, 1);
+    {$IOCHECKS ON}
+        curTime:= frame.realTicks;
+        WorldDx:= frame.CamX;
+        WorldDy:= frame.CamY + cScreenHeight div 2;
+        zoom:= frame.zoom*cScreenWidth;
+        ZoomValue:= zoom;
+        inc(progress);
+        newRealTicks:= frame.realTicks;
+        newGameTicks:= frame.gameTicks;
+    end;
+    LoadNextCameraPosition:= true;
+end;
+
+// Callback which records sound.
+// This procedure may be called from different thread.
+procedure RecordPostMix(udata: pointer; stream: PByte; len: LongInt); cdecl;
+begin
+    udata:= udata; // avoid warning
+{$IOCHECKS OFF}
+    BlockWrite(audioFile, stream^, len);
+{$IOCHECKS ON}
+end;
+
+procedure SaveThumbnail;
+var thumbpath: shortstring;
+    k: LongInt;
+begin
+    thumbpath:= '/VideoTemp/' + RecPrefix;
+    AddFileLog('Saving thumbnail ' + thumbpath);
+    k:= max(max(cScreenWidth, cScreenHeight) div 400, 1); // here 400 is minimum size of thumbnail
+    MakeScreenshot(thumbpath, k);
+    thumbnailSaved:= true;
+end;
+
+// copy file (free pascal doesn't have copy file function)
+procedure CopyFile(src, dest: shortstring);
+var inF, outF: file;
+    buffer: array[0..1023] of byte;
+    result: LongInt;
+begin
+{$IOCHECKS OFF}
+    result:= 0; // avoid compiler hint
+
+    Assign(inF, src);
+    Reset(inF, 1);
+    if IOResult <> 0 then
+    begin
+        AddFileLog('Error: Could not read from ' + src);
+        exit;
+    end;
+
+    Assign(outF, dest);
+    Rewrite(outF, 1);
+    if IOResult <> 0 then
+    begin
+        AddFileLog('Error: Could not write to ' + dest);
+        exit;
+    end;
+
+    repeat
+        BlockRead(inF, buffer, 1024, result);
+        BlockWrite(outF, buffer, result);
+    until result < 1024;
+{$IOCHECKS ON}
+end;
+
+procedure BeginPreRecording;
+var format: word;
+    filename: shortstring;
+    frequency, channels: LongInt;
+begin
+    AddFileLog('BeginPreRecording');
+
+    thumbnailSaved:= false;
+    RecPrefix:= 'hw-' + FormatDateTime('YYYY-MM-DD_HH-mm-ss-z', Now());
+
+    // If this video is recorded from demo executed directly (without frontend)
+    // then we need to copy demo so that frontend will be able to find it later.
+    if recordFileName <> '' then
+    begin
+        if GameType <> gmtDemo then // this is save and game demo is not recording, abort
+            exit;
+        CopyFile(recordFileName, UserPathPrefix + '/VideoTemp/' + RecPrefix + '.hwd');
+    end;
+
+    Mix_QuerySpec(@frequency, @format, @channels);
+    AddFileLog('sound: frequency = ' + IntToStr(frequency) + ', format = ' + IntToStr(format) + ', channels = ' + IntToStr(channels));
+    if format <> $8010 then
+    begin
+        // TODO: support any audio format
+        AddFileLog('Error: Unexpected audio format ' + IntToStr(format));
+        exit;
+    end;
+
+{$IOCHECKS OFF}
+    // create sound file
+    filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.sw';
+    Assign(audioFile, filename);
+    Rewrite(audioFile, 1);
+    if IOResult <> 0 then
+    begin
+        AddFileLog('Error: Could not write to ' + filename);
+        exit;
+    end;
+
+    // create file with camera positions
+    filename:= UserPathPrefix + '/VideoTemp/' + RecPrefix + '.txtout';
+    Assign(cameraFile, filename);
+    Rewrite(cameraFile);
+    if IOResult <> 0 then
+    begin
+        AddFileLog('Error: Could not write to ' + filename);
+        exit;
+    end;
+
+    // save audio parameters in sound file
+    BlockWrite(audioFile, frequency, 4);
+    BlockWrite(audioFile, channels, 4);
+{$IOCHECKS ON}
+
+    // register callback for actual audio recording
+    Mix_SetPostMix(@RecordPostMix, nil);
+
+    startTime:= SDL_GetTicks();
+    flagPrerecording:= true;
+end;
+
+procedure StopPreRecording;
+begin
+    AddFileLog('StopPreRecording');
+    flagPrerecording:= false;
+
+    // call SDL_LockAudio because RecordPostMix may be executing right now
+    SDL_LockAudio();
+    Close(audioFile);
+    Close(cameraFile);
+    Mix_SetPostMix(nil, nil);
+    SDL_UnlockAudio();
+
+    if not thumbnailSaved then
+        SaveThumbnail();
+end;
+
+procedure SaveCameraPosition;
+var frame: TFrame;
+begin
+    if (not thumbnailSaved) and (ScreenFade = sfNone) then
+        SaveThumbnail();
+
+    frame.realTicks:= SDL_GetTicks() - startTime;
+    frame.gameTicks:= GameTicks;
+    frame.CamX:= WorldDx;
+    frame.CamY:= WorldDy - cScreenHeight div 2;
+    frame.zoom:= zoom/cScreenWidth;
+    BlockWrite(cameraFile, frame, 1);
+end;
+
+procedure initModule;
+begin
+end;
+
+procedure freeModule;
+begin
+    if flagPrerecording then
+        StopPreRecording();
+end;
+
+end.
+
+{$ENDIF} // USE_VIDEO_RECORDING
diff --git a/hedgewars/uVisualGears.pas b/hedgewars/uVisualGears.pas
index add880d..15f559a 100644
--- a/hedgewars/uVisualGears.pas
+++ b/hedgewars/uVisualGears.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -34,22 +34,29 @@ uses uConsts, uFloat, GLunit, uTypes, uWorld;
 procedure initModule;
 procedure freeModule;
 
-function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
+function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
+function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
+function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear;
+
 procedure ProcessVisualGears(Steps: Longword);
-procedure KickFlakes(Radius, X, Y: LongInt);
 procedure DrawVisualGears(Layer: LongWord);
 procedure DeleteVisualGear(Gear: PVisualGear);
 function  VisualGearByUID(uid : Longword) : PVisualGear;
+
 procedure AddClouds;
-procedure ChangeToSDClouds;
 procedure AddFlakes;
-procedure ChangeToSDFlakes;
 procedure AddDamageTag(X, Y, Damage, Color: LongWord);
 
+procedure ChangeToSDClouds;
+procedure ChangeToSDFlakes;
+
+procedure KickFlakes(Radius, X, Y: LongInt);
+
 implementation
-uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils, uStore;
+uses uSound, uMobile, uVariables, uTextures, uRender, Math, uRenderUtils, uStore, uUtils;
 
 const cExplFrameTicks = 110;
+var VGCounter: LongWord;
 
 // For better maintainability the step handlers of visual gears are stored
 // in a separate file.
@@ -112,19 +119,29 @@ const doStepHandlers: array[TVisualGearType] of TVGearStepProcedure =
             @doStepStraightShot
         );
 
-function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
-const VGCounter: Longword = 0;
+function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
+begin
+    AddVisualGear:= AddVisualGear(X, Y, Kind, 0, false);
+end;
+
+function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
+begin
+    AddVisualGear:= AddVisualGear(X, Y, Kind, State, false);
+end;
+
+function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear;
 var gear: PVisualGear;
     t: Longword;
     sp: real;
 begin
 AddVisualGear:= nil;
-if ((GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet))) and // we are scrolling now
-   ((Kind <> vgtCloud) and not Critical) then exit;
+if ((GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) or fastScrolling) and // we are scrolling now
+   ((Kind <> vgtCloud) and (not Critical)) then
+       exit;
 
 if ((cReducedQuality and rqAntiBoom) <> 0) and
-   not Critical and
-   not (Kind in
+   (not Critical) and
+   (not (Kind in
    [vgtTeamHealthSorter,
     vgtSmallDamageTag,
     vgtSpeechBubble,
@@ -133,7 +150,9 @@ if ((cReducedQuality and rqAntiBoom) <> 0) and
     vgtSmokeTrace,
     vgtEvilTrace,
     vgtNote,
-    vgtSmoothWindBar]) then exit;
+    vgtSmoothWindBar])) then
+    
+        exit;
 
 inc(VGCounter);
 New(gear);
@@ -149,10 +168,12 @@ gear^.Layer:= 0;
 
 with gear^ do
     case Kind of
-    vgtFlake: begin
+    vgtFlake:
+                begin
                 Timer:= 0;
                 tdX:= 0;
                 tdY:= 0;
+                Scale:= 1.0;
                 if SuddenDeathDmg then
                     begin
                     FrameTicks:= random(vobSDFrameTicks);
@@ -163,105 +184,135 @@ with gear^ do
                     FrameTicks:= random(vobFrameTicks);
                     Frame:= random(vobFramesCount);
                     end;
-                Angle:= random * 360;
+                Angle:= random(360);
                 dx:= 0.0000038654705 * random(10000);
                 dy:= 0.000003506096 * random(7000);
-                if random(2) = 0 then dx := -dx;
-                if SuddenDeathDmg then dAngle:= (random(2) * 2 - 1) * (1 + random) * vobSDVelocity / 1000
-                else dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000
+                if random(2) = 0 then
+                    dx := -dx;
+                if SuddenDeathDmg then
+                    dAngle:= (random(2) * 2 - 1) * (vobSDVelocity + random(vobSDVelocity)) / 1000
+                else
+                    dAngle:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) / 1000
                 end;
-    vgtCloud: begin
+    vgtCloud:
+                begin
                 Frame:= random(4);
                 dx:= 0.5 + 0.1 * random(5); // how much the cloud will be affected by wind
                 timer:= random(4096);
+                Scale:= 1.0
                 end;
     vgtExplPart,
-    vgtExplPart2: begin
+    vgtExplPart2:
+                begin
                 t:= random(1024);
                 sp:= 0.001 * (random(95) + 70);
                 dx:= hwFloat2Float(AngleSin(t)) * sp;
                 dy:= hwFloat2Float(AngleCos(t)) * sp;
-                if random(2) = 0 then dx := -dx;
-                if random(2) = 0 then dy := -dy;
+                if random(2) = 0 then
+                    dx := -dx;
+                if random(2) = 0 then
+                    dy := -dy;
                 Frame:= 7 - random(3);
                 FrameTicks:= cExplFrameTicks
                 end;
-        vgtFire: begin
+        vgtFire:
+                begin
                 t:= random(1024);
                 sp:= 0.001 * (random(85) + 95);
                 dx:= hwFloat2Float(AngleSin(t)) * sp;
                 dy:= hwFloat2Float(AngleCos(t)) * sp;
-                if random(2) = 0 then dx := -dx;
-                if random(2) = 0 then dy := -dy;
+                if random(2) = 0 then
+                    dx := -dx;
+                if random(2) = 0 then
+                    dy := -dy;
                 FrameTicks:= 650 + random(250);
                 Frame:= random(8)
                 end;
-         vgtEgg: begin
+         vgtEgg:
+                begin
                 t:= random(1024);
                 sp:= 0.001 * (random(85) + 95);
                 dx:= hwFloat2Float(AngleSin(t)) * sp;
                 dy:= hwFloat2Float(AngleCos(t)) * sp;
-                if random(2) = 0 then dx := -dx;
-                if random(2) = 0 then dy := -dy;
+                if random(2) = 0 then
+                    dx := -dx;
+                if random(2) = 0 then
+                    dy := -dy;
                 FrameTicks:= 650 + random(250);
                 Frame:= 1
                 end;
         vgtShell: FrameTicks:= 500;
-    vgtSmallDamageTag: begin
+    vgtSmallDamageTag:
+                begin
                 gear^.FrameTicks:= 1100
                 end;
-    vgtBubble: begin
+    vgtBubble:
+                begin
                 dx:= 0.0000038654705 * random(10000);
                 dy:= 0;
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 FrameTicks:= 250 + random(1751);
                 Frame:= random(5)
                 end;
-    vgtSteam: begin
+    vgtSteam:
+                begin
                 dx:= 0.0000038654705 * random(10000);
                 dy:= 0.001 * (random(85) + 95);
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 Frame:= 7 - random(3);
                 FrameTicks:= cExplFrameTicks * 2;
                 end;
-    vgtAmmo: begin
+    vgtAmmo:
+                begin
                 alpha:= 1.0;
                 scale:= 1.0
                 end;
   vgtSmokeWhite,
-  vgtSmoke: begin
+  vgtSmoke:
+                begin
                 Scale:= 1.0;
                 dx:= 0.0002 * (random(45) + 10);
                 dy:= 0.0002 * (random(45) + 10);
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 Frame:= 7 - random(2);
                 FrameTicks:= cExplFrameTicks * 2;
                 end;
-  vgtDust: begin
+  vgtDust:
+                begin
                 dx:= 0.005 * (random(15) + 10);
                 dy:= 0.001 * (random(40) + 20);
                 if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then Tag:= 1
+                else Tag:= -1;
                 Frame:= 7 - random(2);
                 FrameTicks:= random(20) + 15;
                 end;
-  vgtSplash: begin
+  vgtSplash:
+                begin
                 dx:= 0;
                 dy:= 0;
                 FrameTicks:= 740;
                 Frame:= 19;
+                Scale:= 0.75;
+                Timer:= 1;
                 end;
-    vgtDroplet: begin
-                dx:= 0.001 * (random(75) + 15);
-                dy:= -0.001 * (random(80) + 120);
-                if random(2) = 0 then dx := -dx;
+    vgtDroplet:
+                begin
+                dx:= 0.001 * (random(180) - 90);
+                dy:= -0.001 * (random(160) + 40);
                 FrameTicks:= 250 + random(1751);
                 Frame:= random(3)
                 end;
-   vgtBeeTrace: begin
+   vgtBeeTrace:
+                begin
                 FrameTicks:= 1000;
                 Frame:= random(16);
                 end;
-    vgtSmokeRing: begin
+    vgtSmokeRing:
+                begin
                 dx:= 0;
                 dy:= 0;
                 FrameTicks:= 600;
@@ -271,17 +322,21 @@ with gear^ do
                 alpha:= 1;
                 angle:= random(360);
                 end;
-     vgtFeather: begin
+     vgtFeather:
+                begin
                 t:= random(1024);
                 sp:= 0.001 * (random(85) + 95);
                 dx:= hwFloat2Float(AngleSin(t)) * sp;
                 dy:= hwFloat2Float(AngleCos(t)) * sp;
-                if random(2) = 0 then dx := -dx;
-                if random(2) = 0 then dy := -dy;
+                if random(2) = 0 then
+                    dx := -dx;
+                if random(2) = 0 then
+                    dy := -dy;
                 FrameTicks:= 650 + random(250);
                 Frame:= 1
                 end;
-  vgtHealthTag: begin
+  vgtHealthTag:
+                begin
                 Frame:= 0;
                 Timer:= 1500;
                 dY:= -0.08;
@@ -289,64 +344,103 @@ with gear^ do
                 //gear^.Z:= 2002;
                 end;
   vgtSmokeTrace,
-  vgtEvilTrace: begin
+  vgtEvilTrace:
+                begin
                 gear^.X:= gear^.X - 16;
                 gear^.Y:= gear^.Y - 16;
                 gear^.State:= 8;
                 //gear^.Z:= cSmokeZ
                 end;
-vgtBigExplosion: begin
+vgtBigExplosion:
+                begin
                 gear^.Angle:= random(360);
                 end;
-      vgtChunk: begin
+      vgtChunk:
+                begin
                 gear^.Frame:= random(4);
                 t:= random(1024);
                 sp:= 0.001 * (random(85) + 47);
                 dx:= hwFloat2Float(AngleSin(t)) * sp;
                 dy:= hwFloat2Float(AngleCos(t)) * sp * -2;
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 end;
-      vgtNote: begin
+      vgtNote: 
+                begin
                 dx:= 0.005 * (random(15) + 10);
                 dy:= -0.001 * (random(40) + 20);
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 Frame:= random(4);
                 FrameTicks:= random(2000) + 1500;
                 end;
-  vgtBulletHit: begin
+  vgtBulletHit:
+                begin
                 dx:= 0;
                 dy:= 0;
                 FrameTicks:= 350;
                 Frame:= 7;
                 Angle:= 0;
                 end;
-vgtSmoothWindBar: Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
- vgtStraightShot: begin
+vgtSmoothWindBar: 
+                begin
+                Angle:= hwFloat2Float(cMaxWindSpeed)*2 / 1440; // seems rate below is supposed to change wind bar at 1px per 10ms. Max time, 1440ms. This tries to match the rate of change
+                Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
+                end;
+ vgtStraightShot:
+                begin
                 Angle:= 0;
                 Scale:= 1.0;
                 dx:= 0.001 * random(45);
                 dy:= 0.001 * (random(20) + 25);
                 State:= ord(sprHealth);
-                if random(2) = 0 then dx := -dx;
+                if random(2) = 0 then
+                    dx := -dx;
                 Frame:= 0;
                 FrameTicks:= random(750) + 1250;
                 State:= ord(sprSnowDust);
                 end;
         end;
 
-if State <> 0 then gear^.State:= State;
+if State <> 0 then
+    gear^.State:= State;
 
 case Gear^.Kind of
-    vgtFlake: if cFlattenFlakes then gear^.Layer:= 0
-              else if random(3) = 0 then gear^.Layer:= 0   // 33% - far back
-              else if random(3) = 0 then gear^.Layer:= 4   // 22% - mid-distance
-              else if random(3) <> 0 then gear^.Layer:= 5  // 30% - just behind land
-              else if random(2) = 0 then gear^.Layer:= 6   // 7% - just in front of land
-              else gear^.Layer:= 2;  // 7% - close up
+    vgtFlake: if cFlattenFlakes then
+        gear^.Layer:= 0
+              else if random(3) = 0 then 
+                  begin
+                  gear^.Scale:= 0.5;
+                  gear^.Layer:= 0   // 33% - far back
+                  end
+              else if random(3) = 0 then
+                  begin
+                  gear^.Scale:= 0.8;
+                  gear^.Layer:= 4   // 22% - mid-distance
+                  end
+              else if random(3) <> 0 then
+                  gear^.Layer:= 5  // 30% - just behind land
+              else if random(2) = 0 then
+                  gear^.Layer:= 6   // 7% - just in front of land
+              else
+                  begin
+                  gear^.Scale:= 1.5;
+                  gear^.Layer:= 2;  // 7% - close up
+                  end;
 
     vgtCloud: if cFlattenClouds then gear^.Layer:= 5
-              else if random(3) = 0 then gear^.Layer:= 0
-              else gear^.Layer:= random(2) + 4;
+              else if random(3) = 0 then
+                  begin
+                  gear^.Scale:= 0.25;
+                  gear^.Layer:= 0
+                  end
+              else if random(2) = 0 then
+                  gear^.Layer:= 5
+              else
+                  begin
+                  gear^.Scale:= 0.4;
+                  gear^.Layer:= 4
+                  end;
 
     // 0: this layer is very distant in the background when in stereo
     vgtTeamHealthSorter,
@@ -404,11 +498,15 @@ begin
     FreeTexture(Gear^.Tex);
     Gear^.Tex:= nil;
 
-    if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
-    if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear
-    else VisualGearLayers[Gear^.Layer]:= Gear^.NextGear;
+    if Gear^.NextGear <> nil then
+        Gear^.NextGear^.PrevGear:= Gear^.PrevGear;
+    if Gear^.PrevGear <> nil then
+        Gear^.PrevGear^.NextGear:= Gear^.NextGear
+    else
+        VisualGearLayers[Gear^.Layer]:= Gear^.NextGear;
 
-    if lastVisualGearByUID = Gear then lastVisualGearByUID:= nil;
+    if lastVisualGearByUID = Gear then
+        lastVisualGearByUID:= nil;
 
     Dispose(Gear);
 end;
@@ -417,17 +515,18 @@ procedure ProcessVisualGears(Steps: Longword);
 var Gear, t: PVisualGear;
     i: LongWord;
 begin
-if Steps = 0 then exit;
+if Steps = 0 then
+    exit;
 
 for i:= 0 to 6 do
     begin
     t:= VisualGearLayers[i];
     while t <> nil do
-          begin
-          Gear:= t;
-          t:= Gear^.NextGear;
-          Gear^.doStep(Gear, Steps)
-          end;
+        begin
+        Gear:= t;
+        t:= Gear^.NextGear;
+        Gear^.doStep(Gear, Steps)
+        end;
     end
 end;
 
@@ -435,30 +534,33 @@ procedure KickFlakes(Radius, X, Y: LongInt);
 var Gear, t: PVisualGear;
     dmg, i: LongInt;
 begin
-if (vobCount = 0) or (vobCount > 200) then exit;
+if (vobCount = 0) or (vobCount > 200) then
+    exit;
 for i:= 2 to 6 do
     if i <> 3 then
         begin
         t:= VisualGearLayers[i];
         while t <> nil do
-              begin
-              Gear:= t;
-              if Gear^.Kind = vgtFlake then
-                  begin
-                  // Damage calc from doMakeExplosion
-                  dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5);
-                  if dmg > 1 then
-                      begin
-                      Gear^.tdX:= 0.02 * dmg + 0.01;
-                      if Gear^.X - X < 0 then Gear^.tdX := -Gear^.tdX;
-                      Gear^.tdY:= 0.02 * dmg + 0.01;
-                      if Gear^.Y - Y < 0 then Gear^.tdY := -Gear^.tdY;
-                      Gear^.Timer:= 200
-                      end
-                  end;
-              t:= Gear^.NextGear
-              end
-         end
+            begin
+            Gear:= t;
+            if Gear^.Kind = vgtFlake then
+                begin
+                // Damage calc from doMakeExplosion
+                dmg:= Min(101, Radius + cHHRadius div 2 - LongInt(abs(round(Gear^.X) - X) + abs(round(Gear^.Y) - Y)) div 5);
+                if dmg > 1 then
+                    begin
+                    Gear^.tdX:= 0.02 * dmg + 0.01;
+                    if Gear^.X - X < 0 then
+                        Gear^.tdX := -Gear^.tdX;
+                    Gear^.tdY:= 0.02 * dmg + 0.01;
+                    if Gear^.Y - Y < 0 then
+                        Gear^.tdY := -Gear^.tdY;
+                    Gear^.Timer:= 200
+                    end
+                end;
+            t:= Gear^.NextGear
+            end
+        end
 end;
 
 procedure DrawVisualGears(Layer: LongWord);
@@ -470,43 +572,44 @@ begin
 case Layer of
     // this layer is very distant in the background when stereo
     0: begin
-       Gear:= VisualGearLayers[0];
-       while Gear <> nil do
-           begin
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
-           case Gear^.Kind of
+        Gear:= VisualGearLayers[0];
+        while Gear <> nil do
+            begin
+            if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
+            case Gear^.Kind of
               vgtCloud: if SuddenDeathDmg then
-                             DrawTextureF(SpritesData[sprSDCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
+                             DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
                          else
-                            DrawTextureF(SpritesData[sprCloud].Texture, 0.25, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
+                            DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
                vgtFlake: if cFlattenFlakes then
                              begin
                              if SuddenDeathDmg then
                                  if vobSDVelocity = 0 then
                                      DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                                  else
-                                     DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                                     DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
                              else
                                  if vobVelocity = 0 then
                                      DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                                  else
-                                     DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                                     DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
                              end
                          else
                              begin
                              if SuddenDeathDmg then
                                  if vobSDVelocity = 0 then
-                                     DrawTextureF(SpritesData[sprSDFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                                     DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
                                  else
-                                     DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
+                                     DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
                              else
                                  if vobVelocity = 0 then
-                                     DrawTextureF(SpritesData[sprFlake].Texture, 0.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                                     DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
                                  else
-                                     DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
+                                     DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
                              end;
                end;
-           if Gear^.Tint <> $FFFFFFFF then Tint($FF,$FF,$FF,$FF);
+           if Gear^.Tint <> $FFFFFFFF then
+               Tint($FF,$FF,$FF,$FF);
            Gear:= Gear^.NextGear
            end
        end;
@@ -516,20 +619,23 @@ case Layer of
        while Gear <> nil do
           begin
           //tinted:= false;
-          if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
+          if Gear^.Tint <> $FFFFFFFF then
+              Tint(Gear^.Tint);
           case Gear^.Kind of
               vgtFlake: if SuddenDeathDmg then
                              if vobSDVelocity = 0 then
                                  DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                              else
-                                 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                                 DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
                          else
                              if vobVelocity = 0 then
                                  DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                              else
-                                 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
-              vgtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
-              vgtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
+                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
+              vgtSmokeTrace: if Gear^.State < 8 then
+                  DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
+              vgtEvilTrace: if Gear^.State < 8 then
+                  DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
               vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF));
           end;
           if (cReducedQuality and rqAntiBoom) = 0 then
@@ -537,17 +643,19 @@ case Layer of
                   vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 1, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height);
                   vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame);
                   vgtDust: if Gear^.State = 1 then
-                               DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame)
+                               DrawSpriteRotatedF(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle)
                            else
-                               DrawSprite(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame);
+                               DrawSpriteRotatedF(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle);
                   vgtFire: if (Gear^.State and gstTmpFlag) = 0 then
                                DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8)
                            else
                                DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16);
                   vgtSplash: if SuddenDeathDmg then
-                                 DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37))
+                                 //DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37))
+                                 DrawTextureF(SpritesData[sprSDSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height)
                              else
-                                 DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37));
+                                 //DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37));
+                                 DrawTextureF(SpritesData[sprSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height);
                   vgtDroplet: if SuddenDeathDmg then
                                   DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame)
                               else
@@ -555,7 +663,8 @@ case Layer of
                   vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
               end;
           //if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
-          if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF);
+          if (Gear^.Tint <> $FFFFFFFF) then
+              Tint($FF,$FF,$FF,$FF);
           Gear:= Gear^.NextGear
           end
        end;
@@ -565,52 +674,59 @@ case Layer of
        while Gear <> nil do
            begin
            tinted:= false;
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
+           if Gear^.Tint <> $FFFFFFFF then
+               Tint(Gear^.Tint);
            case Gear^.Kind of
 (*
               vgtFlake: if SuddenDeathDmg then
                              if vobSDVelocity = 0 then
                                  DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                              else
-                                 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                                 DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
                          else
                              if vobVelocity = 0 then
                                  DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
                              else
-                                 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*)
+                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*)
                vgtSpeechBubble: begin
                                 if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then
                                     begin
                                     tinted:= true;
                                     Tint($FF, $FF, $FF,  $66);
-                                    DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex)
+                                    DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex)
                                     end
                                 else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then
-                                    DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
+                                    DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
                                 end;
-               vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
+               vgtSmallDamageTag: DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
                vgtHealthTag: if Gear^.Tex <> nil then 
                                begin
                                if Gear^.Frame = 0 then 
-                                   DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex)
+                                   DrawTextureCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex)
                                else
                                    begin
                                    SetScale(cDefaultZoomLevel);
-                                   if Gear^.Angle = 0 then DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex)
-                                   else DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); 
+                                   if Gear^.Angle = 0 then
+                                       DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex)
+                                   else
+                                       DrawTexture(round(Gear^.X), round(Gear^.Y), Gear^.Tex, Gear^.Angle); 
                                    SetScale(zoom)
                                    end
                                end;
                vgtStraightShot: begin 
-                                if Gear^.dX < 0 then i:= -1 else i:= 1;
-                                DrawRotatedTextureF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle);
+                                if Gear^.dX < 0 then
+                                    i:= -1
+                                else
+                                    i:= 1;
+                                DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle);
                                 end;
            end;
            if (cReducedQuality and rqAntiBoom) = 0 then
                case Gear^.Kind of
-                   vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                   vgtChunk: DrawSpriteRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                end;
-           if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
+           if (Gear^.Tint <> $FFFFFFFF) or tinted then
+               Tint($FF,$FF,$FF,$FF);
            Gear:= Gear^.NextGear
            end
        end;
@@ -620,13 +736,14 @@ case Layer of
        while Gear <> nil do
            begin
            tinted:= false;
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
+           if Gear^.Tint <> $FFFFFFFF then
+               Tint(Gear^.Tint);
            case Gear^.Kind of
                vgtExplosion: DrawSprite(sprExplosion50, round(Gear^.X) - 32 + WorldDx, round(Gear^.Y) - 32 + WorldDy, Gear^.State);
                vgtBigExplosion: begin
                                 tinted:= true;
                                 Tint($FF, $FF, $FF, round($FF * (1 - power(Gear^.Timer / 250, 4))));
-                                DrawRotatedTextureF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
+                                DrawTextureRotatedF(SpritesData[sprBigExplosion].Texture, 0.85 * (-power(2, -10 * Int(Gear^.Timer)/250) + 1) + 0.4, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 385, 385, Gear^.Angle);
                                 end;
            end;
            if (cReducedQuality and rqAntiBoom) = 0 then
@@ -646,7 +763,7 @@ case Layer of
                                  Tint($FF, $FF, $FF, Gear^.FrameTicks);
                                  tinted:= true
                                  end;
-                             DrawRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                             DrawSpriteRotatedF(sprShell, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                              end;
                    vgtFeather: begin
                                if Gear^.FrameTicks < 255 then
@@ -654,121 +771,129 @@ case Layer of
                                    Tint($FF, $FF, $FF, Gear^.FrameTicks);
                                    tinted:= true
                                    end;
-                               DrawRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                               DrawSpriteRotatedF(sprFeather, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                              end;
-                   vgtEgg: DrawRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                   vgtEgg: DrawSpriteRotatedF(sprEgg, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                    vgtBeeTrace: begin
                                 if Gear^.FrameTicks < $FF then
                                     Tint($FF, $FF, $FF, Gear^.FrameTicks div 2)
                                 else
                                     Tint($FF, $FF, $FF, $80);
                                 tinted:= true;
-                                DrawRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle);
+                                DrawSpriteRotatedF(sprBeeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle);
                                 end;
                    vgtSmokeRing: begin
                                  tinted:= true;
                                  Tint($FF, $FF, $FF, round(Gear^.alpha * $FF));
-                                 DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
+                                 DrawTextureRotatedF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
                                  end;
-                   vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
-                   vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle);
+                   vgtNote: DrawSpriteRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
+                   vgtBulletHit: DrawSpriteRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle);
                end;
            case Gear^.Kind of
                vgtFlake: if SuddenDeathDmg then
                              if vobSDVelocity = 0 then
-                                 DrawTextureF(SpritesData[sprSDFlake].Texture, 1.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                                 DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
                              else
-                                 DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 1.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
+                                 DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
                          else
                              if vobVelocity = 0 then
-                                 DrawTextureF(SpritesData[sprFlake].Texture, 1.5, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                                 DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
                              else
-                                 DrawRotatedTextureF(SpritesData[sprFlake].Texture, 1.5, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle);
+                                 DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle);
                vgtCircle: if gear^.Angle = 1 then
                               begin
                               tmp:= Gear^.State / 100;
                               DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp)
                               end
-                          else DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer);
+                          else
+                              DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer);
            end;
-           if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
-           Gear:= Gear^.NextGear
-           end
-       end;
-    // this layer is half-way between the screen plane (depth = 0) when in stereo, and the land
-    4: begin
-       Gear:= VisualGearLayers[4];
-       while Gear <> nil do
-           begin
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
-           case Gear^.Kind of
-              vgtCloud: if SuddenDeathDmg then
-                             DrawTextureF(SpritesData[sprSDCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
-                         else
-                            DrawTextureF(SpritesData[sprCloud].Texture, 0.4, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
-              vgtFlake: if SuddenDeathDmg then
-                             if vobSDVelocity = 0 then
-                                 DrawTextureF(SpritesData[sprSDFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
-                             else
-                                 DrawRotatedTextureF(SpritesData[sprSDFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
-                         else
-                             if vobVelocity = 0 then
-                                 DrawTextureF(SpritesData[sprFlake].Texture, 0.8, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
-                             else
-                                 DrawRotatedTextureF(SpritesData[sprFlake].Texture, 0.8, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle);
-               end;
-           if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF);
+           if (Gear^.Tint <> $FFFFFFFF) or tinted then
+               Tint($FF,$FF,$FF,$FF);
            Gear:= Gear^.NextGear
            end
        end;
-    // this layer is on the screen plane (depth = 0) when stereo, but just behind the land
-    5: begin
-       Gear:= VisualGearLayers[5];
-       while Gear <> nil do
-           begin
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
-           case Gear^.Kind of
+     // this layer is half-way between the screen plane (depth = 0) when in stereo, and the land
+     4: begin
+        Gear:= VisualGearLayers[4];
+        while Gear <> nil do
+            begin
+            if Gear^.Tint <> $FFFFFFFF then
+                Tint(Gear^.Tint);
+            case Gear^.Kind of
                vgtCloud: if SuddenDeathDmg then
-                             DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
-                         else
-                             DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame);
+                            DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
+                        else
+                            DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 2, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
               vgtFlake: if SuddenDeathDmg then
-                             if vobSDVelocity = 0 then
-                                 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
-                             else
-                                 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
-                         else
-                             if vobVelocity = 0 then
-                                 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
-                             else
-                                 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
-               end;
-           if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF);
-           Gear:= Gear^.NextGear
-           end
-       end;
-    // this layer is on the screen plane (depth = 0) when stereo, but just in front of the land
-    6: begin
-       Gear:= VisualGearLayers[6];
-       while Gear <> nil do
-           begin
-           if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
-           case Gear^.Kind of
+                            if vobSDVelocity = 0 then
+                                DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                            else
+                                DrawTextureRotatedF(SpritesData[sprSDFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle)
+                        else
+                            if vobVelocity = 0 then
+                                DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
+                            else
+                                DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle);
+            end;
+            if (Gear^.Tint <> $FFFFFFFF) then
+                Tint($FF,$FF,$FF,$FF);
+            Gear:= Gear^.NextGear
+            end
+        end;
+     // this layer is on the screen plane (depth = 0) when stereo, but just behind the land
+     5: begin
+        Gear:= VisualGearLayers[5];
+        while Gear <> nil do
+            begin
+            if Gear^.Tint <> $FFFFFFFF then
+                Tint(Gear^.Tint);
+            case Gear^.Kind of
+                vgtCloud: if SuddenDeathDmg then
+                            DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
+                          else
+                            DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame);
               vgtFlake: if SuddenDeathDmg then
-                             if vobSDVelocity = 0 then
-                                 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
-                             else
-                                 DrawRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
-                         else
-                             if vobVelocity = 0 then
-                                 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
-                             else
-                                 DrawRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
-               end;
-           if (Gear^.Tint <> $FFFFFFFF) then Tint($FF,$FF,$FF,$FF);
-           Gear:= Gear^.NextGear
-           end
-       end;
+                            if vobSDVelocity = 0 then
+                                DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
+                            else
+                                DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                          else
+                            if vobVelocity = 0 then
+                                DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
+                            else
+                                DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
+                end;
+            if (Gear^.Tint <> $FFFFFFFF) then
+                Tint($FF,$FF,$FF,$FF);
+            Gear:= Gear^.NextGear
+            end
+        end;
+     // this layer is on the screen plane (depth = 0) when stereo, but just in front of the land
+    6: begin
+        Gear:= VisualGearLayers[6];
+        while Gear <> nil do
+            begin
+            if Gear^.Tint <> $FFFFFFFF then
+                Tint(Gear^.Tint);
+            case Gear^.Kind of
+                vgtFlake: if SuddenDeathDmg then
+                            if vobSDVelocity = 0 then
+                                DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
+                            else
+                                DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
+                          else
+                            if vobVelocity = 0 then
+                                DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
+                            else
+                                DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
+                end;
+            if (Gear^.Tint <> $FFFFFFFF) then
+                Tint($FF,$FF,$FF,$FF);
+            Gear:= Gear^.NextGear
+            end
+        end;
     end;
 end;
 
@@ -777,7 +902,8 @@ var vg: PVisualGear;
     i: LongWord;
 begin
 VisualGearByUID:= nil;
-if uid = 0 then exit;
+if uid = 0 then
+    exit;
 if (lastVisualGearByUID <> nil) and (lastVisualGearByUID^.uid = uid) then
     begin
     VisualGearByUID:= lastVisualGearByUID;
@@ -790,11 +916,11 @@ for i:= 2 to 5 do
     while vg <> nil do
         begin
         if vg^.uid = uid then
-    	    begin
-    	    lastVisualGearByUID:= vg;
-    	    VisualGearByUID:= vg;
-    	    exit
-    	    end;
+            begin
+            lastVisualGearByUID:= vg;
+            VisualGearByUID:= vg;
+            exit
+            end;
         vg:= vg^.NextGear
         end
     end
@@ -811,7 +937,8 @@ procedure ChangeToSDClouds;
 var       i: LongInt;
     vg, tmp: PVisualGear;
 begin
-if cCloudsNumber = cSDCloudsNumber then exit;
+if cCloudsNumber = cSDCloudsNumber then
+    exit;
 vg:= VisualGearLayers[0];
 while vg <> nil do
     if vg^.Kind = vgtCloud then
@@ -828,13 +955,14 @@ end;
 procedure AddFlakes;
 var i: LongInt;
 begin
-if (cReducedQuality and rqKillFlakes) <> 0 then exit;
+if (cReducedQuality and rqKillFlakes) <> 0 then
+    exit;
 
 if hasBorder or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
-    for i:= 0 to Pred(vobCount * cScreenSpace div LAND_WIDTH) do
+    for i:= 0 to Pred(vobCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
-    for i:= 0 to Pred((vobCount * cScreenSpace div LAND_WIDTH) div 3) do
+    for i:= 0 to Pred((vobCount * cScreenSpace div 4096) div 3) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake);
 end;
 
@@ -842,8 +970,10 @@ procedure ChangeToSDFlakes;
 var       i: LongInt;
     vg, tmp: PVisualGear;
 begin
-if (cReducedQuality and rqKillFlakes) <> 0 then exit;
-if vobCount = vobSDCount then exit;
+if (cReducedQuality and rqKillFlakes) <> 0 then
+    exit;
+if vobCount = vobSDCount then
+    exit;
 for i:= 0 to 6 do
     begin
     vg:= VisualGearLayers[i];
@@ -857,16 +987,17 @@ for i:= 0 to 6 do
         else vg:= vg^.NextGear;
     end;
 if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
-    for i:= 0 to Pred(vobSDCount * cScreenSpace div LAND_WIDTH) do
+    for i:= 0 to Pred(vobSDCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
-    for i:= 0 to Pred((vobSDCount * cScreenSpace div LAND_WIDTH) div 3) do
+    for i:= 0 to Pred((vobSDCount * cScreenSpace div 4096) div 3) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake);
 end;
 
 procedure initModule;
 var i: LongWord;
 begin
+VGCounter:= 0;
 for i:= 0 to 6 do
     VisualGearLayers[i]:= nil;
 end;
@@ -874,6 +1005,7 @@ end;
 procedure freeModule;
 var i: LongWord;
 begin
+VGCounter:= 0;
 for i:= 0 to 6 do
     while VisualGearLayers[i] <> nil do DeleteVisualGear(VisualGearLayers[i]);
 end;
diff --git a/hedgewars/uWorld.pas b/hedgewars/uWorld.pas
index 46f758c..e21fe47 100644
--- a/hedgewars/uWorld.pas
+++ b/hedgewars/uWorld.pas
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr at gmail.com>
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr at 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
@@ -21,7 +21,7 @@
 
 unit uWorld;
 interface
-uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes;
+uses SDLh, uGears, uConsts, uFloat, uRandom, uTypes, uRenderUtils;
 
 procedure initModule;
 procedure freeModule;
@@ -35,33 +35,41 @@ procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongIn
 procedure HideMission;
 procedure ShakeCamera(amount: LongInt);
 procedure InitCameraBorders;
+procedure InitTouchInterface;
+procedure SetUtilityWidgetState(ammoType: TAmmoType);
+procedure animateWidget(widget: POnScreenWidget; fade, showWidget: boolean);
 procedure MoveCamera;
 procedure onFocusStateChanged;
 
 implementation
 uses
-    uStore,
-    uMisc,
-    uIO,
-    uLocale,
-    uSound,
-    uAmmos,
-    uVisualGears,
-    uChat,
-    uLandTexture,
-    GLunit,
-    uVariables,
-    uUtils,
-    uTextures,
-    uRender,
-    uCaptions,
-    uCursor,
-    uCommands,
-    uMobile
+    uStore
+    , uMisc
+    , uIO
+    , uLocale
+    , uSound
+    , uAmmos
+    , uVisualGears
+    , uChat
+    , uLandTexture
+    , GLunit
+    , uVariables
+    , uUtils
+    , uTextures
+    , uRender
+    , uCaptions
+    , uCursor
+    , uCommands
+    , uMobile
+{$IFDEF USE_VIDEO_RECORDING}    
+    , uVideoRec
+{$ENDIF}    
     ;
 
 var cWaveWidth, cWaveHeight: LongInt;
-    AMSlotSize, AMxOffset, AMyOffset, AMWidth, AMxShift, SlotsNum: LongInt;
+    AMShiftTargetX, AMShiftTargetY, AMShiftX, AMShiftY, SlotsNum: LongInt;
+    AMAnimStartTime, AMState : LongInt;
+    AMAnimState: Single;
     tmpSurface: PSDL_Surface;
     fpsTexture: PTexture;
     timeTexture: PTexture;
@@ -73,6 +81,9 @@ var cWaveWidth, cWaveHeight: LongInt;
     missionTex: PTexture;
     missionTimer: LongInt;
     stereoDepth: GLfloat;
+    isFirstFrame: boolean;
+    AMAnimType: LongInt;
+    recTexture: PTexture;
 
 const cStereo_Sky           = 0.0500;
       cStereo_Horizon       = 0.0250;
@@ -82,56 +93,59 @@ const cStereo_Sky           = 0.0500;
       cStereo_Water_near    = 0.0025;
       cStereo_Outside       = -0.0400;
 
+// helper functions to create the goal/game mode string
+function AddGoal(s: ansistring; gf: longword; si: TGoalStrId; i: LongInt): ansistring;
+var t: ansistring;
+begin
+    if (GameFlags and gf) <> 0 then
+        begin
+        t:= inttostr(i);
+        s:= s + FormatA(trgoal[si], t) + '|'
+        end;
+    AddGoal:= s;
+end;
+
+function AddGoal(s: ansistring; gf: longword; si: TGoalStrId): ansistring;
+begin
+    if (GameFlags and gf) <> 0 then
+        s:= s + trgoal[si] + '|';
+    AddGoal:= s;
+end;
+
 procedure InitWorld;
 var i, t: LongInt;
     cp: PClan;
     g: ansistring;
+begin
+missionTimer:= 0;
 
-    // helper functions to create the goal/game mode string
-    function AddGoal(s: ansistring; gf: longword; si: TGoalStrId; i: LongInt): ansistring;
-    var t: ansistring;
+if (GameFlags and gfRandomOrder) <> 0 then  // shuffle them up a bit
     begin
-        if (GameFlags and gf) <> 0 then
+    for i:= 0 to ClansCount * 4 do
+        begin
+        t:= GetRandom(ClansCount);
+        if t <> 0 then
             begin
-            t:= inttostr(i);
-            s:= s + format(trgoal[si], t) + '|'
+            cp:= ClansArray[0];
+            ClansArray[0]:= ClansArray[t];
+            ClansArray[t]:= cp;
+            ClansArray[t]^.ClanIndex:= t;
+            ClansArray[0]^.ClanIndex:= 0;
+            if (LocalClan = t) then
+                LocalClan:= 0
+            else if (LocalClan = 0) then
+                LocalClan:= t
             end;
-        AddGoal:= s;
-    end;
-
-    function AddGoal(s: ansistring; gf: longword; si: TGoalStrId): ansistring;
-    begin
-        if (GameFlags and gf) <> 0 then
-            s:= s + trgoal[si] + '|';
-        AddGoal:= s;
+        end;
+    CurrentTeam:= ClansArray[0]^.Teams[0];
     end;
-begin
-missionTimer:= 0;
-
-if (GameFlags and gfRandomOrder) <> 0 then  // shuffle them up a bit
-   begin
-   for i:= 0 to ClansCount * 4 do
-      begin
-      t:= GetRandom(ClansCount);
-      if t <> 0 then
-         begin
-         cp:= ClansArray[0];
-         ClansArray[0]:= ClansArray[t];
-         ClansArray[t]:= cp;
-         ClansArray[t]^.ClanIndex:= t;
-         ClansArray[0]^.ClanIndex:= 0;
-         if (LocalClan = t) then LocalClan:= 0
-         else if (LocalClan = 0) then LocalClan:= t
-         end;
-      end;
-   CurrentTeam:= ClansArray[0]^.Teams[0];
-   end;
 
 // if special game flags/settings are changed, add them to the game mode notice window and then show it
 g:= ''; // no text/things to note yet
 
 // add custom goals from lua script if there are any
-if LuaGoals <> '' then g:= LuaGoals + '|';
+if LuaGoals <> '' then
+    g:= LuaGoals + '|';
 
 // check different game flags (goals/game modes first for now)
 g:= AddGoal(g, gfKing, gidKing); // king?
@@ -174,7 +188,8 @@ if cMinesTime <> 3000 then
     end;
 
 // if the string has been set, show it for (default timeframe) seconds
-if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
+if g <> '' then
+    ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
 
 cWaveWidth:= SpritesData[sprWater].Width;
 //cWaveHeight:= SpritesData[sprWater].Height;
@@ -184,29 +199,15 @@ InitCameraBorders();
 uCursor.init();
 prevPoint.X:= 0;
 prevPoint.Y:= cScreenHeight div 2;
-WorldDx:=  - (LAND_WIDTH div 2) + cScreenWidth div 2;
-WorldDy:=  - (LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2);
-AMSlotSize:= 33;
-{$IFDEF IPHONEOS}
-if isPhone() then
-    begin
-    AMxOffset:= -30 + cScreenHeight div 2;
-    AMyOffset:= 10;
-    end
-else
-    begin
-    AMxOffset:= AMSlotSize + cScreenHeight div 2;
-    AMyOffset:= -10 + cScreenWidth div 3;
-    end;
-AMWidth:= (cMaxSlotAmmoIndex + 1) * AMSlotSize + AMxOffset;
-{$ELSE}
-AMxOffset:= 10;
-AMyOffset:= 60;
-AMWidth:= (cMaxSlotAmmoIndex + 2) * AMSlotSize + AMxOffset;
-{$ENDIF}
-AMxShift:= AMWidth;
+WorldDx:=  -(LAND_WIDTH div 2) + cScreenWidth div 2;
+WorldDy:=  -(LAND_HEIGHT - (playHeight div 2)) + (cScreenHeight div 2);
+
+//aligns it to the bottom of the screen, minus the border
 SkyOffset:= 0;
 HorizontOffset:= 0;
+
+InitTouchInterface();
+AMAnimType:= AMTypeMaskX or AMTypeMaskAlpha;
 end;
 
 procedure InitCameraBorders;
@@ -214,6 +215,163 @@ begin
 cGearScrEdgesDist:= min(2 * cScreenHeight div 5, 2 * cScreenWidth div 5);
 end;
 
+procedure InitTouchInterface;
+begin
+{$IFDEF USE_TOUCH_INTERFACE}
+
+//positioning of the buttons
+buttonScale:= uMobile.getScreenDPI/cDefaultZoomLevel;
+
+
+with JumpWidget do
+    begin
+    show:= true;
+    sprite:= sprJumpWidget;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= (cScreenWidth shr 1) - Round(frame.w * 1.2);
+    frame.y:= cScreenHeight - frame.h * 2;
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with AMWidget do
+    begin
+    show:= true;
+    sprite:= sprAMWidget;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= (cScreenWidth shr 1) - frame.w * 2;
+    frame.y:= cScreenHeight - Round(frame.h * 1.2);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with arrowLeft do
+    begin
+    show:= true;
+    sprite:= sprArrowLeft;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= -(cScreenWidth shr 1) + Round(frame.w * 0.25);
+    frame.y:= cScreenHeight - Round(frame.h * 1.5);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with arrowRight do
+    begin
+    show:= true;
+    sprite:= sprArrowRight;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= -(cScreenWidth shr 1) + Round(frame.w * 1.5);
+    frame.y:= cScreenHeight - Round(frame.h * 1.5);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with firebutton do
+    begin
+    show:= true;
+    sprite:= sprFireButton;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= arrowRight.frame.x + arrowRight.frame.w;
+    frame.y:= arrowRight.frame.y + (arrowRight.frame.w shr 1) - (frame.w shr 1);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with arrowUp do
+    begin
+    show:= false;
+    sprite:= sprArrowUp;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= (cScreenWidth shr 1) - frame.w * 2;
+    frame.y:= jumpWidget.frame.y - Round(frame.h * 1.25);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    with moveAnim do
+         begin
+         target.x:= frame.x;
+         target.y:= frame.y;
+         source.x:= frame.x - Round(frame.w * 0.75);
+         source.y:= frame.y;
+         end;
+    end;
+
+with arrowDown do
+    begin
+    show:= false;
+    sprite:= sprArrowDown;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= (cScreenWidth shr 1) - frame.w * 2;
+    frame.y:= jumpWidget.frame.y - Round(frame.h * 1.25);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    with moveAnim do
+        begin
+        target.x:= frame.x;
+        target.y:= frame.y;
+        source.x:= frame.x + Round(frame.w * 0.75);
+        source.y:= frame.y;
+        end;
+    end;
+
+with pauseButton do
+    begin
+    show:= true;
+    sprite:= sprPauseButton;
+    frame.w:= Round(spritesData[sprPauseButton].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprPauseButton].Texture^.h * buttonScale);
+    frame.x:= cScreenWidth div 2 - frame.w;
+    frame.y:= 0;
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    end;
+
+with utilityWidget do
+    begin
+    show:= false;
+    sprite:= sprTimerButton;
+    frame.w:= Round(spritesData[sprite].Texture^.w * buttonScale);
+    frame.h:= Round(spritesData[sprite].Texture^.h * buttonScale);
+    frame.x:= arrowLeft.frame.x;
+    frame.y:= arrowLeft.frame.y - Round(frame.h * 1.25);
+    active.x:= frame.x;
+    active.y:= frame.y;
+    active.w:= frame.w;
+    active.h:= frame.h;
+    with moveAnim do
+        begin
+        target.x:= frame.x;
+        target.y:= frame.y;
+        source.x:= frame.x;
+        source.y:= frame.y;
+        end;
+    end;
+{$ENDIF}
+end;
+
 // for uStore texture resetting
 procedure ResetWorldTex;
 begin
@@ -223,175 +381,317 @@ begin
     timeTexture:= nil;
     FreeTexture(missionTex);
     missionTex:= nil;
+    FreeTexture(recTexture);
+    recTexture:= nil;
+end;
+
+function GetAmmoMenuTexture(Ammo: PHHAmmo): PTexture;
+const BORDERSIZE = 2;
+var x, y, i, t, SlotsNumY, SlotsNumX, AMFrame: LongInt;
+    STurns: LongInt;
+    amSurface: PSDL_Surface;
+    AMRect: TSDL_Rect;
+{$IFDEF USE_AM_NUMCOLUMN}tmpsurf: PSDL_Surface;{$ENDIF}
+begin
+    SlotsNum:= 0;
+    for i:= 0 to cMaxSlotIndex do
+        if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (Ammo^[i,0].Count > 0)) then
+            inc(SlotsNum);
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+    SlotsNumX:= SlotsNum;
+    SlotsNumY:= cMaxSlotAmmoIndex + 2;
+    {$IFDEF USE_AM_NUMCOLUMN}
+    inc(SlotsNumY);
+    {$ENDIF}
+{$ELSE}
+    SlotsNumX:= cMaxSlotAmmoIndex + 1;
+    SlotsNumY:= SlotsNum + 1;
+    {$IFDEF USE_AM_NUMCOLUMN}
+    inc(SlotsNumX);
+    {$ENDIF}
+{$ENDIF}
+
+
+    AmmoRect.w:= (BORDERSIZE*2) + (SlotsNumX * AMSlotSize) + (SlotsNumX-1);
+    AmmoRect.h:= (BORDERSIZE*2) + (SlotsNumY * AMSlotSize) + (SlotsNumY-1);
+    amSurface := SDL_CreateRGBSurface(SDL_SWSURFACE, AmmoRect.w, AmmoRect.h, 32, RMask, GMask, BMask, AMask);
+    
+    AMRect.x:= BORDERSIZE;
+    AMRect.y:= BORDERSIZE;
+    AMRect.w:= AmmoRect.w - (BORDERSIZE*2);
+    AMRect.h:= AmmoRect.h - (BORDERSIZE*2);
+
+    SDL_FillRect(amSurface, @AMRect, SDL_MapRGB(amSurface^.format, 0,0,0));
+    
+    x:= AMRect.x;
+    y:= AMRect.y;
+    for i:= 0 to cMaxSlotIndex do
+        if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
+            begin
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+            y:= AMRect.y;
+{$ELSE}
+            x:= AMRect.x;
+{$ENDIF}
+{$IFDEF USE_AM_NUMCOLUMN}
+            tmpsurf:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar('F' + IntToStr(i+1)), cWhiteColorChannels);
+            copyToXY(tmpsurf, amSurface,
+                     x + AMSlotPadding + (AMSlotSize shr 1) - (tmpsurf^.w shr 1),
+                     y + AMSlotPadding + (AMSlotSize shr 1) - (tmpsurf^.h shr 1));
+
+            SDL_FreeSurface(tmpsurf);
+    {$IFDEF USE_LANDSCAPE_AMMOMENU}
+            y:= AMRect.y + AMSlotSize + 1;
+    {$ELSE}
+            x:= AMRect.x + AMSlotSize + 1;
+    {$ENDIF}
+{$ENDIF}
+
+
+            for t:=0 to cMaxSlotAmmoIndex do
+                begin
+                if (Ammo^[i, t].Count > 0)  and (Ammo^[i, t].AmmoType <> amNothing) then
+                    begin
+                    STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
+                    AMFrame:= LongInt(Ammo^[i,t].AmmoType) - 1;
+                    if STurns >= 0 then //weapon not usable yet, draw grayed out with turns remaining
+                        begin
+                        DrawSpriteFrame2Surf(sprAMAmmosBW, amSurface, x + AMSlotPadding, 
+                                                                 y + AMSlotPadding, AMFrame);
+                        if STurns < 100 then
+                            DrawSpriteFrame2Surf(sprTurnsLeft, amSurface, 
+                                x + AMSlotSize-16, 
+                                y + AMSlotSize + 1 - 16, STurns);
+                        end
+                    else //draw colored version
+                        begin
+                        DrawSpriteFrame2Surf(sprAMAmmos, amSurface, x + AMSlotPadding, 
+                                                               y + AMSlotPadding, AMFrame);
+                        end;
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+	    inc(y, AMSlotSize + 1); //the plus one is for the border
+{$ELSE}
+	    inc(x, AMSlotSize + 1);
+{$ENDIF}
+	    end;
+	end;
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+    inc(x, AMSlotSize + 1);
+{$ELSE}
+    inc(y, AMSlotSize + 1);
+{$ENDIF}
+    end;
+
+for i:= 1 to SlotsNumX -1 do
+DrawLine2Surf(amSurface, i * (AMSlotSize+1)+1, BORDERSIZE, i * (AMSlotSize+1)+1, AMRect.h + BORDERSIZE - AMSlotSize - 2,160,160,160);            
+for i:= 1 to SlotsNumY -1 do
+DrawLine2Surf(amSurface, BORDERSIZE, i * (AMSlotSize+1)+1, AMRect.w + BORDERSIZE, i * (AMSlotSize+1)+1,160,160,160);
+
+//draw outer border
+DrawSpriteFrame2Surf(sprAMCorners, amSurface, 0                    , 0                    , 0);
+DrawSpriteFrame2Surf(sprAMCorners, amSurface, AMRect.w + BORDERSIZE, AMRect.y             , 1);
+DrawSpriteFrame2Surf(sprAMCorners, amSurface, AMRect.x             , AMRect.h + BORDERSIZE, 2);
+DrawSpriteFrame2Surf(sprAMCorners, amSurface, AMRect.w + BORDERSIZE, AMRect.h + BORDERSIZE, 3);
+
+for i:=0 to BORDERSIZE-1 do
+begin
+DrawLine2Surf(amSurface, BORDERSIZE, i, AMRect.w + BORDERSIZE, i,160,160,160);//top
+DrawLine2Surf(amSurface, BORDERSIZE, AMRect.h+BORDERSIZE+i, AMRect.w + BORDERSIZE, AMRect.h+BORDERSIZE+i,160,160,160);//bottom
+DrawLine2Surf(amSurface, i, BORDERSIZE, i, AMRect.h + BORDERSIZE,160,160,160);//left
+DrawLine2Surf(amSurface, AMRect.w+BORDERSIZE+i, BORDERSIZE, AMRect.w + BORDERSIZE+i, AMRect.h + BORDERSIZE, 160,160,160);//right
+end;
+
+GetAmmoMenuTexture:= Surface2Tex(amSurface, false);
+if amSurface <> nil then SDL_FreeSurface(amSurface);
 end;
 
 procedure ShowAmmoMenu;
-const MENUSPEED = 15;
 const BORDERSIZE = 2;
-var x, y, i, t, g: LongInt;
-    Slot, Pos, STurns: LongInt;
+var Slot, Pos: LongInt;
     Ammo: PHHAmmo;
+    c,i,g,t,STurns: LongInt;
 begin
-    if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or
-       ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then
-        bShowAmmoMenu:= false;
+if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil)
+or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then
+    bShowAmmoMenu:= false;
+
+// give the assigned ammo to hedgehog
+Ammo:= nil;
+if (CurrentTeam <> nil) and (CurrentHedgehog <> nil)
+and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
+    Ammo:= CurrentHedgehog^.Ammo
+else if (LocalAmmo <> -1) then
+    Ammo:= GetAmmoByNum(LocalAmmo);
+Pos:= -1;
+if Ammo = nil then
+    begin
+    bShowAmmoMenu:= false;
+    AMState:= AMHidden;
+    exit
+    end;
 
-    if bShowAmmoMenu then
-    // show ammo menu
+//Init the menu 
+if(AmmoMenuInvalidated) then 
+    begin
+    AmmoMenuInvalidated:= false;
+    FreeTexture(AmmoMenuTex);
+    AmmoMenuTex:= GetAmmoMenuTexture(Ammo);
+
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+    if isPhone() then
         begin
-        FollowGear:= nil;
-        if AMxShift = AMWidth then prevPoint.X:= 0;
-        if (cReducedQuality and rqSlowMenu) <> 0 then AMxShift:= 0
-        else
-            if AMxShift > MENUSPEED then dec(AMxShift, MENUSPEED)
-            else AMxShift:= 0;
+        AmmoRect.x:= -(AmmoRect.w shr 1);
+        AmmoRect.y:= (cScreenHeight shr 1) - (AmmoRect.h shr 1);
         end
     else
-    // hide ammo menu
         begin
-        if AMxShift = 0 then
+        AmmoRect.x:= -(AmmoRect.w shr 1);
+        AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
+        end;
+{$ELSE}
+        AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize;
+        AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
+{$ENDIF}
+    AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x;
+    AMShiftTargetY:= cScreenHeight        - AmmoRect.y;
+
+    if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x
+    else AMShiftTargetX:= 0;
+    if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight        - AmmoRect.y
+    else AMShiftTargetY:= 0;
+
+    AMShiftX:= AMShiftTargetX;
+    AMShiftY:= AMShiftTargetY;
+end;
+
+AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;
+
+if AMState = AMShowing then
+    begin
+    FollowGear:=nil;
+    end;
+
+if AMState = AMShowingUp then // show ammo menu
+    begin
+    if (cReducedQuality and rqSlowMenu) <> 0 then
+        begin
+        AMShiftX:= 0;
+        AMShiftY:= 0;
+        AMState:= AMShowing;
+        end
+    else
+        if AMAnimState < 1 then
             begin
-            CursorPoint.X:= cScreenWidth shr 1;
-            CursorPoint.Y:= cScreenHeight shr 1;
+            AMShiftX:= Round(AMShiftTargetX * (1 - AMAnimState));
+            AMShiftY:= Round(AMShiftTargetY * (1 - AMAnimState));
+            if (AMAnimType and AMTypeMaskAlpha) <> 0 then 
+                Tint($FF, $ff, $ff, Round($ff * AMAnimState));
+            end
+        else
+            begin
+            AMShiftX:= 0;
+            AMShiftY:= 0;
+            CursorPoint.X:= AmmoRect.x + AmmoRect.w;
+            CursorPoint.Y:= AmmoRect.y;
+            AMState:= AMShowing;
+            end;
+    end;
+if AMState = AMHiding then // hide ammo menu
+    begin
+    if (cReducedQuality and rqSlowMenu) <> 0 then
+        begin
+        AMShiftX:= AMShiftTargetX;
+        AMShiftY:= AMShiftTargetY;
+        AMState:= AMHidden;
+        end
+    else
+        if AMAnimState < 1 then
+            begin
+            AMShiftX:= Round(AMShiftTargetX * AMAnimState);
+            AMShiftY:= Round(AMShiftTargetY * AMAnimState);
+            if (AMAnimType and AMTypeMaskAlpha) <> 0 then 
+                Tint($FF, $ff, $ff, Round($ff * (1-AMAnimState)));
+            end
+         else 
+            begin
+            AMShiftX:= AMShiftTargetX;
+            AMShiftY:= AMShiftTargetY;
             prevPoint:= CursorPoint;
+            AMState:= AMHidden;
             end;
-        if (cReducedQuality and rqSlowMenu) <> 0 then AMxShift:= AMWidth+2
-        else
-            if AMxShift < (AMWidth - MENUSPEED) then inc(AMxShift, MENUSPEED)
-            else AMxShift:= AMWidth;
-        end;
+    end;
+    
+DrawTexture(AmmoRect.x + AMShiftX, AmmoRect.y + AMShiftY, AmmoMenuTex);
 
-    // give the assigned ammo to hedgehog
-    Ammo:= nil;
-    if (CurrentTeam <> nil) and (CurrentHedgehog <> nil) and
-       (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
-        Ammo:= CurrentHedgehog^.Ammo
-    else if (LocalAmmo <> -1) then
-        Ammo:= GetAmmoByNum(LocalAmmo);
-    Pos:= -1;
-    if Ammo = nil then
-        begin
-        bShowAmmoMenu:= false;
-        exit
-        end;
-    SlotsNum:= 0;
-    x:= (cScreenWidth shr 1) - AMWidth + AMxShift;
-
-{$IFDEF IPHONEOS}
-    Slot:= cMaxSlotIndex;
-    x:= x - cOffsetY;
-    y:= AMyOffset;
-    dec(y, BORDERSIZE);
-    DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0);
-    for i:= 0 to cMaxSlotAmmoIndex do
-        DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0);
-    DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1);
-    inc(y, BORDERSIZE);
+if ((AMState = AMHiding) or (AMState = AMShowingUp)) and ((AMAnimType and AMTypeMaskAlpha) <> 0 )then 
+    Tint($FF, $ff, $ff, $ff);
 
+Pos:= -1;
+Slot:= -1;
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+c:= -1;
     for i:= 0 to cMaxSlotIndex do
         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
             begin
-            if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i;
-            inc(SlotsNum);
-            DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
-            t:= 0;
+            inc(c);
+    {$IFDEF USE_AM_NUMCOLUMN}
+            g:= 1;
+    {$ELSE}
             g:= 0;
-            while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
-                begin
-                DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1);
-                if (Ammo^[i, t].AmmoType <> amNothing) then
+    {$ENDIF}
+            for t:=0 to cMaxSlotAmmoIndex do
+                if (Ammo^[i, t].Count > 0) and (Ammo^[i, t].AmmoType <> amNothing) then
                     begin
-                    STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
-
-                    if STurns >= 0 then
-                        begin
-                        DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
-                        if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
-                        end
-                    else
-                        DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
-                    if (Slot = i) and (CursorPoint.X >= x + g * AMSlotSize) and
-                       (CursorPoint.X <= x + (g + 1) * AMSlotSize) then
+                    if (CursorPoint.Y <= (cScreenHeight - AmmoRect.y) - ( g    * (AMSlotSize+1))) and
+                       (CursorPoint.Y >  (cScreenHeight - AmmoRect.y) - ((g+1) * (AMSlotSize+1))) and
+                       (CursorPoint.X >  AmmoRect.x                   + ( c    * (AMSlotSize+1))) and 
+                       (CursorPoint.X <= AmmoRect.x                   + ((c+1) * (AMSlotSize+1))) then
                         begin
-                        if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
+                        Slot:= i;
                         Pos:= t;
+                        STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
+                        if (STurns < 0) and (AMShiftX = 0) and (AMShiftY = 0) then
+                            DrawSprite(sprAMSlot, 
+                                       AmmoRect.x + BORDERSIZE + (c * (AMSlotSize+1)) + AMSlotPadding, 
+                                       AmmoRect.y + BORDERSIZE + (g  * (AMSlotSize+1)) + AMSlotPadding -1, 0);
                         end;
-                    inc(g)
-                    end;
-                inc(t)
-                end;
-            for g:= g to cMaxSlotAmmoIndex do
-                DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1);
-            DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1);
-            inc(y, AMSlotSize);
+                        inc(g);
+                   end;
             end;
-
-    DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2);
-    for i:= 0 to cMaxSlotAmmoIndex do
-	DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1);
-    DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3);
 {$ELSE}
-    Slot:= 0;
-    y:= cScreenHeight - AMyOffset;
-    DrawSprite(sprAMCorners, x - BORDERSIZE, y, 2);
-    for i:= 0 to cMaxSlotAmmoIndex + 1 do
-        DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 1);
-    DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 3);
-    dec(y, AMSlotSize);
-    DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
-    for i:= 0 to cMaxSlotAmmoIndex do
-        DrawSprite(sprAMSlot, x + i * AMSlotSize, y, 2);
-    DrawSprite(sprAMSlot, x + (cMaxSlotAmmoIndex + 1) * AMSlotSize, y, 1);
-    DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1);
-
-    for i:= cMaxSlotIndex downto 0 do
+c:= -1;
+    for i:= 0 to cMaxSlotIndex do
         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
             begin
-            if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i;
-            dec(y, AMSlotSize);
-            inc(SlotsNum);
-            DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
-            DrawSprite(sprAMSlot, x, y, 1);
-            DrawSprite(sprAMSlotKeys, x, y + 1, i);
-            t:= 0;
+            inc(c);
+    {$IFDEF USE_AM_NUMCOLUMN}
             g:= 1;
-            while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
-                begin
-                DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1);
-                if (Ammo^[i, t].AmmoType <> amNothing) then
+    {$ELSE}
+            g:= 0;
+    {$ENDIF}
+            for t:=0 to cMaxSlotAmmoIndex do
+                if (Ammo^[i, t].Count > 0) and (Ammo^[i, t].AmmoType <> amNothing) then
                     begin
-                    STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
-
-                    if STurns >= 0 then
+                    if (CursorPoint.Y <= (cScreenHeight - AmmoRect.y) - ( c    * (AMSlotSize+1))) and
+                       (CursorPoint.Y >  (cScreenHeight - AmmoRect.y) - ((c+1) * (AMSlotSize+1))) and
+                       (CursorPoint.X >  AmmoRect.x                   + ( g    * (AMSlotSize+1))) and 
+                       (CursorPoint.X <= AmmoRect.x                   + ((g+1) * (AMSlotSize+1))) then
                         begin
-                        DrawSprite(sprAMAmmosBW, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
-                        if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
-                        end else
-                        DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
-                    if (Slot = i) and (CursorPoint.X >= x + g * AMSlotSize) and
-                       (CursorPoint.X <= x + (g + 1) * AMSlotSize) then
-                        begin
-                        if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
+                        Slot:= i;
                         Pos:= t;
+                        STurns:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
+                        if (STurns < 0) and (AMShiftX = 0) and (AMShiftY = 0) then
+                            DrawSprite(sprAMSlot, 
+                                       AmmoRect.x + BORDERSIZE + (g * (AMSlotSize+1)) + AMSlotPadding, 
+                                       AmmoRect.y + BORDERSIZE + (c  * (AMSlotSize+1)) + AMSlotPadding -1, 0);
                         end;
-                    inc(g)
-                    end;
-                    inc(t)
-                end;
-            for g:= g to cMaxSlotAmmoIndex + 1 do
-                DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 1);
-            DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1);
+                        inc(g);
+                   end;
             end;
-
-    dec(y, BORDERSIZE);
-    DrawSprite(sprAMCorners, x - BORDERSIZE, y, 0);
-    for i:= 0 to cMaxSlotAmmoIndex + 1 do
-        DrawSprite(sprAMBorderHorizontal, x + i * AMSlotSize, y, 0);
-    DrawSprite(sprAMCorners, x + AMWidth - AMxOffset, y, 1);
 {$ENDIF}
-
-    if (Pos >= 0) then
+    if (Pos >= 0) and (Pos <= cMaxSlotAmmoIndex) and (Slot >= 0) and (Slot <= cMaxSlotIndex)then
         begin
+        if (AMShiftX = 0) and (AMShiftY = 0) then
         if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
             begin
             if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then
@@ -400,15 +700,13 @@ begin
                 RenderWeaponTooltip(amSel)
                 end;
 
-{$IFDEF IPHONEOS}
-            DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
-            if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
-                DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + 163, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
-{$ELSE}
-            DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
+            DrawTexture(AmmoRect.x + (AMSlotSize shr 1),
+                        AmmoRect.y + AmmoRect.h - BORDERSIZE - (AMSlotSize shr 1) - (Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex^.h shr 1),
+                        Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
             if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
-                DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
-{$ENDIF}
+                DrawTexture(AmmoRect.x + AmmoRect.w - 20 - (CountTexz[Ammo^[Slot, Pos].Count]^.w),
+                            AmmoRect.y + AmmoRect.h - BORDERSIZE - (AMslotSize shr 1) - (CountTexz[Ammo^[Slot, Pos].Count]^.w shr 1),
+                            CountTexz[Ammo^[Slot, Pos].Count]);
 
             if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then
                 begin
@@ -416,6 +714,23 @@ begin
                 SetWeapon(Ammo^[Slot, Pos].AmmoType);
                 bSelected:= false;
                 FreeWeaponTooltip;
+{$IFDEF USE_TOUCH_INTERFACE}//show the aiming buttons + animation
+                if (Ammo^[Slot, Pos].Propz and ammoprop_NeedUpDown) <> 0 then
+                    begin
+                    if not(arrowUp.show) then
+                        begin
+                        animateWidget(@arrowUp, true, true);
+                        animateWidget(@arrowDown, true, true);
+                        end;
+                    end
+                else
+                    if arrowUp.show then
+                        begin
+                        animateWidget(@arrowUp, true, false);
+                        animateWidget(@arrowDown, true, false);
+                        end;
+                SetUtilityWidgetState(Ammo^[Slot, Pos].AmmoType);
+{$ENDIF}
                 exit
                 end;
             end
@@ -423,15 +738,19 @@ begin
     else
         FreeWeaponTooltip;
 
-    if (WeaponTooltipTex <> nil) and (AMxShift = 0) then
-{$IFDEF IPHONEOS}
-        ShowWeaponTooltip(-WeaponTooltipTex^.w div 2, 100);
+    if (WeaponTooltipTex <> nil) and (AMShiftX = 0) and (AMShiftY = 0) then
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+        if not isPhone() then
+            ShowWeaponTooltip(-WeaponTooltipTex^.w div 2, AmmoRect.y - WeaponTooltipTex^.h - AMSlotSize);
 {$ELSE}
-        ShowWeaponTooltip(x - WeaponTooltipTex^.w - 3, Min(y + 1, cScreenHeight - WeaponTooltipTex^.h - 40));
+        ShowWeaponTooltip(AmmoRect.x - WeaponTooltipTex^.w - 3, Min(AmmoRect.y + 1, cScreenHeight - WeaponTooltipTex^.h - 40));
 {$ENDIF}
 
     bSelected:= false;
-    if AMxShift = 0 then DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
+{$IFNDEF USE_TOUCH_INTERFACE}
+   if (AMShiftX = 0) and (AMShiftY = 0) then
+        DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
+{$ENDIF}
 end;
 
 procedure DrawWater(Alpha: byte; OffsetY: LongInt);
@@ -439,27 +758,27 @@ var VertexBuffer: array [0..3] of TVertex2f;
     r: TSDL_Rect;
     lw, lh: GLfloat;
 begin
-    if SuddenDeathDmg then
-        begin
-        SDWaterColorArray[0].a := Alpha;
-        SDWaterColorArray[1].a := Alpha;
-        SDWaterColorArray[2].a := Alpha;
-        SDWaterColorArray[3].a := Alpha
-        end
-    else
-        begin
-        WaterColorArray[0].a := Alpha;
-        WaterColorArray[1].a := Alpha;
-        WaterColorArray[2].a := Alpha;
-        WaterColorArray[3].a := Alpha
-        end;
+if SuddenDeathDmg then
+    begin
+    SDWaterColorArray[0].a := Alpha;
+    SDWaterColorArray[1].a := Alpha;
+    SDWaterColorArray[2].a := Alpha;
+    SDWaterColorArray[3].a := Alpha
+    end
+else
+    begin
+    WaterColorArray[0].a := Alpha;
+    WaterColorArray[1].a := Alpha;
+    WaterColorArray[2].a := Alpha;
+    WaterColorArray[3].a := Alpha
+    end;
 
-    lw:= cScreenWidth / cScaleFactor;
-    lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16;
+lw:= cScreenWidth / cScaleFactor;
+lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16;
 
     // Water
-    r.y:= OffsetY + WorldDy + cWaterLine;
-    if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then
+r.y:= OffsetY + WorldDy + cWaterLine;
+if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then
     begin
         if r.y < 0 then
             r.y:= 0;
@@ -558,74 +877,72 @@ end;
 procedure DrawRepeated(spr, sprL, sprR: TSprite; Shift, OffsetY: LongInt);
 var i, w, h, lw, lh, rw, rh, sw: LongInt;
 begin
-    sw:= round(cScreenWidth / cScaleFactor);
-    if (SpritesData[sprL].Texture = nil) and (SpritesData[spr].Texture <> nil) then
+sw:= round(cScreenWidth / cScaleFactor);
+if (SpritesData[sprL].Texture = nil) and (SpritesData[spr].Texture <> nil) then
+    begin
+    w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
+    h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
+    i:= Shift mod w;
+    if i > 0 then
+        dec(i, w);
+    dec(i, w * (sw div w + 1));
+    repeat
+    DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
+    inc(i, w)
+    until i > sw
+    end
+else if SpritesData[spr].Texture <> nil then
+    begin
+    w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
+    h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
+    lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale;
+    lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale;
+    if SpritesData[sprR].Texture <> nil then
         begin
-        w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
-        h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
-        i:= Shift mod w;
-        if i > 0 then dec(i, w);
-        dec(i, w * (sw div w + 1));
-        repeat
-            DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
-            inc(i, w)
-        until i > sw
-        end
-    else if SpritesData[spr].Texture <> nil then
+        rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
+        rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale
+        end;
+    dec(Shift, w div 2);
+    DrawTexture(Shift, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
+
+    i:= Shift - lw;
+    while i >= -sw - lw do
         begin
-        w:= SpritesData[spr].Width * SpritesData[spr].Texture^.Scale;
-        h:= SpritesData[spr].Height * SpritesData[spr].Texture^.Scale;
-        lw:= SpritesData[sprL].Width * SpritesData[spr].Texture^.Scale;
-        lh:= SpritesData[sprL].Height * SpritesData[spr].Texture^.Scale;
-        if SpritesData[sprR].Texture <> nil then
-            begin
-            rw:= SpritesData[sprR].Width * SpritesData[spr].Texture^.Scale;
-            rh:= SpritesData[sprR].Height * SpritesData[spr].Texture^.Scale
-            end;
-        dec(Shift, w div 2);
-        DrawTexture(Shift, WorldDy + LAND_HEIGHT + OffsetY - h, SpritesData[spr].Texture, SpritesData[spr].Texture^.Scale);
+        DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale);
+        dec(i, lw);
+        end;
 
-        i:= Shift - lw;
-        while i >= -sw - lw do
+    i:= Shift + w;
+    if SpritesData[sprR].Texture <> nil then
+        while i <= sw do
+            begin
+            DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
+            inc(i, rw)
+            end
+    else
+        while i <= sw do
             begin
             DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale);
-            dec(i, lw);
-            end;
-
-        i:= Shift + w;
-        if SpritesData[sprR].Texture <> nil then
-            while i <= sw do
-                begin
-                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - rh, SpritesData[sprR].Texture, SpritesData[sprR].Texture^.Scale);
-                inc(i, rw)
-                end
-        else
-            while i <= sw do
-                begin
-                DrawTexture(i, WorldDy + LAND_HEIGHT + OffsetY - lh, SpritesData[sprL].Texture, SpritesData[sprL].Texture^.Scale);
-                inc(i, lw)
-                end
-        end
+            inc(i, lw)
+            end
+    end
 end;
 
 
 procedure DrawWorld(Lag: LongInt);
 begin
-    if not isPaused then
+    if ZoomValue < zoom then
     begin
-        if ZoomValue < zoom then
-        begin
-            zoom:= zoom - 0.002 * Lag;
-            if ZoomValue > zoom then
-                zoom:= ZoomValue
-        end
-        else
+        zoom:= zoom - 0.002 * Lag;
+        if ZoomValue > zoom then
+            zoom:= ZoomValue
+    end
+    else
         if ZoomValue > zoom then
         begin
-            zoom:= zoom + 0.002 * Lag;
-            if ZoomValue < zoom then
-                zoom:= ZoomValue
-            end
+        zoom:= zoom + 0.002 * Lag;
+        if ZoomValue < zoom then
+            zoom:= ZoomValue
         end
     else
         ZoomValue:= zoom;
@@ -635,7 +952,7 @@ begin
     //glPushMatrix;
     //glScalef(1.0, 1.0, 1.0);
 
-    if not isPaused then
+    if (not isPaused) and (GameType <> gmtRecord) then
         MoveCamera;
 
     if cStereoMode = smNone then
@@ -666,7 +983,7 @@ begin
         DrawWorldStereo(0, rmRightEye);
 
         // detatch drawing from fbs
-        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, defaultFrame);
         glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
         SetScale(cDefaultZoomLevel);
 
@@ -761,8 +1078,10 @@ begin
     exit;
 {$ELSE}
     d:= d / 5;
-    if rm = rmDefault then exit
-    else if rm = rmLeftEye then d:= -d;
+    if rm = rmDefault then
+        exit
+    else if rm = rmLeftEye then
+        d:= -d;
     stereoDepth:= stereoDepth + d;
     glMatrixMode(GL_PROJECTION);
     glTranslatef(d, 0, 0);
@@ -776,7 +1095,8 @@ begin
     rm:= rm; // avoid hint
     exit;
 {$ELSE}
-    if rm = rmDefault then exit;
+    if rm = rmDefault then
+        exit;
     glMatrixMode(GL_PROJECTION);
     glTranslatef(-stereoDepth, 0, 0);
     glMatrixMode(GL_MODELVIEW);
@@ -785,15 +1105,15 @@ begin
 end;
  
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
-var i, t: LongInt;
+var i, t, h: LongInt;
     r: TSDL_Rect;
     tdx, tdy: Double;
-    s: string[15];
+    s: shortstring;
     highlight: Boolean;
     smallScreenOffset, offsetX, offsetY, screenBottom: LongInt;
     VertexBuffer: array [0..3] of TVertex2f;
 begin
-    if (cReducedQuality and rqNoBackground) = 0 then
+if (cReducedQuality and rqNoBackground) = 0 then
     begin
         // Offsets relative to camera - spare them to wimpier cpus, no bg or flakes for them anyway
         ScreenBottom:= (WorldDy - trunc(cScreenHeight/cScaleFactor) - (cScreenHeight div 2) + cWaterLine);
@@ -805,18 +1125,20 @@ begin
 
         // background
         ChangeDepth(RM, cStereo_Sky);
-        if SuddenDeathDmg then Tint(SDTint, SDTint, SDTint, $FF);
+        if SuddenDeathDmg then
+            Tint(SDTint, SDTint, SDTint, $FF);
         DrawRepeated(sprSky, sprSkyL, sprSkyR, (WorldDx + LAND_WIDTH div 2) * 3 div 8, SkyOffset);
         ChangeDepth(RM, -cStereo_Horizon);
         DrawRepeated(sprHorizont, sprHorizontL, sprHorizontR, (WorldDx + LAND_WIDTH div 2) * 3 div 5, HorizontOffset);
-        if SuddenDeathDmg then Tint($FF, $FF, $FF, $FF);
+        if SuddenDeathDmg then
+            Tint($FF, $FF, $FF, $FF);
     end;
 
-    DrawVisualGears(0);
-    ChangeDepth(RM, -cStereo_MidDistance);
-    DrawVisualGears(4);
+DrawVisualGears(0);
+ChangeDepth(RM, -cStereo_MidDistance);
+DrawVisualGears(4);
 
-    if (cReducedQuality and rq2DWater) = 0 then
+if (cReducedQuality and rq2DWater) = 0 then
     begin
         // Waves
         DrawWater(255, SkyOffset); 
@@ -829,7 +1151,7 @@ begin
         ChangeDepth(RM, -cStereo_Water_distant);
         DrawWaves(-1, 100 + WorldDx div 14, - cWaveHeight + offsetY div 70, 24);
     end
-    else
+else
         DrawWaves(-1, 100, - (cWaveHeight + (cWaveHeight shr 1)), 0);
 
     changeDepth(RM, cStereo_Land);
@@ -838,59 +1160,37 @@ begin
 
     DrawWater(255, 0);
 
-// Attack bar
-    if CurrentTeam <> nil then
-        case AttackBar of
-(*        1: begin
-        r:= StuffPoz[sPowerBar];
-        {$WARNINGS OFF}
-        r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor;
-        {$WARNINGS ON}
-        DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
-        end;*)
-        2: with CurrentHedgehog^ do
-                begin
-                tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
-                tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
-                for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
-                    DrawSprite(sprPower,
-                            hwRound(Gear^.X) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + LongInt(round(WorldDx + tdx * (24 + i * 2))) - 16,
-                            hwRound(Gear^.Y) + GetLaunchY(CurAmmoType, Gear^.Angle) + LongInt(round(WorldDy + tdy * (24 + i * 2))) - 16,
-                            i)
-                end
-        end;
+DrawVisualGears(1);
+DrawGears;
+DrawVisualGears(6);
 
-    DrawVisualGears(1);
-    DrawGears;
-    DrawVisualGears(6);
-
-    if SuddenDeathDmg then
-        DrawWater(cSDWaterOpacity, 0)
-    else
-        DrawWater(cWaterOpacity, 0);
+if SuddenDeathDmg then
+    DrawWater(SDWaterOpacity, 0)
+else
+    DrawWater(WaterOpacity, 0);
 
     // Waves
-    ChangeDepth(RM, cStereo_Water_near);
-    DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 12);
+ChangeDepth(RM, cStereo_Water_near);
+DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 12);
 
-    if (cReducedQuality and rq2DWater) = 0 then
+if (cReducedQuality and rq2DWater) = 0 then
     begin
-        //DrawWater(cWaterOpacity, - offsetY div 40);
-        ChangeDepth(RM, cStereo_Water_near);
-        DrawWaves(-1, 50 + WorldDx div 6, - cWaveHeight - offsetY div 40, 8);
-        if SuddenDeathDmg then
-            DrawWater(cSDWaterOpacity, - offsetY div 20)
-        else
-            DrawWater(cWaterOpacity, - offsetY div 20);
-        ChangeDepth(RM, cStereo_Water_near);
-        DrawWaves( 1, 75 - WorldDx div 4, - cWaveHeight - offsetY div 20, 2);
+    //DrawWater(WaterOpacity, - offsetY div 40);
+    ChangeDepth(RM, cStereo_Water_near);
+    DrawWaves(-1, 50 + WorldDx div 6, - cWaveHeight - offsetY div 40, 8);
+    if SuddenDeathDmg then
+        DrawWater(SDWaterOpacity, - offsetY div 20)
+    else
+        DrawWater(WaterOpacity, - offsetY div 20);
+    ChangeDepth(RM, cStereo_Water_near);
+    DrawWaves( 1, 75 - WorldDx div 4, - cWaveHeight - offsetY div 20, 2);
         if SuddenDeathDmg then
-            DrawWater(cSDWaterOpacity, - offsetY div 10)
+            DrawWater(SDWaterOpacity, - offsetY div 10)
         else
-            DrawWater(cWaterOpacity, - offsetY div 10);
+            DrawWater(WaterOpacity, - offsetY div 10);
         ChangeDepth(RM, cStereo_Water_near);
         DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0);
-    end
+        end
     else
         DrawWaves(-1, 50, - (cWaveHeight shr 1), 0);
 
@@ -911,9 +1211,9 @@ if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <>
     with PHedgehog(CurrentHedgehog)^ do
         begin
         if CurAmmoType = amBee then
-            DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+            DrawSpriteRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
         else
-            DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+            DrawSpriteRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
         end
     end;
 {$WARNINGS ON}
@@ -922,7 +1222,7 @@ if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <>
 SetScale(cDefaultZoomLevel);
 
 // Turn time
-{$IFDEF IPHONEOS}
+{$IFDEF USE_TOUCH_INTERFACE}
 offsetX:= cScreenHeight - 13;
 {$ELSE}
 offsetX:= 48;
@@ -935,96 +1235,140 @@ if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) th
     else
         i:= Succ(Pred(TurnTimeLeft) div 1000);
    
-   if i>99 then t:= 112
-      else if i>9 then t:= 96
-                  else t:= 80;
-   DrawSprite(sprFrame, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, 1);
-   while i > 0 do
-         begin
-         dec(t, 32);
-         DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
-         i:= i div 10
-         end;
-   DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0);
-   end;
+    if i>99 then
+        t:= 112
+    else if i>9 then
+        t:= 96
+    else
+        t:= 80;
+    DrawSprite(sprFrame, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, 1);
+    while i > 0 do
+        begin
+        dec(t, 32);
+        DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
+        i:= i div 10
+        end;
+    DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0);
+    end;
 
 // Captions
 DrawCaptions;
 
+{$IFDEF USE_TOUCH_INTERFACE}
+// Draw buttons Related to the Touch interface
+DrawScreenWidget(@arrowLeft);
+DrawScreenWidget(@arrowRight);
+DrawScreenWidget(@arrowUp);
+DrawScreenWidget(@arrowDown);
+
+DrawScreenWidget(@fireButton);
+DrawScreenWidget(@jumpWidget);
+DrawScreenWidget(@AMWidget);
+DrawScreenWidget(@pauseButton);
+DrawScreenWidget(@utilityWidget);
+{$ENDIF}
+
 // Teams Healths
 if TeamsCount * 20 > Longword(cScreenHeight) div 7 then  // take up less screen on small displays
     begin
     SetScale(1.5);
     smallScreenOffset:= cScreenHeight div 6;
-    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$80);
+    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
+        Tint($FF,$FF,$FF,$80);
     end
 else smallScreenOffset:= 0;
 for t:= 0 to Pred(TeamsCount) do
-   with TeamsArray[t]^ do
-      begin
-      highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
-
-      if highlight then
-         Tint(Clan^.Color shl 8 or $FF);
-
-      // draw name
-      DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset, NameTagTex);
-
-      // draw flag
-      DrawTexture(-14, cScreenHeight + DrawHealthY + smallScreenOffset, FlagTex);
-
-      // draw health bar
-      r.x:= 0;
-      r.y:= 0;
-      r.w:= 2 + TeamHealthBarWidth;
-      r.h:= HealthTex^.h;
-      DrawFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
-
-      // draw health bars right border
-      inc(r.x, cTeamHealthWidth + 2);
-      r.w:= 3;
-      DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
-
-      // draw ai kill counter for gfAISurvival
-      if (GameFlags and gfAISurvival) <> 0 then begin
-          DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset,
-              AIKillsTex);
-      end;
-
-      // if highlighted, draw flag and other contents again to keep their colors
-      // this approach should be faster than drawing all borders one by one tinted or not
-      if highlight then
-         begin
-         if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$80)
-         else Tint($FF, $FF, $FF, $FF);
+    with TeamsArray[t]^ do
+      if TeamHealth > 0 then
+        begin
+        h:= 0;
+        highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
+
+        if highlight then
+            Tint(Clan^.Color shl 8 or $FF);
 
          // draw name
-         r.x:= 2;
-         r.y:= 2;
-         r.w:= NameTagTex^.w - 4;
-         r.h:= NameTagTex^.h - 4;
-         DrawFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex);
-         // draw flag
-         r.w:= 22;
-         r.h:= 15;
-         DrawFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
-         // draw health bar
-         r.w:= TeamHealthBarWidth + 1;
-         r.h:= HealthTex^.h - 4;
-         DrawFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
-         end;
-      end;
+        DrawTexture(-NameTagTex^.w - 16, cScreenHeight + DrawHealthY + smallScreenOffset, NameTagTex);
+
+        // draw flag
+        DrawTexture(-14, cScreenHeight + DrawHealthY + smallScreenOffset, FlagTex);
+
+        // draw health bar
+        r.x:= 0;
+        r.y:= 0;
+        r.w:= 2 + TeamHealthBarWidth;
+        r.h:= HealthTex^.h;
+        DrawTextureFromRect(14, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
+
+        // draw health bars right border
+        inc(r.x, cTeamHealthWidth + 2);
+        r.w:= 3;
+        DrawTextureFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
+
+        if not highlight and (not hasGone) then
+            for i:= 0 to cMaxHHIndex do
+                if Hedgehogs[i].Gear <> nil then
+                    begin
+                    inc(h,Hedgehogs[i].Gear^.Health);
+                    if h < TeamHealth then DrawTexture(15 + h*TeamHealthBarWidth div TeamHealth, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
+                    end;
+
+        // draw ai kill counter for gfAISurvival
+        if (GameFlags and gfAISurvival) <> 0 then
+            begin
+            DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY + smallScreenOffset, AIKillsTex);
+            end;
+
+        // if highlighted, draw flag and other contents again to keep their colors
+        // this approach should be faster than drawing all borders one by one tinted or not
+        if highlight then
+            begin
+            if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
+                Tint($FF,$FF,$FF,$80)
+            else Tint($FF, $FF, $FF, $FF);
+
+            // draw name
+            r.x:= 2;
+            r.y:= 2;
+            r.w:= NameTagTex^.w - 4;
+            r.h:= NameTagTex^.h - 4;
+            DrawTextureFromRect(-NameTagTex^.w - 14, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, NameTagTex);
+            // draw flag
+            r.w:= 22;
+            r.h:= 15;
+            DrawTextureFromRect(-12, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, FlagTex);
+            // draw health bar
+            r.w:= TeamHealthBarWidth + 1;
+            r.h:= HealthTex^.h - 4;
+            DrawTextureFromRect(16, cScreenHeight + DrawHealthY + smallScreenOffset + 2, @r, HealthTex);
+            if not hasGone and (TeamHealth > 1) then
+                begin
+                Tint(Clan^.Color shl 8 or $FF);
+                for i:= 0 to cMaxHHIndex do
+                    if Hedgehogs[i].Gear <> nil then
+                        begin
+                        inc(h,Hedgehogs[i].Gear^.Health);
+                        if h < TeamHealth then DrawTexture(15 + h*TeamHealthBarWidth div TeamHealth, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
+                        end;
+                if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
+                    Tint($FF,$FF,$FF,$80)
+                else Tint($FF, $FF, $FF, $FF);
+                end;
+            end;
+        end;
 if smallScreenOffset <> 0 then
     begin
     SetScale(cDefaultZoomLevel);
-    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then Tint($FF,$FF,$FF,$FF);
+    if TeamsCount * 20 > Longword(cScreenHeight) div 5 then
+        Tint($FF,$FF,$FF,$FF);
     end;
 
 // Lag alert
-if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
+if isInLag then
+    DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr 7) mod 12);
 
 // Wind bar
-{$IFDEF IPHONEOS}
+{$IFDEF USE_TOUCH_INTERFACE}
     offsetX:= cScreenHeight - 13;
     offsetY:= (cScreenWidth shr 1) + 74;
 {$ELSE}
@@ -1033,7 +1377,7 @@ if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr
 {$ENDIF}
     DrawSprite(sprWindBar, (cScreenWidth shr 1) - offsetY, cScreenHeight - offsetX, 0);
     if WindBarWidth > 0 then
-    begin
+        begin
         {$WARNINGS OFF}
         r.x:= 8 - (RealTicks shr 6) mod 8;
         {$WARNINGS ON}
@@ -1041,7 +1385,7 @@ if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr
         r.w:= WindBarWidth;
         r.h:= 13;
         DrawSpriteFromRect(sprWindR, r, (cScreenWidth shr 1) - offsetY + 77, cScreenHeight - offsetX + 2, 13, 0);
-    end
+        end
     else
         if WindBarWidth < 0 then
         begin
@@ -1055,49 +1399,73 @@ if isInLag then DrawSprite(sprLag, 32 - (cScreenWidth shr 1), 32, (RealTicks shr
         end;
 
 // AmmoMenu
-if (AMxShift < AMWidth) or bShowAmmoMenu then ShowAmmoMenu;
+if bShowAmmoMenu and ((AMState = AMHidden) or (AMState = AMHiding)) then
+    begin
+    if (AMState = AMHidden) then
+        AMAnimStartTime:= RealTicks
+    else
+        AMAnimStartTime:= RealTicks - (AMAnimDuration - (RealTicks - AMAnimStartTime));
+    AMState:= AMShowingUp;
+    end;
+if not(bShowAmmoMenu) and ((AMstate = AMShowing) or (AMState = AMShowingUp)) then
+    begin
+    if (AMState = AMShowing) then
+        AMAnimStartTime:= RealTicks
+    else
+        AMAnimStartTime:= RealTicks - (AMAnimDuration - (RealTicks - AMAnimStartTime));
+    AMState:= AMHiding;
+    end; 
+
+if bShowAmmoMenu or (AMState = AMHiding) then
+    ShowAmmoMenu;
 
 // Cursor
 if isCursorVisible and bShowAmmoMenu then
-   DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
+    DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
 
 // Chat
 DrawChat;
 
 // various captions
-if fastUntilLag then DrawCentered(0, (cScreenHeight shr 1), SyncTexture);
-if isPaused then DrawCentered(0, (cScreenHeight shr 1), PauseTexture);
+if fastUntilLag then
+    DrawTextureCentered(0, (cScreenHeight shr 1), SyncTexture);
+if isPaused then
+    DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture);
 if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then
     begin
-    if (ReadyTimeLeft = 0) and (missionTimer > 0) then dec(missionTimer, Lag);
-    if missionTimer < 0 then missionTimer:= 0; // avoid subtracting below 0
+    if (ReadyTimeLeft = 0) and (missionTimer > 0) then
+        dec(missionTimer, Lag);
+    if missionTimer < 0 then
+        missionTimer:= 0; // avoid subtracting below 0
     if missionTex <> nil then
-        DrawCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
+        DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
     end;
 
 // fps
-{$IFDEF IPHONEOS}
-offsetX:= 8;
+{$IFDEF USE_TOUCH_INTERFACE}
+offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12;
 {$ELSE}
 offsetX:= 10;
 {$ENDIF}
 offsetY:= cOffsetY;
 if (RM = rmDefault) or (RM = rmRightEye) then
-begin
+    begin
     inc(Frames);
 
     if cShowFPS or (GameType = gmtDemo) then
         inc(CountTicks, Lag);
     if (GameType = gmtDemo) and (CountTicks >= 1000) then
-    begin
-        i:=GameTicks div 1000;
+        begin
+        i:= GameTicks div 1000;
         t:= i mod 60;
         s:= inttostr(t);
-        if t < 10 then s:= '0' + s;
+        if t < 10 then
+            s:= '0' + s;
         i:= i div 60;
         t:= i mod 60;
         s:= inttostr(t) + ':' + s;
-        if t < 10 then s:= '0' + s;
+        if t < 10 then
+            s:= '0' + s;
         s:= inttostr(i div 60) + ':' + s;
    
     
@@ -1106,15 +1474,15 @@ begin
         FreeTexture(timeTexture);
         timeTexture:= Surface2Tex(tmpSurface, false);
         SDL_FreeSurface(tmpSurface)
-    end;
+        end;
 
     if timeTexture <> nil then
         DrawTexture((cScreenWidth shr 1) - 20 - timeTexture^.w - offsetY, offsetX + timeTexture^.h+5, timeTexture);
 
     if cShowFPS then
-    begin
-        if CountTicks >= 1000 then
         begin
+        if CountTicks >= 1000 then
+            begin
             FPS:= Frames;
             Frames:= 0;
             CountTicks:= 0;
@@ -1124,29 +1492,29 @@ begin
             FreeTexture(fpsTexture);
             fpsTexture:= Surface2Tex(tmpSurface, false);
             SDL_FreeSurface(tmpSurface)
-        end;
+            end;
         if fpsTexture <> nil then
             DrawTexture((cScreenWidth shr 1) - 60 - offsetY, offsetX, fpsTexture);
-    end;
-
-    if CountTicks >= 1000 then CountTicks:= 0;
+        end;
 
     // lag warning (?)
     inc(SoundTimerTicks, Lag);
 end;
 
 if SoundTimerTicks >= 50 then
-   begin
-   SoundTimerTicks:= 0;
-   if cVolumeDelta <> 0 then
-      begin
-      str(ChangeVolume(cVolumeDelta), s);
-      AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume)
-      end
-   end;
+begin
+    SoundTimerTicks:= 0;
+    if cVolumeDelta <> 0 then
+    begin
+        str(ChangeVolume(cVolumeDelta), s);
+        AddCaption(Format(trmsg[sidVolume], s), cWhiteColor, capgrpVolume);
+    end;
+    if isAudioMuted then
+        AddCaption(trmsg[sidMute], cWhiteColor, capgrpVolume)
+end;
 
 if GameState = gsConfirm then
-    DrawCentered(0, (cScreenHeight shr 1), ConfirmTexture);
+    DrawTextureCentered(0, (cScreenHeight shr 1), ConfirmTexture);
 
 if ScreenFade <> sfNone then
     begin
@@ -1184,44 +1552,96 @@ if ScreenFade <> sfNone then
 
         glEnable(GL_TEXTURE_2D);
         Tint($FF, $FF, $FF, $FF);
-        if not isFirstFrame and ((ScreenFadeValue = 0) or (ScreenFadeValue = sfMax)) then ScreenFade:= sfNone
+        if not isFirstFrame and ((ScreenFadeValue = 0) or (ScreenFadeValue = sfMax)) then
+            ScreenFade:= sfNone
         end
     end;
 
+{$IFDEF USE_VIDEO_RECORDING}
+// during video prerecording draw red blinking circle and text 'rec'
+if flagPrerecording then
+    begin
+    if recTexture = nil then
+        begin
+        s:= 'rec';
+        tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fntBig].Handle, Str2PChar(s), cWhiteColorChannels);
+        tmpSurface:= doSurfaceConversion(tmpSurface);
+        FreeTexture(recTexture);
+        recTexture:= Surface2Tex(tmpSurface, false);
+        SDL_FreeSurface(tmpSurface)
+        end;
+    DrawTexture( -(cScreenWidth shr 1) + 50, 20, recTexture);
+
+    // draw red circle
+    glDisable(GL_TEXTURE_2D); 
+    Tint($FF, $00, $00, Byte(Round(127*(1 + sin(SDL_GetTicks()*0.007)))));
+    glBegin(GL_POLYGON);
+    for i:= 0 to 20 do
+        glVertex2f(-(cScreenWidth shr 1) + 30 + sin(i*2*Pi/20)*10, 35 + cos(i*2*Pi/20)*10);
+    glEnd();
+    Tint($FF, $FF, $FF, $FF);
+    glEnable(GL_TEXTURE_2D);
+    end;
+{$ENDIF}
+
 SetScale(zoom);
 
+// Attack bar
+    if CurrentTeam <> nil then
+        case AttackBar of
+(*        1: begin
+        r:= StuffPoz[sPowerBar];
+        {$WARNINGS OFF}
+        r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor;
+        {$WARNINGS ON}
+        DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
+        end;*)
+        2: with CurrentHedgehog^ do
+                begin
+                tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
+                tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
+                for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
+                    DrawSprite(sprPower,
+                            hwRound(Gear^.X) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + LongInt(round(WorldDx + tdx * (24 + i * 2))) - 16,
+                            hwRound(Gear^.Y) + GetLaunchY(CurAmmoType, Gear^.Angle) + LongInt(round(WorldDy + tdy * (24 + i * 2))) - 16,
+                            i)
+                end
+        end;
+
+
 // Cursor
 if isCursorVisible then
-   begin
-   if not bShowAmmoMenu then
-     begin
-     with CurrentHedgehog^ do
-       if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
-         begin
-         if (CurAmmoType = amNapalm) or (CurAmmoType = amMineStrike) then
-           DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
-         i:= GetAmmoEntry(CurrentHedgehog^)^.Pos;
-         with Ammoz[CurAmmoType] do
-           if PosCount > 1 then
-             DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);
-         end;
-     DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
-     end
-   end;
+    begin
+    if not bShowAmmoMenu then
+        begin
+        with CurrentHedgehog^ do
+            if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
+                begin
+            if (CurAmmoType = amNapalm) or (CurAmmoType = amMineStrike) then
+                DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
+            i:= GetCurAmmoEntry(CurrentHedgehog^)^.Pos;
+            with Ammoz[CurAmmoType] do
+                if PosCount > 1 then
+                    DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);
+                end;
+        DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
+        end
+    end;
 isFirstFrame:= false
 end;
 
+var PrevSentPointTime: LongWord = 0;
+
 procedure MoveCamera;
-var EdgesDist, wdy, shs,z: LongInt;
-    PrevSentPointTime: LongWord = 0;
+var EdgesDist, wdy, shs,z, amNumOffsetX, amNumOffsetY: LongInt;
 begin
-{$IFNDEF IPHONEOS}
-if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
+{$IFNDEF MOBILE}
+if (not (CurrentTeam^.ExtDriven and isCursorVisible and (not bShowAmmoMenu))) and cHasFocus and (GameState <> gsConfirm) then
     uCursor.updatePosition();
 {$ENDIF}
 z:= round(200/zoom);
-if not PlacingHogs and (FollowGear <> nil) and not isCursorVisible and not bShowAmmoMenu and not fastUntilLag then
-    if (not autoCameraOn) or ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
+if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) and autoCameraOn then
+    if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
         begin
         FollowGear:= nil;
         prevPoint:= CursorPoint;
@@ -1237,84 +1657,103 @@ if not PlacingHogs and (FollowGear <> nil) and not isCursorVisible and not bShow
         end;
 
 wdy:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine - cVisibleWater;
-if WorldDy < wdy then WorldDy:= wdy;
+if WorldDy < wdy then
+    WorldDy:= wdy;
 
-if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then exit;
+if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
+    exit;
 
-if AMxShift < AMWidth then
+if (AMState = AMShowingUp) or (AMState = AMShowing) then
 begin
-{$IFDEF IPHONEOS}
-    if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth;
-    if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset;
-    if CursorPoint.Y < cScreenHeight - AMyOffset - SlotsNum * AMSlotSize then CursorPoint.Y:= cScreenHeight - AMyOffset - SlotsNum * AMSlotSize;
-    if CursorPoint.Y > cScreenHeight - AMyOffset then CursorPoint.Y:= cScreenHeight - AMyOffset;
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+    amNumOffsetX:= 0;
+    {$IFDEF USE_AM_NUMCOLUMN}
+    amNumOffsetY:= AMSlotSize;
+    {$ELSE}
+    amNumOffsetY:= 0;
+    {$ENDIF}
 {$ELSE}
-    if CursorPoint.X < cScreenWidth div 2 + AMxShift - AMWidth + AMSlotSize then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMWidth + AMSlotSize;
-    if CursorPoint.X > cScreenWidth div 2 + AMxShift - AMxOffset then CursorPoint.X:= cScreenWidth div 2 + AMxShift - AMxOffset;
-    if CursorPoint.Y > AMyOffset + (SlotsNum + 1) * AMSlotSize then CursorPoint.Y:= AMyOffset + (SlotsNum + 1) * AMSlotSize;
-    if CursorPoint.Y < AMyOffset + AMSlotSize then CursorPoint.Y:= AMyOffset + AMSlotSize;
+    amNumOffsetY:= 0;
+    {$IFDEF USE_AM_NUMCOLUMN}
+    amNumOffsetX:= AMSlotSize;
+    {$ELSE}
+    amNumOffsetX:= 0;
+    {$ENDIF}
+
 {$ENDIF}
+    if CursorPoint.X < AmmoRect.x + amNumOffsetX + 3 then//check left 
+        CursorPoint.X:= AmmoRect.x + amNumOffsetX + 3;
+    if CursorPoint.X > AmmoRect.x + AmmoRect.w - 3 then//check right
+        CursorPoint.X:= AmmoRect.x + AmmoRect.w - 3;
+    if CursorPoint.Y > cScreenHeight - AmmoRect.y -amNumOffsetY - 1 then//check top
+        CursorPoint.Y:= cScreenHeight - AmmoRect.y - amNumOffsetY - 1;
+    if CursorPoint.Y < cScreenHeight - (AmmoRect.y + AmmoRect.h - AMSlotSize - 5) then//check bottom
+        CursorPoint.Y:= cScreenHeight - (AmmoRect.y + AmmoRect.h - AMSlotSize - 5);
     prevPoint:= CursorPoint;
     //if cHasFocus then SDL_WarpMouse(CursorPoint.X + cScreenWidth div 2, cScreenHeight - CursorPoint.Y);
     exit
 end;
 
 if isCursorVisible then
-begin
-    if (not CurrentTeam^.ExtDriven) and (GameTicks >= PrevSentPointTime + cSendCursorPosTime) then
     begin
+    if (not CurrentTeam^.ExtDriven) and (GameTicks >= PrevSentPointTime + cSendCursorPosTime) then
+        begin
         SendIPCXY('P', CursorPoint.X - WorldDx, cScreenHeight - CursorPoint.Y - WorldDy);
         PrevSentPointTime:= GameTicks
-    end;
+        end;
     EdgesDist:= cCursorEdgesDist
-end
+    end
 else
     EdgesDist:= cGearScrEdgesDist;
 
 // this generates the border around the screen that moves the camera when cursor is near it
-if isCursorVisible or (FollowGear <> nil) then
-begin
-    if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then
+if isCursorVisible or ((FollowGear <> nil) and autoCameraOn) then
     begin
+    if CursorPoint.X < - cScreenWidth div 2 + EdgesDist then
+        begin
         WorldDx:= WorldDx - CursorPoint.X - cScreenWidth div 2 + EdgesDist;
         CursorPoint.X:= - cScreenWidth div 2 + EdgesDist
-    end
+        end
     else
         if CursorPoint.X > cScreenWidth div 2 - EdgesDist then
-        begin
+            begin
             WorldDx:= WorldDx - CursorPoint.X + cScreenWidth div 2 - EdgesDist;
             CursorPoint.X:= cScreenWidth div 2 - EdgesDist
-        end;
+            end;
 
     shs:= min(cScreenHeight div 2 - trunc(cScreenHeight / cScaleFactor) + EdgesDist, cScreenHeight - EdgesDist);
     if CursorPoint.Y < shs then
-    begin
+        begin
         WorldDy:= WorldDy + CursorPoint.Y - shs;
         CursorPoint.Y:= shs;
-    end
+        end
     else
         if (CursorPoint.Y > cScreenHeight - EdgesDist) then
-        begin
+            begin
            WorldDy:= WorldDy + CursorPoint.Y - cScreenHeight + EdgesDist;
            CursorPoint.Y:= cScreenHeight - EdgesDist
-        end;
-end
+            end;
+    end
 else
     if cHasFocus then
-    begin
+        begin
         WorldDx:= WorldDx - CursorPoint.X + prevPoint.X;
         WorldDy:= WorldDy + CursorPoint.Y - prevPoint.Y;
         CursorPoint.X:= 0;
         CursorPoint.Y:= cScreenHeight div 2;
-    end;
+        end;
 
 // this moves the camera according to CursorPoint X and Y
 prevPoint:= CursorPoint;
 //if cHasFocus then SDL_WarpMouse(CursorPoint.X + (cScreenWidth shr 1), cScreenHeight - CursorPoint.Y);
-if WorldDy > LAND_HEIGHT + 1024 then WorldDy:= LAND_HEIGHT + 1024;
-if WorldDy < wdy then WorldDy:= wdy;
-if WorldDx < - LAND_WIDTH - 1024 then WorldDx:= - LAND_WIDTH - 1024;
-if WorldDx > 1024 then WorldDx:= 1024;
+if WorldDy > LAND_HEIGHT + 1024 then
+    WorldDy:= LAND_HEIGHT + 1024;
+if WorldDy < wdy then
+    WorldDy:= wdy;
+if WorldDx < - LAND_WIDTH - 1024 then
+    WorldDx:= - LAND_WIDTH - 1024;
+if WorldDx > 1024 then
+    WorldDx:= 1024;
 end;
 
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
@@ -1323,7 +1762,8 @@ begin
 r.w:= 32;
 r.h:= 32;
 
-if time = 0 then time:= 5000;
+if time = 0 then
+    time:= 5000;
 missionTimer:= time;
 FreeTexture(missionTex);
 
@@ -1348,12 +1788,13 @@ end;
 
 procedure ShakeCamera(amount: LongInt);
 begin
-    if isCursorVisible then exit;
-    amount:= Max(1, round(amount*zoom/2));
-    WorldDx:= WorldDx - amount + LongInt(random(1 + amount * 2));
-    WorldDy:= WorldDy - amount + LongInt(random(1 + amount * 2));
-    //CursorPoint.X:= CursorPoint.X - amount + LongInt(random(1 + amount * 2));
-    //CursorPoint.Y:= CursorPoint.Y - amount + LongInt(random(1 + amount * 2))
+if isCursorVisible then
+    exit;
+amount:= Max(1, round(amount*zoom/2));
+WorldDx:= WorldDx - amount + LongInt(random(1 + amount * 2));
+WorldDy:= WorldDy - amount + LongInt(random(1 + amount * 2));
+//CursorPoint.X:= CursorPoint.X - amount + LongInt(random(1 + amount * 2));
+//CursorPoint.Y:= CursorPoint.Y - amount + LongInt(random(1 + amount * 2))
 end;
 
 
@@ -1361,12 +1802,76 @@ procedure onFocusStateChanged;
 begin
 if (not cHasFocus) and (GameState <> gsConfirm) then
     ParseCommand('quit', true);
+{$IFDEF MOBILE}
+// when created SDL receives an exposure event that calls UndampenAudio at full power, muting audio
+exit;
+{$ENDIF}
+
+{$IFDEF USE_VIDEO_RECORDING}
+// do not change volume during prerecording as it will affect sound in video file
+if not flagPrerecording then
+{$ENDIF}
+    begin
+    if not cHasFocus then DampenAudio()
+    else UndampenAudio();
+    end;
+end;
+
+procedure SetUtilityWidgetState(ammoType: TAmmoType);
+begin
+{$IFDEF USE_TOUCH_INTERFACE}
+if(ammoType = amNothing)then
+    ammoType:= CurrentHedgehog^.CurAmmoType;
+
+if(CurrentHedgehog <> nil)then
+    if (Ammoz[ammoType].Ammo.Propz and ammoprop_Timerable) <> 0 then
+        begin
+        utilityWidget.sprite:= sprTimerButton;
+        animateWidget(@utilityWidget, true, true);
+        end 
+    else if (Ammoz[ammoType].Ammo.Propz and ammoprop_NeedTarget) <> 0 then
+        begin
+        utilityWidget.sprite:= sprTargetButton;
+        animateWidget(@utilityWidget, true, true);
+        end
+    else if ammoType = amSwitch then
+        begin
+        utilityWidget.sprite:= sprTargetButton;
+        animateWidget(@utilityWidget, true, true);
+        end
+    else if utilityWidget.show then
+        animateWidget(@utilityWidget, true, false);
+{$ELSE}
+ammoType:= ammoType; // avoid hint
+{$ENDIF}
+end;
+
+procedure animateWidget(widget: POnScreenWidget; fade, showWidget: boolean);
+begin
+with widget^ do
+    begin
+    show:= showWidget;
+    if fade then fadeAnimStart:= RealTicks;
+    
+    with moveAnim do
+        begin
+        animate:= true;
+        startTime:= RealTicks;
+        source.x:= source.x xor target.x; //swap source <-> target
+        target.x:= source.x xor target.x;
+        source.x:= source.x xor target.x;
+        source.y:= source.y xor target.y;
+        target.y:= source.y xor target.y;
+        source.y:= source.y xor target.y;
+        end;
+    end;
 end;
 
 
 procedure initModule;
 begin
     fpsTexture:= nil;
+    recTexture:= nil;
     FollowGear:= nil;
     WindBarWidth:= 0;
     bShowAmmoMenu:= false;
@@ -1375,6 +1880,7 @@ begin
     Frames:= 0;
     WorldDx:= -512;
     WorldDy:= -256;
+    PrevSentPointTime:= 0;
 
     FPS:= 0;
     CountTicks:= 0;
@@ -1385,17 +1891,14 @@ begin
     missionTex:= nil;
     cOffsetY:= 0;
     stereoDepth:= 0;
+    AMState:= AMHidden;
+    isFirstFrame:= true;
+    stereoDepth:= stereoDepth; // avoid hint
 end;
 
 procedure freeModule;
 begin
-    stereoDepth:= stereoDepth; // avoid hint
-    FreeTexture(fpsTexture);
-    fpsTexture:= nil;
-    FreeTexture(timeTexture);
-    timeTexture:= nil;
-    FreeTexture(missionTex);
-    missionTex:= nil
+    ResetWorldTex();
 end;
 
 end.
diff --git a/misc/Android.mk b/misc/Android.mk
new file mode 100644
index 0000000..295f430
--- /dev/null
+++ b/misc/Android.mk
@@ -0,0 +1,6 @@
+MISC_DIR   := $(call my-dir)
+LOCAL_PATH := MISC_DIR
+
+include $(MISC_DIR)/libfreetype/Android.mk
+include $(MISC_DIR)/liblua/Android.mk
+include $(MISC_DIR)/libtremor/Android.mk
diff --git a/misc/hats_js_anim.xhtml b/misc/hats_js_anim.xhtml
index a3bfba3..a1ec016 100644
--- a/misc/hats_js_anim.xhtml
+++ b/misc/hats_js_anim.xhtml
@@ -10,7 +10,7 @@ body
 {
     background: url('http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left;
     -moz-background-size: 200%;
-    background-size: 200%;
+    background-size: 100% 100%;
     font-family: sans-serif;
 }
 h1 { text-shadow: 0 0 2px white; }
@@ -47,6 +47,7 @@ would be easier with a server-side portion. list of sprites could be gotten from
 /*var masks = ['2001suit2', '2001suit', '4gsuif', 'AkuAku', 'android', 'angel', 'anzac', 'apple', 'ash', 'Balrog', 'banana', 'Bandit', 'bat', 'beaver', 'beefeater', 'Blanka', 'BlankaToothless', 'BlueCap', 'BlueHair', 'bobby2v', 'bobby', 'Bob', 'BrainSlugMouth', 'BrainSlug', 'britishpithhelmet', 'britmedic', 'britsapper', 'Bub', 'Bunny', 'bushhider', 'charlesdegaulle', 'charmander', 'chef', 'chikorita', 'Chunli', 'clown-copper', 'clown-crossed', 'clown', 'Coonskin3', 'Cororon', 'Cowboy', 'crown', 'cyborg', 'darthvader', 'Deer', 'desertgrenadier01', 'desertgrenadier02', 'desertgrenadier04', 'desertgrenadier05', 'desertgrenadierofficer', 'desertmedic', 'desertsapper1', 'desertsapper2', 'diglett', 'Disguise', 'Dragon', 'dwarf', 'eastertop', 'Elvis', 'Eva_00b', 'Eva_00y', 'Falcon', 'frenchwwigasmask', 'frenchwwihelmet', 'Gasmask', 'Geordi', 'germanwiimedichelmet', 'germanwwihelmetmustache', 'germanwwiipithhelmetdes', 'germanwwitankhelmet', 'Glasses', 'GreenCap', 'GreenHair', 'grenadier1', 'GreyHair', 'Guile', 'hedgehogk', 'HogInTheHat', 'hogpharoah', 'Honda', 'IndianChief', 'infernalhorns', 'InfernalHorns', 'Jason', 'jigglypuff', 'judo', 'junior', 'Ken', 'KirbyMask', 'kiss_criss', 'kiss_frehley', 'kiss_simmons', 'kiss_stanley', 'knight', 'Kululun', 'Ladle', 'lambda', 'Laminaria', 'laurel', 'lemon', 'link', 'lugia', 'Luigi', 'Mario', 'MegaHogX', 'metalband', 'mexicansunbrero', 'mickey_ears', 'Moose', 'mp3', 'mudkip', 'Mummy', 'naruto', 'NinjaFull', 'NinjaStraight', 'NinjaTriangle', 'OldMan', 'OrangeHair', 'orange', 'Pantsu', 'Pig', 'pikachu', 'PinkHair', 'pinksunhat', 'pirate_jack_bandana', 'pirate_jack', 'plainpith', 'Plunger', 'policecap', 'porkey', 'PrincessDaisy', 'PrincessPeach', 'Pumpkin_Hat', 'PurpleHair', 'quotecap', 'Rain', 'Rambo', 'rasta', 'RedCap', 'RedHair', 'RobinHood', 'royalguard', 'RSR', 'Ryu', 'Samurai', 'Samus', 'Santa', 'SauceBoatSilver', 'ShaggyYeti', 'sheep', 'ShortHair_Black', 'ShortHair_Brown', 'ShortHair_Grey', 'ShortHair_Red', 'ShortHair_Yellow', 'Skull', 'Sleepwalker', 'slowpoke', 'Sniper', 'Sonic', 'sovietcomrade2', 'sovietcomrade', 'SparkleSuperFun', 'SparkssHelmet', 'spartan', 'spcartman', 'spidey', 'spkenny', 'spkyle', 'spstan', 'squirtle', 'sth_AmyClassic', 'sth_Amy', 'sth_Eggman', 'sth_Knux', 'sth_Metal', 'sth_Shadow', 'sth_Sonic', 'sth_Super', 'sth_Tails', 'stormcloud', 'stormtrooper', 'StrawHatEyes', 'StrawHatFacial', 'StrawHat', 'Sunglasses', 'SunWukong', 'Teacup', 'Teapot', 'terminatorc', 'Terminator_Glasses', 'thug', 'Toad', 'tophats', 'touhou_chen', 'touhou_marisa', 'touhou_patchouli', 'touhou_remelia', 'touhou_suwako', 'touhou_yukari', 'trenchgrenadier1', 'trenchgrenadier2', 'trenchgrenadier3', 'ushanka', 'vampirichog', 'Vega', 'venom', 'Viking', 'voltorb', 'Wario', 'WhySoSerious', 'WizardHat', 'YellowCap', 'YellowHair', 'Zombi'];*/
 var masks = [];
 var themes = {
+"Cave":1,
 "Golf":1,
 "Stage":1,
 "Island":0,
diff --git a/misc/libfreetype/Android.mk b/misc/libfreetype/Android.mk
new file mode 100644
index 0000000..c2cd0f5
--- /dev/null
+++ b/misc/libfreetype/Android.mk
@@ -0,0 +1,45 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+# compile in ARM mode, since the glyph loader/renderer is a hotspot
+# when loading complex pages in the browser
+#
+LOCAL_ARM_MODE := arm
+
+LOCAL_SRC_FILES:= \
+	src/base/ftbbox.c \
+	src/base/ftbitmap.c \
+	src/base/ftglyph.c \
+	src/base/ftstroke.c \
+	src/base/ftxf86.c \
+	src/base/ftbase.c \
+	src/base/ftsystem.c \
+	src/base/ftinit.c \
+	src/base/ftgasp.c \
+	src/raster/raster.c \
+	src/sfnt/sfnt.c \
+	src/smooth/smooth.c \
+	src/autofit/autofit.c \
+	src/truetype/truetype.c \
+	src/cff/cff.c \
+	src/psnames/psnames.c \
+	src/pshinter/pshinter.c
+
+LOCAL_C_INCLUDES += \
+	$(LOCAL_PATH)/builds \
+	$(LOCAL_PATH)/include
+
+LOCAL_CFLAGS += -W -Wall
+LOCAL_CFLAGS += -fPIC -DPIC
+LOCAL_CFLAGS += "-DDARWIN_NO_CARBON"
+LOCAL_CFLAGS += "-DFT2_BUILD_LIBRARY"
+
+# the following is for testing only, and should not be used in final builds
+# of the product
+#LOCAL_CFLAGS += "-DTT_CONFIG_OPTION_BYTECODE_INTERPRETER"
+
+LOCAL_CFLAGS += -O2
+
+LOCAL_MODULE:= freetype
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.mode1v3 b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.mode1v3
similarity index 100%
rename from misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.mode1v3
rename to misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.mode1v3
diff --git a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.pbxuser b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.pbxuser
similarity index 100%
rename from misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/default.pbxuser
rename to misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/default.pbxuser
diff --git a/misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj b/misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/project.pbxproj
similarity index 100%
rename from misc/libfreetype/Xcode-iPhoneOS/Freetype.xcodeproj/project.pbxproj
rename to misc/libfreetype/Xcode-iOS/Freetype.xcodeproj/project.pbxproj
diff --git a/misc/libfreetype/Xcode-iPhoneOS/Freetype_Prefix.pch b/misc/libfreetype/Xcode-iOS/Freetype_Prefix.pch
similarity index 100%
rename from misc/libfreetype/Xcode-iPhoneOS/Freetype_Prefix.pch
rename to misc/libfreetype/Xcode-iOS/Freetype_Prefix.pch
diff --git a/misc/libfreetype/include/freetype/config/ftconfig.h b/misc/libfreetype/include/freetype/config/ftconfig.h
index 79c9da4..96f5628 100644
--- a/misc/libfreetype/include/freetype/config/ftconfig.h
+++ b/misc/libfreetype/include/freetype/config/ftconfig.h
@@ -340,6 +340,7 @@ FT_BEGIN_HEADER
 #define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
 
   /* documentation is in freetype.h */
+  // Xeli: Got this snippet from  a 2.4.6 source
 
   static __inline__ FT_Int32
   FT_MulFix_arm( FT_Int32  a,
@@ -347,7 +348,6 @@ FT_BEGIN_HEADER
   {
     register FT_Int32  t, t2;
 
-<<<<<<< Updated upstream
 
     __asm__ __volatile__ (
       "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
@@ -357,17 +357,6 @@ FT_BEGIN_HEADER
       "adc    %2, %2, #0\n\t"           /* %2 += carry */
       "mov    %0, %1, lsr #16\n\t"      /* %0  = %1 >> 16 */
       "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
-=======
-#warning Should this be __asm__ ?
-    asm __volatile__ (
-      "smull  %1, %2, %4, %3\n\t"   /* (lo=%1,hi=%2) = a*b */
-      "mov    %0, %2, asr #31\n\t"  /* %0  = (hi >> 31) */
-      "add    %0, %0, #0x8000\n\t"  /* %0 += 0x8000 */
-      "adds   %1, %1, %0\n\t"       /* %1 += %0 */
-      "adc    %2, %2, #0\n\t"       /* %2 += carry */
-      "mov    %0, %1, lsr #16\n\t"  /* %0  = %1 >> 16 */
-      "orr    %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
->>>>>>> Stashed changes
       : "=r"(a), "=&r"(t2), "=&r"(t)
       : "r"(a), "r"(b) );
     return a;
diff --git a/misc/liblua/CMakeLists.txt b/misc/liblua/CMakeLists.txt
deleted file mode 100644
index cb9e2aa..0000000
--- a/misc/liblua/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-file(GLOB lua_src *.c *.h)
-set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
-
-IF(APPLE)
-	set(build_type STATIC)
-	add_definitions(-DLUA_USE_LINUX)
-	add_library (lua ${build_type} ${lua_src})
-ENDIF(APPLE)
-
-IF(WIN32)
-	set(build_type SHARED)
-	add_definitions(-DLUA_BUILD_AS_DLL)
-	add_library (lua ${build_type} ${lua_src})
-
-	SET_TARGET_PROPERTIES(lua PROPERTIES PREFIX "")
-	install(TARGETS lua RUNTIME DESTINATION ${target_dir})
-endif(WIN32)
-
-
-
diff --git a/misc/liblua/Xcode/Lua.xcodeproj/default.mode1v3 b/misc/liblua/Xcode/Lua.xcodeproj/default.mode1v3
deleted file mode 100644
index 64252df..0000000
--- a/misc/liblua/Xcode/Lua.xcodeproj/default.mode1v3
+++ /dev/null
@@ -1,1357 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>ActivePerspectiveName</key>
-	<string>Project</string>
-	<key>AllowedModules</key>
-	<array>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXSmartGroupTreeModule</string>
-			<key>Name</key>
-			<string>Groups and Files Outline View</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXNavigatorGroup</string>
-			<key>Name</key>
-			<string>Editor</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>XCTaskListModule</string>
-			<key>Name</key>
-			<string>Task List</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>XCDetailModule</string>
-			<key>Name</key>
-			<string>File and Smart Group Detail Viewer</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>1</string>
-			<key>Module</key>
-			<string>PBXBuildResultsModule</string>
-			<key>Name</key>
-			<string>Detailed Build Results Viewer</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>1</string>
-			<key>Module</key>
-			<string>PBXProjectFindModule</string>
-			<key>Name</key>
-			<string>Project Batch Find Tool</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>XCProjectFormatConflictsModule</string>
-			<key>Name</key>
-			<string>Project Format Conflicts List</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXBookmarksModule</string>
-			<key>Name</key>
-			<string>Bookmarks Tool</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXClassBrowserModule</string>
-			<key>Name</key>
-			<string>Class Browser</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXCVSModule</string>
-			<key>Name</key>
-			<string>Source Code Control Tool</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXDebugBreakpointsModule</string>
-			<key>Name</key>
-			<string>Debug Breakpoints Tool</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>XCDockableInspector</string>
-			<key>Name</key>
-			<string>Inspector</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>PBXOpenQuicklyModule</string>
-			<key>Name</key>
-			<string>Open Quickly Tool</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>1</string>
-			<key>Module</key>
-			<string>PBXDebugSessionModule</string>
-			<key>Name</key>
-			<string>Debugger</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>1</string>
-			<key>Module</key>
-			<string>PBXDebugCLIModule</string>
-			<key>Name</key>
-			<string>Debug Console</string>
-		</dict>
-		<dict>
-			<key>BundleLoadPath</key>
-			<string></string>
-			<key>MaxInstances</key>
-			<string>n</string>
-			<key>Module</key>
-			<string>XCSnapshotModule</string>
-			<key>Name</key>
-			<string>Snapshots Tool</string>
-		</dict>
-	</array>
-	<key>BundlePath</key>
-	<string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string>
-	<key>Description</key>
-	<string>DefaultDescriptionKey</string>
-	<key>DockingSystemVisible</key>
-	<false/>
-	<key>Extension</key>
-	<string>mode1v3</string>
-	<key>FavBarConfig</key>
-	<dict>
-		<key>PBXProjectModuleGUID</key>
-		<string>619599841364E41A00B429B6</string>
-		<key>XCBarModuleItemNames</key>
-		<dict/>
-		<key>XCBarModuleItems</key>
-		<array/>
-	</dict>
-	<key>FirstTimeWindowDisplayed</key>
-	<false/>
-	<key>Identifier</key>
-	<string>com.apple.perspectives.project.mode1v3</string>
-	<key>MajorVersion</key>
-	<integer>33</integer>
-	<key>MinorVersion</key>
-	<integer>0</integer>
-	<key>Name</key>
-	<string>Default</string>
-	<key>Notifications</key>
-	<array/>
-	<key>OpenEditors</key>
-	<array/>
-	<key>PerspectiveWidths</key>
-	<array>
-		<integer>-1</integer>
-		<integer>-1</integer>
-	</array>
-	<key>Perspectives</key>
-	<array>
-		<dict>
-			<key>ChosenToolbarItems</key>
-			<array>
-				<string>active-combo-popup</string>
-				<string>active-executable-popup</string>
-				<string>NSToolbarFlexibleSpaceItem</string>
-				<string>debugger-enable-breakpoints</string>
-				<string>buildOrClean</string>
-				<string>build-and-go</string>
-				<string>clean-target</string>
-				<string>com.apple.ide.PBXToolbarStopButton</string>
-				<string>NSToolbarFlexibleSpaceItem</string>
-			</array>
-			<key>ControllerClassBaseName</key>
-			<string></string>
-			<key>IconName</key>
-			<string>WindowOfProjectWithEditor</string>
-			<key>Identifier</key>
-			<string>perspective.project</string>
-			<key>IsVertical</key>
-			<false/>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>BecomeActive</key>
-					<true/>
-					<key>ContentConfiguration</key>
-					<dict>
-						<key>PBXBottomSmartGroupGIDs</key>
-						<array>
-							<string>1C37FBAC04509CD000000102</string>
-							<string>1C37FAAC04509CD000000102</string>
-							<string>1C37FABC05509CD000000102</string>
-							<string>1C37FABC05539CD112110102</string>
-							<string>E2644B35053B69B200211256</string>
-							<string>1C37FABC04509CD000100104</string>
-							<string>1CC0EA4004350EF90044410B</string>
-							<string>1CC0EA4004350EF90041110B</string>
-						</array>
-						<key>PBXProjectModuleGUID</key>
-						<string>1CE0B1FE06471DED0097A5F4</string>
-						<key>PBXProjectModuleLabel</key>
-						<string>Files</string>
-						<key>PBXProjectStructureProvided</key>
-						<string>yes</string>
-						<key>PBXSmartGroupTreeModuleColumnData</key>
-						<dict>
-							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
-							<array>
-								<real>186</real>
-							</array>
-							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
-							<array>
-								<string>MainColumn</string>
-							</array>
-						</dict>
-						<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
-						<dict>
-							<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
-							<array>
-								<string>0867D691FE84028FC02AAC07</string>
-								<string>1C37FABC05509CD000000102</string>
-							</array>
-							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
-							<array>
-								<array>
-									<integer>0</integer>
-								</array>
-							</array>
-							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-							<string>{{0, 0}, {186, 445}}</string>
-						</dict>
-						<key>PBXTopSmartGroupGIDs</key>
-						<array/>
-						<key>XCIncludePerspectivesSwitch</key>
-						<true/>
-						<key>XCSharingToken</key>
-						<string>com.apple.Xcode.GFSharingToken</string>
-					</dict>
-					<key>GeometryConfiguration</key>
-					<dict>
-						<key>Frame</key>
-						<string>{{0, 0}, {203, 463}}</string>
-						<key>GroupTreeTableConfiguration</key>
-						<array>
-							<string>MainColumn</string>
-							<real>186</real>
-						</array>
-						<key>RubberWindowFrame</key>
-						<string>2068 295 788 504 1920 0 1920 1200 </string>
-					</dict>
-					<key>Module</key>
-					<string>PBXSmartGroupTreeModule</string>
-					<key>Proportion</key>
-					<string>203pt</string>
-				</dict>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CE0B20306471E060097A5F4</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>MyNewFile14.java</string>
-								<key>PBXSplitModuleInNavigatorKey</key>
-								<dict>
-									<key>Split0</key>
-									<dict>
-										<key>PBXProjectModuleGUID</key>
-										<string>1CE0B20406471E060097A5F4</string>
-										<key>PBXProjectModuleLabel</key>
-										<string>MyNewFile14.java</string>
-									</dict>
-									<key>SplitCount</key>
-									<string>1</string>
-								</dict>
-								<key>StatusBarVisibility</key>
-								<true/>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {580, 277}}</string>
-								<key>RubberWindowFrame</key>
-								<string>2068 295 788 504 1920 0 1920 1200 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>277pt</string>
-						</dict>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CE0B20506471E060097A5F4</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Detail</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 282}, {580, 181}}</string>
-								<key>RubberWindowFrame</key>
-								<string>2068 295 788 504 1920 0 1920 1200 </string>
-							</dict>
-							<key>Module</key>
-							<string>XCDetailModule</string>
-							<key>Proportion</key>
-							<string>181pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>580pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Project</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>XCModuleDock</string>
-				<string>PBXSmartGroupTreeModule</string>
-				<string>XCModuleDock</string>
-				<string>PBXNavigatorGroup</string>
-				<string>XCDetailModule</string>
-			</array>
-			<key>TableOfContents</key>
-			<array>
-				<string>619599821364E41A00B429B6</string>
-				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>619599831364E41A00B429B6</string>
-				<string>1CE0B20306471E060097A5F4</string>
-				<string>1CE0B20506471E060097A5F4</string>
-			</array>
-			<key>ToolbarConfigUserDefaultsMinorVersion</key>
-			<string>2</string>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.defaultV3</string>
-		</dict>
-		<dict>
-			<key>ControllerClassBaseName</key>
-			<string></string>
-			<key>IconName</key>
-			<string>WindowOfProject</string>
-			<key>Identifier</key>
-			<string>perspective.morph</string>
-			<key>IsVertical</key>
-			<integer>0</integer>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>BecomeActive</key>
-					<integer>1</integer>
-					<key>ContentConfiguration</key>
-					<dict>
-						<key>PBXBottomSmartGroupGIDs</key>
-						<array>
-							<string>1C37FBAC04509CD000000102</string>
-							<string>1C37FAAC04509CD000000102</string>
-							<string>1C08E77C0454961000C914BD</string>
-							<string>1C37FABC05509CD000000102</string>
-							<string>1C37FABC05539CD112110102</string>
-							<string>E2644B35053B69B200211256</string>
-							<string>1C37FABC04509CD000100104</string>
-							<string>1CC0EA4004350EF90044410B</string>
-							<string>1CC0EA4004350EF90041110B</string>
-						</array>
-						<key>PBXProjectModuleGUID</key>
-						<string>11E0B1FE06471DED0097A5F4</string>
-						<key>PBXProjectModuleLabel</key>
-						<string>Files</string>
-						<key>PBXProjectStructureProvided</key>
-						<string>yes</string>
-						<key>PBXSmartGroupTreeModuleColumnData</key>
-						<dict>
-							<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
-							<array>
-								<real>186</real>
-							</array>
-							<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
-							<array>
-								<string>MainColumn</string>
-							</array>
-						</dict>
-						<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
-						<dict>
-							<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
-							<array>
-								<string>29B97314FDCFA39411CA2CEA</string>
-								<string>1C37FABC05509CD000000102</string>
-							</array>
-							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
-							<array>
-								<array>
-									<integer>0</integer>
-								</array>
-							</array>
-							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-							<string>{{0, 0}, {186, 337}}</string>
-						</dict>
-						<key>PBXTopSmartGroupGIDs</key>
-						<array/>
-						<key>XCIncludePerspectivesSwitch</key>
-						<integer>1</integer>
-						<key>XCSharingToken</key>
-						<string>com.apple.Xcode.GFSharingToken</string>
-					</dict>
-					<key>GeometryConfiguration</key>
-					<dict>
-						<key>Frame</key>
-						<string>{{0, 0}, {203, 355}}</string>
-						<key>GroupTreeTableConfiguration</key>
-						<array>
-							<string>MainColumn</string>
-							<real>186</real>
-						</array>
-						<key>RubberWindowFrame</key>
-						<string>373 269 690 397 0 0 1440 878 </string>
-					</dict>
-					<key>Module</key>
-					<string>PBXSmartGroupTreeModule</string>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Morph</string>
-			<key>PreferredWidth</key>
-			<integer>300</integer>
-			<key>ServiceClasses</key>
-			<array>
-				<string>XCModuleDock</string>
-				<string>PBXSmartGroupTreeModule</string>
-			</array>
-			<key>TableOfContents</key>
-			<array>
-				<string>11E0B1FE06471DED0097A5F4</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.default.shortV3</string>
-		</dict>
-	</array>
-	<key>PerspectivesBarVisible</key>
-	<false/>
-	<key>ShelfIsVisible</key>
-	<false/>
-	<key>SourceDescription</key>
-	<string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string>
-	<key>StatusbarIsVisible</key>
-	<true/>
-	<key>TimeStamp</key>
-	<real>0.0</real>
-	<key>ToolbarConfigUserDefaultsMinorVersion</key>
-	<string>2</string>
-	<key>ToolbarDisplayMode</key>
-	<integer>1</integer>
-	<key>ToolbarIsVisible</key>
-	<true/>
-	<key>ToolbarSizeMode</key>
-	<integer>1</integer>
-	<key>Type</key>
-	<string>Perspectives</string>
-	<key>UpdateMessage</key>
-	<string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature).  You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature.  Do you wish to update to the latest Workspace defaults for project '%@'?</string>
-	<key>WindowJustification</key>
-	<integer>5</integer>
-	<key>WindowOrderList</key>
-	<array>
-		<string>619599851364E41A00B429B6</string>
-		<string>/Users/vittorio/hedgewars/trunk/misc/liblua/Xcode/Lua.xcodeproj</string>
-	</array>
-	<key>WindowString</key>
-	<string>2068 295 788 504 1920 0 1920 1200 </string>
-	<key>WindowToolsV3</key>
-	<array>
-		<dict>
-			<key>FirstTimeWindowDisplayed</key>
-			<false/>
-			<key>Identifier</key>
-			<string>windowTool.build</string>
-			<key>IsVertical</key>
-			<true/>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CD0528F0623707200166675</string>
-								<key>PBXProjectModuleLabel</key>
-								<string></string>
-								<key>StatusBarVisibility</key>
-								<true/>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {500, 218}}</string>
-								<key>RubberWindowFrame</key>
-								<string>2089 276 500 500 1920 0 1920 1200 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>218pt</string>
-						</dict>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>XCMainBuildResultsModuleGUID</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Build Results</string>
-								<key>XCBuildResultsTrigger_Collapse</key>
-								<integer>1021</integer>
-								<key>XCBuildResultsTrigger_Open</key>
-								<integer>1011</integer>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 223}, {500, 236}}</string>
-								<key>RubberWindowFrame</key>
-								<string>2089 276 500 500 1920 0 1920 1200 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXBuildResultsModule</string>
-							<key>Proportion</key>
-							<string>236pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>459pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Build Results</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXBuildResultsModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<true/>
-			<key>TableOfContents</key>
-			<array>
-				<string>619599851364E41A00B429B6</string>
-				<string>619599861364E41A00B429B6</string>
-				<string>1CD0528F0623707200166675</string>
-				<string>XCMainBuildResultsModuleGUID</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.buildV3</string>
-			<key>WindowContentMinSize</key>
-			<string>486 300</string>
-			<key>WindowString</key>
-			<string>2089 276 500 500 1920 0 1920 1200 </string>
-			<key>WindowToolGUID</key>
-			<string>619599851364E41A00B429B6</string>
-			<key>WindowToolIsVisible</key>
-			<false/>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.debugger</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>Debugger</key>
-								<dict>
-									<key>HorizontalSplitView</key>
-									<dict>
-										<key>_collapsingFrameDimension</key>
-										<real>0.0</real>
-										<key>_indexOfCollapsedView</key>
-										<integer>0</integer>
-										<key>_percentageOfCollapsedView</key>
-										<real>0.0</real>
-										<key>isCollapsed</key>
-										<string>yes</string>
-										<key>sizes</key>
-										<array>
-											<string>{{0, 0}, {317, 164}}</string>
-											<string>{{317, 0}, {377, 164}}</string>
-										</array>
-									</dict>
-									<key>VerticalSplitView</key>
-									<dict>
-										<key>_collapsingFrameDimension</key>
-										<real>0.0</real>
-										<key>_indexOfCollapsedView</key>
-										<integer>0</integer>
-										<key>_percentageOfCollapsedView</key>
-										<real>0.0</real>
-										<key>isCollapsed</key>
-										<string>yes</string>
-										<key>sizes</key>
-										<array>
-											<string>{{0, 0}, {694, 164}}</string>
-											<string>{{0, 164}, {694, 216}}</string>
-										</array>
-									</dict>
-								</dict>
-								<key>LauncherConfigVersion</key>
-								<string>8</string>
-								<key>PBXProjectModuleGUID</key>
-								<string>1C162984064C10D400B95A72</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Debug - GLUTExamples (Underwater)</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>DebugConsoleDrawerSize</key>
-								<string>{100, 120}</string>
-								<key>DebugConsoleVisible</key>
-								<string>None</string>
-								<key>DebugConsoleWindowFrame</key>
-								<string>{{200, 200}, {500, 300}}</string>
-								<key>DebugSTDIOWindowFrame</key>
-								<string>{{200, 200}, {500, 300}}</string>
-								<key>Frame</key>
-								<string>{{0, 0}, {694, 380}}</string>
-								<key>RubberWindowFrame</key>
-								<string>321 238 694 422 0 0 1440 878 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXDebugSessionModule</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Debugger</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXDebugSessionModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1CD10A99069EF8BA00B06720</string>
-				<string>1C0AD2AB069F1E9B00FABCE6</string>
-				<string>1C162984064C10D400B95A72</string>
-				<string>1C0AD2AC069F1E9B00FABCE6</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.debugV3</string>
-			<key>WindowString</key>
-			<string>321 238 694 422 0 0 1440 878 </string>
-			<key>WindowToolGUID</key>
-			<string>1CD10A99069EF8BA00B06720</string>
-			<key>WindowToolIsVisible</key>
-			<integer>0</integer>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.find</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>Dock</key>
-							<array>
-								<dict>
-									<key>ContentConfiguration</key>
-									<dict>
-										<key>PBXProjectModuleGUID</key>
-										<string>1CDD528C0622207200134675</string>
-										<key>PBXProjectModuleLabel</key>
-										<string><No Editor></string>
-										<key>PBXSplitModuleInNavigatorKey</key>
-										<dict>
-											<key>Split0</key>
-											<dict>
-												<key>PBXProjectModuleGUID</key>
-												<string>1CD0528D0623707200166675</string>
-											</dict>
-											<key>SplitCount</key>
-											<string>1</string>
-										</dict>
-										<key>StatusBarVisibility</key>
-										<integer>1</integer>
-									</dict>
-									<key>GeometryConfiguration</key>
-									<dict>
-										<key>Frame</key>
-										<string>{{0, 0}, {781, 167}}</string>
-										<key>RubberWindowFrame</key>
-										<string>62 385 781 470 0 0 1440 878 </string>
-									</dict>
-									<key>Module</key>
-									<string>PBXNavigatorGroup</string>
-									<key>Proportion</key>
-									<string>781pt</string>
-								</dict>
-							</array>
-							<key>Proportion</key>
-							<string>50%</string>
-						</dict>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CD0528E0623707200166675</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Project Find</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{8, 0}, {773, 254}}</string>
-								<key>RubberWindowFrame</key>
-								<string>62 385 781 470 0 0 1440 878 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXProjectFindModule</string>
-							<key>Proportion</key>
-							<string>50%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>428pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Project Find</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXProjectFindModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1C530D57069F1CE1000CFCEE</string>
-				<string>1C530D58069F1CE1000CFCEE</string>
-				<string>1C530D59069F1CE1000CFCEE</string>
-				<string>1CDD528C0622207200134675</string>
-				<string>1C530D5A069F1CE1000CFCEE</string>
-				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>1CD0528E0623707200166675</string>
-			</array>
-			<key>WindowString</key>
-			<string>62 385 781 470 0 0 1440 878 </string>
-			<key>WindowToolGUID</key>
-			<string>1C530D57069F1CE1000CFCEE</string>
-			<key>WindowToolIsVisible</key>
-			<integer>0</integer>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>MENUSEPARATOR</string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.debuggerConsole</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1C78EAAC065D492600B07095</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Debugger Console</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {650, 250}}</string>
-								<key>RubberWindowFrame</key>
-								<string>516 632 650 250 0 0 1680 1027 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXDebugCLIModule</string>
-							<key>Proportion</key>
-							<string>209pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>209pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Debugger Console</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXDebugCLIModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1C78EAAD065D492600B07095</string>
-				<string>1C78EAAE065D492600B07095</string>
-				<string>1C78EAAC065D492600B07095</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.consoleV3</string>
-			<key>WindowString</key>
-			<string>650 41 650 250 0 0 1280 1002 </string>
-			<key>WindowToolGUID</key>
-			<string>1C78EAAD065D492600B07095</string>
-			<key>WindowToolIsVisible</key>
-			<integer>0</integer>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.snapshots</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>Module</key>
-							<string>XCSnapshotModule</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Snapshots</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>XCSnapshotModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<string>Yes</string>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.snapshots</string>
-			<key>WindowString</key>
-			<string>315 824 300 550 0 0 1440 878 </string>
-			<key>WindowToolIsVisible</key>
-			<string>Yes</string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.scm</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1C78EAB2065D492600B07095</string>
-								<key>PBXProjectModuleLabel</key>
-								<string><No Editor></string>
-								<key>PBXSplitModuleInNavigatorKey</key>
-								<dict>
-									<key>Split0</key>
-									<dict>
-										<key>PBXProjectModuleGUID</key>
-										<string>1C78EAB3065D492600B07095</string>
-									</dict>
-									<key>SplitCount</key>
-									<string>1</string>
-								</dict>
-								<key>StatusBarVisibility</key>
-								<integer>1</integer>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {452, 0}}</string>
-								<key>RubberWindowFrame</key>
-								<string>743 379 452 308 0 0 1280 1002 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>0pt</string>
-						</dict>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CD052920623707200166675</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>SCM</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>ConsoleFrame</key>
-								<string>{{0, 259}, {452, 0}}</string>
-								<key>Frame</key>
-								<string>{{0, 7}, {452, 259}}</string>
-								<key>RubberWindowFrame</key>
-								<string>743 379 452 308 0 0 1280 1002 </string>
-								<key>TableConfiguration</key>
-								<array>
-									<string>Status</string>
-									<real>30</real>
-									<string>FileName</string>
-									<real>199</real>
-									<string>Path</string>
-									<real>197.0950012207031</real>
-								</array>
-								<key>TableFrame</key>
-								<string>{{0, 0}, {452, 250}}</string>
-							</dict>
-							<key>Module</key>
-							<string>PBXCVSModule</string>
-							<key>Proportion</key>
-							<string>262pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>266pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>SCM</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXCVSModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1C78EAB4065D492600B07095</string>
-				<string>1C78EAB5065D492600B07095</string>
-				<string>1C78EAB2065D492600B07095</string>
-				<string>1CD052920623707200166675</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.scm</string>
-			<key>WindowString</key>
-			<string>743 379 452 308 0 0 1280 1002 </string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.breakpoints</string>
-			<key>IsVertical</key>
-			<integer>0</integer>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXBottomSmartGroupGIDs</key>
-								<array>
-									<string>1C77FABC04509CD000000102</string>
-								</array>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CE0B1FE06471DED0097A5F4</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Files</string>
-								<key>PBXProjectStructureProvided</key>
-								<string>no</string>
-								<key>PBXSmartGroupTreeModuleColumnData</key>
-								<dict>
-									<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
-									<array>
-										<real>168</real>
-									</array>
-									<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
-									<array>
-										<string>MainColumn</string>
-									</array>
-								</dict>
-								<key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
-								<dict>
-									<key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
-									<array>
-										<string>1C77FABC04509CD000000102</string>
-									</array>
-									<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
-									<array>
-										<array>
-											<integer>0</integer>
-										</array>
-									</array>
-									<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-									<string>{{0, 0}, {168, 350}}</string>
-								</dict>
-								<key>PBXTopSmartGroupGIDs</key>
-								<array/>
-								<key>XCIncludePerspectivesSwitch</key>
-								<integer>0</integer>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{0, 0}, {185, 368}}</string>
-								<key>GroupTreeTableConfiguration</key>
-								<array>
-									<string>MainColumn</string>
-									<real>168</real>
-								</array>
-								<key>RubberWindowFrame</key>
-								<string>315 424 744 409 0 0 1440 878 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXSmartGroupTreeModule</string>
-							<key>Proportion</key>
-							<string>185pt</string>
-						</dict>
-						<dict>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CA1AED706398EBD00589147</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Detail</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{{190, 0}, {554, 368}}</string>
-								<key>RubberWindowFrame</key>
-								<string>315 424 744 409 0 0 1440 878 </string>
-							</dict>
-							<key>Module</key>
-							<string>XCDetailModule</string>
-							<key>Proportion</key>
-							<string>554pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>368pt</string>
-				</dict>
-			</array>
-			<key>MajorVersion</key>
-			<integer>3</integer>
-			<key>MinorVersion</key>
-			<integer>0</integer>
-			<key>Name</key>
-			<string>Breakpoints</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXSmartGroupTreeModule</string>
-				<string>XCDetailModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1CDDB66807F98D9800BB5817</string>
-				<string>1CDDB66907F98D9800BB5817</string>
-				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>1CA1AED706398EBD00589147</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.breakpointsV3</string>
-			<key>WindowString</key>
-			<string>315 424 744 409 0 0 1440 878 </string>
-			<key>WindowToolGUID</key>
-			<string>1CDDB66807F98D9800BB5817</string>
-			<key>WindowToolIsVisible</key>
-			<integer>1</integer>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.debugAnimator</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>Module</key>
-							<string>PBXNavigatorGroup</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Debug Visualizer</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXNavigatorGroup</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>1</integer>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.debugAnimatorV3</string>
-			<key>WindowString</key>
-			<string>100 100 700 500 0 0 1280 1002 </string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.bookmarks</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>Module</key>
-							<string>PBXBookmarksModule</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Bookmarks</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXBookmarksModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>0</integer>
-			<key>WindowString</key>
-			<string>538 42 401 187 0 0 1280 1002 </string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.projectFormatConflicts</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>Module</key>
-							<string>XCProjectFormatConflictsModule</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Project Format Conflicts</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>XCProjectFormatConflictsModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>0</integer>
-			<key>WindowContentMinSize</key>
-			<string>450 300</string>
-			<key>WindowString</key>
-			<string>50 850 472 307 0 0 1440 877</string>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.classBrowser</string>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>ContentConfiguration</key>
-							<dict>
-								<key>OptionsSetName</key>
-								<string>Hierarchy, all classes</string>
-								<key>PBXProjectModuleGUID</key>
-								<string>1CA6456E063B45B4001379D8</string>
-								<key>PBXProjectModuleLabel</key>
-								<string>Class Browser - NSObject</string>
-							</dict>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>ClassesFrame</key>
-								<string>{{0, 0}, {374, 96}}</string>
-								<key>ClassesTreeTableConfiguration</key>
-								<array>
-									<string>PBXClassNameColumnIdentifier</string>
-									<real>208</real>
-									<string>PBXClassBookColumnIdentifier</string>
-									<real>22</real>
-								</array>
-								<key>Frame</key>
-								<string>{{0, 0}, {630, 331}}</string>
-								<key>MembersFrame</key>
-								<string>{{0, 105}, {374, 395}}</string>
-								<key>MembersTreeTableConfiguration</key>
-								<array>
-									<string>PBXMemberTypeIconColumnIdentifier</string>
-									<real>22</real>
-									<string>PBXMemberNameColumnIdentifier</string>
-									<real>216</real>
-									<string>PBXMemberTypeColumnIdentifier</string>
-									<real>97</real>
-									<string>PBXMemberBookColumnIdentifier</string>
-									<real>22</real>
-								</array>
-								<key>PBXModuleWindowStatusBarHidden2</key>
-								<integer>1</integer>
-								<key>RubberWindowFrame</key>
-								<string>385 179 630 352 0 0 1440 878 </string>
-							</dict>
-							<key>Module</key>
-							<string>PBXClassBrowserModule</string>
-							<key>Proportion</key>
-							<string>332pt</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>332pt</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Class Browser</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>PBXClassBrowserModule</string>
-			</array>
-			<key>StatusbarIsVisible</key>
-			<integer>0</integer>
-			<key>TableOfContents</key>
-			<array>
-				<string>1C0AD2AF069F1E9B00FABCE6</string>
-				<string>1C0AD2B0069F1E9B00FABCE6</string>
-				<string>1CA6456E063B45B4001379D8</string>
-			</array>
-			<key>ToolbarConfiguration</key>
-			<string>xcode.toolbar.config.classbrowser</string>
-			<key>WindowString</key>
-			<string>385 179 630 352 0 0 1440 878 </string>
-			<key>WindowToolGUID</key>
-			<string>1C0AD2AF069F1E9B00FABCE6</string>
-			<key>WindowToolIsVisible</key>
-			<integer>0</integer>
-		</dict>
-		<dict>
-			<key>Identifier</key>
-			<string>windowTool.refactoring</string>
-			<key>IncludeInToolsMenu</key>
-			<integer>0</integer>
-			<key>Layout</key>
-			<array>
-				<dict>
-					<key>Dock</key>
-					<array>
-						<dict>
-							<key>BecomeActive</key>
-							<integer>1</integer>
-							<key>GeometryConfiguration</key>
-							<dict>
-								<key>Frame</key>
-								<string>{0, 0}, {500, 335}</string>
-								<key>RubberWindowFrame</key>
-								<string>{0, 0}, {500, 335}</string>
-							</dict>
-							<key>Module</key>
-							<string>XCRefactoringModule</string>
-							<key>Proportion</key>
-							<string>100%</string>
-						</dict>
-					</array>
-					<key>Proportion</key>
-					<string>100%</string>
-				</dict>
-			</array>
-			<key>Name</key>
-			<string>Refactoring</string>
-			<key>ServiceClasses</key>
-			<array>
-				<string>XCRefactoringModule</string>
-			</array>
-			<key>WindowString</key>
-			<string>200 200 500 356 0 0 1920 1200 </string>
-		</dict>
-	</array>
-</dict>
-</plist>
diff --git a/misc/liblua/Xcode/Lua.xcodeproj/default.pbxuser b/misc/liblua/Xcode/Lua.xcodeproj/default.pbxuser
deleted file mode 100644
index 722cef9..0000000
--- a/misc/liblua/Xcode/Lua.xcodeproj/default.pbxuser
+++ /dev/null
@@ -1,110 +0,0 @@
-// !$*UTF8*$!
-{
-	0867D690FE84028FC02AAC07 /* Project object */ = {
-		activeBuildConfigurationName = Release;
-		activeSDKPreference = iphoneos4.2;
-		activeTarget = D2AAC07D0554694100DB518D /* libLua */;
-		addToTargets = (
-			D2AAC07D0554694100DB518D /* libLua */,
-		);
-		codeSenseManager = 619598BC1364C73500B429B6 /* Code sense */;
-		perUserDictionary = {
-			PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
-				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-				PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-				PBXFileTableDataSourceColumnWidthsKey = (
-					20,
-					341,
-					20,
-					48,
-					43,
-					43,
-					20,
-				);
-				PBXFileTableDataSourceColumnsKey = (
-					PBXFileDataSource_FiletypeID,
-					PBXFileDataSource_Filename_ColumnID,
-					PBXFileDataSource_Built_ColumnID,
-					PBXFileDataSource_ObjectSize_ColumnID,
-					PBXFileDataSource_Errors_ColumnID,
-					PBXFileDataSource_Warnings_ColumnID,
-					PBXFileDataSource_Target_ColumnID,
-				);
-			};
-			PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
-				PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-				PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-				PBXFileTableDataSourceColumnWidthsKey = (
-					20,
-					301,
-					60,
-					20,
-					48.16259765625,
-					43,
-					43,
-				);
-				PBXFileTableDataSourceColumnsKey = (
-					PBXFileDataSource_FiletypeID,
-					PBXFileDataSource_Filename_ColumnID,
-					PBXTargetDataSource_PrimaryAttribute,
-					PBXFileDataSource_Built_ColumnID,
-					PBXFileDataSource_ObjectSize_ColumnID,
-					PBXFileDataSource_Errors_ColumnID,
-					PBXFileDataSource_Warnings_ColumnID,
-				);
-			};
-			PBXPerProjectTemplateStateSaveDate = 325371811;
-			PBXWorkspaceStateSaveDate = 325371811;
-		};
-		perUserProjectItems = {
-			619599331364C7D300B429B6 /* XCBuildMessageTextBookmark */ = 619599331364C7D300B429B6 /* XCBuildMessageTextBookmark */;
-			6195995E1364C95D00B429B6 /* PBXTextBookmark */ = 6195995E1364C95D00B429B6 /* PBXTextBookmark */;
-		};
-		sourceControlManager = 619598BB1364C73500B429B6 /* Source Control */;
-		userBuildSettings = {
-		};
-	};
-	619598BB1364C73500B429B6 /* Source Control */ = {
-		isa = PBXSourceControlManager;
-		fallbackIsa = XCSourceControlManager;
-		isSCMEnabled = 0;
-		scmConfiguration = {
-			repositoryNamesForRoots = {
-				"" = "";
-			};
-		};
-	};
-	619598BC1364C73500B429B6 /* Code sense */ = {
-		isa = PBXCodeSenseManager;
-		indexTemplatePath = "";
-	};
-	619598F61364C7BD00B429B6 /* lvm.c */ = {
-		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {439, 11745}}";
-			sepNavSelRange = "{0, 0}";
-			sepNavVisRange = "{0, 214}";
-		};
-	};
-	619599331364C7D300B429B6 /* XCBuildMessageTextBookmark */ = {
-		isa = PBXTextBookmark;
-		comments = "Compile /Users/vittorio/hedgewars/trunk/misc/liblua/Xcode/../lvm.c";
-		fRef = 619598F61364C7BD00B429B6 /* lvm.c */;
-		fallbackIsa = XCBuildMessageTextBookmark;
-		rLen = 0;
-		rLoc = 0;
-		rType = 1;
-	};
-	6195995E1364C95D00B429B6 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 619598F61364C7BD00B429B6 /* lvm.c */;
-		name = "lvm.c: 1";
-		rLen = 0;
-		rLoc = 0;
-		rType = 0;
-		vrLen = 233;
-		vrLoc = 0;
-	};
-	D2AAC07D0554694100DB518D /* libLua */ = {
-		activeExec = 0;
-	};
-}
diff --git a/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj b/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj
deleted file mode 100644
index 089ed41..0000000
--- a/misc/liblua/Xcode/Lua.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,445 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 45;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		619598FB1364C7BD00B429B6 /* lapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598C61364C7BD00B429B6 /* lapi.c */; };
-		619598FC1364C7BD00B429B6 /* lapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598C71364C7BD00B429B6 /* lapi.h */; };
-		619598FD1364C7BD00B429B6 /* lauxlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598C81364C7BD00B429B6 /* lauxlib.c */; };
-		619598FE1364C7BD00B429B6 /* lauxlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598C91364C7BD00B429B6 /* lauxlib.h */; };
-		619598FF1364C7BD00B429B6 /* lbaselib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598CA1364C7BD00B429B6 /* lbaselib.c */; };
-		619599001364C7BD00B429B6 /* lcode.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598CB1364C7BD00B429B6 /* lcode.c */; };
-		619599011364C7BD00B429B6 /* lcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598CC1364C7BD00B429B6 /* lcode.h */; };
-		619599021364C7BD00B429B6 /* ldblib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598CD1364C7BD00B429B6 /* ldblib.c */; };
-		619599031364C7BD00B429B6 /* ldebug.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598CE1364C7BD00B429B6 /* ldebug.c */; };
-		619599041364C7BD00B429B6 /* ldebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598CF1364C7BD00B429B6 /* ldebug.h */; };
-		619599051364C7BD00B429B6 /* ldo.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D01364C7BD00B429B6 /* ldo.c */; };
-		619599061364C7BD00B429B6 /* ldo.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598D11364C7BD00B429B6 /* ldo.h */; };
-		619599071364C7BD00B429B6 /* ldump.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D21364C7BD00B429B6 /* ldump.c */; };
-		619599081364C7BD00B429B6 /* lfunc.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D31364C7BD00B429B6 /* lfunc.c */; };
-		619599091364C7BD00B429B6 /* lfunc.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598D41364C7BD00B429B6 /* lfunc.h */; };
-		6195990A1364C7BD00B429B6 /* lgc.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D51364C7BD00B429B6 /* lgc.c */; };
-		6195990B1364C7BD00B429B6 /* lgc.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598D61364C7BD00B429B6 /* lgc.h */; };
-		6195990C1364C7BD00B429B6 /* linit.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D71364C7BD00B429B6 /* linit.c */; };
-		6195990D1364C7BD00B429B6 /* liolib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D81364C7BD00B429B6 /* liolib.c */; };
-		6195990E1364C7BD00B429B6 /* llex.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598D91364C7BD00B429B6 /* llex.c */; };
-		6195990F1364C7BD00B429B6 /* llex.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598DA1364C7BD00B429B6 /* llex.h */; };
-		619599101364C7BD00B429B6 /* llimits.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598DB1364C7BD00B429B6 /* llimits.h */; };
-		619599111364C7BD00B429B6 /* lmathlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598DC1364C7BD00B429B6 /* lmathlib.c */; };
-		619599121364C7BD00B429B6 /* lmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598DD1364C7BD00B429B6 /* lmem.c */; };
-		619599131364C7BD00B429B6 /* lmem.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598DE1364C7BD00B429B6 /* lmem.h */; };
-		619599141364C7BD00B429B6 /* loadlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598DF1364C7BD00B429B6 /* loadlib.c */; };
-		619599151364C7BD00B429B6 /* lobject.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E01364C7BD00B429B6 /* lobject.c */; };
-		619599161364C7BD00B429B6 /* lobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598E11364C7BD00B429B6 /* lobject.h */; };
-		619599171364C7BD00B429B6 /* lopcodes.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E21364C7BD00B429B6 /* lopcodes.c */; };
-		619599181364C7BD00B429B6 /* lopcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598E31364C7BD00B429B6 /* lopcodes.h */; };
-		619599191364C7BD00B429B6 /* loslib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E41364C7BD00B429B6 /* loslib.c */; };
-		6195991A1364C7BD00B429B6 /* lparser.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E51364C7BD00B429B6 /* lparser.c */; };
-		6195991B1364C7BD00B429B6 /* lparser.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598E61364C7BD00B429B6 /* lparser.h */; };
-		6195991C1364C7BD00B429B6 /* lstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E71364C7BD00B429B6 /* lstate.c */; };
-		6195991D1364C7BD00B429B6 /* lstate.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598E81364C7BD00B429B6 /* lstate.h */; };
-		6195991E1364C7BD00B429B6 /* lstring.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598E91364C7BD00B429B6 /* lstring.c */; };
-		6195991F1364C7BD00B429B6 /* lstring.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598EA1364C7BD00B429B6 /* lstring.h */; };
-		619599201364C7BD00B429B6 /* lstrlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598EB1364C7BD00B429B6 /* lstrlib.c */; };
-		619599211364C7BD00B429B6 /* ltable.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598EC1364C7BD00B429B6 /* ltable.c */; };
-		619599221364C7BD00B429B6 /* ltable.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598ED1364C7BD00B429B6 /* ltable.h */; };
-		619599231364C7BD00B429B6 /* ltablib.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598EE1364C7BD00B429B6 /* ltablib.c */; };
-		619599241364C7BD00B429B6 /* ltm.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598EF1364C7BD00B429B6 /* ltm.c */; };
-		619599251364C7BD00B429B6 /* ltm.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F01364C7BD00B429B6 /* ltm.h */; };
-		619599261364C7BD00B429B6 /* lua.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F11364C7BD00B429B6 /* lua.h */; };
-		619599271364C7BD00B429B6 /* luaconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F21364C7BD00B429B6 /* luaconf.h */; };
-		619599281364C7BD00B429B6 /* lualib.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F31364C7BD00B429B6 /* lualib.h */; };
-		619599291364C7BD00B429B6 /* lundump.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598F41364C7BD00B429B6 /* lundump.c */; };
-		6195992A1364C7BD00B429B6 /* lundump.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F51364C7BD00B429B6 /* lundump.h */; };
-		6195992B1364C7BD00B429B6 /* lvm.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598F61364C7BD00B429B6 /* lvm.c */; };
-		6195992C1364C7BD00B429B6 /* lvm.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F71364C7BD00B429B6 /* lvm.h */; };
-		6195992D1364C7BD00B429B6 /* lzio.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598F81364C7BD00B429B6 /* lzio.c */; };
-		6195992E1364C7BD00B429B6 /* lzio.h in Headers */ = {isa = PBXBuildFile; fileRef = 619598F91364C7BD00B429B6 /* lzio.h */; };
-		6195992F1364C7BD00B429B6 /* print.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598FA1364C7BD00B429B6 /* print.c */; };
-		AA747D9F0F9514B9006C5449 /* Lua_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Lua_Prefix.pch */; };
-		AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
-		619598C61364C7BD00B429B6 /* lapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lapi.c; path = ../lapi.c; sourceTree = SOURCE_ROOT; };
-		619598C71364C7BD00B429B6 /* lapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lapi.h; path = ../lapi.h; sourceTree = SOURCE_ROOT; };
-		619598C81364C7BD00B429B6 /* lauxlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lauxlib.c; path = ../lauxlib.c; sourceTree = SOURCE_ROOT; };
-		619598C91364C7BD00B429B6 /* lauxlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lauxlib.h; path = ../lauxlib.h; sourceTree = SOURCE_ROOT; };
-		619598CA1364C7BD00B429B6 /* lbaselib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lbaselib.c; path = ../lbaselib.c; sourceTree = SOURCE_ROOT; };
-		619598CB1364C7BD00B429B6 /* lcode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lcode.c; path = ../lcode.c; sourceTree = SOURCE_ROOT; };
-		619598CC1364C7BD00B429B6 /* lcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lcode.h; path = ../lcode.h; sourceTree = SOURCE_ROOT; };
-		619598CD1364C7BD00B429B6 /* ldblib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldblib.c; path = ../ldblib.c; sourceTree = SOURCE_ROOT; };
-		619598CE1364C7BD00B429B6 /* ldebug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldebug.c; path = ../ldebug.c; sourceTree = SOURCE_ROOT; };
-		619598CF1364C7BD00B429B6 /* ldebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ldebug.h; path = ../ldebug.h; sourceTree = SOURCE_ROOT; };
-		619598D01364C7BD00B429B6 /* ldo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldo.c; path = ../ldo.c; sourceTree = SOURCE_ROOT; };
-		619598D11364C7BD00B429B6 /* ldo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ldo.h; path = ../ldo.h; sourceTree = SOURCE_ROOT; };
-		619598D21364C7BD00B429B6 /* ldump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ldump.c; path = ../ldump.c; sourceTree = SOURCE_ROOT; };
-		619598D31364C7BD00B429B6 /* lfunc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lfunc.c; path = ../lfunc.c; sourceTree = SOURCE_ROOT; };
-		619598D41364C7BD00B429B6 /* lfunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lfunc.h; path = ../lfunc.h; sourceTree = SOURCE_ROOT; };
-		619598D51364C7BD00B429B6 /* lgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lgc.c; path = ../lgc.c; sourceTree = SOURCE_ROOT; };
-		619598D61364C7BD00B429B6 /* lgc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lgc.h; path = ../lgc.h; sourceTree = SOURCE_ROOT; };
-		619598D71364C7BD00B429B6 /* linit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = linit.c; path = ../linit.c; sourceTree = SOURCE_ROOT; };
-		619598D81364C7BD00B429B6 /* liolib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = liolib.c; path = ../liolib.c; sourceTree = SOURCE_ROOT; };
-		619598D91364C7BD00B429B6 /* llex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = llex.c; path = ../llex.c; sourceTree = SOURCE_ROOT; };
-		619598DA1364C7BD00B429B6 /* llex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = llex.h; path = ../llex.h; sourceTree = SOURCE_ROOT; };
-		619598DB1364C7BD00B429B6 /* llimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = llimits.h; path = ../llimits.h; sourceTree = SOURCE_ROOT; };
-		619598DC1364C7BD00B429B6 /* lmathlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lmathlib.c; path = ../lmathlib.c; sourceTree = SOURCE_ROOT; };
-		619598DD1364C7BD00B429B6 /* lmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lmem.c; path = ../lmem.c; sourceTree = SOURCE_ROOT; };
-		619598DE1364C7BD00B429B6 /* lmem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lmem.h; path = ../lmem.h; sourceTree = SOURCE_ROOT; };
-		619598DF1364C7BD00B429B6 /* loadlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loadlib.c; path = ../loadlib.c; sourceTree = SOURCE_ROOT; };
-		619598E01364C7BD00B429B6 /* lobject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lobject.c; path = ../lobject.c; sourceTree = SOURCE_ROOT; };
-		619598E11364C7BD00B429B6 /* lobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lobject.h; path = ../lobject.h; sourceTree = SOURCE_ROOT; };
-		619598E21364C7BD00B429B6 /* lopcodes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lopcodes.c; path = ../lopcodes.c; sourceTree = SOURCE_ROOT; };
-		619598E31364C7BD00B429B6 /* lopcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lopcodes.h; path = ../lopcodes.h; sourceTree = SOURCE_ROOT; };
-		619598E41364C7BD00B429B6 /* loslib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loslib.c; path = ../loslib.c; sourceTree = SOURCE_ROOT; };
-		619598E51364C7BD00B429B6 /* lparser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lparser.c; path = ../lparser.c; sourceTree = SOURCE_ROOT; };
-		619598E61364C7BD00B429B6 /* lparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lparser.h; path = ../lparser.h; sourceTree = SOURCE_ROOT; };
-		619598E71364C7BD00B429B6 /* lstate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstate.c; path = ../lstate.c; sourceTree = SOURCE_ROOT; };
-		619598E81364C7BD00B429B6 /* lstate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstate.h; path = ../lstate.h; sourceTree = SOURCE_ROOT; };
-		619598E91364C7BD00B429B6 /* lstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstring.c; path = ../lstring.c; sourceTree = SOURCE_ROOT; };
-		619598EA1364C7BD00B429B6 /* lstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstring.h; path = ../lstring.h; sourceTree = SOURCE_ROOT; };
-		619598EB1364C7BD00B429B6 /* lstrlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lstrlib.c; path = ../lstrlib.c; sourceTree = SOURCE_ROOT; };
-		619598EC1364C7BD00B429B6 /* ltable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltable.c; path = ../ltable.c; sourceTree = SOURCE_ROOT; };
-		619598ED1364C7BD00B429B6 /* ltable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ltable.h; path = ../ltable.h; sourceTree = SOURCE_ROOT; };
-		619598EE1364C7BD00B429B6 /* ltablib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltablib.c; path = ../ltablib.c; sourceTree = SOURCE_ROOT; };
-		619598EF1364C7BD00B429B6 /* ltm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ltm.c; path = ../ltm.c; sourceTree = SOURCE_ROOT; };
-		619598F01364C7BD00B429B6 /* ltm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ltm.h; path = ../ltm.h; sourceTree = SOURCE_ROOT; };
-		619598F11364C7BD00B429B6 /* lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lua.h; path = ../lua.h; sourceTree = SOURCE_ROOT; };
-		619598F21364C7BD00B429B6 /* luaconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = luaconf.h; path = ../luaconf.h; sourceTree = SOURCE_ROOT; };
-		619598F31364C7BD00B429B6 /* lualib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lualib.h; path = ../lualib.h; sourceTree = SOURCE_ROOT; };
-		619598F41364C7BD00B429B6 /* lundump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lundump.c; path = ../lundump.c; sourceTree = SOURCE_ROOT; };
-		619598F51364C7BD00B429B6 /* lundump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lundump.h; path = ../lundump.h; sourceTree = SOURCE_ROOT; };
-		619598F61364C7BD00B429B6 /* lvm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lvm.c; path = ../lvm.c; sourceTree = SOURCE_ROOT; };
-		619598F71364C7BD00B429B6 /* lvm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lvm.h; path = ../lvm.h; sourceTree = SOURCE_ROOT; };
-		619598F81364C7BD00B429B6 /* lzio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lzio.c; path = ../lzio.c; sourceTree = SOURCE_ROOT; };
-		619598F91364C7BD00B429B6 /* lzio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lzio.h; path = ../lzio.h; sourceTree = SOURCE_ROOT; };
-		619598FA1364C7BD00B429B6 /* print.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = print.c; path = ../print.c; sourceTree = SOURCE_ROOT; };
-		AA747D9E0F9514B9006C5449 /* Lua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lua_Prefix.pch; sourceTree = SOURCE_ROOT; };
-		AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		D2AAC07E0554694100DB518D /* libLua.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLua.a; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		D2AAC07C0554694100DB518D /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		034768DFFF38A50411DB9C8B /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				D2AAC07E0554694100DB518D /* libLua.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		0867D691FE84028FC02AAC07 /* Lua */ = {
-			isa = PBXGroup;
-			children = (
-				08FB77AEFE84172EC02AAC07 /* Sources */,
-				32C88DFF0371C24200C91783 /* Other Sources */,
-				0867D69AFE84028FC02AAC07 /* Frameworks */,
-				034768DFFF38A50411DB9C8B /* Products */,
-			);
-			name = Lua;
-			sourceTree = "<group>";
-		};
-		0867D69AFE84028FC02AAC07 /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				AACBBE490F95108600F1A2B1 /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		08FB77AEFE84172EC02AAC07 /* Sources */ = {
-			isa = PBXGroup;
-			children = (
-				619598C61364C7BD00B429B6 /* lapi.c */,
-				619598C71364C7BD00B429B6 /* lapi.h */,
-				619598C81364C7BD00B429B6 /* lauxlib.c */,
-				619598C91364C7BD00B429B6 /* lauxlib.h */,
-				619598CA1364C7BD00B429B6 /* lbaselib.c */,
-				619598CB1364C7BD00B429B6 /* lcode.c */,
-				619598CC1364C7BD00B429B6 /* lcode.h */,
-				619598CD1364C7BD00B429B6 /* ldblib.c */,
-				619598CE1364C7BD00B429B6 /* ldebug.c */,
-				619598CF1364C7BD00B429B6 /* ldebug.h */,
-				619598D01364C7BD00B429B6 /* ldo.c */,
-				619598D11364C7BD00B429B6 /* ldo.h */,
-				619598D21364C7BD00B429B6 /* ldump.c */,
-				619598D31364C7BD00B429B6 /* lfunc.c */,
-				619598D41364C7BD00B429B6 /* lfunc.h */,
-				619598D51364C7BD00B429B6 /* lgc.c */,
-				619598D61364C7BD00B429B6 /* lgc.h */,
-				619598D71364C7BD00B429B6 /* linit.c */,
-				619598D81364C7BD00B429B6 /* liolib.c */,
-				619598D91364C7BD00B429B6 /* llex.c */,
-				619598DA1364C7BD00B429B6 /* llex.h */,
-				619598DB1364C7BD00B429B6 /* llimits.h */,
-				619598DC1364C7BD00B429B6 /* lmathlib.c */,
-				619598DD1364C7BD00B429B6 /* lmem.c */,
-				619598DE1364C7BD00B429B6 /* lmem.h */,
-				619598DF1364C7BD00B429B6 /* loadlib.c */,
-				619598E01364C7BD00B429B6 /* lobject.c */,
-				619598E11364C7BD00B429B6 /* lobject.h */,
-				619598E21364C7BD00B429B6 /* lopcodes.c */,
-				619598E31364C7BD00B429B6 /* lopcodes.h */,
-				619598E41364C7BD00B429B6 /* loslib.c */,
-				619598E51364C7BD00B429B6 /* lparser.c */,
-				619598E61364C7BD00B429B6 /* lparser.h */,
-				619598E71364C7BD00B429B6 /* lstate.c */,
-				619598E81364C7BD00B429B6 /* lstate.h */,
-				619598E91364C7BD00B429B6 /* lstring.c */,
-				619598EA1364C7BD00B429B6 /* lstring.h */,
-				619598EB1364C7BD00B429B6 /* lstrlib.c */,
-				619598EC1364C7BD00B429B6 /* ltable.c */,
-				619598ED1364C7BD00B429B6 /* ltable.h */,
-				619598EE1364C7BD00B429B6 /* ltablib.c */,
-				619598EF1364C7BD00B429B6 /* ltm.c */,
-				619598F01364C7BD00B429B6 /* ltm.h */,
-				619598F11364C7BD00B429B6 /* lua.h */,
-				619598F21364C7BD00B429B6 /* luaconf.h */,
-				619598F31364C7BD00B429B6 /* lualib.h */,
-				619598F41364C7BD00B429B6 /* lundump.c */,
-				619598F51364C7BD00B429B6 /* lundump.h */,
-				619598F61364C7BD00B429B6 /* lvm.c */,
-				619598F71364C7BD00B429B6 /* lvm.h */,
-				619598F81364C7BD00B429B6 /* lzio.c */,
-				619598F91364C7BD00B429B6 /* lzio.h */,
-				619598FA1364C7BD00B429B6 /* print.c */,
-			);
-			name = Sources;
-			sourceTree = "<group>";
-		};
-		32C88DFF0371C24200C91783 /* Other Sources */ = {
-			isa = PBXGroup;
-			children = (
-				AA747D9E0F9514B9006C5449 /* Lua_Prefix.pch */,
-			);
-			name = "Other Sources";
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
-		D2AAC07A0554694100DB518D /* Headers */ = {
-			isa = PBXHeadersBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				AA747D9F0F9514B9006C5449 /* Lua_Prefix.pch in Headers */,
-				619598FC1364C7BD00B429B6 /* lapi.h in Headers */,
-				619598FE1364C7BD00B429B6 /* lauxlib.h in Headers */,
-				619599011364C7BD00B429B6 /* lcode.h in Headers */,
-				619599041364C7BD00B429B6 /* ldebug.h in Headers */,
-				619599061364C7BD00B429B6 /* ldo.h in Headers */,
-				619599091364C7BD00B429B6 /* lfunc.h in Headers */,
-				6195990B1364C7BD00B429B6 /* lgc.h in Headers */,
-				6195990F1364C7BD00B429B6 /* llex.h in Headers */,
-				619599101364C7BD00B429B6 /* llimits.h in Headers */,
-				619599131364C7BD00B429B6 /* lmem.h in Headers */,
-				619599161364C7BD00B429B6 /* lobject.h in Headers */,
-				619599181364C7BD00B429B6 /* lopcodes.h in Headers */,
-				6195991B1364C7BD00B429B6 /* lparser.h in Headers */,
-				6195991D1364C7BD00B429B6 /* lstate.h in Headers */,
-				6195991F1364C7BD00B429B6 /* lstring.h in Headers */,
-				619599221364C7BD00B429B6 /* ltable.h in Headers */,
-				619599251364C7BD00B429B6 /* ltm.h in Headers */,
-				619599261364C7BD00B429B6 /* lua.h in Headers */,
-				619599271364C7BD00B429B6 /* luaconf.h in Headers */,
-				619599281364C7BD00B429B6 /* lualib.h in Headers */,
-				6195992A1364C7BD00B429B6 /* lundump.h in Headers */,
-				6195992C1364C7BD00B429B6 /* lvm.h in Headers */,
-				6195992E1364C7BD00B429B6 /* lzio.h in Headers */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
-		D2AAC07D0554694100DB518D /* libLua */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "libLua" */;
-			buildPhases = (
-				D2AAC07A0554694100DB518D /* Headers */,
-				D2AAC07B0554694100DB518D /* Sources */,
-				D2AAC07C0554694100DB518D /* Frameworks */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = libLua;
-			productName = Lua;
-			productReference = D2AAC07E0554694100DB518D /* libLua.a */;
-			productType = "com.apple.product-type.library.static";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		0867D690FE84028FC02AAC07 /* Project object */ = {
-			isa = PBXProject;
-			buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Lua" */;
-			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
-			hasScannedForEncodings = 1;
-			knownRegions = (
-				English,
-				Japanese,
-				French,
-				German,
-			);
-			mainGroup = 0867D691FE84028FC02AAC07 /* Lua */;
-			productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				D2AAC07D0554694100DB518D /* libLua */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-		D2AAC07B0554694100DB518D /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				619598FB1364C7BD00B429B6 /* lapi.c in Sources */,
-				619598FD1364C7BD00B429B6 /* lauxlib.c in Sources */,
-				619598FF1364C7BD00B429B6 /* lbaselib.c in Sources */,
-				619599001364C7BD00B429B6 /* lcode.c in Sources */,
-				619599021364C7BD00B429B6 /* ldblib.c in Sources */,
-				619599031364C7BD00B429B6 /* ldebug.c in Sources */,
-				619599051364C7BD00B429B6 /* ldo.c in Sources */,
-				619599071364C7BD00B429B6 /* ldump.c in Sources */,
-				619599081364C7BD00B429B6 /* lfunc.c in Sources */,
-				6195990A1364C7BD00B429B6 /* lgc.c in Sources */,
-				6195990C1364C7BD00B429B6 /* linit.c in Sources */,
-				6195990D1364C7BD00B429B6 /* liolib.c in Sources */,
-				6195990E1364C7BD00B429B6 /* llex.c in Sources */,
-				619599111364C7BD00B429B6 /* lmathlib.c in Sources */,
-				619599121364C7BD00B429B6 /* lmem.c in Sources */,
-				619599141364C7BD00B429B6 /* loadlib.c in Sources */,
-				619599151364C7BD00B429B6 /* lobject.c in Sources */,
-				619599171364C7BD00B429B6 /* lopcodes.c in Sources */,
-				619599191364C7BD00B429B6 /* loslib.c in Sources */,
-				6195991A1364C7BD00B429B6 /* lparser.c in Sources */,
-				6195991C1364C7BD00B429B6 /* lstate.c in Sources */,
-				6195991E1364C7BD00B429B6 /* lstring.c in Sources */,
-				619599201364C7BD00B429B6 /* lstrlib.c in Sources */,
-				619599211364C7BD00B429B6 /* ltable.c in Sources */,
-				619599231364C7BD00B429B6 /* ltablib.c in Sources */,
-				619599241364C7BD00B429B6 /* ltm.c in Sources */,
-				619599291364C7BD00B429B6 /* lundump.c in Sources */,
-				6195992B1364C7BD00B429B6 /* lvm.c in Sources */,
-				6195992D1364C7BD00B429B6 /* lzio.c in Sources */,
-				6195992F1364C7BD00B429B6 /* print.c in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		1DEB921F08733DC00010E9CD /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				COPY_PHASE_STRIP = NO;
-				DSTROOT = /tmp/Lua.dst;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_MODEL_TUNING = G5;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = Lua_Prefix.pch;
-				INSTALL_PATH = /usr/local/lib;
-				PRODUCT_NAME = Lua;
-			};
-			name = Debug;
-		};
-		1DEB922008733DC00010E9CD /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				DSTROOT = /tmp/Lua.dst;
-				GCC_MODEL_TUNING = G5;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = Lua_Prefix.pch;
-				INSTALL_PATH = /usr/local/lib;
-				PRODUCT_NAME = Lua;
-			};
-			name = Release;
-		};
-		1DEB922308733DC00010E9CD /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_THUMB_SUPPORT = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
-				OTHER_LDFLAGS = "-ObjC";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Debug;
-		};
-		1DEB922408733DC00010E9CD /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_FAST_MATH = YES;
-				GCC_THUMB_SUPPORT = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
-				OTHER_LDFLAGS = "-ObjC";
-				PREBINDING = NO;
-				SDKROOT = iphoneos;
-				TARGETED_DEVICE_FAMILY = "1,2";
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "libLua" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1DEB921F08733DC00010E9CD /* Debug */,
-				1DEB922008733DC00010E9CD /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Lua" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1DEB922308733DC00010E9CD /* Debug */,
-				1DEB922408733DC00010E9CD /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/misc/liblua/Xcode/Lua_Prefix.pch b/misc/liblua/Xcode/Lua_Prefix.pch
deleted file mode 100644
index bfb7394..0000000
--- a/misc/liblua/Xcode/Lua_Prefix.pch
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project.
-//
-
-#ifdef __OBJC__
-    #import <Foundation/Foundation.h>
-#endif
diff --git a/misc/liblua/lapi.c b/misc/liblua/lapi.c
deleted file mode 100644
index 86ebb51..0000000
--- a/misc/liblua/lapi.c
+++ /dev/null
@@ -1,1087 +0,0 @@
-/*
-** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $
-** Lua API
-** See Copyright Notice in lua.h
-*/
-
-
-#include <assert.h>
-#include <math.h>
-#include <stdarg.h>
-#include <string.h>
-
-#define lapi_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lapi.h"
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-#include "lundump.h"
-#include "lvm.h"
-
-
-
-const char lua_ident[] =
-  "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n"
-  "$Authors: " LUA_AUTHORS " $\n"
-  "$URL: www.lua.org $\n";
-
-
-
-#define api_checknelems(L, n)	api_check(L, (n) <= (L->top - L->base))
-
-#define api_checkvalidindex(L, i)	api_check(L, (i) != luaO_nilobject)
-
-#define api_incr_top(L)   {api_check(L, L->top < L->ci->top); L->top++;}
-
-
-
-static TValue *index2adr (lua_State *L, int idx) {
-  if (idx > 0) {
-    TValue *o = L->base + (idx - 1);
-    api_check(L, idx <= L->ci->top - L->base);
-    if (o >= L->top) return cast(TValue *, luaO_nilobject);
-    else return o;
-  }
-  else if (idx > LUA_REGISTRYINDEX) {
-    api_check(L, idx != 0 && -idx <= L->top - L->base);
-    return L->top + idx;
-  }
-  else switch (idx) {  /* pseudo-indices */
-    case LUA_REGISTRYINDEX: return registry(L);
-    case LUA_ENVIRONINDEX: {
-      Closure *func = curr_func(L);
-      sethvalue(L, &L->env, func->c.env);
-      return &L->env;
-    }
-    case LUA_GLOBALSINDEX: return gt(L);
-    default: {
-      Closure *func = curr_func(L);
-      idx = LUA_GLOBALSINDEX - idx;
-      return (idx <= func->c.nupvalues)
-                ? &func->c.upvalue[idx-1]
-                : cast(TValue *, luaO_nilobject);
-    }
-  }
-}
-
-
-static Table *getcurrenv (lua_State *L) {
-  if (L->ci == L->base_ci)  /* no enclosing function? */
-    return hvalue(gt(L));  /* use global table as environment */
-  else {
-    Closure *func = curr_func(L);
-    return func->c.env;
-  }
-}
-
-
-void luaA_pushobject (lua_State *L, const TValue *o) {
-  setobj2s(L, L->top, o);
-  api_incr_top(L);
-}
-
-
-LUA_API int lua_checkstack (lua_State *L, int size) {
-  int res = 1;
-  lua_lock(L);
-  if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)
-    res = 0;  /* stack overflow */
-  else if (size > 0) {
-    luaD_checkstack(L, size);
-    if (L->ci->top < L->top + size)
-      L->ci->top = L->top + size;
-  }
-  lua_unlock(L);
-  return res;
-}
-
-
-LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
-  int i;
-  if (from == to) return;
-  lua_lock(to);
-  api_checknelems(from, n);
-  api_check(from, G(from) == G(to));
-  api_check(from, to->ci->top - to->top >= n);
-  from->top -= n;
-  for (i = 0; i < n; i++) {
-    setobj2s(to, to->top++, from->top + i);
-  }
-  lua_unlock(to);
-}
-
-
-LUA_API void lua_setlevel (lua_State *from, lua_State *to) {
-  to->nCcalls = from->nCcalls;
-}
-
-
-LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
-  lua_CFunction old;
-  lua_lock(L);
-  old = G(L)->panic;
-  G(L)->panic = panicf;
-  lua_unlock(L);
-  return old;
-}
-
-
-LUA_API lua_State *lua_newthread (lua_State *L) {
-  lua_State *L1;
-  lua_lock(L);
-  luaC_checkGC(L);
-  L1 = luaE_newthread(L);
-  setthvalue(L, L->top, L1);
-  api_incr_top(L);
-  lua_unlock(L);
-  luai_userstatethread(L, L1);
-  return L1;
-}
-
-
-
-/*
-** basic stack manipulation
-*/
-
-
-LUA_API int lua_gettop (lua_State *L) {
-  return cast_int(L->top - L->base);
-}
-
-
-LUA_API void lua_settop (lua_State *L, int idx) {
-  lua_lock(L);
-  if (idx >= 0) {
-    api_check(L, idx <= L->stack_last - L->base);
-    while (L->top < L->base + idx)
-      setnilvalue(L->top++);
-    L->top = L->base + idx;
-  }
-  else {
-    api_check(L, -(idx+1) <= (L->top - L->base));
-    L->top += idx+1;  /* `subtract' index (index is negative) */
-  }
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_remove (lua_State *L, int idx) {
-  StkId p;
-  lua_lock(L);
-  p = index2adr(L, idx);
-  api_checkvalidindex(L, p);
-  while (++p < L->top) setobjs2s(L, p-1, p);
-  L->top--;
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_insert (lua_State *L, int idx) {
-  StkId p;
-  StkId q;
-  lua_lock(L);
-  p = index2adr(L, idx);
-  api_checkvalidindex(L, p);
-  for (q = L->top; q>p; q--) setobjs2s(L, q, q-1);
-  setobjs2s(L, p, L->top);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_replace (lua_State *L, int idx) {
-  StkId o;
-  lua_lock(L);
-  /* explicit test for incompatible code */
-  if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci)
-    luaG_runerror(L, "no calling environment");
-  api_checknelems(L, 1);
-  o = index2adr(L, idx);
-  api_checkvalidindex(L, o);
-  if (idx == LUA_ENVIRONINDEX) {
-    Closure *func = curr_func(L);
-    api_check(L, ttistable(L->top - 1));
-    func->c.env = hvalue(L->top - 1);
-    luaC_barrier(L, func, L->top - 1);
-  }
-  else {
-    setobj(L, o, L->top - 1);
-    if (idx < LUA_GLOBALSINDEX)  /* function upvalue? */
-      luaC_barrier(L, curr_func(L), L->top - 1);
-  }
-  L->top--;
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushvalue (lua_State *L, int idx) {
-  lua_lock(L);
-  setobj2s(L, L->top, index2adr(L, idx));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-
-/*
-** access functions (stack -> C)
-*/
-
-
-LUA_API int lua_type (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  return (o == luaO_nilobject) ? LUA_TNONE : ttype(o);
-}
-
-
-LUA_API const char *lua_typename (lua_State *L, int t) {
-  UNUSED(L);
-  return (t == LUA_TNONE) ? "no value" : luaT_typenames[t];
-}
-
-
-LUA_API int lua_iscfunction (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  return iscfunction(o);
-}
-
-
-LUA_API int lua_isnumber (lua_State *L, int idx) {
-  TValue n;
-  const TValue *o = index2adr(L, idx);
-  return tonumber(o, &n);
-}
-
-
-LUA_API int lua_isstring (lua_State *L, int idx) {
-  int t = lua_type(L, idx);
-  return (t == LUA_TSTRING || t == LUA_TNUMBER);
-}
-
-
-LUA_API int lua_isuserdata (lua_State *L, int idx) {
-  const TValue *o = index2adr(L, idx);
-  return (ttisuserdata(o) || ttislightuserdata(o));
-}
-
-
-LUA_API int lua_rawequal (lua_State *L, int index1, int index2) {
-  StkId o1 = index2adr(L, index1);
-  StkId o2 = index2adr(L, index2);
-  return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
-         : luaO_rawequalObj(o1, o2);
-}
-
-
-LUA_API int lua_equal (lua_State *L, int index1, int index2) {
-  StkId o1, o2;
-  int i;
-  lua_lock(L);  /* may call tag method */
-  o1 = index2adr(L, index1);
-  o2 = index2adr(L, index2);
-  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2);
-  lua_unlock(L);
-  return i;
-}
-
-
-LUA_API int lua_lessthan (lua_State *L, int index1, int index2) {
-  StkId o1, o2;
-  int i;
-  lua_lock(L);  /* may call tag method */
-  o1 = index2adr(L, index1);
-  o2 = index2adr(L, index2);
-  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
-       : luaV_lessthan(L, o1, o2);
-  lua_unlock(L);
-  return i;
-}
-
-
-
-LUA_API lua_Number lua_tonumber (lua_State *L, int idx) {
-  TValue n;
-  const TValue *o = index2adr(L, idx);
-  if (tonumber(o, &n))
-    return nvalue(o);
-  else
-    return 0;
-}
-
-
-LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) {
-  TValue n;
-  const TValue *o = index2adr(L, idx);
-  if (tonumber(o, &n)) {
-    lua_Integer res;
-    lua_Number num = nvalue(o);
-    lua_number2integer(res, num);
-    return res;
-  }
-  else
-    return 0;
-}
-
-
-LUA_API int lua_toboolean (lua_State *L, int idx) {
-  const TValue *o = index2adr(L, idx);
-  return !l_isfalse(o);
-}
-
-
-LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
-  StkId o = index2adr(L, idx);
-  if (!ttisstring(o)) {
-    lua_lock(L);  /* `luaV_tostring' may create a new string */
-    if (!luaV_tostring(L, o)) {  /* conversion failed? */
-      if (len != NULL) *len = 0;
-      lua_unlock(L);
-      return NULL;
-    }
-    luaC_checkGC(L);
-    o = index2adr(L, idx);  /* previous call may reallocate the stack */
-    lua_unlock(L);
-  }
-  if (len != NULL) *len = tsvalue(o)->len;
-  return svalue(o);
-}
-
-
-LUA_API size_t lua_objlen (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  switch (ttype(o)) {
-    case LUA_TSTRING: return tsvalue(o)->len;
-    case LUA_TUSERDATA: return uvalue(o)->len;
-    case LUA_TTABLE: return luaH_getn(hvalue(o));
-    case LUA_TNUMBER: {
-      size_t l;
-      lua_lock(L);  /* `luaV_tostring' may create a new string */
-      l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0);
-      lua_unlock(L);
-      return l;
-    }
-    default: return 0;
-  }
-}
-
-
-LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  return (!iscfunction(o)) ? NULL : clvalue(o)->c.f;
-}
-
-
-LUA_API void *lua_touserdata (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  switch (ttype(o)) {
-    case LUA_TUSERDATA: return (rawuvalue(o) + 1);
-    case LUA_TLIGHTUSERDATA: return pvalue(o);
-    default: return NULL;
-  }
-}
-
-
-LUA_API lua_State *lua_tothread (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  return (!ttisthread(o)) ? NULL : thvalue(o);
-}
-
-
-LUA_API const void *lua_topointer (lua_State *L, int idx) {
-  StkId o = index2adr(L, idx);
-  switch (ttype(o)) {
-    case LUA_TTABLE: return hvalue(o);
-    case LUA_TFUNCTION: return clvalue(o);
-    case LUA_TTHREAD: return thvalue(o);
-    case LUA_TUSERDATA:
-    case LUA_TLIGHTUSERDATA:
-      return lua_touserdata(L, idx);
-    default: return NULL;
-  }
-}
-
-
-
-/*
-** push functions (C -> stack)
-*/
-
-
-LUA_API void lua_pushnil (lua_State *L) {
-  lua_lock(L);
-  setnilvalue(L->top);
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
-  lua_lock(L);
-  setnvalue(L->top, n);
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
-  lua_lock(L);
-  setnvalue(L->top, cast_num(n));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
-  lua_lock(L);
-  luaC_checkGC(L);
-  setsvalue2s(L, L->top, luaS_newlstr(L, s, len));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushstring (lua_State *L, const char *s) {
-  if (s == NULL)
-    lua_pushnil(L);
-  else
-    lua_pushlstring(L, s, strlen(s));
-}
-
-
-LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt,
-                                      va_list argp) {
-  const char *ret;
-  lua_lock(L);
-  luaC_checkGC(L);
-  ret = luaO_pushvfstring(L, fmt, argp);
-  lua_unlock(L);
-  return ret;
-}
-
-
-LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {
-  const char *ret;
-  va_list argp;
-  lua_lock(L);
-  luaC_checkGC(L);
-  va_start(argp, fmt);
-  ret = luaO_pushvfstring(L, fmt, argp);
-  va_end(argp);
-  lua_unlock(L);
-  return ret;
-}
-
-
-LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
-  Closure *cl;
-  lua_lock(L);
-  luaC_checkGC(L);
-  api_checknelems(L, n);
-  cl = luaF_newCclosure(L, n, getcurrenv(L));
-  cl->c.f = fn;
-  L->top -= n;
-  while (n--)
-    setobj2n(L, &cl->c.upvalue[n], L->top+n);
-  setclvalue(L, L->top, cl);
-  lua_assert(iswhite(obj2gco(cl)));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushboolean (lua_State *L, int b) {
-  lua_lock(L);
-  setbvalue(L->top, (b != 0));  /* ensure that true is 1 */
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
-  lua_lock(L);
-  setpvalue(L->top, p);
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API int lua_pushthread (lua_State *L) {
-  lua_lock(L);
-  setthvalue(L, L->top, L);
-  api_incr_top(L);
-  lua_unlock(L);
-  return (G(L)->mainthread == L);
-}
-
-
-
-/*
-** get functions (Lua -> stack)
-*/
-
-
-LUA_API void lua_gettable (lua_State *L, int idx) {
-  StkId t;
-  lua_lock(L);
-  t = index2adr(L, idx);
-  api_checkvalidindex(L, t);
-  luaV_gettable(L, t, L->top - 1, L->top - 1);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_getfield (lua_State *L, int idx, const char *k) {
-  StkId t;
-  TValue key;
-  lua_lock(L);
-  t = index2adr(L, idx);
-  api_checkvalidindex(L, t);
-  setsvalue(L, &key, luaS_new(L, k));
-  luaV_gettable(L, t, &key, L->top);
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_rawget (lua_State *L, int idx) {
-  StkId t;
-  lua_lock(L);
-  t = index2adr(L, idx);
-  api_check(L, ttistable(t));
-  setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1));
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
-  StkId o;
-  lua_lock(L);
-  o = index2adr(L, idx);
-  api_check(L, ttistable(o));
-  setobj2s(L, L->top, luaH_getnum(hvalue(o), n));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
-  lua_lock(L);
-  luaC_checkGC(L);
-  sethvalue(L, L->top, luaH_new(L, narray, nrec));
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-LUA_API int lua_getmetatable (lua_State *L, int objindex) {
-  const TValue *obj;
-  Table *mt = NULL;
-  int res;
-  lua_lock(L);
-  obj = index2adr(L, objindex);
-  switch (ttype(obj)) {
-    case LUA_TTABLE:
-      mt = hvalue(obj)->metatable;
-      break;
-    case LUA_TUSERDATA:
-      mt = uvalue(obj)->metatable;
-      break;
-    default:
-      mt = G(L)->mt[ttype(obj)];
-      break;
-  }
-  if (mt == NULL)
-    res = 0;
-  else {
-    sethvalue(L, L->top, mt);
-    api_incr_top(L);
-    res = 1;
-  }
-  lua_unlock(L);
-  return res;
-}
-
-
-LUA_API void lua_getfenv (lua_State *L, int idx) {
-  StkId o;
-  lua_lock(L);
-  o = index2adr(L, idx);
-  api_checkvalidindex(L, o);
-  switch (ttype(o)) {
-    case LUA_TFUNCTION:
-      sethvalue(L, L->top, clvalue(o)->c.env);
-      break;
-    case LUA_TUSERDATA:
-      sethvalue(L, L->top, uvalue(o)->env);
-      break;
-    case LUA_TTHREAD:
-      setobj2s(L, L->top,  gt(thvalue(o)));
-      break;
-    default:
-      setnilvalue(L->top);
-      break;
-  }
-  api_incr_top(L);
-  lua_unlock(L);
-}
-
-
-/*
-** set functions (stack -> Lua)
-*/
-
-
-LUA_API void lua_settable (lua_State *L, int idx) {
-  StkId t;
-  lua_lock(L);
-  api_checknelems(L, 2);
-  t = index2adr(L, idx);
-  api_checkvalidindex(L, t);
-  luaV_settable(L, t, L->top - 2, L->top - 1);
-  L->top -= 2;  /* pop index and value */
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
-  StkId t;
-  TValue key;
-  lua_lock(L);
-  api_checknelems(L, 1);
-  t = index2adr(L, idx);
-  api_checkvalidindex(L, t);
-  setsvalue(L, &key, luaS_new(L, k));
-  luaV_settable(L, t, &key, L->top - 1);
-  L->top--;  /* pop value */
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_rawset (lua_State *L, int idx) {
-  StkId t;
-  lua_lock(L);
-  api_checknelems(L, 2);
-  t = index2adr(L, idx);
-  api_check(L, ttistable(t));
-  setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);
-  luaC_barriert(L, hvalue(t), L->top-1);
-  L->top -= 2;
-  lua_unlock(L);
-}
-
-
-LUA_API void lua_rawseti (lua_State *L, int idx, int n) {
-  StkId o;
-  lua_lock(L);
-  api_checknelems(L, 1);
-  o = index2adr(L, idx);
-  api_check(L, ttistable(o));
-  setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1);
-  luaC_barriert(L, hvalue(o), L->top-1);
-  L->top--;
-  lua_unlock(L);
-}
-
-
-LUA_API int lua_setmetatable (lua_State *L, int objindex) {
-  TValue *obj;
-  Table *mt;
-  lua_lock(L);
-  api_checknelems(L, 1);
-  obj = index2adr(L, objindex);
-  api_checkvalidindex(L, obj);
-  if (ttisnil(L->top - 1))
-    mt = NULL;
-  else {
-    api_check(L, ttistable(L->top - 1));
-    mt = hvalue(L->top - 1);
-  }
-  switch (ttype(obj)) {
-    case LUA_TTABLE: {
-      hvalue(obj)->metatable = mt;
-      if (mt)
-        luaC_objbarriert(L, hvalue(obj), mt);
-      break;
-    }
-    case LUA_TUSERDATA: {
-      uvalue(obj)->metatable = mt;
-      if (mt)
-        luaC_objbarrier(L, rawuvalue(obj), mt);
-      break;
-    }
-    default: {
-      G(L)->mt[ttype(obj)] = mt;
-      break;
-    }
-  }
-  L->top--;
-  lua_unlock(L);
-  return 1;
-}
-
-
-LUA_API int lua_setfenv (lua_State *L, int idx) {
-  StkId o;
-  int res = 1;
-  lua_lock(L);
-  api_checknelems(L, 1);
-  o = index2adr(L, idx);
-  api_checkvalidindex(L, o);
-  api_check(L, ttistable(L->top - 1));
-  switch (ttype(o)) {
-    case LUA_TFUNCTION:
-      clvalue(o)->c.env = hvalue(L->top - 1);
-      break;
-    case LUA_TUSERDATA:
-      uvalue(o)->env = hvalue(L->top - 1);
-      break;
-    case LUA_TTHREAD:
-      sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1));
-      break;
-    default:
-      res = 0;
-      break;
-  }
-  if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));
-  L->top--;
-  lua_unlock(L);
-  return res;
-}
-
-
-/*
-** `load' and `call' functions (run Lua code)
-*/
-
-
-#define adjustresults(L,nres) \
-    { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; }
-
-
-#define checkresults(L,na,nr) \
-     api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
-
-
-LUA_API void lua_call (lua_State *L, int nargs, int nresults) {
-  StkId func;
-  lua_lock(L);
-  api_checknelems(L, nargs+1);
-  checkresults(L, nargs, nresults);
-  func = L->top - (nargs+1);
-  luaD_call(L, func, nresults);
-  adjustresults(L, nresults);
-  lua_unlock(L);
-}
-
-
-
-/*
-** Execute a protected call.
-*/
-struct CallS {  /* data to `f_call' */
-  StkId func;
-  int nresults;
-};
-
-
-static void f_call (lua_State *L, void *ud) {
-  struct CallS *c = cast(struct CallS *, ud);
-  luaD_call(L, c->func, c->nresults);
-}
-
-
-
-LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) {
-  struct CallS c;
-  int status;
-  ptrdiff_t func;
-  lua_lock(L);
-  api_checknelems(L, nargs+1);
-  checkresults(L, nargs, nresults);
-  if (errfunc == 0)
-    func = 0;
-  else {
-    StkId o = index2adr(L, errfunc);
-    api_checkvalidindex(L, o);
-    func = savestack(L, o);
-  }
-  c.func = L->top - (nargs+1);  /* function to be called */
-  c.nresults = nresults;
-  status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);
-  adjustresults(L, nresults);
-  lua_unlock(L);
-  return status;
-}
-
-
-/*
-** Execute a protected C call.
-*/
-struct CCallS {  /* data to `f_Ccall' */
-  lua_CFunction func;
-  void *ud;
-};
-
-
-static void f_Ccall (lua_State *L, void *ud) {
-  struct CCallS *c = cast(struct CCallS *, ud);
-  Closure *cl;
-  cl = luaF_newCclosure(L, 0, getcurrenv(L));
-  cl->c.f = c->func;
-  setclvalue(L, L->top, cl);  /* push function */
-  api_incr_top(L);
-  setpvalue(L->top, c->ud);  /* push only argument */
-  api_incr_top(L);
-  luaD_call(L, L->top - 2, 0);
-}
-
-
-LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) {
-  struct CCallS c;
-  int status;
-  lua_lock(L);
-  c.func = func;
-  c.ud = ud;
-  status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0);
-  lua_unlock(L);
-  return status;
-}
-
-
-LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
-                      const char *chunkname) {
-  ZIO z;
-  int status;
-  lua_lock(L);
-  if (!chunkname) chunkname = "?";
-  luaZ_init(L, &z, reader, data);
-  status = luaD_protectedparser(L, &z, chunkname);
-  lua_unlock(L);
-  return status;
-}
-
-
-LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {
-  int status;
-  TValue *o;
-  lua_lock(L);
-  api_checknelems(L, 1);
-  o = L->top - 1;
-  if (isLfunction(o))
-    status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0);
-  else
-    status = 1;
-  lua_unlock(L);
-  return status;
-}
-
-
-LUA_API int  lua_status (lua_State *L) {
-  return L->status;
-}
-
-
-/*
-** Garbage-collection function
-*/
-
-LUA_API int lua_gc (lua_State *L, int what, int data) {
-  int res = 0;
-  global_State *g;
-  lua_lock(L);
-  g = G(L);
-  switch (what) {
-    case LUA_GCSTOP: {
-      g->GCthreshold = MAX_LUMEM;
-      break;
-    }
-    case LUA_GCRESTART: {
-      g->GCthreshold = g->totalbytes;
-      break;
-    }
-    case LUA_GCCOLLECT: {
-      luaC_fullgc(L);
-      break;
-    }
-    case LUA_GCCOUNT: {
-      /* GC values are expressed in Kbytes: #bytes/2^10 */
-      res = cast_int(g->totalbytes >> 10);
-      break;
-    }
-    case LUA_GCCOUNTB: {
-      res = cast_int(g->totalbytes & 0x3ff);
-      break;
-    }
-    case LUA_GCSTEP: {
-      lu_mem a = (cast(lu_mem, data) << 10);
-      if (a <= g->totalbytes)
-        g->GCthreshold = g->totalbytes - a;
-      else
-        g->GCthreshold = 0;
-      while (g->GCthreshold <= g->totalbytes) {
-        luaC_step(L);
-        if (g->gcstate == GCSpause) {  /* end of cycle? */
-          res = 1;  /* signal it */
-          break;
-        }
-      }
-      break;
-    }
-    case LUA_GCSETPAUSE: {
-      res = g->gcpause;
-      g->gcpause = data;
-      break;
-    }
-    case LUA_GCSETSTEPMUL: {
-      res = g->gcstepmul;
-      g->gcstepmul = data;
-      break;
-    }
-    default: res = -1;  /* invalid option */
-  }
-  lua_unlock(L);
-  return res;
-}
-
-
-
-/*
-** miscellaneous functions
-*/
-
-
-LUA_API int lua_error (lua_State *L) {
-  lua_lock(L);
-  api_checknelems(L, 1);
-  luaG_errormsg(L);
-  lua_unlock(L);
-  return 0;  /* to avoid warnings */
-}
-
-
-LUA_API int lua_next (lua_State *L, int idx) {
-  StkId t;
-  int more;
-  lua_lock(L);
-  t = index2adr(L, idx);
-  api_check(L, ttistable(t));
-  more = luaH_next(L, hvalue(t), L->top - 1);
-  if (more) {
-    api_incr_top(L);
-  }
-  else  /* no more elements */
-    L->top -= 1;  /* remove key */
-  lua_unlock(L);
-  return more;
-}
-
-
-LUA_API void lua_concat (lua_State *L, int n) {
-  lua_lock(L);
-  api_checknelems(L, n);
-  if (n >= 2) {
-    luaC_checkGC(L);
-    luaV_concat(L, n, cast_int(L->top - L->base) - 1);
-    L->top -= (n-1);
-  }
-  else if (n == 0) {  /* push empty string */
-    setsvalue2s(L, L->top, luaS_newlstr(L, "", 0));
-    api_incr_top(L);
-  }
-  /* else n == 1; nothing to do */
-  lua_unlock(L);
-}
-
-
-LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) {
-  lua_Alloc f;
-  lua_lock(L);
-  if (ud) *ud = G(L)->ud;
-  f = G(L)->frealloc;
-  lua_unlock(L);
-  return f;
-}
-
-
-LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) {
-  lua_lock(L);
-  G(L)->ud = ud;
-  G(L)->frealloc = f;
-  lua_unlock(L);
-}
-
-
-LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
-  Udata *u;
-  lua_lock(L);
-  luaC_checkGC(L);
-  u = luaS_newudata(L, size, getcurrenv(L));
-  setuvalue(L, L->top, u);
-  api_incr_top(L);
-  lua_unlock(L);
-  return u + 1;
-}
-
-
-
-
-static const char *aux_upvalue (StkId fi, int n, TValue **val) {
-  Closure *f;
-  if (!ttisfunction(fi)) return NULL;
-  f = clvalue(fi);
-  if (f->c.isC) {
-    if (!(1 <= n && n <= f->c.nupvalues)) return NULL;
-    *val = &f->c.upvalue[n-1];
-    return "";
-  }
-  else {
-    Proto *p = f->l.p;
-    if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
-    *val = f->l.upvals[n-1]->v;
-    return getstr(p->upvalues[n-1]);
-  }
-}
-
-
-LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {
-  const char *name;
-  TValue *val;
-  lua_lock(L);
-  name = aux_upvalue(index2adr(L, funcindex), n, &val);
-  if (name) {
-    setobj2s(L, L->top, val);
-    api_incr_top(L);
-  }
-  lua_unlock(L);
-  return name;
-}
-
-
-LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
-  const char *name;
-  TValue *val;
-  StkId fi;
-  lua_lock(L);
-  fi = index2adr(L, funcindex);
-  api_checknelems(L, 1);
-  name = aux_upvalue(fi, n, &val);
-  if (name) {
-    L->top--;
-    setobj(L, val, L->top);
-    luaC_barrier(L, clvalue(fi), L->top);
-  }
-  lua_unlock(L);
-  return name;
-}
-
diff --git a/misc/liblua/lapi.h b/misc/liblua/lapi.h
deleted file mode 100644
index 2c3fab2..0000000
--- a/misc/liblua/lapi.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
-** Auxiliary functions from Lua API
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lapi_h
-#define lapi_h
-
-
-#include "lobject.h"
-
-
-LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
-
-#endif
diff --git a/misc/liblua/lauxlib.c b/misc/liblua/lauxlib.c
deleted file mode 100644
index 10f14e2..0000000
--- a/misc/liblua/lauxlib.c
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
-** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $
-** Auxiliary functions for building Lua libraries
-** See Copyright Notice in lua.h
-*/
-
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/* This file uses only the official API of Lua.
-** Any function declared here could be written as an application function.
-*/
-
-#define lauxlib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-
-
-#define FREELIST_REF	0	/* free list of references */
-
-
-/* convert a stack index to positive */
-#define abs_index(L, i)		((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \
-					lua_gettop(L) + (i) + 1)
-
-
-/*
-** {======================================================
-** Error-report functions
-** =======================================================
-*/
-
-
-LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
-  lua_Debug ar;
-  if (!lua_getstack(L, 0, &ar))  /* no stack frame? */
-    return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
-  lua_getinfo(L, "n", &ar);
-  if (strcmp(ar.namewhat, "method") == 0) {
-    narg--;  /* do not count `self' */
-    if (narg == 0)  /* error is in the self argument itself? */
-      return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
-                           ar.name, extramsg);
-  }
-  if (ar.name == NULL)
-    ar.name = "?";
-  return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)",
-                        narg, ar.name, extramsg);
-}
-
-
-LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) {
-  const char *msg = lua_pushfstring(L, "%s expected, got %s",
-                                    tname, luaL_typename(L, narg));
-  return luaL_argerror(L, narg, msg);
-}
-
-
-static void tag_error (lua_State *L, int narg, int tag) {
-  luaL_typerror(L, narg, lua_typename(L, tag));
-}
-
-
-LUALIB_API void luaL_where (lua_State *L, int level) {
-  lua_Debug ar;
-  if (lua_getstack(L, level, &ar)) {  /* check function at level */
-    lua_getinfo(L, "Sl", &ar);  /* get info about it */
-    if (ar.currentline > 0) {  /* is there info? */
-      lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline);
-      return;
-    }
-  }
-  lua_pushliteral(L, "");  /* else, no information available... */
-}
-
-
-LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) {
-  va_list argp;
-  va_start(argp, fmt);
-  luaL_where(L, 1);
-  lua_pushvfstring(L, fmt, argp);
-  va_end(argp);
-  lua_concat(L, 2);
-  return lua_error(L);
-}
-
-/* }====================================================== */
-
-
-LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
-                                 const char *const lst[]) {
-  const char *name = (def) ? luaL_optstring(L, narg, def) :
-                             luaL_checkstring(L, narg);
-  int i;
-  for (i=0; lst[i]; i++)
-    if (strcmp(lst[i], name) == 0)
-      return i;
-  return luaL_argerror(L, narg,
-                       lua_pushfstring(L, "invalid option " LUA_QS, name));
-}
-
-
-LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) {
-  lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get registry.name */
-  if (!lua_isnil(L, -1))  /* name already in use? */
-    return 0;  /* leave previous value on top, but return 0 */
-  lua_pop(L, 1);
-  lua_newtable(L);  /* create metatable */
-  lua_pushvalue(L, -1);
-  lua_setfield(L, LUA_REGISTRYINDEX, tname);  /* registry.name = metatable */
-  return 1;
-}
-
-
-LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
-  void *p = lua_touserdata(L, ud);
-  if (p != NULL) {  /* value is a userdata? */
-    if (lua_getmetatable(L, ud)) {  /* does it have a metatable? */
-      lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get correct metatable */
-      if (lua_rawequal(L, -1, -2)) {  /* does it have the correct mt? */
-        lua_pop(L, 2);  /* remove both metatables */
-        return p;
-      }
-    }
-  }
-  luaL_typerror(L, ud, tname);  /* else error */
-  return NULL;  /* to avoid warnings */
-}
-
-
-LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {
-  if (!lua_checkstack(L, space))
-    luaL_error(L, "stack overflow (%s)", mes);
-}
-
-
-LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {
-  if (lua_type(L, narg) != t)
-    tag_error(L, narg, t);
-}
-
-
-LUALIB_API void luaL_checkany (lua_State *L, int narg) {
-  if (lua_type(L, narg) == LUA_TNONE)
-    luaL_argerror(L, narg, "value expected");
-}
-
-
-LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {
-  const char *s = lua_tolstring(L, narg, len);
-  if (!s) tag_error(L, narg, LUA_TSTRING);
-  return s;
-}
-
-
-LUALIB_API const char *luaL_optlstring (lua_State *L, int narg,
-                                        const char *def, size_t *len) {
-  if (lua_isnoneornil(L, narg)) {
-    if (len)
-      *len = (def ? strlen(def) : 0);
-    return def;
-  }
-  else return luaL_checklstring(L, narg, len);
-}
-
-
-LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
-  lua_Number d = lua_tonumber(L, narg);
-  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */
-    tag_error(L, narg, LUA_TNUMBER);
-  return d;
-}
-
-
-LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {
-  return luaL_opt(L, luaL_checknumber, narg, def);
-}
-
-
-LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {
-  lua_Integer d = lua_tointeger(L, narg);
-  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */
-    tag_error(L, narg, LUA_TNUMBER);
-  return d;
-}
-
-
-LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
-                                                      lua_Integer def) {
-  return luaL_opt(L, luaL_checkinteger, narg, def);
-}
-
-
-LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
-  if (!lua_getmetatable(L, obj))  /* no metatable? */
-    return 0;
-  lua_pushstring(L, event);
-  lua_rawget(L, -2);
-  if (lua_isnil(L, -1)) {
-    lua_pop(L, 2);  /* remove metatable and metafield */
-    return 0;
-  }
-  else {
-    lua_remove(L, -2);  /* remove only metatable */
-    return 1;
-  }
-}
-
-
-LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {
-  obj = abs_index(L, obj);
-  if (!luaL_getmetafield(L, obj, event))  /* no metafield? */
-    return 0;
-  lua_pushvalue(L, obj);
-  lua_call(L, 1, 1);
-  return 1;
-}
-
-
-LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
-                                const luaL_Reg *l) {
-  luaI_openlib(L, libname, l, 0);
-}
-
-
-static int libsize (const luaL_Reg *l) {
-  int size = 0;
-  for (; l->name; l++) size++;
-  return size;
-}
-
-
-LUALIB_API void luaI_openlib (lua_State *L, const char *libname,
-                              const luaL_Reg *l, int nup) {
-  if (libname) {
-    int size = libsize(l);
-    /* check whether lib already exists */
-    luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1);
-    lua_getfield(L, -1, libname);  /* get _LOADED[libname] */
-    if (!lua_istable(L, -1)) {  /* not found? */
-      lua_pop(L, 1);  /* remove previous result */
-      /* try global variable (and create one if it does not exist) */
-      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL)
-        luaL_error(L, "name conflict for module " LUA_QS, libname);
-      lua_pushvalue(L, -1);
-      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */
-    }
-    lua_remove(L, -2);  /* remove _LOADED table */
-    lua_insert(L, -(nup+1));  /* move library table to below upvalues */
-  }
-  for (; l->name; l++) {
-    int i;
-    for (i=0; i<nup; i++)  /* copy upvalues to the top */
-      lua_pushvalue(L, -nup);
-    lua_pushcclosure(L, l->func, nup);
-    lua_setfield(L, -(nup+2), l->name);
-  }
-  lua_pop(L, nup);  /* remove upvalues */
-}
-
-
-
-/*
-** {======================================================
-** getn-setn: size for arrays
-** =======================================================
-*/
-
-#if defined(LUA_COMPAT_GETN)
-
-static int checkint (lua_State *L, int topop) {
-  int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1;
-  lua_pop(L, topop);
-  return n;
-}
-
-
-static void getsizes (lua_State *L) {
-  lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES");
-  if (lua_isnil(L, -1)) {  /* no `size' table? */
-    lua_pop(L, 1);  /* remove nil */
-    lua_newtable(L);  /* create it */
-    lua_pushvalue(L, -1);  /* `size' will be its own metatable */
-    lua_setmetatable(L, -2);
-    lua_pushliteral(L, "kv");
-    lua_setfield(L, -2, "__mode");  /* metatable(N).__mode = "kv" */
-    lua_pushvalue(L, -1);
-    lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES");  /* store in register */
-  }
-}
-
-
-LUALIB_API void luaL_setn (lua_State *L, int t, int n) {
-  t = abs_index(L, t);
-  lua_pushliteral(L, "n");
-  lua_rawget(L, t);
-  if (checkint(L, 1) >= 0) {  /* is there a numeric field `n'? */
-    lua_pushliteral(L, "n");  /* use it */
-    lua_pushinteger(L, n);
-    lua_rawset(L, t);
-  }
-  else {  /* use `sizes' */
-    getsizes(L);
-    lua_pushvalue(L, t);
-    lua_pushinteger(L, n);
-    lua_rawset(L, -3);  /* sizes[t] = n */
-    lua_pop(L, 1);  /* remove `sizes' */
-  }
-}
-
-
-LUALIB_API int luaL_getn (lua_State *L, int t) {
-  int n;
-  t = abs_index(L, t);
-  lua_pushliteral(L, "n");  /* try t.n */
-  lua_rawget(L, t);
-  if ((n = checkint(L, 1)) >= 0) return n;
-  getsizes(L);  /* else try sizes[t] */
-  lua_pushvalue(L, t);
-  lua_rawget(L, -2);
-  if ((n = checkint(L, 2)) >= 0) return n;
-  return (int)lua_objlen(L, t);
-}
-
-#endif
-
-/* }====================================================== */
-
-
-
-LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p,
-                                                               const char *r) {
-  const char *wild;
-  size_t l = strlen(p);
-  luaL_Buffer b;
-  luaL_buffinit(L, &b);
-  while ((wild = strstr(s, p)) != NULL) {
-    luaL_addlstring(&b, s, wild - s);  /* push prefix */
-    luaL_addstring(&b, r);  /* push replacement in place of pattern */
-    s = wild + l;  /* continue after `p' */
-  }
-  luaL_addstring(&b, s);  /* push last suffix */
-  luaL_pushresult(&b);
-  return lua_tostring(L, -1);
-}
-
-
-LUALIB_API const char *luaL_findtable (lua_State *L, int idx,
-                                       const char *fname, int szhint) {
-  const char *e;
-  lua_pushvalue(L, idx);
-  do {
-    e = strchr(fname, '.');
-    if (e == NULL) e = fname + strlen(fname);
-    lua_pushlstring(L, fname, e - fname);
-    lua_rawget(L, -2);
-    if (lua_isnil(L, -1)) {  /* no such field? */
-      lua_pop(L, 1);  /* remove this nil */
-      lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */
-      lua_pushlstring(L, fname, e - fname);
-      lua_pushvalue(L, -2);
-      lua_settable(L, -4);  /* set new table into field */
-    }
-    else if (!lua_istable(L, -1)) {  /* field has a non-table value? */
-      lua_pop(L, 2);  /* remove table and value */
-      return fname;  /* return problematic part of the name */
-    }
-    lua_remove(L, -2);  /* remove previous table */
-    fname = e + 1;
-  } while (*e == '.');
-  return NULL;
-}
-
-
-
-/*
-** {======================================================
-** Generic Buffer manipulation
-** =======================================================
-*/
-
-
-#define bufflen(B)	((B)->p - (B)->buffer)
-#define bufffree(B)	((size_t)(LUAL_BUFFERSIZE - bufflen(B)))
-
-#define LIMIT	(LUA_MINSTACK/2)
-
-
-static int emptybuffer (luaL_Buffer *B) {
-  size_t l = bufflen(B);
-  if (l == 0) return 0;  /* put nothing on stack */
-  else {
-    lua_pushlstring(B->L, B->buffer, l);
-    B->p = B->buffer;
-    B->lvl++;
-    return 1;
-  }
-}
-
-
-static void adjuststack (luaL_Buffer *B) {
-  if (B->lvl > 1) {
-    lua_State *L = B->L;
-    int toget = 1;  /* number of levels to concat */
-    size_t toplen = lua_strlen(L, -1);
-    do {
-      size_t l = lua_strlen(L, -(toget+1));
-      if (B->lvl - toget + 1 >= LIMIT || toplen > l) {
-        toplen += l;
-        toget++;
-      }
-      else break;
-    } while (toget < B->lvl);
-    lua_concat(L, toget);
-    B->lvl = B->lvl - toget + 1;
-  }
-}
-
-
-LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) {
-  if (emptybuffer(B))
-    adjuststack(B);
-  return B->buffer;
-}
-
-
-LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) {
-  while (l--)
-    luaL_addchar(B, *s++);
-}
-
-
-LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) {
-  luaL_addlstring(B, s, strlen(s));
-}
-
-
-LUALIB_API void luaL_pushresult (luaL_Buffer *B) {
-  emptybuffer(B);
-  lua_concat(B->L, B->lvl);
-  B->lvl = 1;
-}
-
-
-LUALIB_API void luaL_addvalue (luaL_Buffer *B) {
-  lua_State *L = B->L;
-  size_t vl;
-  const char *s = lua_tolstring(L, -1, &vl);
-  if (vl <= bufffree(B)) {  /* fit into buffer? */
-    memcpy(B->p, s, vl);  /* put it there */
-    B->p += vl;
-    lua_pop(L, 1);  /* remove from stack */
-  }
-  else {
-    if (emptybuffer(B))
-      lua_insert(L, -2);  /* put buffer before new value */
-    B->lvl++;  /* add new value into B stack */
-    adjuststack(B);
-  }
-}
-
-
-LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) {
-  B->L = L;
-  B->p = B->buffer;
-  B->lvl = 0;
-}
-
-/* }====================================================== */
-
-
-LUALIB_API int luaL_ref (lua_State *L, int t) {
-  int ref;
-  t = abs_index(L, t);
-  if (lua_isnil(L, -1)) {
-    lua_pop(L, 1);  /* remove from stack */
-    return LUA_REFNIL;  /* `nil' has a unique fixed reference */
-  }
-  lua_rawgeti(L, t, FREELIST_REF);  /* get first free element */
-  ref = (int)lua_tointeger(L, -1);  /* ref = t[FREELIST_REF] */
-  lua_pop(L, 1);  /* remove it from stack */
-  if (ref != 0) {  /* any free element? */
-    lua_rawgeti(L, t, ref);  /* remove it from list */
-    lua_rawseti(L, t, FREELIST_REF);  /* (t[FREELIST_REF] = t[ref]) */
-  }
-  else {  /* no free elements */
-    ref = (int)lua_objlen(L, t);
-    ref++;  /* create new reference */
-  }
-  lua_rawseti(L, t, ref);
-  return ref;
-}
-
-
-LUALIB_API void luaL_unref (lua_State *L, int t, int ref) {
-  if (ref >= 0) {
-    t = abs_index(L, t);
-    lua_rawgeti(L, t, FREELIST_REF);
-    lua_rawseti(L, t, ref);  /* t[ref] = t[FREELIST_REF] */
-    lua_pushinteger(L, ref);
-    lua_rawseti(L, t, FREELIST_REF);  /* t[FREELIST_REF] = ref */
-  }
-}
-
-
-
-/*
-** {======================================================
-** Load functions
-** =======================================================
-*/
-
-typedef struct LoadF {
-  int extraline;
-  FILE *f;
-  char buff[LUAL_BUFFERSIZE];
-} LoadF;
-
-
-static const char *getF (lua_State *L, void *ud, size_t *size) {
-  LoadF *lf = (LoadF *)ud;
-  (void)L;
-  if (lf->extraline) {
-    lf->extraline = 0;
-    *size = 1;
-    return "\n";
-  }
-  if (feof(lf->f)) return NULL;
-  *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f);
-  return (*size > 0) ? lf->buff : NULL;
-}
-
-
-static int errfile (lua_State *L, const char *what, int fnameindex) {
-  const char *serr = strerror(errno);
-  const char *filename = lua_tostring(L, fnameindex) + 1;
-  lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr);
-  lua_remove(L, fnameindex);
-  return LUA_ERRFILE;
-}
-
-
-LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
-  LoadF lf;
-  int status, readstatus;
-  int c;
-  int fnameindex = lua_gettop(L) + 1;  /* index of filename on the stack */
-  lf.extraline = 0;
-  if (filename == NULL) {
-    lua_pushliteral(L, "=stdin");
-    lf.f = stdin;
-  }
-  else {
-    lua_pushfstring(L, "@%s", filename);
-    lf.f = fopen(filename, "r");
-    if (lf.f == NULL) return errfile(L, "open", fnameindex);
-  }
-  c = getc(lf.f);
-  if (c == '#') {  /* Unix exec. file? */
-    lf.extraline = 1;
-    while ((c = getc(lf.f)) != EOF && c != '\n') ;  /* skip first line */
-    if (c == '\n') c = getc(lf.f);
-  }
-  if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */
-    lf.f = freopen(filename, "rb", lf.f);  /* reopen in binary mode */
-    if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
-    /* skip eventual `#!...' */
-   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
-    lf.extraline = 0;
-  }
-  ungetc(c, lf.f);
-  status = lua_load(L, getF, &lf, lua_tostring(L, -1));
-  readstatus = ferror(lf.f);
-  if (filename) fclose(lf.f);  /* close file (even in case of errors) */
-  if (readstatus) {
-    lua_settop(L, fnameindex);  /* ignore results from `lua_load' */
-    return errfile(L, "read", fnameindex);
-  }
-  lua_remove(L, fnameindex);
-  return status;
-}
-
-
-typedef struct LoadS {
-  const char *s;
-  size_t size;
-} LoadS;
-
-
-static const char *getS (lua_State *L, void *ud, size_t *size) {
-  LoadS *ls = (LoadS *)ud;
-  (void)L;
-  if (ls->size == 0) return NULL;
-  *size = ls->size;
-  ls->size = 0;
-  return ls->s;
-}
-
-
-LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size,
-                                const char *name) {
-  LoadS ls;
-  ls.s = buff;
-  ls.size = size;
-  return lua_load(L, getS, &ls, name);
-}
-
-
-LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) {
-  return luaL_loadbuffer(L, s, strlen(s), s);
-}
-
-
-
-/* }====================================================== */
-
-
-static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
-  (void)ud;
-  (void)osize;
-  if (nsize == 0) {
-    free(ptr);
-    return NULL;
-  }
-  else
-    return realloc(ptr, nsize);
-}
-
-
-static int panic (lua_State *L) {
-  (void)L;  /* to avoid warnings */
-  fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
-                   lua_tostring(L, -1));
-  return 0;
-}
-
-
-LUALIB_API lua_State *luaL_newstate (void) {
-  lua_State *L = lua_newstate(l_alloc, NULL);
-  if (L) lua_atpanic(L, &panic);
-  return L;
-}
-
diff --git a/misc/liblua/lauxlib.h b/misc/liblua/lauxlib.h
deleted file mode 100644
index 3425823..0000000
--- a/misc/liblua/lauxlib.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $
-** Auxiliary functions for building Lua libraries
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lauxlib_h
-#define lauxlib_h
-
-
-#include <stddef.h>
-#include <stdio.h>
-
-#include "lua.h"
-
-
-#if defined(LUA_COMPAT_GETN)
-LUALIB_API int (luaL_getn) (lua_State *L, int t);
-LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
-#else
-#define luaL_getn(L,i)          ((int)lua_objlen(L, i))
-#define luaL_setn(L,i,j)        ((void)0)  /* no op! */
-#endif
-
-#if defined(LUA_COMPAT_OPENLIB)
-#define luaI_openlib	luaL_openlib
-#endif
-
-
-/* extra error code for `luaL_load' */
-#define LUA_ERRFILE     (LUA_ERRERR+1)
-
-
-typedef struct luaL_Reg {
-  const char *name;
-  lua_CFunction func;
-} luaL_Reg;
-
-
-
-LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
-                                const luaL_Reg *l, int nup);
-LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
-                                const luaL_Reg *l);
-LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
-LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
-LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
-LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
-LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
-                                                          size_t *l);
-LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
-                                          const char *def, size_t *l);
-LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
-LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
-
-LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
-LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
-                                          lua_Integer def);
-
-LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
-LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
-LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
-
-LUALIB_API int   (luaL_newmetatable) (lua_State *L, const char *tname);
-LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
-
-LUALIB_API void (luaL_where) (lua_State *L, int lvl);
-LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
-
-LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
-                                   const char *const lst[]);
-
-LUALIB_API int (luaL_ref) (lua_State *L, int t);
-LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
-
-LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
-LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
-                                  const char *name);
-LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
-
-LUALIB_API lua_State *(luaL_newstate) (void);
-
-
-LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
-                                                  const char *r);
-
-LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
-                                         const char *fname, int szhint);
-
-
-
-
-/*
-** ===============================================================
-** some useful macros
-** ===============================================================
-*/
-
-#define luaL_argcheck(L, cond,numarg,extramsg)	\
-		((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
-#define luaL_checkstring(L,n)	(luaL_checklstring(L, (n), NULL))
-#define luaL_optstring(L,n,d)	(luaL_optlstring(L, (n), (d), NULL))
-#define luaL_checkint(L,n)	((int)luaL_checkinteger(L, (n)))
-#define luaL_optint(L,n,d)	((int)luaL_optinteger(L, (n), (d)))
-#define luaL_checklong(L,n)	((long)luaL_checkinteger(L, (n)))
-#define luaL_optlong(L,n,d)	((long)luaL_optinteger(L, (n), (d)))
-
-#define luaL_typename(L,i)	lua_typename(L, lua_type(L,(i)))
-
-#define luaL_dofile(L, fn) \
-	(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
-
-#define luaL_dostring(L, s) \
-	(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
-
-#define luaL_getmetatable(L,n)	(lua_getfield(L, LUA_REGISTRYINDEX, (n)))
-
-#define luaL_opt(L,f,n,d)	(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
-
-/*
-** {======================================================
-** Generic Buffer manipulation
-** =======================================================
-*/
-
-
-
-typedef struct luaL_Buffer {
-  char *p;			/* current position in buffer */
-  int lvl;  /* number of strings in the stack (level) */
-  lua_State *L;
-  char buffer[LUAL_BUFFERSIZE];
-} luaL_Buffer;
-
-#define luaL_addchar(B,c) \
-  ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
-   (*(B)->p++ = (char)(c)))
-
-/* compatibility only */
-#define luaL_putchar(B,c)	luaL_addchar(B,c)
-
-#define luaL_addsize(B,n)	((B)->p += (n))
-
-LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
-LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
-LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
-LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
-LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
-LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
-
-
-/* }====================================================== */
-
-
-/* compatibility with ref system */
-
-/* pre-defined references */
-#define LUA_NOREF       (-2)
-#define LUA_REFNIL      (-1)
-
-#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
-      (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
-
-#define lua_unref(L,ref)        luaL_unref(L, LUA_REGISTRYINDEX, (ref))
-
-#define lua_getref(L,ref)       lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
-
-
-#define luaL_reg	luaL_Reg
-
-#endif
-
-
diff --git a/misc/liblua/lbaselib.c b/misc/liblua/lbaselib.c
deleted file mode 100644
index 2a4c079..0000000
--- a/misc/liblua/lbaselib.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
-** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $
-** Basic library
-** See Copyright Notice in lua.h
-*/
-
-
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define lbaselib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-
-
-/*
-** If your system does not support `stdout', you can just remove this function.
-** If you need, you can define your own `print' function, following this
-** model but changing `fputs' to put the strings at a proper place
-** (a console window or a log file, for instance).
-*/
-static int luaB_print (lua_State *L) {
-  int n = lua_gettop(L);  /* number of arguments */
-  int i;
-  lua_getglobal(L, "tostring");
-  for (i=1; i<=n; i++) {
-    const char *s;
-    lua_pushvalue(L, -1);  /* function to be called */
-    lua_pushvalue(L, i);   /* value to print */
-    lua_call(L, 1, 1);
-    s = lua_tostring(L, -1);  /* get result */
-    if (s == NULL)
-      return luaL_error(L, LUA_QL("tostring") " must return a string to "
-                           LUA_QL("print"));
-    if (i>1) fputs("\t", stdout);
-    fputs(s, stdout);
-    lua_pop(L, 1);  /* pop result */
-  }
-  fputs("\n", stdout);
-  return 0;
-}
-
-
-static int luaB_tonumber (lua_State *L) {
-  int base = luaL_optint(L, 2, 10);
-  if (base == 10) {  /* standard conversion */
-    luaL_checkany(L, 1);
-    if (lua_isnumber(L, 1)) {
-      lua_pushnumber(L, lua_tonumber(L, 1));
-      return 1;
-    }
-  }
-  else {
-    const char *s1 = luaL_checkstring(L, 1);
-    char *s2;
-    unsigned long n;
-    luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range");
-    n = strtoul(s1, &s2, base);
-    if (s1 != s2) {  /* at least one valid digit? */
-      while (isspace((unsigned char)(*s2))) s2++;  /* skip trailing spaces */
-      if (*s2 == '\0') {  /* no invalid trailing characters? */
-        lua_pushnumber(L, (lua_Number)n);
-        return 1;
-      }
-    }
-  }
-  lua_pushnil(L);  /* else not a number */
-  return 1;
-}
-
-
-static int luaB_error (lua_State *L) {
-  int level = luaL_optint(L, 2, 1);
-  lua_settop(L, 1);
-  if (lua_isstring(L, 1) && level > 0) {  /* add extra information? */
-    luaL_where(L, level);
-    lua_pushvalue(L, 1);
-    lua_concat(L, 2);
-  }
-  return lua_error(L);
-}
-
-
-static int luaB_getmetatable (lua_State *L) {
-  luaL_checkany(L, 1);
-  if (!lua_getmetatable(L, 1)) {
-    lua_pushnil(L);
-    return 1;  /* no metatable */
-  }
-  luaL_getmetafield(L, 1, "__metatable");
-  return 1;  /* returns either __metatable field (if present) or metatable */
-}
-
-
-static int luaB_setmetatable (lua_State *L) {
-  int t = lua_type(L, 2);
-  luaL_checktype(L, 1, LUA_TTABLE);
-  luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
-                    "nil or table expected");
-  if (luaL_getmetafield(L, 1, "__metatable"))
-    luaL_error(L, "cannot change a protected metatable");
-  lua_settop(L, 2);
-  lua_setmetatable(L, 1);
-  return 1;
-}
-
-
-static void getfunc (lua_State *L, int opt) {
-  if (lua_isfunction(L, 1)) lua_pushvalue(L, 1);
-  else {
-    lua_Debug ar;
-    int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1);
-    luaL_argcheck(L, level >= 0, 1, "level must be non-negative");
-    if (lua_getstack(L, level, &ar) == 0)
-      luaL_argerror(L, 1, "invalid level");
-    lua_getinfo(L, "f", &ar);
-    if (lua_isnil(L, -1))
-      luaL_error(L, "no function environment for tail call at level %d",
-                    level);
-  }
-}
-
-
-static int luaB_getfenv (lua_State *L) {
-  getfunc(L, 1);
-  if (lua_iscfunction(L, -1))  /* is a C function? */
-    lua_pushvalue(L, LUA_GLOBALSINDEX);  /* return the thread's global env. */
-  else
-    lua_getfenv(L, -1);
-  return 1;
-}
-
-
-static int luaB_setfenv (lua_State *L) {
-  luaL_checktype(L, 2, LUA_TTABLE);
-  getfunc(L, 0);
-  lua_pushvalue(L, 2);
-  if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) {
-    /* change environment of current thread */
-    lua_pushthread(L);
-    lua_insert(L, -2);
-    lua_setfenv(L, -2);
-    return 0;
-  }
-  else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)
-    luaL_error(L,
-          LUA_QL("setfenv") " cannot change environment of given object");
-  return 1;
-}
-
-
-static int luaB_rawequal (lua_State *L) {
-  luaL_checkany(L, 1);
-  luaL_checkany(L, 2);
-  lua_pushboolean(L, lua_rawequal(L, 1, 2));
-  return 1;
-}
-
-
-static int luaB_rawget (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  luaL_checkany(L, 2);
-  lua_settop(L, 2);
-  lua_rawget(L, 1);
-  return 1;
-}
-
-static int luaB_rawset (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  luaL_checkany(L, 2);
-  luaL_checkany(L, 3);
-  lua_settop(L, 3);
-  lua_rawset(L, 1);
-  return 1;
-}
-
-
-static int luaB_gcinfo (lua_State *L) {
-  lua_pushinteger(L, lua_getgccount(L));
-  return 1;
-}
-
-
-static int luaB_collectgarbage (lua_State *L) {
-  static const char *const opts[] = {"stop", "restart", "collect",
-    "count", "step", "setpause", "setstepmul", NULL};
-  static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
-    LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL};
-  int o = luaL_checkoption(L, 1, "collect", opts);
-  int ex = luaL_optint(L, 2, 0);
-  int res = lua_gc(L, optsnum[o], ex);
-  switch (optsnum[o]) {
-    case LUA_GCCOUNT: {
-      int b = lua_gc(L, LUA_GCCOUNTB, 0);
-      lua_pushnumber(L, res + ((lua_Number)b/1024));
-      return 1;
-    }
-    case LUA_GCSTEP: {
-      lua_pushboolean(L, res);
-      return 1;
-    }
-    default: {
-      lua_pushnumber(L, res);
-      return 1;
-    }
-  }
-}
-
-
-static int luaB_type (lua_State *L) {
-  luaL_checkany(L, 1);
-  lua_pushstring(L, luaL_typename(L, 1));
-  return 1;
-}
-
-
-static int luaB_next (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  lua_settop(L, 2);  /* create a 2nd argument if there isn't one */
-  if (lua_next(L, 1))
-    return 2;
-  else {
-    lua_pushnil(L);
-    return 1;
-  }
-}
-
-
-static int luaB_pairs (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */
-  lua_pushvalue(L, 1);  /* state, */
-  lua_pushnil(L);  /* and initial value */
-  return 3;
-}
-
-
-static int ipairsaux (lua_State *L) {
-  int i = luaL_checkint(L, 2);
-  luaL_checktype(L, 1, LUA_TTABLE);
-  i++;  /* next value */
-  lua_pushinteger(L, i);
-  lua_rawgeti(L, 1, i);
-  return (lua_isnil(L, -1)) ? 0 : 2;
-}
-
-
-static int luaB_ipairs (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */
-  lua_pushvalue(L, 1);  /* state, */
-  lua_pushinteger(L, 0);  /* and initial value */
-  return 3;
-}
-
-
-static int load_aux (lua_State *L, int status) {
-  if (status == 0)  /* OK? */
-    return 1;
-  else {
-    lua_pushnil(L);
-    lua_insert(L, -2);  /* put before error message */
-    return 2;  /* return nil plus error message */
-  }
-}
-
-
-static int luaB_loadstring (lua_State *L) {
-  size_t l;
-  const char *s = luaL_checklstring(L, 1, &l);
-  const char *chunkname = luaL_optstring(L, 2, s);
-  return load_aux(L, luaL_loadbuffer(L, s, l, chunkname));
-}
-
-
-static int luaB_loadfile (lua_State *L) {
-  const char *fname = luaL_optstring(L, 1, NULL);
-  return load_aux(L, luaL_loadfile(L, fname));
-}
-
-
-/*
-** Reader for generic `load' function: `lua_load' uses the
-** stack for internal stuff, so the reader cannot change the
-** stack top. Instead, it keeps its resulting string in a
-** reserved slot inside the stack.
-*/
-static const char *generic_reader (lua_State *L, void *ud, size_t *size) {
-  (void)ud;  /* to avoid warnings */
-  luaL_checkstack(L, 2, "too many nested functions");
-  lua_pushvalue(L, 1);  /* get function */
-  lua_call(L, 0, 1);  /* call it */
-  if (lua_isnil(L, -1)) {
-    *size = 0;
-    return NULL;
-  }
-  else if (lua_isstring(L, -1)) {
-    lua_replace(L, 3);  /* save string in a reserved stack slot */
-    return lua_tolstring(L, 3, size);
-  }
-  else luaL_error(L, "reader function must return a string");
-  return NULL;  /* to avoid warnings */
-}
-
-
-static int luaB_load (lua_State *L) {
-  int status;
-  const char *cname = luaL_optstring(L, 2, "=(load)");
-  luaL_checktype(L, 1, LUA_TFUNCTION);
-  lua_settop(L, 3);  /* function, eventual name, plus one reserved slot */
-  status = lua_load(L, generic_reader, NULL, cname);
-  return load_aux(L, status);
-}
-
-
-static int luaB_dofile (lua_State *L) {
-  const char *fname = luaL_optstring(L, 1, NULL);
-  int n = lua_gettop(L);
-  if (luaL_loadfile(L, fname) != 0) lua_error(L);
-  lua_call(L, 0, LUA_MULTRET);
-  return lua_gettop(L) - n;
-}
-
-
-static int luaB_assert (lua_State *L) {
-  luaL_checkany(L, 1);
-  if (!lua_toboolean(L, 1))
-    return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!"));
-  return lua_gettop(L);
-}
-
-
-static int luaB_unpack (lua_State *L) {
-  int i, e, n;
-  luaL_checktype(L, 1, LUA_TTABLE);
-  i = luaL_optint(L, 2, 1);
-  e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));
-  if (i > e) return 0;  /* empty range */
-  n = e - i + 1;  /* number of elements */
-  if (n <= 0 || !lua_checkstack(L, n))  /* n <= 0 means arith. overflow */
-    return luaL_error(L, "too many results to unpack");
-  lua_rawgeti(L, 1, i);  /* push arg[i] (avoiding overflow problems) */
-  while (i++ < e)  /* push arg[i + 1...e] */
-    lua_rawgeti(L, 1, i);
-  return n;
-}
-
-
-static int luaB_select (lua_State *L) {
-  int n = lua_gettop(L);
-  if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
-    lua_pushinteger(L, n-1);
-    return 1;
-  }
-  else {
-    int i = luaL_checkint(L, 1);
-    if (i < 0) i = n + i;
-    else if (i > n) i = n;
-    luaL_argcheck(L, 1 <= i, 1, "index out of range");
-    return n - i;
-  }
-}
-
-
-static int luaB_pcall (lua_State *L) {
-  int status;
-  luaL_checkany(L, 1);
-  status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0);
-  lua_pushboolean(L, (status == 0));
-  lua_insert(L, 1);
-  return lua_gettop(L);  /* return status + all results */
-}
-
-
-static int luaB_xpcall (lua_State *L) {
-  int status;
-  luaL_checkany(L, 2);
-  lua_settop(L, 2);
-  lua_insert(L, 1);  /* put error function under function to be called */
-  status = lua_pcall(L, 0, LUA_MULTRET, 1);
-  lua_pushboolean(L, (status == 0));
-  lua_replace(L, 1);
-  return lua_gettop(L);  /* return status + all results */
-}
-
-
-static int luaB_tostring (lua_State *L) {
-  luaL_checkany(L, 1);
-  if (luaL_callmeta(L, 1, "__tostring"))  /* is there a metafield? */
-    return 1;  /* use its value */
-  switch (lua_type(L, 1)) {
-    case LUA_TNUMBER:
-      lua_pushstring(L, lua_tostring(L, 1));
-      break;
-    case LUA_TSTRING:
-      lua_pushvalue(L, 1);
-      break;
-    case LUA_TBOOLEAN:
-      lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false"));
-      break;
-    case LUA_TNIL:
-      lua_pushliteral(L, "nil");
-      break;
-    default:
-      lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1));
-      break;
-  }
-  return 1;
-}
-
-
-static int luaB_newproxy (lua_State *L) {
-  lua_settop(L, 1);
-  lua_newuserdata(L, 0);  /* create proxy */
-  if (lua_toboolean(L, 1) == 0)
-    return 1;  /* no metatable */
-  else if (lua_isboolean(L, 1)) {
-    lua_newtable(L);  /* create a new metatable `m' ... */
-    lua_pushvalue(L, -1);  /* ... and mark `m' as a valid metatable */
-    lua_pushboolean(L, 1);
-    lua_rawset(L, lua_upvalueindex(1));  /* weaktable[m] = true */
-  }
-  else {
-    int validproxy = 0;  /* to check if weaktable[metatable(u)] == true */
-    if (lua_getmetatable(L, 1)) {
-      lua_rawget(L, lua_upvalueindex(1));
-      validproxy = lua_toboolean(L, -1);
-      lua_pop(L, 1);  /* remove value */
-    }
-    luaL_argcheck(L, validproxy, 1, "boolean or proxy expected");
-    lua_getmetatable(L, 1);  /* metatable is valid; get it */
-  }
-  lua_setmetatable(L, 2);
-  return 1;
-}
-
-
-static const luaL_Reg base_funcs[] = {
-  {"assert", luaB_assert},
-  {"collectgarbage", luaB_collectgarbage},
-  {"dofile", luaB_dofile},
-  {"error", luaB_error},
-  {"gcinfo", luaB_gcinfo},
-  {"getfenv", luaB_getfenv},
-  {"getmetatable", luaB_getmetatable},
-  {"loadfile", luaB_loadfile},
-  {"load", luaB_load},
-  {"loadstring", luaB_loadstring},
-  {"next", luaB_next},
-  {"pcall", luaB_pcall},
-  {"print", luaB_print},
-  {"rawequal", luaB_rawequal},
-  {"rawget", luaB_rawget},
-  {"rawset", luaB_rawset},
-  {"select", luaB_select},
-  {"setfenv", luaB_setfenv},
-  {"setmetatable", luaB_setmetatable},
-  {"tonumber", luaB_tonumber},
-  {"tostring", luaB_tostring},
-  {"type", luaB_type},
-  {"unpack", luaB_unpack},
-  {"xpcall", luaB_xpcall},
-  {NULL, NULL}
-};
-
-
-/*
-** {======================================================
-** Coroutine library
-** =======================================================
-*/
-
-#define CO_RUN	0	/* running */
-#define CO_SUS	1	/* suspended */
-#define CO_NOR	2	/* 'normal' (it resumed another coroutine) */
-#define CO_DEAD	3
-
-static const char *const statnames[] =
-    {"running", "suspended", "normal", "dead"};
-
-static int costatus (lua_State *L, lua_State *co) {
-  if (L == co) return CO_RUN;
-  switch (lua_status(co)) {
-    case LUA_YIELD:
-      return CO_SUS;
-    case 0: {
-      lua_Debug ar;
-      if (lua_getstack(co, 0, &ar) > 0)  /* does it have frames? */
-        return CO_NOR;  /* it is running */
-      else if (lua_gettop(co) == 0)
-          return CO_DEAD;
-      else
-        return CO_SUS;  /* initial state */
-    }
-    default:  /* some error occured */
-      return CO_DEAD;
-  }
-}
-
-
-static int luaB_costatus (lua_State *L) {
-  lua_State *co = lua_tothread(L, 1);
-  luaL_argcheck(L, co, 1, "coroutine expected");
-  lua_pushstring(L, statnames[costatus(L, co)]);
-  return 1;
-}
-
-
-static int auxresume (lua_State *L, lua_State *co, int narg) {
-  int status = costatus(L, co);
-  if (!lua_checkstack(co, narg))
-    luaL_error(L, "too many arguments to resume");
-  if (status != CO_SUS) {
-    lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]);
-    return -1;  /* error flag */
-  }
-  lua_xmove(L, co, narg);
-  lua_setlevel(L, co);
-  status = lua_resume(co, narg);
-  if (status == 0 || status == LUA_YIELD) {
-    int nres = lua_gettop(co);
-    if (!lua_checkstack(L, nres + 1))
-      luaL_error(L, "too many results to resume");
-    lua_xmove(co, L, nres);  /* move yielded values */
-    return nres;
-  }
-  else {
-    lua_xmove(co, L, 1);  /* move error message */
-    return -1;  /* error flag */
-  }
-}
-
-
-static int luaB_coresume (lua_State *L) {
-  lua_State *co = lua_tothread(L, 1);
-  int r;
-  luaL_argcheck(L, co, 1, "coroutine expected");
-  r = auxresume(L, co, lua_gettop(L) - 1);
-  if (r < 0) {
-    lua_pushboolean(L, 0);
-    lua_insert(L, -2);
-    return 2;  /* return false + error message */
-  }
-  else {
-    lua_pushboolean(L, 1);
-    lua_insert(L, -(r + 1));
-    return r + 1;  /* return true + `resume' returns */
-  }
-}
-
-
-static int luaB_auxwrap (lua_State *L) {
-  lua_State *co = lua_tothread(L, lua_upvalueindex(1));
-  int r = auxresume(L, co, lua_gettop(L));
-  if (r < 0) {
-    if (lua_isstring(L, -1)) {  /* error object is a string? */
-      luaL_where(L, 1);  /* add extra info */
-      lua_insert(L, -2);
-      lua_concat(L, 2);
-    }
-    lua_error(L);  /* propagate error */
-  }
-  return r;
-}
-
-
-static int luaB_cocreate (lua_State *L) {
-  lua_State *NL = lua_newthread(L);
-  luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1,
-    "Lua function expected");
-  lua_pushvalue(L, 1);  /* move function to top */
-  lua_xmove(L, NL, 1);  /* move function from L to NL */
-  return 1;
-}
-
-
-static int luaB_cowrap (lua_State *L) {
-  luaB_cocreate(L);
-  lua_pushcclosure(L, luaB_auxwrap, 1);
-  return 1;
-}
-
-
-static int luaB_yield (lua_State *L) {
-  return lua_yield(L, lua_gettop(L));
-}
-
-
-static int luaB_corunning (lua_State *L) {
-  if (lua_pushthread(L))
-    lua_pushnil(L);  /* main thread is not a coroutine */
-  return 1;
-}
-
-
-static const luaL_Reg co_funcs[] = {
-  {"create", luaB_cocreate},
-  {"resume", luaB_coresume},
-  {"running", luaB_corunning},
-  {"status", luaB_costatus},
-  {"wrap", luaB_cowrap},
-  {"yield", luaB_yield},
-  {NULL, NULL}
-};
-
-/* }====================================================== */
-
-
-static void auxopen (lua_State *L, const char *name,
-                     lua_CFunction f, lua_CFunction u) {
-  lua_pushcfunction(L, u);
-  lua_pushcclosure(L, f, 1);
-  lua_setfield(L, -2, name);
-}
-
-
-static void base_open (lua_State *L) {
-  /* set global _G */
-  lua_pushvalue(L, LUA_GLOBALSINDEX);
-  lua_setglobal(L, "_G");
-  /* open lib into global table */
-  luaL_register(L, "_G", base_funcs);
-  lua_pushliteral(L, LUA_VERSION);
-  lua_setglobal(L, "_VERSION");  /* set global _VERSION */
-  /* `ipairs' and `pairs' need auxliliary functions as upvalues */
-  auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
-  auxopen(L, "pairs", luaB_pairs, luaB_next);
-  /* `newproxy' needs a weaktable as upvalue */
-  lua_createtable(L, 0, 1);  /* new table `w' */
-  lua_pushvalue(L, -1);  /* `w' will be its own metatable */
-  lua_setmetatable(L, -2);
-  lua_pushliteral(L, "kv");
-  lua_setfield(L, -2, "__mode");  /* metatable(w).__mode = "kv" */
-  lua_pushcclosure(L, luaB_newproxy, 1);
-  lua_setglobal(L, "newproxy");  /* set global `newproxy' */
-}
-
-
-LUALIB_API int luaopen_base (lua_State *L) {
-  base_open(L);
-  luaL_register(L, LUA_COLIBNAME, co_funcs);
-  return 2;
-}
-
diff --git a/misc/liblua/lcode.c b/misc/liblua/lcode.c
deleted file mode 100644
index cff626b..0000000
--- a/misc/liblua/lcode.c
+++ /dev/null
@@ -1,839 +0,0 @@
-/*
-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
-** Code generator for Lua
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stdlib.h>
-
-#define lcode_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lcode.h"
-#include "ldebug.h"
-#include "ldo.h"
-#include "lgc.h"
-#include "llex.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lparser.h"
-#include "ltable.h"
-
-
-#define hasjumps(e)	((e)->t != (e)->f)
-
-
-static int isnumeral(expdesc *e) {
-  return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP);
-}
-
-
-void luaK_nil (FuncState *fs, int from, int n) {
-  Instruction *previous;
-  if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
-    if (fs->pc == 0) {  /* function start? */
-      if (from >= fs->nactvar)
-        return;  /* positions are already clean */
-    }
-    else {
-      previous = &fs->f->code[fs->pc-1];
-      if (GET_OPCODE(*previous) == OP_LOADNIL) {
-        int pfrom = GETARG_A(*previous);
-        int pto = GETARG_B(*previous);
-        if (pfrom <= from && from <= pto+1) {  /* can connect both? */
-          if (from+n-1 > pto)
-            SETARG_B(*previous, from+n-1);
-          return;
-        }
-      }
-    }
-  }
-  luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0);  /* else no optimization */
-}
-
-
-int luaK_jump (FuncState *fs) {
-  int jpc = fs->jpc;  /* save list of jumps to here */
-  int j;
-  fs->jpc = NO_JUMP;
-  j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP);
-  luaK_concat(fs, &j, jpc);  /* keep them on hold */
-  return j;
-}
-
-
-void luaK_ret (FuncState *fs, int first, int nret) {
-  luaK_codeABC(fs, OP_RETURN, first, nret+1, 0);
-}
-
-
-static int condjump (FuncState *fs, OpCode op, int A, int B, int C) {
-  luaK_codeABC(fs, op, A, B, C);
-  return luaK_jump(fs);
-}
-
-
-static void fixjump (FuncState *fs, int pc, int dest) {
-  Instruction *jmp = &fs->f->code[pc];
-  int offset = dest-(pc+1);
-  lua_assert(dest != NO_JUMP);
-  if (abs(offset) > MAXARG_sBx)
-    luaX_syntaxerror(fs->ls, "control structure too long");
-  SETARG_sBx(*jmp, offset);
-}
-
-
-/*
-** returns current `pc' and marks it as a jump target (to avoid wrong
-** optimizations with consecutive instructions not in the same basic block).
-*/
-int luaK_getlabel (FuncState *fs) {
-  fs->lasttarget = fs->pc;
-  return fs->pc;
-}
-
-
-static int getjump (FuncState *fs, int pc) {
-  int offset = GETARG_sBx(fs->f->code[pc]);
-  if (offset == NO_JUMP)  /* point to itself represents end of list */
-    return NO_JUMP;  /* end of list */
-  else
-    return (pc+1)+offset;  /* turn offset into absolute position */
-}
-
-
-static Instruction *getjumpcontrol (FuncState *fs, int pc) {
-  Instruction *pi = &fs->f->code[pc];
-  if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))
-    return pi-1;
-  else
-    return pi;
-}
-
-
-/*
-** check whether list has any jump that do not produce a value
-** (or produce an inverted value)
-*/
-static int need_value (FuncState *fs, int list) {
-  for (; list != NO_JUMP; list = getjump(fs, list)) {
-    Instruction i = *getjumpcontrol(fs, list);
-    if (GET_OPCODE(i) != OP_TESTSET) return 1;
-  }
-  return 0;  /* not found */
-}
-
-
-static int patchtestreg (FuncState *fs, int node, int reg) {
-  Instruction *i = getjumpcontrol(fs, node);
-  if (GET_OPCODE(*i) != OP_TESTSET)
-    return 0;  /* cannot patch other instructions */
-  if (reg != NO_REG && reg != GETARG_B(*i))
-    SETARG_A(*i, reg);
-  else  /* no register to put value or register already has the value */
-    *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
-
-  return 1;
-}
-
-
-static void removevalues (FuncState *fs, int list) {
-  for (; list != NO_JUMP; list = getjump(fs, list))
-      patchtestreg(fs, list, NO_REG);
-}
-
-
-static void patchlistaux (FuncState *fs, int list, int vtarget, int reg,
-                          int dtarget) {
-  while (list != NO_JUMP) {
-    int next = getjump(fs, list);
-    if (patchtestreg(fs, list, reg))
-      fixjump(fs, list, vtarget);
-    else
-      fixjump(fs, list, dtarget);  /* jump to default target */
-    list = next;
-  }
-}
-
-
-static void dischargejpc (FuncState *fs) {
-  patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc);
-  fs->jpc = NO_JUMP;
-}
-
-
-void luaK_patchlist (FuncState *fs, int list, int target) {
-  if (target == fs->pc)
-    luaK_patchtohere(fs, list);
-  else {
-    lua_assert(target < fs->pc);
-    patchlistaux(fs, list, target, NO_REG, target);
-  }
-}
-
-
-void luaK_patchtohere (FuncState *fs, int list) {
-  luaK_getlabel(fs);
-  luaK_concat(fs, &fs->jpc, list);
-}
-
-
-void luaK_concat (FuncState *fs, int *l1, int l2) {
-  if (l2 == NO_JUMP) return;
-  else if (*l1 == NO_JUMP)
-    *l1 = l2;
-  else {
-    int list = *l1;
-    int next;
-    while ((next = getjump(fs, list)) != NO_JUMP)  /* find last element */
-      list = next;
-    fixjump(fs, list, l2);
-  }
-}
-
-
-void luaK_checkstack (FuncState *fs, int n) {
-  int newstack = fs->freereg + n;
-  if (newstack > fs->f->maxstacksize) {
-    if (newstack >= MAXSTACK)
-      luaX_syntaxerror(fs->ls, "function or expression too complex");
-    fs->f->maxstacksize = cast_byte(newstack);
-  }
-}
-
-
-void luaK_reserveregs (FuncState *fs, int n) {
-  luaK_checkstack(fs, n);
-  fs->freereg += n;
-}
-
-
-static void freereg (FuncState *fs, int reg) {
-  if (!ISK(reg) && reg >= fs->nactvar) {
-    fs->freereg--;
-    lua_assert(reg == fs->freereg);
-  }
-}
-
-
-static void freeexp (FuncState *fs, expdesc *e) {
-  if (e->k == VNONRELOC)
-    freereg(fs, e->u.s.info);
-}
-
-
-static int addk (FuncState *fs, TValue *k, TValue *v) {
-  lua_State *L = fs->L;
-  TValue *idx = luaH_set(L, fs->h, k);
-  Proto *f = fs->f;
-  int oldsize = f->sizek;
-  if (ttisnumber(idx)) {
-    lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));
-    return cast_int(nvalue(idx));
-  }
-  else {  /* constant not found; create a new entry */
-    setnvalue(idx, cast_num(fs->nk));
-    luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,
-                    MAXARG_Bx, "constant table overflow");
-    while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);
-    setobj(L, &f->k[fs->nk], v);
-    luaC_barrier(L, f, v);
-    return fs->nk++;
-  }
-}
-
-
-int luaK_stringK (FuncState *fs, TString *s) {
-  TValue o;
-  setsvalue(fs->L, &o, s);
-  return addk(fs, &o, &o);
-}
-
-
-int luaK_numberK (FuncState *fs, lua_Number r) {
-  TValue o;
-  setnvalue(&o, r);
-  return addk(fs, &o, &o);
-}
-
-
-static int boolK (FuncState *fs, int b) {
-  TValue o;
-  setbvalue(&o, b);
-  return addk(fs, &o, &o);
-}
-
-
-static int nilK (FuncState *fs) {
-  TValue k, v;
-  setnilvalue(&v);
-  /* cannot use nil as key; instead use table itself to represent nil */
-  sethvalue(fs->L, &k, fs->h);
-  return addk(fs, &k, &v);
-}
-
-
-void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
-  if (e->k == VCALL) {  /* expression is an open function call? */
-    SETARG_C(getcode(fs, e), nresults+1);
-  }
-  else if (e->k == VVARARG) {
-    SETARG_B(getcode(fs, e), nresults+1);
-    SETARG_A(getcode(fs, e), fs->freereg);
-    luaK_reserveregs(fs, 1);
-  }
-}
-
-
-void luaK_setoneret (FuncState *fs, expdesc *e) {
-  if (e->k == VCALL) {  /* expression is an open function call? */
-    e->k = VNONRELOC;
-    e->u.s.info = GETARG_A(getcode(fs, e));
-  }
-  else if (e->k == VVARARG) {
-    SETARG_B(getcode(fs, e), 2);
-    e->k = VRELOCABLE;  /* can relocate its simple result */
-  }
-}
-
-
-void luaK_dischargevars (FuncState *fs, expdesc *e) {
-  switch (e->k) {
-    case VLOCAL: {
-      e->k = VNONRELOC;
-      break;
-    }
-    case VUPVAL: {
-      e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0);
-      e->k = VRELOCABLE;
-      break;
-    }
-    case VGLOBAL: {
-      e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);
-      e->k = VRELOCABLE;
-      break;
-    }
-    case VINDEXED: {
-      freereg(fs, e->u.s.aux);
-      freereg(fs, e->u.s.info);
-      e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux);
-      e->k = VRELOCABLE;
-      break;
-    }
-    case VVARARG:
-    case VCALL: {
-      luaK_setoneret(fs, e);
-      break;
-    }
-    default: break;  /* there is one value available (somewhere) */
-  }
-}
-
-
-static int code_label (FuncState *fs, int A, int b, int jump) {
-  luaK_getlabel(fs);  /* those instructions may be jump targets */
-  return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);
-}
-
-
-static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
-  luaK_dischargevars(fs, e);
-  switch (e->k) {
-    case VNIL: {
-      luaK_nil(fs, reg, 1);
-      break;
-    }
-    case VFALSE:  case VTRUE: {
-      luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0);
-      break;
-    }
-    case VK: {
-      luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info);
-      break;
-    }
-    case VKNUM: {
-      luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval));
-      break;
-    }
-    case VRELOCABLE: {
-      Instruction *pc = &getcode(fs, e);
-      SETARG_A(*pc, reg);
-      break;
-    }
-    case VNONRELOC: {
-      if (reg != e->u.s.info)
-        luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0);
-      break;
-    }
-    default: {
-      lua_assert(e->k == VVOID || e->k == VJMP);
-      return;  /* nothing to do... */
-    }
-  }
-  e->u.s.info = reg;
-  e->k = VNONRELOC;
-}
-
-
-static void discharge2anyreg (FuncState *fs, expdesc *e) {
-  if (e->k != VNONRELOC) {
-    luaK_reserveregs(fs, 1);
-    discharge2reg(fs, e, fs->freereg-1);
-  }
-}
-
-
-static void exp2reg (FuncState *fs, expdesc *e, int reg) {
-  discharge2reg(fs, e, reg);
-  if (e->k == VJMP)
-    luaK_concat(fs, &e->t, e->u.s.info);  /* put this jump in `t' list */
-  if (hasjumps(e)) {
-    int final;  /* position after whole expression */
-    int p_f = NO_JUMP;  /* position of an eventual LOAD false */
-    int p_t = NO_JUMP;  /* position of an eventual LOAD true */
-    if (need_value(fs, e->t) || need_value(fs, e->f)) {
-      int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
-      p_f = code_label(fs, reg, 0, 1);
-      p_t = code_label(fs, reg, 1, 0);
-      luaK_patchtohere(fs, fj);
-    }
-    final = luaK_getlabel(fs);
-    patchlistaux(fs, e->f, final, reg, p_f);
-    patchlistaux(fs, e->t, final, reg, p_t);
-  }
-  e->f = e->t = NO_JUMP;
-  e->u.s.info = reg;
-  e->k = VNONRELOC;
-}
-
-
-void luaK_exp2nextreg (FuncState *fs, expdesc *e) {
-  luaK_dischargevars(fs, e);
-  freeexp(fs, e);
-  luaK_reserveregs(fs, 1);
-  exp2reg(fs, e, fs->freereg - 1);
-}
-
-
-int luaK_exp2anyreg (FuncState *fs, expdesc *e) {
-  luaK_dischargevars(fs, e);
-  if (e->k == VNONRELOC) {
-    if (!hasjumps(e)) return e->u.s.info;  /* exp is already in a register */
-    if (e->u.s.info >= fs->nactvar) {  /* reg. is not a local? */
-      exp2reg(fs, e, e->u.s.info);  /* put value on it */
-      return e->u.s.info;
-    }
-  }
-  luaK_exp2nextreg(fs, e);  /* default */
-  return e->u.s.info;
-}
-
-
-void luaK_exp2val (FuncState *fs, expdesc *e) {
-  if (hasjumps(e))
-    luaK_exp2anyreg(fs, e);
-  else
-    luaK_dischargevars(fs, e);
-}
-
-
-int luaK_exp2RK (FuncState *fs, expdesc *e) {
-  luaK_exp2val(fs, e);
-  switch (e->k) {
-    case VKNUM:
-    case VTRUE:
-    case VFALSE:
-    case VNIL: {
-      if (fs->nk <= MAXINDEXRK) {  /* constant fit in RK operand? */
-        e->u.s.info = (e->k == VNIL)  ? nilK(fs) :
-                      (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
-                                        boolK(fs, (e->k == VTRUE));
-        e->k = VK;
-        return RKASK(e->u.s.info);
-      }
-      else break;
-    }
-    case VK: {
-      if (e->u.s.info <= MAXINDEXRK)  /* constant fit in argC? */
-        return RKASK(e->u.s.info);
-      else break;
-    }
-    default: break;
-  }
-  /* not a constant in the right range: put it in a register */
-  return luaK_exp2anyreg(fs, e);
-}
-
-
-void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {
-  switch (var->k) {
-    case VLOCAL: {
-      freeexp(fs, ex);
-      exp2reg(fs, ex, var->u.s.info);
-      return;
-    }
-    case VUPVAL: {
-      int e = luaK_exp2anyreg(fs, ex);
-      luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0);
-      break;
-    }
-    case VGLOBAL: {
-      int e = luaK_exp2anyreg(fs, ex);
-      luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);
-      break;
-    }
-    case VINDEXED: {
-      int e = luaK_exp2RK(fs, ex);
-      luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e);
-      break;
-    }
-    default: {
-      lua_assert(0);  /* invalid var kind to store */
-      break;
-    }
-  }
-  freeexp(fs, ex);
-}
-
-
-void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {
-  int func;
-  luaK_exp2anyreg(fs, e);
-  freeexp(fs, e);
-  func = fs->freereg;
-  luaK_reserveregs(fs, 2);
-  luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key));
-  freeexp(fs, key);
-  e->u.s.info = func;
-  e->k = VNONRELOC;
-}
-
-
-static void invertjump (FuncState *fs, expdesc *e) {
-  Instruction *pc = getjumpcontrol(fs, e->u.s.info);
-  lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET &&
-                                           GET_OPCODE(*pc) != OP_TEST);
-  SETARG_A(*pc, !(GETARG_A(*pc)));
-}
-
-
-static int jumponcond (FuncState *fs, expdesc *e, int cond) {
-  if (e->k == VRELOCABLE) {
-    Instruction ie = getcode(fs, e);
-    if (GET_OPCODE(ie) == OP_NOT) {
-      fs->pc--;  /* remove previous OP_NOT */
-      return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond);
-    }
-    /* else go through */
-  }
-  discharge2anyreg(fs, e);
-  freeexp(fs, e);
-  return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond);
-}
-
-
-void luaK_goiftrue (FuncState *fs, expdesc *e) {
-  int pc;  /* pc of last jump */
-  luaK_dischargevars(fs, e);
-  switch (e->k) {
-    case VK: case VKNUM: case VTRUE: {
-      pc = NO_JUMP;  /* always true; do nothing */
-      break;
-    }
-    case VFALSE: {
-      pc = luaK_jump(fs);  /* always jump */
-      break;
-    }
-    case VJMP: {
-      invertjump(fs, e);
-      pc = e->u.s.info;
-      break;
-    }
-    default: {
-      pc = jumponcond(fs, e, 0);
-      break;
-    }
-  }
-  luaK_concat(fs, &e->f, pc);  /* insert last jump in `f' list */
-  luaK_patchtohere(fs, e->t);
-  e->t = NO_JUMP;
-}
-
-
-static void luaK_goiffalse (FuncState *fs, expdesc *e) {
-  int pc;  /* pc of last jump */
-  luaK_dischargevars(fs, e);
-  switch (e->k) {
-    case VNIL: case VFALSE: {
-      pc = NO_JUMP;  /* always false; do nothing */
-      break;
-    }
-    case VTRUE: {
-      pc = luaK_jump(fs);  /* always jump */
-      break;
-    }
-    case VJMP: {
-      pc = e->u.s.info;
-      break;
-    }
-    default: {
-      pc = jumponcond(fs, e, 1);
-      break;
-    }
-  }
-  luaK_concat(fs, &e->t, pc);  /* insert last jump in `t' list */
-  luaK_patchtohere(fs, e->f);
-  e->f = NO_JUMP;
-}
-
-
-static void codenot (FuncState *fs, expdesc *e) {
-  luaK_dischargevars(fs, e);
-  switch (e->k) {
-    case VNIL: case VFALSE: {
-      e->k = VTRUE;
-      break;
-    }
-    case VK: case VKNUM: case VTRUE: {
-      e->k = VFALSE;
-      break;
-    }
-    case VJMP: {
-      invertjump(fs, e);
-      break;
-    }
-    case VRELOCABLE:
-    case VNONRELOC: {
-      discharge2anyreg(fs, e);
-      freeexp(fs, e);
-      e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0);
-      e->k = VRELOCABLE;
-      break;
-    }
-    default: {
-      lua_assert(0);  /* cannot happen */
-      break;
-    }
-  }
-  /* interchange true and false lists */
-  { int temp = e->f; e->f = e->t; e->t = temp; }
-  removevalues(fs, e->f);
-  removevalues(fs, e->t);
-}
-
-
-void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
-  t->u.s.aux = luaK_exp2RK(fs, k);
-  t->k = VINDEXED;
-}
-
-
-static int constfolding (OpCode op, expdesc *e1, expdesc *e2) {
-  lua_Number v1, v2, r;
-  if (!isnumeral(e1) || !isnumeral(e2)) return 0;
-  v1 = e1->u.nval;
-  v2 = e2->u.nval;
-  switch (op) {
-    case OP_ADD: r = luai_numadd(v1, v2); break;
-    case OP_SUB: r = luai_numsub(v1, v2); break;
-    case OP_MUL: r = luai_nummul(v1, v2); break;
-    case OP_DIV:
-      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */
-      r = luai_numdiv(v1, v2); break;
-    case OP_MOD:
-      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */
-      r = luai_nummod(v1, v2); break;
-    case OP_POW: r = luai_numpow(v1, v2); break;
-    case OP_UNM: r = luai_numunm(v1); break;
-    case OP_LEN: return 0;  /* no constant folding for 'len' */
-    default: lua_assert(0); r = 0; break;
-  }
-  if (luai_numisnan(r)) return 0;  /* do not attempt to produce NaN */
-  e1->u.nval = r;
-  return 1;
-}
-
-
-static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {
-  if (constfolding(op, e1, e2))
-    return;
-  else {
-    int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0;
-    int o1 = luaK_exp2RK(fs, e1);
-    if (o1 > o2) {
-      freeexp(fs, e1);
-      freeexp(fs, e2);
-    }
-    else {
-      freeexp(fs, e2);
-      freeexp(fs, e1);
-    }
-    e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2);
-    e1->k = VRELOCABLE;
-  }
-}
-
-
-static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,
-                                                          expdesc *e2) {
-  int o1 = luaK_exp2RK(fs, e1);
-  int o2 = luaK_exp2RK(fs, e2);
-  freeexp(fs, e2);
-  freeexp(fs, e1);
-  if (cond == 0 && op != OP_EQ) {
-    int temp;  /* exchange args to replace by `<' or `<=' */
-    temp = o1; o1 = o2; o2 = temp;  /* o1 <==> o2 */
-    cond = 1;
-  }
-  e1->u.s.info = condjump(fs, op, cond, o1, o2);
-  e1->k = VJMP;
-}
-
-
-void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
-  expdesc e2;
-  e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
-  switch (op) {
-    case OPR_MINUS: {
-      if (!isnumeral(e))
-        luaK_exp2anyreg(fs, e);  /* cannot operate on non-numeric constants */
-      codearith(fs, OP_UNM, e, &e2);
-      break;
-    }
-    case OPR_NOT: codenot(fs, e); break;
-    case OPR_LEN: {
-      luaK_exp2anyreg(fs, e);  /* cannot operate on constants */
-      codearith(fs, OP_LEN, e, &e2);
-      break;
-    }
-    default: lua_assert(0);
-  }
-}
-
-
-void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {
-  switch (op) {
-    case OPR_AND: {
-      luaK_goiftrue(fs, v);
-      break;
-    }
-    case OPR_OR: {
-      luaK_goiffalse(fs, v);
-      break;
-    }
-    case OPR_CONCAT: {
-      luaK_exp2nextreg(fs, v);  /* operand must be on the `stack' */
-      break;
-    }
-    case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV:
-    case OPR_MOD: case OPR_POW: {
-      if (!isnumeral(v)) luaK_exp2RK(fs, v);
-      break;
-    }
-    default: {
-      luaK_exp2RK(fs, v);
-      break;
-    }
-  }
-}
-
-
-void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {
-  switch (op) {
-    case OPR_AND: {
-      lua_assert(e1->t == NO_JUMP);  /* list must be closed */
-      luaK_dischargevars(fs, e2);
-      luaK_concat(fs, &e2->f, e1->f);
-      *e1 = *e2;
-      break;
-    }
-    case OPR_OR: {
-      lua_assert(e1->f == NO_JUMP);  /* list must be closed */
-      luaK_dischargevars(fs, e2);
-      luaK_concat(fs, &e2->t, e1->t);
-      *e1 = *e2;
-      break;
-    }
-    case OPR_CONCAT: {
-      luaK_exp2val(fs, e2);
-      if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) {
-        lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1);
-        freeexp(fs, e1);
-        SETARG_B(getcode(fs, e2), e1->u.s.info);
-        e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info;
-      }
-      else {
-        luaK_exp2nextreg(fs, e2);  /* operand must be on the 'stack' */
-        codearith(fs, OP_CONCAT, e1, e2);
-      }
-      break;
-    }
-    case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break;
-    case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break;
-    case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break;
-    case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break;
-    case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break;
-    case OPR_POW: codearith(fs, OP_POW, e1, e2); break;
-    case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break;
-    case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break;
-    case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break;
-    case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break;
-    case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break;
-    case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break;
-    default: lua_assert(0);
-  }
-}
-
-
-void luaK_fixline (FuncState *fs, int line) {
-  fs->f->lineinfo[fs->pc - 1] = line;
-}
-
-
-static int luaK_code (FuncState *fs, Instruction i, int line) {
-  Proto *f = fs->f;
-  dischargejpc(fs);  /* `pc' will change */
-  /* put new instruction in code array */
-  luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction,
-                  MAX_INT, "code size overflow");
-  f->code[fs->pc] = i;
-  /* save corresponding line information */
-  luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int,
-                  MAX_INT, "code size overflow");
-  f->lineinfo[fs->pc] = line;
-  return fs->pc++;
-}
-
-
-int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) {
-  lua_assert(getOpMode(o) == iABC);
-  lua_assert(getBMode(o) != OpArgN || b == 0);
-  lua_assert(getCMode(o) != OpArgN || c == 0);
-  return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline);
-}
-
-
-int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) {
-  lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx);
-  lua_assert(getCMode(o) == OpArgN);
-  return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline);
-}
-
-
-void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {
-  int c =  (nelems - 1)/LFIELDS_PER_FLUSH + 1;
-  int b = (tostore == LUA_MULTRET) ? 0 : tostore;
-  lua_assert(tostore != 0);
-  if (c <= MAXARG_C)
-    luaK_codeABC(fs, OP_SETLIST, base, b, c);
-  else {
-    luaK_codeABC(fs, OP_SETLIST, base, b, 0);
-    luaK_code(fs, cast(Instruction, c), fs->ls->lastline);
-  }
-  fs->freereg = base + 1;  /* free registers with list values */
-}
-
diff --git a/misc/liblua/lcode.h b/misc/liblua/lcode.h
deleted file mode 100644
index b941c60..0000000
--- a/misc/liblua/lcode.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
-** Code generator for Lua
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lcode_h
-#define lcode_h
-
-#include "llex.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lparser.h"
-
-
-/*
-** Marks the end of a patch list. It is an invalid value both as an absolute
-** address, and as a list link (would link an element to itself).
-*/
-#define NO_JUMP (-1)
-
-
-/*
-** grep "ORDER OPR" if you change these enums
-*/
-typedef enum BinOpr {
-  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
-  OPR_CONCAT,
-  OPR_NE, OPR_EQ,
-  OPR_LT, OPR_LE, OPR_GT, OPR_GE,
-  OPR_AND, OPR_OR,
-  OPR_NOBINOPR
-} BinOpr;
-
-
-typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
-
-
-#define getcode(fs,e)	((fs)->f->code[(e)->u.s.info])
-
-#define luaK_codeAsBx(fs,o,A,sBx)	luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
-
-#define luaK_setmultret(fs,e)	luaK_setreturns(fs, e, LUA_MULTRET)
-
-LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
-LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
-LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
-LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
-LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
-LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
-LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
-LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
-LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
-LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
-LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
-LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
-LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
-LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
-LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
-LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
-LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
-LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
-LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
-LUAI_FUNC int luaK_jump (FuncState *fs);
-LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
-LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
-LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
-LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
-LUAI_FUNC int luaK_getlabel (FuncState *fs);
-LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
-LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
-LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
-LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
-
-
-#endif
diff --git a/misc/liblua/ldblib.c b/misc/liblua/ldblib.c
deleted file mode 100644
index 5e1314e..0000000
--- a/misc/liblua/ldblib.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
-** Interface from Lua to its debug API
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define ldblib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-
-static int db_getregistry (lua_State *L) {
-  lua_pushvalue(L, LUA_REGISTRYINDEX);
-  return 1;
-}
-
-
-static int db_getmetatable (lua_State *L) {
-  luaL_checkany(L, 1);
-  if (!lua_getmetatable(L, 1)) {
-    lua_pushnil(L);  /* no metatable */
-  }
-  return 1;
-}
-
-
-static int db_setmetatable (lua_State *L) {
-  int t = lua_type(L, 2);
-  luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
-                    "nil or table expected");
-  lua_settop(L, 2);
-  lua_pushboolean(L, lua_setmetatable(L, 1));
-  return 1;
-}
-
-
-static int db_getfenv (lua_State *L) {
-  lua_getfenv(L, 1);
-  return 1;
-}
-
-
-static int db_setfenv (lua_State *L) {
-  luaL_checktype(L, 2, LUA_TTABLE);
-  lua_settop(L, 2);
-  if (lua_setfenv(L, 1) == 0)
-    luaL_error(L, LUA_QL("setfenv")
-                  " cannot change environment of given object");
-  return 1;
-}
-
-
-static void settabss (lua_State *L, const char *i, const char *v) {
-  lua_pushstring(L, v);
-  lua_setfield(L, -2, i);
-}
-
-
-static void settabsi (lua_State *L, const char *i, int v) {
-  lua_pushinteger(L, v);
-  lua_setfield(L, -2, i);
-}
-
-
-static lua_State *getthread (lua_State *L, int *arg) {
-  if (lua_isthread(L, 1)) {
-    *arg = 1;
-    return lua_tothread(L, 1);
-  }
-  else {
-    *arg = 0;
-    return L;
-  }
-}
-
-
-static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) {
-  if (L == L1) {
-    lua_pushvalue(L, -2);
-    lua_remove(L, -3);
-  }
-  else
-    lua_xmove(L1, L, 1);
-  lua_setfield(L, -2, fname);
-}
-
-
-static int db_getinfo (lua_State *L) {
-  lua_Debug ar;
-  int arg;
-  lua_State *L1 = getthread(L, &arg);
-  const char *options = luaL_optstring(L, arg+2, "flnSu");
-  if (lua_isnumber(L, arg+1)) {
-    if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) {
-      lua_pushnil(L);  /* level out of range */
-      return 1;
-    }
-  }
-  else if (lua_isfunction(L, arg+1)) {
-    lua_pushfstring(L, ">%s", options);
-    options = lua_tostring(L, -1);
-    lua_pushvalue(L, arg+1);
-    lua_xmove(L, L1, 1);
-  }
-  else
-    return luaL_argerror(L, arg+1, "function or level expected");
-  if (!lua_getinfo(L1, options, &ar))
-    return luaL_argerror(L, arg+2, "invalid option");
-  lua_createtable(L, 0, 2);
-  if (strchr(options, 'S')) {
-    settabss(L, "source", ar.source);
-    settabss(L, "short_src", ar.short_src);
-    settabsi(L, "linedefined", ar.linedefined);
-    settabsi(L, "lastlinedefined", ar.lastlinedefined);
-    settabss(L, "what", ar.what);
-  }
-  if (strchr(options, 'l'))
-    settabsi(L, "currentline", ar.currentline);
-  if (strchr(options, 'u'))
-    settabsi(L, "nups", ar.nups);
-  if (strchr(options, 'n')) {
-    settabss(L, "name", ar.name);
-    settabss(L, "namewhat", ar.namewhat);
-  }
-  if (strchr(options, 'L'))
-    treatstackoption(L, L1, "activelines");
-  if (strchr(options, 'f'))
-    treatstackoption(L, L1, "func");
-  return 1;  /* return table */
-}
-
-
-static int db_getlocal (lua_State *L) {
-  int arg;
-  lua_State *L1 = getthread(L, &arg);
-  lua_Debug ar;
-  const char *name;
-  if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))  /* out of range? */
-    return luaL_argerror(L, arg+1, "level out of range");
-  name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));
-  if (name) {
-    lua_xmove(L1, L, 1);
-    lua_pushstring(L, name);
-    lua_pushvalue(L, -2);
-    return 2;
-  }
-  else {
-    lua_pushnil(L);
-    return 1;
-  }
-}
-
-
-static int db_setlocal (lua_State *L) {
-  int arg;
-  lua_State *L1 = getthread(L, &arg);
-  lua_Debug ar;
-  if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))  /* out of range? */
-    return luaL_argerror(L, arg+1, "level out of range");
-  luaL_checkany(L, arg+3);
-  lua_settop(L, arg+3);
-  lua_xmove(L, L1, 1);
-  lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2)));
-  return 1;
-}
-
-
-static int auxupvalue (lua_State *L, int get) {
-  const char *name;
-  int n = luaL_checkint(L, 2);
-  luaL_checktype(L, 1, LUA_TFUNCTION);
-  if (lua_iscfunction(L, 1)) return 0;  /* cannot touch C upvalues from Lua */
-  name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
-  if (name == NULL) return 0;
-  lua_pushstring(L, name);
-  lua_insert(L, -(get+1));
-  return get + 1;
-}
-
-
-static int db_getupvalue (lua_State *L) {
-  return auxupvalue(L, 1);
-}
-
-
-static int db_setupvalue (lua_State *L) {
-  luaL_checkany(L, 3);
-  return auxupvalue(L, 0);
-}
-
-
-
-static const char KEY_HOOK = 'h';
-
-
-static void hookf (lua_State *L, lua_Debug *ar) {
-  static const char *const hooknames[] =
-    {"call", "return", "line", "count", "tail return"};
-  lua_pushlightuserdata(L, (void *)&KEY_HOOK);
-  lua_rawget(L, LUA_REGISTRYINDEX);
-  lua_pushlightuserdata(L, L);
-  lua_rawget(L, -2);
-  if (lua_isfunction(L, -1)) {
-    lua_pushstring(L, hooknames[(int)ar->event]);
-    if (ar->currentline >= 0)
-      lua_pushinteger(L, ar->currentline);
-    else lua_pushnil(L);
-    lua_assert(lua_getinfo(L, "lS", ar));
-    lua_call(L, 2, 0);
-  }
-}
-
-
-static int makemask (const char *smask, int count) {
-  int mask = 0;
-  if (strchr(smask, 'c')) mask |= LUA_MASKCALL;
-  if (strchr(smask, 'r')) mask |= LUA_MASKRET;
-  if (strchr(smask, 'l')) mask |= LUA_MASKLINE;
-  if (count > 0) mask |= LUA_MASKCOUNT;
-  return mask;
-}
-
-
-static char *unmakemask (int mask, char *smask) {
-  int i = 0;
-  if (mask & LUA_MASKCALL) smask[i++] = 'c';
-  if (mask & LUA_MASKRET) smask[i++] = 'r';
-  if (mask & LUA_MASKLINE) smask[i++] = 'l';
-  smask[i] = '\0';
-  return smask;
-}
-
-
-static void gethooktable (lua_State *L) {
-  lua_pushlightuserdata(L, (void *)&KEY_HOOK);
-  lua_rawget(L, LUA_REGISTRYINDEX);
-  if (!lua_istable(L, -1)) {
-    lua_pop(L, 1);
-    lua_createtable(L, 0, 1);
-    lua_pushlightuserdata(L, (void *)&KEY_HOOK);
-    lua_pushvalue(L, -2);
-    lua_rawset(L, LUA_REGISTRYINDEX);
-  }
-}
-
-
-static int db_sethook (lua_State *L) {
-  int arg, mask, count;
-  lua_Hook func;
-  lua_State *L1 = getthread(L, &arg);
-  if (lua_isnoneornil(L, arg+1)) {
-    lua_settop(L, arg+1);
-    func = NULL; mask = 0; count = 0;  /* turn off hooks */
-  }
-  else {
-    const char *smask = luaL_checkstring(L, arg+2);
-    luaL_checktype(L, arg+1, LUA_TFUNCTION);
-    count = luaL_optint(L, arg+3, 0);
-    func = hookf; mask = makemask(smask, count);
-  }
-  gethooktable(L);
-  lua_pushlightuserdata(L, L1);
-  lua_pushvalue(L, arg+1);
-  lua_rawset(L, -3);  /* set new hook */
-  lua_pop(L, 1);  /* remove hook table */
-  lua_sethook(L1, func, mask, count);  /* set hooks */
-  return 0;
-}
-
-
-static int db_gethook (lua_State *L) {
-  int arg;
-  lua_State *L1 = getthread(L, &arg);
-  char buff[5];
-  int mask = lua_gethookmask(L1);
-  lua_Hook hook = lua_gethook(L1);
-  if (hook != NULL && hook != hookf)  /* external hook? */
-    lua_pushliteral(L, "external hook");
-  else {
-    gethooktable(L);
-    lua_pushlightuserdata(L, L1);
-    lua_rawget(L, -2);   /* get hook */
-    lua_remove(L, -2);  /* remove hook table */
-  }
-  lua_pushstring(L, unmakemask(mask, buff));
-  lua_pushinteger(L, lua_gethookcount(L1));
-  return 3;
-}
-
-
-static int db_debug (lua_State *L) {
-  for (;;) {
-    char buffer[250];
-    fputs("lua_debug> ", stderr);
-    if (fgets(buffer, sizeof(buffer), stdin) == 0 ||
-        strcmp(buffer, "cont\n") == 0)
-      return 0;
-    if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
-        lua_pcall(L, 0, 0, 0)) {
-      fputs(lua_tostring(L, -1), stderr);
-      fputs("\n", stderr);
-    }
-    lua_settop(L, 0);  /* remove eventual returns */
-  }
-}
-
-
-#define LEVELS1	12	/* size of the first part of the stack */
-#define LEVELS2	10	/* size of the second part of the stack */
-
-static int db_errorfb (lua_State *L) {
-  int level;
-  int firstpart = 1;  /* still before eventual `...' */
-  int arg;
-  lua_State *L1 = getthread(L, &arg);
-  lua_Debug ar;
-  if (lua_isnumber(L, arg+2)) {
-    level = (int)lua_tointeger(L, arg+2);
-    lua_pop(L, 1);
-  }
-  else
-    level = (L == L1) ? 1 : 0;  /* level 0 may be this own function */
-  if (lua_gettop(L) == arg)
-    lua_pushliteral(L, "");
-  else if (!lua_isstring(L, arg+1)) return 1;  /* message is not a string */
-  else lua_pushliteral(L, "\n");
-  lua_pushliteral(L, "stack traceback:");
-  while (lua_getstack(L1, level++, &ar)) {
-    if (level > LEVELS1 && firstpart) {
-      /* no more than `LEVELS2' more levels? */
-      if (!lua_getstack(L1, level+LEVELS2, &ar))
-        level--;  /* keep going */
-      else {
-        lua_pushliteral(L, "\n\t...");  /* too many levels */
-        while (lua_getstack(L1, level+LEVELS2, &ar))  /* find last levels */
-          level++;
-      }
-      firstpart = 0;
-      continue;
-    }
-    lua_pushliteral(L, "\n\t");
-    lua_getinfo(L1, "Snl", &ar);
-    lua_pushfstring(L, "%s:", ar.short_src);
-    if (ar.currentline > 0)
-      lua_pushfstring(L, "%d:", ar.currentline);
-    if (*ar.namewhat != '\0')  /* is there a name? */
-        lua_pushfstring(L, " in function " LUA_QS, ar.name);
-    else {
-      if (*ar.what == 'm')  /* main? */
-        lua_pushfstring(L, " in main chunk");
-      else if (*ar.what == 'C' || *ar.what == 't')
-        lua_pushliteral(L, " ?");  /* C function or tail call */
-      else
-        lua_pushfstring(L, " in function <%s:%d>",
-                           ar.short_src, ar.linedefined);
-    }
-    lua_concat(L, lua_gettop(L) - arg);
-  }
-  lua_concat(L, lua_gettop(L) - arg);
-  return 1;
-}
-
-
-static const luaL_Reg dblib[] = {
-  {"debug", db_debug},
-  {"getfenv", db_getfenv},
-  {"gethook", db_gethook},
-  {"getinfo", db_getinfo},
-  {"getlocal", db_getlocal},
-  {"getregistry", db_getregistry},
-  {"getmetatable", db_getmetatable},
-  {"getupvalue", db_getupvalue},
-  {"setfenv", db_setfenv},
-  {"sethook", db_sethook},
-  {"setlocal", db_setlocal},
-  {"setmetatable", db_setmetatable},
-  {"setupvalue", db_setupvalue},
-  {"traceback", db_errorfb},
-  {NULL, NULL}
-};
-
-
-LUALIB_API int luaopen_debug (lua_State *L) {
-  luaL_register(L, LUA_DBLIBNAME, dblib);
-  return 1;
-}
-
diff --git a/misc/liblua/ldo.c b/misc/liblua/ldo.c
deleted file mode 100644
index 7cac000..0000000
--- a/misc/liblua/ldo.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
-** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $
-** Stack and Call structure of Lua
-** See Copyright Notice in lua.h
-*/
-
-
-#include <setjmp.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define ldo_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lparser.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-#include "lundump.h"
-#include "lvm.h"
-#include "lzio.h"
-
-
-
-
-/*
-** {======================================================
-** Error-recovery functions
-** =======================================================
-*/
-
-
-/* chain list of long jump buffers */
-struct lua_longjmp {
-  struct lua_longjmp *previous;
-  luai_jmpbuf b;
-  volatile int status;  /* error code */
-};
-
-
-void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {
-  switch (errcode) {
-    case LUA_ERRMEM: {
-      setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG));
-      break;
-    }
-    case LUA_ERRERR: {
-      setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling"));
-      break;
-    }
-    case LUA_ERRSYNTAX:
-    case LUA_ERRRUN: {
-      setobjs2s(L, oldtop, L->top - 1);  /* error message on current top */
-      break;
-    }
-  }
-  L->top = oldtop + 1;
-}
-
-
-static void restore_stack_limit (lua_State *L) {
-  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);
-  if (L->size_ci > LUAI_MAXCALLS) {  /* there was an overflow? */
-    int inuse = cast_int(L->ci - L->base_ci);
-    if (inuse + 1 < LUAI_MAXCALLS)  /* can `undo' overflow? */
-      luaD_reallocCI(L, LUAI_MAXCALLS);
-  }
-}
-
-
-static void resetstack (lua_State *L, int status) {
-  L->ci = L->base_ci;
-  L->base = L->ci->base;
-  luaF_close(L, L->base);  /* close eventual pending closures */
-  luaD_seterrorobj(L, status, L->base);
-  L->nCcalls = L->baseCcalls;
-  L->allowhook = 1;
-  restore_stack_limit(L);
-  L->errfunc = 0;
-  L->errorJmp = NULL;
-}
-
-
-void luaD_throw (lua_State *L, int errcode) {
-  if (L->errorJmp) {
-    L->errorJmp->status = errcode;
-    LUAI_THROW(L, L->errorJmp);
-  }
-  else {
-    L->status = cast_byte(errcode);
-    if (G(L)->panic) {
-      resetstack(L, errcode);
-      lua_unlock(L);
-      G(L)->panic(L);
-    }
-    exit(EXIT_FAILURE);
-  }
-}
-
-
-int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
-  struct lua_longjmp lj;
-  lj.status = 0;
-  lj.previous = L->errorJmp;  /* chain new error handler */
-  L->errorJmp = &lj;
-  LUAI_TRY(L, &lj,
-    (*f)(L, ud);
-  );
-  L->errorJmp = lj.previous;  /* restore old error handler */
-  return lj.status;
-}
-
-/* }====================================================== */
-
-
-static void correctstack (lua_State *L, TValue *oldstack) {
-  CallInfo *ci;
-  GCObject *up;
-  L->top = (L->top - oldstack) + L->stack;
-  for (up = L->openupval; up != NULL; up = up->gch.next)
-    gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack;
-  for (ci = L->base_ci; ci <= L->ci; ci++) {
-    ci->top = (ci->top - oldstack) + L->stack;
-    ci->base = (ci->base - oldstack) + L->stack;
-    ci->func = (ci->func - oldstack) + L->stack;
-  }
-  L->base = (L->base - oldstack) + L->stack;
-}
-
-
-void luaD_reallocstack (lua_State *L, int newsize) {
-  TValue *oldstack = L->stack;
-  int realsize = newsize + 1 + EXTRA_STACK;
-  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);
-  luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue);
-  L->stacksize = realsize;
-  L->stack_last = L->stack+newsize;
-  correctstack(L, oldstack);
-}
-
-
-void luaD_reallocCI (lua_State *L, int newsize) {
-  CallInfo *oldci = L->base_ci;
-  luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo);
-  L->size_ci = newsize;
-  L->ci = (L->ci - oldci) + L->base_ci;
-  L->end_ci = L->base_ci + L->size_ci - 1;
-}
-
-
-void luaD_growstack (lua_State *L, int n) {
-  if (n <= L->stacksize)  /* double size is enough? */
-    luaD_reallocstack(L, 2*L->stacksize);
-  else
-    luaD_reallocstack(L, L->stacksize + n);
-}
-
-
-static CallInfo *growCI (lua_State *L) {
-  if (L->size_ci > LUAI_MAXCALLS)  /* overflow while handling overflow? */
-    luaD_throw(L, LUA_ERRERR);
-  else {
-    luaD_reallocCI(L, 2*L->size_ci);
-    if (L->size_ci > LUAI_MAXCALLS)
-      luaG_runerror(L, "stack overflow");
-  }
-  return ++L->ci;
-}
-
-
-void luaD_callhook (lua_State *L, int event, int line) {
-  lua_Hook hook = L->hook;
-  if (hook && L->allowhook) {
-    ptrdiff_t top = savestack(L, L->top);
-    ptrdiff_t ci_top = savestack(L, L->ci->top);
-    lua_Debug ar;
-    ar.event = event;
-    ar.currentline = line;
-    if (event == LUA_HOOKTAILRET)
-      ar.i_ci = 0;  /* tail call; no debug information about it */
-    else
-      ar.i_ci = cast_int(L->ci - L->base_ci);
-    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */
-    L->ci->top = L->top + LUA_MINSTACK;
-    lua_assert(L->ci->top <= L->stack_last);
-    L->allowhook = 0;  /* cannot call hooks inside a hook */
-    lua_unlock(L);
-    (*hook)(L, &ar);
-    lua_lock(L);
-    lua_assert(!L->allowhook);
-    L->allowhook = 1;
-    L->ci->top = restorestack(L, ci_top);
-    L->top = restorestack(L, top);
-  }
-}
-
-
-static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
-  int i;
-  int nfixargs = p->numparams;
-  Table *htab = NULL;
-  StkId base, fixed;
-  for (; actual < nfixargs; ++actual)
-    setnilvalue(L->top++);
-#if defined(LUA_COMPAT_VARARG)
-  if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */
-    int nvar = actual - nfixargs;  /* number of extra arguments */
-    lua_assert(p->is_vararg & VARARG_HASARG);
-    luaC_checkGC(L);
-    htab = luaH_new(L, nvar, 1);  /* create `arg' table */
-    for (i=0; i<nvar; i++)  /* put extra arguments into `arg' table */
-      setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);
-    /* store counter in field `n' */
-    setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar));
-  }
-#endif
-  /* move fixed parameters to final position */
-  fixed = L->top - actual;  /* first fixed argument */
-  base = L->top;  /* final position of first argument */
-  for (i=0; i<nfixargs; i++) {
-    setobjs2s(L, L->top++, fixed+i);
-    setnilvalue(fixed+i);
-  }
-  /* add `arg' parameter */
-  if (htab) {
-    sethvalue(L, L->top++, htab);
-    lua_assert(iswhite(obj2gco(htab)));
-  }
-  return base;
-}
-
-
-static StkId tryfuncTM (lua_State *L, StkId func) {
-  const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);
-  StkId p;
-  ptrdiff_t funcr = savestack(L, func);
-  if (!ttisfunction(tm))
-    luaG_typeerror(L, func, "call");
-  /* Open a hole inside the stack at `func' */
-  for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);
-  incr_top(L);
-  func = restorestack(L, funcr);  /* previous call may change stack */
-  setobj2s(L, func, tm);  /* tag method is the new function to be called */
-  return func;
-}
-
-
-
-#define inc_ci(L) \
-  ((L->ci == L->end_ci) ? growCI(L) : \
-   (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci))
-
-
-int luaD_precall (lua_State *L, StkId func, int nresults) {
-  LClosure *cl;
-  ptrdiff_t funcr;
-  if (!ttisfunction(func)) /* `func' is not a function? */
-    func = tryfuncTM(L, func);  /* check the `function' tag method */
-  funcr = savestack(L, func);
-  cl = &clvalue(func)->l;
-  L->ci->savedpc = L->savedpc;
-  if (!cl->isC) {  /* Lua function? prepare its call */
-    CallInfo *ci;
-    StkId st, base;
-    Proto *p = cl->p;
-    luaD_checkstack(L, p->maxstacksize);
-    func = restorestack(L, funcr);
-    if (!p->is_vararg) {  /* no varargs? */
-      base = func + 1;
-      if (L->top > base + p->numparams)
-        L->top = base + p->numparams;
-    }
-    else {  /* vararg function */
-      int nargs = cast_int(L->top - func) - 1;
-      base = adjust_varargs(L, p, nargs);
-      func = restorestack(L, funcr);  /* previous call may change the stack */
-    }
-    ci = inc_ci(L);  /* now `enter' new function */
-    ci->func = func;
-    L->base = ci->base = base;
-    ci->top = L->base + p->maxstacksize;
-    lua_assert(ci->top <= L->stack_last);
-    L->savedpc = p->code;  /* starting point */
-    ci->tailcalls = 0;
-    ci->nresults = nresults;
-    for (st = L->top; st < ci->top; st++)
-      setnilvalue(st);
-    L->top = ci->top;
-    if (L->hookmask & LUA_MASKCALL) {
-      L->savedpc++;  /* hooks assume 'pc' is already incremented */
-      luaD_callhook(L, LUA_HOOKCALL, -1);
-      L->savedpc--;  /* correct 'pc' */
-    }
-    return PCRLUA;
-  }
-  else {  /* if is a C function, call it */
-    CallInfo *ci;
-    int n;
-    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */
-    ci = inc_ci(L);  /* now `enter' new function */
-    ci->func = restorestack(L, funcr);
-    L->base = ci->base = ci->func + 1;
-    ci->top = L->top + LUA_MINSTACK;
-    lua_assert(ci->top <= L->stack_last);
-    ci->nresults = nresults;
-    if (L->hookmask & LUA_MASKCALL)
-      luaD_callhook(L, LUA_HOOKCALL, -1);
-    lua_unlock(L);
-    n = (*curr_func(L)->c.f)(L);  /* do the actual call */
-    lua_lock(L);
-    if (n < 0)  /* yielding? */
-      return PCRYIELD;
-    else {
-      luaD_poscall(L, L->top - n);
-      return PCRC;
-    }
-  }
-}
-
-
-static StkId callrethooks (lua_State *L, StkId firstResult) {
-  ptrdiff_t fr = savestack(L, firstResult);  /* next call may change stack */
-  luaD_callhook(L, LUA_HOOKRET, -1);
-  if (f_isLua(L->ci)) {  /* Lua function? */
-    while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */
-      luaD_callhook(L, LUA_HOOKTAILRET, -1);
-  }
-  return restorestack(L, fr);
-}
-
-
-int luaD_poscall (lua_State *L, StkId firstResult) {
-  StkId res;
-  int wanted, i;
-  CallInfo *ci;
-  if (L->hookmask & LUA_MASKRET)
-    firstResult = callrethooks(L, firstResult);
-  ci = L->ci--;
-  res = ci->func;  /* res == final position of 1st result */
-  wanted = ci->nresults;
-  L->base = (ci - 1)->base;  /* restore base */
-  L->savedpc = (ci - 1)->savedpc;  /* restore savedpc */
-  /* move results to correct place */
-  for (i = wanted; i != 0 && firstResult < L->top; i--)
-    setobjs2s(L, res++, firstResult++);
-  while (i-- > 0)
-    setnilvalue(res++);
-  L->top = res;
-  return (wanted - LUA_MULTRET);  /* 0 iff wanted == LUA_MULTRET */
-}
-
-
-/*
-** Call a function (C or Lua). The function to be called is at *func.
-** The arguments are on the stack, right after the function.
-** When returns, all the results are on the stack, starting at the original
-** function position.
-*/
-void luaD_call (lua_State *L, StkId func, int nResults) {
-  if (++L->nCcalls >= LUAI_MAXCCALLS) {
-    if (L->nCcalls == LUAI_MAXCCALLS)
-      luaG_runerror(L, "C stack overflow");
-    else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
-      luaD_throw(L, LUA_ERRERR);  /* error while handing stack error */
-  }
-  if (luaD_precall(L, func, nResults) == PCRLUA)  /* is a Lua function? */
-    luaV_execute(L, 1);  /* call it */
-  L->nCcalls--;
-  luaC_checkGC(L);
-}
-
-
-static void resume (lua_State *L, void *ud) {
-  StkId firstArg = cast(StkId, ud);
-  CallInfo *ci = L->ci;
-  if (L->status == 0) {  /* start coroutine? */
-    lua_assert(ci == L->base_ci && firstArg > L->base);
-    if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA)
-      return;
-  }
-  else {  /* resuming from previous yield */
-    lua_assert(L->status == LUA_YIELD);
-    L->status = 0;
-    if (!f_isLua(ci)) {  /* `common' yield? */
-      /* finish interrupted execution of `OP_CALL' */
-      lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||
-                 GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL);
-      if (luaD_poscall(L, firstArg))  /* complete it... */
-        L->top = L->ci->top;  /* and correct top if not multiple results */
-    }
-    else  /* yielded inside a hook: just continue its execution */
-      L->base = L->ci->base;
-  }
-  luaV_execute(L, cast_int(L->ci - L->base_ci));
-}
-
-
-static int resume_error (lua_State *L, const char *msg) {
-  L->top = L->ci->base;
-  setsvalue2s(L, L->top, luaS_new(L, msg));
-  incr_top(L);
-  lua_unlock(L);
-  return LUA_ERRRUN;
-}
-
-
-LUA_API int lua_resume (lua_State *L, int nargs) {
-  int status;
-  lua_lock(L);
-  if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))
-      return resume_error(L, "cannot resume non-suspended coroutine");
-  if (L->nCcalls >= LUAI_MAXCCALLS)
-    return resume_error(L, "C stack overflow");
-  luai_userstateresume(L, nargs);
-  lua_assert(L->errfunc == 0);
-  L->baseCcalls = ++L->nCcalls;
-  status = luaD_rawrunprotected(L, resume, L->top - nargs);
-  if (status != 0) {  /* error? */
-    L->status = cast_byte(status);  /* mark thread as `dead' */
-    luaD_seterrorobj(L, status, L->top);
-    L->ci->top = L->top;
-  }
-  else {
-    lua_assert(L->nCcalls == L->baseCcalls);
-    status = L->status;
-  }
-  --L->nCcalls;
-  lua_unlock(L);
-  return status;
-}
-
-
-LUA_API int lua_yield (lua_State *L, int nresults) {
-  luai_userstateyield(L, nresults);
-  lua_lock(L);
-  if (L->nCcalls > L->baseCcalls)
-    luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
-  L->base = L->top - nresults;  /* protect stack slots below */
-  L->status = LUA_YIELD;
-  lua_unlock(L);
-  return -1;
-}
-
-
-int luaD_pcall (lua_State *L, Pfunc func, void *u,
-                ptrdiff_t old_top, ptrdiff_t ef) {
-  int status;
-  unsigned short oldnCcalls = L->nCcalls;
-  ptrdiff_t old_ci = saveci(L, L->ci);
-  lu_byte old_allowhooks = L->allowhook;
-  ptrdiff_t old_errfunc = L->errfunc;
-  L->errfunc = ef;
-  status = luaD_rawrunprotected(L, func, u);
-  if (status != 0) {  /* an error occurred? */
-    StkId oldtop = restorestack(L, old_top);
-    luaF_close(L, oldtop);  /* close eventual pending closures */
-    luaD_seterrorobj(L, status, oldtop);
-    L->nCcalls = oldnCcalls;
-    L->ci = restoreci(L, old_ci);
-    L->base = L->ci->base;
-    L->savedpc = L->ci->savedpc;
-    L->allowhook = old_allowhooks;
-    restore_stack_limit(L);
-  }
-  L->errfunc = old_errfunc;
-  return status;
-}
-
-
-
-/*
-** Execute a protected parser.
-*/
-struct SParser {  /* data to `f_parser' */
-  ZIO *z;
-  Mbuffer buff;  /* buffer to be used by the scanner */
-  const char *name;
-};
-
-static void f_parser (lua_State *L, void *ud) {
-  int i;
-  Proto *tf;
-  Closure *cl;
-  struct SParser *p = cast(struct SParser *, ud);
-  int c = luaZ_lookahead(p->z);
-  luaC_checkGC(L);
-  tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,
-                                                             &p->buff, p->name);
-  cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));
-  cl->l.p = tf;
-  for (i = 0; i < tf->nups; i++)  /* initialize eventual upvalues */
-    cl->l.upvals[i] = luaF_newupval(L);
-  setclvalue(L, L->top, cl);
-  incr_top(L);
-}
-
-
-int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) {
-  struct SParser p;
-  int status;
-  p.z = z; p.name = name;
-  luaZ_initbuffer(L, &p.buff);
-  status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
-  luaZ_freebuffer(L, &p.buff);
-  return status;
-}
-
-
diff --git a/misc/liblua/ldo.h b/misc/liblua/ldo.h
deleted file mode 100644
index 98fddac..0000000
--- a/misc/liblua/ldo.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
-** Stack and Call structure of Lua
-** See Copyright Notice in lua.h
-*/
-
-#ifndef ldo_h
-#define ldo_h
-
-
-#include "lobject.h"
-#include "lstate.h"
-#include "lzio.h"
-
-
-#define luaD_checkstack(L,n)	\
-  if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
-    luaD_growstack(L, n); \
-  else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
-
-
-#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
-
-#define savestack(L,p)		((char *)(p) - (char *)L->stack)
-#define restorestack(L,n)	((TValue *)((char *)L->stack + (n)))
-
-#define saveci(L,p)		((char *)(p) - (char *)L->base_ci)
-#define restoreci(L,n)		((CallInfo *)((char *)L->base_ci + (n)))
-
-
-/* results from luaD_precall */
-#define PCRLUA		0	/* initiated a call to a Lua function */
-#define PCRC		1	/* did a call to a C function */
-#define PCRYIELD	2	/* C funtion yielded */
-
-
-/* type of protected functions, to be ran by `runprotected' */
-typedef void (*Pfunc) (lua_State *L, void *ud);
-
-LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
-LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
-LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
-LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
-LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
-                                        ptrdiff_t oldtop, ptrdiff_t ef);
-LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
-LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
-LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
-LUAI_FUNC void luaD_growstack (lua_State *L, int n);
-
-LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
-LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
-
-LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
-
-#endif
-
diff --git a/misc/liblua/ldump.c b/misc/liblua/ldump.c
deleted file mode 100644
index c9d3d48..0000000
--- a/misc/liblua/ldump.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
-** save precompiled Lua chunks
-** See Copyright Notice in lua.h
-*/
-
-#include <stddef.h>
-
-#define ldump_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lobject.h"
-#include "lstate.h"
-#include "lundump.h"
-
-typedef struct {
- lua_State* L;
- lua_Writer writer;
- void* data;
- int strip;
- int status;
-} DumpState;
-
-#define DumpMem(b,n,size,D)	DumpBlock(b,(n)*(size),D)
-#define DumpVar(x,D)	 	DumpMem(&x,1,sizeof(x),D)
-
-static void DumpBlock(const void* b, size_t size, DumpState* D)
-{
- if (D->status==0)
- {
-  lua_unlock(D->L);
-  D->status=(*D->writer)(D->L,b,size,D->data);
-  lua_lock(D->L);
- }
-}
-
-static void DumpChar(int y, DumpState* D)
-{
- char x=(char)y;
- DumpVar(x,D);
-}
-
-static void DumpInt(int x, DumpState* D)
-{
- DumpVar(x,D);
-}
-
-static void DumpNumber(lua_Number x, DumpState* D)
-{
- DumpVar(x,D);
-}
-
-static void DumpVector(const void* b, int n, size_t size, DumpState* D)
-{
- DumpInt(n,D);
- DumpMem(b,n,size,D);
-}
-
-static void DumpString(const TString* s, DumpState* D)
-{
- if (s==NULL || getstr(s)==NULL)
- {
-  size_t size=0;
-  DumpVar(size,D);
- }
- else
- {
-  size_t size=s->tsv.len+1;		/* include trailing '\0' */
-  DumpVar(size,D);
-  DumpBlock(getstr(s),size,D);
- }
-}
-
-#define DumpCode(f,D)	 DumpVector(f->code,f->sizecode,sizeof(Instruction),D)
-
-static void DumpFunction(const Proto* f, const TString* p, DumpState* D);
-
-static void DumpConstants(const Proto* f, DumpState* D)
-{
- int i,n=f->sizek;
- DumpInt(n,D);
- for (i=0; i<n; i++)
- {
-  const TValue* o=&f->k[i];
-  DumpChar(ttype(o),D);
-  switch (ttype(o))
-  {
-   case LUA_TNIL:
-	break;
-   case LUA_TBOOLEAN:
-	DumpChar(bvalue(o),D);
-	break;
-   case LUA_TNUMBER:
-	DumpNumber(nvalue(o),D);
-	break;
-   case LUA_TSTRING:
-	DumpString(rawtsvalue(o),D);
-	break;
-   default:
-	lua_assert(0);			/* cannot happen */
-	break;
-  }
- }
- n=f->sizep;
- DumpInt(n,D);
- for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);
-}
-
-static void DumpDebug(const Proto* f, DumpState* D)
-{
- int i,n;
- n= (D->strip) ? 0 : f->sizelineinfo;
- DumpVector(f->lineinfo,n,sizeof(int),D);
- n= (D->strip) ? 0 : f->sizelocvars;
- DumpInt(n,D);
- for (i=0; i<n; i++)
- {
-  DumpString(f->locvars[i].varname,D);
-  DumpInt(f->locvars[i].startpc,D);
-  DumpInt(f->locvars[i].endpc,D);
- }
- n= (D->strip) ? 0 : f->sizeupvalues;
- DumpInt(n,D);
- for (i=0; i<n; i++) DumpString(f->upvalues[i],D);
-}
-
-static void DumpFunction(const Proto* f, const TString* p, DumpState* D)
-{
- DumpString((f->source==p || D->strip) ? NULL : f->source,D);
- DumpInt(f->linedefined,D);
- DumpInt(f->lastlinedefined,D);
- DumpChar(f->nups,D);
- DumpChar(f->numparams,D);
- DumpChar(f->is_vararg,D);
- DumpChar(f->maxstacksize,D);
- DumpCode(f,D);
- DumpConstants(f,D);
- DumpDebug(f,D);
-}
-
-static void DumpHeader(DumpState* D)
-{
- char h[LUAC_HEADERSIZE];
- luaU_header(h);
- DumpBlock(h,LUAC_HEADERSIZE,D);
-}
-
-/*
-** dump Lua function as precompiled chunk
-*/
-int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
-{
- DumpState D;
- D.L=L;
- D.writer=w;
- D.data=data;
- D.strip=strip;
- D.status=0;
- DumpHeader(&D);
- DumpFunction(f,NULL,&D);
- return D.status;
-}
diff --git a/misc/liblua/lfunc.c b/misc/liblua/lfunc.c
deleted file mode 100644
index 813e88f..0000000
--- a/misc/liblua/lfunc.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $
-** Auxiliary functions to manipulate prototypes and closures
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stddef.h>
-
-#define lfunc_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lfunc.h"
-#include "lgc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-
-
-
-Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) {
-  Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems)));
-  luaC_link(L, obj2gco(c), LUA_TFUNCTION);
-  c->c.isC = 1;
-  c->c.env = e;
-  c->c.nupvalues = cast_byte(nelems);
-  return c;
-}
-
-
-Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) {
-  Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems)));
-  luaC_link(L, obj2gco(c), LUA_TFUNCTION);
-  c->l.isC = 0;
-  c->l.env = e;
-  c->l.nupvalues = cast_byte(nelems);
-  while (nelems--) c->l.upvals[nelems] = NULL;
-  return c;
-}
-
-
-UpVal *luaF_newupval (lua_State *L) {
-  UpVal *uv = luaM_new(L, UpVal);
-  luaC_link(L, obj2gco(uv), LUA_TUPVAL);
-  uv->v = &uv->u.value;
-  setnilvalue(uv->v);
-  return uv;
-}
-
-
-UpVal *luaF_findupval (lua_State *L, StkId level) {
-  global_State *g = G(L);
-  GCObject **pp = &L->openupval;
-  UpVal *p;
-  UpVal *uv;
-  while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) {
-    lua_assert(p->v != &p->u.value);
-    if (p->v == level) {  /* found a corresponding upvalue? */
-      if (isdead(g, obj2gco(p)))  /* is it dead? */
-        changewhite(obj2gco(p));  /* ressurect it */
-      return p;
-    }
-    pp = &p->next;
-  }
-  uv = luaM_new(L, UpVal);  /* not found: create a new one */
-  uv->tt = LUA_TUPVAL;
-  uv->marked = luaC_white(g);
-  uv->v = level;  /* current value lives in the stack */
-  uv->next = *pp;  /* chain it in the proper position */
-  *pp = obj2gco(uv);
-  uv->u.l.prev = &g->uvhead;  /* double link it in `uvhead' list */
-  uv->u.l.next = g->uvhead.u.l.next;
-  uv->u.l.next->u.l.prev = uv;
-  g->uvhead.u.l.next = uv;
-  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
-  return uv;
-}
-
-
-static void unlinkupval (UpVal *uv) {
-  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
-  uv->u.l.next->u.l.prev = uv->u.l.prev;  /* remove from `uvhead' list */
-  uv->u.l.prev->u.l.next = uv->u.l.next;
-}
-
-
-void luaF_freeupval (lua_State *L, UpVal *uv) {
-  if (uv->v != &uv->u.value)  /* is it open? */
-    unlinkupval(uv);  /* remove from open list */
-  luaM_free(L, uv);  /* free upvalue */
-}
-
-
-void luaF_close (lua_State *L, StkId level) {
-  UpVal *uv;
-  global_State *g = G(L);
-  while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {
-    GCObject *o = obj2gco(uv);
-    lua_assert(!isblack(o) && uv->v != &uv->u.value);
-    L->openupval = uv->next;  /* remove from `open' list */
-    if (isdead(g, o))
-      luaF_freeupval(L, uv);  /* free upvalue */
-    else {
-      unlinkupval(uv);
-      setobj(L, &uv->u.value, uv->v);
-      uv->v = &uv->u.value;  /* now current value lives here */
-      luaC_linkupval(L, uv);  /* link upvalue into `gcroot' list */
-    }
-  }
-}
-
-
-Proto *luaF_newproto (lua_State *L) {
-  Proto *f = luaM_new(L, Proto);
-  luaC_link(L, obj2gco(f), LUA_TPROTO);
-  f->k = NULL;
-  f->sizek = 0;
-  f->p = NULL;
-  f->sizep = 0;
-  f->code = NULL;
-  f->sizecode = 0;
-  f->sizelineinfo = 0;
-  f->sizeupvalues = 0;
-  f->nups = 0;
-  f->upvalues = NULL;
-  f->numparams = 0;
-  f->is_vararg = 0;
-  f->maxstacksize = 0;
-  f->lineinfo = NULL;
-  f->sizelocvars = 0;
-  f->locvars = NULL;
-  f->linedefined = 0;
-  f->lastlinedefined = 0;
-  f->source = NULL;
-  return f;
-}
-
-
-void luaF_freeproto (lua_State *L, Proto *f) {
-  luaM_freearray(L, f->code, f->sizecode, Instruction);
-  luaM_freearray(L, f->p, f->sizep, Proto *);
-  luaM_freearray(L, f->k, f->sizek, TValue);
-  luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);
-  luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);
-  luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *);
-  luaM_free(L, f);
-}
-
-
-void luaF_freeclosure (lua_State *L, Closure *c) {
-  int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) :
-                          sizeLclosure(c->l.nupvalues);
-  luaM_freemem(L, c, size);
-}
-
-
-/*
-** Look for n-th local variable at line `line' in function `func'.
-** Returns NULL if not found.
-*/
-const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
-  int i;
-  for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
-    if (pc < f->locvars[i].endpc) {  /* is variable active? */
-      local_number--;
-      if (local_number == 0)
-        return getstr(f->locvars[i].varname);
-    }
-  }
-  return NULL;  /* not found */
-}
-
diff --git a/misc/liblua/lfunc.h b/misc/liblua/lfunc.h
deleted file mode 100644
index a68cf51..0000000
--- a/misc/liblua/lfunc.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
-** Auxiliary functions to manipulate prototypes and closures
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lfunc_h
-#define lfunc_h
-
-
-#include "lobject.h"
-
-
-#define sizeCclosure(n)	(cast(int, sizeof(CClosure)) + \
-                         cast(int, sizeof(TValue)*((n)-1)))
-
-#define sizeLclosure(n)	(cast(int, sizeof(LClosure)) + \
-                         cast(int, sizeof(TValue *)*((n)-1)))
-
-
-LUAI_FUNC Proto *luaF_newproto (lua_State *L);
-LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
-LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
-LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
-LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
-LUAI_FUNC void luaF_close (lua_State *L, StkId level);
-LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
-LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
-LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
-LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
-                                         int pc);
-
-
-#endif
diff --git a/misc/liblua/lgc.c b/misc/liblua/lgc.c
deleted file mode 100644
index e0c69a7..0000000
--- a/misc/liblua/lgc.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
-** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $
-** Garbage Collector
-** See Copyright Notice in lua.h
-*/
-
-#include <string.h>
-
-#define lgc_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-
-
-#define GCSTEPSIZE	1024u
-#define GCSWEEPMAX	40
-#define GCSWEEPCOST	10
-#define GCFINALIZECOST	100
-
-
-#define maskmarks	cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))
-
-#define makewhite(g,x)	\
-   ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g)))
-
-#define white2gray(x)	reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
-#define black2gray(x)	resetbit((x)->gch.marked, BLACKBIT)
-
-#define stringmark(s)	reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)
-
-
-#define isfinalized(u)		testbit((u)->marked, FINALIZEDBIT)
-#define markfinalized(u)	l_setbit((u)->marked, FINALIZEDBIT)
-
-
-#define KEYWEAK         bitmask(KEYWEAKBIT)
-#define VALUEWEAK       bitmask(VALUEWEAKBIT)
-
-
-
-#define markvalue(g,o) { checkconsistency(o); \
-  if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }
-
-#define markobject(g,t) { if (iswhite(obj2gco(t))) \
-		reallymarkobject(g, obj2gco(t)); }
-
-
-#define setthreshold(g)  (g->GCthreshold = (g->estimate/100) * g->gcpause)
-
-
-static void removeentry (Node *n) {
-  lua_assert(ttisnil(gval(n)));
-  if (iscollectable(gkey(n)))
-    setttype(gkey(n), LUA_TDEADKEY);  /* dead key; remove it */
-}
-
-
-static void reallymarkobject (global_State *g, GCObject *o) {
-  lua_assert(iswhite(o) && !isdead(g, o));
-  white2gray(o);
-  switch (o->gch.tt) {
-    case LUA_TSTRING: {
-      return;
-    }
-    case LUA_TUSERDATA: {
-      Table *mt = gco2u(o)->metatable;
-      gray2black(o);  /* udata are never gray */
-      if (mt) markobject(g, mt);
-      markobject(g, gco2u(o)->env);
-      return;
-    }
-    case LUA_TUPVAL: {
-      UpVal *uv = gco2uv(o);
-      markvalue(g, uv->v);
-      if (uv->v == &uv->u.value)  /* closed? */
-        gray2black(o);  /* open upvalues are never black */
-      return;
-    }
-    case LUA_TFUNCTION: {
-      gco2cl(o)->c.gclist = g->gray;
-      g->gray = o;
-      break;
-    }
-    case LUA_TTABLE: {
-      gco2h(o)->gclist = g->gray;
-      g->gray = o;
-      break;
-    }
-    case LUA_TTHREAD: {
-      gco2th(o)->gclist = g->gray;
-      g->gray = o;
-      break;
-    }
-    case LUA_TPROTO: {
-      gco2p(o)->gclist = g->gray;
-      g->gray = o;
-      break;
-    }
-    default: lua_assert(0);
-  }
-}
-
-
-static void marktmu (global_State *g) {
-  GCObject *u = g->tmudata;
-  if (u) {
-    do {
-      u = u->gch.next;
-      makewhite(g, u);  /* may be marked, if left from previous GC */
-      reallymarkobject(g, u);
-    } while (u != g->tmudata);
-  }
-}
-
-
-/* move `dead' udata that need finalization to list `tmudata' */
-size_t luaC_separateudata (lua_State *L, int all) {
-  global_State *g = G(L);
-  size_t deadmem = 0;
-  GCObject **p = &g->mainthread->next;
-  GCObject *curr;
-  while ((curr = *p) != NULL) {
-    if (!(iswhite(curr) || all) || isfinalized(gco2u(curr)))
-      p = &curr->gch.next;  /* don't bother with them */
-    else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) {
-      markfinalized(gco2u(curr));  /* don't need finalization */
-      p = &curr->gch.next;
-    }
-    else {  /* must call its gc method */
-      deadmem += sizeudata(gco2u(curr));
-      markfinalized(gco2u(curr));
-      *p = curr->gch.next;
-      /* link `curr' at the end of `tmudata' list */
-      if (g->tmudata == NULL)  /* list is empty? */
-        g->tmudata = curr->gch.next = curr;  /* creates a circular list */
-      else {
-        curr->gch.next = g->tmudata->gch.next;
-        g->tmudata->gch.next = curr;
-        g->tmudata = curr;
-      }
-    }
-  }
-  return deadmem;
-}
-
-
-static int traversetable (global_State *g, Table *h) {
-  int i;
-  int weakkey = 0;
-  int weakvalue = 0;
-  const TValue *mode;
-  if (h->metatable)
-    markobject(g, h->metatable);
-  mode = gfasttm(g, h->metatable, TM_MODE);
-  if (mode && ttisstring(mode)) {  /* is there a weak mode? */
-    weakkey = (strchr(svalue(mode), 'k') != NULL);
-    weakvalue = (strchr(svalue(mode), 'v') != NULL);
-    if (weakkey || weakvalue) {  /* is really weak? */
-      h->marked &= ~(KEYWEAK | VALUEWEAK);  /* clear bits */
-      h->marked |= cast_byte((weakkey << KEYWEAKBIT) |
-                             (weakvalue << VALUEWEAKBIT));
-      h->gclist = g->weak;  /* must be cleared after GC, ... */
-      g->weak = obj2gco(h);  /* ... so put in the appropriate list */
-    }
-  }
-  if (weakkey && weakvalue) return 1;
-  if (!weakvalue) {
-    i = h->sizearray;
-    while (i--)
-      markvalue(g, &h->array[i]);
-  }
-  i = sizenode(h);
-  while (i--) {
-    Node *n = gnode(h, i);
-    lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n)));
-    if (ttisnil(gval(n)))
-      removeentry(n);  /* remove empty entries */
-    else {
-      lua_assert(!ttisnil(gkey(n)));
-      if (!weakkey) markvalue(g, gkey(n));
-      if (!weakvalue) markvalue(g, gval(n));
-    }
-  }
-  return weakkey || weakvalue;
-}
-
-
-/*
-** All marks are conditional because a GC may happen while the
-** prototype is still being created
-*/
-static void traverseproto (global_State *g, Proto *f) {
-  int i;
-  if (f->source) stringmark(f->source);
-  for (i=0; i<f->sizek; i++)  /* mark literals */
-    markvalue(g, &f->k[i]);
-  for (i=0; i<f->sizeupvalues; i++) {  /* mark upvalue names */
-    if (f->upvalues[i])
-      stringmark(f->upvalues[i]);
-  }
-  for (i=0; i<f->sizep; i++) {  /* mark nested protos */
-    if (f->p[i])
-      markobject(g, f->p[i]);
-  }
-  for (i=0; i<f->sizelocvars; i++) {  /* mark local-variable names */
-    if (f->locvars[i].varname)
-      stringmark(f->locvars[i].varname);
-  }
-}
-
-
-
-static void traverseclosure (global_State *g, Closure *cl) {
-  markobject(g, cl->c.env);
-  if (cl->c.isC) {
-    int i;
-    for (i=0; i<cl->c.nupvalues; i++)  /* mark its upvalues */
-      markvalue(g, &cl->c.upvalue[i]);
-  }
-  else {
-    int i;
-    lua_assert(cl->l.nupvalues == cl->l.p->nups);
-    markobject(g, cl->l.p);
-    for (i=0; i<cl->l.nupvalues; i++)  /* mark its upvalues */
-      markobject(g, cl->l.upvals[i]);
-  }
-}
-
-
-static void checkstacksizes (lua_State *L, StkId max) {
-  int ci_used = cast_int(L->ci - L->base_ci);  /* number of `ci' in use */
-  int s_used = cast_int(max - L->stack);  /* part of stack in use */
-  if (L->size_ci > LUAI_MAXCALLS)  /* handling overflow? */
-    return;  /* do not touch the stacks */
-  if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
-    luaD_reallocCI(L, L->size_ci/2);  /* still big enough... */
-  condhardstacktests(luaD_reallocCI(L, ci_used + 1));
-  if (4*s_used < L->stacksize &&
-      2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)
-    luaD_reallocstack(L, L->stacksize/2);  /* still big enough... */
-  condhardstacktests(luaD_reallocstack(L, s_used));
-}
-
-
-static void traversestack (global_State *g, lua_State *l) {
-  StkId o, lim;
-  CallInfo *ci;
-  markvalue(g, gt(l));
-  lim = l->top;
-  for (ci = l->base_ci; ci <= l->ci; ci++) {
-    lua_assert(ci->top <= l->stack_last);
-    if (lim < ci->top) lim = ci->top;
-  }
-  for (o = l->stack; o < l->top; o++)
-    markvalue(g, o);
-  for (; o <= lim; o++)
-    setnilvalue(o);
-  checkstacksizes(l, lim);
-}
-
-
-/*
-** traverse one gray object, turning it to black.
-** Returns `quantity' traversed.
-*/
-static l_mem propagatemark (global_State *g) {
-  GCObject *o = g->gray;
-  lua_assert(isgray(o));
-  gray2black(o);
-  switch (o->gch.tt) {
-    case LUA_TTABLE: {
-      Table *h = gco2h(o);
-      g->gray = h->gclist;
-      if (traversetable(g, h))  /* table is weak? */
-        black2gray(o);  /* keep it gray */
-      return sizeof(Table) + sizeof(TValue) * h->sizearray +
-                             sizeof(Node) * sizenode(h);
-    }
-    case LUA_TFUNCTION: {
-      Closure *cl = gco2cl(o);
-      g->gray = cl->c.gclist;
-      traverseclosure(g, cl);
-      return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) :
-                           sizeLclosure(cl->l.nupvalues);
-    }
-    case LUA_TTHREAD: {
-      lua_State *th = gco2th(o);
-      g->gray = th->gclist;
-      th->gclist = g->grayagain;
-      g->grayagain = o;
-      black2gray(o);
-      traversestack(g, th);
-      return sizeof(lua_State) + sizeof(TValue) * th->stacksize +
-                                 sizeof(CallInfo) * th->size_ci;
-    }
-    case LUA_TPROTO: {
-      Proto *p = gco2p(o);
-      g->gray = p->gclist;
-      traverseproto(g, p);
-      return sizeof(Proto) + sizeof(Instruction) * p->sizecode +
-                             sizeof(Proto *) * p->sizep +
-                             sizeof(TValue) * p->sizek +
-                             sizeof(int) * p->sizelineinfo +
-                             sizeof(LocVar) * p->sizelocvars +
-                             sizeof(TString *) * p->sizeupvalues;
-    }
-    default: lua_assert(0); return 0;
-  }
-}
-
-
-static size_t propagateall (global_State *g) {
-  size_t m = 0;
-  while (g->gray) m += propagatemark(g);
-  return m;
-}
-
-
-/*
-** The next function tells whether a key or value can be cleared from
-** a weak table. Non-collectable objects are never removed from weak
-** tables. Strings behave as `values', so are never removed too. for
-** other objects: if really collected, cannot keep them; for userdata
-** being finalized, keep them in keys, but not in values
-*/
-static int iscleared (const TValue *o, int iskey) {
-  if (!iscollectable(o)) return 0;
-  if (ttisstring(o)) {
-    stringmark(rawtsvalue(o));  /* strings are `values', so are never weak */
-    return 0;
-  }
-  return iswhite(gcvalue(o)) ||
-    (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));
-}
-
-
-/*
-** clear collected entries from weaktables
-*/
-static void cleartable (GCObject *l) {
-  while (l) {
-    Table *h = gco2h(l);
-    int i = h->sizearray;
-    lua_assert(testbit(h->marked, VALUEWEAKBIT) ||
-               testbit(h->marked, KEYWEAKBIT));
-    if (testbit(h->marked, VALUEWEAKBIT)) {
-      while (i--) {
-        TValue *o = &h->array[i];
-        if (iscleared(o, 0))  /* value was collected? */
-          setnilvalue(o);  /* remove value */
-      }
-    }
-    i = sizenode(h);
-    while (i--) {
-      Node *n = gnode(h, i);
-      if (!ttisnil(gval(n)) &&  /* non-empty entry? */
-          (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) {
-        setnilvalue(gval(n));  /* remove value ... */
-        removeentry(n);  /* remove entry from table */
-      }
-    }
-    l = h->gclist;
-  }
-}
-
-
-static void freeobj (lua_State *L, GCObject *o) {
-  switch (o->gch.tt) {
-    case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break;
-    case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break;
-    case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break;
-    case LUA_TTABLE: luaH_free(L, gco2h(o)); break;
-    case LUA_TTHREAD: {
-      lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread);
-      luaE_freethread(L, gco2th(o));
-      break;
-    }
-    case LUA_TSTRING: {
-      G(L)->strt.nuse--;
-      luaM_freemem(L, o, sizestring(gco2ts(o)));
-      break;
-    }
-    case LUA_TUSERDATA: {
-      luaM_freemem(L, o, sizeudata(gco2u(o)));
-      break;
-    }
-    default: lua_assert(0);
-  }
-}
-
-
-
-#define sweepwholelist(L,p)	sweeplist(L,p,MAX_LUMEM)
-
-
-static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
-  GCObject *curr;
-  global_State *g = G(L);
-  int deadmask = otherwhite(g);
-  while ((curr = *p) != NULL && count-- > 0) {
-    if (curr->gch.tt == LUA_TTHREAD)  /* sweep open upvalues of each thread */
-      sweepwholelist(L, &gco2th(curr)->openupval);
-    if ((curr->gch.marked ^ WHITEBITS) & deadmask) {  /* not dead? */
-      lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT));
-      makewhite(g, curr);  /* make it white (for next cycle) */
-      p = &curr->gch.next;
-    }
-    else {  /* must erase `curr' */
-      lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT));
-      *p = curr->gch.next;
-      if (curr == g->rootgc)  /* is the first element of the list? */
-        g->rootgc = curr->gch.next;  /* adjust first */
-      freeobj(L, curr);
-    }
-  }
-  return p;
-}
-
-
-static void checkSizes (lua_State *L) {
-  global_State *g = G(L);
-  /* check size of string hash */
-  if (g->strt.nuse < cast(lu_int32, g->strt.size/4) &&
-      g->strt.size > MINSTRTABSIZE*2)
-    luaS_resize(L, g->strt.size/2);  /* table is too big */
-  /* check size of buffer */
-  if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) {  /* buffer too big? */
-    size_t newsize = luaZ_sizebuffer(&g->buff) / 2;
-    luaZ_resizebuffer(L, &g->buff, newsize);
-  }
-}
-
-
-static void GCTM (lua_State *L) {
-  global_State *g = G(L);
-  GCObject *o = g->tmudata->gch.next;  /* get first element */
-  Udata *udata = rawgco2u(o);
-  const TValue *tm;
-  /* remove udata from `tmudata' */
-  if (o == g->tmudata)  /* last element? */
-    g->tmudata = NULL;
-  else
-    g->tmudata->gch.next = udata->uv.next;
-  udata->uv.next = g->mainthread->next;  /* return it to `root' list */
-  g->mainthread->next = o;
-  makewhite(g, o);
-  tm = fasttm(L, udata->uv.metatable, TM_GC);
-  if (tm != NULL) {
-    lu_byte oldah = L->allowhook;
-    lu_mem oldt = g->GCthreshold;
-    L->allowhook = 0;  /* stop debug hooks during GC tag method */
-    g->GCthreshold = 2*g->totalbytes;  /* avoid GC steps */
-    setobj2s(L, L->top, tm);
-    setuvalue(L, L->top+1, udata);
-    L->top += 2;
-    luaD_call(L, L->top - 2, 0);
-    L->allowhook = oldah;  /* restore hooks */
-    g->GCthreshold = oldt;  /* restore threshold */
-  }
-}
-
-
-/*
-** Call all GC tag methods
-*/
-void luaC_callGCTM (lua_State *L) {
-  while (G(L)->tmudata)
-    GCTM(L);
-}
-
-
-void luaC_freeall (lua_State *L) {
-  global_State *g = G(L);
-  int i;
-  g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT);  /* mask to collect all elements */
-  sweepwholelist(L, &g->rootgc);
-  for (i = 0; i < g->strt.size; i++)  /* free all string lists */
-    sweepwholelist(L, &g->strt.hash[i]);
-}
-
-
-static void markmt (global_State *g) {
-  int i;
-  for (i=0; i<NUM_TAGS; i++)
-    if (g->mt[i]) markobject(g, g->mt[i]);
-}
-
-
-/* mark root set */
-static void markroot (lua_State *L) {
-  global_State *g = G(L);
-  g->gray = NULL;
-  g->grayagain = NULL;
-  g->weak = NULL;
-  markobject(g, g->mainthread);
-  /* make global table be traversed before main stack */
-  markvalue(g, gt(g->mainthread));
-  markvalue(g, registry(L));
-  markmt(g);
-  g->gcstate = GCSpropagate;
-}
-
-
-static void remarkupvals (global_State *g) {
-  UpVal *uv;
-  for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) {
-    lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);
-    if (isgray(obj2gco(uv)))
-      markvalue(g, uv->v);
-  }
-}
-
-
-static void atomic (lua_State *L) {
-  global_State *g = G(L);
-  size_t udsize;  /* total size of userdata to be finalized */
-  /* remark occasional upvalues of (maybe) dead threads */
-  remarkupvals(g);
-  /* traverse objects cautch by write barrier and by 'remarkupvals' */
-  propagateall(g);
-  /* remark weak tables */
-  g->gray = g->weak;
-  g->weak = NULL;
-  lua_assert(!iswhite(obj2gco(g->mainthread)));
-  markobject(g, L);  /* mark running thread */
-  markmt(g);  /* mark basic metatables (again) */
-  propagateall(g);
-  /* remark gray again */
-  g->gray = g->grayagain;
-  g->grayagain = NULL;
-  propagateall(g);
-  udsize = luaC_separateudata(L, 0);  /* separate userdata to be finalized */
-  marktmu(g);  /* mark `preserved' userdata */
-  udsize += propagateall(g);  /* remark, to propagate `preserveness' */
-  cleartable(g->weak);  /* remove collected objects from weak tables */
-  /* flip current white */
-  g->currentwhite = cast_byte(otherwhite(g));
-  g->sweepstrgc = 0;
-  g->sweepgc = &g->rootgc;
-  g->gcstate = GCSsweepstring;
-  g->estimate = g->totalbytes - udsize;  /* first estimate */
-}
-
-
-static l_mem singlestep (lua_State *L) {
-  global_State *g = G(L);
-  /*lua_checkmemory(L);*/
-  switch (g->gcstate) {
-    case GCSpause: {
-      markroot(L);  /* start a new collection */
-      return 0;
-    }
-    case GCSpropagate: {
-      if (g->gray)
-        return propagatemark(g);
-      else {  /* no more `gray' objects */
-        atomic(L);  /* finish mark phase */
-        return 0;
-      }
-    }
-    case GCSsweepstring: {
-      lu_mem old = g->totalbytes;
-      sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]);
-      if (g->sweepstrgc >= g->strt.size)  /* nothing more to sweep? */
-        g->gcstate = GCSsweep;  /* end sweep-string phase */
-      lua_assert(old >= g->totalbytes);
-      g->estimate -= old - g->totalbytes;
-      return GCSWEEPCOST;
-    }
-    case GCSsweep: {
-      lu_mem old = g->totalbytes;
-      g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX);
-      if (*g->sweepgc == NULL) {  /* nothing more to sweep? */
-        checkSizes(L);
-        g->gcstate = GCSfinalize;  /* end sweep phase */
-      }
-      lua_assert(old >= g->totalbytes);
-      g->estimate -= old - g->totalbytes;
-      return GCSWEEPMAX*GCSWEEPCOST;
-    }
-    case GCSfinalize: {
-      if (g->tmudata) {
-        GCTM(L);
-        if (g->estimate > GCFINALIZECOST)
-          g->estimate -= GCFINALIZECOST;
-        return GCFINALIZECOST;
-      }
-      else {
-        g->gcstate = GCSpause;  /* end collection */
-        g->gcdept = 0;
-        return 0;
-      }
-    }
-    default: lua_assert(0); return 0;
-  }
-}
-
-
-void luaC_step (lua_State *L) {
-  global_State *g = G(L);
-  l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;
-  if (lim == 0)
-    lim = (MAX_LUMEM-1)/2;  /* no limit */
-  g->gcdept += g->totalbytes - g->GCthreshold;
-  do {
-    lim -= singlestep(L);
-    if (g->gcstate == GCSpause)
-      break;
-  } while (lim > 0);
-  if (g->gcstate != GCSpause) {
-    if (g->gcdept < GCSTEPSIZE)
-      g->GCthreshold = g->totalbytes + GCSTEPSIZE;  /* - lim/g->gcstepmul;*/
-    else {
-      g->gcdept -= GCSTEPSIZE;
-      g->GCthreshold = g->totalbytes;
-    }
-  }
-  else {
-    lua_assert(g->totalbytes >= g->estimate);
-    setthreshold(g);
-  }
-}
-
-
-void luaC_fullgc (lua_State *L) {
-  global_State *g = G(L);
-  if (g->gcstate <= GCSpropagate) {
-    /* reset sweep marks to sweep all elements (returning them to white) */
-    g->sweepstrgc = 0;
-    g->sweepgc = &g->rootgc;
-    /* reset other collector lists */
-    g->gray = NULL;
-    g->grayagain = NULL;
-    g->weak = NULL;
-    g->gcstate = GCSsweepstring;
-  }
-  lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate);
-  /* finish any pending sweep phase */
-  while (g->gcstate != GCSfinalize) {
-    lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep);
-    singlestep(L);
-  }
-  markroot(L);
-  while (g->gcstate != GCSpause) {
-    singlestep(L);
-  }
-  setthreshold(g);
-}
-
-
-void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) {
-  global_State *g = G(L);
-  lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));
-  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
-  lua_assert(ttype(&o->gch) != LUA_TTABLE);
-  /* must keep invariant? */
-  if (g->gcstate == GCSpropagate)
-    reallymarkobject(g, v);  /* restore invariant */
-  else  /* don't mind */
-    makewhite(g, o);  /* mark as white just to avoid other barriers */
-}
-
-
-void luaC_barrierback (lua_State *L, Table *t) {
-  global_State *g = G(L);
-  GCObject *o = obj2gco(t);
-  lua_assert(isblack(o) && !isdead(g, o));
-  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
-  black2gray(o);  /* make table gray (again) */
-  t->gclist = g->grayagain;
-  g->grayagain = o;
-}
-
-
-void luaC_link (lua_State *L, GCObject *o, lu_byte tt) {
-  global_State *g = G(L);
-  o->gch.next = g->rootgc;
-  g->rootgc = o;
-  o->gch.marked = luaC_white(g);
-  o->gch.tt = tt;
-}
-
-
-void luaC_linkupval (lua_State *L, UpVal *uv) {
-  global_State *g = G(L);
-  GCObject *o = obj2gco(uv);
-  o->gch.next = g->rootgc;  /* link upvalue into `rootgc' list */
-  g->rootgc = o;
-  if (isgray(o)) {
-    if (g->gcstate == GCSpropagate) {
-      gray2black(o);  /* closed upvalues need barrier */
-      luaC_barrier(L, uv, uv->v);
-    }
-    else {  /* sweep phase: sweep it (turning it into white) */
-      makewhite(g, o);
-      lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
-    }
-  }
-}
-
diff --git a/misc/liblua/lgc.h b/misc/liblua/lgc.h
deleted file mode 100644
index 5a8dc60..0000000
--- a/misc/liblua/lgc.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
-** Garbage Collector
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lgc_h
-#define lgc_h
-
-
-#include "lobject.h"
-
-
-/*
-** Possible states of the Garbage Collector
-*/
-#define GCSpause	0
-#define GCSpropagate	1
-#define GCSsweepstring	2
-#define GCSsweep	3
-#define GCSfinalize	4
-
-
-/*
-** some userful bit tricks
-*/
-#define resetbits(x,m)	((x) &= cast(lu_byte, ~(m)))
-#define setbits(x,m)	((x) |= (m))
-#define testbits(x,m)	((x) & (m))
-#define bitmask(b)	(1<<(b))
-#define bit2mask(b1,b2)	(bitmask(b1) | bitmask(b2))
-#define l_setbit(x,b)	setbits(x, bitmask(b))
-#define resetbit(x,b)	resetbits(x, bitmask(b))
-#define testbit(x,b)	testbits(x, bitmask(b))
-#define set2bits(x,b1,b2)	setbits(x, (bit2mask(b1, b2)))
-#define reset2bits(x,b1,b2)	resetbits(x, (bit2mask(b1, b2)))
-#define test2bits(x,b1,b2)	testbits(x, (bit2mask(b1, b2)))
-
-
-
-/*
-** Layout for bit use in `marked' field:
-** bit 0 - object is white (type 0)
-** bit 1 - object is white (type 1)
-** bit 2 - object is black
-** bit 3 - for userdata: has been finalized
-** bit 3 - for tables: has weak keys
-** bit 4 - for tables: has weak values
-** bit 5 - object is fixed (should not be collected)
-** bit 6 - object is "super" fixed (only the main thread)
-*/
-
-
-#define WHITE0BIT	0
-#define WHITE1BIT	1
-#define BLACKBIT	2
-#define FINALIZEDBIT	3
-#define KEYWEAKBIT	3
-#define VALUEWEAKBIT	4
-#define FIXEDBIT	5
-#define SFIXEDBIT	6
-#define WHITEBITS	bit2mask(WHITE0BIT, WHITE1BIT)
-
-
-#define iswhite(x)      test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
-#define isblack(x)      testbit((x)->gch.marked, BLACKBIT)
-#define isgray(x)	(!isblack(x) && !iswhite(x))
-
-#define otherwhite(g)	(g->currentwhite ^ WHITEBITS)
-#define isdead(g,v)	((v)->gch.marked & otherwhite(g) & WHITEBITS)
-
-#define changewhite(x)	((x)->gch.marked ^= WHITEBITS)
-#define gray2black(x)	l_setbit((x)->gch.marked, BLACKBIT)
-
-#define valiswhite(x)	(iscollectable(x) && iswhite(gcvalue(x)))
-
-#define luaC_white(g)	cast(lu_byte, (g)->currentwhite & WHITEBITS)
-
-
-#define luaC_checkGC(L) { \
-  condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
-  if (G(L)->totalbytes >= G(L)->GCthreshold) \
-	luaC_step(L); }
-
-
-#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p)))  \
-	luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
-
-#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t)))  \
-	luaC_barrierback(L,t); }
-
-#define luaC_objbarrier(L,p,o)  \
-	{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
-		luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
-
-#define luaC_objbarriert(L,t,o)  \
-   { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
-
-LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
-LUAI_FUNC void luaC_callGCTM (lua_State *L);
-LUAI_FUNC void luaC_freeall (lua_State *L);
-LUAI_FUNC void luaC_step (lua_State *L);
-LUAI_FUNC void luaC_fullgc (lua_State *L);
-LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
-LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
-LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
-LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
-
-
-#endif
diff --git a/misc/liblua/linit.c b/misc/liblua/linit.c
deleted file mode 100644
index c1f90df..0000000
--- a/misc/liblua/linit.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $
-** Initialization of libraries for lua.c
-** See Copyright Notice in lua.h
-*/
-
-
-#define linit_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lualib.h"
-#include "lauxlib.h"
-
-
-static const luaL_Reg lualibs[] = {
-  {"", luaopen_base},
-  {LUA_LOADLIBNAME, luaopen_package},
-  {LUA_TABLIBNAME, luaopen_table},
-  {LUA_IOLIBNAME, luaopen_io},
-  {LUA_OSLIBNAME, luaopen_os},
-  {LUA_STRLIBNAME, luaopen_string},
-  {LUA_MATHLIBNAME, luaopen_math},
-  {LUA_DBLIBNAME, luaopen_debug},
-  {NULL, NULL}
-};
-
-
-LUALIB_API void luaL_openlibs (lua_State *L) {
-  const luaL_Reg *lib = lualibs;
-  for (; lib->func; lib++) {
-    lua_pushcfunction(L, lib->func);
-    lua_pushstring(L, lib->name);
-    lua_call(L, 1, 0);
-  }
-}
-
diff --git a/misc/liblua/liolib.c b/misc/liblua/liolib.c
deleted file mode 100644
index e79ed1c..0000000
--- a/misc/liblua/liolib.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
-** Standard I/O (and system) library
-** See Copyright Notice in lua.h
-*/
-
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define liolib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-
-#define IO_INPUT	1
-#define IO_OUTPUT	2
-
-
-static const char *const fnames[] = {"input", "output"};
-
-
-static int pushresult (lua_State *L, int i, const char *filename) {
-  int en = errno;  /* calls to Lua API may change this value */
-  if (i) {
-    lua_pushboolean(L, 1);
-    return 1;
-  }
-  else {
-    lua_pushnil(L);
-    if (filename)
-      lua_pushfstring(L, "%s: %s", filename, strerror(en));
-    else
-      lua_pushfstring(L, "%s", strerror(en));
-    lua_pushinteger(L, en);
-    return 3;
-  }
-}
-
-
-static void fileerror (lua_State *L, int arg, const char *filename) {
-  lua_pushfstring(L, "%s: %s", filename, strerror(errno));
-  luaL_argerror(L, arg, lua_tostring(L, -1));
-}
-
-
-#define tofilep(L)	((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))
-
-
-static int io_type (lua_State *L) {
-  void *ud;
-  luaL_checkany(L, 1);
-  ud = lua_touserdata(L, 1);
-  lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE);
-  if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1))
-    lua_pushnil(L);  /* not a file */
-  else if (*((FILE **)ud) == NULL)
-    lua_pushliteral(L, "closed file");
-  else
-    lua_pushliteral(L, "file");
-  return 1;
-}
-
-
-static FILE *tofile (lua_State *L) {
-  FILE **f = tofilep(L);
-  if (*f == NULL)
-    luaL_error(L, "attempt to use a closed file");
-  return *f;
-}
-
-
-
-/*
-** When creating file handles, always creates a `closed' file handle
-** before opening the actual file; so, if there is a memory error, the
-** file is not left opened.
-*/
-static FILE **newfile (lua_State *L) {
-  FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *));
-  *pf = NULL;  /* file handle is currently `closed' */
-  luaL_getmetatable(L, LUA_FILEHANDLE);
-  lua_setmetatable(L, -2);
-  return pf;
-}
-
-
-/*
-** function to (not) close the standard files stdin, stdout, and stderr
-*/
-static int io_noclose (lua_State *L) {
-  lua_pushnil(L);
-  lua_pushliteral(L, "cannot close standard file");
-  return 2;
-}
-
-
-/*
-** function to close 'popen' files
-*/
-static int io_pclose (lua_State *L) {
-  FILE **p = tofilep(L);
-  int ok = lua_pclose(L, *p);
-  *p = NULL;
-  return pushresult(L, ok, NULL);
-}
-
-
-/*
-** function to close regular files
-*/
-static int io_fclose (lua_State *L) {
-  FILE **p = tofilep(L);
-  int ok = (fclose(*p) == 0);
-  *p = NULL;
-  return pushresult(L, ok, NULL);
-}
-
-
-static int aux_close (lua_State *L) {
-  lua_getfenv(L, 1);
-  lua_getfield(L, -1, "__close");
-  return (lua_tocfunction(L, -1))(L);
-}
-
-
-static int io_close (lua_State *L) {
-  if (lua_isnone(L, 1))
-    lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT);
-  tofile(L);  /* make sure argument is a file */
-  return aux_close(L);
-}
-
-
-static int io_gc (lua_State *L) {
-  FILE *f = *tofilep(L);
-  /* ignore closed files */
-  if (f != NULL)
-    aux_close(L);
-  return 0;
-}
-
-
-static int io_tostring (lua_State *L) {
-  FILE *f = *tofilep(L);
-  if (f == NULL)
-    lua_pushliteral(L, "file (closed)");
-  else
-    lua_pushfstring(L, "file (%p)", f);
-  return 1;
-}
-
-
-static int io_open (lua_State *L) {
-  const char *filename = luaL_checkstring(L, 1);
-  const char *mode = luaL_optstring(L, 2, "r");
-  FILE **pf = newfile(L);
-  *pf = fopen(filename, mode);
-  return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
-}
-
-
-/*
-** this function has a separated environment, which defines the
-** correct __close for 'popen' files
-*/
-static int io_popen (lua_State *L) {
-  const char *filename = luaL_checkstring(L, 1);
-  const char *mode = luaL_optstring(L, 2, "r");
-  FILE **pf = newfile(L);
-  *pf = lua_popen(L, filename, mode);
-  return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
-}
-
-
-static int io_tmpfile (lua_State *L) {
-  FILE **pf = newfile(L);
-  *pf = tmpfile();
-  return (*pf == NULL) ? pushresult(L, 0, NULL) : 1;
-}
-
-
-static FILE *getiofile (lua_State *L, int findex) {
-  FILE *f;
-  lua_rawgeti(L, LUA_ENVIRONINDEX, findex);
-  f = *(FILE **)lua_touserdata(L, -1);
-  if (f == NULL)
-    luaL_error(L, "standard %s file is closed", fnames[findex - 1]);
-  return f;
-}
-
-
-static int g_iofile (lua_State *L, int f, const char *mode) {
-  if (!lua_isnoneornil(L, 1)) {
-    const char *filename = lua_tostring(L, 1);
-    if (filename) {
-      FILE **pf = newfile(L);
-      *pf = fopen(filename, mode);
-      if (*pf == NULL)
-        fileerror(L, 1, filename);
-    }
-    else {
-      tofile(L);  /* check that it's a valid file handle */
-      lua_pushvalue(L, 1);
-    }
-    lua_rawseti(L, LUA_ENVIRONINDEX, f);
-  }
-  /* return current value */
-  lua_rawgeti(L, LUA_ENVIRONINDEX, f);
-  return 1;
-}
-
-
-static int io_input (lua_State *L) {
-  return g_iofile(L, IO_INPUT, "r");
-}
-
-
-static int io_output (lua_State *L) {
-  return g_iofile(L, IO_OUTPUT, "w");
-}
-
-
-static int io_readline (lua_State *L);
-
-
-static void aux_lines (lua_State *L, int idx, int toclose) {
-  lua_pushvalue(L, idx);
-  lua_pushboolean(L, toclose);  /* close/not close file when finished */
-  lua_pushcclosure(L, io_readline, 2);
-}
-
-
-static int f_lines (lua_State *L) {
-  tofile(L);  /* check that it's a valid file handle */
-  aux_lines(L, 1, 0);
-  return 1;
-}
-
-
-static int io_lines (lua_State *L) {
-  if (lua_isnoneornil(L, 1)) {  /* no arguments? */
-    /* will iterate over default input */
-    lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT);
-    return f_lines(L);
-  }
-  else {
-    const char *filename = luaL_checkstring(L, 1);
-    FILE **pf = newfile(L);
-    *pf = fopen(filename, "r");
-    if (*pf == NULL)
-      fileerror(L, 1, filename);
-    aux_lines(L, lua_gettop(L), 1);
-    return 1;
-  }
-}
-
-
-/*
-** {======================================================
-** READ
-** =======================================================
-*/
-
-
-static int read_number (lua_State *L, FILE *f) {
-  lua_Number d;
-  if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
-    lua_pushnumber(L, d);
-    return 1;
-  }
-  else return 0;  /* read fails */
-}
-
-
-static int test_eof (lua_State *L, FILE *f) {
-  int c = getc(f);
-  ungetc(c, f);
-  lua_pushlstring(L, NULL, 0);
-  return (c != EOF);
-}
-
-
-static int read_line (lua_State *L, FILE *f) {
-  luaL_Buffer b;
-  luaL_buffinit(L, &b);
-  for (;;) {
-    size_t l;
-    char *p = luaL_prepbuffer(&b);
-    if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) {  /* eof? */
-      luaL_pushresult(&b);  /* close buffer */
-      return (lua_objlen(L, -1) > 0);  /* check whether read something */
-    }
-    l = strlen(p);
-    if (l == 0 || p[l-1] != '\n')
-      luaL_addsize(&b, l);
-    else {
-      luaL_addsize(&b, l - 1);  /* do not include `eol' */
-      luaL_pushresult(&b);  /* close buffer */
-      return 1;  /* read at least an `eol' */
-    }
-  }
-}
-
-
-static int read_chars (lua_State *L, FILE *f, size_t n) {
-  size_t rlen;  /* how much to read */
-  size_t nr;  /* number of chars actually read */
-  luaL_Buffer b;
-  luaL_buffinit(L, &b);
-  rlen = LUAL_BUFFERSIZE;  /* try to read that much each time */
-  do {
-    char *p = luaL_prepbuffer(&b);
-    if (rlen > n) rlen = n;  /* cannot read more than asked */
-    nr = fread(p, sizeof(char), rlen, f);
-    luaL_addsize(&b, nr);
-    n -= nr;  /* still have to read `n' chars */
-  } while (n > 0 && nr == rlen);  /* until end of count or eof */
-  luaL_pushresult(&b);  /* close buffer */
-  return (n == 0 || lua_objlen(L, -1) > 0);
-}
-
-
-static int g_read (lua_State *L, FILE *f, int first) {
-  int nargs = lua_gettop(L) - 1;
-  int success;
-  int n;
-  clearerr(f);
-  if (nargs == 0) {  /* no arguments? */
-    success = read_line(L, f);
-    n = first+1;  /* to return 1 result */
-  }
-  else {  /* ensure stack space for all results and for auxlib's buffer */
-    luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments");
-    success = 1;
-    for (n = first; nargs-- && success; n++) {
-      if (lua_type(L, n) == LUA_TNUMBER) {
-        size_t l = (size_t)lua_tointeger(L, n);
-        success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l);
-      }
-      else {
-        const char *p = lua_tostring(L, n);
-        luaL_argcheck(L, p && p[0] == '*', n, "invalid option");
-        switch (p[1]) {
-          case 'n':  /* number */
-            success = read_number(L, f);
-            break;
-          case 'l':  /* line */
-            success = read_line(L, f);
-            break;
-          case 'a':  /* file */
-            read_chars(L, f, ~((size_t)0));  /* read MAX_SIZE_T chars */
-            success = 1; /* always success */
-            break;
-          default:
-            return luaL_argerror(L, n, "invalid format");
-        }
-      }
-    }
-  }
-  if (ferror(f))
-    return pushresult(L, 0, NULL);
-  if (!success) {
-    lua_pop(L, 1);  /* remove last result */
-    lua_pushnil(L);  /* push nil instead */
-  }
-  return n - first;
-}
-
-
-static int io_read (lua_State *L) {
-  return g_read(L, getiofile(L, IO_INPUT), 1);
-}
-
-
-static int f_read (lua_State *L) {
-  return g_read(L, tofile(L), 2);
-}
-
-
-static int io_readline (lua_State *L) {
-  FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1));
-  int sucess;
-  if (f == NULL)  /* file is already closed? */
-    luaL_error(L, "file is already closed");
-  sucess = read_line(L, f);
-  if (ferror(f))
-    return luaL_error(L, "%s", strerror(errno));
-  if (sucess) return 1;
-  else {  /* EOF */
-    if (lua_toboolean(L, lua_upvalueindex(2))) {  /* generator created file? */
-      lua_settop(L, 0);
-      lua_pushvalue(L, lua_upvalueindex(1));
-      aux_close(L);  /* close it */
-    }
-    return 0;
-  }
-}
-
-/* }====================================================== */
-
-
-static int g_write (lua_State *L, FILE *f, int arg) {
-  int nargs = lua_gettop(L) - 1;
-  int status = 1;
-  for (; nargs--; arg++) {
-    if (lua_type(L, arg) == LUA_TNUMBER) {
-      /* optimization: could be done exactly as for strings */
-      status = status &&
-          fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0;
-    }
-    else {
-      size_t l;
-      const char *s = luaL_checklstring(L, arg, &l);
-      status = status && (fwrite(s, sizeof(char), l, f) == l);
-    }
-  }
-  return pushresult(L, status, NULL);
-}
-
-
-static int io_write (lua_State *L) {
-  return g_write(L, getiofile(L, IO_OUTPUT), 1);
-}
-
-
-static int f_write (lua_State *L) {
-  return g_write(L, tofile(L), 2);
-}
-
-
-static int f_seek (lua_State *L) {
-  static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END};
-  static const char *const modenames[] = {"set", "cur", "end", NULL};
-  FILE *f = tofile(L);
-  int op = luaL_checkoption(L, 2, "cur", modenames);
-  long offset = luaL_optlong(L, 3, 0);
-  op = fseek(f, offset, mode[op]);
-  if (op)
-    return pushresult(L, 0, NULL);  /* error */
-  else {
-    lua_pushinteger(L, ftell(f));
-    return 1;
-  }
-}
-
-
-static int f_setvbuf (lua_State *L) {
-  static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
-  static const char *const modenames[] = {"no", "full", "line", NULL};
-  FILE *f = tofile(L);
-  int op = luaL_checkoption(L, 2, NULL, modenames);
-  lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
-  int res = setvbuf(f, NULL, mode[op], sz);
-  return pushresult(L, res == 0, NULL);
-}
-
-
-
-static int io_flush (lua_State *L) {
-  return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL);
-}
-
-
-static int f_flush (lua_State *L) {
-  return pushresult(L, fflush(tofile(L)) == 0, NULL);
-}
-
-
-static const luaL_Reg iolib[] = {
-  {"close", io_close},
-  {"flush", io_flush},
-  {"input", io_input},
-  {"lines", io_lines},
-  {"open", io_open},
-  {"output", io_output},
-  {"popen", io_popen},
-  {"read", io_read},
-  {"tmpfile", io_tmpfile},
-  {"type", io_type},
-  {"write", io_write},
-  {NULL, NULL}
-};
-
-
-static const luaL_Reg flib[] = {
-  {"close", io_close},
-  {"flush", f_flush},
-  {"lines", f_lines},
-  {"read", f_read},
-  {"seek", f_seek},
-  {"setvbuf", f_setvbuf},
-  {"write", f_write},
-  {"__gc", io_gc},
-  {"__tostring", io_tostring},
-  {NULL, NULL}
-};
-
-
-static void createmeta (lua_State *L) {
-  luaL_newmetatable(L, LUA_FILEHANDLE);  /* create metatable for file handles */
-  lua_pushvalue(L, -1);  /* push metatable */
-  lua_setfield(L, -2, "__index");  /* metatable.__index = metatable */
-  luaL_register(L, NULL, flib);  /* file methods */
-}
-
-
-static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) {
-  *newfile(L) = f;
-  if (k > 0) {
-    lua_pushvalue(L, -1);
-    lua_rawseti(L, LUA_ENVIRONINDEX, k);
-  }
-  lua_pushvalue(L, -2);  /* copy environment */
-  lua_setfenv(L, -2);  /* set it */
-  lua_setfield(L, -3, fname);
-}
-
-
-static void newfenv (lua_State *L, lua_CFunction cls) {
-  lua_createtable(L, 0, 1);
-  lua_pushcfunction(L, cls);
-  lua_setfield(L, -2, "__close");
-}
-
-
-LUALIB_API int luaopen_io (lua_State *L) {
-  createmeta(L);
-  /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */
-  newfenv(L, io_fclose);
-  lua_replace(L, LUA_ENVIRONINDEX);
-  /* open library */
-  luaL_register(L, LUA_IOLIBNAME, iolib);
-  /* create (and set) default files */
-  newfenv(L, io_noclose);  /* close function for default files */
-  createstdfile(L, stdin, IO_INPUT, "stdin");
-  createstdfile(L, stdout, IO_OUTPUT, "stdout");
-  createstdfile(L, stderr, 0, "stderr");
-  lua_pop(L, 1);  /* pop environment for default files */
-  lua_getfield(L, -1, "popen");
-  newfenv(L, io_pclose);  /* create environment for 'popen' */
-  lua_setfenv(L, -2);  /* set fenv for 'popen' */
-  lua_pop(L, 1);  /* pop 'popen' */
-  return 1;
-}
-
diff --git a/misc/liblua/llex.c b/misc/liblua/llex.c
deleted file mode 100644
index 6dc3193..0000000
--- a/misc/liblua/llex.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lexical Analyzer
-** See Copyright Notice in lua.h
-*/
-
-
-#include <ctype.h>
-#include <locale.h>
-#include <string.h>
-
-#define llex_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldo.h"
-#include "llex.h"
-#include "lobject.h"
-#include "lparser.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "lzio.h"
-
-
-
-#define next(ls) (ls->current = zgetc(ls->z))
-
-
-
-
-#define currIsNewline(ls)	(ls->current == '\n' || ls->current == '\r')
-
-
-/* ORDER RESERVED */
-const char *const luaX_tokens [] = {
-    "and", "break", "do", "else", "elseif",
-    "end", "false", "for", "function", "if",
-    "in", "local", "nil", "not", "or", "repeat",
-    "return", "then", "true", "until", "while",
-    "..", "...", "==", ">=", "<=", "~=",
-    "<number>", "<name>", "<string>", "<eof>",
-    NULL
-};
-
-
-#define save_and_next(ls) (save(ls, ls->current), next(ls))
-
-
-static void save (LexState *ls, int c) {
-  Mbuffer *b = ls->buff;
-  if (b->n + 1 > b->buffsize) {
-    size_t newsize;
-    if (b->buffsize >= MAX_SIZET/2)
-      luaX_lexerror(ls, "lexical element too long", 0);
-    newsize = b->buffsize * 2;
-    luaZ_resizebuffer(ls->L, b, newsize);
-  }
-  b->buffer[b->n++] = cast(char, c);
-}
-
-
-void luaX_init (lua_State *L) {
-  int i;
-  for (i=0; i<NUM_RESERVED; i++) {
-    TString *ts = luaS_new(L, luaX_tokens[i]);
-    luaS_fix(ts);  /* reserved words are never collected */
-    lua_assert(strlen(luaX_tokens[i])+1 <= TOKEN_LEN);
-    ts->tsv.reserved = cast_byte(i+1);  /* reserved word */
-  }
-}
-
-
-#define MAXSRC          80
-
-
-const char *luaX_token2str (LexState *ls, int token) {
-  if (token < FIRST_RESERVED) {
-    lua_assert(token == cast(unsigned char, token));
-    return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) :
-                              luaO_pushfstring(ls->L, "%c", token);
-  }
-  else
-    return luaX_tokens[token-FIRST_RESERVED];
-}
-
-
-static const char *txtToken (LexState *ls, int token) {
-  switch (token) {
-    case TK_NAME:
-    case TK_STRING:
-    case TK_NUMBER:
-      save(ls, '\0');
-      return luaZ_buffer(ls->buff);
-    default:
-      return luaX_token2str(ls, token);
-  }
-}
-
-
-void luaX_lexerror (LexState *ls, const char *msg, int token) {
-  char buff[MAXSRC];
-  luaO_chunkid(buff, getstr(ls->source), MAXSRC);
-  msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg);
-  if (token)
-    luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token));
-  luaD_throw(ls->L, LUA_ERRSYNTAX);
-}
-
-
-void luaX_syntaxerror (LexState *ls, const char *msg) {
-  luaX_lexerror(ls, msg, ls->t.token);
-}
-
-
-TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
-  lua_State *L = ls->L;
-  TString *ts = luaS_newlstr(L, str, l);
-  TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */
-  if (ttisnil(o))
-    setbvalue(o, 1);  /* make sure `str' will not be collected */
-  return ts;
-}
-
-
-static void inclinenumber (LexState *ls) {
-  int old = ls->current;
-  lua_assert(currIsNewline(ls));
-  next(ls);  /* skip `\n' or `\r' */
-  if (currIsNewline(ls) && ls->current != old)
-    next(ls);  /* skip `\n\r' or `\r\n' */
-  if (++ls->linenumber >= MAX_INT)
-    luaX_syntaxerror(ls, "chunk has too many lines");
-}
-
-
-void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {
-  ls->decpoint = '.';
-  ls->L = L;
-  ls->lookahead.token = TK_EOS;  /* no look-ahead token */
-  ls->z = z;
-  ls->fs = NULL;
-  ls->linenumber = 1;
-  ls->lastline = 1;
-  ls->source = source;
-  luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER);  /* initialize buffer */
-  next(ls);  /* read first char */
-}
-
-
-
-/*
-** =======================================================
-** LEXICAL ANALYZER
-** =======================================================
-*/
-
-
-
-static int check_next (LexState *ls, const char *set) {
-  if (!strchr(set, ls->current))
-    return 0;
-  save_and_next(ls);
-  return 1;
-}
-
-
-static void buffreplace (LexState *ls, char from, char to) {
-  size_t n = luaZ_bufflen(ls->buff);
-  char *p = luaZ_buffer(ls->buff);
-  while (n--)
-    if (p[n] == from) p[n] = to;
-}
-
-
-static void trydecpoint (LexState *ls, SemInfo *seminfo) {
-  /* format error: try to update decimal point separator */
-  struct lconv *cv = localeconv();
-  char old = ls->decpoint;
-  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
-  buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
-  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
-    /* format error with correct decimal point: no more options */
-    buffreplace(ls, ls->decpoint, '.');  /* undo change (for error message) */
-    luaX_lexerror(ls, "malformed number", TK_NUMBER);
-  }
-}
-
-
-/* LUA_NUMBER */
-static void read_numeral (LexState *ls, SemInfo *seminfo) {
-  lua_assert(isdigit(ls->current));
-  do {
-    save_and_next(ls);
-  } while (isdigit(ls->current) || ls->current == '.');
-  if (check_next(ls, "Ee"))  /* `E'? */
-    check_next(ls, "+-");  /* optional exponent sign */
-  while (isalnum(ls->current) || ls->current == '_')
-    save_and_next(ls);
-  save(ls, '\0');
-  buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */
-  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r))  /* format error? */
-    trydecpoint(ls, seminfo); /* try to update decimal point separator */
-}
-
-
-static int skip_sep (LexState *ls) {
-  int count = 0;
-  int s = ls->current;
-  lua_assert(s == '[' || s == ']');
-  save_and_next(ls);
-  while (ls->current == '=') {
-    save_and_next(ls);
-    count++;
-  }
-  return (ls->current == s) ? count : (-count) - 1;
-}
-
-
-static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
-  int cont = 0;
-  (void)(cont);  /* avoid warnings when `cont' is not used */
-  save_and_next(ls);  /* skip 2nd `[' */
-  if (currIsNewline(ls))  /* string starts with a newline? */
-    inclinenumber(ls);  /* skip it */
-  for (;;) {
-    switch (ls->current) {
-      case EOZ:
-        luaX_lexerror(ls, (seminfo) ? "unfinished long string" :
-                                   "unfinished long comment", TK_EOS);
-        break;  /* to avoid warnings */
-#if defined(LUA_COMPAT_LSTR)
-      case '[': {
-        if (skip_sep(ls) == sep) {
-          save_and_next(ls);  /* skip 2nd `[' */
-          cont++;
-#if LUA_COMPAT_LSTR == 1
-          if (sep == 0)
-            luaX_lexerror(ls, "nesting of [[...]] is deprecated", '[');
-#endif
-        }
-        break;
-      }
-#endif
-      case ']': {
-        if (skip_sep(ls) == sep) {
-          save_and_next(ls);  /* skip 2nd `]' */
-#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2
-          cont--;
-          if (sep == 0 && cont >= 0) break;
-#endif
-          goto endloop;
-        }
-        break;
-      }
-      case '\n':
-      case '\r': {
-        save(ls, '\n');
-        inclinenumber(ls);
-        if (!seminfo) luaZ_resetbuffer(ls->buff);  /* avoid wasting space */
-        break;
-      }
-      default: {
-        if (seminfo) save_and_next(ls);
-        else next(ls);
-      }
-    }
-  } endloop:
-  if (seminfo)
-    seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep),
-                                     luaZ_bufflen(ls->buff) - 2*(2 + sep));
-}
-
-
-static void read_string (LexState *ls, int del, SemInfo *seminfo) {
-  save_and_next(ls);
-  while (ls->current != del) {
-    switch (ls->current) {
-      case EOZ:
-        luaX_lexerror(ls, "unfinished string", TK_EOS);
-        continue;  /* to avoid warnings */
-      case '\n':
-      case '\r':
-        luaX_lexerror(ls, "unfinished string", TK_STRING);
-        continue;  /* to avoid warnings */
-      case '\\': {
-        int c;
-        next(ls);  /* do not save the `\' */
-        switch (ls->current) {
-          case 'a': c = '\a'; break;
-          case 'b': c = '\b'; break;
-          case 'f': c = '\f'; break;
-          case 'n': c = '\n'; break;
-          case 'r': c = '\r'; break;
-          case 't': c = '\t'; break;
-          case 'v': c = '\v'; break;
-          case '\n':  /* go through */
-          case '\r': save(ls, '\n'); inclinenumber(ls); continue;
-          case EOZ: continue;  /* will raise an error next loop */
-          default: {
-            if (!isdigit(ls->current))
-              save_and_next(ls);  /* handles \\, \", \', and \? */
-            else {  /* \xxx */
-              int i = 0;
-              c = 0;
-              do {
-                c = 10*c + (ls->current-'0');
-                next(ls);
-              } while (++i<3 && isdigit(ls->current));
-              if (c > UCHAR_MAX)
-                luaX_lexerror(ls, "escape sequence too large", TK_STRING);
-              save(ls, c);
-            }
-            continue;
-          }
-        }
-        save(ls, c);
-        next(ls);
-        continue;
-      }
-      default:
-        save_and_next(ls);
-    }
-  }
-  save_and_next(ls);  /* skip delimiter */
-  seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1,
-                                   luaZ_bufflen(ls->buff) - 2);
-}
-
-
-static int llex (LexState *ls, SemInfo *seminfo) {
-  luaZ_resetbuffer(ls->buff);
-  for (;;) {
-    switch (ls->current) {
-      case '\n':
-      case '\r': {
-        inclinenumber(ls);
-        continue;
-      }
-      case '-': {
-        next(ls);
-        if (ls->current != '-') return '-';
-        /* else is a comment */
-        next(ls);
-        if (ls->current == '[') {
-          int sep = skip_sep(ls);
-          luaZ_resetbuffer(ls->buff);  /* `skip_sep' may dirty the buffer */
-          if (sep >= 0) {
-            read_long_string(ls, NULL, sep);  /* long comment */
-            luaZ_resetbuffer(ls->buff);
-            continue;
-          }
-        }
-        /* else short comment */
-        while (!currIsNewline(ls) && ls->current != EOZ)
-          next(ls);
-        continue;
-      }
-      case '[': {
-        int sep = skip_sep(ls);
-        if (sep >= 0) {
-          read_long_string(ls, seminfo, sep);
-          return TK_STRING;
-        }
-        else if (sep == -1) return '[';
-        else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
-      }
-      case '=': {
-        next(ls);
-        if (ls->current != '=') return '=';
-        else { next(ls); return TK_EQ; }
-      }
-      case '<': {
-        next(ls);
-        if (ls->current != '=') return '<';
-        else { next(ls); return TK_LE; }
-      }
-      case '>': {
-        next(ls);
-        if (ls->current != '=') return '>';
-        else { next(ls); return TK_GE; }
-      }
-      case '~': {
-        next(ls);
-        if (ls->current != '=') return '~';
-        else { next(ls); return TK_NE; }
-      }
-      case '"':
-      case '\'': {
-        read_string(ls, ls->current, seminfo);
-        return TK_STRING;
-      }
-      case '.': {
-        save_and_next(ls);
-        if (check_next(ls, ".")) {
-          if (check_next(ls, "."))
-            return TK_DOTS;   /* ... */
-          else return TK_CONCAT;   /* .. */
-        }
-        else if (!isdigit(ls->current)) return '.';
-        else {
-          read_numeral(ls, seminfo);
-          return TK_NUMBER;
-        }
-      }
-      case EOZ: {
-        return TK_EOS;
-      }
-      default: {
-        if (isspace(ls->current)) {
-          lua_assert(!currIsNewline(ls));
-          next(ls);
-          continue;
-        }
-        else if (isdigit(ls->current)) {
-          read_numeral(ls, seminfo);
-          return TK_NUMBER;
-        }
-        else if (isalpha(ls->current) || ls->current == '_') {
-          /* identifier or reserved word */
-          TString *ts;
-          do {
-            save_and_next(ls);
-          } while (isalnum(ls->current) || ls->current == '_');
-          ts = luaX_newstring(ls, luaZ_buffer(ls->buff),
-                                  luaZ_bufflen(ls->buff));
-          if (ts->tsv.reserved > 0)  /* reserved word? */
-            return ts->tsv.reserved - 1 + FIRST_RESERVED;
-          else {
-            seminfo->ts = ts;
-            return TK_NAME;
-          }
-        }
-        else {
-          int c = ls->current;
-          next(ls);
-          return c;  /* single-char tokens (+ - / ...) */
-        }
-      }
-    }
-  }
-}
-
-
-void luaX_next (LexState *ls) {
-  ls->lastline = ls->linenumber;
-  if (ls->lookahead.token != TK_EOS) {  /* is there a look-ahead token? */
-    ls->t = ls->lookahead;  /* use this one */
-    ls->lookahead.token = TK_EOS;  /* and discharge it */
-  }
-  else
-    ls->t.token = llex(ls, &ls->t.seminfo);  /* read next token */
-}
-
-
-void luaX_lookahead (LexState *ls) {
-  lua_assert(ls->lookahead.token == TK_EOS);
-  ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
-}
-
diff --git a/misc/liblua/llex.h b/misc/liblua/llex.h
deleted file mode 100644
index a9201ce..0000000
--- a/misc/liblua/llex.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lexical Analyzer
-** See Copyright Notice in lua.h
-*/
-
-#ifndef llex_h
-#define llex_h
-
-#include "lobject.h"
-#include "lzio.h"
-
-
-#define FIRST_RESERVED	257
-
-/* maximum length of a reserved word */
-#define TOKEN_LEN	(sizeof("function")/sizeof(char))
-
-
-/*
-* WARNING: if you change the order of this enumeration,
-* grep "ORDER RESERVED"
-*/
-enum RESERVED {
-  /* terminal symbols denoted by reserved words */
-  TK_AND = FIRST_RESERVED, TK_BREAK,
-  TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
-  TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
-  TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
-  /* other terminal symbols */
-  TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,
-  TK_NAME, TK_STRING, TK_EOS
-};
-
-/* number of reserved words */
-#define NUM_RESERVED	(cast(int, TK_WHILE-FIRST_RESERVED+1))
-
-
-/* array with token `names' */
-LUAI_DATA const char *const luaX_tokens [];
-
-
-typedef union {
-  lua_Number r;
-  TString *ts;
-} SemInfo;  /* semantics information */
-
-
-typedef struct Token {
-  int token;
-  SemInfo seminfo;
-} Token;
-
-
-typedef struct LexState {
-  int current;  /* current character (charint) */
-  int linenumber;  /* input line counter */
-  int lastline;  /* line of last token `consumed' */
-  Token t;  /* current token */
-  Token lookahead;  /* look ahead token */
-  struct FuncState *fs;  /* `FuncState' is private to the parser */
-  struct lua_State *L;
-  ZIO *z;  /* input stream */
-  Mbuffer *buff;  /* buffer for tokens */
-  TString *source;  /* current source name */
-  char decpoint;  /* locale decimal point */
-} LexState;
-
-
-LUAI_FUNC void luaX_init (lua_State *L);
-LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
-                              TString *source);
-LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
-LUAI_FUNC void luaX_next (LexState *ls);
-LUAI_FUNC void luaX_lookahead (LexState *ls);
-LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
-LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
-LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
-
-
-#endif
diff --git a/misc/liblua/llimits.h b/misc/liblua/llimits.h
deleted file mode 100644
index 20475d4..0000000
--- a/misc/liblua/llimits.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $
-** Limits, basic types, and some other `installation-dependent' definitions
-** See Copyright Notice in lua.h
-*/
-
-#ifndef llimits_h
-#define llimits_h
-
-
-#include <limits.h>
-#include <stddef.h>
-
-
-#include "lua.h"
-
-
-typedef LUAI_UINT32 lu_int32;
-
-typedef LUAI_UMEM lu_mem;
-
-typedef LUAI_MEM l_mem;
-
-
-
-/* chars used as small naturals (so that `char' is reserved for characters) */
-typedef unsigned char lu_byte;
-
-
-#define MAX_SIZET	((size_t)(~(size_t)0)-2)
-
-#define MAX_LUMEM	((lu_mem)(~(lu_mem)0)-2)
-
-
-#define MAX_INT (INT_MAX-2)  /* maximum value of an int (-2 for safety) */
-
-/*
-** conversion of pointer to integer
-** this is for hashing only; there is no problem if the integer
-** cannot hold the whole pointer value
-*/
-#define IntPoint(p)  ((unsigned int)(lu_mem)(p))
-
-
-
-/* type to ensure maximum alignment */
-typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
-
-
-/* result of a `usual argument conversion' over lua_Number */
-typedef LUAI_UACNUMBER l_uacNumber;
-
-
-/* internal assertions for in-house debugging */
-#ifdef lua_assert
-
-#define check_exp(c,e)		(lua_assert(c), (e))
-#define api_check(l,e)		lua_assert(e)
-
-#else
-
-#define lua_assert(c)		((void)0)
-#define check_exp(c,e)		(e)
-#define api_check		luai_apicheck
-
-#endif
-
-
-#ifndef UNUSED
-#define UNUSED(x)	((void)(x))	/* to avoid warnings */
-#endif
-
-
-#ifndef cast
-#define cast(t, exp)	((t)(exp))
-#endif
-
-#define cast_byte(i)	cast(lu_byte, (i))
-#define cast_num(i)	cast(lua_Number, (i))
-#define cast_int(i)	cast(int, (i))
-
-
-
-/*
-** type for virtual-machine instructions
-** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
-*/
-typedef lu_int32 Instruction;
-
-
-
-/* maximum stack for a Lua function */
-#define MAXSTACK	250
-
-
-
-/* minimum size for the string table (must be power of 2) */
-#ifndef MINSTRTABSIZE
-#define MINSTRTABSIZE	32
-#endif
-
-
-/* minimum size for string buffer */
-#ifndef LUA_MINBUFFER
-#define LUA_MINBUFFER	32
-#endif
-
-
-#ifndef lua_lock
-#define lua_lock(L)     ((void) 0)
-#define lua_unlock(L)   ((void) 0)
-#endif
-
-#ifndef luai_threadyield
-#define luai_threadyield(L)     {lua_unlock(L); lua_lock(L);}
-#endif
-
-
-/*
-** macro to control inclusion of some hard tests on stack reallocation
-*/
-#ifndef HARDSTACKTESTS
-#define condhardstacktests(x)	((void)0)
-#else
-#define condhardstacktests(x)	x
-#endif
-
-#endif
diff --git a/misc/liblua/lmathlib.c b/misc/liblua/lmathlib.c
deleted file mode 100644
index 441fbf7..0000000
--- a/misc/liblua/lmathlib.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
-** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $
-** Standard mathematical library
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stdlib.h>
-#include <math.h>
-
-#define lmathlib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-#undef PI
-#define PI (3.14159265358979323846)
-#define RADIANS_PER_DEGREE (PI/180.0)
-
-
-
-static int math_abs (lua_State *L) {
-  lua_pushnumber(L, fabs(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_sin (lua_State *L) {
-  lua_pushnumber(L, sin(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_sinh (lua_State *L) {
-  lua_pushnumber(L, sinh(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_cos (lua_State *L) {
-  lua_pushnumber(L, cos(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_cosh (lua_State *L) {
-  lua_pushnumber(L, cosh(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_tan (lua_State *L) {
-  lua_pushnumber(L, tan(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_tanh (lua_State *L) {
-  lua_pushnumber(L, tanh(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_asin (lua_State *L) {
-  lua_pushnumber(L, asin(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_acos (lua_State *L) {
-  lua_pushnumber(L, acos(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_atan (lua_State *L) {
-  lua_pushnumber(L, atan(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_atan2 (lua_State *L) {
-  lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));
-  return 1;
-}
-
-static int math_ceil (lua_State *L) {
-  lua_pushnumber(L, ceil(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_floor (lua_State *L) {
-  lua_pushnumber(L, floor(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_fmod (lua_State *L) {
-  lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));
-  return 1;
-}
-
-static int math_modf (lua_State *L) {
-  double ip;
-  double fp = modf(luaL_checknumber(L, 1), &ip);
-  lua_pushnumber(L, ip);
-  lua_pushnumber(L, fp);
-  return 2;
-}
-
-static int math_sqrt (lua_State *L) {
-  lua_pushnumber(L, sqrt(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_pow (lua_State *L) {
-  lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));
-  return 1;
-}
-
-static int math_log (lua_State *L) {
-  lua_pushnumber(L, log(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_log10 (lua_State *L) {
-  lua_pushnumber(L, log10(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_exp (lua_State *L) {
-  lua_pushnumber(L, exp(luaL_checknumber(L, 1)));
-  return 1;
-}
-
-static int math_deg (lua_State *L) {
-  lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE);
-  return 1;
-}
-
-static int math_rad (lua_State *L) {
-  lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE);
-  return 1;
-}
-
-static int math_frexp (lua_State *L) {
-  int e;
-  lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e));
-  lua_pushinteger(L, e);
-  return 2;
-}
-
-static int math_ldexp (lua_State *L) {
-  lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2)));
-  return 1;
-}
-
-
-
-static int math_min (lua_State *L) {
-  int n = lua_gettop(L);  /* number of arguments */
-  lua_Number dmin = luaL_checknumber(L, 1);
-  int i;
-  for (i=2; i<=n; i++) {
-    lua_Number d = luaL_checknumber(L, i);
-    if (d < dmin)
-      dmin = d;
-  }
-  lua_pushnumber(L, dmin);
-  return 1;
-}
-
-
-static int math_max (lua_State *L) {
-  int n = lua_gettop(L);  /* number of arguments */
-  lua_Number dmax = luaL_checknumber(L, 1);
-  int i;
-  for (i=2; i<=n; i++) {
-    lua_Number d = luaL_checknumber(L, i);
-    if (d > dmax)
-      dmax = d;
-  }
-  lua_pushnumber(L, dmax);
-  return 1;
-}
-
-
-static int math_random (lua_State *L) {
-  /* the `%' avoids the (rare) case of r==1, and is needed also because on
-     some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */
-  lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX;
-  switch (lua_gettop(L)) {  /* check number of arguments */
-    case 0: {  /* no arguments */
-      lua_pushnumber(L, r);  /* Number between 0 and 1 */
-      break;
-    }
-    case 1: {  /* only upper limit */
-      int u = luaL_checkint(L, 1);
-      luaL_argcheck(L, 1<=u, 1, "interval is empty");
-      lua_pushnumber(L, floor(r*u)+1);  /* int between 1 and `u' */
-      break;
-    }
-    case 2: {  /* lower and upper limits */
-      int l = luaL_checkint(L, 1);
-      int u = luaL_checkint(L, 2);
-      luaL_argcheck(L, l<=u, 2, "interval is empty");
-      lua_pushnumber(L, floor(r*(u-l+1))+l);  /* int between `l' and `u' */
-      break;
-    }
-    default: return luaL_error(L, "wrong number of arguments");
-  }
-  return 1;
-}
-
-
-static int math_randomseed (lua_State *L) {
-  srand(luaL_checkint(L, 1));
-  return 0;
-}
-
-
-static const luaL_Reg mathlib[] = {
-  {"abs",   math_abs},
-  {"acos",  math_acos},
-  {"asin",  math_asin},
-  {"atan2", math_atan2},
-  {"atan",  math_atan},
-  {"ceil",  math_ceil},
-  {"cosh",   math_cosh},
-  {"cos",   math_cos},
-  {"deg",   math_deg},
-  {"exp",   math_exp},
-  {"floor", math_floor},
-  {"fmod",   math_fmod},
-  {"frexp", math_frexp},
-  {"ldexp", math_ldexp},
-  {"log10", math_log10},
-  {"log",   math_log},
-  {"max",   math_max},
-  {"min",   math_min},
-  {"modf",   math_modf},
-  {"pow",   math_pow},
-  {"rad",   math_rad},
-  {"random",     math_random},
-  {"randomseed", math_randomseed},
-  {"sinh",   math_sinh},
-  {"sin",   math_sin},
-  {"sqrt",  math_sqrt},
-  {"tanh",   math_tanh},
-  {"tan",   math_tan},
-  {NULL, NULL}
-};
-
-
-/*
-** Open math library
-*/
-LUALIB_API int luaopen_math (lua_State *L) {
-  luaL_register(L, LUA_MATHLIBNAME, mathlib);
-  lua_pushnumber(L, PI);
-  lua_setfield(L, -2, "pi");
-  lua_pushnumber(L, HUGE_VAL);
-  lua_setfield(L, -2, "huge");
-#if defined(LUA_COMPAT_MOD)
-  lua_getfield(L, -1, "fmod");
-  lua_setfield(L, -2, "mod");
-#endif
-  return 1;
-}
-
diff --git a/misc/liblua/lmem.c b/misc/liblua/lmem.c
deleted file mode 100644
index ae7d8c9..0000000
--- a/misc/liblua/lmem.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $
-** Interface to Memory Manager
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stddef.h>
-
-#define lmem_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-
-
-
-/*
-** About the realloc function:
-** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize);
-** (`osize' is the old size, `nsize' is the new size)
-**
-** Lua ensures that (ptr == NULL) iff (osize == 0).
-**
-** * frealloc(ud, NULL, 0, x) creates a new block of size `x'
-**
-** * frealloc(ud, p, x, 0) frees the block `p'
-** (in this specific case, frealloc must return NULL).
-** particularly, frealloc(ud, NULL, 0, 0) does nothing
-** (which is equivalent to free(NULL) in ANSI C)
-**
-** frealloc returns NULL if it cannot create or reallocate the area
-** (any reallocation to an equal or smaller size cannot fail!)
-*/
-
-
-
-#define MINSIZEARRAY	4
-
-
-void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,
-                     int limit, const char *errormsg) {
-  void *newblock;
-  int newsize;
-  if (*size >= limit/2) {  /* cannot double it? */
-    if (*size >= limit)  /* cannot grow even a little? */
-      luaG_runerror(L, errormsg);
-    newsize = limit;  /* still have at least one free place */
-  }
-  else {
-    newsize = (*size)*2;
-    if (newsize < MINSIZEARRAY)
-      newsize = MINSIZEARRAY;  /* minimum size */
-  }
-  newblock = luaM_reallocv(L, block, *size, newsize, size_elems);
-  *size = newsize;  /* update only when everything else is OK */
-  return newblock;
-}
-
-
-void *luaM_toobig (lua_State *L) {
-  luaG_runerror(L, "memory allocation error: block too big");
-  return NULL;  /* to avoid warnings */
-}
-
-
-
-/*
-** generic allocation routine.
-*/
-void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {
-  global_State *g = G(L);
-  lua_assert((osize == 0) == (block == NULL));
-  block = (*g->frealloc)(g->ud, block, osize, nsize);
-  if (block == NULL && nsize > 0)
-    luaD_throw(L, LUA_ERRMEM);
-  lua_assert((nsize == 0) == (block == NULL));
-  g->totalbytes = (g->totalbytes - osize) + nsize;
-  return block;
-}
-
diff --git a/misc/liblua/lmem.h b/misc/liblua/lmem.h
deleted file mode 100644
index 7c2dcb3..0000000
--- a/misc/liblua/lmem.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
-** Interface to Memory Manager
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lmem_h
-#define lmem_h
-
-
-#include <stddef.h>
-
-#include "llimits.h"
-#include "lua.h"
-
-#define MEMERRMSG	"not enough memory"
-
-
-#define luaM_reallocv(L,b,on,n,e) \
-	((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \
-		luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
-		luaM_toobig(L))
-
-#define luaM_freemem(L, b, s)	luaM_realloc_(L, (b), (s), 0)
-#define luaM_free(L, b)		luaM_realloc_(L, (b), sizeof(*(b)), 0)
-#define luaM_freearray(L, b, n, t)   luaM_reallocv(L, (b), n, 0, sizeof(t))
-
-#define luaM_malloc(L,t)	luaM_realloc_(L, NULL, 0, (t))
-#define luaM_new(L,t)		cast(t *, luaM_malloc(L, sizeof(t)))
-#define luaM_newvector(L,n,t) \
-		cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
-
-#define luaM_growvector(L,v,nelems,size,t,limit,e) \
-          if ((nelems)+1 > (size)) \
-            ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
-
-#define luaM_reallocvector(L, v,oldn,n,t) \
-   ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
-
-
-LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
-                                                          size_t size);
-LUAI_FUNC void *luaM_toobig (lua_State *L);
-LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
-                               size_t size_elem, int limit,
-                               const char *errormsg);
-
-#endif
-
diff --git a/misc/liblua/loadlib.c b/misc/liblua/loadlib.c
deleted file mode 100644
index 0eac6fb..0000000
--- a/misc/liblua/loadlib.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
-** Dynamic library loader for Lua
-** See Copyright Notice in lua.h
-**
-** This module contains an implementation of loadlib for Unix systems
-** that have dlfcn, an implementation for Darwin (Mac OS X), an
-** implementation for Windows, and a stub for other systems.
-*/
-
-
-#include <stdlib.h>
-#include <string.h>
-
-
-#define loadlib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-/* prefix for open functions in C libraries */
-#define LUA_POF		"luaopen_"
-
-/* separator for open functions in C libraries */
-#define LUA_OFSEP	"_"
-
-
-#define LIBPREFIX	"LOADLIB: "
-
-#define POF		LUA_POF
-#define LIB_FAIL	"open"
-
-
-/* error codes for ll_loadfunc */
-#define ERRLIB		1
-#define ERRFUNC		2
-
-#define setprogdir(L)		((void)0)
-
-
-static void ll_unloadlib (void *lib);
-static void *ll_load (lua_State *L, const char *path);
-static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym);
-
-
-
-#if defined(LUA_DL_DLOPEN)
-/*
-** {========================================================================
-** This is an implementation of loadlib based on the dlfcn interface.
-** The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD,
-** NetBSD, AIX 4.2, HPUX 11, and  probably most other Unix flavors, at least
-** as an emulation layer on top of native functions.
-** =========================================================================
-*/
-
-#include <dlfcn.h>
-
-static void ll_unloadlib (void *lib) {
-  dlclose(lib);
-}
-
-
-static void *ll_load (lua_State *L, const char *path) {
-  void *lib = dlopen(path, RTLD_NOW);
-  if (lib == NULL) lua_pushstring(L, dlerror());
-  return lib;
-}
-
-
-static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
-  lua_CFunction f = (lua_CFunction)dlsym(lib, sym);
-  if (f == NULL) lua_pushstring(L, dlerror());
-  return f;
-}
-
-/* }====================================================== */
-
-
-
-#elif defined(LUA_DL_DLL)
-/*
-** {======================================================================
-** This is an implementation of loadlib for Windows using native functions.
-** =======================================================================
-*/
-
-#include <windows.h>
-
-
-#undef setprogdir
-
-static void setprogdir (lua_State *L) {
-  char buff[MAX_PATH + 1];
-  char *lb;
-  DWORD nsize = sizeof(buff)/sizeof(char);
-  DWORD n = GetModuleFileNameA(NULL, buff, nsize);
-  if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL)
-    luaL_error(L, "unable to get ModuleFileName");
-  else {
-    *lb = '\0';
-    luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff);
-    lua_remove(L, -2);  /* remove original string */
-  }
-}
-
-
-static void pusherror (lua_State *L) {
-  int error = GetLastError();
-  char buffer[128];
-  if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
-      NULL, error, 0, buffer, sizeof(buffer), NULL))
-    lua_pushstring(L, buffer);
-  else
-    lua_pushfstring(L, "system error %d\n", error);
-}
-
-static void ll_unloadlib (void *lib) {
-  FreeLibrary((HINSTANCE)lib);
-}
-
-
-static void *ll_load (lua_State *L, const char *path) {
-  HINSTANCE lib = LoadLibraryA(path);
-  if (lib == NULL) pusherror(L);
-  return lib;
-}
-
-
-static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
-  lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym);
-  if (f == NULL) pusherror(L);
-  return f;
-}
-
-/* }====================================================== */
-
-
-
-#elif defined(LUA_DL_DYLD)
-/*
-** {======================================================================
-** Native Mac OS X / Darwin Implementation
-** =======================================================================
-*/
-
-#include <mach-o/dyld.h>
-
-
-/* Mac appends a `_' before C function names */
-#undef POF
-#define POF	"_" LUA_POF
-
-
-static void pusherror (lua_State *L) {
-  const char *err_str;
-  const char *err_file;
-  NSLinkEditErrors err;
-  int err_num;
-  NSLinkEditError(&err, &err_num, &err_file, &err_str);
-  lua_pushstring(L, err_str);
-}
-
-
-static const char *errorfromcode (NSObjectFileImageReturnCode ret) {
-  switch (ret) {
-    case NSObjectFileImageInappropriateFile:
-      return "file is not a bundle";
-    case NSObjectFileImageArch:
-      return "library is for wrong CPU type";
-    case NSObjectFileImageFormat:
-      return "bad format";
-    case NSObjectFileImageAccess:
-      return "cannot access file";
-    case NSObjectFileImageFailure:
-    default:
-      return "unable to load library";
-  }
-}
-
-
-static void ll_unloadlib (void *lib) {
-  NSUnLinkModule((NSModule)lib, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES);
-}
-
-
-static void *ll_load (lua_State *L, const char *path) {
-  NSObjectFileImage img;
-  NSObjectFileImageReturnCode ret;
-  /* this would be a rare case, but prevents crashing if it happens */
-  if(!_dyld_present()) {
-    lua_pushliteral(L, "dyld not present");
-    return NULL;
-  }
-  ret = NSCreateObjectFileImageFromFile(path, &img);
-  if (ret == NSObjectFileImageSuccess) {
-    NSModule mod = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE |
-                       NSLINKMODULE_OPTION_RETURN_ON_ERROR);
-    NSDestroyObjectFileImage(img);
-    if (mod == NULL) pusherror(L);
-    return mod;
-  }
-  lua_pushstring(L, errorfromcode(ret));
-  return NULL;
-}
-
-
-static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
-  NSSymbol nss = NSLookupSymbolInModule((NSModule)lib, sym);
-  if (nss == NULL) {
-    lua_pushfstring(L, "symbol " LUA_QS " not found", sym);
-    return NULL;
-  }
-  return (lua_CFunction)NSAddressOfSymbol(nss);
-}
-
-/* }====================================================== */
-
-
-
-#else
-/*
-** {======================================================
-** Fallback for other systems
-** =======================================================
-*/
-
-#undef LIB_FAIL
-#define LIB_FAIL	"absent"
-
-
-#define DLMSG	"dynamic libraries not enabled; check your Lua installation"
-
-
-static void ll_unloadlib (void *lib) {
-  (void)lib;  /* to avoid warnings */
-}
-
-
-static void *ll_load (lua_State *L, const char *path) {
-  (void)path;  /* to avoid warnings */
-  lua_pushliteral(L, DLMSG);
-  return NULL;
-}
-
-
-static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
-  (void)lib; (void)sym;  /* to avoid warnings */
-  lua_pushliteral(L, DLMSG);
-  return NULL;
-}
-
-/* }====================================================== */
-#endif
-
-
-
-static void **ll_register (lua_State *L, const char *path) {
-  void **plib;
-  lua_pushfstring(L, "%s%s", LIBPREFIX, path);
-  lua_gettable(L, LUA_REGISTRYINDEX);  /* check library in registry? */
-  if (!lua_isnil(L, -1))  /* is there an entry? */
-    plib = (void **)lua_touserdata(L, -1);
-  else {  /* no entry yet; create one */
-    lua_pop(L, 1);
-    plib = (void **)lua_newuserdata(L, sizeof(const void *));
-    *plib = NULL;
-    luaL_getmetatable(L, "_LOADLIB");
-    lua_setmetatable(L, -2);
-    lua_pushfstring(L, "%s%s", LIBPREFIX, path);
-    lua_pushvalue(L, -2);
-    lua_settable(L, LUA_REGISTRYINDEX);
-  }
-  return plib;
-}
-
-
-/*
-** __gc tag method: calls library's `ll_unloadlib' function with the lib
-** handle
-*/
-static int gctm (lua_State *L) {
-  void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB");
-  if (*lib) ll_unloadlib(*lib);
-  *lib = NULL;  /* mark library as closed */
-  return 0;
-}
-
-
-static int ll_loadfunc (lua_State *L, const char *path, const char *sym) {
-  void **reg = ll_register(L, path);
-  if (*reg == NULL) *reg = ll_load(L, path);
-  if (*reg == NULL)
-    return ERRLIB;  /* unable to load library */
-  else {
-    lua_CFunction f = ll_sym(L, *reg, sym);
-    if (f == NULL)
-      return ERRFUNC;  /* unable to find function */
-    lua_pushcfunction(L, f);
-    return 0;  /* return function */
-  }
-}
-
-
-static int ll_loadlib (lua_State *L) {
-  const char *path = luaL_checkstring(L, 1);
-  const char *init = luaL_checkstring(L, 2);
-  int stat = ll_loadfunc(L, path, init);
-  if (stat == 0)  /* no errors? */
-    return 1;  /* return the loaded function */
-  else {  /* error; error message is on stack top */
-    lua_pushnil(L);
-    lua_insert(L, -2);
-    lua_pushstring(L, (stat == ERRLIB) ?  LIB_FAIL : "init");
-    return 3;  /* return nil, error message, and where */
-  }
-}
-
-
-
-/*
-** {======================================================
-** 'require' function
-** =======================================================
-*/
-
-
-static int readable (const char *filename) {
-  FILE *f = fopen(filename, "r");  /* try to open file */
-  if (f == NULL) return 0;  /* open failed */
-  fclose(f);
-  return 1;
-}
-
-
-static const char *pushnexttemplate (lua_State *L, const char *path) {
-  const char *l;
-  while (*path == *LUA_PATHSEP) path++;  /* skip separators */
-  if (*path == '\0') return NULL;  /* no more templates */
-  l = strchr(path, *LUA_PATHSEP);  /* find next separator */
-  if (l == NULL) l = path + strlen(path);
-  lua_pushlstring(L, path, l - path);  /* template */
-  return l;
-}
-
-
-static const char *findfile (lua_State *L, const char *name,
-                                           const char *pname) {
-  const char *path;
-  name = luaL_gsub(L, name, ".", LUA_DIRSEP);
-  lua_getfield(L, LUA_ENVIRONINDEX, pname);
-  path = lua_tostring(L, -1);
-  if (path == NULL)
-    luaL_error(L, LUA_QL("package.%s") " must be a string", pname);
-  lua_pushliteral(L, "");  /* error accumulator */
-  while ((path = pushnexttemplate(L, path)) != NULL) {
-    const char *filename;
-    filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name);
-    lua_remove(L, -2);  /* remove path template */
-    if (readable(filename))  /* does file exist and is readable? */
-      return filename;  /* return that file name */
-    lua_pushfstring(L, "\n\tno file " LUA_QS, filename);
-    lua_remove(L, -2);  /* remove file name */
-    lua_concat(L, 2);  /* add entry to possible error message */
-  }
-  return NULL;  /* not found */
-}
-
-
-static void loaderror (lua_State *L, const char *filename) {
-  luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s",
-                lua_tostring(L, 1), filename, lua_tostring(L, -1));
-}
-
-
-static int loader_Lua (lua_State *L) {
-  const char *filename;
-  const char *name = luaL_checkstring(L, 1);
-  filename = findfile(L, name, "path");
-  if (filename == NULL) return 1;  /* library not found in this path */
-  if (luaL_loadfile(L, filename) != 0)
-    loaderror(L, filename);
-  return 1;  /* library loaded successfully */
-}
-
-
-static const char *mkfuncname (lua_State *L, const char *modname) {
-  const char *funcname;
-  const char *mark = strchr(modname, *LUA_IGMARK);
-  if (mark) modname = mark + 1;
-  funcname = luaL_gsub(L, modname, ".", LUA_OFSEP);
-  funcname = lua_pushfstring(L, POF"%s", funcname);
-  lua_remove(L, -2);  /* remove 'gsub' result */
-  return funcname;
-}
-
-
-static int loader_C (lua_State *L) {
-  const char *funcname;
-  const char *name = luaL_checkstring(L, 1);
-  const char *filename = findfile(L, name, "cpath");
-  if (filename == NULL) return 1;  /* library not found in this path */
-  funcname = mkfuncname(L, name);
-  if (ll_loadfunc(L, filename, funcname) != 0)
-    loaderror(L, filename);
-  return 1;  /* library loaded successfully */
-}
-
-
-static int loader_Croot (lua_State *L) {
-  const char *funcname;
-  const char *filename;
-  const char *name = luaL_checkstring(L, 1);
-  const char *p = strchr(name, '.');
-  int stat;
-  if (p == NULL) return 0;  /* is root */
-  lua_pushlstring(L, name, p - name);
-  filename = findfile(L, lua_tostring(L, -1), "cpath");
-  if (filename == NULL) return 1;  /* root not found */
-  funcname = mkfuncname(L, name);
-  if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {
-    if (stat != ERRFUNC) loaderror(L, filename);  /* real error */
-    lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
-                       name, filename);
-    return 1;  /* function not found */
-  }
-  return 1;
-}
-
-
-static int loader_preload (lua_State *L) {
-  const char *name = luaL_checkstring(L, 1);
-  lua_getfield(L, LUA_ENVIRONINDEX, "preload");
-  if (!lua_istable(L, -1))
-    luaL_error(L, LUA_QL("package.preload") " must be a table");
-  lua_getfield(L, -1, name);
-  if (lua_isnil(L, -1))  /* not found? */
-    lua_pushfstring(L, "\n\tno field package.preload['%s']", name);
-  return 1;
-}
-
-
-static const int sentinel_ = 0;
-#define sentinel	((void *)&sentinel_)
-
-
-static int ll_require (lua_State *L) {
-  const char *name = luaL_checkstring(L, 1);
-  int i;
-  lua_settop(L, 1);  /* _LOADED table will be at index 2 */
-  lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
-  lua_getfield(L, 2, name);
-  if (lua_toboolean(L, -1)) {  /* is it there? */
-    if (lua_touserdata(L, -1) == sentinel)  /* check loops */
-      luaL_error(L, "loop or previous error loading module " LUA_QS, name);
-    return 1;  /* package is already loaded */
-  }
-  /* else must load it; iterate over available loaders */
-  lua_getfield(L, LUA_ENVIRONINDEX, "loaders");
-  if (!lua_istable(L, -1))
-    luaL_error(L, LUA_QL("package.loaders") " must be a table");
-  lua_pushliteral(L, "");  /* error message accumulator */
-  for (i=1; ; i++) {
-    lua_rawgeti(L, -2, i);  /* get a loader */
-    if (lua_isnil(L, -1))
-      luaL_error(L, "module " LUA_QS " not found:%s",
-                    name, lua_tostring(L, -2));
-    lua_pushstring(L, name);
-    lua_call(L, 1, 1);  /* call it */
-    if (lua_isfunction(L, -1))  /* did it find module? */
-      break;  /* module loaded successfully */
-    else if (lua_isstring(L, -1))  /* loader returned error message? */
-      lua_concat(L, 2);  /* accumulate it */
-    else
-      lua_pop(L, 1);
-  }
-  lua_pushlightuserdata(L, sentinel);
-  lua_setfield(L, 2, name);  /* _LOADED[name] = sentinel */
-  lua_pushstring(L, name);  /* pass name as argument to module */
-  lua_call(L, 1, 1);  /* run loaded module */
-  if (!lua_isnil(L, -1))  /* non-nil return? */
-    lua_setfield(L, 2, name);  /* _LOADED[name] = returned value */
-  lua_getfield(L, 2, name);
-  if (lua_touserdata(L, -1) == sentinel) {   /* module did not set a value? */
-    lua_pushboolean(L, 1);  /* use true as result */
-    lua_pushvalue(L, -1);  /* extra copy to be returned */
-    lua_setfield(L, 2, name);  /* _LOADED[name] = true */
-  }
-  return 1;
-}
-
-/* }====================================================== */
-
-
-
-/*
-** {======================================================
-** 'module' function
-** =======================================================
-*/
-
-
-static void setfenv (lua_State *L) {
-  lua_Debug ar;
-  if (lua_getstack(L, 1, &ar) == 0 ||
-      lua_getinfo(L, "f", &ar) == 0 ||  /* get calling function */
-      lua_iscfunction(L, -1))
-    luaL_error(L, LUA_QL("module") " not called from a Lua function");
-  lua_pushvalue(L, -2);
-  lua_setfenv(L, -2);
-  lua_pop(L, 1);
-}
-
-
-static void dooptions (lua_State *L, int n) {
-  int i;
-  for (i = 2; i <= n; i++) {
-    lua_pushvalue(L, i);  /* get option (a function) */
-    lua_pushvalue(L, -2);  /* module */
-    lua_call(L, 1, 0);
-  }
-}
-
-
-static void modinit (lua_State *L, const char *modname) {
-  const char *dot;
-  lua_pushvalue(L, -1);
-  lua_setfield(L, -2, "_M");  /* module._M = module */
-  lua_pushstring(L, modname);
-  lua_setfield(L, -2, "_NAME");
-  dot = strrchr(modname, '.');  /* look for last dot in module name */
-  if (dot == NULL) dot = modname;
-  else dot++;
-  /* set _PACKAGE as package name (full module name minus last part) */
-  lua_pushlstring(L, modname, dot - modname);
-  lua_setfield(L, -2, "_PACKAGE");
-}
-
-
-static int ll_module (lua_State *L) {
-  const char *modname = luaL_checkstring(L, 1);
-  int loaded = lua_gettop(L) + 1;  /* index of _LOADED table */
-  lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
-  lua_getfield(L, loaded, modname);  /* get _LOADED[modname] */
-  if (!lua_istable(L, -1)) {  /* not found? */
-    lua_pop(L, 1);  /* remove previous result */
-    /* try global variable (and create one if it does not exist) */
-    if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL)
-      return luaL_error(L, "name conflict for module " LUA_QS, modname);
-    lua_pushvalue(L, -1);
-    lua_setfield(L, loaded, modname);  /* _LOADED[modname] = new table */
-  }
-  /* check whether table already has a _NAME field */
-  lua_getfield(L, -1, "_NAME");
-  if (!lua_isnil(L, -1))  /* is table an initialized module? */
-    lua_pop(L, 1);
-  else {  /* no; initialize it */
-    lua_pop(L, 1);
-    modinit(L, modname);
-  }
-  lua_pushvalue(L, -1);
-  setfenv(L);
-  dooptions(L, loaded - 1);
-  return 0;
-}
-
-
-static int ll_seeall (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  if (!lua_getmetatable(L, 1)) {
-    lua_createtable(L, 0, 1); /* create new metatable */
-    lua_pushvalue(L, -1);
-    lua_setmetatable(L, 1);
-  }
-  lua_pushvalue(L, LUA_GLOBALSINDEX);
-  lua_setfield(L, -2, "__index");  /* mt.__index = _G */
-  return 0;
-}
-
-
-/* }====================================================== */
-
-
-
-/* auxiliary mark (for internal use) */
-#define AUXMARK		"\1"
-
-static void setpath (lua_State *L, const char *fieldname, const char *envname,
-                                   const char *def) {
-  const char *path = getenv(envname);
-  if (path == NULL)  /* no environment variable? */
-    lua_pushstring(L, def);  /* use default */
-  else {
-    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
-    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
-                              LUA_PATHSEP AUXMARK LUA_PATHSEP);
-    luaL_gsub(L, path, AUXMARK, def);
-    lua_remove(L, -2);
-  }
-  setprogdir(L);
-  lua_setfield(L, -2, fieldname);
-}
-
-
-static const luaL_Reg pk_funcs[] = {
-  {"loadlib", ll_loadlib},
-  {"seeall", ll_seeall},
-  {NULL, NULL}
-};
-
-
-static const luaL_Reg ll_funcs[] = {
-  {"module", ll_module},
-  {"require", ll_require},
-  {NULL, NULL}
-};
-
-
-static const lua_CFunction loaders[] =
-  {loader_preload, loader_Lua, loader_C, loader_Croot, NULL};
-
-
-LUALIB_API int luaopen_package (lua_State *L) {
-  int i;
-  /* create new type _LOADLIB */
-  luaL_newmetatable(L, "_LOADLIB");
-  lua_pushcfunction(L, gctm);
-  lua_setfield(L, -2, "__gc");
-  /* create `package' table */
-  luaL_register(L, LUA_LOADLIBNAME, pk_funcs);
-#if defined(LUA_COMPAT_LOADLIB)
-  lua_getfield(L, -1, "loadlib");
-  lua_setfield(L, LUA_GLOBALSINDEX, "loadlib");
-#endif
-  lua_pushvalue(L, -1);
-  lua_replace(L, LUA_ENVIRONINDEX);
-  /* create `loaders' table */
-  lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
-  /* fill it with pre-defined loaders */
-  for (i=0; loaders[i] != NULL; i++) {
-    lua_pushcfunction(L, loaders[i]);
-    lua_rawseti(L, -2, i+1);
-  }
-  lua_setfield(L, -2, "loaders");  /* put it in field `loaders' */
-  setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT);  /* set field `path' */
-  setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */
-  /* store config information */
-  lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n"
-                     LUA_EXECDIR "\n" LUA_IGMARK);
-  lua_setfield(L, -2, "config");
-  /* set field `loaded' */
-  luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2);
-  lua_setfield(L, -2, "loaded");
-  /* set field `preload' */
-  lua_newtable(L);
-  lua_setfield(L, -2, "preload");
-  lua_pushvalue(L, LUA_GLOBALSINDEX);
-  luaL_register(L, NULL, ll_funcs);  /* open lib into global table */
-  lua_pop(L, 1);
-  return 1;  /* return 'package' table */
-}
-
diff --git a/misc/liblua/lobject.c b/misc/liblua/lobject.c
deleted file mode 100644
index 4ff5073..0000000
--- a/misc/liblua/lobject.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
-** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $
-** Some generic functions over Lua objects
-** See Copyright Notice in lua.h
-*/
-
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define lobject_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldo.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "lvm.h"
-
-
-
-const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL};
-
-
-/*
-** converts an integer to a "floating point byte", represented as
-** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if
-** eeeee != 0 and (xxx) otherwise.
-*/
-int luaO_int2fb (unsigned int x) {
-  int e = 0;  /* expoent */
-  while (x >= 16) {
-    x = (x+1) >> 1;
-    e++;
-  }
-  if (x < 8) return x;
-  else return ((e+1) << 3) | (cast_int(x) - 8);
-}
-
-
-/* converts back */
-int luaO_fb2int (int x) {
-  int e = (x >> 3) & 31;
-  if (e == 0) return x;
-  else return ((x & 7)+8) << (e - 1);
-}
-
-
-int luaO_log2 (unsigned int x) {
-  static const lu_byte log_2[256] = {
-    0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-    6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
-    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
-    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
-    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
-  };
-  int l = -1;
-  while (x >= 256) { l += 8; x >>= 8; }
-  return l + log_2[x];
-
-}
-
-
-int luaO_rawequalObj (const TValue *t1, const TValue *t2) {
-  if (ttype(t1) != ttype(t2)) return 0;
-  else switch (ttype(t1)) {
-    case LUA_TNIL:
-      return 1;
-    case LUA_TNUMBER:
-      return luai_numeq(nvalue(t1), nvalue(t2));
-    case LUA_TBOOLEAN:
-      return bvalue(t1) == bvalue(t2);  /* boolean true must be 1 !! */
-    case LUA_TLIGHTUSERDATA:
-      return pvalue(t1) == pvalue(t2);
-    default:
-      lua_assert(iscollectable(t1));
-      return gcvalue(t1) == gcvalue(t2);
-  }
-}
-
-
-int luaO_str2d (const char *s, lua_Number *result) {
-  char *endptr;
-  *result = lua_str2number(s, &endptr);
-  if (endptr == s) return 0;  /* conversion failed */
-  if (*endptr == 'x' || *endptr == 'X')  /* maybe an hexadecimal constant? */
-    *result = cast_num(strtoul(s, &endptr, 16));
-  if (*endptr == '\0') return 1;  /* most common case */
-  while (isspace(cast(unsigned char, *endptr))) endptr++;
-  if (*endptr != '\0') return 0;  /* invalid trailing characters? */
-  return 1;
-}
-
-
-
-static void pushstr (lua_State *L, const char *str) {
-  setsvalue2s(L, L->top, luaS_new(L, str));
-  incr_top(L);
-}
-
-
-/* this function handles only `%d', `%c', %f, %p, and `%s' formats */
-const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {
-  int n = 1;
-  pushstr(L, "");
-  for (;;) {
-    const char *e = strchr(fmt, '%');
-    if (e == NULL) break;
-    setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt));
-    incr_top(L);
-    switch (*(e+1)) {
-      case 's': {
-        const char *s = va_arg(argp, char *);
-        if (s == NULL) s = "(null)";
-        pushstr(L, s);
-        break;
-      }
-      case 'c': {
-        char buff[2];
-        buff[0] = cast(char, va_arg(argp, int));
-        buff[1] = '\0';
-        pushstr(L, buff);
-        break;
-      }
-      case 'd': {
-        setnvalue(L->top, cast_num(va_arg(argp, int)));
-        incr_top(L);
-        break;
-      }
-      case 'f': {
-        setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber)));
-        incr_top(L);
-        break;
-      }
-      case 'p': {
-        char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */
-        sprintf(buff, "%p", va_arg(argp, void *));
-        pushstr(L, buff);
-        break;
-      }
-      case '%': {
-        pushstr(L, "%");
-        break;
-      }
-      default: {
-        char buff[3];
-        buff[0] = '%';
-        buff[1] = *(e+1);
-        buff[2] = '\0';
-        pushstr(L, buff);
-        break;
-      }
-    }
-    n += 2;
-    fmt = e+2;
-  }
-  pushstr(L, fmt);
-  luaV_concat(L, n+1, cast_int(L->top - L->base) - 1);
-  L->top -= n;
-  return svalue(L->top - 1);
-}
-
-
-const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) {
-  const char *msg;
-  va_list argp;
-  va_start(argp, fmt);
-  msg = luaO_pushvfstring(L, fmt, argp);
-  va_end(argp);
-  return msg;
-}
-
-
-void luaO_chunkid (char *out, const char *source, size_t bufflen) {
-  if (*source == '=') {
-    strncpy(out, source+1, bufflen);  /* remove first char */
-    out[bufflen-1] = '\0';  /* ensures null termination */
-  }
-  else {  /* out = "source", or "...source" */
-    if (*source == '@') {
-      size_t l;
-      source++;  /* skip the `@' */
-      bufflen -= sizeof(" '...' ");
-      l = strlen(source);
-      strcpy(out, "");
-      if (l > bufflen) {
-        source += (l-bufflen);  /* get last part of file name */
-        strcat(out, "...");
-      }
-      strcat(out, source);
-    }
-    else {  /* out = [string "string"] */
-      size_t len = strcspn(source, "\n\r");  /* stop at first newline */
-      bufflen -= sizeof(" [string \"...\"] ");
-      if (len > bufflen) len = bufflen;
-      strcpy(out, "[string \"");
-      if (source[len] != '\0') {  /* must truncate? */
-        strncat(out, source, len);
-        strcat(out, "...");
-      }
-      else
-        strcat(out, source);
-      strcat(out, "\"]");
-    }
-  }
-}
diff --git a/misc/liblua/lobject.h b/misc/liblua/lobject.h
deleted file mode 100644
index 577c6cc..0000000
--- a/misc/liblua/lobject.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $
-** Type definitions for Lua objects
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lobject_h
-#define lobject_h
-
-
-#include <stdarg.h>
-
-
-#include "llimits.h"
-#include "lua.h"
-
-
-/* tags for values visible from Lua */
-#define LAST_TAG	LUA_TTHREAD
-
-#define NUM_TAGS	(LAST_TAG+1)
-
-
-/*
-** Extra tags for non-values
-*/
-#define LUA_TPROTO	(LAST_TAG+1)
-#define LUA_TUPVAL	(LAST_TAG+2)
-#define LUA_TDEADKEY	(LAST_TAG+3)
-
-
-/*
-** Union of all collectable objects
-*/
-typedef union GCObject GCObject;
-
-
-/*
-** Common Header for all collectable objects (in macro form, to be
-** included in other objects)
-*/
-#define CommonHeader	GCObject *next; lu_byte tt; lu_byte marked
-
-
-/*
-** Common header in struct form
-*/
-typedef struct GCheader {
-  CommonHeader;
-} GCheader;
-
-
-
-
-/*
-** Union of all Lua values
-*/
-typedef union {
-  GCObject *gc;
-  void *p;
-  lua_Number n;
-  int b;
-} Value;
-
-
-/*
-** Tagged Values
-*/
-
-#define TValuefields	Value value; int tt
-
-typedef struct lua_TValue {
-  TValuefields;
-} TValue;
-
-
-/* Macros to test type */
-#define ttisnil(o)	(ttype(o) == LUA_TNIL)
-#define ttisnumber(o)	(ttype(o) == LUA_TNUMBER)
-#define ttisstring(o)	(ttype(o) == LUA_TSTRING)
-#define ttistable(o)	(ttype(o) == LUA_TTABLE)
-#define ttisfunction(o)	(ttype(o) == LUA_TFUNCTION)
-#define ttisboolean(o)	(ttype(o) == LUA_TBOOLEAN)
-#define ttisuserdata(o)	(ttype(o) == LUA_TUSERDATA)
-#define ttisthread(o)	(ttype(o) == LUA_TTHREAD)
-#define ttislightuserdata(o)	(ttype(o) == LUA_TLIGHTUSERDATA)
-
-/* Macros to access values */
-#define ttype(o)	((o)->tt)
-#define gcvalue(o)	check_exp(iscollectable(o), (o)->value.gc)
-#define pvalue(o)	check_exp(ttislightuserdata(o), (o)->value.p)
-#define nvalue(o)	check_exp(ttisnumber(o), (o)->value.n)
-#define rawtsvalue(o)	check_exp(ttisstring(o), &(o)->value.gc->ts)
-#define tsvalue(o)	(&rawtsvalue(o)->tsv)
-#define rawuvalue(o)	check_exp(ttisuserdata(o), &(o)->value.gc->u)
-#define uvalue(o)	(&rawuvalue(o)->uv)
-#define clvalue(o)	check_exp(ttisfunction(o), &(o)->value.gc->cl)
-#define hvalue(o)	check_exp(ttistable(o), &(o)->value.gc->h)
-#define bvalue(o)	check_exp(ttisboolean(o), (o)->value.b)
-#define thvalue(o)	check_exp(ttisthread(o), &(o)->value.gc->th)
-
-#define l_isfalse(o)	(ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
-
-/*
-** for internal debug only
-*/
-#define checkconsistency(obj) \
-  lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt))
-
-#define checkliveness(g,obj) \
-  lua_assert(!iscollectable(obj) || \
-  ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc)))
-
-
-/* Macros to set values */
-#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
-
-#define setnvalue(obj,x) \
-  { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }
-
-#define setpvalue(obj,x) \
-  { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; }
-
-#define setbvalue(obj,x) \
-  { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; }
-
-#define setsvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \
-    checkliveness(G(L),i_o); }
-
-#define setuvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \
-    checkliveness(G(L),i_o); }
-
-#define setthvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \
-    checkliveness(G(L),i_o); }
-
-#define setclvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \
-    checkliveness(G(L),i_o); }
-
-#define sethvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \
-    checkliveness(G(L),i_o); }
-
-#define setptvalue(L,obj,x) \
-  { TValue *i_o=(obj); \
-    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \
-    checkliveness(G(L),i_o); }
-
-
-
-
-#define setobj(L,obj1,obj2) \
-  { const TValue *o2=(obj2); TValue *o1=(obj1); \
-    o1->value = o2->value; o1->tt=o2->tt; \
-    checkliveness(G(L),o1); }
-
-
-/*
-** different types of sets, according to destination
-*/
-
-/* from stack to (same) stack */
-#define setobjs2s	setobj
-/* to stack (not from same stack) */
-#define setobj2s	setobj
-#define setsvalue2s	setsvalue
-#define sethvalue2s	sethvalue
-#define setptvalue2s	setptvalue
-/* from table to same table */
-#define setobjt2t	setobj
-/* to table */
-#define setobj2t	setobj
-/* to new object */
-#define setobj2n	setobj
-#define setsvalue2n	setsvalue
-
-#define setttype(obj, tt) (ttype(obj) = (tt))
-
-
-#define iscollectable(o)	(ttype(o) >= LUA_TSTRING)
-
-
-
-typedef TValue *StkId;  /* index to stack elements */
-
-
-/*
-** String headers for string table
-*/
-typedef union TString {
-  L_Umaxalign dummy;  /* ensures maximum alignment for strings */
-  struct {
-    CommonHeader;
-    lu_byte reserved;
-    unsigned int hash;
-    size_t len;
-  } tsv;
-} TString;
-
-
-#define getstr(ts)	cast(const char *, (ts) + 1)
-#define svalue(o)       getstr(rawtsvalue(o))
-
-
-
-typedef union Udata {
-  L_Umaxalign dummy;  /* ensures maximum alignment for `local' udata */
-  struct {
-    CommonHeader;
-    struct Table *metatable;
-    struct Table *env;
-    size_t len;
-  } uv;
-} Udata;
-
-
-
-
-/*
-** Function Prototypes
-*/
-typedef struct Proto {
-  CommonHeader;
-  TValue *k;  /* constants used by the function */
-  Instruction *code;
-  struct Proto **p;  /* functions defined inside the function */
-  int *lineinfo;  /* map from opcodes to source lines */
-  struct LocVar *locvars;  /* information about local variables */
-  TString **upvalues;  /* upvalue names */
-  TString  *source;
-  int sizeupvalues;
-  int sizek;  /* size of `k' */
-  int sizecode;
-  int sizelineinfo;
-  int sizep;  /* size of `p' */
-  int sizelocvars;
-  int linedefined;
-  int lastlinedefined;
-  GCObject *gclist;
-  lu_byte nups;  /* number of upvalues */
-  lu_byte numparams;
-  lu_byte is_vararg;
-  lu_byte maxstacksize;
-} Proto;
-
-
-/* masks for new-style vararg */
-#define VARARG_HASARG		1
-#define VARARG_ISVARARG		2
-#define VARARG_NEEDSARG		4
-
-
-typedef struct LocVar {
-  TString *varname;
-  int startpc;  /* first point where variable is active */
-  int endpc;    /* first point where variable is dead */
-} LocVar;
-
-
-
-/*
-** Upvalues
-*/
-
-typedef struct UpVal {
-  CommonHeader;
-  TValue *v;  /* points to stack or to its own value */
-  union {
-    TValue value;  /* the value (when closed) */
-    struct {  /* double linked list (when open) */
-      struct UpVal *prev;
-      struct UpVal *next;
-    } l;
-  } u;
-} UpVal;
-
-
-/*
-** Closures
-*/
-
-#define ClosureHeader \
-	CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
-	struct Table *env
-
-typedef struct CClosure {
-  ClosureHeader;
-  lua_CFunction f;
-  TValue upvalue[1];
-} CClosure;
-
-
-typedef struct LClosure {
-  ClosureHeader;
-  struct Proto *p;
-  UpVal *upvals[1];
-} LClosure;
-
-
-typedef union Closure {
-  CClosure c;
-  LClosure l;
-} Closure;
-
-
-#define iscfunction(o)	(ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
-#define isLfunction(o)	(ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
-
-
-/*
-** Tables
-*/
-
-typedef union TKey {
-  struct {
-    TValuefields;
-    struct Node *next;  /* for chaining */
-  } nk;
-  TValue tvk;
-} TKey;
-
-
-typedef struct Node {
-  TValue i_val;
-  TKey i_key;
-} Node;
-
-
-typedef struct Table {
-  CommonHeader;
-  lu_byte flags;  /* 1<<p means tagmethod(p) is not present */
-  lu_byte lsizenode;  /* log2 of size of `node' array */
-  struct Table *metatable;
-  TValue *array;  /* array part */
-  Node *node;
-  Node *lastfree;  /* any free position is before this position */
-  GCObject *gclist;
-  int sizearray;  /* size of `array' array */
-} Table;
-
-
-
-/*
-** `module' operation for hashing (size is always a power of 2)
-*/
-#define lmod(s,size) \
-	(check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
-
-
-#define twoto(x)	(1<<(x))
-#define sizenode(t)	(twoto((t)->lsizenode))
-
-
-#define luaO_nilobject		(&luaO_nilobject_)
-
-LUAI_DATA const TValue luaO_nilobject_;
-
-#define ceillog2(x)	(luaO_log2((x)-1) + 1)
-
-LUAI_FUNC int luaO_log2 (unsigned int x);
-LUAI_FUNC int luaO_int2fb (unsigned int x);
-LUAI_FUNC int luaO_fb2int (int x);
-LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
-LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
-LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
-                                                       va_list argp);
-LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
-LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);
-
-
-#endif
-
diff --git a/misc/liblua/lopcodes.c b/misc/liblua/lopcodes.c
deleted file mode 100644
index 4cc7452..0000000
--- a/misc/liblua/lopcodes.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
-** See Copyright Notice in lua.h
-*/
-
-
-#define lopcodes_c
-#define LUA_CORE
-
-
-#include "lopcodes.h"
-
-
-/* ORDER OP */
-
-const char *const luaP_opnames[NUM_OPCODES+1] = {
-  "MOVE",
-  "LOADK",
-  "LOADBOOL",
-  "LOADNIL",
-  "GETUPVAL",
-  "GETGLOBAL",
-  "GETTABLE",
-  "SETGLOBAL",
-  "SETUPVAL",
-  "SETTABLE",
-  "NEWTABLE",
-  "SELF",
-  "ADD",
-  "SUB",
-  "MUL",
-  "DIV",
-  "MOD",
-  "POW",
-  "UNM",
-  "NOT",
-  "LEN",
-  "CONCAT",
-  "JMP",
-  "EQ",
-  "LT",
-  "LE",
-  "TEST",
-  "TESTSET",
-  "CALL",
-  "TAILCALL",
-  "RETURN",
-  "FORLOOP",
-  "FORPREP",
-  "TFORLOOP",
-  "SETLIST",
-  "CLOSE",
-  "CLOSURE",
-  "VARARG",
-  NULL
-};
-
-
-#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
-
-const lu_byte luaP_opmodes[NUM_OPCODES] = {
-/*       T  A    B       C     mode		   opcode	*/
-  opmode(0, 1, OpArgR, OpArgN, iABC) 		/* OP_MOVE */
- ,opmode(0, 1, OpArgK, OpArgN, iABx)		/* OP_LOADK */
- ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_LOADBOOL */
- ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_LOADNIL */
- ,opmode(0, 1, OpArgU, OpArgN, iABC)		/* OP_GETUPVAL */
- ,opmode(0, 1, OpArgK, OpArgN, iABx)		/* OP_GETGLOBAL */
- ,opmode(0, 1, OpArgR, OpArgK, iABC)		/* OP_GETTABLE */
- ,opmode(0, 0, OpArgK, OpArgN, iABx)		/* OP_SETGLOBAL */
- ,opmode(0, 0, OpArgU, OpArgN, iABC)		/* OP_SETUPVAL */
- ,opmode(0, 0, OpArgK, OpArgK, iABC)		/* OP_SETTABLE */
- ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_NEWTABLE */
- ,opmode(0, 1, OpArgR, OpArgK, iABC)		/* OP_SELF */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_ADD */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_SUB */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_MUL */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_DIV */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_MOD */
- ,opmode(0, 1, OpArgK, OpArgK, iABC)		/* OP_POW */
- ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_UNM */
- ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_NOT */
- ,opmode(0, 1, OpArgR, OpArgN, iABC)		/* OP_LEN */
- ,opmode(0, 1, OpArgR, OpArgR, iABC)		/* OP_CONCAT */
- ,opmode(0, 0, OpArgR, OpArgN, iAsBx)		/* OP_JMP */
- ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_EQ */
- ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_LT */
- ,opmode(1, 0, OpArgK, OpArgK, iABC)		/* OP_LE */
- ,opmode(1, 1, OpArgR, OpArgU, iABC)		/* OP_TEST */
- ,opmode(1, 1, OpArgR, OpArgU, iABC)		/* OP_TESTSET */
- ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_CALL */
- ,opmode(0, 1, OpArgU, OpArgU, iABC)		/* OP_TAILCALL */
- ,opmode(0, 0, OpArgU, OpArgN, iABC)		/* OP_RETURN */
- ,opmode(0, 1, OpArgR, OpArgN, iAsBx)		/* OP_FORLOOP */
- ,opmode(0, 1, OpArgR, OpArgN, iAsBx)		/* OP_FORPREP */
- ,opmode(1, 0, OpArgN, OpArgU, iABC)		/* OP_TFORLOOP */
- ,opmode(0, 0, OpArgU, OpArgU, iABC)		/* OP_SETLIST */
- ,opmode(0, 0, OpArgN, OpArgN, iABC)		/* OP_CLOSE */
- ,opmode(0, 1, OpArgU, OpArgN, iABx)		/* OP_CLOSURE */
- ,opmode(0, 1, OpArgU, OpArgN, iABC)		/* OP_VARARG */
-};
-
diff --git a/misc/liblua/lopcodes.h b/misc/liblua/lopcodes.h
deleted file mode 100644
index b4b86cf..0000000
--- a/misc/liblua/lopcodes.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
-** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $
-** Opcodes for Lua virtual machine
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lopcodes_h
-#define lopcodes_h
-
-#include "llimits.h"
-
-
-/*===========================================================================
-  We assume that instructions are unsigned numbers.
-  All instructions have an opcode in the first 6 bits.
-  Instructions can have the following fields:
-	`A' : 8 bits
-	`B' : 9 bits
-	`C' : 9 bits
-	`Bx' : 18 bits (`B' and `C' together)
-	`sBx' : signed Bx
-
-  A signed argument is represented in excess K; that is, the number
-  value is the unsigned value minus K. K is exactly the maximum value
-  for that argument (so that -max is represented by 0, and +max is
-  represented by 2*max), which is half the maximum for the corresponding
-  unsigned argument.
-===========================================================================*/
-
-
-enum OpMode {iABC, iABx, iAsBx};  /* basic instruction format */
-
-
-/*
-** size and position of opcode arguments.
-*/
-#define SIZE_C		9
-#define SIZE_B		9
-#define SIZE_Bx		(SIZE_C + SIZE_B)
-#define SIZE_A		8
-
-#define SIZE_OP		6
-
-#define POS_OP		0
-#define POS_A		(POS_OP + SIZE_OP)
-#define POS_C		(POS_A + SIZE_A)
-#define POS_B		(POS_C + SIZE_C)
-#define POS_Bx		POS_C
-
-
-/*
-** limits for opcode arguments.
-** we use (signed) int to manipulate most arguments,
-** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)
-*/
-#if SIZE_Bx < LUAI_BITSINT-1
-#define MAXARG_Bx        ((1<<SIZE_Bx)-1)
-#define MAXARG_sBx        (MAXARG_Bx>>1)         /* `sBx' is signed */
-#else
-#define MAXARG_Bx        MAX_INT
-#define MAXARG_sBx        MAX_INT
-#endif
-
-
-#define MAXARG_A        ((1<<SIZE_A)-1)
-#define MAXARG_B        ((1<<SIZE_B)-1)
-#define MAXARG_C        ((1<<SIZE_C)-1)
-
-
-/* creates a mask with `n' 1 bits at position `p' */
-#define MASK1(n,p)	((~((~(Instruction)0)<<n))<<p)
-
-/* creates a mask with `n' 0 bits at position `p' */
-#define MASK0(n,p)	(~MASK1(n,p))
-
-/*
-** the following macros help to manipulate instructions
-*/
-
-#define GET_OPCODE(i)	(cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
-#define SET_OPCODE(i,o)	((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
-		((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
-
-#define GETARG_A(i)	(cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))
-#define SETARG_A(i,u)	((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
-		((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))
-
-#define GETARG_B(i)	(cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))
-#define SETARG_B(i,b)	((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
-		((cast(Instruction, b)<<POS_B)&MASK1(SIZE_B,POS_B))))
-
-#define GETARG_C(i)	(cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))
-#define SETARG_C(i,b)	((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
-		((cast(Instruction, b)<<POS_C)&MASK1(SIZE_C,POS_C))))
-
-#define GETARG_Bx(i)	(cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))
-#define SETARG_Bx(i,b)	((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
-		((cast(Instruction, b)<<POS_Bx)&MASK1(SIZE_Bx,POS_Bx))))
-
-#define GETARG_sBx(i)	(GETARG_Bx(i)-MAXARG_sBx)
-#define SETARG_sBx(i,b)	SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
-
-
-#define CREATE_ABC(o,a,b,c)	((cast(Instruction, o)<<POS_OP) \
-			| (cast(Instruction, a)<<POS_A) \
-			| (cast(Instruction, b)<<POS_B) \
-			| (cast(Instruction, c)<<POS_C))
-
-#define CREATE_ABx(o,a,bc)	((cast(Instruction, o)<<POS_OP) \
-			| (cast(Instruction, a)<<POS_A) \
-			| (cast(Instruction, bc)<<POS_Bx))
-
-
-/*
-** Macros to operate RK indices
-*/
-
-/* this bit 1 means constant (0 means register) */
-#define BITRK		(1 << (SIZE_B - 1))
-
-/* test whether value is a constant */
-#define ISK(x)		((x) & BITRK)
-
-/* gets the index of the constant */
-#define INDEXK(r)	((int)(r) & ~BITRK)
-
-#define MAXINDEXRK	(BITRK - 1)
-
-/* code a constant index as a RK value */
-#define RKASK(x)	((x) | BITRK)
-
-
-/*
-** invalid register that fits in 8 bits
-*/
-#define NO_REG		MAXARG_A
-
-
-/*
-** R(x) - register
-** Kst(x) - constant (in constant table)
-** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)
-*/
-
-
-/*
-** grep "ORDER OP" if you change these enums
-*/
-
-typedef enum {
-/*----------------------------------------------------------------------
-name		args	description
-------------------------------------------------------------------------*/
-OP_MOVE,/*	A B	R(A) := R(B)					*/
-OP_LOADK,/*	A Bx	R(A) := Kst(Bx)					*/
-OP_LOADBOOL,/*	A B C	R(A) := (Bool)B; if (C) pc++			*/
-OP_LOADNIL,/*	A B	R(A) := ... := R(B) := nil			*/
-OP_GETUPVAL,/*	A B	R(A) := UpValue[B]				*/
-
-OP_GETGLOBAL,/*	A Bx	R(A) := Gbl[Kst(Bx)]				*/
-OP_GETTABLE,/*	A B C	R(A) := R(B)[RK(C)]				*/
-
-OP_SETGLOBAL,/*	A Bx	Gbl[Kst(Bx)] := R(A)				*/
-OP_SETUPVAL,/*	A B	UpValue[B] := R(A)				*/
-OP_SETTABLE,/*	A B C	R(A)[RK(B)] := RK(C)				*/
-
-OP_NEWTABLE,/*	A B C	R(A) := {} (size = B,C)				*/
-
-OP_SELF,/*	A B C	R(A+1) := R(B); R(A) := R(B)[RK(C)]		*/
-
-OP_ADD,/*	A B C	R(A) := RK(B) + RK(C)				*/
-OP_SUB,/*	A B C	R(A) := RK(B) - RK(C)				*/
-OP_MUL,/*	A B C	R(A) := RK(B) * RK(C)				*/
-OP_DIV,/*	A B C	R(A) := RK(B) / RK(C)				*/
-OP_MOD,/*	A B C	R(A) := RK(B) % RK(C)				*/
-OP_POW,/*	A B C	R(A) := RK(B) ^ RK(C)				*/
-OP_UNM,/*	A B	R(A) := -R(B)					*/
-OP_NOT,/*	A B	R(A) := not R(B)				*/
-OP_LEN,/*	A B	R(A) := length of R(B)				*/
-
-OP_CONCAT,/*	A B C	R(A) := R(B).. ... ..R(C)			*/
-
-OP_JMP,/*	sBx	pc+=sBx					*/
-
-OP_EQ,/*	A B C	if ((RK(B) == RK(C)) ~= A) then pc++		*/
-OP_LT,/*	A B C	if ((RK(B) <  RK(C)) ~= A) then pc++  		*/
-OP_LE,/*	A B C	if ((RK(B) <= RK(C)) ~= A) then pc++  		*/
-
-OP_TEST,/*	A C	if not (R(A) <=> C) then pc++			*/
-OP_TESTSET,/*	A B C	if (R(B) <=> C) then R(A) := R(B) else pc++	*/
-
-OP_CALL,/*	A B C	R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
-OP_TAILCALL,/*	A B C	return R(A)(R(A+1), ... ,R(A+B-1))		*/
-OP_RETURN,/*	A B	return R(A), ... ,R(A+B-2)	(see note)	*/
-
-OP_FORLOOP,/*	A sBx	R(A)+=R(A+2);
-			if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
-OP_FORPREP,/*	A sBx	R(A)-=R(A+2); pc+=sBx				*/
-
-OP_TFORLOOP,/*	A C	R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
-                        if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++	*/
-OP_SETLIST,/*	A B C	R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B	*/
-
-OP_CLOSE,/*	A 	close all variables in the stack up to (>=) R(A)*/
-OP_CLOSURE,/*	A Bx	R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n))	*/
-
-OP_VARARG/*	A B	R(A), R(A+1), ..., R(A+B-1) = vararg		*/
-} OpCode;
-
-
-#define NUM_OPCODES	(cast(int, OP_VARARG) + 1)
-
-
-
-/*===========================================================================
-  Notes:
-  (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,
-      and can be 0: OP_CALL then sets `top' to last_result+1, so
-      next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.
-
-  (*) In OP_VARARG, if (B == 0) then use actual number of varargs and
-      set top (like in OP_CALL with C == 0).
-
-  (*) In OP_RETURN, if (B == 0) then return up to `top'
-
-  (*) In OP_SETLIST, if (B == 0) then B = `top';
-      if (C == 0) then next `instruction' is real C
-
-  (*) For comparisons, A specifies what condition the test should accept
-      (true or false).
-
-  (*) All `skips' (pc++) assume that next instruction is a jump
-===========================================================================*/
-
-
-/*
-** masks for instruction properties. The format is:
-** bits 0-1: op mode
-** bits 2-3: C arg mode
-** bits 4-5: B arg mode
-** bit 6: instruction set register A
-** bit 7: operator is a test
-*/
-
-enum OpArgMask {
-  OpArgN,  /* argument is not used */
-  OpArgU,  /* argument is used */
-  OpArgR,  /* argument is a register or a jump offset */
-  OpArgK   /* argument is a constant or register/constant */
-};
-
-LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
-
-#define getOpMode(m)	(cast(enum OpMode, luaP_opmodes[m] & 3))
-#define getBMode(m)	(cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
-#define getCMode(m)	(cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
-#define testAMode(m)	(luaP_opmodes[m] & (1 << 6))
-#define testTMode(m)	(luaP_opmodes[m] & (1 << 7))
-
-
-LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1];  /* opcode names */
-
-
-/* number of list items to accumulate before a SETLIST instruction */
-#define LFIELDS_PER_FLUSH	50
-
-
-#endif
diff --git a/misc/liblua/loslib.c b/misc/liblua/loslib.c
deleted file mode 100644
index da06a57..0000000
--- a/misc/liblua/loslib.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
-** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $
-** Standard Operating System library
-** See Copyright Notice in lua.h
-*/
-
-
-#include <errno.h>
-#include <locale.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define loslib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-static int os_pushresult (lua_State *L, int i, const char *filename) {
-  int en = errno;  /* calls to Lua API may change this value */
-  if (i) {
-    lua_pushboolean(L, 1);
-    return 1;
-  }
-  else {
-    lua_pushnil(L);
-    lua_pushfstring(L, "%s: %s", filename, strerror(en));
-    lua_pushinteger(L, en);
-    return 3;
-  }
-}
-
-
-static int os_execute (lua_State *L) {
-  lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
-  return 1;
-}
-
-
-static int os_remove (lua_State *L) {
-  const char *filename = luaL_checkstring(L, 1);
-  return os_pushresult(L, remove(filename) == 0, filename);
-}
-
-
-static int os_rename (lua_State *L) {
-  const char *fromname = luaL_checkstring(L, 1);
-  const char *toname = luaL_checkstring(L, 2);
-  return os_pushresult(L, rename(fromname, toname) == 0, fromname);
-}
-
-
-static int os_tmpname (lua_State *L) {
-  char buff[LUA_TMPNAMBUFSIZE];
-  int err;
-  lua_tmpnam(buff, err);
-  if (err)
-    return luaL_error(L, "unable to generate a unique filename");
-  lua_pushstring(L, buff);
-  return 1;
-}
-
-
-static int os_getenv (lua_State *L) {
-  lua_pushstring(L, getenv(luaL_checkstring(L, 1)));  /* if NULL push nil */
-  return 1;
-}
-
-
-static int os_clock (lua_State *L) {
-  lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
-  return 1;
-}
-
-
-/*
-** {======================================================
-** Time/Date operations
-** { year=%Y, month=%m, day=%d, hour=%H, min=%M, sec=%S,
-**   wday=%w+1, yday=%j, isdst=? }
-** =======================================================
-*/
-
-static void setfield (lua_State *L, const char *key, int value) {
-  lua_pushinteger(L, value);
-  lua_setfield(L, -2, key);
-}
-
-static void setboolfield (lua_State *L, const char *key, int value) {
-  if (value < 0)  /* undefined? */
-    return;  /* does not set field */
-  lua_pushboolean(L, value);
-  lua_setfield(L, -2, key);
-}
-
-static int getboolfield (lua_State *L, const char *key) {
-  int res;
-  lua_getfield(L, -1, key);
-  res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1);
-  lua_pop(L, 1);
-  return res;
-}
-
-
-static int getfield (lua_State *L, const char *key, int d) {
-  int res;
-  lua_getfield(L, -1, key);
-  if (lua_isnumber(L, -1))
-    res = (int)lua_tointeger(L, -1);
-  else {
-    if (d < 0)
-      return luaL_error(L, "field " LUA_QS " missing in date table", key);
-    res = d;
-  }
-  lua_pop(L, 1);
-  return res;
-}
-
-
-static int os_date (lua_State *L) {
-  const char *s = luaL_optstring(L, 1, "%c");
-  time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL));
-  struct tm *stm;
-  if (*s == '!') {  /* UTC? */
-    stm = gmtime(&t);
-    s++;  /* skip `!' */
-  }
-  else
-    stm = localtime(&t);
-  if (stm == NULL)  /* invalid date? */
-    lua_pushnil(L);
-  else if (strcmp(s, "*t") == 0) {
-    lua_createtable(L, 0, 9);  /* 9 = number of fields */
-    setfield(L, "sec", stm->tm_sec);
-    setfield(L, "min", stm->tm_min);
-    setfield(L, "hour", stm->tm_hour);
-    setfield(L, "day", stm->tm_mday);
-    setfield(L, "month", stm->tm_mon+1);
-    setfield(L, "year", stm->tm_year+1900);
-    setfield(L, "wday", stm->tm_wday+1);
-    setfield(L, "yday", stm->tm_yday+1);
-    setboolfield(L, "isdst", stm->tm_isdst);
-  }
-  else {
-    char cc[3];
-    luaL_Buffer b;
-    cc[0] = '%'; cc[2] = '\0';
-    luaL_buffinit(L, &b);
-    for (; *s; s++) {
-      if (*s != '%' || *(s + 1) == '\0')  /* no conversion specifier? */
-        luaL_addchar(&b, *s);
-      else {
-        size_t reslen;
-        char buff[200];  /* should be big enough for any conversion result */
-        cc[1] = *(++s);
-        reslen = strftime(buff, sizeof(buff), cc, stm);
-        luaL_addlstring(&b, buff, reslen);
-      }
-    }
-    luaL_pushresult(&b);
-  }
-  return 1;
-}
-
-
-static int os_time (lua_State *L) {
-  time_t t;
-  if (lua_isnoneornil(L, 1))  /* called without args? */
-    t = time(NULL);  /* get current time */
-  else {
-    struct tm ts;
-    luaL_checktype(L, 1, LUA_TTABLE);
-    lua_settop(L, 1);  /* make sure table is at the top */
-    ts.tm_sec = getfield(L, "sec", 0);
-    ts.tm_min = getfield(L, "min", 0);
-    ts.tm_hour = getfield(L, "hour", 12);
-    ts.tm_mday = getfield(L, "day", -1);
-    ts.tm_mon = getfield(L, "month", -1) - 1;
-    ts.tm_year = getfield(L, "year", -1) - 1900;
-    ts.tm_isdst = getboolfield(L, "isdst");
-    t = mktime(&ts);
-  }
-  if (t == (time_t)(-1))
-    lua_pushnil(L);
-  else
-    lua_pushnumber(L, (lua_Number)t);
-  return 1;
-}
-
-
-static int os_difftime (lua_State *L) {
-  lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)),
-                             (time_t)(luaL_optnumber(L, 2, 0))));
-  return 1;
-}
-
-/* }====================================================== */
-
-
-static int os_setlocale (lua_State *L) {
-  static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
-                      LC_NUMERIC, LC_TIME};
-  static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
-     "numeric", "time", NULL};
-  const char *l = luaL_optstring(L, 1, NULL);
-  int op = luaL_checkoption(L, 2, "all", catnames);
-  lua_pushstring(L, setlocale(cat[op], l));
-  return 1;
-}
-
-
-static int os_exit (lua_State *L) {
-  exit(luaL_optint(L, 1, EXIT_SUCCESS));
-}
-
-static const luaL_Reg syslib[] = {
-  {"clock",     os_clock},
-  {"date",      os_date},
-  {"difftime",  os_difftime},
-  {"execute",   os_execute},
-  {"exit",      os_exit},
-  {"getenv",    os_getenv},
-  {"remove",    os_remove},
-  {"rename",    os_rename},
-  {"setlocale", os_setlocale},
-  {"time",      os_time},
-  {"tmpname",   os_tmpname},
-  {NULL, NULL}
-};
-
-/* }====================================================== */
-
-
-
-LUALIB_API int luaopen_os (lua_State *L) {
-  luaL_register(L, LUA_OSLIBNAME, syslib);
-  return 1;
-}
-
diff --git a/misc/liblua/lparser.c b/misc/liblua/lparser.c
deleted file mode 100644
index 1e2a9a8..0000000
--- a/misc/liblua/lparser.c
+++ /dev/null
@@ -1,1339 +0,0 @@
-/*
-** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $
-** Lua Parser
-** See Copyright Notice in lua.h
-*/
-
-
-#include <string.h>
-
-#define lparser_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lcode.h"
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "llex.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lparser.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-
-
-
-#define hasmultret(k)		((k) == VCALL || (k) == VVARARG)
-
-#define getlocvar(fs, i)	((fs)->f->locvars[(fs)->actvar[i]])
-
-#define luaY_checklimit(fs,v,l,m)	if ((v)>(l)) errorlimit(fs,l,m)
-
-
-/*
-** nodes for block list (list of active blocks)
-*/
-typedef struct BlockCnt {
-  struct BlockCnt *previous;  /* chain */
-  int breaklist;  /* list of jumps out of this loop */
-  lu_byte nactvar;  /* # active locals outside the breakable structure */
-  lu_byte upval;  /* true if some variable in the block is an upvalue */
-  lu_byte isbreakable;  /* true if `block' is a loop */
-} BlockCnt;
-
-
-
-/*
-** prototypes for recursive non-terminal functions
-*/
-static void chunk (LexState *ls);
-static void expr (LexState *ls, expdesc *v);
-
-
-static void anchor_token (LexState *ls) {
-  if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) {
-    TString *ts = ls->t.seminfo.ts;
-    luaX_newstring(ls, getstr(ts), ts->tsv.len);
-  }
-}
-
-
-static void error_expected (LexState *ls, int token) {
-  luaX_syntaxerror(ls,
-      luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token)));
-}
-
-
-static void errorlimit (FuncState *fs, int limit, const char *what) {
-  const char *msg = (fs->f->linedefined == 0) ?
-    luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) :
-    luaO_pushfstring(fs->L, "function at line %d has more than %d %s",
-                            fs->f->linedefined, limit, what);
-  luaX_lexerror(fs->ls, msg, 0);
-}
-
-
-static int testnext (LexState *ls, int c) {
-  if (ls->t.token == c) {
-    luaX_next(ls);
-    return 1;
-  }
-  else return 0;
-}
-
-
-static void check (LexState *ls, int c) {
-  if (ls->t.token != c)
-    error_expected(ls, c);
-}
-
-static void checknext (LexState *ls, int c) {
-  check(ls, c);
-  luaX_next(ls);
-}
-
-
-#define check_condition(ls,c,msg)	{ if (!(c)) luaX_syntaxerror(ls, msg); }
-
-
-
-static void check_match (LexState *ls, int what, int who, int where) {
-  if (!testnext(ls, what)) {
-    if (where == ls->linenumber)
-      error_expected(ls, what);
-    else {
-      luaX_syntaxerror(ls, luaO_pushfstring(ls->L,
-             LUA_QS " expected (to close " LUA_QS " at line %d)",
-              luaX_token2str(ls, what), luaX_token2str(ls, who), where));
-    }
-  }
-}
-
-
-static TString *str_checkname (LexState *ls) {
-  TString *ts;
-  check(ls, TK_NAME);
-  ts = ls->t.seminfo.ts;
-  luaX_next(ls);
-  return ts;
-}
-
-
-static void init_exp (expdesc *e, expkind k, int i) {
-  e->f = e->t = NO_JUMP;
-  e->k = k;
-  e->u.s.info = i;
-}
-
-
-static void codestring (LexState *ls, expdesc *e, TString *s) {
-  init_exp(e, VK, luaK_stringK(ls->fs, s));
-}
-
-
-static void checkname(LexState *ls, expdesc *e) {
-  codestring(ls, e, str_checkname(ls));
-}
-
-
-static int registerlocalvar (LexState *ls, TString *varname) {
-  FuncState *fs = ls->fs;
-  Proto *f = fs->f;
-  int oldsize = f->sizelocvars;
-  luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,
-                  LocVar, SHRT_MAX, "too many local variables");
-  while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL;
-  f->locvars[fs->nlocvars].varname = varname;
-  luaC_objbarrier(ls->L, f, varname);
-  return fs->nlocvars++;
-}
-
-
-#define new_localvarliteral(ls,v,n) \
-  new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n)
-
-
-static void new_localvar (LexState *ls, TString *name, int n) {
-  FuncState *fs = ls->fs;
-  luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables");
-  fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name));
-}
-
-
-static void adjustlocalvars (LexState *ls, int nvars) {
-  FuncState *fs = ls->fs;
-  fs->nactvar = cast_byte(fs->nactvar + nvars);
-  for (; nvars; nvars--) {
-    getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc;
-  }
-}
-
-
-static void removevars (LexState *ls, int tolevel) {
-  FuncState *fs = ls->fs;
-  while (fs->nactvar > tolevel)
-    getlocvar(fs, --fs->nactvar).endpc = fs->pc;
-}
-
-
-static int indexupvalue (FuncState *fs, TString *name, expdesc *v) {
-  int i;
-  Proto *f = fs->f;
-  int oldsize = f->sizeupvalues;
-  for (i=0; i<f->nups; i++) {
-    if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) {
-      lua_assert(f->upvalues[i] == name);
-      return i;
-    }
-  }
-  /* new one */
-  luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues");
-  luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues,
-                  TString *, MAX_INT, "");
-  while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL;
-  f->upvalues[f->nups] = name;
-  luaC_objbarrier(fs->L, f, name);
-  lua_assert(v->k == VLOCAL || v->k == VUPVAL);
-  fs->upvalues[f->nups].k = cast_byte(v->k);
-  fs->upvalues[f->nups].info = cast_byte(v->u.s.info);
-  return f->nups++;
-}
-
-
-static int searchvar (FuncState *fs, TString *n) {
-  int i;
-  for (i=fs->nactvar-1; i >= 0; i--) {
-    if (n == getlocvar(fs, i).varname)
-      return i;
-  }
-  return -1;  /* not found */
-}
-
-
-static void markupval (FuncState *fs, int level) {
-  BlockCnt *bl = fs->bl;
-  while (bl && bl->nactvar > level) bl = bl->previous;
-  if (bl) bl->upval = 1;
-}
-
-
-static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {
-  if (fs == NULL) {  /* no more levels? */
-    init_exp(var, VGLOBAL, NO_REG);  /* default is global variable */
-    return VGLOBAL;
-  }
-  else {
-    int v = searchvar(fs, n);  /* look up at current level */
-    if (v >= 0) {
-      init_exp(var, VLOCAL, v);
-      if (!base)
-        markupval(fs, v);  /* local will be used as an upval */
-      return VLOCAL;
-    }
-    else {  /* not found at current level; try upper one */
-      if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL)
-        return VGLOBAL;
-      var->u.s.info = indexupvalue(fs, n, var);  /* else was LOCAL or UPVAL */
-      var->k = VUPVAL;  /* upvalue in this level */
-      return VUPVAL;
-    }
-  }
-}
-
-
-static void singlevar (LexState *ls, expdesc *var) {
-  TString *varname = str_checkname(ls);
-  FuncState *fs = ls->fs;
-  if (singlevaraux(fs, varname, var, 1) == VGLOBAL)
-    var->u.s.info = luaK_stringK(fs, varname);  /* info points to global name */
-}
-
-
-static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
-  FuncState *fs = ls->fs;
-  int extra = nvars - nexps;
-  if (hasmultret(e->k)) {
-    extra++;  /* includes call itself */
-    if (extra < 0) extra = 0;
-    luaK_setreturns(fs, e, extra);  /* last exp. provides the difference */
-    if (extra > 1) luaK_reserveregs(fs, extra-1);
-  }
-  else {
-    if (e->k != VVOID) luaK_exp2nextreg(fs, e);  /* close last expression */
-    if (extra > 0) {
-      int reg = fs->freereg;
-      luaK_reserveregs(fs, extra);
-      luaK_nil(fs, reg, extra);
-    }
-  }
-}
-
-
-static void enterlevel (LexState *ls) {
-  if (++ls->L->nCcalls > LUAI_MAXCCALLS)
-	luaX_lexerror(ls, "chunk has too many syntax levels", 0);
-}
-
-
-#define leavelevel(ls)	((ls)->L->nCcalls--)
-
-
-static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) {
-  bl->breaklist = NO_JUMP;
-  bl->isbreakable = isbreakable;
-  bl->nactvar = fs->nactvar;
-  bl->upval = 0;
-  bl->previous = fs->bl;
-  fs->bl = bl;
-  lua_assert(fs->freereg == fs->nactvar);
-}
-
-
-static void leaveblock (FuncState *fs) {
-  BlockCnt *bl = fs->bl;
-  fs->bl = bl->previous;
-  removevars(fs->ls, bl->nactvar);
-  if (bl->upval)
-    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
-  /* a block either controls scope or breaks (never both) */
-  lua_assert(!bl->isbreakable || !bl->upval);
-  lua_assert(bl->nactvar == fs->nactvar);
-  fs->freereg = fs->nactvar;  /* free registers */
-  luaK_patchtohere(fs, bl->breaklist);
-}
-
-
-static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
-  FuncState *fs = ls->fs;
-  Proto *f = fs->f;
-  int oldsize = f->sizep;
-  int i;
-  luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
-                  MAXARG_Bx, "constant table overflow");
-  while (oldsize < f->sizep) f->p[oldsize++] = NULL;
-  f->p[fs->np++] = func->f;
-  luaC_objbarrier(ls->L, f, func->f);
-  init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));
-  for (i=0; i<func->f->nups; i++) {
-    OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL;
-    luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0);
-  }
-}
-
-
-static void open_func (LexState *ls, FuncState *fs) {
-  lua_State *L = ls->L;
-  Proto *f = luaF_newproto(L);
-  fs->f = f;
-  fs->prev = ls->fs;  /* linked list of funcstates */
-  fs->ls = ls;
-  fs->L = L;
-  ls->fs = fs;
-  fs->pc = 0;
-  fs->lasttarget = -1;
-  fs->jpc = NO_JUMP;
-  fs->freereg = 0;
-  fs->nk = 0;
-  fs->np = 0;
-  fs->nlocvars = 0;
-  fs->nactvar = 0;
-  fs->bl = NULL;
-  f->source = ls->source;
-  f->maxstacksize = 2;  /* registers 0/1 are always valid */
-  fs->h = luaH_new(L, 0, 0);
-  /* anchor table of constants and prototype (to avoid being collected) */
-  sethvalue2s(L, L->top, fs->h);
-  incr_top(L);
-  setptvalue2s(L, L->top, f);
-  incr_top(L);
-}
-
-
-static void close_func (LexState *ls) {
-  lua_State *L = ls->L;
-  FuncState *fs = ls->fs;
-  Proto *f = fs->f;
-  removevars(ls, 0);
-  luaK_ret(fs, 0, 0);  /* final return */
-  luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);
-  f->sizecode = fs->pc;
-  luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);
-  f->sizelineinfo = fs->pc;
-  luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);
-  f->sizek = fs->nk;
-  luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
-  f->sizep = fs->np;
-  luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
-  f->sizelocvars = fs->nlocvars;
-  luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *);
-  f->sizeupvalues = f->nups;
-  lua_assert(luaG_checkcode(f));
-  lua_assert(fs->bl == NULL);
-  ls->fs = fs->prev;
-  L->top -= 2;  /* remove table and prototype from the stack */
-  /* last token read was anchored in defunct function; must reanchor it */
-  if (fs) anchor_token(ls);
-}
-
-
-Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
-  struct LexState lexstate;
-  struct FuncState funcstate;
-  lexstate.buff = buff;
-  luaX_setinput(L, &lexstate, z, luaS_new(L, name));
-  open_func(&lexstate, &funcstate);
-  funcstate.f->is_vararg = VARARG_ISVARARG;  /* main func. is always vararg */
-  luaX_next(&lexstate);  /* read first token */
-  chunk(&lexstate);
-  check(&lexstate, TK_EOS);
-  close_func(&lexstate);
-  lua_assert(funcstate.prev == NULL);
-  lua_assert(funcstate.f->nups == 0);
-  lua_assert(lexstate.fs == NULL);
-  return funcstate.f;
-}
-
-
-
-/*============================================================*/
-/* GRAMMAR RULES */
-/*============================================================*/
-
-
-static void field (LexState *ls, expdesc *v) {
-  /* field -> ['.' | ':'] NAME */
-  FuncState *fs = ls->fs;
-  expdesc key;
-  luaK_exp2anyreg(fs, v);
-  luaX_next(ls);  /* skip the dot or colon */
-  checkname(ls, &key);
-  luaK_indexed(fs, v, &key);
-}
-
-
-static void yindex (LexState *ls, expdesc *v) {
-  /* index -> '[' expr ']' */
-  luaX_next(ls);  /* skip the '[' */
-  expr(ls, v);
-  luaK_exp2val(ls->fs, v);
-  checknext(ls, ']');
-}
-
-
-/*
-** {======================================================================
-** Rules for Constructors
-** =======================================================================
-*/
-
-
-struct ConsControl {
-  expdesc v;  /* last list item read */
-  expdesc *t;  /* table descriptor */
-  int nh;  /* total number of `record' elements */
-  int na;  /* total number of array elements */
-  int tostore;  /* number of array elements pending to be stored */
-};
-
-
-static void recfield (LexState *ls, struct ConsControl *cc) {
-  /* recfield -> (NAME | `['exp1`]') = exp1 */
-  FuncState *fs = ls->fs;
-  int reg = ls->fs->freereg;
-  expdesc key, val;
-  int rkkey;
-  if (ls->t.token == TK_NAME) {
-    luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
-    checkname(ls, &key);
-  }
-  else  /* ls->t.token == '[' */
-    yindex(ls, &key);
-  cc->nh++;
-  checknext(ls, '=');
-  rkkey = luaK_exp2RK(fs, &key);
-  expr(ls, &val);
-  luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val));
-  fs->freereg = reg;  /* free registers */
-}
-
-
-static void closelistfield (FuncState *fs, struct ConsControl *cc) {
-  if (cc->v.k == VVOID) return;  /* there is no list item */
-  luaK_exp2nextreg(fs, &cc->v);
-  cc->v.k = VVOID;
-  if (cc->tostore == LFIELDS_PER_FLUSH) {
-    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);  /* flush */
-    cc->tostore = 0;  /* no more items pending */
-  }
-}
-
-
-static void lastlistfield (FuncState *fs, struct ConsControl *cc) {
-  if (cc->tostore == 0) return;
-  if (hasmultret(cc->v.k)) {
-    luaK_setmultret(fs, &cc->v);
-    luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET);
-    cc->na--;  /* do not count last expression (unknown number of elements) */
-  }
-  else {
-    if (cc->v.k != VVOID)
-      luaK_exp2nextreg(fs, &cc->v);
-    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);
-  }
-}
-
-
-static void listfield (LexState *ls, struct ConsControl *cc) {
-  expr(ls, &cc->v);
-  luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor");
-  cc->na++;
-  cc->tostore++;
-}
-
-
-static void constructor (LexState *ls, expdesc *t) {
-  /* constructor -> ?? */
-  FuncState *fs = ls->fs;
-  int line = ls->linenumber;
-  int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0);
-  struct ConsControl cc;
-  cc.na = cc.nh = cc.tostore = 0;
-  cc.t = t;
-  init_exp(t, VRELOCABLE, pc);
-  init_exp(&cc.v, VVOID, 0);  /* no value (yet) */
-  luaK_exp2nextreg(ls->fs, t);  /* fix it at stack top (for gc) */
-  checknext(ls, '{');
-  do {
-    lua_assert(cc.v.k == VVOID || cc.tostore > 0);
-    if (ls->t.token == '}') break;
-    closelistfield(fs, &cc);
-    switch(ls->t.token) {
-      case TK_NAME: {  /* may be listfields or recfields */
-        luaX_lookahead(ls);
-        if (ls->lookahead.token != '=')  /* expression? */
-          listfield(ls, &cc);
-        else
-          recfield(ls, &cc);
-        break;
-      }
-      case '[': {  /* constructor_item -> recfield */
-        recfield(ls, &cc);
-        break;
-      }
-      default: {  /* constructor_part -> listfield */
-        listfield(ls, &cc);
-        break;
-      }
-    }
-  } while (testnext(ls, ',') || testnext(ls, ';'));
-  check_match(ls, '}', '{', line);
-  lastlistfield(fs, &cc);
-  SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */
-  SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh));  /* set initial table size */
-}
-
-/* }====================================================================== */
-
-
-
-static void parlist (LexState *ls) {
-  /* parlist -> [ param { `,' param } ] */
-  FuncState *fs = ls->fs;
-  Proto *f = fs->f;
-  int nparams = 0;
-  f->is_vararg = 0;
-  if (ls->t.token != ')') {  /* is `parlist' not empty? */
-    do {
-      switch (ls->t.token) {
-        case TK_NAME: {  /* param -> NAME */
-          new_localvar(ls, str_checkname(ls), nparams++);
-          break;
-        }
-        case TK_DOTS: {  /* param -> `...' */
-          luaX_next(ls);
-#if defined(LUA_COMPAT_VARARG)
-          /* use `arg' as default name */
-          new_localvarliteral(ls, "arg", nparams++);
-          f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG;
-#endif
-          f->is_vararg |= VARARG_ISVARARG;
-          break;
-        }
-        default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected");
-      }
-    } while (!f->is_vararg && testnext(ls, ','));
-  }
-  adjustlocalvars(ls, nparams);
-  f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG));
-  luaK_reserveregs(fs, fs->nactvar);  /* reserve register for parameters */
-}
-
-
-static void body (LexState *ls, expdesc *e, int needself, int line) {
-  /* body ->  `(' parlist `)' chunk END */
-  FuncState new_fs;
-  open_func(ls, &new_fs);
-  new_fs.f->linedefined = line;
-  checknext(ls, '(');
-  if (needself) {
-    new_localvarliteral(ls, "self", 0);
-    adjustlocalvars(ls, 1);
-  }
-  parlist(ls);
-  checknext(ls, ')');
-  chunk(ls);
-  new_fs.f->lastlinedefined = ls->linenumber;
-  check_match(ls, TK_END, TK_FUNCTION, line);
-  close_func(ls);
-  pushclosure(ls, &new_fs, e);
-}
-
-
-static int explist1 (LexState *ls, expdesc *v) {
-  /* explist1 -> expr { `,' expr } */
-  int n = 1;  /* at least one expression */
-  expr(ls, v);
-  while (testnext(ls, ',')) {
-    luaK_exp2nextreg(ls->fs, v);
-    expr(ls, v);
-    n++;
-  }
-  return n;
-}
-
-
-static void funcargs (LexState *ls, expdesc *f) {
-  FuncState *fs = ls->fs;
-  expdesc args;
-  int base, nparams;
-  int line = ls->linenumber;
-  switch (ls->t.token) {
-    case '(': {  /* funcargs -> `(' [ explist1 ] `)' */
-      if (line != ls->lastline)
-        luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)");
-      luaX_next(ls);
-      if (ls->t.token == ')')  /* arg list is empty? */
-        args.k = VVOID;
-      else {
-        explist1(ls, &args);
-        luaK_setmultret(fs, &args);
-      }
-      check_match(ls, ')', '(', line);
-      break;
-    }
-    case '{': {  /* funcargs -> constructor */
-      constructor(ls, &args);
-      break;
-    }
-    case TK_STRING: {  /* funcargs -> STRING */
-      codestring(ls, &args, ls->t.seminfo.ts);
-      luaX_next(ls);  /* must use `seminfo' before `next' */
-      break;
-    }
-    default: {
-      luaX_syntaxerror(ls, "function arguments expected");
-      return;
-    }
-  }
-  lua_assert(f->k == VNONRELOC);
-  base = f->u.s.info;  /* base register for call */
-  if (hasmultret(args.k))
-    nparams = LUA_MULTRET;  /* open call */
-  else {
-    if (args.k != VVOID)
-      luaK_exp2nextreg(fs, &args);  /* close last argument */
-    nparams = fs->freereg - (base+1);
-  }
-  init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2));
-  luaK_fixline(fs, line);
-  fs->freereg = base+1;  /* call remove function and arguments and leaves
-                            (unless changed) one result */
-}
-
-
-
-
-/*
-** {======================================================================
-** Expression parsing
-** =======================================================================
-*/
-
-
-static void prefixexp (LexState *ls, expdesc *v) {
-  /* prefixexp -> NAME | '(' expr ')' */
-  switch (ls->t.token) {
-    case '(': {
-      int line = ls->linenumber;
-      luaX_next(ls);
-      expr(ls, v);
-      check_match(ls, ')', '(', line);
-      luaK_dischargevars(ls->fs, v);
-      return;
-    }
-    case TK_NAME: {
-      singlevar(ls, v);
-      return;
-    }
-    default: {
-      luaX_syntaxerror(ls, "unexpected symbol");
-      return;
-    }
-  }
-}
-
-
-static void primaryexp (LexState *ls, expdesc *v) {
-  /* primaryexp ->
-        prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */
-  FuncState *fs = ls->fs;
-  prefixexp(ls, v);
-  for (;;) {
-    switch (ls->t.token) {
-      case '.': {  /* field */
-        field(ls, v);
-        break;
-      }
-      case '[': {  /* `[' exp1 `]' */
-        expdesc key;
-        luaK_exp2anyreg(fs, v);
-        yindex(ls, &key);
-        luaK_indexed(fs, v, &key);
-        break;
-      }
-      case ':': {  /* `:' NAME funcargs */
-        expdesc key;
-        luaX_next(ls);
-        checkname(ls, &key);
-        luaK_self(fs, v, &key);
-        funcargs(ls, v);
-        break;
-      }
-      case '(': case TK_STRING: case '{': {  /* funcargs */
-        luaK_exp2nextreg(fs, v);
-        funcargs(ls, v);
-        break;
-      }
-      default: return;
-    }
-  }
-}
-
-
-static void simpleexp (LexState *ls, expdesc *v) {
-  /* simpleexp -> NUMBER | STRING | NIL | true | false | ... |
-                  constructor | FUNCTION body | primaryexp */
-  switch (ls->t.token) {
-    case TK_NUMBER: {
-      init_exp(v, VKNUM, 0);
-      v->u.nval = ls->t.seminfo.r;
-      break;
-    }
-    case TK_STRING: {
-      codestring(ls, v, ls->t.seminfo.ts);
-      break;
-    }
-    case TK_NIL: {
-      init_exp(v, VNIL, 0);
-      break;
-    }
-    case TK_TRUE: {
-      init_exp(v, VTRUE, 0);
-      break;
-    }
-    case TK_FALSE: {
-      init_exp(v, VFALSE, 0);
-      break;
-    }
-    case TK_DOTS: {  /* vararg */
-      FuncState *fs = ls->fs;
-      check_condition(ls, fs->f->is_vararg,
-                      "cannot use " LUA_QL("...") " outside a vararg function");
-      fs->f->is_vararg &= ~VARARG_NEEDSARG;  /* don't need 'arg' */
-      init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));
-      break;
-    }
-    case '{': {  /* constructor */
-      constructor(ls, v);
-      return;
-    }
-    case TK_FUNCTION: {
-      luaX_next(ls);
-      body(ls, v, 0, ls->linenumber);
-      return;
-    }
-    default: {
-      primaryexp(ls, v);
-      return;
-    }
-  }
-  luaX_next(ls);
-}
-
-
-static UnOpr getunopr (int op) {
-  switch (op) {
-    case TK_NOT: return OPR_NOT;
-    case '-': return OPR_MINUS;
-    case '#': return OPR_LEN;
-    default: return OPR_NOUNOPR;
-  }
-}
-
-
-static BinOpr getbinopr (int op) {
-  switch (op) {
-    case '+': return OPR_ADD;
-    case '-': return OPR_SUB;
-    case '*': return OPR_MUL;
-    case '/': return OPR_DIV;
-    case '%': return OPR_MOD;
-    case '^': return OPR_POW;
-    case TK_CONCAT: return OPR_CONCAT;
-    case TK_NE: return OPR_NE;
-    case TK_EQ: return OPR_EQ;
-    case '<': return OPR_LT;
-    case TK_LE: return OPR_LE;
-    case '>': return OPR_GT;
-    case TK_GE: return OPR_GE;
-    case TK_AND: return OPR_AND;
-    case TK_OR: return OPR_OR;
-    default: return OPR_NOBINOPR;
-  }
-}
-
-
-static const struct {
-  lu_byte left;  /* left priority for each binary operator */
-  lu_byte right; /* right priority */
-} priority[] = {  /* ORDER OPR */
-   {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7},  /* `+' `-' `/' `%' */
-   {10, 9}, {5, 4},                 /* power and concat (right associative) */
-   {3, 3}, {3, 3},                  /* equality and inequality */
-   {3, 3}, {3, 3}, {3, 3}, {3, 3},  /* order */
-   {2, 2}, {1, 1}                   /* logical (and/or) */
-};
-
-#define UNARY_PRIORITY	8  /* priority for unary operators */
-
-
-/*
-** subexpr -> (simpleexp | unop subexpr) { binop subexpr }
-** where `binop' is any binary operator with a priority higher than `limit'
-*/
-static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) {
-  BinOpr op;
-  UnOpr uop;
-  enterlevel(ls);
-  uop = getunopr(ls->t.token);
-  if (uop != OPR_NOUNOPR) {
-    luaX_next(ls);
-    subexpr(ls, v, UNARY_PRIORITY);
-    luaK_prefix(ls->fs, uop, v);
-  }
-  else simpleexp(ls, v);
-  /* expand while operators have priorities higher than `limit' */
-  op = getbinopr(ls->t.token);
-  while (op != OPR_NOBINOPR && priority[op].left > limit) {
-    expdesc v2;
-    BinOpr nextop;
-    luaX_next(ls);
-    luaK_infix(ls->fs, op, v);
-    /* read sub-expression with higher priority */
-    nextop = subexpr(ls, &v2, priority[op].right);
-    luaK_posfix(ls->fs, op, v, &v2);
-    op = nextop;
-  }
-  leavelevel(ls);
-  return op;  /* return first untreated operator */
-}
-
-
-static void expr (LexState *ls, expdesc *v) {
-  subexpr(ls, v, 0);
-}
-
-/* }==================================================================== */
-
-
-
-/*
-** {======================================================================
-** Rules for Statements
-** =======================================================================
-*/
-
-
-static int block_follow (int token) {
-  switch (token) {
-    case TK_ELSE: case TK_ELSEIF: case TK_END:
-    case TK_UNTIL: case TK_EOS:
-      return 1;
-    default: return 0;
-  }
-}
-
-
-static void block (LexState *ls) {
-  /* block -> chunk */
-  FuncState *fs = ls->fs;
-  BlockCnt bl;
-  enterblock(fs, &bl, 0);
-  chunk(ls);
-  lua_assert(bl.breaklist == NO_JUMP);
-  leaveblock(fs);
-}
-
-
-/*
-** structure to chain all variables in the left-hand side of an
-** assignment
-*/
-struct LHS_assign {
-  struct LHS_assign *prev;
-  expdesc v;  /* variable (global, local, upvalue, or indexed) */
-};
-
-
-/*
-** check whether, in an assignment to a local variable, the local variable
-** is needed in a previous assignment (to a table). If so, save original
-** local value in a safe place and use this safe copy in the previous
-** assignment.
-*/
-static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) {
-  FuncState *fs = ls->fs;
-  int extra = fs->freereg;  /* eventual position to save local variable */
-  int conflict = 0;
-  for (; lh; lh = lh->prev) {
-    if (lh->v.k == VINDEXED) {
-      if (lh->v.u.s.info == v->u.s.info) {  /* conflict? */
-        conflict = 1;
-        lh->v.u.s.info = extra;  /* previous assignment will use safe copy */
-      }
-      if (lh->v.u.s.aux == v->u.s.info) {  /* conflict? */
-        conflict = 1;
-        lh->v.u.s.aux = extra;  /* previous assignment will use safe copy */
-      }
-    }
-  }
-  if (conflict) {
-    luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0);  /* make copy */
-    luaK_reserveregs(fs, 1);
-  }
-}
-
-
-static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {
-  expdesc e;
-  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,
-                      "syntax error");
-  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */
-    struct LHS_assign nv;
-    nv.prev = lh;
-    primaryexp(ls, &nv.v);
-    if (nv.v.k == VLOCAL)
-      check_conflict(ls, lh, &nv.v);
-    luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
-                    "variables in assignment");
-    assignment(ls, &nv, nvars+1);
-  }
-  else {  /* assignment -> `=' explist1 */
-    int nexps;
-    checknext(ls, '=');
-    nexps = explist1(ls, &e);
-    if (nexps != nvars) {
-      adjust_assign(ls, nvars, nexps, &e);
-      if (nexps > nvars)
-        ls->fs->freereg -= nexps - nvars;  /* remove extra values */
-    }
-    else {
-      luaK_setoneret(ls->fs, &e);  /* close last expression */
-      luaK_storevar(ls->fs, &lh->v, &e);
-      return;  /* avoid default */
-    }
-  }
-  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */
-  luaK_storevar(ls->fs, &lh->v, &e);
-}
-
-
-static int cond (LexState *ls) {
-  /* cond -> exp */
-  expdesc v;
-  expr(ls, &v);  /* read condition */
-  if (v.k == VNIL) v.k = VFALSE;  /* `falses' are all equal here */
-  luaK_goiftrue(ls->fs, &v);
-  return v.f;
-}
-
-
-static void breakstat (LexState *ls) {
-  FuncState *fs = ls->fs;
-  BlockCnt *bl = fs->bl;
-  int upval = 0;
-  while (bl && !bl->isbreakable) {
-    upval |= bl->upval;
-    bl = bl->previous;
-  }
-  if (!bl)
-    luaX_syntaxerror(ls, "no loop to break");
-  if (upval)
-    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
-  luaK_concat(fs, &bl->breaklist, luaK_jump(fs));
-}
-
-
-static void whilestat (LexState *ls, int line) {
-  /* whilestat -> WHILE cond DO block END */
-  FuncState *fs = ls->fs;
-  int whileinit;
-  int condexit;
-  BlockCnt bl;
-  luaX_next(ls);  /* skip WHILE */
-  whileinit = luaK_getlabel(fs);
-  condexit = cond(ls);
-  enterblock(fs, &bl, 1);
-  checknext(ls, TK_DO);
-  block(ls);
-  luaK_patchlist(fs, luaK_jump(fs), whileinit);
-  check_match(ls, TK_END, TK_WHILE, line);
-  leaveblock(fs);
-  luaK_patchtohere(fs, condexit);  /* false conditions finish the loop */
-}
-
-
-static void repeatstat (LexState *ls, int line) {
-  /* repeatstat -> REPEAT block UNTIL cond */
-  int condexit;
-  FuncState *fs = ls->fs;
-  int repeat_init = luaK_getlabel(fs);
-  BlockCnt bl1, bl2;
-  enterblock(fs, &bl1, 1);  /* loop block */
-  enterblock(fs, &bl2, 0);  /* scope block */
-  luaX_next(ls);  /* skip REPEAT */
-  chunk(ls);
-  check_match(ls, TK_UNTIL, TK_REPEAT, line);
-  condexit = cond(ls);  /* read condition (inside scope block) */
-  if (!bl2.upval) {  /* no upvalues? */
-    leaveblock(fs);  /* finish scope */
-    luaK_patchlist(ls->fs, condexit, repeat_init);  /* close the loop */
-  }
-  else {  /* complete semantics when there are upvalues */
-    breakstat(ls);  /* if condition then break */
-    luaK_patchtohere(ls->fs, condexit);  /* else... */
-    leaveblock(fs);  /* finish scope... */
-    luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init);  /* and repeat */
-  }
-  leaveblock(fs);  /* finish loop */
-}
-
-
-static int exp1 (LexState *ls) {
-  expdesc e;
-  int k;
-  expr(ls, &e);
-  k = e.k;
-  luaK_exp2nextreg(ls->fs, &e);
-  return k;
-}
-
-
-static void forbody (LexState *ls, int base, int line, int nvars, int isnum) {
-  /* forbody -> DO block */
-  BlockCnt bl;
-  FuncState *fs = ls->fs;
-  int prep, endfor;
-  adjustlocalvars(ls, 3);  /* control variables */
-  checknext(ls, TK_DO);
-  prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs);
-  enterblock(fs, &bl, 0);  /* scope for declared variables */
-  adjustlocalvars(ls, nvars);
-  luaK_reserveregs(fs, nvars);
-  block(ls);
-  leaveblock(fs);  /* end of scope for declared variables */
-  luaK_patchtohere(fs, prep);
-  endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) :
-                     luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars);
-  luaK_fixline(fs, line);  /* pretend that `OP_FOR' starts the loop */
-  luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1);
-}
-
-
-static void fornum (LexState *ls, TString *varname, int line) {
-  /* fornum -> NAME = exp1,exp1[,exp1] forbody */
-  FuncState *fs = ls->fs;
-  int base = fs->freereg;
-  new_localvarliteral(ls, "(for index)", 0);
-  new_localvarliteral(ls, "(for limit)", 1);
-  new_localvarliteral(ls, "(for step)", 2);
-  new_localvar(ls, varname, 3);
-  checknext(ls, '=');
-  exp1(ls);  /* initial value */
-  checknext(ls, ',');
-  exp1(ls);  /* limit */
-  if (testnext(ls, ','))
-    exp1(ls);  /* optional step */
-  else {  /* default step = 1 */
-    luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1));
-    luaK_reserveregs(fs, 1);
-  }
-  forbody(ls, base, line, 1, 1);
-}
-
-
-static void forlist (LexState *ls, TString *indexname) {
-  /* forlist -> NAME {,NAME} IN explist1 forbody */
-  FuncState *fs = ls->fs;
-  expdesc e;
-  int nvars = 0;
-  int line;
-  int base = fs->freereg;
-  /* create control variables */
-  new_localvarliteral(ls, "(for generator)", nvars++);
-  new_localvarliteral(ls, "(for state)", nvars++);
-  new_localvarliteral(ls, "(for control)", nvars++);
-  /* create declared variables */
-  new_localvar(ls, indexname, nvars++);
-  while (testnext(ls, ','))
-    new_localvar(ls, str_checkname(ls), nvars++);
-  checknext(ls, TK_IN);
-  line = ls->linenumber;
-  adjust_assign(ls, 3, explist1(ls, &e), &e);
-  luaK_checkstack(fs, 3);  /* extra space to call generator */
-  forbody(ls, base, line, nvars - 3, 0);
-}
-
-
-static void forstat (LexState *ls, int line) {
-  /* forstat -> FOR (fornum | forlist) END */
-  FuncState *fs = ls->fs;
-  TString *varname;
-  BlockCnt bl;
-  enterblock(fs, &bl, 1);  /* scope for loop and control variables */
-  luaX_next(ls);  /* skip `for' */
-  varname = str_checkname(ls);  /* first variable name */
-  switch (ls->t.token) {
-    case '=': fornum(ls, varname, line); break;
-    case ',': case TK_IN: forlist(ls, varname); break;
-    default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected");
-  }
-  check_match(ls, TK_END, TK_FOR, line);
-  leaveblock(fs);  /* loop scope (`break' jumps to this point) */
-}
-
-
-static int test_then_block (LexState *ls) {
-  /* test_then_block -> [IF | ELSEIF] cond THEN block */
-  int condexit;
-  luaX_next(ls);  /* skip IF or ELSEIF */
-  condexit = cond(ls);
-  checknext(ls, TK_THEN);
-  block(ls);  /* `then' part */
-  return condexit;
-}
-
-
-static void ifstat (LexState *ls, int line) {
-  /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */
-  FuncState *fs = ls->fs;
-  int flist;
-  int escapelist = NO_JUMP;
-  flist = test_then_block(ls);  /* IF cond THEN block */
-  while (ls->t.token == TK_ELSEIF) {
-    luaK_concat(fs, &escapelist, luaK_jump(fs));
-    luaK_patchtohere(fs, flist);
-    flist = test_then_block(ls);  /* ELSEIF cond THEN block */
-  }
-  if (ls->t.token == TK_ELSE) {
-    luaK_concat(fs, &escapelist, luaK_jump(fs));
-    luaK_patchtohere(fs, flist);
-    luaX_next(ls);  /* skip ELSE (after patch, for correct line info) */
-    block(ls);  /* `else' part */
-  }
-  else
-    luaK_concat(fs, &escapelist, flist);
-  luaK_patchtohere(fs, escapelist);
-  check_match(ls, TK_END, TK_IF, line);
-}
-
-
-static void localfunc (LexState *ls) {
-  expdesc v, b;
-  FuncState *fs = ls->fs;
-  new_localvar(ls, str_checkname(ls), 0);
-  init_exp(&v, VLOCAL, fs->freereg);
-  luaK_reserveregs(fs, 1);
-  adjustlocalvars(ls, 1);
-  body(ls, &b, 0, ls->linenumber);
-  luaK_storevar(fs, &v, &b);
-  /* debug information will only see the variable after this point! */
-  getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
-}
-
-
-static void localstat (LexState *ls) {
-  /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */
-  int nvars = 0;
-  int nexps;
-  expdesc e;
-  do {
-    new_localvar(ls, str_checkname(ls), nvars++);
-  } while (testnext(ls, ','));
-  if (testnext(ls, '='))
-    nexps = explist1(ls, &e);
-  else {
-    e.k = VVOID;
-    nexps = 0;
-  }
-  adjust_assign(ls, nvars, nexps, &e);
-  adjustlocalvars(ls, nvars);
-}
-
-
-static int funcname (LexState *ls, expdesc *v) {
-  /* funcname -> NAME {field} [`:' NAME] */
-  int needself = 0;
-  singlevar(ls, v);
-  while (ls->t.token == '.')
-    field(ls, v);
-  if (ls->t.token == ':') {
-    needself = 1;
-    field(ls, v);
-  }
-  return needself;
-}
-
-
-static void funcstat (LexState *ls, int line) {
-  /* funcstat -> FUNCTION funcname body */
-  int needself;
-  expdesc v, b;
-  luaX_next(ls);  /* skip FUNCTION */
-  needself = funcname(ls, &v);
-  body(ls, &b, needself, line);
-  luaK_storevar(ls->fs, &v, &b);
-  luaK_fixline(ls->fs, line);  /* definition `happens' in the first line */
-}
-
-
-static void exprstat (LexState *ls) {
-  /* stat -> func | assignment */
-  FuncState *fs = ls->fs;
-  struct LHS_assign v;
-  primaryexp(ls, &v.v);
-  if (v.v.k == VCALL)  /* stat -> func */
-    SETARG_C(getcode(fs, &v.v), 1);  /* call statement uses no results */
-  else {  /* stat -> assignment */
-    v.prev = NULL;
-    assignment(ls, &v, 1);
-  }
-}
-
-
-static void retstat (LexState *ls) {
-  /* stat -> RETURN explist */
-  FuncState *fs = ls->fs;
-  expdesc e;
-  int first, nret;  /* registers with returned values */
-  luaX_next(ls);  /* skip RETURN */
-  if (block_follow(ls->t.token) || ls->t.token == ';')
-    first = nret = 0;  /* return no values */
-  else {
-    nret = explist1(ls, &e);  /* optional return values */
-    if (hasmultret(e.k)) {
-      luaK_setmultret(fs, &e);
-      if (e.k == VCALL && nret == 1) {  /* tail call? */
-        SET_OPCODE(getcode(fs,&e), OP_TAILCALL);
-        lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar);
-      }
-      first = fs->nactvar;
-      nret = LUA_MULTRET;  /* return all values */
-    }
-    else {
-      if (nret == 1)  /* only one single value? */
-        first = luaK_exp2anyreg(fs, &e);
-      else {
-        luaK_exp2nextreg(fs, &e);  /* values must go to the `stack' */
-        first = fs->nactvar;  /* return all `active' values */
-        lua_assert(nret == fs->freereg - first);
-      }
-    }
-  }
-  luaK_ret(fs, first, nret);
-}
-
-
-static int statement (LexState *ls) {
-  int line = ls->linenumber;  /* may be needed for error messages */
-  switch (ls->t.token) {
-    case TK_IF: {  /* stat -> ifstat */
-      ifstat(ls, line);
-      return 0;
-    }
-    case TK_WHILE: {  /* stat -> whilestat */
-      whilestat(ls, line);
-      return 0;
-    }
-    case TK_DO: {  /* stat -> DO block END */
-      luaX_next(ls);  /* skip DO */
-      block(ls);
-      check_match(ls, TK_END, TK_DO, line);
-      return 0;
-    }
-    case TK_FOR: {  /* stat -> forstat */
-      forstat(ls, line);
-      return 0;
-    }
-    case TK_REPEAT: {  /* stat -> repeatstat */
-      repeatstat(ls, line);
-      return 0;
-    }
-    case TK_FUNCTION: {
-      funcstat(ls, line);  /* stat -> funcstat */
-      return 0;
-    }
-    case TK_LOCAL: {  /* stat -> localstat */
-      luaX_next(ls);  /* skip LOCAL */
-      if (testnext(ls, TK_FUNCTION))  /* local function? */
-        localfunc(ls);
-      else
-        localstat(ls);
-      return 0;
-    }
-    case TK_RETURN: {  /* stat -> retstat */
-      retstat(ls);
-      return 1;  /* must be last statement */
-    }
-    case TK_BREAK: {  /* stat -> breakstat */
-      luaX_next(ls);  /* skip BREAK */
-      breakstat(ls);
-      return 1;  /* must be last statement */
-    }
-    default: {
-      exprstat(ls);
-      return 0;  /* to avoid warnings */
-    }
-  }
-}
-
-
-static void chunk (LexState *ls) {
-  /* chunk -> { stat [`;'] } */
-  int islast = 0;
-  enterlevel(ls);
-  while (!islast && !block_follow(ls->t.token)) {
-    islast = statement(ls);
-    testnext(ls, ';');
-    lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg &&
-               ls->fs->freereg >= ls->fs->nactvar);
-    ls->fs->freereg = ls->fs->nactvar;  /* free registers */
-  }
-  leavelevel(ls);
-}
-
-/* }====================================================================== */
diff --git a/misc/liblua/lparser.h b/misc/liblua/lparser.h
deleted file mode 100644
index 18836af..0000000
--- a/misc/liblua/lparser.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lua Parser
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lparser_h
-#define lparser_h
-
-#include "llimits.h"
-#include "lobject.h"
-#include "lzio.h"
-
-
-/*
-** Expression descriptor
-*/
-
-typedef enum {
-  VVOID,	/* no value */
-  VNIL,
-  VTRUE,
-  VFALSE,
-  VK,		/* info = index of constant in `k' */
-  VKNUM,	/* nval = numerical value */
-  VLOCAL,	/* info = local register */
-  VUPVAL,       /* info = index of upvalue in `upvalues' */
-  VGLOBAL,	/* info = index of table; aux = index of global name in `k' */
-  VINDEXED,	/* info = table register; aux = index register (or `k') */
-  VJMP,		/* info = instruction pc */
-  VRELOCABLE,	/* info = instruction pc */
-  VNONRELOC,	/* info = result register */
-  VCALL,	/* info = instruction pc */
-  VVARARG	/* info = instruction pc */
-} expkind;
-
-typedef struct expdesc {
-  expkind k;
-  union {
-    struct { int info, aux; } s;
-    lua_Number nval;
-  } u;
-  int t;  /* patch list of `exit when true' */
-  int f;  /* patch list of `exit when false' */
-} expdesc;
-
-
-typedef struct upvaldesc {
-  lu_byte k;
-  lu_byte info;
-} upvaldesc;
-
-
-struct BlockCnt;  /* defined in lparser.c */
-
-
-/* state needed to generate code for a given function */
-typedef struct FuncState {
-  Proto *f;  /* current function header */
-  Table *h;  /* table to find (and reuse) elements in `k' */
-  struct FuncState *prev;  /* enclosing function */
-  struct LexState *ls;  /* lexical state */
-  struct lua_State *L;  /* copy of the Lua state */
-  struct BlockCnt *bl;  /* chain of current blocks */
-  int pc;  /* next position to code (equivalent to `ncode') */
-  int lasttarget;   /* `pc' of last `jump target' */
-  int jpc;  /* list of pending jumps to `pc' */
-  int freereg;  /* first free register */
-  int nk;  /* number of elements in `k' */
-  int np;  /* number of elements in `p' */
-  short nlocvars;  /* number of elements in `locvars' */
-  lu_byte nactvar;  /* number of active local variables */
-  upvaldesc upvalues[LUAI_MAXUPVALUES];  /* upvalues */
-  unsigned short actvar[LUAI_MAXVARS];  /* declared-variable stack */
-} FuncState;
-
-
-LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
-                                            const char *name);
-
-
-#endif
diff --git a/misc/liblua/lstate.c b/misc/liblua/lstate.c
deleted file mode 100644
index 2bdbb62..0000000
--- a/misc/liblua/lstate.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
-** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $
-** Global State
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stddef.h>
-
-#define lstate_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "llex.h"
-#include "lmem.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-
-
-#define state_size(x)	(sizeof(x) + LUAI_EXTRASPACE)
-#define fromstate(l)	(cast(lu_byte *, (l)) - LUAI_EXTRASPACE)
-#define tostate(l)   (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE))
-
-
-/*
-** Main thread combines a thread state and the global state
-*/
-typedef struct LG {
-  lua_State l;
-  global_State g;
-} LG;
-
-
-
-static void stack_init (lua_State *L1, lua_State *L) {
-  /* initialize CallInfo array */
-  L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo);
-  L1->ci = L1->base_ci;
-  L1->size_ci = BASIC_CI_SIZE;
-  L1->end_ci = L1->base_ci + L1->size_ci - 1;
-  /* initialize stack array */
-  L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue);
-  L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK;
-  L1->top = L1->stack;
-  L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1;
-  /* initialize first ci */
-  L1->ci->func = L1->top;
-  setnilvalue(L1->top++);  /* `function' entry for this `ci' */
-  L1->base = L1->ci->base = L1->top;
-  L1->ci->top = L1->top + LUA_MINSTACK;
-}
-
-
-static void freestack (lua_State *L, lua_State *L1) {
-  luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo);
-  luaM_freearray(L, L1->stack, L1->stacksize, TValue);
-}
-
-
-/*
-** open parts that may cause memory-allocation errors
-*/
-static void f_luaopen (lua_State *L, void *ud) {
-  global_State *g = G(L);
-  UNUSED(ud);
-  stack_init(L, L);  /* init stack */
-  sethvalue(L, gt(L), luaH_new(L, 0, 2));  /* table of globals */
-  sethvalue(L, registry(L), luaH_new(L, 0, 2));  /* registry */
-  luaS_resize(L, MINSTRTABSIZE);  /* initial size of string table */
-  luaT_init(L);
-  luaX_init(L);
-  luaS_fix(luaS_newliteral(L, MEMERRMSG));
-  g->GCthreshold = 4*g->totalbytes;
-}
-
-
-static void preinit_state (lua_State *L, global_State *g) {
-  G(L) = g;
-  L->stack = NULL;
-  L->stacksize = 0;
-  L->errorJmp = NULL;
-  L->hook = NULL;
-  L->hookmask = 0;
-  L->basehookcount = 0;
-  L->allowhook = 1;
-  resethookcount(L);
-  L->openupval = NULL;
-  L->size_ci = 0;
-  L->nCcalls = L->baseCcalls = 0;
-  L->status = 0;
-  L->base_ci = L->ci = NULL;
-  L->savedpc = NULL;
-  L->errfunc = 0;
-  setnilvalue(gt(L));
-}
-
-
-static void close_state (lua_State *L) {
-  global_State *g = G(L);
-  luaF_close(L, L->stack);  /* close all upvalues for this thread */
-  luaC_freeall(L);  /* collect all objects */
-  lua_assert(g->rootgc == obj2gco(L));
-  lua_assert(g->strt.nuse == 0);
-  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *);
-  luaZ_freebuffer(L, &g->buff);
-  freestack(L, L);
-  lua_assert(g->totalbytes == sizeof(LG));
-  (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0);
-}
-
-
-lua_State *luaE_newthread (lua_State *L) {
-  lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
-  luaC_link(L, obj2gco(L1), LUA_TTHREAD);
-  preinit_state(L1, G(L));
-  stack_init(L1, L);  /* init stack */
-  setobj2n(L, gt(L1), gt(L));  /* share table of globals */
-  L1->hookmask = L->hookmask;
-  L1->basehookcount = L->basehookcount;
-  L1->hook = L->hook;
-  resethookcount(L1);
-  lua_assert(iswhite(obj2gco(L1)));
-  return L1;
-}
-
-
-void luaE_freethread (lua_State *L, lua_State *L1) {
-  luaF_close(L1, L1->stack);  /* close all upvalues for this thread */
-  lua_assert(L1->openupval == NULL);
-  luai_userstatefree(L1);
-  freestack(L, L1);
-  luaM_freemem(L, fromstate(L1), state_size(lua_State));
-}
-
-
-LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
-  int i;
-  lua_State *L;
-  global_State *g;
-  void *l = (*f)(ud, NULL, 0, state_size(LG));
-  if (l == NULL) return NULL;
-  L = tostate(l);
-  g = &((LG *)L)->g;
-  L->next = NULL;
-  L->tt = LUA_TTHREAD;
-  g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT);
-  L->marked = luaC_white(g);
-  set2bits(L->marked, FIXEDBIT, SFIXEDBIT);
-  preinit_state(L, g);
-  g->frealloc = f;
-  g->ud = ud;
-  g->mainthread = L;
-  g->uvhead.u.l.prev = &g->uvhead;
-  g->uvhead.u.l.next = &g->uvhead;
-  g->GCthreshold = 0;  /* mark it as unfinished state */
-  g->strt.size = 0;
-  g->strt.nuse = 0;
-  g->strt.hash = NULL;
-  setnilvalue(registry(L));
-  luaZ_initbuffer(L, &g->buff);
-  g->panic = NULL;
-  g->gcstate = GCSpause;
-  g->rootgc = obj2gco(L);
-  g->sweepstrgc = 0;
-  g->sweepgc = &g->rootgc;
-  g->gray = NULL;
-  g->grayagain = NULL;
-  g->weak = NULL;
-  g->tmudata = NULL;
-  g->totalbytes = sizeof(LG);
-  g->gcpause = LUAI_GCPAUSE;
-  g->gcstepmul = LUAI_GCMUL;
-  g->gcdept = 0;
-  for (i=0; i<NUM_TAGS; i++) g->mt[i] = NULL;
-  if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) {
-    /* memory allocation error: free partial state */
-    close_state(L);
-    L = NULL;
-  }
-  else
-    luai_userstateopen(L);
-  return L;
-}
-
-
-static void callallgcTM (lua_State *L, void *ud) {
-  UNUSED(ud);
-  luaC_callGCTM(L);  /* call GC metamethods for all udata */
-}
-
-
-LUA_API void lua_close (lua_State *L) {
-  L = G(L)->mainthread;  /* only the main thread can be closed */
-  lua_lock(L);
-  luaF_close(L, L->stack);  /* close all upvalues for this thread */
-  luaC_separateudata(L, 1);  /* separate udata that have GC metamethods */
-  L->errfunc = 0;  /* no error function during GC metamethods */
-  do {  /* repeat until no more errors */
-    L->ci = L->base_ci;
-    L->base = L->top = L->ci->base;
-    L->nCcalls = L->baseCcalls = 0;
-  } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
-  lua_assert(G(L)->tmudata == NULL);
-  luai_userstateclose(L);
-  close_state(L);
-}
-
diff --git a/misc/liblua/lstate.h b/misc/liblua/lstate.h
deleted file mode 100644
index 3bc575b..0000000
--- a/misc/liblua/lstate.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $
-** Global State
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lstate_h
-#define lstate_h
-
-#include "lua.h"
-
-#include "lobject.h"
-#include "ltm.h"
-#include "lzio.h"
-
-
-
-struct lua_longjmp;  /* defined in ldo.c */
-
-
-/* table of globals */
-#define gt(L)	(&L->l_gt)
-
-/* registry */
-#define registry(L)	(&G(L)->l_registry)
-
-
-/* extra stack space to handle TM calls and some other extras */
-#define EXTRA_STACK   5
-
-
-#define BASIC_CI_SIZE           8
-
-#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)
-
-
-
-typedef struct stringtable {
-  GCObject **hash;
-  lu_int32 nuse;  /* number of elements */
-  int size;
-} stringtable;
-
-
-/*
-** informations about a call
-*/
-typedef struct CallInfo {
-  StkId base;  /* base for this function */
-  StkId func;  /* function index in the stack */
-  StkId	top;  /* top for this function */
-  const Instruction *savedpc;
-  int nresults;  /* expected number of results from this function */
-  int tailcalls;  /* number of tail calls lost under this entry */
-} CallInfo;
-
-
-
-#define curr_func(L)	(clvalue(L->ci->func))
-#define ci_func(ci)	(clvalue((ci)->func))
-#define f_isLua(ci)	(!ci_func(ci)->c.isC)
-#define isLua(ci)	(ttisfunction((ci)->func) && f_isLua(ci))
-
-
-/*
-** `global state', shared by all threads of this state
-*/
-typedef struct global_State {
-  stringtable strt;  /* hash table for strings */
-  lua_Alloc frealloc;  /* function to reallocate memory */
-  void *ud;         /* auxiliary data to `frealloc' */
-  lu_byte currentwhite;
-  lu_byte gcstate;  /* state of garbage collector */
-  int sweepstrgc;  /* position of sweep in `strt' */
-  GCObject *rootgc;  /* list of all collectable objects */
-  GCObject **sweepgc;  /* position of sweep in `rootgc' */
-  GCObject *gray;  /* list of gray objects */
-  GCObject *grayagain;  /* list of objects to be traversed atomically */
-  GCObject *weak;  /* list of weak tables (to be cleared) */
-  GCObject *tmudata;  /* last element of list of userdata to be GC */
-  Mbuffer buff;  /* temporary buffer for string concatentation */
-  lu_mem GCthreshold;
-  lu_mem totalbytes;  /* number of bytes currently allocated */
-  lu_mem estimate;  /* an estimate of number of bytes actually in use */
-  lu_mem gcdept;  /* how much GC is `behind schedule' */
-  int gcpause;  /* size of pause between successive GCs */
-  int gcstepmul;  /* GC `granularity' */
-  lua_CFunction panic;  /* to be called in unprotected errors */
-  TValue l_registry;
-  struct lua_State *mainthread;
-  UpVal uvhead;  /* head of double-linked list of all open upvalues */
-  struct Table *mt[NUM_TAGS];  /* metatables for basic types */
-  TString *tmname[TM_N];  /* array with tag-method names */
-} global_State;
-
-
-/*
-** `per thread' state
-*/
-struct lua_State {
-  CommonHeader;
-  lu_byte status;
-  StkId top;  /* first free slot in the stack */
-  StkId base;  /* base of current function */
-  global_State *l_G;
-  CallInfo *ci;  /* call info for current function */
-  const Instruction *savedpc;  /* `savedpc' of current function */
-  StkId stack_last;  /* last free slot in the stack */
-  StkId stack;  /* stack base */
-  CallInfo *end_ci;  /* points after end of ci array*/
-  CallInfo *base_ci;  /* array of CallInfo's */
-  int stacksize;
-  int size_ci;  /* size of array `base_ci' */
-  unsigned short nCcalls;  /* number of nested C calls */
-  unsigned short baseCcalls;  /* nested C calls when resuming coroutine */
-  lu_byte hookmask;
-  lu_byte allowhook;
-  int basehookcount;
-  int hookcount;
-  lua_Hook hook;
-  TValue l_gt;  /* table of globals */
-  TValue env;  /* temporary place for environments */
-  GCObject *openupval;  /* list of open upvalues in this stack */
-  GCObject *gclist;
-  struct lua_longjmp *errorJmp;  /* current error recover point */
-  ptrdiff_t errfunc;  /* current error handling function (stack index) */
-};
-
-
-#define G(L)	(L->l_G)
-
-
-/*
-** Union of all collectable objects
-*/
-union GCObject {
-  GCheader gch;
-  union TString ts;
-  union Udata u;
-  union Closure cl;
-  struct Table h;
-  struct Proto p;
-  struct UpVal uv;
-  struct lua_State th;  /* thread */
-};
-
-
-/* macros to convert a GCObject into a specific value */
-#define rawgco2ts(o)	check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
-#define gco2ts(o)	(&rawgco2ts(o)->tsv)
-#define rawgco2u(o)	check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
-#define gco2u(o)	(&rawgco2u(o)->uv)
-#define gco2cl(o)	check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
-#define gco2h(o)	check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
-#define gco2p(o)	check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
-#define gco2uv(o)	check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
-#define ngcotouv(o) \
-	check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
-#define gco2th(o)	check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
-
-/* macro to convert any Lua object into a GCObject */
-#define obj2gco(v)	(cast(GCObject *, (v)))
-
-
-LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
-LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
-
-#endif
-
diff --git a/misc/liblua/lstring.c b/misc/liblua/lstring.c
deleted file mode 100644
index 4911315..0000000
--- a/misc/liblua/lstring.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
-** String table (keeps all strings handled by Lua)
-** See Copyright Notice in lua.h
-*/
-
-
-#include <string.h>
-
-#define lstring_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-#include "lstring.h"
-
-
-
-void luaS_resize (lua_State *L, int newsize) {
-  GCObject **newhash;
-  stringtable *tb;
-  int i;
-  if (G(L)->gcstate == GCSsweepstring)
-    return;  /* cannot resize during GC traverse */
-  newhash = luaM_newvector(L, newsize, GCObject *);
-  tb = &G(L)->strt;
-  for (i=0; i<newsize; i++) newhash[i] = NULL;
-  /* rehash */
-  for (i=0; i<tb->size; i++) {
-    GCObject *p = tb->hash[i];
-    while (p) {  /* for each node in the list */
-      GCObject *next = p->gch.next;  /* save next */
-      unsigned int h = gco2ts(p)->hash;
-      int h1 = lmod(h, newsize);  /* new position */
-      lua_assert(cast_int(h%newsize) == lmod(h, newsize));
-      p->gch.next = newhash[h1];  /* chain it */
-      newhash[h1] = p;
-      p = next;
-    }
-  }
-  luaM_freearray(L, tb->hash, tb->size, TString *);
-  tb->size = newsize;
-  tb->hash = newhash;
-}
-
-
-static TString *newlstr (lua_State *L, const char *str, size_t l,
-                                       unsigned int h) {
-  TString *ts;
-  stringtable *tb;
-  if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char))
-    luaM_toobig(L);
-  ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString)));
-  ts->tsv.len = l;
-  ts->tsv.hash = h;
-  ts->tsv.marked = luaC_white(G(L));
-  ts->tsv.tt = LUA_TSTRING;
-  ts->tsv.reserved = 0;
-  memcpy(ts+1, str, l*sizeof(char));
-  ((char *)(ts+1))[l] = '\0';  /* ending 0 */
-  tb = &G(L)->strt;
-  h = lmod(h, tb->size);
-  ts->tsv.next = tb->hash[h];  /* chain new entry */
-  tb->hash[h] = obj2gco(ts);
-  tb->nuse++;
-  if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2)
-    luaS_resize(L, tb->size*2);  /* too crowded */
-  return ts;
-}
-
-
-TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
-  GCObject *o;
-  unsigned int h = cast(unsigned int, l);  /* seed */
-  size_t step = (l>>5)+1;  /* if string is too long, don't hash all its chars */
-  size_t l1;
-  for (l1=l; l1>=step; l1-=step)  /* compute hash */
-    h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1]));
-  for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
-       o != NULL;
-       o = o->gch.next) {
-    TString *ts = rawgco2ts(o);
-    if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
-      /* string may be dead */
-      if (isdead(G(L), o)) changewhite(o);
-      return ts;
-    }
-  }
-  return newlstr(L, str, l, h);  /* not found */
-}
-
-
-Udata *luaS_newudata (lua_State *L, size_t s, Table *e) {
-  Udata *u;
-  if (s > MAX_SIZET - sizeof(Udata))
-    luaM_toobig(L);
-  u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));
-  u->uv.marked = luaC_white(G(L));  /* is not finalized */
-  u->uv.tt = LUA_TUSERDATA;
-  u->uv.len = s;
-  u->uv.metatable = NULL;
-  u->uv.env = e;
-  /* chain it on udata list (after main thread) */
-  u->uv.next = G(L)->mainthread->next;
-  G(L)->mainthread->next = obj2gco(u);
-  return u;
-}
-
diff --git a/misc/liblua/lstring.h b/misc/liblua/lstring.h
deleted file mode 100644
index 73a2ff8..0000000
--- a/misc/liblua/lstring.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
-** String table (keep all strings handled by Lua)
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lstring_h
-#define lstring_h
-
-
-#include "lgc.h"
-#include "lobject.h"
-#include "lstate.h"
-
-
-#define sizestring(s)	(sizeof(union TString)+((s)->len+1)*sizeof(char))
-
-#define sizeudata(u)	(sizeof(union Udata)+(u)->len)
-
-#define luaS_new(L, s)	(luaS_newlstr(L, s, strlen(s)))
-#define luaS_newliteral(L, s)	(luaS_newlstr(L, "" s, \
-                                 (sizeof(s)/sizeof(char))-1))
-
-#define luaS_fix(s)	l_setbit((s)->tsv.marked, FIXEDBIT)
-
-LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
-LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
-LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
-
-
-#endif
diff --git a/misc/liblua/lstrlib.c b/misc/liblua/lstrlib.c
deleted file mode 100644
index b478e05..0000000
--- a/misc/liblua/lstrlib.c
+++ /dev/null
@@ -1,869 +0,0 @@
-/*
-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
-** Standard library for string operations and pattern-matching
-** See Copyright Notice in lua.h
-*/
-
-
-#include <ctype.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define lstrlib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-/* macro to `unsign' a character */
-#define uchar(c)        ((unsigned char)(c))
-
-
-
-static int str_len (lua_State *L) {
-  size_t l;
-  luaL_checklstring(L, 1, &l);
-  lua_pushinteger(L, l);
-  return 1;
-}
-
-
-static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {
-  /* relative string position: negative means back from end */
-  if (pos < 0) pos += (ptrdiff_t)len + 1;
-  return (pos >= 0) ? pos : 0;
-}
-
-
-static int str_sub (lua_State *L) {
-  size_t l;
-  const char *s = luaL_checklstring(L, 1, &l);
-  ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l);
-  ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l);
-  if (start < 1) start = 1;
-  if (end > (ptrdiff_t)l) end = (ptrdiff_t)l;
-  if (start <= end)
-    lua_pushlstring(L, s+start-1, end-start+1);
-  else lua_pushliteral(L, "");
-  return 1;
-}
-
-
-static int str_reverse (lua_State *L) {
-  size_t l;
-  luaL_Buffer b;
-  const char *s = luaL_checklstring(L, 1, &l);
-  luaL_buffinit(L, &b);
-  while (l--) luaL_addchar(&b, s[l]);
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-static int str_lower (lua_State *L) {
-  size_t l;
-  size_t i;
-  luaL_Buffer b;
-  const char *s = luaL_checklstring(L, 1, &l);
-  luaL_buffinit(L, &b);
-  for (i=0; i<l; i++)
-    luaL_addchar(&b, tolower(uchar(s[i])));
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-static int str_upper (lua_State *L) {
-  size_t l;
-  size_t i;
-  luaL_Buffer b;
-  const char *s = luaL_checklstring(L, 1, &l);
-  luaL_buffinit(L, &b);
-  for (i=0; i<l; i++)
-    luaL_addchar(&b, toupper(uchar(s[i])));
-  luaL_pushresult(&b);
-  return 1;
-}
-
-static int str_rep (lua_State *L) {
-  size_t l;
-  luaL_Buffer b;
-  const char *s = luaL_checklstring(L, 1, &l);
-  int n = luaL_checkint(L, 2);
-  luaL_buffinit(L, &b);
-  while (n-- > 0)
-    luaL_addlstring(&b, s, l);
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-static int str_byte (lua_State *L) {
-  size_t l;
-  const char *s = luaL_checklstring(L, 1, &l);
-  ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l);
-  ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l);
-  int n, i;
-  if (posi <= 0) posi = 1;
-  if ((size_t)pose > l) pose = l;
-  if (posi > pose) return 0;  /* empty interval; return no values */
-  n = (int)(pose -  posi + 1);
-  if (posi + n <= pose)  /* overflow? */
-    luaL_error(L, "string slice too long");
-  luaL_checkstack(L, n, "string slice too long");
-  for (i=0; i<n; i++)
-    lua_pushinteger(L, uchar(s[posi+i-1]));
-  return n;
-}
-
-
-static int str_char (lua_State *L) {
-  int n = lua_gettop(L);  /* number of arguments */
-  int i;
-  luaL_Buffer b;
-  luaL_buffinit(L, &b);
-  for (i=1; i<=n; i++) {
-    int c = luaL_checkint(L, i);
-    luaL_argcheck(L, uchar(c) == c, i, "invalid value");
-    luaL_addchar(&b, uchar(c));
-  }
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-static int writer (lua_State *L, const void* b, size_t size, void* B) {
-  (void)L;
-  luaL_addlstring((luaL_Buffer*) B, (const char *)b, size);
-  return 0;
-}
-
-
-static int str_dump (lua_State *L) {
-  luaL_Buffer b;
-  luaL_checktype(L, 1, LUA_TFUNCTION);
-  lua_settop(L, 1);
-  luaL_buffinit(L,&b);
-  if (lua_dump(L, writer, &b) != 0)
-    luaL_error(L, "unable to dump given function");
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-
-/*
-** {======================================================
-** PATTERN MATCHING
-** =======================================================
-*/
-
-
-#define CAP_UNFINISHED	(-1)
-#define CAP_POSITION	(-2)
-
-typedef struct MatchState {
-  const char *src_init;  /* init of source string */
-  const char *src_end;  /* end (`\0') of source string */
-  lua_State *L;
-  int level;  /* total number of captures (finished or unfinished) */
-  struct {
-    const char *init;
-    ptrdiff_t len;
-  } capture[LUA_MAXCAPTURES];
-} MatchState;
-
-
-#define L_ESC		'%'
-#define SPECIALS	"^$*+?.([%-"
-
-
-static int check_capture (MatchState *ms, int l) {
-  l -= '1';
-  if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)
-    return luaL_error(ms->L, "invalid capture index");
-  return l;
-}
-
-
-static int capture_to_close (MatchState *ms) {
-  int level = ms->level;
-  for (level--; level>=0; level--)
-    if (ms->capture[level].len == CAP_UNFINISHED) return level;
-  return luaL_error(ms->L, "invalid pattern capture");
-}
-
-
-static const char *classend (MatchState *ms, const char *p) {
-  switch (*p++) {
-    case L_ESC: {
-      if (*p == '\0')
-        luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
-      return p+1;
-    }
-    case '[': {
-      if (*p == '^') p++;
-      do {  /* look for a `]' */
-        if (*p == '\0')
-          luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
-        if (*(p++) == L_ESC && *p != '\0')
-          p++;  /* skip escapes (e.g. `%]') */
-      } while (*p != ']');
-      return p+1;
-    }
-    default: {
-      return p;
-    }
-  }
-}
-
-
-static int match_class (int c, int cl) {
-  int res;
-  switch (tolower(cl)) {
-    case 'a' : res = isalpha(c); break;
-    case 'c' : res = iscntrl(c); break;
-    case 'd' : res = isdigit(c); break;
-    case 'l' : res = islower(c); break;
-    case 'p' : res = ispunct(c); break;
-    case 's' : res = isspace(c); break;
-    case 'u' : res = isupper(c); break;
-    case 'w' : res = isalnum(c); break;
-    case 'x' : res = isxdigit(c); break;
-    case 'z' : res = (c == 0); break;
-    default: return (cl == c);
-  }
-  return (islower(cl) ? res : !res);
-}
-
-
-static int matchbracketclass (int c, const char *p, const char *ec) {
-  int sig = 1;
-  if (*(p+1) == '^') {
-    sig = 0;
-    p++;  /* skip the `^' */
-  }
-  while (++p < ec) {
-    if (*p == L_ESC) {
-      p++;
-      if (match_class(c, uchar(*p)))
-        return sig;
-    }
-    else if ((*(p+1) == '-') && (p+2 < ec)) {
-      p+=2;
-      if (uchar(*(p-2)) <= c && c <= uchar(*p))
-        return sig;
-    }
-    else if (uchar(*p) == c) return sig;
-  }
-  return !sig;
-}
-
-
-static int singlematch (int c, const char *p, const char *ep) {
-  switch (*p) {
-    case '.': return 1;  /* matches any char */
-    case L_ESC: return match_class(c, uchar(*(p+1)));
-    case '[': return matchbracketclass(c, p, ep-1);
-    default:  return (uchar(*p) == c);
-  }
-}
-
-
-static const char *match (MatchState *ms, const char *s, const char *p);
-
-
-static const char *matchbalance (MatchState *ms, const char *s,
-                                   const char *p) {
-  if (*p == 0 || *(p+1) == 0)
-    luaL_error(ms->L, "unbalanced pattern");
-  if (*s != *p) return NULL;
-  else {
-    int b = *p;
-    int e = *(p+1);
-    int cont = 1;
-    while (++s < ms->src_end) {
-      if (*s == e) {
-        if (--cont == 0) return s+1;
-      }
-      else if (*s == b) cont++;
-    }
-  }
-  return NULL;  /* string ends out of balance */
-}
-
-
-static const char *max_expand (MatchState *ms, const char *s,
-                                 const char *p, const char *ep) {
-  ptrdiff_t i = 0;  /* counts maximum expand for item */
-  while ((s+i)<ms->src_end && singlematch(uchar(*(s+i)), p, ep))
-    i++;
-  /* keeps trying to match with the maximum repetitions */
-  while (i>=0) {
-    const char *res = match(ms, (s+i), ep+1);
-    if (res) return res;
-    i--;  /* else didn't match; reduce 1 repetition to try again */
-  }
-  return NULL;
-}
-
-
-static const char *min_expand (MatchState *ms, const char *s,
-                                 const char *p, const char *ep) {
-  for (;;) {
-    const char *res = match(ms, s, ep+1);
-    if (res != NULL)
-      return res;
-    else if (s<ms->src_end && singlematch(uchar(*s), p, ep))
-      s++;  /* try with one more repetition */
-    else return NULL;
-  }
-}
-
-
-static const char *start_capture (MatchState *ms, const char *s,
-                                    const char *p, int what) {
-  const char *res;
-  int level = ms->level;
-  if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures");
-  ms->capture[level].init = s;
-  ms->capture[level].len = what;
-  ms->level = level+1;
-  if ((res=match(ms, s, p)) == NULL)  /* match failed? */
-    ms->level--;  /* undo capture */
-  return res;
-}
-
-
-static const char *end_capture (MatchState *ms, const char *s,
-                                  const char *p) {
-  int l = capture_to_close(ms);
-  const char *res;
-  ms->capture[l].len = s - ms->capture[l].init;  /* close capture */
-  if ((res = match(ms, s, p)) == NULL)  /* match failed? */
-    ms->capture[l].len = CAP_UNFINISHED;  /* undo capture */
-  return res;
-}
-
-
-static const char *match_capture (MatchState *ms, const char *s, int l) {
-  size_t len;
-  l = check_capture(ms, l);
-  len = ms->capture[l].len;
-  if ((size_t)(ms->src_end-s) >= len &&
-      memcmp(ms->capture[l].init, s, len) == 0)
-    return s+len;
-  else return NULL;
-}
-
-
-static const char *match (MatchState *ms, const char *s, const char *p) {
-  init: /* using goto's to optimize tail recursion */
-  switch (*p) {
-    case '(': {  /* start capture */
-      if (*(p+1) == ')')  /* position capture? */
-        return start_capture(ms, s, p+2, CAP_POSITION);
-      else
-        return start_capture(ms, s, p+1, CAP_UNFINISHED);
-    }
-    case ')': {  /* end capture */
-      return end_capture(ms, s, p+1);
-    }
-    case L_ESC: {
-      switch (*(p+1)) {
-        case 'b': {  /* balanced string? */
-          s = matchbalance(ms, s, p+2);
-          if (s == NULL) return NULL;
-          p+=4; goto init;  /* else return match(ms, s, p+4); */
-        }
-        case 'f': {  /* frontier? */
-          const char *ep; char previous;
-          p += 2;
-          if (*p != '[')
-            luaL_error(ms->L, "missing " LUA_QL("[") " after "
-                               LUA_QL("%%f") " in pattern");
-          ep = classend(ms, p);  /* points to what is next */
-          previous = (s == ms->src_init) ? '\0' : *(s-1);
-          if (matchbracketclass(uchar(previous), p, ep-1) ||
-             !matchbracketclass(uchar(*s), p, ep-1)) return NULL;
-          p=ep; goto init;  /* else return match(ms, s, ep); */
-        }
-        default: {
-          if (isdigit(uchar(*(p+1)))) {  /* capture results (%0-%9)? */
-            s = match_capture(ms, s, uchar(*(p+1)));
-            if (s == NULL) return NULL;
-            p+=2; goto init;  /* else return match(ms, s, p+2) */
-          }
-          goto dflt;  /* case default */
-        }
-      }
-    }
-    case '\0': {  /* end of pattern */
-      return s;  /* match succeeded */
-    }
-    case '$': {
-      if (*(p+1) == '\0')  /* is the `$' the last char in pattern? */
-        return (s == ms->src_end) ? s : NULL;  /* check end of string */
-      else goto dflt;
-    }
-    default: dflt: {  /* it is a pattern item */
-      const char *ep = classend(ms, p);  /* points to what is next */
-      int m = s<ms->src_end && singlematch(uchar(*s), p, ep);
-      switch (*ep) {
-        case '?': {  /* optional */
-          const char *res;
-          if (m && ((res=match(ms, s+1, ep+1)) != NULL))
-            return res;
-          p=ep+1; goto init;  /* else return match(ms, s, ep+1); */
-        }
-        case '*': {  /* 0 or more repetitions */
-          return max_expand(ms, s, p, ep);
-        }
-        case '+': {  /* 1 or more repetitions */
-          return (m ? max_expand(ms, s+1, p, ep) : NULL);
-        }
-        case '-': {  /* 0 or more repetitions (minimum) */
-          return min_expand(ms, s, p, ep);
-        }
-        default: {
-          if (!m) return NULL;
-          s++; p=ep; goto init;  /* else return match(ms, s+1, ep); */
-        }
-      }
-    }
-  }
-}
-
-
-
-static const char *lmemfind (const char *s1, size_t l1,
-                               const char *s2, size_t l2) {
-  if (l2 == 0) return s1;  /* empty strings are everywhere */
-  else if (l2 > l1) return NULL;  /* avoids a negative `l1' */
-  else {
-    const char *init;  /* to search for a `*s2' inside `s1' */
-    l2--;  /* 1st char will be checked by `memchr' */
-    l1 = l1-l2;  /* `s2' cannot be found after that */
-    while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) {
-      init++;   /* 1st char is already checked */
-      if (memcmp(init, s2+1, l2) == 0)
-        return init-1;
-      else {  /* correct `l1' and `s1' to try again */
-        l1 -= init-s1;
-        s1 = init;
-      }
-    }
-    return NULL;  /* not found */
-  }
-}
-
-
-static void push_onecapture (MatchState *ms, int i, const char *s,
-                                                    const char *e) {
-  if (i >= ms->level) {
-    if (i == 0)  /* ms->level == 0, too */
-      lua_pushlstring(ms->L, s, e - s);  /* add whole match */
-    else
-      luaL_error(ms->L, "invalid capture index");
-  }
-  else {
-    ptrdiff_t l = ms->capture[i].len;
-    if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture");
-    if (l == CAP_POSITION)
-      lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);
-    else
-      lua_pushlstring(ms->L, ms->capture[i].init, l);
-  }
-}
-
-
-static int push_captures (MatchState *ms, const char *s, const char *e) {
-  int i;
-  int nlevels = (ms->level == 0 && s) ? 1 : ms->level;
-  luaL_checkstack(ms->L, nlevels, "too many captures");
-  for (i = 0; i < nlevels; i++)
-    push_onecapture(ms, i, s, e);
-  return nlevels;  /* number of strings pushed */
-}
-
-
-static int str_find_aux (lua_State *L, int find) {
-  size_t l1, l2;
-  const char *s = luaL_checklstring(L, 1, &l1);
-  const char *p = luaL_checklstring(L, 2, &l2);
-  ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1;
-  if (init < 0) init = 0;
-  else if ((size_t)(init) > l1) init = (ptrdiff_t)l1;
-  if (find && (lua_toboolean(L, 4) ||  /* explicit request? */
-      strpbrk(p, SPECIALS) == NULL)) {  /* or no special characters? */
-    /* do a plain search */
-    const char *s2 = lmemfind(s+init, l1-init, p, l2);
-    if (s2) {
-      lua_pushinteger(L, s2-s+1);
-      lua_pushinteger(L, s2-s+l2);
-      return 2;
-    }
-  }
-  else {
-    MatchState ms;
-    int anchor = (*p == '^') ? (p++, 1) : 0;
-    const char *s1=s+init;
-    ms.L = L;
-    ms.src_init = s;
-    ms.src_end = s+l1;
-    do {
-      const char *res;
-      ms.level = 0;
-      if ((res=match(&ms, s1, p)) != NULL) {
-        if (find) {
-          lua_pushinteger(L, s1-s+1);  /* start */
-          lua_pushinteger(L, res-s);   /* end */
-          return push_captures(&ms, NULL, 0) + 2;
-        }
-        else
-          return push_captures(&ms, s1, res);
-      }
-    } while (s1++ < ms.src_end && !anchor);
-  }
-  lua_pushnil(L);  /* not found */
-  return 1;
-}
-
-
-static int str_find (lua_State *L) {
-  return str_find_aux(L, 1);
-}
-
-
-static int str_match (lua_State *L) {
-  return str_find_aux(L, 0);
-}
-
-
-static int gmatch_aux (lua_State *L) {
-  MatchState ms;
-  size_t ls;
-  const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
-  const char *p = lua_tostring(L, lua_upvalueindex(2));
-  const char *src;
-  ms.L = L;
-  ms.src_init = s;
-  ms.src_end = s+ls;
-  for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3));
-       src <= ms.src_end;
-       src++) {
-    const char *e;
-    ms.level = 0;
-    if ((e = match(&ms, src, p)) != NULL) {
-      lua_Integer newstart = e-s;
-      if (e == src) newstart++;  /* empty match? go at least one position */
-      lua_pushinteger(L, newstart);
-      lua_replace(L, lua_upvalueindex(3));
-      return push_captures(&ms, src, e);
-    }
-  }
-  return 0;  /* not found */
-}
-
-
-static int gmatch (lua_State *L) {
-  luaL_checkstring(L, 1);
-  luaL_checkstring(L, 2);
-  lua_settop(L, 2);
-  lua_pushinteger(L, 0);
-  lua_pushcclosure(L, gmatch_aux, 3);
-  return 1;
-}
-
-
-static int gfind_nodef (lua_State *L) {
-  return luaL_error(L, LUA_QL("string.gfind") " was renamed to "
-                       LUA_QL("string.gmatch"));
-}
-
-
-static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
-                                                   const char *e) {
-  size_t l, i;
-  const char *news = lua_tolstring(ms->L, 3, &l);
-  for (i = 0; i < l; i++) {
-    if (news[i] != L_ESC)
-      luaL_addchar(b, news[i]);
-    else {
-      i++;  /* skip ESC */
-      if (!isdigit(uchar(news[i])))
-        luaL_addchar(b, news[i]);
-      else if (news[i] == '0')
-          luaL_addlstring(b, s, e - s);
-      else {
-        push_onecapture(ms, news[i] - '1', s, e);
-        luaL_addvalue(b);  /* add capture to accumulated result */
-      }
-    }
-  }
-}
-
-
-static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
-                                                       const char *e) {
-  lua_State *L = ms->L;
-  switch (lua_type(L, 3)) {
-    case LUA_TNUMBER:
-    case LUA_TSTRING: {
-      add_s(ms, b, s, e);
-      return;
-    }
-    case LUA_TFUNCTION: {
-      int n;
-      lua_pushvalue(L, 3);
-      n = push_captures(ms, s, e);
-      lua_call(L, n, 1);
-      break;
-    }
-    case LUA_TTABLE: {
-      push_onecapture(ms, 0, s, e);
-      lua_gettable(L, 3);
-      break;
-    }
-  }
-  if (!lua_toboolean(L, -1)) {  /* nil or false? */
-    lua_pop(L, 1);
-    lua_pushlstring(L, s, e - s);  /* keep original text */
-  }
-  else if (!lua_isstring(L, -1))
-    luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
-  luaL_addvalue(b);  /* add result to accumulator */
-}
-
-
-static int str_gsub (lua_State *L) {
-  size_t srcl;
-  const char *src = luaL_checklstring(L, 1, &srcl);
-  const char *p = luaL_checkstring(L, 2);
-  int  tr = lua_type(L, 3);
-  int max_s = luaL_optint(L, 4, srcl+1);
-  int anchor = (*p == '^') ? (p++, 1) : 0;
-  int n = 0;
-  MatchState ms;
-  luaL_Buffer b;
-  luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING ||
-                   tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3,
-                      "string/function/table expected");
-  luaL_buffinit(L, &b);
-  ms.L = L;
-  ms.src_init = src;
-  ms.src_end = src+srcl;
-  while (n < max_s) {
-    const char *e;
-    ms.level = 0;
-    e = match(&ms, src, p);
-    if (e) {
-      n++;
-      add_value(&ms, &b, src, e);
-    }
-    if (e && e>src) /* non empty match? */
-      src = e;  /* skip it */
-    else if (src < ms.src_end)
-      luaL_addchar(&b, *src++);
-    else break;
-    if (anchor) break;
-  }
-  luaL_addlstring(&b, src, ms.src_end-src);
-  luaL_pushresult(&b);
-  lua_pushinteger(L, n);  /* number of substitutions */
-  return 2;
-}
-
-/* }====================================================== */
-
-
-/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */
-#define MAX_ITEM	512
-/* valid flags in a format specification */
-#define FLAGS	"-+ #0"
-/*
-** maximum size of each format specification (such as '%-099.99d')
-** (+10 accounts for %99.99x plus margin of error)
-*/
-#define MAX_FORMAT	(sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10)
-
-
-static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
-  size_t l;
-  const char *s = luaL_checklstring(L, arg, &l);
-  luaL_addchar(b, '"');
-  while (l--) {
-    switch (*s) {
-      case '"': case '\\': case '\n': {
-        luaL_addchar(b, '\\');
-        luaL_addchar(b, *s);
-        break;
-      }
-      case '\r': {
-        luaL_addlstring(b, "\\r", 2);
-        break;
-      }
-      case '\0': {
-        luaL_addlstring(b, "\\000", 4);
-        break;
-      }
-      default: {
-        luaL_addchar(b, *s);
-        break;
-      }
-    }
-    s++;
-  }
-  luaL_addchar(b, '"');
-}
-
-static const char *scanformat (lua_State *L, const char *strfrmt, char *form) {
-  const char *p = strfrmt;
-  while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++;  /* skip flags */
-  if ((size_t)(p - strfrmt) >= sizeof(FLAGS))
-    luaL_error(L, "invalid format (repeated flags)");
-  if (isdigit(uchar(*p))) p++;  /* skip width */
-  if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */
-  if (*p == '.') {
-    p++;
-    if (isdigit(uchar(*p))) p++;  /* skip precision */
-    if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */
-  }
-  if (isdigit(uchar(*p)))
-    luaL_error(L, "invalid format (width or precision too long)");
-  *(form++) = '%';
-  strncpy(form, strfrmt, p - strfrmt + 1);
-  form += p - strfrmt + 1;
-  *form = '\0';
-  return p;
-}
-
-
-static void addintlen (char *form) {
-  size_t l = strlen(form);
-  char spec = form[l - 1];
-  strcpy(form + l - 1, LUA_INTFRMLEN);
-  form[l + sizeof(LUA_INTFRMLEN) - 2] = spec;
-  form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0';
-}
-
-
-static int str_format (lua_State *L) {
-  int arg = 1;
-  size_t sfl;
-  const char *strfrmt = luaL_checklstring(L, arg, &sfl);
-  const char *strfrmt_end = strfrmt+sfl;
-  luaL_Buffer b;
-  luaL_buffinit(L, &b);
-  while (strfrmt < strfrmt_end) {
-    if (*strfrmt != L_ESC)
-      luaL_addchar(&b, *strfrmt++);
-    else if (*++strfrmt == L_ESC)
-      luaL_addchar(&b, *strfrmt++);  /* %% */
-    else { /* format item */
-      char form[MAX_FORMAT];  /* to store the format (`%...') */
-      char buff[MAX_ITEM];  /* to store the formatted item */
-      arg++;
-      strfrmt = scanformat(L, strfrmt, form);
-      switch (*strfrmt++) {
-        case 'c': {
-          sprintf(buff, form, (int)luaL_checknumber(L, arg));
-          break;
-        }
-        case 'd':  case 'i': {
-          addintlen(form);
-          sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg));
-          break;
-        }
-        case 'o':  case 'u':  case 'x':  case 'X': {
-          addintlen(form);
-          sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));
-          break;
-        }
-        case 'e':  case 'E': case 'f':
-        case 'g': case 'G': {
-          sprintf(buff, form, (double)luaL_checknumber(L, arg));
-          break;
-        }
-        case 'q': {
-          addquoted(L, &b, arg);
-          continue;  /* skip the 'addsize' at the end */
-        }
-        case 's': {
-          size_t l;
-          const char *s = luaL_checklstring(L, arg, &l);
-          if (!strchr(form, '.') && l >= 100) {
-            /* no precision and string is too long to be formatted;
-               keep original string */
-            lua_pushvalue(L, arg);
-            luaL_addvalue(&b);
-            continue;  /* skip the `addsize' at the end */
-          }
-          else {
-            sprintf(buff, form, s);
-            break;
-          }
-        }
-        default: {  /* also treat cases `pnLlh' */
-          return luaL_error(L, "invalid option " LUA_QL("%%%c") " to "
-                               LUA_QL("format"), *(strfrmt - 1));
-        }
-      }
-      luaL_addlstring(&b, buff, strlen(buff));
-    }
-  }
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-static const luaL_Reg strlib[] = {
-  {"byte", str_byte},
-  {"char", str_char},
-  {"dump", str_dump},
-  {"find", str_find},
-  {"format", str_format},
-  {"gfind", gfind_nodef},
-  {"gmatch", gmatch},
-  {"gsub", str_gsub},
-  {"len", str_len},
-  {"lower", str_lower},
-  {"match", str_match},
-  {"rep", str_rep},
-  {"reverse", str_reverse},
-  {"sub", str_sub},
-  {"upper", str_upper},
-  {NULL, NULL}
-};
-
-
-static void createmetatable (lua_State *L) {
-  lua_createtable(L, 0, 1);  /* create metatable for strings */
-  lua_pushliteral(L, "");  /* dummy string */
-  lua_pushvalue(L, -2);
-  lua_setmetatable(L, -2);  /* set string metatable */
-  lua_pop(L, 1);  /* pop dummy string */
-  lua_pushvalue(L, -2);  /* string library... */
-  lua_setfield(L, -2, "__index");  /* ...is the __index metamethod */
-  lua_pop(L, 1);  /* pop metatable */
-}
-
-
-/*
-** Open string library
-*/
-LUALIB_API int luaopen_string (lua_State *L) {
-  luaL_register(L, LUA_STRLIBNAME, strlib);
-#if defined(LUA_COMPAT_GFIND)
-  lua_getfield(L, -1, "gmatch");
-  lua_setfield(L, -2, "gfind");
-#endif
-  createmetatable(L);
-  return 1;
-}
-
diff --git a/misc/liblua/ltable.c b/misc/liblua/ltable.c
deleted file mode 100644
index 677b0e9..0000000
--- a/misc/liblua/ltable.c
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
-** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $
-** Lua tables (hash)
-** See Copyright Notice in lua.h
-*/
-
-
-/*
-** Implementation of tables (aka arrays, objects, or hash tables).
-** Tables keep its elements in two parts: an array part and a hash part.
-** Non-negative integer keys are all candidates to be kept in the array
-** part. The actual size of the array is the largest `n' such that at
-** least half the slots between 0 and n are in use.
-** Hash uses a mix of chained scatter table with Brent's variation.
-** A main invariant of these tables is that, if an element is not
-** in its main position (i.e. the `original' position that its hash gives
-** to it), then the colliding element is in its own main position.
-** Hence even when the load factor reaches 100%, performance remains good.
-*/
-
-#include <math.h>
-#include <string.h>
-
-#define ltable_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lgc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstate.h"
-#include "ltable.h"
-
-
-/*
-** max size of array part is 2^MAXBITS
-*/
-#if LUAI_BITSINT > 26
-#define MAXBITS		26
-#else
-#define MAXBITS		(LUAI_BITSINT-2)
-#endif
-
-#define MAXASIZE	(1 << MAXBITS)
-
-
-#define hashpow2(t,n)      (gnode(t, lmod((n), sizenode(t))))
-
-#define hashstr(t,str)  hashpow2(t, (str)->tsv.hash)
-#define hashboolean(t,p)        hashpow2(t, p)
-
-
-/*
-** for some types, it is better to avoid modulus by power of 2, as
-** they tend to have many 2 factors.
-*/
-#define hashmod(t,n)	(gnode(t, ((n) % ((sizenode(t)-1)|1))))
-
-
-#define hashpointer(t,p)	hashmod(t, IntPoint(p))
-
-
-/*
-** number of ints inside a lua_Number
-*/
-#define numints		cast_int(sizeof(lua_Number)/sizeof(int))
-
-
-
-#define dummynode		(&dummynode_)
-
-static const Node dummynode_ = {
-  {{NULL}, LUA_TNIL},  /* value */
-  {{{NULL}, LUA_TNIL, NULL}}  /* key */
-};
-
-
-/*
-** hash for lua_Numbers
-*/
-static Node *hashnum (const Table *t, lua_Number n) {
-  unsigned int a[numints];
-  int i;
-  if (luai_numeq(n, 0))  /* avoid problems with -0 */
-    return gnode(t, 0);
-  memcpy(a, &n, sizeof(a));
-  for (i = 1; i < numints; i++) a[0] += a[i];
-  return hashmod(t, a[0]);
-}
-
-
-
-/*
-** returns the `main' position of an element in a table (that is, the index
-** of its hash value)
-*/
-static Node *mainposition (const Table *t, const TValue *key) {
-  switch (ttype(key)) {
-    case LUA_TNUMBER:
-      return hashnum(t, nvalue(key));
-    case LUA_TSTRING:
-      return hashstr(t, rawtsvalue(key));
-    case LUA_TBOOLEAN:
-      return hashboolean(t, bvalue(key));
-    case LUA_TLIGHTUSERDATA:
-      return hashpointer(t, pvalue(key));
-    default:
-      return hashpointer(t, gcvalue(key));
-  }
-}
-
-
-/*
-** returns the index for `key' if `key' is an appropriate key to live in
-** the array part of the table, -1 otherwise.
-*/
-static int arrayindex (const TValue *key) {
-  if (ttisnumber(key)) {
-    lua_Number n = nvalue(key);
-    int k;
-    lua_number2int(k, n);
-    if (luai_numeq(cast_num(k), n))
-      return k;
-  }
-  return -1;  /* `key' did not match some condition */
-}
-
-
-/*
-** returns the index of a `key' for table traversals. First goes all
-** elements in the array part, then elements in the hash part. The
-** beginning of a traversal is signalled by -1.
-*/
-static int findindex (lua_State *L, Table *t, StkId key) {
-  int i;
-  if (ttisnil(key)) return -1;  /* first iteration */
-  i = arrayindex(key);
-  if (0 < i && i <= t->sizearray)  /* is `key' inside array part? */
-    return i-1;  /* yes; that's the index (corrected to C) */
-  else {
-    Node *n = mainposition(t, key);
-    do {  /* check whether `key' is somewhere in the chain */
-      /* key may be dead already, but it is ok to use it in `next' */
-      if (luaO_rawequalObj(key2tval(n), key) ||
-            (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) &&
-             gcvalue(gkey(n)) == gcvalue(key))) {
-        i = cast_int(n - gnode(t, 0));  /* key index in hash table */
-        /* hash elements are numbered after array ones */
-        return i + t->sizearray;
-      }
-      else n = gnext(n);
-    } while (n);
-    luaG_runerror(L, "invalid key to " LUA_QL("next"));  /* key not found */
-    return 0;  /* to avoid warnings */
-  }
-}
-
-
-int luaH_next (lua_State *L, Table *t, StkId key) {
-  int i = findindex(L, t, key);  /* find original element */
-  for (i++; i < t->sizearray; i++) {  /* try first array part */
-    if (!ttisnil(&t->array[i])) {  /* a non-nil value? */
-      setnvalue(key, cast_num(i+1));
-      setobj2s(L, key+1, &t->array[i]);
-      return 1;
-    }
-  }
-  for (i -= t->sizearray; i < sizenode(t); i++) {  /* then hash part */
-    if (!ttisnil(gval(gnode(t, i)))) {  /* a non-nil value? */
-      setobj2s(L, key, key2tval(gnode(t, i)));
-      setobj2s(L, key+1, gval(gnode(t, i)));
-      return 1;
-    }
-  }
-  return 0;  /* no more elements */
-}
-
-
-/*
-** {=============================================================
-** Rehash
-** ==============================================================
-*/
-
-
-static int computesizes (int nums[], int *narray) {
-  int i;
-  int twotoi;  /* 2^i */
-  int a = 0;  /* number of elements smaller than 2^i */
-  int na = 0;  /* number of elements to go to array part */
-  int n = 0;  /* optimal size for array part */
-  for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) {
-    if (nums[i] > 0) {
-      a += nums[i];
-      if (a > twotoi/2) {  /* more than half elements present? */
-        n = twotoi;  /* optimal size (till now) */
-        na = a;  /* all elements smaller than n will go to array part */
-      }
-    }
-    if (a == *narray) break;  /* all elements already counted */
-  }
-  *narray = n;
-  lua_assert(*narray/2 <= na && na <= *narray);
-  return na;
-}
-
-
-static int countint (const TValue *key, int *nums) {
-  int k = arrayindex(key);
-  if (0 < k && k <= MAXASIZE) {  /* is `key' an appropriate array index? */
-    nums[ceillog2(k)]++;  /* count as such */
-    return 1;
-  }
-  else
-    return 0;
-}
-
-
-static int numusearray (const Table *t, int *nums) {
-  int lg;
-  int ttlg;  /* 2^lg */
-  int ause = 0;  /* summation of `nums' */
-  int i = 1;  /* count to traverse all array keys */
-  for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) {  /* for each slice */
-    int lc = 0;  /* counter */
-    int lim = ttlg;
-    if (lim > t->sizearray) {
-      lim = t->sizearray;  /* adjust upper limit */
-      if (i > lim)
-        break;  /* no more elements to count */
-    }
-    /* count elements in range (2^(lg-1), 2^lg] */
-    for (; i <= lim; i++) {
-      if (!ttisnil(&t->array[i-1]))
-        lc++;
-    }
-    nums[lg] += lc;
-    ause += lc;
-  }
-  return ause;
-}
-
-
-static int numusehash (const Table *t, int *nums, int *pnasize) {
-  int totaluse = 0;  /* total number of elements */
-  int ause = 0;  /* summation of `nums' */
-  int i = sizenode(t);
-  while (i--) {
-    Node *n = &t->node[i];
-    if (!ttisnil(gval(n))) {
-      ause += countint(key2tval(n), nums);
-      totaluse++;
-    }
-  }
-  *pnasize += ause;
-  return totaluse;
-}
-
-
-static void setarrayvector (lua_State *L, Table *t, int size) {
-  int i;
-  luaM_reallocvector(L, t->array, t->sizearray, size, TValue);
-  for (i=t->sizearray; i<size; i++)
-     setnilvalue(&t->array[i]);
-  t->sizearray = size;
-}
-
-
-static void setnodevector (lua_State *L, Table *t, int size) {
-  int lsize;
-  if (size == 0) {  /* no elements to hash part? */
-    t->node = cast(Node *, dummynode);  /* use common `dummynode' */
-    lsize = 0;
-  }
-  else {
-    int i;
-    lsize = ceillog2(size);
-    if (lsize > MAXBITS)
-      luaG_runerror(L, "table overflow");
-    size = twoto(lsize);
-    t->node = luaM_newvector(L, size, Node);
-    for (i=0; i<size; i++) {
-      Node *n = gnode(t, i);
-      gnext(n) = NULL;
-      setnilvalue(gkey(n));
-      setnilvalue(gval(n));
-    }
-  }
-  t->lsizenode = cast_byte(lsize);
-  t->lastfree = gnode(t, size);  /* all positions are free */
-}
-
-
-static void resize (lua_State *L, Table *t, int nasize, int nhsize) {
-  int i;
-  int oldasize = t->sizearray;
-  int oldhsize = t->lsizenode;
-  Node *nold = t->node;  /* save old hash ... */
-  if (nasize > oldasize)  /* array part must grow? */
-    setarrayvector(L, t, nasize);
-  /* create new hash part with appropriate size */
-  setnodevector(L, t, nhsize);
-  if (nasize < oldasize) {  /* array part must shrink? */
-    t->sizearray = nasize;
-    /* re-insert elements from vanishing slice */
-    for (i=nasize; i<oldasize; i++) {
-      if (!ttisnil(&t->array[i]))
-        setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]);
-    }
-    /* shrink array */
-    luaM_reallocvector(L, t->array, oldasize, nasize, TValue);
-  }
-  /* re-insert elements from hash part */
-  for (i = twoto(oldhsize) - 1; i >= 0; i--) {
-    Node *old = nold+i;
-    if (!ttisnil(gval(old)))
-      setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old));
-  }
-  if (nold != dummynode)
-    luaM_freearray(L, nold, twoto(oldhsize), Node);  /* free old array */
-}
-
-
-void luaH_resizearray (lua_State *L, Table *t, int nasize) {
-  int nsize = (t->node == dummynode) ? 0 : sizenode(t);
-  resize(L, t, nasize, nsize);
-}
-
-
-static void rehash (lua_State *L, Table *t, const TValue *ek) {
-  int nasize, na;
-  int nums[MAXBITS+1];  /* nums[i] = number of keys between 2^(i-1) and 2^i */
-  int i;
-  int totaluse;
-  for (i=0; i<=MAXBITS; i++) nums[i] = 0;  /* reset counts */
-  nasize = numusearray(t, nums);  /* count keys in array part */
-  totaluse = nasize;  /* all those keys are integer keys */
-  totaluse += numusehash(t, nums, &nasize);  /* count keys in hash part */
-  /* count extra key */
-  nasize += countint(ek, nums);
-  totaluse++;
-  /* compute new size for array part */
-  na = computesizes(nums, &nasize);
-  /* resize the table to new computed sizes */
-  resize(L, t, nasize, totaluse - na);
-}
-
-
-
-/*
-** }=============================================================
-*/
-
-
-Table *luaH_new (lua_State *L, int narray, int nhash) {
-  Table *t = luaM_new(L, Table);
-  luaC_link(L, obj2gco(t), LUA_TTABLE);
-  t->metatable = NULL;
-  t->flags = cast_byte(~0);
-  /* temporary values (kept only if some malloc fails) */
-  t->array = NULL;
-  t->sizearray = 0;
-  t->lsizenode = 0;
-  t->node = cast(Node *, dummynode);
-  setarrayvector(L, t, narray);
-  setnodevector(L, t, nhash);
-  return t;
-}
-
-
-void luaH_free (lua_State *L, Table *t) {
-  if (t->node != dummynode)
-    luaM_freearray(L, t->node, sizenode(t), Node);
-  luaM_freearray(L, t->array, t->sizearray, TValue);
-  luaM_free(L, t);
-}
-
-
-static Node *getfreepos (Table *t) {
-  while (t->lastfree-- > t->node) {
-    if (ttisnil(gkey(t->lastfree)))
-      return t->lastfree;
-  }
-  return NULL;  /* could not find a free place */
-}
-
-
-
-/*
-** inserts a new key into a hash table; first, check whether key's main
-** position is free. If not, check whether colliding node is in its main
-** position or not: if it is not, move colliding node to an empty place and
-** put new key in its main position; otherwise (colliding node is in its main
-** position), new key goes to an empty position.
-*/
-static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
-  Node *mp = mainposition(t, key);
-  if (!ttisnil(gval(mp)) || mp == dummynode) {
-    Node *othern;
-    Node *n = getfreepos(t);  /* get a free place */
-    if (n == NULL) {  /* cannot find a free place? */
-      rehash(L, t, key);  /* grow table */
-      return luaH_set(L, t, key);  /* re-insert key into grown table */
-    }
-    lua_assert(n != dummynode);
-    othern = mainposition(t, key2tval(mp));
-    if (othern != mp) {  /* is colliding node out of its main position? */
-      /* yes; move colliding node into free position */
-      while (gnext(othern) != mp) othern = gnext(othern);  /* find previous */
-      gnext(othern) = n;  /* redo the chain with `n' in place of `mp' */
-      *n = *mp;  /* copy colliding node into free pos. (mp->next also goes) */
-      gnext(mp) = NULL;  /* now `mp' is free */
-      setnilvalue(gval(mp));
-    }
-    else {  /* colliding node is in its own main position */
-      /* new node will go into free position */
-      gnext(n) = gnext(mp);  /* chain new position */
-      gnext(mp) = n;
-      mp = n;
-    }
-  }
-  gkey(mp)->value = key->value; gkey(mp)->tt = key->tt;
-  luaC_barriert(L, t, key);
-  lua_assert(ttisnil(gval(mp)));
-  return gval(mp);
-}
-
-
-/*
-** search function for integers
-*/
-const TValue *luaH_getnum (Table *t, int key) {
-  /* (1 <= key && key <= t->sizearray) */
-  if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray))
-    return &t->array[key-1];
-  else {
-    lua_Number nk = cast_num(key);
-    Node *n = hashnum(t, nk);
-    do {  /* check whether `key' is somewhere in the chain */
-      if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))
-        return gval(n);  /* that's it */
-      else n = gnext(n);
-    } while (n);
-    return luaO_nilobject;
-  }
-}
-
-
-/*
-** search function for strings
-*/
-const TValue *luaH_getstr (Table *t, TString *key) {
-  Node *n = hashstr(t, key);
-  do {  /* check whether `key' is somewhere in the chain */
-    if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key)
-      return gval(n);  /* that's it */
-    else n = gnext(n);
-  } while (n);
-  return luaO_nilobject;
-}
-
-
-/*
-** main search function
-*/
-const TValue *luaH_get (Table *t, const TValue *key) {
-  switch (ttype(key)) {
-    case LUA_TNIL: return luaO_nilobject;
-    case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));
-    case LUA_TNUMBER: {
-      int k;
-      lua_Number n = nvalue(key);
-      lua_number2int(k, n);
-      if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */
-        return luaH_getnum(t, k);  /* use specialized version */
-      /* else go through */
-    }
-    default: {
-      Node *n = mainposition(t, key);
-      do {  /* check whether `key' is somewhere in the chain */
-        if (luaO_rawequalObj(key2tval(n), key))
-          return gval(n);  /* that's it */
-        else n = gnext(n);
-      } while (n);
-      return luaO_nilobject;
-    }
-  }
-}
-
-
-TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
-  const TValue *p = luaH_get(t, key);
-  t->flags = 0;
-  if (p != luaO_nilobject)
-    return cast(TValue *, p);
-  else {
-    if (ttisnil(key)) luaG_runerror(L, "table index is nil");
-    else if (ttisnumber(key) && luai_numisnan(nvalue(key)))
-      luaG_runerror(L, "table index is NaN");
-    return newkey(L, t, key);
-  }
-}
-
-
-TValue *luaH_setnum (lua_State *L, Table *t, int key) {
-  const TValue *p = luaH_getnum(t, key);
-  if (p != luaO_nilobject)
-    return cast(TValue *, p);
-  else {
-    TValue k;
-    setnvalue(&k, cast_num(key));
-    return newkey(L, t, &k);
-  }
-}
-
-
-TValue *luaH_setstr (lua_State *L, Table *t, TString *key) {
-  const TValue *p = luaH_getstr(t, key);
-  if (p != luaO_nilobject)
-    return cast(TValue *, p);
-  else {
-    TValue k;
-    setsvalue(L, &k, key);
-    return newkey(L, t, &k);
-  }
-}
-
-
-static int unbound_search (Table *t, unsigned int j) {
-  unsigned int i = j;  /* i is zero or a present index */
-  j++;
-  /* find `i' and `j' such that i is present and j is not */
-  while (!ttisnil(luaH_getnum(t, j))) {
-    i = j;
-    j *= 2;
-    if (j > cast(unsigned int, MAX_INT)) {  /* overflow? */
-      /* table was built with bad purposes: resort to linear search */
-      i = 1;
-      while (!ttisnil(luaH_getnum(t, i))) i++;
-      return i - 1;
-    }
-  }
-  /* now do a binary search between them */
-  while (j - i > 1) {
-    unsigned int m = (i+j)/2;
-    if (ttisnil(luaH_getnum(t, m))) j = m;
-    else i = m;
-  }
-  return i;
-}
-
-
-/*
-** Try to find a boundary in table `t'. A `boundary' is an integer index
-** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).
-*/
-int luaH_getn (Table *t) {
-  unsigned int j = t->sizearray;
-  if (j > 0 && ttisnil(&t->array[j - 1])) {
-    /* there is a boundary in the array part: (binary) search for it */
-    unsigned int i = 0;
-    while (j - i > 1) {
-      unsigned int m = (i+j)/2;
-      if (ttisnil(&t->array[m - 1])) j = m;
-      else i = m;
-    }
-    return i;
-  }
-  /* else must find a boundary in hash part */
-  else if (t->node == dummynode)  /* hash part is empty? */
-    return j;  /* that is easy... */
-  else return unbound_search(t, j);
-}
-
-
-
-#if defined(LUA_DEBUG)
-
-Node *luaH_mainposition (const Table *t, const TValue *key) {
-  return mainposition(t, key);
-}
-
-int luaH_isdummy (Node *n) { return n == dummynode; }
-
-#endif
diff --git a/misc/liblua/ltable.h b/misc/liblua/ltable.h
deleted file mode 100644
index f5b9d5e..0000000
--- a/misc/liblua/ltable.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lua tables (hash)
-** See Copyright Notice in lua.h
-*/
-
-#ifndef ltable_h
-#define ltable_h
-
-#include "lobject.h"
-
-
-#define gnode(t,i)	(&(t)->node[i])
-#define gkey(n)		(&(n)->i_key.nk)
-#define gval(n)		(&(n)->i_val)
-#define gnext(n)	((n)->i_key.nk.next)
-
-#define key2tval(n)	(&(n)->i_key.tvk)
-
-
-LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
-LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
-LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
-LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
-LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
-LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
-LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
-LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
-LUAI_FUNC void luaH_free (lua_State *L, Table *t);
-LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
-LUAI_FUNC int luaH_getn (Table *t);
-
-
-#if defined(LUA_DEBUG)
-LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
-LUAI_FUNC int luaH_isdummy (Node *n);
-#endif
-
-
-#endif
diff --git a/misc/liblua/ltablib.c b/misc/liblua/ltablib.c
deleted file mode 100644
index b6d9cb4..0000000
--- a/misc/liblua/ltablib.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
-** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $
-** Library for Table Manipulation
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stddef.h>
-
-#define ltablib_c
-#define LUA_LIB
-
-#include "lua.h"
-
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-#define aux_getn(L,n)	(luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))
-
-
-static int foreachi (lua_State *L) {
-  int i;
-  int n = aux_getn(L, 1);
-  luaL_checktype(L, 2, LUA_TFUNCTION);
-  for (i=1; i <= n; i++) {
-    lua_pushvalue(L, 2);  /* function */
-    lua_pushinteger(L, i);  /* 1st argument */
-    lua_rawgeti(L, 1, i);  /* 2nd argument */
-    lua_call(L, 2, 1);
-    if (!lua_isnil(L, -1))
-      return 1;
-    lua_pop(L, 1);  /* remove nil result */
-  }
-  return 0;
-}
-
-
-static int foreach (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-  luaL_checktype(L, 2, LUA_TFUNCTION);
-  lua_pushnil(L);  /* first key */
-  while (lua_next(L, 1)) {
-    lua_pushvalue(L, 2);  /* function */
-    lua_pushvalue(L, -3);  /* key */
-    lua_pushvalue(L, -3);  /* value */
-    lua_call(L, 2, 1);
-    if (!lua_isnil(L, -1))
-      return 1;
-    lua_pop(L, 2);  /* remove value and result */
-  }
-  return 0;
-}
-
-
-static int maxn (lua_State *L) {
-  lua_Number max = 0;
-  luaL_checktype(L, 1, LUA_TTABLE);
-  lua_pushnil(L);  /* first key */
-  while (lua_next(L, 1)) {
-    lua_pop(L, 1);  /* remove value */
-    if (lua_type(L, -1) == LUA_TNUMBER) {
-      lua_Number v = lua_tonumber(L, -1);
-      if (v > max) max = v;
-    }
-  }
-  lua_pushnumber(L, max);
-  return 1;
-}
-
-
-static int getn (lua_State *L) {
-  lua_pushinteger(L, aux_getn(L, 1));
-  return 1;
-}
-
-
-static int setn (lua_State *L) {
-  luaL_checktype(L, 1, LUA_TTABLE);
-#ifndef luaL_setn
-  luaL_setn(L, 1, luaL_checkint(L, 2));
-#else
-  luaL_error(L, LUA_QL("setn") " is obsolete");
-#endif
-  lua_pushvalue(L, 1);
-  return 1;
-}
-
-
-static int tinsert (lua_State *L) {
-  int e = aux_getn(L, 1) + 1;  /* first empty element */
-  int pos;  /* where to insert new element */
-  switch (lua_gettop(L)) {
-    case 2: {  /* called with only 2 arguments */
-      pos = e;  /* insert new element at the end */
-      break;
-    }
-    case 3: {
-      int i;
-      pos = luaL_checkint(L, 2);  /* 2nd argument is the position */
-      if (pos > e) e = pos;  /* `grow' array if necessary */
-      for (i = e; i > pos; i--) {  /* move up elements */
-        lua_rawgeti(L, 1, i-1);
-        lua_rawseti(L, 1, i);  /* t[i] = t[i-1] */
-      }
-      break;
-    }
-    default: {
-      return luaL_error(L, "wrong number of arguments to " LUA_QL("insert"));
-    }
-  }
-  luaL_setn(L, 1, e);  /* new size */
-  lua_rawseti(L, 1, pos);  /* t[pos] = v */
-  return 0;
-}
-
-
-static int tremove (lua_State *L) {
-  int e = aux_getn(L, 1);
-  int pos = luaL_optint(L, 2, e);
-  if (!(1 <= pos && pos <= e))  /* position is outside bounds? */
-   return 0;  /* nothing to remove */
-  luaL_setn(L, 1, e - 1);  /* t.n = n-1 */
-  lua_rawgeti(L, 1, pos);  /* result = t[pos] */
-  for ( ;pos<e; pos++) {
-    lua_rawgeti(L, 1, pos+1);
-    lua_rawseti(L, 1, pos);  /* t[pos] = t[pos+1] */
-  }
-  lua_pushnil(L);
-  lua_rawseti(L, 1, e);  /* t[e] = nil */
-  return 1;
-}
-
-
-static void addfield (lua_State *L, luaL_Buffer *b, int i) {
-  lua_rawgeti(L, 1, i);
-  if (!lua_isstring(L, -1))
-    luaL_error(L, "invalid value (%s) at index %d in table for "
-                  LUA_QL("concat"), luaL_typename(L, -1), i);
-    luaL_addvalue(b);
-}
-
-
-static int tconcat (lua_State *L) {
-  luaL_Buffer b;
-  size_t lsep;
-  int i, last;
-  const char *sep = luaL_optlstring(L, 2, "", &lsep);
-  luaL_checktype(L, 1, LUA_TTABLE);
-  i = luaL_optint(L, 3, 1);
-  last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
-  luaL_buffinit(L, &b);
-  for (; i < last; i++) {
-    addfield(L, &b, i);
-    luaL_addlstring(&b, sep, lsep);
-  }
-  if (i == last)  /* add last value (if interval was not empty) */
-    addfield(L, &b, i);
-  luaL_pushresult(&b);
-  return 1;
-}
-
-
-
-/*
-** {======================================================
-** Quicksort
-** (based on `Algorithms in MODULA-3', Robert Sedgewick;
-**  Addison-Wesley, 1993.)
-*/
-
-
-static void set2 (lua_State *L, int i, int j) {
-  lua_rawseti(L, 1, i);
-  lua_rawseti(L, 1, j);
-}
-
-static int sort_comp (lua_State *L, int a, int b) {
-  if (!lua_isnil(L, 2)) {  /* function? */
-    int res;
-    lua_pushvalue(L, 2);
-    lua_pushvalue(L, a-1);  /* -1 to compensate function */
-    lua_pushvalue(L, b-2);  /* -2 to compensate function and `a' */
-    lua_call(L, 2, 1);
-    res = lua_toboolean(L, -1);
-    lua_pop(L, 1);
-    return res;
-  }
-  else  /* a < b? */
-    return lua_lessthan(L, a, b);
-}
-
-static void auxsort (lua_State *L, int l, int u) {
-  while (l < u) {  /* for tail recursion */
-    int i, j;
-    /* sort elements a[l], a[(l+u)/2] and a[u] */
-    lua_rawgeti(L, 1, l);
-    lua_rawgeti(L, 1, u);
-    if (sort_comp(L, -1, -2))  /* a[u] < a[l]? */
-      set2(L, l, u);  /* swap a[l] - a[u] */
-    else
-      lua_pop(L, 2);
-    if (u-l == 1) break;  /* only 2 elements */
-    i = (l+u)/2;
-    lua_rawgeti(L, 1, i);
-    lua_rawgeti(L, 1, l);
-    if (sort_comp(L, -2, -1))  /* a[i]<a[l]? */
-      set2(L, i, l);
-    else {
-      lua_pop(L, 1);  /* remove a[l] */
-      lua_rawgeti(L, 1, u);
-      if (sort_comp(L, -1, -2))  /* a[u]<a[i]? */
-        set2(L, i, u);
-      else
-        lua_pop(L, 2);
-    }
-    if (u-l == 2) break;  /* only 3 elements */
-    lua_rawgeti(L, 1, i);  /* Pivot */
-    lua_pushvalue(L, -1);
-    lua_rawgeti(L, 1, u-1);
-    set2(L, i, u-1);
-    /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */
-    i = l; j = u-1;
-    for (;;) {  /* invariant: a[l..i] <= P <= a[j..u] */
-      /* repeat ++i until a[i] >= P */
-      while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {
-        if (i>u) luaL_error(L, "invalid order function for sorting");
-        lua_pop(L, 1);  /* remove a[i] */
-      }
-      /* repeat --j until a[j] <= P */
-      while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {
-        if (j<l) luaL_error(L, "invalid order function for sorting");
-        lua_pop(L, 1);  /* remove a[j] */
-      }
-      if (j<i) {
-        lua_pop(L, 3);  /* pop pivot, a[i], a[j] */
-        break;
-      }
-      set2(L, i, j);
-    }
-    lua_rawgeti(L, 1, u-1);
-    lua_rawgeti(L, 1, i);
-    set2(L, u-1, i);  /* swap pivot (a[u-1]) with a[i] */
-    /* a[l..i-1] <= a[i] == P <= a[i+1..u] */
-    /* adjust so that smaller half is in [j..i] and larger one in [l..u] */
-    if (i-l < u-i) {
-      j=l; i=i-1; l=i+2;
-    }
-    else {
-      j=i+1; i=u; u=j-2;
-    }
-    auxsort(L, j, i);  /* call recursively the smaller one */
-  }  /* repeat the routine for the larger one */
-}
-
-static int sort (lua_State *L) {
-  int n = aux_getn(L, 1);
-  luaL_checkstack(L, 40, "");  /* assume array is smaller than 2^40 */
-  if (!lua_isnoneornil(L, 2))  /* is there a 2nd argument? */
-    luaL_checktype(L, 2, LUA_TFUNCTION);
-  lua_settop(L, 2);  /* make sure there is two arguments */
-  auxsort(L, 1, n);
-  return 0;
-}
-
-/* }====================================================== */
-
-
-static const luaL_Reg tab_funcs[] = {
-  {"concat", tconcat},
-  {"foreach", foreach},
-  {"foreachi", foreachi},
-  {"getn", getn},
-  {"maxn", maxn},
-  {"insert", tinsert},
-  {"remove", tremove},
-  {"setn", setn},
-  {"sort", sort},
-  {NULL, NULL}
-};
-
-
-LUALIB_API int luaopen_table (lua_State *L) {
-  luaL_register(L, LUA_TABLIBNAME, tab_funcs);
-  return 1;
-}
-
diff --git a/misc/liblua/ltm.c b/misc/liblua/ltm.c
deleted file mode 100644
index c27f0f6..0000000
--- a/misc/liblua/ltm.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
-** Tag methods
-** See Copyright Notice in lua.h
-*/
-
-
-#include <string.h>
-
-#define ltm_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "lobject.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-
-
-
-const char *const luaT_typenames[] = {
-  "nil", "boolean", "userdata", "number",
-  "string", "table", "function", "userdata", "thread",
-  "proto", "upval"
-};
-
-
-void luaT_init (lua_State *L) {
-  static const char *const luaT_eventname[] = {  /* ORDER TM */
-    "__index", "__newindex",
-    "__gc", "__mode", "__eq",
-    "__add", "__sub", "__mul", "__div", "__mod",
-    "__pow", "__unm", "__len", "__lt", "__le",
-    "__concat", "__call"
-  };
-  int i;
-  for (i=0; i<TM_N; i++) {
-    G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]);
-    luaS_fix(G(L)->tmname[i]);  /* never collect these names */
-  }
-}
-
-
-/*
-** function to be used with macro "fasttm": optimized for absence of
-** tag methods
-*/
-const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
-  const TValue *tm = luaH_getstr(events, ename);
-  lua_assert(event <= TM_EQ);
-  if (ttisnil(tm)) {  /* no tag method? */
-    events->flags |= cast_byte(1u<<event);  /* cache this fact */
-    return NULL;
-  }
-  else return tm;
-}
-
-
-const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
-  Table *mt;
-  switch (ttype(o)) {
-    case LUA_TTABLE:
-      mt = hvalue(o)->metatable;
-      break;
-    case LUA_TUSERDATA:
-      mt = uvalue(o)->metatable;
-      break;
-    default:
-      mt = G(L)->mt[ttype(o)];
-  }
-  return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);
-}
-
diff --git a/misc/liblua/ltm.h b/misc/liblua/ltm.h
deleted file mode 100644
index 64343b7..0000000
--- a/misc/liblua/ltm.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
-** Tag methods
-** See Copyright Notice in lua.h
-*/
-
-#ifndef ltm_h
-#define ltm_h
-
-
-#include "lobject.h"
-
-
-/*
-* WARNING: if you change the order of this enumeration,
-* grep "ORDER TM"
-*/
-typedef enum {
-  TM_INDEX,
-  TM_NEWINDEX,
-  TM_GC,
-  TM_MODE,
-  TM_EQ,  /* last tag method with `fast' access */
-  TM_ADD,
-  TM_SUB,
-  TM_MUL,
-  TM_DIV,
-  TM_MOD,
-  TM_POW,
-  TM_UNM,
-  TM_LEN,
-  TM_LT,
-  TM_LE,
-  TM_CONCAT,
-  TM_CALL,
-  TM_N		/* number of elements in the enum */
-} TMS;
-
-
-
-#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
-  ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
-
-#define fasttm(l,et,e)	gfasttm(G(l), et, e)
-
-LUAI_DATA const char *const luaT_typenames[];
-
-
-LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
-LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
-                                                       TMS event);
-LUAI_FUNC void luaT_init (lua_State *L);
-
-#endif
diff --git a/misc/liblua/lua.h b/misc/liblua/lua.h
deleted file mode 100644
index b796878..0000000
--- a/misc/liblua/lua.h
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $
-** Lua - An Extensible Extension Language
-** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
-** See Copyright Notice at the end of this file
-*/
-
-
-#ifndef lua_h
-#define lua_h
-
-#include <stdarg.h>
-#include <stddef.h>
-
-
-#include "luaconf.h"
-
-
-#define LUA_VERSION	"Lua 5.1"
-#define LUA_RELEASE	"Lua 5.1.4"
-#define LUA_VERSION_NUM	501
-#define LUA_COPYRIGHT	"Copyright (C) 1994-2008 Lua.org, PUC-Rio"
-#define LUA_AUTHORS 	"R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
-
-
-/* mark for precompiled code (`<esc>Lua') */
-#define	LUA_SIGNATURE	"\033Lua"
-
-/* option for multiple returns in `lua_pcall' and `lua_call' */
-#define LUA_MULTRET	(-1)
-
-
-/*
-** pseudo-indices
-*/
-#define LUA_REGISTRYINDEX	(-10000)
-#define LUA_ENVIRONINDEX	(-10001)
-#define LUA_GLOBALSINDEX	(-10002)
-#define lua_upvalueindex(i)	(LUA_GLOBALSINDEX-(i))
-
-
-/* thread status; 0 is OK */
-#define LUA_YIELD	1
-#define LUA_ERRRUN	2
-#define LUA_ERRSYNTAX	3
-#define LUA_ERRMEM	4
-#define LUA_ERRERR	5
-
-
-typedef struct lua_State lua_State;
-
-typedef int (*lua_CFunction) (lua_State *L);
-
-
-/*
-** functions that read/write blocks when loading/dumping Lua chunks
-*/
-typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
-
-typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
-
-
-/*
-** prototype for memory-allocation functions
-*/
-typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
-
-
-/*
-** basic types
-*/
-#define LUA_TNONE		(-1)
-
-#define LUA_TNIL		0
-#define LUA_TBOOLEAN		1
-#define LUA_TLIGHTUSERDATA	2
-#define LUA_TNUMBER		3
-#define LUA_TSTRING		4
-#define LUA_TTABLE		5
-#define LUA_TFUNCTION		6
-#define LUA_TUSERDATA		7
-#define LUA_TTHREAD		8
-
-
-
-/* minimum Lua stack available to a C function */
-#define LUA_MINSTACK	20
-
-
-/*
-** generic extra include file
-*/
-#if defined(LUA_USER_H)
-#include LUA_USER_H
-#endif
-
-
-/* type of numbers in Lua */
-typedef LUA_NUMBER lua_Number;
-
-
-/* type for integer functions */
-typedef LUA_INTEGER lua_Integer;
-
-
-
-/*
-** state manipulation
-*/
-LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
-LUA_API void       (lua_close) (lua_State *L);
-LUA_API lua_State *(lua_newthread) (lua_State *L);
-
-LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
-
-
-/*
-** basic stack manipulation
-*/
-LUA_API int   (lua_gettop) (lua_State *L);
-LUA_API void  (lua_settop) (lua_State *L, int idx);
-LUA_API void  (lua_pushvalue) (lua_State *L, int idx);
-LUA_API void  (lua_remove) (lua_State *L, int idx);
-LUA_API void  (lua_insert) (lua_State *L, int idx);
-LUA_API void  (lua_replace) (lua_State *L, int idx);
-LUA_API int   (lua_checkstack) (lua_State *L, int sz);
-
-LUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);
-
-
-/*
-** access functions (stack -> C)
-*/
-
-LUA_API int             (lua_isnumber) (lua_State *L, int idx);
-LUA_API int             (lua_isstring) (lua_State *L, int idx);
-LUA_API int             (lua_iscfunction) (lua_State *L, int idx);
-LUA_API int             (lua_isuserdata) (lua_State *L, int idx);
-LUA_API int             (lua_type) (lua_State *L, int idx);
-LUA_API const char     *(lua_typename) (lua_State *L, int tp);
-
-LUA_API int            (lua_equal) (lua_State *L, int idx1, int idx2);
-LUA_API int            (lua_rawequal) (lua_State *L, int idx1, int idx2);
-LUA_API int            (lua_lessthan) (lua_State *L, int idx1, int idx2);
-
-LUA_API lua_Number      (lua_tonumber) (lua_State *L, int idx);
-LUA_API lua_Integer     (lua_tointeger) (lua_State *L, int idx);
-LUA_API int             (lua_toboolean) (lua_State *L, int idx);
-LUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);
-LUA_API size_t          (lua_objlen) (lua_State *L, int idx);
-LUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);
-LUA_API void	       *(lua_touserdata) (lua_State *L, int idx);
-LUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);
-LUA_API const void     *(lua_topointer) (lua_State *L, int idx);
-
-
-/*
-** push functions (C -> stack)
-*/
-LUA_API void  (lua_pushnil) (lua_State *L);
-LUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);
-LUA_API void  (lua_pushinteger) (lua_State *L, lua_Integer n);
-LUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);
-LUA_API void  (lua_pushstring) (lua_State *L, const char *s);
-LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
-                                                      va_list argp);
-LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
-LUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
-LUA_API void  (lua_pushboolean) (lua_State *L, int b);
-LUA_API void  (lua_pushlightuserdata) (lua_State *L, void *p);
-LUA_API int   (lua_pushthread) (lua_State *L);
-
-
-/*
-** get functions (Lua -> stack)
-*/
-LUA_API void  (lua_gettable) (lua_State *L, int idx);
-LUA_API void  (lua_getfield) (lua_State *L, int idx, const char *k);
-LUA_API void  (lua_rawget) (lua_State *L, int idx);
-LUA_API void  (lua_rawgeti) (lua_State *L, int idx, int n);
-LUA_API void  (lua_createtable) (lua_State *L, int narr, int nrec);
-LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
-LUA_API int   (lua_getmetatable) (lua_State *L, int objindex);
-LUA_API void  (lua_getfenv) (lua_State *L, int idx);
-
-
-/*
-** set functions (stack -> Lua)
-*/
-LUA_API void  (lua_settable) (lua_State *L, int idx);
-LUA_API void  (lua_setfield) (lua_State *L, int idx, const char *k);
-LUA_API void  (lua_rawset) (lua_State *L, int idx);
-LUA_API void  (lua_rawseti) (lua_State *L, int idx, int n);
-LUA_API int   (lua_setmetatable) (lua_State *L, int objindex);
-LUA_API int   (lua_setfenv) (lua_State *L, int idx);
-
-
-/*
-** `load' and `call' functions (load and run Lua code)
-*/
-LUA_API void  (lua_call) (lua_State *L, int nargs, int nresults);
-LUA_API int   (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
-LUA_API int   (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
-LUA_API int   (lua_load) (lua_State *L, lua_Reader reader, void *dt,
-                                        const char *chunkname);
-
-LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
-
-
-/*
-** coroutine functions
-*/
-LUA_API int  (lua_yield) (lua_State *L, int nresults);
-LUA_API int  (lua_resume) (lua_State *L, int narg);
-LUA_API int  (lua_status) (lua_State *L);
-
-/*
-** garbage-collection function and options
-*/
-
-#define LUA_GCSTOP		0
-#define LUA_GCRESTART		1
-#define LUA_GCCOLLECT		2
-#define LUA_GCCOUNT		3
-#define LUA_GCCOUNTB		4
-#define LUA_GCSTEP		5
-#define LUA_GCSETPAUSE		6
-#define LUA_GCSETSTEPMUL	7
-
-LUA_API int (lua_gc) (lua_State *L, int what, int data);
-
-
-/*
-** miscellaneous functions
-*/
-
-LUA_API int   (lua_error) (lua_State *L);
-
-LUA_API int   (lua_next) (lua_State *L, int idx);
-
-LUA_API void  (lua_concat) (lua_State *L, int n);
-
-LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
-LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
-
-
-
-/*
-** ===============================================================
-** some useful macros
-** ===============================================================
-*/
-
-#define lua_pop(L,n)		lua_settop(L, -(n)-1)
-
-#define lua_newtable(L)		lua_createtable(L, 0, 0)
-
-#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
-
-#define lua_pushcfunction(L,f)	lua_pushcclosure(L, (f), 0)
-
-#define lua_strlen(L,i)		lua_objlen(L, (i))
-
-#define lua_isfunction(L,n)	(lua_type(L, (n)) == LUA_TFUNCTION)
-#define lua_istable(L,n)	(lua_type(L, (n)) == LUA_TTABLE)
-#define lua_islightuserdata(L,n)	(lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
-#define lua_isnil(L,n)		(lua_type(L, (n)) == LUA_TNIL)
-#define lua_isboolean(L,n)	(lua_type(L, (n)) == LUA_TBOOLEAN)
-#define lua_isthread(L,n)	(lua_type(L, (n)) == LUA_TTHREAD)
-#define lua_isnone(L,n)		(lua_type(L, (n)) == LUA_TNONE)
-#define lua_isnoneornil(L, n)	(lua_type(L, (n)) <= 0)
-
-#define lua_pushliteral(L, s)	\
-	lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
-
-#define lua_setglobal(L,s)	lua_setfield(L, LUA_GLOBALSINDEX, (s))
-#define lua_getglobal(L,s)	lua_getfield(L, LUA_GLOBALSINDEX, (s))
-
-#define lua_tostring(L,i)	lua_tolstring(L, (i), NULL)
-
-
-
-/*
-** compatibility macros and functions
-*/
-
-#define lua_open()	luaL_newstate()
-
-#define lua_getregistry(L)	lua_pushvalue(L, LUA_REGISTRYINDEX)
-
-#define lua_getgccount(L)	lua_gc(L, LUA_GCCOUNT, 0)
-
-#define lua_Chunkreader		lua_Reader
-#define lua_Chunkwriter		lua_Writer
-
-
-/* hack */
-LUA_API void lua_setlevel	(lua_State *from, lua_State *to);
-
-
-/*
-** {======================================================================
-** Debug API
-** =======================================================================
-*/
-
-
-/*
-** Event codes
-*/
-#define LUA_HOOKCALL	0
-#define LUA_HOOKRET	1
-#define LUA_HOOKLINE	2
-#define LUA_HOOKCOUNT	3
-#define LUA_HOOKTAILRET 4
-
-
-/*
-** Event masks
-*/
-#define LUA_MASKCALL	(1 << LUA_HOOKCALL)
-#define LUA_MASKRET	(1 << LUA_HOOKRET)
-#define LUA_MASKLINE	(1 << LUA_HOOKLINE)
-#define LUA_MASKCOUNT	(1 << LUA_HOOKCOUNT)
-
-typedef struct lua_Debug lua_Debug;  /* activation record */
-
-
-/* Functions to be called by the debuger in specific events */
-typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
-
-
-LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
-LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
-LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
-LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
-LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);
-LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);
-
-LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
-LUA_API lua_Hook lua_gethook (lua_State *L);
-LUA_API int lua_gethookmask (lua_State *L);
-LUA_API int lua_gethookcount (lua_State *L);
-
-
-struct lua_Debug {
-  int event;
-  const char *name;	/* (n) */
-  const char *namewhat;	/* (n) `global', `local', `field', `method' */
-  const char *what;	/* (S) `Lua', `C', `main', `tail' */
-  const char *source;	/* (S) */
-  int currentline;	/* (l) */
-  int nups;		/* (u) number of upvalues */
-  int linedefined;	/* (S) */
-  int lastlinedefined;	/* (S) */
-  char short_src[LUA_IDSIZE]; /* (S) */
-  /* private part */
-  int i_ci;  /* active function */
-};
-
-/* }====================================================================== */
-
-
-/******************************************************************************
-* Copyright (C) 1994-2008 Lua.org, PUC-Rio.  All rights reserved.
-*
-* 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.
-******************************************************************************/
-
-
-#endif
diff --git a/misc/liblua/luaconf.h b/misc/liblua/luaconf.h
deleted file mode 100644
index e2cb261..0000000
--- a/misc/liblua/luaconf.h
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
-** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $
-** Configuration file for Lua
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lconfig_h
-#define lconfig_h
-
-#include <limits.h>
-#include <stddef.h>
-
-
-/*
-** ==================================================================
-** Search for "@@" to find all configurable definitions.
-** ===================================================================
-*/
-
-
-/*
-@@ LUA_ANSI controls the use of non-ansi features.
-** CHANGE it (define it) if you want Lua to avoid the use of any
-** non-ansi feature or library.
-*/
-#if defined(__STRICT_ANSI__)
-#define LUA_ANSI
-#endif
-
-
-#if !defined(LUA_ANSI) && defined(_WIN32)
-#define LUA_WIN
-#endif
-
-#if defined(LUA_USE_LINUX)
-#define LUA_USE_POSIX
-#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
-#define LUA_USE_READLINE	/* needs some extra libraries */
-#endif
-
-#if defined(LUA_USE_MACOSX)
-#define LUA_USE_POSIX
-#define LUA_DL_DYLD		/* does not need extra library */
-#endif
-
-
-
-/*
-@@ LUA_USE_POSIX includes all functionallity listed as X/Open System
-@* Interfaces Extension (XSI).
-** CHANGE it (define it) if your system is XSI compatible.
-*/
-#if defined(LUA_USE_POSIX)
-#define LUA_USE_MKSTEMP
-#define LUA_USE_ISATTY
-#define LUA_USE_POPEN
-#define LUA_USE_ULONGJMP
-#endif
-
-
-/*
-@@ LUA_PATH and LUA_CPATH are the names of the environment variables that
-@* Lua check to set its paths.
-@@ LUA_INIT is the name of the environment variable that Lua
-@* checks for initialization code.
-** CHANGE them if you want different names.
-*/
-#define LUA_PATH        "LUA_PATH"
-#define LUA_CPATH       "LUA_CPATH"
-#define LUA_INIT	"LUA_INIT"
-
-
-/*
-@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
-@* Lua libraries.
-@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
-@* C libraries.
-** CHANGE them if your machine has a non-conventional directory
-** hierarchy or if you want to install your libraries in
-** non-conventional directories.
-*/
-#if defined(_WIN32)
-/*
-** In Windows, any exclamation mark ('!') in the path is replaced by the
-** path of the directory of the executable file of the current process.
-*/
-#define LUA_LDIR	"!\\lua\\"
-#define LUA_CDIR	"!\\"
-#define LUA_PATH_DEFAULT  \
-		".\\?.lua;"  LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
-		             LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua"
-#define LUA_CPATH_DEFAULT \
-	".\\?.dll;"  LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
-
-#else
-#define LUA_ROOT	"/usr/local/"
-#define LUA_LDIR	LUA_ROOT "share/lua/5.1/"
-#define LUA_CDIR	LUA_ROOT "lib/lua/5.1/"
-#define LUA_PATH_DEFAULT  \
-		"./?.lua;"  LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
-		            LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua"
-#define LUA_CPATH_DEFAULT \
-	"./?.so;"  LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
-#endif
-
-
-/*
-@@ LUA_DIRSEP is the directory separator (for submodules).
-** CHANGE it if your machine does not use "/" as the directory separator
-** and is not Windows. (On Windows Lua automatically uses "\".)
-*/
-#if defined(_WIN32)
-#define LUA_DIRSEP	"\\"
-#else
-#define LUA_DIRSEP	"/"
-#endif
-
-
-/*
-@@ LUA_PATHSEP is the character that separates templates in a path.
-@@ LUA_PATH_MARK is the string that marks the substitution points in a
-@* template.
-@@ LUA_EXECDIR in a Windows path is replaced by the executable's
-@* directory.
-@@ LUA_IGMARK is a mark to ignore all before it when bulding the
-@* luaopen_ function name.
-** CHANGE them if for some reason your system cannot use those
-** characters. (E.g., if one of those characters is a common character
-** in file/directory names.) Probably you do not need to change them.
-*/
-#define LUA_PATHSEP	";"
-#define LUA_PATH_MARK	"?"
-#define LUA_EXECDIR	"!"
-#define LUA_IGMARK	"-"
-
-
-/*
-@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
-** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
-** machines, ptrdiff_t gives a good choice between int or long.)
-*/
-#define LUA_INTEGER	ptrdiff_t
-
-
-/*
-@@ LUA_API is a mark for all core API functions.
-@@ LUALIB_API is a mark for all standard library functions.
-** CHANGE them if you need to define those functions in some special way.
-** For instance, if you want to create one Windows DLL with the core and
-** the libraries, you may want to use the following definition (define
-** LUA_BUILD_AS_DLL to get it).
-*/
-#if defined(LUA_BUILD_AS_DLL)
-
-#if defined(LUA_CORE) || defined(LUA_LIB)
-#define LUA_API __declspec(dllexport)
-#else
-#define LUA_API __declspec(dllimport)
-#endif
-
-#else
-
-#define LUA_API		extern
-
-#endif
-
-/* more often than not the libs go together with the core */
-#define LUALIB_API	LUA_API
-
-
-/*
-@@ LUAI_FUNC is a mark for all extern functions that are not to be
-@* exported to outside modules.
-@@ LUAI_DATA is a mark for all extern (const) variables that are not to
-@* be exported to outside modules.
-** CHANGE them if you need to mark them in some special way. Elf/gcc
-** (versions 3.2 and later) mark them as "hidden" to optimize access
-** when Lua is compiled as a shared library.
-*/
-#if defined(luaall_c)
-#define LUAI_FUNC	static
-#define LUAI_DATA	/* empty */
-
-#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
-      defined(__ELF__)
-#define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
-#define LUAI_DATA	LUAI_FUNC
-
-#else
-#define LUAI_FUNC	extern
-#define LUAI_DATA	extern
-#endif
-
-
-
-/*
-@@ LUA_QL describes how error messages quote program elements.
-** CHANGE it if you want a different appearance.
-*/
-#define LUA_QL(x)	"'" x "'"
-#define LUA_QS		LUA_QL("%s")
-
-
-/*
-@@ LUA_IDSIZE gives the maximum size for the description of the source
-@* of a function in debug information.
-** CHANGE it if you want a different size.
-*/
-#define LUA_IDSIZE	60
-
-
-/*
-** {==================================================================
-** Stand-alone configuration
-** ===================================================================
-*/
-
-#if defined(lua_c) || defined(luaall_c)
-
-/*
-@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
-@* is, whether we're running lua interactively).
-** CHANGE it if you have a better definition for non-POSIX/non-Windows
-** systems.
-*/
-#if defined(LUA_USE_ISATTY)
-#include <unistd.h>
-#define lua_stdin_is_tty()	isatty(0)
-#elif defined(LUA_WIN)
-#include <io.h>
-#include <stdio.h>
-#define lua_stdin_is_tty()	_isatty(_fileno(stdin))
-#else
-#define lua_stdin_is_tty()	1  /* assume stdin is a tty */
-#endif
-
-
-/*
-@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
-@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
-** CHANGE them if you want different prompts. (You can also change the
-** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
-*/
-#define LUA_PROMPT		"> "
-#define LUA_PROMPT2		">> "
-
-
-/*
-@@ LUA_PROGNAME is the default name for the stand-alone Lua program.
-** CHANGE it if your stand-alone interpreter has a different name and
-** your system is not able to detect that name automatically.
-*/
-#define LUA_PROGNAME		"lua"
-
-
-/*
-@@ LUA_MAXINPUT is the maximum length for an input line in the
-@* stand-alone interpreter.
-** CHANGE it if you need longer lines.
-*/
-#define LUA_MAXINPUT	512
-
-
-/*
-@@ lua_readline defines how to show a prompt and then read a line from
-@* the standard input.
-@@ lua_saveline defines how to "save" a read line in a "history".
-@@ lua_freeline defines how to free a line read by lua_readline.
-** CHANGE them if you want to improve this functionality (e.g., by using
-** GNU readline and history facilities).
-*/
-#if defined(LUA_USE_READLINE)
-#include <stdio.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-#define lua_readline(L,b,p)	((void)L, ((b)=readline(p)) != NULL)
-#define lua_saveline(L,idx) \
-	if (lua_strlen(L,idx) > 0)  /* non-empty line? */ \
-	  add_history(lua_tostring(L, idx));  /* add it to history */
-#define lua_freeline(L,b)	((void)L, free(b))
-#else
-#define lua_readline(L,b,p)	\
-	((void)L, fputs(p, stdout), fflush(stdout),  /* show prompt */ \
-	fgets(b, LUA_MAXINPUT, stdin) != NULL)  /* get line */
-#define lua_saveline(L,idx)	{ (void)L; (void)idx; }
-#define lua_freeline(L,b)	{ (void)L; (void)b; }
-#endif
-
-#endif
-
-/* }================================================================== */
-
-
-/*
-@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles
-@* as a percentage.
-** CHANGE it if you want the GC to run faster or slower (higher values
-** mean larger pauses which mean slower collection.) You can also change
-** this value dynamically.
-*/
-#define LUAI_GCPAUSE	200  /* 200% (wait memory to double before next GC) */
-
-
-/*
-@@ LUAI_GCMUL defines the default speed of garbage collection relative to
-@* memory allocation as a percentage.
-** CHANGE it if you want to change the granularity of the garbage
-** collection. (Higher values mean coarser collections. 0 represents
-** infinity, where each step performs a full collection.) You can also
-** change this value dynamically.
-*/
-#define LUAI_GCMUL	200 /* GC runs 'twice the speed' of memory allocation */
-
-
-
-/*
-@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.
-** CHANGE it (define it) if you want exact compatibility with the
-** behavior of setn/getn in Lua 5.0.
-*/
-#undef LUA_COMPAT_GETN
-
-/*
-@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.
-** CHANGE it to undefined as soon as you do not need a global 'loadlib'
-** function (the function is still available as 'package.loadlib').
-*/
-#undef LUA_COMPAT_LOADLIB
-
-/*
-@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
-** CHANGE it to undefined as soon as your programs use only '...' to
-** access vararg parameters (instead of the old 'arg' table).
-*/
-#define LUA_COMPAT_VARARG
-
-/*
-@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
-** CHANGE it to undefined as soon as your programs use 'math.fmod' or
-** the new '%' operator instead of 'math.mod'.
-*/
-#define LUA_COMPAT_MOD
-
-/*
-@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
-@* facility.
-** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
-** off the advisory error when nesting [[...]].
-*/
-#define LUA_COMPAT_LSTR		1
-
-/*
-@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
-** CHANGE it to undefined as soon as you rename 'string.gfind' to
-** 'string.gmatch'.
-*/
-#define LUA_COMPAT_GFIND
-
-/*
-@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
-@* behavior.
-** CHANGE it to undefined as soon as you replace to 'luaL_register'
-** your uses of 'luaL_openlib'
-*/
-#define LUA_COMPAT_OPENLIB
-
-
-
-/*
-@@ luai_apicheck is the assert macro used by the Lua-C API.
-** CHANGE luai_apicheck if you want Lua to perform some checks in the
-** parameters it gets from API calls. This may slow down the interpreter
-** a bit, but may be quite useful when debugging C code that interfaces
-** with Lua. A useful redefinition is to use assert.h.
-*/
-#if defined(LUA_USE_APICHECK)
-#include <assert.h>
-#define luai_apicheck(L,o)	{ (void)L; assert(o); }
-#else
-#define luai_apicheck(L,o)	{ (void)L; }
-#endif
-
-
-/*
-@@ LUAI_BITSINT defines the number of bits in an int.
-** CHANGE here if Lua cannot automatically detect the number of bits of
-** your machine. Probably you do not need to change this.
-*/
-/* avoid overflows in comparison */
-#if INT_MAX-20 < 32760
-#define LUAI_BITSINT	16
-#elif INT_MAX > 2147483640L
-/* int has at least 32 bits */
-#define LUAI_BITSINT	32
-#else
-#error "you must define LUA_BITSINT with number of bits in an integer"
-#endif
-
-
-/*
-@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
-@@ LUAI_INT32 is an signed integer with at least 32 bits.
-@@ LUAI_UMEM is an unsigned integer big enough to count the total
-@* memory used by Lua.
-@@ LUAI_MEM is a signed integer big enough to count the total memory
-@* used by Lua.
-** CHANGE here if for some weird reason the default definitions are not
-** good enough for your machine. (The definitions in the 'else'
-** part always works, but may waste space on machines with 64-bit
-** longs.) Probably you do not need to change this.
-*/
-#if LUAI_BITSINT >= 32
-#define LUAI_UINT32	unsigned int
-#define LUAI_INT32	int
-#define LUAI_MAXINT32	INT_MAX
-#define LUAI_UMEM	size_t
-#define LUAI_MEM	ptrdiff_t
-#else
-/* 16-bit ints */
-#define LUAI_UINT32	unsigned long
-#define LUAI_INT32	long
-#define LUAI_MAXINT32	LONG_MAX
-#define LUAI_UMEM	unsigned long
-#define LUAI_MEM	long
-#endif
-
-
-/*
-@@ LUAI_MAXCALLS limits the number of nested calls.
-** CHANGE it if you need really deep recursive calls. This limit is
-** arbitrary; its only purpose is to stop infinite recursion before
-** exhausting memory.
-*/
-#define LUAI_MAXCALLS	20000
-
-
-/*
-@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
-@* can use.
-** CHANGE it if you need lots of (Lua) stack space for your C
-** functions. This limit is arbitrary; its only purpose is to stop C
-** functions to consume unlimited stack space. (must be smaller than
-** -LUA_REGISTRYINDEX)
-*/
-#define LUAI_MAXCSTACK	8000
-
-
-
-/*
-** {==================================================================
-** CHANGE (to smaller values) the following definitions if your system
-** has a small C stack. (Or you may want to change them to larger
-** values if your system has a large C stack and these limits are
-** too rigid for you.) Some of these constants control the size of
-** stack-allocated arrays used by the compiler or the interpreter, while
-** others limit the maximum number of recursive calls that the compiler
-** or the interpreter can perform. Values too large may cause a C stack
-** overflow for some forms of deep constructs.
-** ===================================================================
-*/
-
-
-/*
-@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
-@* syntactical nested non-terminals in a program.
-*/
-#define LUAI_MAXCCALLS		200
-
-
-/*
-@@ LUAI_MAXVARS is the maximum number of local variables per function
-@* (must be smaller than 250).
-*/
-#define LUAI_MAXVARS		200
-
-
-/*
-@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
-@* (must be smaller than 250).
-*/
-#define LUAI_MAXUPVALUES	60
-
-
-/*
-@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
-*/
-#define LUAL_BUFFERSIZE		BUFSIZ
-
-/* }================================================================== */
-
-
-
-
-/*
-** {==================================================================
-@@ LUA_NUMBER is the type of numbers in Lua.
-** CHANGE the following definitions only if you want to build Lua
-** with a number type different from double. You may also need to
-** change lua_number2int & lua_number2integer.
-** ===================================================================
-*/
-
-#define LUA_NUMBER_DOUBLE
-#define LUA_NUMBER	double
-
-/*
-@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
-@* over a number.
-*/
-#define LUAI_UACNUMBER	double
-
-
-/*
-@@ LUA_NUMBER_SCAN is the format for reading numbers.
-@@ LUA_NUMBER_FMT is the format for writing numbers.
-@@ lua_number2str converts a number to a string.
-@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
-@@ lua_str2number converts a string to a number.
-*/
-#define LUA_NUMBER_SCAN		"%lf"
-#define LUA_NUMBER_FMT		"%.14g"
-#define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))
-#define LUAI_MAXNUMBER2STR	32 /* 16 digits, sign, point, and \0 */
-#define lua_str2number(s,p)	strtod((s), (p))
-
-
-/*
-@@ The luai_num* macros define the primitive operations over numbers.
-*/
-#if defined(LUA_CORE)
-#include <math.h>
-#define luai_numadd(a,b)	((a)+(b))
-#define luai_numsub(a,b)	((a)-(b))
-#define luai_nummul(a,b)	((a)*(b))
-#define luai_numdiv(a,b)	((a)/(b))
-#define luai_nummod(a,b)	((a) - floor((a)/(b))*(b))
-#define luai_numpow(a,b)	(pow(a,b))
-#define luai_numunm(a)		(-(a))
-#define luai_numeq(a,b)		((a)==(b))
-#define luai_numlt(a,b)		((a)<(b))
-#define luai_numle(a,b)		((a)<=(b))
-#define luai_numisnan(a)	(!luai_numeq((a), (a)))
-#endif
-
-
-/*
-@@ lua_number2int is a macro to convert lua_Number to int.
-@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
-** CHANGE them if you know a faster way to convert a lua_Number to
-** int (with any rounding method and without throwing errors) in your
-** system. In Pentium machines, a naive typecast from double to int
-** in C is extremely slow, so any alternative is worth trying.
-*/
-
-/* On a Pentium, resort to a trick */
-#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
-    (defined(__i386) || defined (_M_IX86) || defined(__i386__))
-
-/* On a Microsoft compiler, use assembler */
-#if defined(_MSC_VER)
-
-#define lua_number2int(i,d)   __asm fld d   __asm fistp i
-#define lua_number2integer(i,n)		lua_number2int(i, n)
-
-/* the next trick should work on any Pentium, but sometimes clashes
-   with a DirectX idiosyncrasy */
-#else
-
-union luai_Cast { double l_d; long l_l; };
-#define lua_number2int(i,d) \
-  { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
-#define lua_number2integer(i,n)		lua_number2int(i, n)
-
-#endif
-
-
-/* this option always works, but may be slow */
-#else
-#define lua_number2int(i,d)	((i)=(int)(d))
-#define lua_number2integer(i,d)	((i)=(lua_Integer)(d))
-
-#endif
-
-/* }================================================================== */
-
-
-/*
-@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
-** CHANGE it if your system requires alignments larger than double. (For
-** instance, if your system supports long doubles and they must be
-** aligned in 16-byte boundaries, then you should add long double in the
-** union.) Probably you do not need to change this.
-*/
-#define LUAI_USER_ALIGNMENT_T	union { double u; void *s; long l; }
-
-
-/*
-@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
-** CHANGE them if you prefer to use longjmp/setjmp even with C++
-** or if want/don't to use _longjmp/_setjmp instead of regular
-** longjmp/setjmp. By default, Lua handles errors with exceptions when
-** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
-** and with longjmp/setjmp otherwise.
-*/
-#if defined(__cplusplus)
-/* C++ exceptions */
-#define LUAI_THROW(L,c)	throw(c)
-#define LUAI_TRY(L,c,a)	try { a } catch(...) \
-	{ if ((c)->status == 0) (c)->status = -1; }
-#define luai_jmpbuf	int  /* dummy variable */
-
-#elif defined(LUA_USE_ULONGJMP)
-/* in Unix, try _longjmp/_setjmp (more efficient) */
-#define LUAI_THROW(L,c)	_longjmp((c)->b, 1)
-#define LUAI_TRY(L,c,a)	if (_setjmp((c)->b) == 0) { a }
-#define luai_jmpbuf	jmp_buf
-
-#else
-/* default handling with long jumps */
-#define LUAI_THROW(L,c)	longjmp((c)->b, 1)
-#define LUAI_TRY(L,c,a)	if (setjmp((c)->b) == 0) { a }
-#define luai_jmpbuf	jmp_buf
-
-#endif
-
-
-/*
-@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern
-@* can do during pattern-matching.
-** CHANGE it if you need more captures. This limit is arbitrary.
-*/
-#define LUA_MAXCAPTURES		32
-
-
-/*
-@@ lua_tmpnam is the function that the OS library uses to create a
-@* temporary name.
-@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
-** CHANGE them if you have an alternative to tmpnam (which is considered
-** insecure) or if you want the original tmpnam anyway.  By default, Lua
-** uses tmpnam except when POSIX is available, where it uses mkstemp.
-*/
-#if defined(loslib_c) || defined(luaall_c)
-
-#if defined(LUA_USE_MKSTEMP)
-#include <unistd.h>
-#define LUA_TMPNAMBUFSIZE	32
-#define lua_tmpnam(b,e)	{ \
-	strcpy(b, "/tmp/lua_XXXXXX"); \
-	e = mkstemp(b); \
-	if (e != -1) close(e); \
-	e = (e == -1); }
-
-#else
-#define LUA_TMPNAMBUFSIZE	L_tmpnam
-#define lua_tmpnam(b,e)		{ e = (tmpnam(b) == NULL); }
-#endif
-
-#endif
-
-
-/*
-@@ lua_popen spawns a new process connected to the current one through
-@* the file streams.
-** CHANGE it if you have a way to implement it in your system.
-*/
-#if defined(LUA_USE_POPEN)
-
-#define lua_popen(L,c,m)	((void)L, fflush(NULL), popen(c,m))
-#define lua_pclose(L,file)	((void)L, (pclose(file) != -1))
-
-#elif defined(LUA_WIN)
-
-#define lua_popen(L,c,m)	((void)L, _popen(c,m))
-#define lua_pclose(L,file)	((void)L, (_pclose(file) != -1))
-
-#else
-
-#define lua_popen(L,c,m)	((void)((void)c, m),  \
-		luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
-#define lua_pclose(L,file)		((void)((void)L, file), 0)
-
-#endif
-
-/*
-@@ LUA_DL_* define which dynamic-library system Lua should use.
-** CHANGE here if Lua has problems choosing the appropriate
-** dynamic-library system for your platform (either Windows' DLL, Mac's
-** dyld, or Unix's dlopen). If your system is some kind of Unix, there
-** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
-** it.  To use dlopen you also need to adapt the src/Makefile (probably
-** adding -ldl to the linker options), so Lua does not select it
-** automatically.  (When you change the makefile to add -ldl, you must
-** also add -DLUA_USE_DLOPEN.)
-** If you do not want any kind of dynamic library, undefine all these
-** options.
-** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
-*/
-#if defined(LUA_USE_DLOPEN)
-#define LUA_DL_DLOPEN
-#endif
-
-#if defined(LUA_WIN)
-#define LUA_DL_DLL
-#endif
-
-
-/*
-@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
-@* (the data goes just *before* the lua_State pointer).
-** CHANGE (define) this if you really need that. This value must be
-** a multiple of the maximum alignment required for your machine.
-*/
-#define LUAI_EXTRASPACE		0
-
-
-/*
-@@ luai_userstate* allow user-specific actions on threads.
-** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
-** extra when a thread is created/deleted/resumed/yielded.
-*/
-#define luai_userstateopen(L)		((void)L)
-#define luai_userstateclose(L)		((void)L)
-#define luai_userstatethread(L,L1)	((void)L)
-#define luai_userstatefree(L)		((void)L)
-#define luai_userstateresume(L,n)	((void)L)
-#define luai_userstateyield(L,n)	((void)L)
-
-
-/*
-@@ LUA_INTFRMLEN is the length modifier for integer conversions
-@* in 'string.format'.
-@@ LUA_INTFRM_T is the integer type correspoding to the previous length
-@* modifier.
-** CHANGE them if your system supports long long or does not support long.
-*/
-
-#if defined(LUA_USELONGLONG)
-
-#define LUA_INTFRMLEN		"ll"
-#define LUA_INTFRM_T		long long
-
-#else
-
-#define LUA_INTFRMLEN		"l"
-#define LUA_INTFRM_T		long
-
-#endif
-
-
-
-/* =================================================================== */
-
-/*
-** Local configuration. You can use this space to add your redefinitions
-** without modifying the main part of the file.
-*/
-
-
-
-#endif
-
diff --git a/misc/liblua/lualib.h b/misc/liblua/lualib.h
deleted file mode 100644
index e9ff9ba..0000000
--- a/misc/liblua/lualib.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lua standard libraries
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lualib_h
-#define lualib_h
-
-#include "lua.h"
-
-
-/* Key to file-handle type */
-#define LUA_FILEHANDLE		"FILE*"
-
-
-#define LUA_COLIBNAME	"coroutine"
-LUALIB_API int (luaopen_base) (lua_State *L);
-
-#define LUA_TABLIBNAME	"table"
-LUALIB_API int (luaopen_table) (lua_State *L);
-
-#define LUA_IOLIBNAME	"io"
-LUALIB_API int (luaopen_io) (lua_State *L);
-
-#define LUA_OSLIBNAME	"os"
-LUALIB_API int (luaopen_os) (lua_State *L);
-
-#define LUA_STRLIBNAME	"string"
-LUALIB_API int (luaopen_string) (lua_State *L);
-
-#define LUA_MATHLIBNAME	"math"
-LUALIB_API int (luaopen_math) (lua_State *L);
-
-#define LUA_DBLIBNAME	"debug"
-LUALIB_API int (luaopen_debug) (lua_State *L);
-
-#define LUA_LOADLIBNAME	"package"
-LUALIB_API int (luaopen_package) (lua_State *L);
-
-
-/* open all previous libraries */
-LUALIB_API void (luaL_openlibs) (lua_State *L);
-
-
-
-#ifndef lua_assert
-#define lua_assert(x)	((void)0)
-#endif
-
-
-#endif
diff --git a/misc/liblua/lundump.c b/misc/liblua/lundump.c
deleted file mode 100644
index 8010a45..0000000
--- a/misc/liblua/lundump.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
-** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $
-** load precompiled Lua chunks
-** See Copyright Notice in lua.h
-*/
-
-#include <string.h>
-
-#define lundump_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lmem.h"
-#include "lobject.h"
-#include "lstring.h"
-#include "lundump.h"
-#include "lzio.h"
-
-typedef struct {
- lua_State* L;
- ZIO* Z;
- Mbuffer* b;
- const char* name;
-} LoadState;
-
-#ifdef LUAC_TRUST_BINARIES
-#define IF(c,s)
-#define error(S,s)
-#else
-#define IF(c,s)		if (c) error(S,s)
-
-static void error(LoadState* S, const char* why)
-{
- luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why);
- luaD_throw(S->L,LUA_ERRSYNTAX);
-}
-#endif
-
-#define LoadMem(S,b,n,size)	LoadBlock(S,b,(n)*(size))
-#define	LoadByte(S)		(lu_byte)LoadChar(S)
-#define LoadVar(S,x)		LoadMem(S,&x,1,sizeof(x))
-#define LoadVector(S,b,n,size)	LoadMem(S,b,n,size)
-
-static void LoadBlock(LoadState* S, void* b, size_t size)
-{
- size_t r=luaZ_read(S->Z,b,size);
- IF (r!=0, "unexpected end");
-}
-
-static int LoadChar(LoadState* S)
-{
- char x;
- LoadVar(S,x);
- return x;
-}
-
-static int LoadInt(LoadState* S)
-{
- int x;
- LoadVar(S,x);
- IF (x<0, "bad integer");
- return x;
-}
-
-static lua_Number LoadNumber(LoadState* S)
-{
- lua_Number x;
- LoadVar(S,x);
- return x;
-}
-
-static TString* LoadString(LoadState* S)
-{
- size_t size;
- LoadVar(S,size);
- if (size==0)
-  return NULL;
- else
- {
-  char* s=luaZ_openspace(S->L,S->b,size);
-  LoadBlock(S,s,size);
-  return luaS_newlstr(S->L,s,size-1);		/* remove trailing '\0' */
- }
-}
-
-static void LoadCode(LoadState* S, Proto* f)
-{
- int n=LoadInt(S);
- f->code=luaM_newvector(S->L,n,Instruction);
- f->sizecode=n;
- LoadVector(S,f->code,n,sizeof(Instruction));
-}
-
-static Proto* LoadFunction(LoadState* S, TString* p);
-
-static void LoadConstants(LoadState* S, Proto* f)
-{
- int i,n;
- n=LoadInt(S);
- f->k=luaM_newvector(S->L,n,TValue);
- f->sizek=n;
- for (i=0; i<n; i++) setnilvalue(&f->k[i]);
- for (i=0; i<n; i++)
- {
-  TValue* o=&f->k[i];
-  int t=LoadChar(S);
-  switch (t)
-  {
-   case LUA_TNIL:
-   	setnilvalue(o);
-	break;
-   case LUA_TBOOLEAN:
-   	setbvalue(o,LoadChar(S)!=0);
-	break;
-   case LUA_TNUMBER:
-	setnvalue(o,LoadNumber(S));
-	break;
-   case LUA_TSTRING:
-	setsvalue2n(S->L,o,LoadString(S));
-	break;
-   default:
-	error(S,"bad constant");
-	break;
-  }
- }
- n=LoadInt(S);
- f->p=luaM_newvector(S->L,n,Proto*);
- f->sizep=n;
- for (i=0; i<n; i++) f->p[i]=NULL;
- for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source);
-}
-
-static void LoadDebug(LoadState* S, Proto* f)
-{
- int i,n;
- n=LoadInt(S);
- f->lineinfo=luaM_newvector(S->L,n,int);
- f->sizelineinfo=n;
- LoadVector(S,f->lineinfo,n,sizeof(int));
- n=LoadInt(S);
- f->locvars=luaM_newvector(S->L,n,LocVar);
- f->sizelocvars=n;
- for (i=0; i<n; i++) f->locvars[i].varname=NULL;
- for (i=0; i<n; i++)
- {
-  f->locvars[i].varname=LoadString(S);
-  f->locvars[i].startpc=LoadInt(S);
-  f->locvars[i].endpc=LoadInt(S);
- }
- n=LoadInt(S);
- f->upvalues=luaM_newvector(S->L,n,TString*);
- f->sizeupvalues=n;
- for (i=0; i<n; i++) f->upvalues[i]=NULL;
- for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
-}
-
-static Proto* LoadFunction(LoadState* S, TString* p)
-{
- Proto* f;
- if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
- f=luaF_newproto(S->L);
- setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
- f->source=LoadString(S); if (f->source==NULL) f->source=p;
- f->linedefined=LoadInt(S);
- f->lastlinedefined=LoadInt(S);
- f->nups=LoadByte(S);
- f->numparams=LoadByte(S);
- f->is_vararg=LoadByte(S);
- f->maxstacksize=LoadByte(S);
- LoadCode(S,f);
- LoadConstants(S,f);
- LoadDebug(S,f);
- IF (!luaG_checkcode(f), "bad code");
- S->L->top--;
- S->L->nCcalls--;
- return f;
-}
-
-static void LoadHeader(LoadState* S)
-{
- char h[LUAC_HEADERSIZE];
- char s[LUAC_HEADERSIZE];
- luaU_header(h);
- LoadBlock(S,s,LUAC_HEADERSIZE);
- IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
-}
-
-/*
-** load precompiled chunk
-*/
-Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)
-{
- LoadState S;
- if (*name=='@' || *name=='=')
-  S.name=name+1;
- else if (*name==LUA_SIGNATURE[0])
-  S.name="binary string";
- else
-  S.name=name;
- S.L=L;
- S.Z=Z;
- S.b=buff;
- LoadHeader(&S);
- return LoadFunction(&S,luaS_newliteral(L,"=?"));
-}
-
-/*
-* make header
-*/
-void luaU_header (char* h)
-{
- int x=1;
- memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);
- h+=sizeof(LUA_SIGNATURE)-1;
- *h++=(char)LUAC_VERSION;
- *h++=(char)LUAC_FORMAT;
- *h++=(char)*(char*)&x;				/* endianness */
- *h++=(char)sizeof(int);
- *h++=(char)sizeof(size_t);
- *h++=(char)sizeof(Instruction);
- *h++=(char)sizeof(lua_Number);
- *h++=(char)(((lua_Number)0.5)==0);		/* is lua_Number integral? */
-}
diff --git a/misc/liblua/lundump.h b/misc/liblua/lundump.h
deleted file mode 100644
index c80189d..0000000
--- a/misc/liblua/lundump.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
-** load precompiled Lua chunks
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lundump_h
-#define lundump_h
-
-#include "lobject.h"
-#include "lzio.h"
-
-/* load one chunk; from lundump.c */
-LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
-
-/* make header; from lundump.c */
-LUAI_FUNC void luaU_header (char* h);
-
-/* dump one chunk; from ldump.c */
-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
-
-#ifdef luac_c
-/* print one chunk; from print.c */
-LUAI_FUNC void luaU_print (const Proto* f, int full);
-#endif
-
-/* for header of binary files -- this is Lua 5.1 */
-#define LUAC_VERSION		0x51
-
-/* for header of binary files -- this is the official format */
-#define LUAC_FORMAT		0
-
-/* size of header of binary files */
-#define LUAC_HEADERSIZE		12
-
-#endif
diff --git a/misc/liblua/lvm.c b/misc/liblua/lvm.c
deleted file mode 100644
index c7c0e57..0000000
--- a/misc/liblua/lvm.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
-** Lua virtual machine
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define lvm_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "ldebug.h"
-#include "ldo.h"
-#include "lfunc.h"
-#include "lgc.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lstate.h"
-#include "lstring.h"
-#include "ltable.h"
-#include "ltm.h"
-#include "lvm.h"
-
-
-
-/* limit for table tag-method chains (to avoid loops) */
-#define MAXTAGLOOP	100
-
-
-const TValue *luaV_tonumber (const TValue *obj, TValue *n) {
-  lua_Number num;
-  if (ttisnumber(obj)) return obj;
-  if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) {
-    setnvalue(n, num);
-    return n;
-  }
-  else
-    return NULL;
-}
-
-
-int luaV_tostring (lua_State *L, StkId obj) {
-  if (!ttisnumber(obj))
-    return 0;
-  else {
-    char s[LUAI_MAXNUMBER2STR];
-    lua_Number n = nvalue(obj);
-    lua_number2str(s, n);
-    setsvalue2s(L, obj, luaS_new(L, s));
-    return 1;
-  }
-}
-
-
-static void traceexec (lua_State *L, const Instruction *pc) {
-  lu_byte mask = L->hookmask;
-  const Instruction *oldpc = L->savedpc;
-  L->savedpc = pc;
-  if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) {
-    resethookcount(L);
-    luaD_callhook(L, LUA_HOOKCOUNT, -1);
-  }
-  if (mask & LUA_MASKLINE) {
-    Proto *p = ci_func(L->ci)->l.p;
-    int npc = pcRel(pc, p);
-    int newline = getline(p, npc);
-    /* call linehook when enter a new function, when jump back (loop),
-       or when enter a new line */
-    if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p)))
-      luaD_callhook(L, LUA_HOOKLINE, newline);
-  }
-}
-
-
-static void callTMres (lua_State *L, StkId res, const TValue *f,
-                        const TValue *p1, const TValue *p2) {
-  ptrdiff_t result = savestack(L, res);
-  setobj2s(L, L->top, f);  /* push function */
-  setobj2s(L, L->top+1, p1);  /* 1st argument */
-  setobj2s(L, L->top+2, p2);  /* 2nd argument */
-  luaD_checkstack(L, 3);
-  L->top += 3;
-  luaD_call(L, L->top - 3, 1);
-  res = restorestack(L, result);
-  L->top--;
-  setobjs2s(L, res, L->top);
-}
-
-
-
-static void callTM (lua_State *L, const TValue *f, const TValue *p1,
-                    const TValue *p2, const TValue *p3) {
-  setobj2s(L, L->top, f);  /* push function */
-  setobj2s(L, L->top+1, p1);  /* 1st argument */
-  setobj2s(L, L->top+2, p2);  /* 2nd argument */
-  setobj2s(L, L->top+3, p3);  /* 3th argument */
-  luaD_checkstack(L, 4);
-  L->top += 4;
-  luaD_call(L, L->top - 4, 0);
-}
-
-
-void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
-  int loop;
-  for (loop = 0; loop < MAXTAGLOOP; loop++) {
-    const TValue *tm;
-    if (ttistable(t)) {  /* `t' is a table? */
-      Table *h = hvalue(t);
-      const TValue *res = luaH_get(h, key); /* do a primitive get */
-      if (!ttisnil(res) ||  /* result is no nil? */
-          (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */
-        setobj2s(L, val, res);
-        return;
-      }
-      /* else will try the tag method */
-    }
-    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))
-      luaG_typeerror(L, t, "index");
-    if (ttisfunction(tm)) {
-      callTMres(L, val, tm, t, key);
-      return;
-    }
-    t = tm;  /* else repeat with `tm' */
-  }
-  luaG_runerror(L, "loop in gettable");
-}
-
-
-void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
-  int loop;
-  for (loop = 0; loop < MAXTAGLOOP; loop++) {
-    const TValue *tm;
-    if (ttistable(t)) {  /* `t' is a table? */
-      Table *h = hvalue(t);
-      TValue *oldval = luaH_set(L, h, key); /* do a primitive set */
-      if (!ttisnil(oldval) ||  /* result is no nil? */
-          (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
-        setobj2t(L, oldval, val);
-        luaC_barriert(L, h, val);
-        return;
-      }
-      /* else will try the tag method */
-    }
-    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))
-      luaG_typeerror(L, t, "index");
-    if (ttisfunction(tm)) {
-      callTM(L, tm, t, key, val);
-      return;
-    }
-    t = tm;  /* else repeat with `tm' */
-  }
-  luaG_runerror(L, "loop in settable");
-}
-
-
-static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2,
-                       StkId res, TMS event) {
-  const TValue *tm = luaT_gettmbyobj(L, p1, event);  /* try first operand */
-  if (ttisnil(tm))
-    tm = luaT_gettmbyobj(L, p2, event);  /* try second operand */
-  if (ttisnil(tm)) return 0;
-  callTMres(L, res, tm, p1, p2);
-  return 1;
-}
-
-
-static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2,
-                                  TMS event) {
-  const TValue *tm1 = fasttm(L, mt1, event);
-  const TValue *tm2;
-  if (tm1 == NULL) return NULL;  /* no metamethod */
-  if (mt1 == mt2) return tm1;  /* same metatables => same metamethods */
-  tm2 = fasttm(L, mt2, event);
-  if (tm2 == NULL) return NULL;  /* no metamethod */
-  if (luaO_rawequalObj(tm1, tm2))  /* same metamethods? */
-    return tm1;
-  return NULL;
-}
-
-
-static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2,
-                         TMS event) {
-  const TValue *tm1 = luaT_gettmbyobj(L, p1, event);
-  const TValue *tm2;
-  if (ttisnil(tm1)) return -1;  /* no metamethod? */
-  tm2 = luaT_gettmbyobj(L, p2, event);
-  if (!luaO_rawequalObj(tm1, tm2))  /* different metamethods? */
-    return -1;
-  callTMres(L, L->top, tm1, p1, p2);
-  return !l_isfalse(L->top);
-}
-
-
-static int l_strcmp (const TString *ls, const TString *rs) {
-  const char *l = getstr(ls);
-  size_t ll = ls->tsv.len;
-  const char *r = getstr(rs);
-  size_t lr = rs->tsv.len;
-  for (;;) {
-    int temp = strcoll(l, r);
-    if (temp != 0) return temp;
-    else {  /* strings are equal up to a `\0' */
-      size_t len = strlen(l);  /* index of first `\0' in both strings */
-      if (len == lr)  /* r is finished? */
-        return (len == ll) ? 0 : 1;
-      else if (len == ll)  /* l is finished? */
-        return -1;  /* l is smaller than r (because r is not finished) */
-      /* both strings longer than `len'; go on comparing (after the `\0') */
-      len++;
-      l += len; ll -= len; r += len; lr -= len;
-    }
-  }
-}
-
-
-int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {
-  int res;
-  if (ttype(l) != ttype(r))
-    return luaG_ordererror(L, l, r);
-  else if (ttisnumber(l))
-    return luai_numlt(nvalue(l), nvalue(r));
-  else if (ttisstring(l))
-    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0;
-  else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)
-    return res;
-  return luaG_ordererror(L, l, r);
-}
-
-
-static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
-  int res;
-  if (ttype(l) != ttype(r))
-    return luaG_ordererror(L, l, r);
-  else if (ttisnumber(l))
-    return luai_numle(nvalue(l), nvalue(r));
-  else if (ttisstring(l))
-    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
-  else if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */
-    return res;
-  else if ((res = call_orderTM(L, r, l, TM_LT)) != -1)  /* else try `lt' */
-    return !res;
-  return luaG_ordererror(L, l, r);
-}
-
-
-int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {
-  const TValue *tm;
-  lua_assert(ttype(t1) == ttype(t2));
-  switch (ttype(t1)) {
-    case LUA_TNIL: return 1;
-    case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));
-    case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2);  /* true must be 1 !! */
-    case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);
-    case LUA_TUSERDATA: {
-      if (uvalue(t1) == uvalue(t2)) return 1;
-      tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable,
-                         TM_EQ);
-      break;  /* will try TM */
-    }
-    case LUA_TTABLE: {
-      if (hvalue(t1) == hvalue(t2)) return 1;
-      tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ);
-      break;  /* will try TM */
-    }
-    default: return gcvalue(t1) == gcvalue(t2);
-  }
-  if (tm == NULL) return 0;  /* no TM? */
-  callTMres(L, L->top, tm, t1, t2);  /* call TM */
-  return !l_isfalse(L->top);
-}
-
-
-void luaV_concat (lua_State *L, int total, int last) {
-  do {
-    StkId top = L->base + last + 1;
-    int n = 2;  /* number of elements handled in this pass (at least 2) */
-    if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {
-      if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))
-        luaG_concaterror(L, top-2, top-1);
-    } else if (tsvalue(top-1)->len == 0)  /* second op is empty? */
-      (void)tostring(L, top - 2);  /* result is first op (as string) */
-    else {
-      /* at least two string values; get as many as possible */
-      size_t tl = tsvalue(top-1)->len;
-      char *buffer;
-      int i;
-      /* collect total length */
-      for (n = 1; n < total && tostring(L, top-n-1); n++) {
-        size_t l = tsvalue(top-n-1)->len;
-        if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow");
-        tl += l;
-      }
-      buffer = luaZ_openspace(L, &G(L)->buff, tl);
-      tl = 0;
-      for (i=n; i>0; i--) {  /* concat all strings */
-        size_t l = tsvalue(top-i)->len;
-        memcpy(buffer+tl, svalue(top-i), l);
-        tl += l;
-      }
-      setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl));
-    }
-    total -= n-1;  /* got `n' strings to create 1 new */
-    last -= n-1;
-  } while (total > 1);  /* repeat until only 1 result left */
-}
-
-
-static void Arith (lua_State *L, StkId ra, const TValue *rb,
-                   const TValue *rc, TMS op) {
-  TValue tempb, tempc;
-  const TValue *b, *c;
-  if ((b = luaV_tonumber(rb, &tempb)) != NULL &&
-      (c = luaV_tonumber(rc, &tempc)) != NULL) {
-    lua_Number nb = nvalue(b), nc = nvalue(c);
-    switch (op) {
-      case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;
-      case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;
-      case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;
-      case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break;
-      case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;
-      case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;
-      case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;
-      default: lua_assert(0); break;
-    }
-  }
-  else if (!call_binTM(L, rb, rc, ra, op))
-    luaG_aritherror(L, rb, rc);
-}
-
-
-
-/*
-** some macros for common tasks in `luaV_execute'
-*/
-
-#define runtime_check(L, c)	{ if (!(c)) break; }
-
-#define RA(i)	(base+GETARG_A(i))
-/* to be used after possible stack reallocation */
-#define RB(i)	check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))
-#define RC(i)	check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))
-#define RKB(i)	check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \
-	ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))
-#define RKC(i)	check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \
-	ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))
-#define KBx(i)	check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))
-
-
-#define dojump(L,pc,i)	{(pc) += (i); luai_threadyield(L);}
-
-
-#define Protect(x)	{ L->savedpc = pc; {x;}; base = L->base; }
-
-
-#define arith_op(op,tm) { \
-        TValue *rb = RKB(i); \
-        TValue *rc = RKC(i); \
-        if (ttisnumber(rb) && ttisnumber(rc)) { \
-          lua_Number nb = nvalue(rb), nc = nvalue(rc); \
-          setnvalue(ra, op(nb, nc)); \
-        } \
-        else \
-          Protect(Arith(L, ra, rb, rc, tm)); \
-      }
-
-
-
-void luaV_execute (lua_State *L, int nexeccalls) {
-  LClosure *cl;
-  StkId base;
-  TValue *k;
-  const Instruction *pc;
- reentry:  /* entry point */
-  lua_assert(isLua(L->ci));
-  pc = L->savedpc;
-  cl = &clvalue(L->ci->func)->l;
-  base = L->base;
-  k = cl->p->k;
-  /* main loop of interpreter */
-  for (;;) {
-    const Instruction i = *pc++;
-    StkId ra;
-    if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) &&
-        (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {
-      traceexec(L, pc);
-      if (L->status == LUA_YIELD) {  /* did hook yield? */
-        L->savedpc = pc - 1;
-        return;
-      }
-      base = L->base;
-    }
-    /* warning!! several calls may realloc the stack and invalidate `ra' */
-    ra = RA(i);
-    lua_assert(base == L->base && L->base == L->ci->base);
-    lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
-    lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
-    switch (GET_OPCODE(i)) {
-      case OP_MOVE: {
-        setobjs2s(L, ra, RB(i));
-        continue;
-      }
-      case OP_LOADK: {
-        setobj2s(L, ra, KBx(i));
-        continue;
-      }
-      case OP_LOADBOOL: {
-        setbvalue(ra, GETARG_B(i));
-        if (GETARG_C(i)) pc++;  /* skip next instruction (if C) */
-        continue;
-      }
-      case OP_LOADNIL: {
-        TValue *rb = RB(i);
-        do {
-          setnilvalue(rb--);
-        } while (rb >= ra);
-        continue;
-      }
-      case OP_GETUPVAL: {
-        int b = GETARG_B(i);
-        setobj2s(L, ra, cl->upvals[b]->v);
-        continue;
-      }
-      case OP_GETGLOBAL: {
-        TValue g;
-        TValue *rb = KBx(i);
-        sethvalue(L, &g, cl->env);
-        lua_assert(ttisstring(rb));
-        Protect(luaV_gettable(L, &g, rb, ra));
-        continue;
-      }
-      case OP_GETTABLE: {
-        Protect(luaV_gettable(L, RB(i), RKC(i), ra));
-        continue;
-      }
-      case OP_SETGLOBAL: {
-        TValue g;
-        sethvalue(L, &g, cl->env);
-        lua_assert(ttisstring(KBx(i)));
-        Protect(luaV_settable(L, &g, KBx(i), ra));
-        continue;
-      }
-      case OP_SETUPVAL: {
-        UpVal *uv = cl->upvals[GETARG_B(i)];
-        setobj(L, uv->v, ra);
-        luaC_barrier(L, uv, ra);
-        continue;
-      }
-      case OP_SETTABLE: {
-        Protect(luaV_settable(L, ra, RKB(i), RKC(i)));
-        continue;
-      }
-      case OP_NEWTABLE: {
-        int b = GETARG_B(i);
-        int c = GETARG_C(i);
-        sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));
-        Protect(luaC_checkGC(L));
-        continue;
-      }
-      case OP_SELF: {
-        StkId rb = RB(i);
-        setobjs2s(L, ra+1, rb);
-        Protect(luaV_gettable(L, rb, RKC(i), ra));
-        continue;
-      }
-      case OP_ADD: {
-        arith_op(luai_numadd, TM_ADD);
-        continue;
-      }
-      case OP_SUB: {
-        arith_op(luai_numsub, TM_SUB);
-        continue;
-      }
-      case OP_MUL: {
-        arith_op(luai_nummul, TM_MUL);
-        continue;
-      }
-      case OP_DIV: {
-        arith_op(luai_numdiv, TM_DIV);
-        continue;
-      }
-      case OP_MOD: {
-        arith_op(luai_nummod, TM_MOD);
-        continue;
-      }
-      case OP_POW: {
-        arith_op(luai_numpow, TM_POW);
-        continue;
-      }
-      case OP_UNM: {
-        TValue *rb = RB(i);
-        if (ttisnumber(rb)) {
-          lua_Number nb = nvalue(rb);
-          setnvalue(ra, luai_numunm(nb));
-        }
-        else {
-          Protect(Arith(L, ra, rb, rb, TM_UNM));
-        }
-        continue;
-      }
-      case OP_NOT: {
-        int res = l_isfalse(RB(i));  /* next assignment may change this value */
-        setbvalue(ra, res);
-        continue;
-      }
-      case OP_LEN: {
-        const TValue *rb = RB(i);
-        switch (ttype(rb)) {
-          case LUA_TTABLE: {
-            setnvalue(ra, cast_num(luaH_getn(hvalue(rb))));
-            break;
-          }
-          case LUA_TSTRING: {
-            setnvalue(ra, cast_num(tsvalue(rb)->len));
-            break;
-          }
-          default: {  /* try metamethod */
-            Protect(
-              if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
-                luaG_typeerror(L, rb, "get length of");
-            )
-          }
-        }
-        continue;
-      }
-      case OP_CONCAT: {
-        int b = GETARG_B(i);
-        int c = GETARG_C(i);
-        Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L));
-        setobjs2s(L, RA(i), base+b);
-        continue;
-      }
-      case OP_JMP: {
-        dojump(L, pc, GETARG_sBx(i));
-        continue;
-      }
-      case OP_EQ: {
-        TValue *rb = RKB(i);
-        TValue *rc = RKC(i);
-        Protect(
-          if (equalobj(L, rb, rc) == GETARG_A(i))
-            dojump(L, pc, GETARG_sBx(*pc));
-        )
-        pc++;
-        continue;
-      }
-      case OP_LT: {
-        Protect(
-          if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
-            dojump(L, pc, GETARG_sBx(*pc));
-        )
-        pc++;
-        continue;
-      }
-      case OP_LE: {
-        Protect(
-          if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
-            dojump(L, pc, GETARG_sBx(*pc));
-        )
-        pc++;
-        continue;
-      }
-      case OP_TEST: {
-        if (l_isfalse(ra) != GETARG_C(i))
-          dojump(L, pc, GETARG_sBx(*pc));
-        pc++;
-        continue;
-      }
-      case OP_TESTSET: {
-        TValue *rb = RB(i);
-        if (l_isfalse(rb) != GETARG_C(i)) {
-          setobjs2s(L, ra, rb);
-          dojump(L, pc, GETARG_sBx(*pc));
-        }
-        pc++;
-        continue;
-      }
-      case OP_CALL: {
-        int b = GETARG_B(i);
-        int nresults = GETARG_C(i) - 1;
-        if (b != 0) L->top = ra+b;  /* else previous instruction set top */
-        L->savedpc = pc;
-        switch (luaD_precall(L, ra, nresults)) {
-          case PCRLUA: {
-            nexeccalls++;
-            goto reentry;  /* restart luaV_execute over new Lua function */
-          }
-          case PCRC: {
-            /* it was a C function (`precall' called it); adjust results */
-            if (nresults >= 0) L->top = L->ci->top;
-            base = L->base;
-            continue;
-          }
-          default: {
-            return;  /* yield */
-          }
-        }
-      }
-      case OP_TAILCALL: {
-        int b = GETARG_B(i);
-        if (b != 0) L->top = ra+b;  /* else previous instruction set top */
-        L->savedpc = pc;
-        lua_assert(GETARG_C(i) - 1 == LUA_MULTRET);
-        switch (luaD_precall(L, ra, LUA_MULTRET)) {
-          case PCRLUA: {
-            /* tail call: put new frame in place of previous one */
-            CallInfo *ci = L->ci - 1;  /* previous frame */
-            int aux;
-            StkId func = ci->func;
-            StkId pfunc = (ci+1)->func;  /* previous function index */
-            if (L->openupval) luaF_close(L, ci->base);
-            L->base = ci->base = ci->func + ((ci+1)->base - pfunc);
-            for (aux = 0; pfunc+aux < L->top; aux++)  /* move frame down */
-              setobjs2s(L, func+aux, pfunc+aux);
-            ci->top = L->top = func+aux;  /* correct top */
-            lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize);
-            ci->savedpc = L->savedpc;
-            ci->tailcalls++;  /* one more call lost */
-            L->ci--;  /* remove new frame */
-            goto reentry;
-          }
-          case PCRC: {  /* it was a C function (`precall' called it) */
-            base = L->base;
-            continue;
-          }
-          default: {
-            return;  /* yield */
-          }
-        }
-      }
-      case OP_RETURN: {
-        int b = GETARG_B(i);
-        if (b != 0) L->top = ra+b-1;
-        if (L->openupval) luaF_close(L, base);
-        L->savedpc = pc;
-        b = luaD_poscall(L, ra);
-        if (--nexeccalls == 0)  /* was previous function running `here'? */
-          return;  /* no: return */
-        else {  /* yes: continue its execution */
-          if (b) L->top = L->ci->top;
-          lua_assert(isLua(L->ci));
-          lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL);
-          goto reentry;
-        }
-      }
-      case OP_FORLOOP: {
-        lua_Number step = nvalue(ra+2);
-        lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */
-        lua_Number limit = nvalue(ra+1);
-        if (luai_numlt(0, step) ? luai_numle(idx, limit)
-                                : luai_numle(limit, idx)) {
-          dojump(L, pc, GETARG_sBx(i));  /* jump back */
-          setnvalue(ra, idx);  /* update internal index... */
-          setnvalue(ra+3, idx);  /* ...and external index */
-        }
-        continue;
-      }
-      case OP_FORPREP: {
-        const TValue *init = ra;
-        const TValue *plimit = ra+1;
-        const TValue *pstep = ra+2;
-        L->savedpc = pc;  /* next steps may throw errors */
-        if (!tonumber(init, ra))
-          luaG_runerror(L, LUA_QL("for") " initial value must be a number");
-        else if (!tonumber(plimit, ra+1))
-          luaG_runerror(L, LUA_QL("for") " limit must be a number");
-        else if (!tonumber(pstep, ra+2))
-          luaG_runerror(L, LUA_QL("for") " step must be a number");
-        setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));
-        dojump(L, pc, GETARG_sBx(i));
-        continue;
-      }
-      case OP_TFORLOOP: {
-        StkId cb = ra + 3;  /* call base */
-        setobjs2s(L, cb+2, ra+2);
-        setobjs2s(L, cb+1, ra+1);
-        setobjs2s(L, cb, ra);
-        L->top = cb+3;  /* func. + 2 args (state and index) */
-        Protect(luaD_call(L, cb, GETARG_C(i)));
-        L->top = L->ci->top;
-        cb = RA(i) + 3;  /* previous call may change the stack */
-        if (!ttisnil(cb)) {  /* continue loop? */
-          setobjs2s(L, cb-1, cb);  /* save control variable */
-          dojump(L, pc, GETARG_sBx(*pc));  /* jump back */
-        }
-        pc++;
-        continue;
-      }
-      case OP_SETLIST: {
-        int n = GETARG_B(i);
-        int c = GETARG_C(i);
-        int last;
-        Table *h;
-        if (n == 0) {
-          n = cast_int(L->top - ra) - 1;
-          L->top = L->ci->top;
-        }
-        if (c == 0) c = cast_int(*pc++);
-        runtime_check(L, ttistable(ra));
-        h = hvalue(ra);
-        last = ((c-1)*LFIELDS_PER_FLUSH) + n;
-        if (last > h->sizearray)  /* needs more space? */
-          luaH_resizearray(L, h, last);  /* pre-alloc it at once */
-        for (; n > 0; n--) {
-          TValue *val = ra+n;
-          setobj2t(L, luaH_setnum(L, h, last--), val);
-          luaC_barriert(L, h, val);
-        }
-        continue;
-      }
-      case OP_CLOSE: {
-        luaF_close(L, ra);
-        continue;
-      }
-      case OP_CLOSURE: {
-        Proto *p;
-        Closure *ncl;
-        int nup, j;
-        p = cl->p->p[GETARG_Bx(i)];
-        nup = p->nups;
-        ncl = luaF_newLclosure(L, nup, cl->env);
-        ncl->l.p = p;
-        for (j=0; j<nup; j++, pc++) {
-          if (GET_OPCODE(*pc) == OP_GETUPVAL)
-            ncl->l.upvals[j] = cl->upvals[GETARG_B(*pc)];
-          else {
-            lua_assert(GET_OPCODE(*pc) == OP_MOVE);
-            ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc));
-          }
-        }
-        setclvalue(L, ra, ncl);
-        Protect(luaC_checkGC(L));
-        continue;
-      }
-      case OP_VARARG: {
-        int b = GETARG_B(i) - 1;
-        int j;
-        CallInfo *ci = L->ci;
-        int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1;
-        if (b == LUA_MULTRET) {
-          Protect(luaD_checkstack(L, n));
-          ra = RA(i);  /* previous call may change the stack */
-          b = n;
-          L->top = ra + n;
-        }
-        for (j = 0; j < b; j++) {
-          if (j < n) {
-            setobjs2s(L, ra + j, ci->base - n + j);
-          }
-          else {
-            setnilvalue(ra + j);
-          }
-        }
-        continue;
-      }
-    }
-  }
-}
-
diff --git a/misc/liblua/lvm.h b/misc/liblua/lvm.h
deleted file mode 100644
index bfe4f56..0000000
--- a/misc/liblua/lvm.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
-** Lua virtual machine
-** See Copyright Notice in lua.h
-*/
-
-#ifndef lvm_h
-#define lvm_h
-
-
-#include "ldo.h"
-#include "lobject.h"
-#include "ltm.h"
-
-
-#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
-
-#define tonumber(o,n)	(ttype(o) == LUA_TNUMBER || \
-                         (((o) = luaV_tonumber(o,n)) != NULL))
-
-#define equalobj(L,o1,o2) \
-	(ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
-
-
-LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
-LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
-LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
-LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
-LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
-                                            StkId val);
-LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
-                                            StkId val);
-LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
-LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
-
-#endif
diff --git a/misc/liblua/lzio.c b/misc/liblua/lzio.c
deleted file mode 100644
index 293edd5..0000000
--- a/misc/liblua/lzio.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
-** a generic input stream interface
-** See Copyright Notice in lua.h
-*/
-
-
-#include <string.h>
-
-#define lzio_c
-#define LUA_CORE
-
-#include "lua.h"
-
-#include "llimits.h"
-#include "lmem.h"
-#include "lstate.h"
-#include "lzio.h"
-
-
-int luaZ_fill (ZIO *z) {
-  size_t size;
-  lua_State *L = z->L;
-  const char *buff;
-  lua_unlock(L);
-  buff = z->reader(L, z->data, &size);
-  lua_lock(L);
-  if (buff == NULL || size == 0) return EOZ;
-  z->n = size - 1;
-  z->p = buff;
-  return char2int(*(z->p++));
-}
-
-
-int luaZ_lookahead (ZIO *z) {
-  if (z->n == 0) {
-    if (luaZ_fill(z) == EOZ)
-      return EOZ;
-    else {
-      z->n++;  /* luaZ_fill removed first byte; put back it */
-      z->p--;
-    }
-  }
-  return char2int(*z->p);
-}
-
-
-void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
-  z->L = L;
-  z->reader = reader;
-  z->data = data;
-  z->n = 0;
-  z->p = NULL;
-}
-
-
-/* --------------------------------------------------------------- read --- */
-size_t luaZ_read (ZIO *z, void *b, size_t n) {
-  while (n) {
-    size_t m;
-    if (luaZ_lookahead(z) == EOZ)
-      return n;  /* return number of missing bytes */
-    m = (n <= z->n) ? n : z->n;  /* min. between n and z->n */
-    memcpy(b, z->p, m);
-    z->n -= m;
-    z->p += m;
-    b = (char *)b + m;
-    n -= m;
-  }
-  return 0;
-}
-
-/* ------------------------------------------------------------------------ */
-char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
-  if (n > buff->buffsize) {
-    if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
-    luaZ_resizebuffer(L, buff, n);
-  }
-  return buff->buffer;
-}
-
-
diff --git a/misc/liblua/lzio.h b/misc/liblua/lzio.h
deleted file mode 100644
index 51d695d..0000000
--- a/misc/liblua/lzio.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
-** Buffered streams
-** See Copyright Notice in lua.h
-*/
-
-
-#ifndef lzio_h
-#define lzio_h
-
-#include "lua.h"
-
-#include "lmem.h"
-
-
-#define EOZ	(-1)			/* end of stream */
-
-typedef struct Zio ZIO;
-
-#define char2int(c)	cast(int, cast(unsigned char, (c)))
-
-#define zgetc(z)  (((z)->n--)>0 ?  char2int(*(z)->p++) : luaZ_fill(z))
-
-typedef struct Mbuffer {
-  char *buffer;
-  size_t n;
-  size_t buffsize;
-} Mbuffer;
-
-#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
-
-#define luaZ_buffer(buff)	((buff)->buffer)
-#define luaZ_sizebuffer(buff)	((buff)->buffsize)
-#define luaZ_bufflen(buff)	((buff)->n)
-
-#define luaZ_resetbuffer(buff) ((buff)->n = 0)
-
-
-#define luaZ_resizebuffer(L, buff, size) \
-	(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
-	(buff)->buffsize = size)
-
-#define luaZ_freebuffer(L, buff)	luaZ_resizebuffer(L, buff, 0)
-
-
-LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
-LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
-                                        void *data);
-LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n);	/* read next n bytes */
-LUAI_FUNC int luaZ_lookahead (ZIO *z);
-
-
-
-/* --------- Private Part ------------------ */
-
-struct Zio {
-  size_t n;			/* bytes still unread */
-  const char *p;		/* current position in buffer */
-  lua_Reader reader;
-  void* data;			/* additional data */
-  lua_State *L;			/* Lua state (for reader) */
-};
-
-
-LUAI_FUNC int luaZ_fill (ZIO *z);
-
-#endif
diff --git a/misc/liblua/print.c b/misc/liblua/print.c
deleted file mode 100644
index e240cfc..0000000
--- a/misc/liblua/print.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
-** $Id: print.c,v 1.55a 2006/05/31 13:30:05 lhf Exp $
-** print bytecodes
-** See Copyright Notice in lua.h
-*/
-
-#include <ctype.h>
-#include <stdio.h>
-
-#define luac_c
-#define LUA_CORE
-
-#include "ldebug.h"
-#include "lobject.h"
-#include "lopcodes.h"
-#include "lundump.h"
-
-#define PrintFunction	luaU_print
-
-#define Sizeof(x)	((int)sizeof(x))
-#define VOID(p)		((const void*)(p))
-
-static void PrintString(const TString* ts)
-{
- const char* s=getstr(ts);
- size_t i,n=ts->tsv.len;
- putchar('"');
- for (i=0; i<n; i++)
- {
-  int c=s[i];
-  switch (c)
-  {
-   case '"': printf("\\\""); break;
-   case '\\': printf("\\\\"); break;
-   case '\a': printf("\\a"); break;
-   case '\b': printf("\\b"); break;
-   case '\f': printf("\\f"); break;
-   case '\n': printf("\\n"); break;
-   case '\r': printf("\\r"); break;
-   case '\t': printf("\\t"); break;
-   case '\v': printf("\\v"); break;
-   default:	if (isprint((unsigned char)c))
-   			putchar(c);
-		else
-			printf("\\%03u",(unsigned char)c);
-  }
- }
- putchar('"');
-}
-
-static void PrintConstant(const Proto* f, int i)
-{
- const TValue* o=&f->k[i];
- switch (ttype(o))
- {
-  case LUA_TNIL:
-	printf("nil");
-	break;
-  case LUA_TBOOLEAN:
-	printf(bvalue(o) ? "true" : "false");
-	break;
-  case LUA_TNUMBER:
-	printf(LUA_NUMBER_FMT,nvalue(o));
-	break;
-  case LUA_TSTRING:
-	PrintString(rawtsvalue(o));
-	break;
-  default:				/* cannot happen */
-	printf("? type=%d",ttype(o));
-	break;
- }
-}
-
-static void PrintCode(const Proto* f)
-{
- const Instruction* code=f->code;
- int pc,n=f->sizecode;
- for (pc=0; pc<n; pc++)
- {
-  Instruction i=code[pc];
-  OpCode o=GET_OPCODE(i);
-  int a=GETARG_A(i);
-  int b=GETARG_B(i);
-  int c=GETARG_C(i);
-  int bx=GETARG_Bx(i);
-  int sbx=GETARG_sBx(i);
-  int line=getline(f,pc);
-  printf("\t%d\t",pc+1);
-  if (line>0) printf("[%d]\t",line); else printf("[-]\t");
-  printf("%-9s\t",luaP_opnames[o]);
-  switch (getOpMode(o))
-  {
-   case iABC:
-    printf("%d",a);
-    if (getBMode(o)!=OpArgN) printf(" %d",ISK(b) ? (-1-INDEXK(b)) : b);
-    if (getCMode(o)!=OpArgN) printf(" %d",ISK(c) ? (-1-INDEXK(c)) : c);
-    break;
-   case iABx:
-    if (getBMode(o)==OpArgK) printf("%d %d",a,-1-bx); else printf("%d %d",a,bx);
-    break;
-   case iAsBx:
-    if (o==OP_JMP) printf("%d",sbx); else printf("%d %d",a,sbx);
-    break;
-  }
-  switch (o)
-  {
-   case OP_LOADK:
-    printf("\t; "); PrintConstant(f,bx);
-    break;
-   case OP_GETUPVAL:
-   case OP_SETUPVAL:
-    printf("\t; %s", (f->sizeupvalues>0) ? getstr(f->upvalues[b]) : "-");
-    break;
-   case OP_GETGLOBAL:
-   case OP_SETGLOBAL:
-    printf("\t; %s",svalue(&f->k[bx]));
-    break;
-   case OP_GETTABLE:
-   case OP_SELF:
-    if (ISK(c)) { printf("\t; "); PrintConstant(f,INDEXK(c)); }
-    break;
-   case OP_SETTABLE:
-   case OP_ADD:
-   case OP_SUB:
-   case OP_MUL:
-   case OP_DIV:
-   case OP_POW:
-   case OP_EQ:
-   case OP_LT:
-   case OP_LE:
-    if (ISK(b) || ISK(c))
-    {
-     printf("\t; ");
-     if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf("-");
-     printf(" ");
-     if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf("-");
-    }
-    break;
-   case OP_JMP:
-   case OP_FORLOOP:
-   case OP_FORPREP:
-    printf("\t; to %d",sbx+pc+2);
-    break;
-   case OP_CLOSURE:
-    printf("\t; %p",VOID(f->p[bx]));
-    break;
-   case OP_SETLIST:
-    if (c==0) printf("\t; %d",(int)code[++pc]);
-    else printf("\t; %d",c);
-    break;
-   default:
-    break;
-  }
-  printf("\n");
- }
-}
-
-#define SS(x)	(x==1)?"":"s"
-#define S(x)	x,SS(x)
-
-static void PrintHeader(const Proto* f)
-{
- const char* s=getstr(f->source);
- if (*s=='@' || *s=='=')
-  s++;
- else if (*s==LUA_SIGNATURE[0])
-  s="(bstring)";
- else
-  s="(string)";
- printf("\n%s <%s:%d,%d> (%d instruction%s, %d bytes at %p)\n",
- 	(f->linedefined==0)?"main":"function",s,
-	f->linedefined,f->lastlinedefined,
-	S(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f));
- printf("%d%s param%s, %d slot%s, %d upvalue%s, ",
-	f->numparams,f->is_vararg?"+":"",SS(f->numparams),
-	S(f->maxstacksize),S(f->nups));
- printf("%d local%s, %d constant%s, %d function%s\n",
-	S(f->sizelocvars),S(f->sizek),S(f->sizep));
-}
-
-static void PrintConstants(const Proto* f)
-{
- int i,n=f->sizek;
- printf("constants (%d) for %p:\n",n,VOID(f));
- for (i=0; i<n; i++)
- {
-  printf("\t%d\t",i+1);
-  PrintConstant(f,i);
-  printf("\n");
- }
-}
-
-static void PrintLocals(const Proto* f)
-{
- int i,n=f->sizelocvars;
- printf("locals (%d) for %p:\n",n,VOID(f));
- for (i=0; i<n; i++)
- {
-  printf("\t%d\t%s\t%d\t%d\n",
-  i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1);
- }
-}
-
-static void PrintUpvalues(const Proto* f)
-{
- int i,n=f->sizeupvalues;
- printf("upvalues (%d) for %p:\n",n,VOID(f));
- if (f->upvalues==NULL) return;
- for (i=0; i<n; i++)
- {
-  printf("\t%d\t%s\n",i,getstr(f->upvalues[i]));
- }
-}
-
-void PrintFunction(const Proto* f, int full)
-{
- int i,n=f->sizep;
- PrintHeader(f);
- PrintCode(f);
- if (full)
- {
-  PrintConstants(f);
-  PrintLocals(f);
-  PrintUpvalues(f);
- }
- for (i=0; i<n; i++) PrintFunction(f->p[i],full);
-}
diff --git a/misc/libtremor/Android.mk b/misc/libtremor/Android.mk
new file mode 100644
index 0000000..913dc2d
--- /dev/null
+++ b/misc/libtremor/Android.mk
@@ -0,0 +1,27 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := tremor
+
+LOCAL_CFLAGS := -I$(LOCAL_PATH) -DHAVE_ALLOCA_H
+
+LOCAL_SRC_FILES =    \
+        tremor/bitwise.c    \
+        tremor/block.c      \
+        tremor/codebook.c   \
+        tremor/floor0.c     \
+        tremor/floor1.c     \
+        tremor/framing.c    \
+        tremor/info.c       \
+        tremor/mapping0.c   \
+        tremor/mdct.c       \
+        tremor/registry.c   \
+        tremor/res012.c     \
+        tremor/sharedbook.c \
+        tremor/synthesis.c  \
+        tremor/vorbisfile.c \
+        tremor/window.c     
+
+include $(BUILD_STATIC_LIBRARY)
+
diff --git a/misc/libtremor/Version_script.in b/misc/libtremor/Version_script.in
deleted file mode 100644
index 2eb1d87..0000000
--- a/misc/libtremor/Version_script.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Export file for libvorbisidec
-#
-# Only the symbols listed in the global section will be callable from
-# applications linking to libvorbisidec.
-#
-
- at PACKAGE@.so.1
-{
-	global:
-		ov_clear;
-		ov_open;
-		ov_open_callbacks;
-		ov_test;
-		ov_test_callbacks;
-		ov_test_open;
-		ov_bitrate;
-		ov_bitrate_instant;
-		ov_streams;
-		ov_seekable;
-		ov_serialnumber;
-		ov_raw_total;
-		ov_pcm_total;
-		ov_time_total;
-		ov_raw_seek;
-		ov_pcm_seek;
-		ov_pcm_seek_page;
-		ov_time_seek;
-		ov_time_seek_page;
-		ov_raw_tell;
-		ov_pcm_tell;
-		ov_time_tell;
-		ov_info;
-		ov_comment;
-		ov_read;
-
-		vorbis_info_init;
-		vorbis_info_clear;
-		vorbis_info_blocksize;
-		vorbis_comment_init;
-		vorbis_comment_add;
-		vorbis_comment_add_tag;
-		vorbis_comment_query;
-		vorbis_comment_query_count;
-		vorbis_comment_clear;
-
-	local:
-		*;
-};
diff --git a/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj b/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj
index ac32ea1..5d93e35 100644
--- a/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj
+++ b/misc/libtremor/Xcode/Tremor.xcodeproj/project.pbxproj
@@ -7,77 +7,77 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		61958DC31364B72000B429B6 /* asm_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DA61364B72000B429B6 /* asm_arm.h */; };
-		61958DC41364B72000B429B6 /* backends.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DA71364B72000B429B6 /* backends.h */; };
-		61958DC51364B72000B429B6 /* block.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DA81364B72000B429B6 /* block.c */; };
-		61958DC61364B72000B429B6 /* block.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DA91364B72000B429B6 /* block.h */; };
-		61958DC71364B72000B429B6 /* codebook.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DAA1364B72000B429B6 /* codebook.c */; };
-		61958DC81364B72000B429B6 /* codebook.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DAB1364B72000B429B6 /* codebook.h */; };
-		61958DC91364B72000B429B6 /* codec_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DAC1364B72000B429B6 /* codec_internal.h */; };
-		61958DCA1364B72000B429B6 /* config_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DAD1364B72000B429B6 /* config_types.h */; };
-		61958DCB1364B72000B429B6 /* floor0.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DAE1364B72000B429B6 /* floor0.c */; };
-		61958DCC1364B72000B429B6 /* floor1.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DAF1364B72000B429B6 /* floor1.c */; };
-		61958DCD1364B72000B429B6 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DB01364B72000B429B6 /* info.c */; };
-		61958DCE1364B72000B429B6 /* ivorbiscodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB11364B72000B429B6 /* ivorbiscodec.h */; };
-		61958DCF1364B72000B429B6 /* ivorbisfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB21364B72000B429B6 /* ivorbisfile.h */; };
-		61958DD01364B72000B429B6 /* lsp_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB31364B72000B429B6 /* lsp_lookup.h */; };
-		61958DD11364B72000B429B6 /* mapping0.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DB41364B72000B429B6 /* mapping0.c */; };
-		61958DD21364B72000B429B6 /* mdct_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB51364B72000B429B6 /* mdct_lookup.h */; };
-		61958DD31364B72000B429B6 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DB61364B72000B429B6 /* mdct.c */; };
-		61958DD41364B72000B429B6 /* mdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB71364B72000B429B6 /* mdct.h */; };
-		61958DD51364B72000B429B6 /* misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB81364B72000B429B6 /* misc.h */; };
-		61958DD61364B72000B429B6 /* os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DB91364B72000B429B6 /* os.h */; };
-		61958DD71364B72000B429B6 /* registry.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DBA1364B72000B429B6 /* registry.c */; };
-		61958DD81364B72000B429B6 /* registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DBB1364B72000B429B6 /* registry.h */; };
-		61958DD91364B72000B429B6 /* res012.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DBC1364B72000B429B6 /* res012.c */; };
-		61958DDA1364B72000B429B6 /* sharedbook.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DBD1364B72000B429B6 /* sharedbook.c */; };
-		61958DDB1364B72000B429B6 /* synthesis.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DBE1364B72000B429B6 /* synthesis.c */; };
-		61958DDC1364B72000B429B6 /* vorbisfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DBF1364B72000B429B6 /* vorbisfile.c */; };
-		61958DDD1364B72000B429B6 /* window_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DC01364B72000B429B6 /* window_lookup.h */; };
-		61958DDE1364B72000B429B6 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 61958DC11364B72000B429B6 /* window.c */; };
-		61958DDF1364B72000B429B6 /* window.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DC21364B72000B429B6 /* window.h */; };
-		61958DFC1364B84300B429B6 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958DFB1364B84300B429B6 /* os_types.h */; };
-		61958E0E1364B89700B429B6 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 61958E0D1364B89700B429B6 /* ogg.h */; };
-		619598391364BDCC00B429B6 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598381364BDCC00B429B6 /* framing.c */; };
-		619598411364BE7F00B429B6 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 619598401364BE7F00B429B6 /* bitwise.c */; };
+		61DB1809148BA9A9004A67B8 /* asm_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17E7148BA9A9004A67B8 /* asm_arm.h */; };
+		61DB180A148BA9A9004A67B8 /* backends.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17E8148BA9A9004A67B8 /* backends.h */; };
+		61DB180B148BA9A9004A67B8 /* bitwise.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17E9148BA9A9004A67B8 /* bitwise.c */; };
+		61DB180C148BA9A9004A67B8 /* block.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17EA148BA9A9004A67B8 /* block.c */; };
+		61DB180D148BA9A9004A67B8 /* block.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17EB148BA9A9004A67B8 /* block.h */; };
+		61DB180E148BA9A9004A67B8 /* codebook.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17EC148BA9A9004A67B8 /* codebook.c */; };
+		61DB180F148BA9A9004A67B8 /* codebook.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17ED148BA9A9004A67B8 /* codebook.h */; };
+		61DB1810148BA9A9004A67B8 /* codec_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17EE148BA9A9004A67B8 /* codec_internal.h */; };
+		61DB1811148BA9A9004A67B8 /* config_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17EF148BA9A9004A67B8 /* config_types.h */; };
+		61DB1812148BA9A9004A67B8 /* floor0.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17F0148BA9A9004A67B8 /* floor0.c */; };
+		61DB1813148BA9A9004A67B8 /* floor1.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17F1148BA9A9004A67B8 /* floor1.c */; };
+		61DB1814148BA9A9004A67B8 /* framing.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17F2148BA9A9004A67B8 /* framing.c */; };
+		61DB1815148BA9A9004A67B8 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17F3148BA9A9004A67B8 /* info.c */; };
+		61DB1816148BA9A9004A67B8 /* ivorbiscodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17F4148BA9A9004A67B8 /* ivorbiscodec.h */; };
+		61DB1818148BA9A9004A67B8 /* ivorbisfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17F6148BA9A9004A67B8 /* ivorbisfile.h */; };
+		61DB1819148BA9A9004A67B8 /* lsp_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17F7148BA9A9004A67B8 /* lsp_lookup.h */; };
+		61DB181A148BA9A9004A67B8 /* mapping0.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17F8148BA9A9004A67B8 /* mapping0.c */; };
+		61DB181B148BA9A9004A67B8 /* mdct_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17F9148BA9A9004A67B8 /* mdct_lookup.h */; };
+		61DB181C148BA9A9004A67B8 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB17FA148BA9A9004A67B8 /* mdct.c */; };
+		61DB181D148BA9A9004A67B8 /* mdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17FB148BA9A9004A67B8 /* mdct.h */; };
+		61DB181E148BA9A9004A67B8 /* misc.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17FC148BA9A9004A67B8 /* misc.h */; };
+		61DB181F148BA9A9004A67B8 /* ogg.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17FD148BA9A9004A67B8 /* ogg.h */; };
+		61DB1820148BA9A9004A67B8 /* os_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17FE148BA9A9004A67B8 /* os_types.h */; };
+		61DB1821148BA9A9004A67B8 /* os.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB17FF148BA9A9004A67B8 /* os.h */; };
+		61DB1822148BA9A9004A67B8 /* registry.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1800148BA9A9004A67B8 /* registry.c */; };
+		61DB1823148BA9A9004A67B8 /* registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB1801148BA9A9004A67B8 /* registry.h */; };
+		61DB1824148BA9A9004A67B8 /* res012.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1802148BA9A9004A67B8 /* res012.c */; };
+		61DB1825148BA9A9004A67B8 /* sharedbook.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1803148BA9A9004A67B8 /* sharedbook.c */; };
+		61DB1826148BA9A9004A67B8 /* synthesis.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1804148BA9A9004A67B8 /* synthesis.c */; };
+		61DB1827148BA9A9004A67B8 /* vorbisfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1805148BA9A9004A67B8 /* vorbisfile.c */; };
+		61DB1828148BA9A9004A67B8 /* window_lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB1806148BA9A9004A67B8 /* window_lookup.h */; };
+		61DB1829148BA9A9004A67B8 /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = 61DB1807148BA9A9004A67B8 /* window.c */; };
+		61DB182A148BA9A9004A67B8 /* window.h in Headers */ = {isa = PBXBuildFile; fileRef = 61DB1808148BA9A9004A67B8 /* window.h */; };
 		AA747D9F0F9514B9006C5449 /* Tremor_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Tremor_Prefix.pch */; };
 		AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
-		61958DA61364B72000B429B6 /* asm_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asm_arm.h; path = ../asm_arm.h; sourceTree = SOURCE_ROOT; };
-		61958DA71364B72000B429B6 /* backends.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = backends.h; path = ../backends.h; sourceTree = SOURCE_ROOT; };
-		61958DA81364B72000B429B6 /* block.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = block.c; path = ../block.c; sourceTree = SOURCE_ROOT; };
-		61958DA91364B72000B429B6 /* block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = block.h; path = ../block.h; sourceTree = SOURCE_ROOT; };
-		61958DAA1364B72000B429B6 /* codebook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = codebook.c; path = ../codebook.c; sourceTree = SOURCE_ROOT; };
-		61958DAB1364B72000B429B6 /* codebook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codebook.h; path = ../codebook.h; sourceTree = SOURCE_ROOT; };
-		61958DAC1364B72000B429B6 /* codec_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codec_internal.h; path = ../codec_internal.h; sourceTree = SOURCE_ROOT; };
-		61958DAD1364B72000B429B6 /* config_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config_types.h; path = ../config_types.h; sourceTree = SOURCE_ROOT; };
-		61958DAE1364B72000B429B6 /* floor0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = floor0.c; path = ../floor0.c; sourceTree = SOURCE_ROOT; };
-		61958DAF1364B72000B429B6 /* floor1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = floor1.c; path = ../floor1.c; sourceTree = SOURCE_ROOT; };
-		61958DB01364B72000B429B6 /* info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = info.c; path = ../info.c; sourceTree = SOURCE_ROOT; };
-		61958DB11364B72000B429B6 /* ivorbiscodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ivorbiscodec.h; path = ../ivorbiscodec.h; sourceTree = SOURCE_ROOT; };
-		61958DB21364B72000B429B6 /* ivorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ivorbisfile.h; path = ../ivorbisfile.h; sourceTree = SOURCE_ROOT; };
-		61958DB31364B72000B429B6 /* lsp_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lsp_lookup.h; path = ../lsp_lookup.h; sourceTree = SOURCE_ROOT; };
-		61958DB41364B72000B429B6 /* mapping0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mapping0.c; path = ../mapping0.c; sourceTree = SOURCE_ROOT; };
-		61958DB51364B72000B429B6 /* mdct_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mdct_lookup.h; path = ../mdct_lookup.h; sourceTree = SOURCE_ROOT; };
-		61958DB61364B72000B429B6 /* mdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdct.c; path = ../mdct.c; sourceTree = SOURCE_ROOT; };
-		61958DB71364B72000B429B6 /* mdct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mdct.h; path = ../mdct.h; sourceTree = SOURCE_ROOT; };
-		61958DB81364B72000B429B6 /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = misc.h; path = ../misc.h; sourceTree = SOURCE_ROOT; };
-		61958DB91364B72000B429B6 /* os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os.h; path = ../os.h; sourceTree = SOURCE_ROOT; };
-		61958DBA1364B72000B429B6 /* registry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = registry.c; path = ../registry.c; sourceTree = SOURCE_ROOT; };
-		61958DBB1364B72000B429B6 /* registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = registry.h; path = ../registry.h; sourceTree = SOURCE_ROOT; };
-		61958DBC1364B72000B429B6 /* res012.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = res012.c; path = ../res012.c; sourceTree = SOURCE_ROOT; };
-		61958DBD1364B72000B429B6 /* sharedbook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sharedbook.c; path = ../sharedbook.c; sourceTree = SOURCE_ROOT; };
-		61958DBE1364B72000B429B6 /* synthesis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = synthesis.c; path = ../synthesis.c; sourceTree = SOURCE_ROOT; };
-		61958DBF1364B72000B429B6 /* vorbisfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vorbisfile.c; path = ../vorbisfile.c; sourceTree = SOURCE_ROOT; };
-		61958DC01364B72000B429B6 /* window_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = window_lookup.h; path = ../window_lookup.h; sourceTree = SOURCE_ROOT; };
-		61958DC11364B72000B429B6 /* window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = window.c; path = ../window.c; sourceTree = SOURCE_ROOT; };
-		61958DC21364B72000B429B6 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = window.h; path = ../window.h; sourceTree = SOURCE_ROOT; };
-		61958DFB1364B84300B429B6 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_types.h; path = ../../../../Library/cocos2d/external/Tremor/os_types.h; sourceTree = SOURCE_ROOT; };
-		61958E0D1364B89700B429B6 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ogg.h; path = ../ogg.h; sourceTree = SOURCE_ROOT; };
-		619598381364BDCC00B429B6 /* framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = framing.c; path = ../framing.c; sourceTree = "<group>"; };
-		619598401364BE7F00B429B6 /* bitwise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitwise.c; path = ../bitwise.c; sourceTree = "<group>"; };
+		61DB17E7148BA9A9004A67B8 /* asm_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asm_arm.h; path = ../tremor/asm_arm.h; sourceTree = SOURCE_ROOT; };
+		61DB17E8148BA9A9004A67B8 /* backends.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = backends.h; path = ../tremor/backends.h; sourceTree = SOURCE_ROOT; };
+		61DB17E9148BA9A9004A67B8 /* bitwise.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bitwise.c; path = ../tremor/bitwise.c; sourceTree = SOURCE_ROOT; };
+		61DB17EA148BA9A9004A67B8 /* block.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = block.c; path = ../tremor/block.c; sourceTree = SOURCE_ROOT; };
+		61DB17EB148BA9A9004A67B8 /* block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = block.h; path = ../tremor/block.h; sourceTree = SOURCE_ROOT; };
+		61DB17EC148BA9A9004A67B8 /* codebook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = codebook.c; path = ../tremor/codebook.c; sourceTree = SOURCE_ROOT; };
+		61DB17ED148BA9A9004A67B8 /* codebook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codebook.h; path = ../tremor/codebook.h; sourceTree = SOURCE_ROOT; };
+		61DB17EE148BA9A9004A67B8 /* codec_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codec_internal.h; path = ../tremor/codec_internal.h; sourceTree = SOURCE_ROOT; };
+		61DB17EF148BA9A9004A67B8 /* config_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config_types.h; path = ../tremor/config_types.h; sourceTree = SOURCE_ROOT; };
+		61DB17F0148BA9A9004A67B8 /* floor0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = floor0.c; path = ../tremor/floor0.c; sourceTree = SOURCE_ROOT; };
+		61DB17F1148BA9A9004A67B8 /* floor1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = floor1.c; path = ../tremor/floor1.c; sourceTree = SOURCE_ROOT; };
+		61DB17F2148BA9A9004A67B8 /* framing.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = framing.c; path = ../tremor/framing.c; sourceTree = SOURCE_ROOT; };
+		61DB17F3148BA9A9004A67B8 /* info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = info.c; path = ../tremor/info.c; sourceTree = SOURCE_ROOT; };
+		61DB17F4148BA9A9004A67B8 /* ivorbiscodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ivorbiscodec.h; path = ../tremor/ivorbiscodec.h; sourceTree = SOURCE_ROOT; };
+		61DB17F6148BA9A9004A67B8 /* ivorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ivorbisfile.h; path = ../tremor/ivorbisfile.h; sourceTree = SOURCE_ROOT; };
+		61DB17F7148BA9A9004A67B8 /* lsp_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lsp_lookup.h; path = ../tremor/lsp_lookup.h; sourceTree = SOURCE_ROOT; };
+		61DB17F8148BA9A9004A67B8 /* mapping0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mapping0.c; path = ../tremor/mapping0.c; sourceTree = SOURCE_ROOT; };
+		61DB17F9148BA9A9004A67B8 /* mdct_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mdct_lookup.h; path = ../tremor/mdct_lookup.h; sourceTree = SOURCE_ROOT; };
+		61DB17FA148BA9A9004A67B8 /* mdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mdct.c; path = ../tremor/mdct.c; sourceTree = SOURCE_ROOT; };
+		61DB17FB148BA9A9004A67B8 /* mdct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mdct.h; path = ../tremor/mdct.h; sourceTree = SOURCE_ROOT; };
+		61DB17FC148BA9A9004A67B8 /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = misc.h; path = ../tremor/misc.h; sourceTree = SOURCE_ROOT; };
+		61DB17FD148BA9A9004A67B8 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ogg.h; path = ../tremor/ogg.h; sourceTree = SOURCE_ROOT; };
+		61DB17FE148BA9A9004A67B8 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os_types.h; path = ../tremor/os_types.h; sourceTree = SOURCE_ROOT; };
+		61DB17FF148BA9A9004A67B8 /* os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = os.h; path = ../tremor/os.h; sourceTree = SOURCE_ROOT; };
+		61DB1800148BA9A9004A67B8 /* registry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = registry.c; path = ../tremor/registry.c; sourceTree = SOURCE_ROOT; };
+		61DB1801148BA9A9004A67B8 /* registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = registry.h; path = ../tremor/registry.h; sourceTree = SOURCE_ROOT; };
+		61DB1802148BA9A9004A67B8 /* res012.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = res012.c; path = ../tremor/res012.c; sourceTree = SOURCE_ROOT; };
+		61DB1803148BA9A9004A67B8 /* sharedbook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sharedbook.c; path = ../tremor/sharedbook.c; sourceTree = SOURCE_ROOT; };
+		61DB1804148BA9A9004A67B8 /* synthesis.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = synthesis.c; path = ../tremor/synthesis.c; sourceTree = SOURCE_ROOT; };
+		61DB1805148BA9A9004A67B8 /* vorbisfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vorbisfile.c; path = ../tremor/vorbisfile.c; sourceTree = SOURCE_ROOT; };
+		61DB1806148BA9A9004A67B8 /* window_lookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = window_lookup.h; path = ../tremor/window_lookup.h; sourceTree = SOURCE_ROOT; };
+		61DB1807148BA9A9004A67B8 /* window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = window.c; path = ../tremor/window.c; sourceTree = SOURCE_ROOT; };
+		61DB1808148BA9A9004A67B8 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = window.h; path = ../tremor/window.h; sourceTree = SOURCE_ROOT; };
 		AA747D9E0F9514B9006C5449 /* Tremor_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tremor_Prefix.pch; sourceTree = SOURCE_ROOT; };
 		AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		D2AAC07E0554694100DB518D /* libTremor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTremor.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -125,39 +125,39 @@
 		08FB77AEFE84172EC02AAC07 /* Sources */ = {
 			isa = PBXGroup;
 			children = (
-				619598401364BE7F00B429B6 /* bitwise.c */,
-				619598381364BDCC00B429B6 /* framing.c */,
-				61958DA61364B72000B429B6 /* asm_arm.h */,
-				61958DA71364B72000B429B6 /* backends.h */,
-				61958DA81364B72000B429B6 /* block.c */,
-				61958DA91364B72000B429B6 /* block.h */,
-				61958DAA1364B72000B429B6 /* codebook.c */,
-				61958DAB1364B72000B429B6 /* codebook.h */,
-				61958DAC1364B72000B429B6 /* codec_internal.h */,
-				61958DAD1364B72000B429B6 /* config_types.h */,
-				61958DAE1364B72000B429B6 /* floor0.c */,
-				61958DAF1364B72000B429B6 /* floor1.c */,
-				61958DB01364B72000B429B6 /* info.c */,
-				61958DB11364B72000B429B6 /* ivorbiscodec.h */,
-				61958DB21364B72000B429B6 /* ivorbisfile.h */,
-				61958DB31364B72000B429B6 /* lsp_lookup.h */,
-				61958DB41364B72000B429B6 /* mapping0.c */,
-				61958DB51364B72000B429B6 /* mdct_lookup.h */,
-				61958DB61364B72000B429B6 /* mdct.c */,
-				61958DB71364B72000B429B6 /* mdct.h */,
-				61958DB81364B72000B429B6 /* misc.h */,
-				61958E0D1364B89700B429B6 /* ogg.h */,
-				61958DB91364B72000B429B6 /* os.h */,
-				61958DFB1364B84300B429B6 /* os_types.h */,
-				61958DBA1364B72000B429B6 /* registry.c */,
-				61958DBB1364B72000B429B6 /* registry.h */,
-				61958DBC1364B72000B429B6 /* res012.c */,
-				61958DBD1364B72000B429B6 /* sharedbook.c */,
-				61958DBE1364B72000B429B6 /* synthesis.c */,
-				61958DBF1364B72000B429B6 /* vorbisfile.c */,
-				61958DC01364B72000B429B6 /* window_lookup.h */,
-				61958DC11364B72000B429B6 /* window.c */,
-				61958DC21364B72000B429B6 /* window.h */,
+				61DB17E7148BA9A9004A67B8 /* asm_arm.h */,
+				61DB17E8148BA9A9004A67B8 /* backends.h */,
+				61DB17E9148BA9A9004A67B8 /* bitwise.c */,
+				61DB17EA148BA9A9004A67B8 /* block.c */,
+				61DB17EB148BA9A9004A67B8 /* block.h */,
+				61DB17EC148BA9A9004A67B8 /* codebook.c */,
+				61DB17ED148BA9A9004A67B8 /* codebook.h */,
+				61DB17EE148BA9A9004A67B8 /* codec_internal.h */,
+				61DB17EF148BA9A9004A67B8 /* config_types.h */,
+				61DB17F0148BA9A9004A67B8 /* floor0.c */,
+				61DB17F1148BA9A9004A67B8 /* floor1.c */,
+				61DB17F2148BA9A9004A67B8 /* framing.c */,
+				61DB17F3148BA9A9004A67B8 /* info.c */,
+				61DB17F4148BA9A9004A67B8 /* ivorbiscodec.h */,
+				61DB17F6148BA9A9004A67B8 /* ivorbisfile.h */,
+				61DB17F7148BA9A9004A67B8 /* lsp_lookup.h */,
+				61DB17F8148BA9A9004A67B8 /* mapping0.c */,
+				61DB17F9148BA9A9004A67B8 /* mdct_lookup.h */,
+				61DB17FA148BA9A9004A67B8 /* mdct.c */,
+				61DB17FB148BA9A9004A67B8 /* mdct.h */,
+				61DB17FC148BA9A9004A67B8 /* misc.h */,
+				61DB17FD148BA9A9004A67B8 /* ogg.h */,
+				61DB17FE148BA9A9004A67B8 /* os_types.h */,
+				61DB17FF148BA9A9004A67B8 /* os.h */,
+				61DB1800148BA9A9004A67B8 /* registry.c */,
+				61DB1801148BA9A9004A67B8 /* registry.h */,
+				61DB1802148BA9A9004A67B8 /* res012.c */,
+				61DB1803148BA9A9004A67B8 /* sharedbook.c */,
+				61DB1804148BA9A9004A67B8 /* synthesis.c */,
+				61DB1805148BA9A9004A67B8 /* vorbisfile.c */,
+				61DB1806148BA9A9004A67B8 /* window_lookup.h */,
+				61DB1807148BA9A9004A67B8 /* window.c */,
+				61DB1808148BA9A9004A67B8 /* window.h */,
 			);
 			name = Sources;
 			sourceTree = "<group>";
@@ -178,24 +178,24 @@
 			buildActionMask = 2147483647;
 			files = (
 				AA747D9F0F9514B9006C5449 /* Tremor_Prefix.pch in Headers */,
-				61958DC31364B72000B429B6 /* asm_arm.h in Headers */,
-				61958DC41364B72000B429B6 /* backends.h in Headers */,
-				61958DC61364B72000B429B6 /* block.h in Headers */,
-				61958DC81364B72000B429B6 /* codebook.h in Headers */,
-				61958DC91364B72000B429B6 /* codec_internal.h in Headers */,
-				61958DCA1364B72000B429B6 /* config_types.h in Headers */,
-				61958DCE1364B72000B429B6 /* ivorbiscodec.h in Headers */,
-				61958DCF1364B72000B429B6 /* ivorbisfile.h in Headers */,
-				61958DD01364B72000B429B6 /* lsp_lookup.h in Headers */,
-				61958DD21364B72000B429B6 /* mdct_lookup.h in Headers */,
-				61958DD41364B72000B429B6 /* mdct.h in Headers */,
-				61958DD51364B72000B429B6 /* misc.h in Headers */,
-				61958DD61364B72000B429B6 /* os.h in Headers */,
-				61958DD81364B72000B429B6 /* registry.h in Headers */,
-				61958DDD1364B72000B429B6 /* window_lookup.h in Headers */,
-				61958DDF1364B72000B429B6 /* window.h in Headers */,
-				61958DFC1364B84300B429B6 /* os_types.h in Headers */,
-				61958E0E1364B89700B429B6 /* ogg.h in Headers */,
+				61DB1809148BA9A9004A67B8 /* asm_arm.h in Headers */,
+				61DB180A148BA9A9004A67B8 /* backends.h in Headers */,
+				61DB180D148BA9A9004A67B8 /* block.h in Headers */,
+				61DB180F148BA9A9004A67B8 /* codebook.h in Headers */,
+				61DB1810148BA9A9004A67B8 /* codec_internal.h in Headers */,
+				61DB1811148BA9A9004A67B8 /* config_types.h in Headers */,
+				61DB1816148BA9A9004A67B8 /* ivorbiscodec.h in Headers */,
+				61DB1818148BA9A9004A67B8 /* ivorbisfile.h in Headers */,
+				61DB1819148BA9A9004A67B8 /* lsp_lookup.h in Headers */,
+				61DB181B148BA9A9004A67B8 /* mdct_lookup.h in Headers */,
+				61DB181D148BA9A9004A67B8 /* mdct.h in Headers */,
+				61DB181E148BA9A9004A67B8 /* misc.h in Headers */,
+				61DB181F148BA9A9004A67B8 /* ogg.h in Headers */,
+				61DB1820148BA9A9004A67B8 /* os_types.h in Headers */,
+				61DB1821148BA9A9004A67B8 /* os.h in Headers */,
+				61DB1823148BA9A9004A67B8 /* registry.h in Headers */,
+				61DB1828148BA9A9004A67B8 /* window_lookup.h in Headers */,
+				61DB182A148BA9A9004A67B8 /* window.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -249,21 +249,21 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				619598411364BE7F00B429B6 /* bitwise.c in Sources */,
-				61958DC51364B72000B429B6 /* block.c in Sources */,
-				61958DC71364B72000B429B6 /* codebook.c in Sources */,
-				619598391364BDCC00B429B6 /* framing.c in Sources */,
-				61958DCB1364B72000B429B6 /* floor0.c in Sources */,
-				61958DCC1364B72000B429B6 /* floor1.c in Sources */,
-				61958DCD1364B72000B429B6 /* info.c in Sources */,
-				61958DD11364B72000B429B6 /* mapping0.c in Sources */,
-				61958DD31364B72000B429B6 /* mdct.c in Sources */,
-				61958DD71364B72000B429B6 /* registry.c in Sources */,
-				61958DD91364B72000B429B6 /* res012.c in Sources */,
-				61958DDA1364B72000B429B6 /* sharedbook.c in Sources */,
-				61958DDB1364B72000B429B6 /* synthesis.c in Sources */,
-				61958DDC1364B72000B429B6 /* vorbisfile.c in Sources */,
-				61958DDE1364B72000B429B6 /* window.c in Sources */,
+				61DB180B148BA9A9004A67B8 /* bitwise.c in Sources */,
+				61DB180C148BA9A9004A67B8 /* block.c in Sources */,
+				61DB180E148BA9A9004A67B8 /* codebook.c in Sources */,
+				61DB1812148BA9A9004A67B8 /* floor0.c in Sources */,
+				61DB1813148BA9A9004A67B8 /* floor1.c in Sources */,
+				61DB1814148BA9A9004A67B8 /* framing.c in Sources */,
+				61DB1815148BA9A9004A67B8 /* info.c in Sources */,
+				61DB181A148BA9A9004A67B8 /* mapping0.c in Sources */,
+				61DB181C148BA9A9004A67B8 /* mdct.c in Sources */,
+				61DB1822148BA9A9004A67B8 /* registry.c in Sources */,
+				61DB1824148BA9A9004A67B8 /* res012.c in Sources */,
+				61DB1825148BA9A9004A67B8 /* sharedbook.c in Sources */,
+				61DB1826148BA9A9004A67B8 /* synthesis.c in Sources */,
+				61DB1827148BA9A9004A67B8 /* vorbisfile.c in Sources */,
+				61DB1829148BA9A9004A67B8 /* window.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/misc/libtremor/backends.h b/misc/libtremor/backends.h
deleted file mode 100644
index 269d9b8..0000000
--- a/misc/libtremor/backends.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: backend and mapping structures
-
- ********************************************************************/
-
-/* this is exposed up here because we need it for static modes.
-   Lookups for each backend aren't exposed because there's no reason
-   to do so */
-
-#ifndef _vorbis_backend_h_
-#define _vorbis_backend_h_
-
-#include "codec_internal.h"
-
-/* this would all be simpler/shorter with templates, but.... */
-/* Transform backend generic *************************************/
-
-/* only mdct right now.  Flesh it out more if we ever transcend mdct
-   in the transform domain */
-
-/* Floor backend generic *****************************************/
-typedef struct{
-  vorbis_info_floor     *(*unpack)(vorbis_info *,oggpack_buffer *);
-  vorbis_look_floor     *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
-				   vorbis_info_floor *);
-  void (*free_info) (vorbis_info_floor *);
-  void (*free_look) (vorbis_look_floor *);
-  void *(*inverse1)  (struct vorbis_block *,vorbis_look_floor *);
-  int   (*inverse2)  (struct vorbis_block *,vorbis_look_floor *,
-		     void *buffer,ogg_int32_t *);
-} vorbis_func_floor;
-
-typedef struct{
-  int   order;
-  long  rate;
-  long  barkmap;
-
-  int   ampbits;
-  int   ampdB;
-
-  int   numbooks; /* <= 16 */
-  int   books[16];
-
-} vorbis_info_floor0;
-
-#define VIF_POSIT 63
-#define VIF_CLASS 16
-#define VIF_PARTS 31
-typedef struct{
-  int   partitions;                /* 0 to 31 */
-  int   partitionclass[VIF_PARTS]; /* 0 to 15 */
-
-  int   class_dim[VIF_CLASS];        /* 1 to 8 */
-  int   class_subs[VIF_CLASS];       /* 0,1,2,3 (bits: 1<<n poss) */
-  int   class_book[VIF_CLASS];       /* subs ^ dim entries */
-  int   class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
-
-
-  int   mult;                      /* 1 2 3 or 4 */
-  int   postlist[VIF_POSIT+2];    /* first two implicit */
-
-} vorbis_info_floor1;
-
-/* Residue backend generic *****************************************/
-typedef struct{
-  vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
-  vorbis_look_residue *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
-				 vorbis_info_residue *);
-  void (*free_info)    (vorbis_info_residue *);
-  void (*free_look)    (vorbis_look_residue *);
-  int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
-			ogg_int32_t **,int *,int);
-} vorbis_func_residue;
-
-typedef struct vorbis_info_residue0{
-/* block-partitioned VQ coded straight residue */
-  long  begin;
-  long  end;
-
-  /* first stage (lossless partitioning) */
-  int    grouping;         /* group n vectors per partition */
-  int    partitions;       /* possible codebooks for a partition */
-  int    groupbook;        /* huffbook for partitioning */
-  int    secondstages[64]; /* expanded out to pointers in lookup */
-  int    booklist[256];    /* list of second stage books */
-} vorbis_info_residue0;
-
-/* Mapping backend generic *****************************************/
-typedef struct{
-  vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
-  vorbis_look_mapping *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
-				 vorbis_info_mapping *);
-  void (*free_info)    (vorbis_info_mapping *);
-  void (*free_look)    (vorbis_look_mapping *);
-  int  (*inverse)      (struct vorbis_block *vb,vorbis_look_mapping *);
-} vorbis_func_mapping;
-
-typedef struct vorbis_info_mapping0{
-  int   submaps;  /* <= 16 */
-  int   chmuxlist[256];   /* up to 256 channels in a Vorbis stream */
-
-  int   floorsubmap[16];   /* [mux] submap to floors */
-  int   residuesubmap[16]; /* [mux] submap to residue */
-
-  int   psy[2]; /* by blocktype; impulse/padding for short,
-                   transition/normal for long */
-
-  int   coupling_steps;
-  int   coupling_mag[256];
-  int   coupling_ang[256];
-} vorbis_info_mapping0;
-
-#endif
-
-
-
-
-
diff --git a/misc/libtremor/block.c b/misc/libtremor/block.c
deleted file mode 100644
index 361de9f..0000000
--- a/misc/libtremor/block.c
+++ /dev/null
@@ -1,453 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: PCM data vector blocking, windowing and dis/reassembly
-
- ********************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "ogg.h"
-#include "ivorbiscodec.h"
-#include "codec_internal.h"
-
-#include "window.h"
-#include "registry.h"
-#include "misc.h"
-
-static int ilog(unsigned int v){
-  int ret=0;
-  if(v)--v;
-  while(v){
-    ret++;
-    v>>=1;
-  }
-  return(ret);
-}
-
-/* pcm accumulator examples (not exhaustive):
-
- <-------------- lW ---------------->
-                   <--------------- W ---------------->
-:            .....|.....       _______________         |
-:        .'''     |     '''_---      |       |\        |
-:.....'''         |_____--- '''......|       | \_______|
-:.................|__________________|_______|__|______|
-                  |<------ Sl ------>|      > Sr <     |endW
-                  |beginSl           |endSl  |  |endSr
-                  |beginW            |endlW  |beginSr
-
-
-                      |< lW >|
-                   <--------------- W ---------------->
-                  |   |  ..  ______________            |
-                  |   | '  `/        |     ---_        |
-                  |___.'___/`.       |         ---_____|
-                  |_______|__|_______|_________________|
-                  |      >|Sl|<      |<------ Sr ----->|endW
-                  |       |  |endSl  |beginSr          |endSr
-                  |beginW |  |endlW
-                  mult[0] |beginSl                     mult[n]
-
- <-------------- lW ----------------->
-                          |<--W-->|
-:            ..............  ___  |   |
-:        .'''             |`/   \ |   |
-:.....'''                 |/`....\|...|
-:.........................|___|___|___|
-                          |Sl |Sr |endW
-                          |   |   |endSr
-                          |   |beginSr
-                          |   |endSl
-			  |beginSl
-			  |beginW
-*/
-
-/* block abstraction setup *********************************************/
-
-#ifndef WORD_ALIGN
-#define WORD_ALIGN 8
-#endif
-
-int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
-  memset(vb,0,sizeof(*vb));
-  vb->vd=v;
-  vb->localalloc=0;
-  vb->localstore=NULL;
-
-  return(0);
-}
-
-void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
-  bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
-  if(bytes+vb->localtop>vb->localalloc){
-    /* can't just _ogg_realloc... there are outstanding pointers */
-    if(vb->localstore){
-      struct alloc_chain *link=(struct alloc_chain *)_ogg_malloc(sizeof(*link));
-      vb->totaluse+=vb->localtop;
-      link->next=vb->reap;
-      link->ptr=vb->localstore;
-      vb->reap=link;
-    }
-    /* highly conservative */
-    vb->localalloc=bytes;
-    vb->localstore=_ogg_malloc(vb->localalloc);
-    vb->localtop=0;
-  }
-  {
-    void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
-    vb->localtop+=bytes;
-    return ret;
-  }
-}
-
-/* reap the chain, pull the ripcord */
-void _vorbis_block_ripcord(vorbis_block *vb){
-  /* reap the chain */
-  struct alloc_chain *reap=vb->reap;
-  while(reap){
-    struct alloc_chain *next=reap->next;
-    _ogg_free(reap->ptr);
-    memset(reap,0,sizeof(*reap));
-    _ogg_free(reap);
-    reap=next;
-  }
-  /* consolidate storage */
-  if(vb->totaluse){
-    vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
-    vb->localalloc+=vb->totaluse;
-    vb->totaluse=0;
-  }
-
-  /* pull the ripcord */
-  vb->localtop=0;
-  vb->reap=NULL;
-}
-
-int vorbis_block_clear(vorbis_block *vb){
-  _vorbis_block_ripcord(vb);
-  if(vb->localstore)_ogg_free(vb->localstore);
-
-  memset(vb,0,sizeof(*vb));
-  return(0);
-}
-
-static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
-  int i;
-  codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
-  private_state *b=NULL;
-
-  memset(v,0,sizeof(*v));
-  b=(private_state *)(v->backend_state=_ogg_calloc(1,sizeof(*b)));
-
-  v->vi=vi;
-  b->modebits=ilog(ci->modes);
-
-  /* Vorbis I uses only window type 0 */
-  b->window[0]=_vorbis_window(0,ci->blocksizes[0]/2);
-  b->window[1]=_vorbis_window(0,ci->blocksizes[1]/2);
-
-  /* finish the codebooks */
-  if(!ci->fullbooks){
-    ci->fullbooks=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
-    for(i=0;i<ci->books;i++){
-      vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]);
-      /* decode codebooks are now standalone after init */
-      vorbis_staticbook_destroy(ci->book_param[i]);
-      ci->book_param[i]=NULL;
-    }
-  }
-
-  v->pcm_storage=ci->blocksizes[1];
-  v->pcm=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcm));
-  v->pcmret=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcmret));
-  for(i=0;i<vi->channels;i++)
-    v->pcm[i]=(ogg_int32_t *)_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i]));
-
-  /* all 1 (large block) or 0 (small block) */
-  /* explicitly set for the sake of clarity */
-  v->lW=0; /* previous window size */
-  v->W=0;  /* current window size */
-
-  /* initialize all the mapping/backend lookups */
-  b->mode=(vorbis_look_mapping **)_ogg_calloc(ci->modes,sizeof(*b->mode));
-  for(i=0;i<ci->modes;i++){
-    int mapnum=ci->mode_param[i]->mapping;
-    int maptype=ci->map_type[mapnum];
-    b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i],
-					 ci->map_param[mapnum]);
-  }
-  return(0);
-}
-
-int vorbis_synthesis_restart(vorbis_dsp_state *v){
-  vorbis_info *vi=v->vi;
-  codec_setup_info *ci;
-
-  if(!v->backend_state)return -1;
-  if(!vi)return -1;
-  ci=vi->codec_setup;
-  if(!ci)return -1;
-
-  v->centerW=ci->blocksizes[1]/2;
-  v->pcm_current=v->centerW;
-
-  v->pcm_returned=-1;
-  v->granulepos=-1;
-  v->sequence=-1;
-  ((private_state *)(v->backend_state))->sample_count=-1;
-
-  return(0);
-}
-
-int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi){
-  _vds_init(v,vi);
-  vorbis_synthesis_restart(v);
-
-  return(0);
-}
-
-void vorbis_dsp_clear(vorbis_dsp_state *v){
-  int i;
-  if(v){
-    vorbis_info *vi=v->vi;
-    codec_setup_info *ci=(codec_setup_info *)(vi?vi->codec_setup:NULL);
-    private_state *b=(private_state *)v->backend_state;
-
-    if(v->pcm){
-      for(i=0;i<vi->channels;i++)
-	if(v->pcm[i])_ogg_free(v->pcm[i]);
-      _ogg_free(v->pcm);
-      if(v->pcmret)_ogg_free(v->pcmret);
-    }
-
-    /* free mode lookups; these are actually vorbis_look_mapping structs */
-    if(ci){
-      for(i=0;i<ci->modes;i++){
-	int mapnum=ci->mode_param[i]->mapping;
-	int maptype=ci->map_type[mapnum];
-	if(b && b->mode)_mapping_P[maptype]->free_look(b->mode[i]);
-      }
-    }
-
-    if(b){
-      if(b->mode)_ogg_free(b->mode);
-      _ogg_free(b);
-    }
-
-    memset(v,0,sizeof(*v));
-  }
-}
-
-/* Unlike in analysis, the window is only partially applied for each
-   block.  The time domain envelope is not yet handled at the point of
-   calling (as it relies on the previous block). */
-
-int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
-  vorbis_info *vi=v->vi;
-  codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
-  private_state *b=v->backend_state;
-  int i,j;
-
-  if(v->pcm_current>v->pcm_returned  && v->pcm_returned!=-1)return(OV_EINVAL);
-
-  v->lW=v->W;
-  v->W=vb->W;
-  v->nW=-1;
-
-  if((v->sequence==-1)||
-     (v->sequence+1 != vb->sequence)){
-    v->granulepos=-1; /* out of sequence; lose count */
-    b->sample_count=-1;
-  }
-
-  v->sequence=vb->sequence;
-
-  if(vb->pcm){  /* no pcm to process if vorbis_synthesis_trackonly
-                   was called on block */
-    int n=ci->blocksizes[v->W]/2;
-    int n0=ci->blocksizes[0]/2;
-    int n1=ci->blocksizes[1]/2;
-
-    int thisCenter;
-    int prevCenter;
-
-    if(v->centerW){
-      thisCenter=n1;
-      prevCenter=0;
-    }else{
-      thisCenter=0;
-      prevCenter=n1;
-    }
-
-    /* v->pcm is now used like a two-stage double buffer.  We don't want
-       to have to constantly shift *or* adjust memory usage.  Don't
-       accept a new block until the old is shifted out */
-
-    /* overlap/add PCM */
-
-    for(j=0;j<vi->channels;j++){
-      /* the overlap/add section */
-      if(v->lW){
-	if(v->W){
-	  /* large/large */
-	  ogg_int32_t *pcm=v->pcm[j]+prevCenter;
-	  ogg_int32_t *p=vb->pcm[j];
-	  for(i=0;i<n1;i++)
-	    pcm[i]+=p[i];
-	}else{
-	  /* large/small */
-	  ogg_int32_t *pcm=v->pcm[j]+prevCenter+n1/2-n0/2;
-	  ogg_int32_t *p=vb->pcm[j];
-	  for(i=0;i<n0;i++)
-	    pcm[i]+=p[i];
-	}
-      }else{
-	if(v->W){
-	  /* small/large */
-	  ogg_int32_t *pcm=v->pcm[j]+prevCenter;
-	  ogg_int32_t *p=vb->pcm[j]+n1/2-n0/2;
-	  for(i=0;i<n0;i++)
-	    pcm[i]+=p[i];
-	  for(;i<n1/2+n0/2;i++)
-	    pcm[i]=p[i];
-	}else{
-	  /* small/small */
-	  ogg_int32_t *pcm=v->pcm[j]+prevCenter;
-	  ogg_int32_t *p=vb->pcm[j];
-	  for(i=0;i<n0;i++)
-	    pcm[i]+=p[i];
-	}
-      }
-
-      /* the copy section */
-      {
-	ogg_int32_t *pcm=v->pcm[j]+thisCenter;
-	ogg_int32_t *p=vb->pcm[j]+n;
-	for(i=0;i<n;i++)
-	  pcm[i]=p[i];
-      }
-    }
-
-    if(v->centerW)
-      v->centerW=0;
-    else
-      v->centerW=n1;
-
-    /* deal with initial packet state; we do this using the explicit
-       pcm_returned==-1 flag otherwise we're sensitive to first block
-       being short or long */
-
-    if(v->pcm_returned==-1){
-      v->pcm_returned=thisCenter;
-      v->pcm_current=thisCenter;
-    }else{
-      v->pcm_returned=prevCenter;
-      v->pcm_current=prevCenter+
-	ci->blocksizes[v->lW]/4+
-	ci->blocksizes[v->W]/4;
-    }
-
-  }
-
-  /* track the frame number... This is for convenience, but also
-     making sure our last packet doesn't end with added padding.  If
-     the last packet is partial, the number of samples we'll have to
-     return will be past the vb->granulepos.
-     
-     This is not foolproof!  It will be confused if we begin
-     decoding at the last page after a seek or hole.  In that case,
-     we don't have a starting point to judge where the last frame
-     is.  For this reason, vorbisfile will always try to make sure
-     it reads the last two marked pages in proper sequence */
-
-  if(b->sample_count==-1){
-    b->sample_count=0;
-  }else{
-    b->sample_count+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
-  }
-
-  if(v->granulepos==-1){
-    if(vb->granulepos!=-1){ /* only set if we have a position to set to */
-
-      v->granulepos=vb->granulepos;
-
-      /* is this a short page? */
-      if(b->sample_count>v->granulepos){
-	/* corner case; if this is both the first and last audio page,
-	   then spec says the end is cut, not beginning */
-	if(vb->eofflag){
-	  /* trim the end */
-	  /* no preceeding granulepos; assume we started at zero (we'd
-	     have to in a short single-page stream) */
-	  /* granulepos could be -1 due to a seek, but that would result
-	     in a long coun`t, not short count */
-
-	  v->pcm_current-=(b->sample_count-v->granulepos);
-	}else{
-	  /* trim the beginning */
-	  v->pcm_returned+=(b->sample_count-v->granulepos);
-	  if(v->pcm_returned>v->pcm_current)
-	    v->pcm_returned=v->pcm_current;
-	}
-
-      }
-
-    }
-  }else{
-    v->granulepos+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
-    if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
-      
-      if(v->granulepos>vb->granulepos){
-	long extra=v->granulepos-vb->granulepos;
-	
-	if(extra)
-	  if(vb->eofflag){
-	    /* partial last frame.  Strip the extra samples off */
-	    v->pcm_current-=extra;
-	  } /* else {Shouldn't happen *unless* the bitstream is out of
-	       spec.  Either way, believe the bitstream } */
-      } /* else {Shouldn't happen *unless* the bitstream is out of
-	   spec.  Either way, believe the bitstream } */
-      v->granulepos=vb->granulepos;
-    }
-  }
-
-  /* Update, cleanup */
-
-  if(vb->eofflag)v->eofflag=1;
-  return(0);
-}
-
-/* pcm==NULL indicates we just want the pending samples, no more */
-int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm){
-  vorbis_info *vi=v->vi;
-  if(v->pcm_returned>-1 && v->pcm_returned<v->pcm_current){
-    if(pcm){
-      int i;
-      for(i=0;i<vi->channels;i++)
-	v->pcmret[i]=v->pcm[i]+v->pcm_returned;
-      *pcm=v->pcmret;
-    }
-    return(v->pcm_current-v->pcm_returned);
-  }
-  return(0);
-}
-
-int vorbis_synthesis_read(vorbis_dsp_state *v,int bytes){
-  if(bytes && v->pcm_returned+bytes>v->pcm_current)return(OV_EINVAL);
-  v->pcm_returned+=bytes;
-  return(0);
-}
-
diff --git a/misc/libtremor/block.h b/misc/libtremor/block.h
deleted file mode 100644
index 62b1bff..0000000
--- a/misc/libtremor/block.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2008    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: shared block functions
-
- ********************************************************************/
-
-#ifndef _V_BLOCK_
-#define _V_BLOCK_
-
-#include "ivorbiscodec.h"
-
-extern void _vorbis_block_ripcord(vorbis_block *vb);
-extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
-
-#endif
diff --git a/misc/libtremor/misc.h b/misc/libtremor/misc.h
deleted file mode 100644
index a4bc82f..0000000
--- a/misc/libtremor/misc.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: miscellaneous math and prototypes
-
- ********************************************************************/
-
-#ifndef _V_RANDOM_H_
-#define _V_RANDOM_H_
-#include "ivorbiscodec.h"
-#include "os.h"
-
-#include "asm_arm.h"
-#include <stdlib.h> /* for abs() */
-  
-#ifndef _V_WIDE_MATH
-#define _V_WIDE_MATH
-  
-#ifndef  _LOW_ACCURACY_
-/* 64 bit multiply */
-
-#if !(defined WIN32 && defined WINCE)
-#include <sys/types.h>
-#endif
-
-#if BYTE_ORDER==LITTLE_ENDIAN
-union magic {
-  struct {
-    ogg_int32_t lo;
-    ogg_int32_t hi;
-  } halves;
-  ogg_int64_t whole;
-};
-#endif 
-
-#if BYTE_ORDER==BIG_ENDIAN
-union magic {
-  struct {
-    ogg_int32_t hi;
-    ogg_int32_t lo;
-  } halves;
-  ogg_int64_t whole;
-};
-#endif
-
-STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
-  union magic magic;
-  magic.whole = (ogg_int64_t)x * y;
-  return magic.halves.hi;
-}
-
-STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
-  return MULT32(x,y)<<1;
-}
-
-STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
-  union magic magic;
-  magic.whole  = (ogg_int64_t)x * y;
-  return ((ogg_uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17);
-}
-
-#else
-/* 32 bit multiply, more portable but less accurate */
-
-/*
- * Note: Precision is biased towards the first argument therefore ordering
- * is important.  Shift values were chosen for the best sound quality after
- * many listening tests.
- */
-
-/*
- * For MULT32 and MULT31: The second argument is always a lookup table
- * value already preshifted from 31 to 8 bits.  We therefore take the 
- * opportunity to save on text space and use unsigned char for those
- * tables in this case.
- */
-
-STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
-  return (x >> 9) * y;  /* y preshifted >>23 */
-}
-
-STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
-  return (x >> 8) * y;  /* y preshifted >>23 */
-}
-
-STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
-  return (x >> 6) * y;  /* y preshifted >>9 */
-}
-
-#endif
-
-/*
- * This should be used as a memory barrier, forcing all cached values in
- * registers to wr writen back to memory.  Might or might not be beneficial
- * depending on the architecture and compiler.
- */
-#define MB()
-
-/*
- * The XPROD functions are meant to optimize the cross products found all
- * over the place in mdct.c by forcing memory operation ordering to avoid
- * unnecessary register reloads as soon as memory is being written to.
- * However this is only beneficial on CPUs with a sane number of general
- * purpose registers which exclude the Intel x86.  On Intel, better let the
- * compiler actually reload registers directly from original memory by using
- * macros.
- */
-
-#ifdef __i386__
-
-#define XPROD32(_a, _b, _t, _v, _x, _y)		\
-  { *(_x)=MULT32(_a,_t)+MULT32(_b,_v);		\
-    *(_y)=MULT32(_b,_t)-MULT32(_a,_v); }
-#define XPROD31(_a, _b, _t, _v, _x, _y)		\
-  { *(_x)=MULT31(_a,_t)+MULT31(_b,_v);		\
-    *(_y)=MULT31(_b,_t)-MULT31(_a,_v); }
-#define XNPROD31(_a, _b, _t, _v, _x, _y)	\
-  { *(_x)=MULT31(_a,_t)-MULT31(_b,_v);		\
-    *(_y)=MULT31(_b,_t)+MULT31(_a,_v); }
-
-#else
-
-STIN void XPROD32(ogg_int32_t  a, ogg_int32_t  b,
-			   ogg_int32_t  t, ogg_int32_t  v,
-			   ogg_int32_t *x, ogg_int32_t *y)
-{
-  *x = MULT32(a, t) + MULT32(b, v);
-  *y = MULT32(b, t) - MULT32(a, v);
-}
-
-STIN void XPROD31(ogg_int32_t  a, ogg_int32_t  b,
-			   ogg_int32_t  t, ogg_int32_t  v,
-			   ogg_int32_t *x, ogg_int32_t *y)
-{
-  *x = MULT31(a, t) + MULT31(b, v);
-  *y = MULT31(b, t) - MULT31(a, v);
-}
-
-STIN void XNPROD31(ogg_int32_t  a, ogg_int32_t  b,
-			    ogg_int32_t  t, ogg_int32_t  v,
-			    ogg_int32_t *x, ogg_int32_t *y)
-{
-  *x = MULT31(a, t) - MULT31(b, v);
-  *y = MULT31(b, t) + MULT31(a, v);
-}
-
-#endif
-
-#endif
-
-#ifndef _V_CLIP_MATH
-#define _V_CLIP_MATH
-
-STIN ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
-  int ret=x;
-  ret-= ((x<=32767)-1)&(x-32767);
-  ret-= ((x>=-32768)-1)&(x+32768);
-  return(ret);
-}
-
-#endif
-
-STIN ogg_int32_t VFLOAT_MULT(ogg_int32_t a,ogg_int32_t ap,
-				      ogg_int32_t b,ogg_int32_t bp,
-				      ogg_int32_t *p){
-  if(a && b){
-#ifndef _LOW_ACCURACY_
-    *p=ap+bp+32;
-    return MULT32(a,b);
-#else
-    *p=ap+bp+31;
-    return (a>>15)*(b>>16); 
-#endif
-  }else
-    return 0;
-}
-
-int _ilog(unsigned int);
-
-STIN ogg_int32_t VFLOAT_MULTI(ogg_int32_t a,ogg_int32_t ap,
-				      ogg_int32_t i,
-				      ogg_int32_t *p){
-
-  int ip=_ilog(abs(i))-31;
-  return VFLOAT_MULT(a,ap,i<<-ip,ip,p);
-}
-
-STIN ogg_int32_t VFLOAT_ADD(ogg_int32_t a,ogg_int32_t ap,
-				      ogg_int32_t b,ogg_int32_t bp,
-				      ogg_int32_t *p){
-
-  if(!a){
-    *p=bp;
-    return b;
-  }else if(!b){
-    *p=ap;
-    return a;
-  }
-
-  /* yes, this can leak a bit. */
-  if(ap>bp){
-    int shift=ap-bp+1;
-    *p=ap+1;
-    a>>=1;
-    if(shift<32){
-      b=(b+(1<<(shift-1)))>>shift;
-    }else{
-      b=0;
-    }
-  }else{
-    int shift=bp-ap+1;
-    *p=bp+1;
-    b>>=1;
-    if(shift<32){
-      a=(a+(1<<(shift-1)))>>shift;
-    }else{
-      a=0;
-    }
-  }
-
-  a+=b;
-  if((a&0xc0000000)==0xc0000000 || 
-     (a&0xc0000000)==0){
-    a<<=1;
-    (*p)--;
-  }
-  return(a);
-}
-
-#endif
-
-
-
-
diff --git a/misc/libtremor/registry.c b/misc/libtremor/registry.c
deleted file mode 100644
index c0b5fec..0000000
--- a/misc/libtremor/registry.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: registry for floor, res backends and channel mappings
-
- ********************************************************************/
-
-#include "ivorbiscodec.h"
-#include "codec_internal.h"
-#include "registry.h"
-#include "misc.h"
-
-
-/* seems like major overkill now; the backend numbers will grow into
-   the infrastructure soon enough */
-
-extern vorbis_func_floor     floor0_exportbundle;
-extern vorbis_func_floor     floor1_exportbundle;
-extern vorbis_func_residue   residue0_exportbundle;
-extern vorbis_func_residue   residue1_exportbundle;
-extern vorbis_func_residue   residue2_exportbundle;
-extern vorbis_func_mapping   mapping0_exportbundle;
-
-vorbis_func_floor     *_floor_P[]={
-  &floor0_exportbundle,
-  &floor1_exportbundle,
-};
-
-vorbis_func_residue   *_residue_P[]={
-  &residue0_exportbundle,
-  &residue1_exportbundle,
-  &residue2_exportbundle,
-};
-
-vorbis_func_mapping   *_mapping_P[]={
-  &mapping0_exportbundle,
-};
-
-
-
diff --git a/misc/libtremor/registry.h b/misc/libtremor/registry.h
deleted file mode 100644
index 2bc8068..0000000
--- a/misc/libtremor/registry.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: registry for time, floor, res backends and channel mappings
-
- ********************************************************************/
-
-#ifndef _V_REG_H_
-#define _V_REG_H_
-
-#define VI_TRANSFORMB 1
-#define VI_WINDOWB 1
-#define VI_TIMEB 1
-#define VI_FLOORB 2
-#define VI_RESB 3
-#define VI_MAPB 1
-
-#include "backends.h"
-
-#if defined(_WIN32) && defined(VORBISDLL_IMPORT)
-# define EXTERN __declspec(dllimport) extern
-#else
-# define EXTERN extern
-#endif
-
-EXTERN vorbis_func_floor     *_floor_P[];
-EXTERN vorbis_func_residue   *_residue_P[];
-EXTERN vorbis_func_mapping   *_mapping_P[];
-
-#endif
diff --git a/misc/libtremor/sharedbook.c b/misc/libtremor/sharedbook.c
deleted file mode 100644
index 8e07492..0000000
--- a/misc/libtremor/sharedbook.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: basic shared codebook operations
-
- ********************************************************************/
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include "ogg.h"
-#include "misc.h"
-#include "ivorbiscodec.h"
-#include "codebook.h"
-
-/**** pack/unpack helpers ******************************************/
-int _ilog(unsigned int v){
-  int ret=0;
-  while(v){
-    ret++;
-    v>>=1;
-  }
-  return(ret);
-}
-
-/* 32 bit float (not IEEE; nonnormalized mantissa +
-   biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm 
-   Why not IEEE?  It's just not that important here. */
-
-#define VQ_FEXP 10
-#define VQ_FMAN 21
-#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
-
-static ogg_int32_t _float32_unpack(long val,int *point){
-  long   mant=val&0x1fffff;
-  int    sign=val&0x80000000;
-  long   exp =(val&0x7fe00000L)>>VQ_FMAN;
-
-  exp-=(VQ_FMAN-1)+VQ_FEXP_BIAS;
-
-  if(mant){
-    while(!(mant&0x40000000)){
-      mant<<=1;
-      exp-=1;
-    }
-
-    if(sign)mant= -mant;
-  }else{
-    sign=0;
-    exp=-9999;
-  }
-
-  *point=exp;
-  return mant;
-}
-
-/* given a list of word lengths, generate a list of codewords.  Works
-   for length ordered or unordered, always assigns the lowest valued
-   codewords first.  Extended to handle unused entries (length 0) */
-ogg_uint32_t *_make_words(long *l,long n,long sparsecount){
-  long i,j,count=0;
-  ogg_uint32_t marker[33];
-  ogg_uint32_t *r=(ogg_uint32_t *)_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r));
-  memset(marker,0,sizeof(marker));
-
-  for(i=0;i<n;i++){
-    long length=l[i];
-    if(length>0){
-      ogg_uint32_t entry=marker[length];
-      
-      /* when we claim a node for an entry, we also claim the nodes
-	 below it (pruning off the imagined tree that may have dangled
-	 from it) as well as blocking the use of any nodes directly
-	 above for leaves */
-      
-      /* update ourself */
-      if(length<32 && (entry>>length)){
-	/* error condition; the lengths must specify an overpopulated tree */
-	_ogg_free(r);
-	return(NULL);
-      }
-      r[count++]=entry;
-    
-      /* Look to see if the next shorter marker points to the node
-	 above. if so, update it and repeat.  */
-      {
-	for(j=length;j>0;j--){
-	  
-	  if(marker[j]&1){
-	    /* have to jump branches */
-	    if(j==1)
-	      marker[1]++;
-	    else
-	      marker[j]=marker[j-1]<<1;
-	    break; /* invariant says next upper marker would already
-		      have been moved if it was on the same path */
-	  }
-	  marker[j]++;
-	}
-      }
-      
-      /* prune the tree; the implicit invariant says all the longer
-	 markers were dangling from our just-taken node.  Dangle them
-	 from our *new* node. */
-      for(j=length+1;j<33;j++)
-	if((marker[j]>>1) == entry){
-	  entry=marker[j];
-	  marker[j]=marker[j-1]<<1;
-	}else
-	  break;
-    }else
-      if(sparsecount==0)count++;
-  }
-    
-  /* bitreverse the words because our bitwise packer/unpacker is LSb
-     endian */
-  for(i=0,count=0;i<n;i++){
-    ogg_uint32_t temp=0;
-    for(j=0;j<l[i];j++){
-      temp<<=1;
-      temp|=(r[count]>>j)&1;
-    }
-
-    if(sparsecount){
-      if(l[i])
-	r[count++]=temp;
-    }else
-      r[count++]=temp;
-  }
-
-  return(r);
-}
-
-/* there might be a straightforward one-line way to do the below
-   that's portable and totally safe against roundoff, but I haven't
-   thought of it.  Therefore, we opt on the side of caution */
-long _book_maptype1_quantvals(const static_codebook *b){
-  /* get us a starting hint, we'll polish it below */
-  int bits=_ilog(b->entries);
-  int vals=b->entries>>((bits-1)*(b->dim-1)/b->dim);
-
-  while(1){
-    long acc=1;
-    long acc1=1;
-    int i;
-    for(i=0;i<b->dim;i++){
-      acc*=vals;
-      acc1*=vals+1;
-    }
-    if(acc<=b->entries && acc1>b->entries){
-      return(vals);
-    }else{
-      if(acc>b->entries){
-	vals--;
-      }else{
-	vals++;
-      }
-    }
-  }
-}
-
-/* different than what _book_unquantize does for mainline:
-   we repack the book in a fixed point format that shares the same
-   binary point.  Upon first use, we can shift point if needed */
-
-/* we need to deal with two map types: in map type 1, the values are
-   generated algorithmically (each column of the vector counts through
-   the values in the quant vector). in map type 2, all the values came
-   in in an explicit list.  Both value lists must be unpacked */
-
-ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap,
-			      int *maxpoint){
-  long j,k,count=0;
-  if(b->maptype==1 || b->maptype==2){
-    int quantvals;
-    int minpoint,delpoint;
-    ogg_int32_t mindel=_float32_unpack(b->q_min,&minpoint);
-    ogg_int32_t delta=_float32_unpack(b->q_delta,&delpoint);
-    ogg_int32_t *r=(ogg_int32_t *)_ogg_calloc(n*b->dim,sizeof(*r));
-    int *rp=(int *)_ogg_calloc(n*b->dim,sizeof(*rp));
-
-    *maxpoint=minpoint;
-
-    /* maptype 1 and 2 both use a quantized value vector, but
-       different sizes */
-    switch(b->maptype){
-    case 1:
-      /* most of the time, entries%dimensions == 0, but we need to be
-	 well defined.  We define that the possible vales at each
-	 scalar is values == entries/dim.  If entries%dim != 0, we'll
-	 have 'too few' values (values*dim<entries), which means that
-	 we'll have 'left over' entries; left over entries use zeroed
-	 values (and are wasted).  So don't generate codebooks like
-	 that */
-      quantvals=_book_maptype1_quantvals(b);
-      for(j=0;j<b->entries;j++){
-	if((sparsemap && b->lengthlist[j]) || !sparsemap){
-	  ogg_int32_t last=0;
-	  int lastpoint=0;
-	  int indexdiv=1;
-	  for(k=0;k<b->dim;k++){
-	    int index= (j/indexdiv)%quantvals;
-	    int point=0;
-	    int val=VFLOAT_MULTI(delta,delpoint,
-				 abs(b->quantlist[index]),&point);
-
-	    val=VFLOAT_ADD(mindel,minpoint,val,point,&point);
-	    val=VFLOAT_ADD(last,lastpoint,val,point,&point);
-	    
-	    if(b->q_sequencep){
-	      last=val;	  
-	      lastpoint=point;
-	    }
-	    
-	    if(sparsemap){
-	      r[sparsemap[count]*b->dim+k]=val;
-	      rp[sparsemap[count]*b->dim+k]=point;
-	    }else{
-	      r[count*b->dim+k]=val;
-	      rp[count*b->dim+k]=point;
-	    }
-	    if(*maxpoint<point)*maxpoint=point;
-	    indexdiv*=quantvals;
-	  }
-	  count++;
-	}
-
-      }
-      break;
-    case 2:
-      for(j=0;j<b->entries;j++){
-	if((sparsemap && b->lengthlist[j]) || !sparsemap){
-	  ogg_int32_t last=0;
-	  int         lastpoint=0;
-
-	  for(k=0;k<b->dim;k++){
-	    int point=0;
-	    int val=VFLOAT_MULTI(delta,delpoint,
-				 abs(b->quantlist[j*b->dim+k]),&point);
-
-	    val=VFLOAT_ADD(mindel,minpoint,val,point,&point);
-	    val=VFLOAT_ADD(last,lastpoint,val,point,&point);
-	    
-	    if(b->q_sequencep){
-	      last=val;	  
-	      lastpoint=point;
-	    }
-
-	    if(sparsemap){
-	      r[sparsemap[count]*b->dim+k]=val;
-	      rp[sparsemap[count]*b->dim+k]=point;
-	    }else{
-	      r[count*b->dim+k]=val;
-	      rp[count*b->dim+k]=point;
-	    }
-	    if(*maxpoint<point)*maxpoint=point;
-	  }
-	  count++;
-	}
-      }
-      break;
-    }
-
-    for(j=0;j<n*b->dim;j++)
-      if(rp[j]<*maxpoint)
-	r[j]>>=*maxpoint-rp[j];
-	    
-    _ogg_free(rp);
-    return(r);
-  }
-  return(NULL);
-}
-
-void vorbis_staticbook_clear(static_codebook *b){
-  if(b->quantlist)_ogg_free(b->quantlist);
-  if(b->lengthlist)_ogg_free(b->lengthlist);
-  memset(b,0,sizeof(*b));
-
-}
-
-void vorbis_staticbook_destroy(static_codebook *b){
-  vorbis_staticbook_clear(b);
-  _ogg_free(b);
-}
-
-void vorbis_book_clear(codebook *b){
-  /* static book is not cleared; we're likely called on the lookup and
-     the static codebook belongs to the info struct */
-  if(b->valuelist)_ogg_free(b->valuelist);
-  if(b->codelist)_ogg_free(b->codelist);
-
-  if(b->dec_index)_ogg_free(b->dec_index);
-  if(b->dec_codelengths)_ogg_free(b->dec_codelengths);
-  if(b->dec_firsttable)_ogg_free(b->dec_firsttable);
-
-  memset(b,0,sizeof(*b));
-}
-
-static ogg_uint32_t bitreverse(ogg_uint32_t x){
-  x=    ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
-  x=    ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
-  x=    ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);
-  x=    ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL);
-  return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL);
-}
-
-static int sort32a(const void *a,const void *b){
-  return (**(ogg_uint32_t **)a>**(ogg_uint32_t **)b)-
-    (**(ogg_uint32_t **)a<**(ogg_uint32_t **)b);
-}
-
-/* decode codebook arrangement is more heavily optimized than encode */
-int vorbis_book_init_decode(codebook *c,const static_codebook *s){
-  int i,j,n=0,tabn;
-  int *sortindex;
-  memset(c,0,sizeof(*c));
-  
-  /* count actually used entries */
-  for(i=0;i<s->entries;i++)
-    if(s->lengthlist[i]>0)
-      n++;
-
-  c->entries=s->entries;
-  c->used_entries=n;
-  c->dim=s->dim;
-
-  if(n>0){
-    /* two different remappings go on here.  
-       
-       First, we collapse the likely sparse codebook down only to
-       actually represented values/words.  This collapsing needs to be
-       indexed as map-valueless books are used to encode original entry
-       positions as integers.
-       
-       Second, we reorder all vectors, including the entry index above,
-       by sorted bitreversed codeword to allow treeless decode. */
-    
-    /* perform sort */
-    ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries);
-    ogg_uint32_t **codep=(ogg_uint32_t **)alloca(sizeof(*codep)*n);
-    
-    if(codes==NULL)goto err_out;
-
-    for(i=0;i<n;i++){
-      codes[i]=bitreverse(codes[i]);
-      codep[i]=codes+i;
-    }
-
-    qsort(codep,n,sizeof(*codep),sort32a);
-
-    sortindex=(int *)alloca(n*sizeof(*sortindex));
-    c->codelist=(ogg_uint32_t *)_ogg_malloc(n*sizeof(*c->codelist));
-    /* the index is a reverse index */
-    for(i=0;i<n;i++){
-      int position=codep[i]-codes;
-      sortindex[position]=i;
-    }
-
-    for(i=0;i<n;i++)
-      c->codelist[sortindex[i]]=codes[i];
-    _ogg_free(codes);
-    
-    
-    
-    c->valuelist=_book_unquantize(s,n,sortindex,&c->binarypoint);
-    c->dec_index=(int *)_ogg_malloc(n*sizeof(*c->dec_index));
-    
-    for(n=0,i=0;i<s->entries;i++)
-      if(s->lengthlist[i]>0)
-	c->dec_index[sortindex[n++]]=i;
-    
-    c->dec_codelengths=(char *)_ogg_malloc(n*sizeof(*c->dec_codelengths));
-    for(n=0,i=0;i<s->entries;i++)
-      if(s->lengthlist[i]>0)
-	c->dec_codelengths[sortindex[n++]]=s->lengthlist[i];
-    
-    c->dec_firsttablen=_ilog(c->used_entries)-4; /* this is magic */
-    if(c->dec_firsttablen<5)c->dec_firsttablen=5;
-    if(c->dec_firsttablen>8)c->dec_firsttablen=8;
-    
-    tabn=1<<c->dec_firsttablen;
-    c->dec_firsttable=(ogg_uint32_t *)_ogg_calloc(tabn,sizeof(*c->dec_firsttable));
-    c->dec_maxlength=0;
-    
-    for(i=0;i<n;i++){
-      if(c->dec_maxlength<c->dec_codelengths[i])
-	c->dec_maxlength=c->dec_codelengths[i];
-      if(c->dec_codelengths[i]<=c->dec_firsttablen){
-	ogg_uint32_t orig=bitreverse(c->codelist[i]);
-	for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++)
-	  c->dec_firsttable[orig|(j<<c->dec_codelengths[i])]=i+1;
-      }
-    }
-    
-    /* now fill in 'unused' entries in the firsttable with hi/lo search
-       hints for the non-direct-hits */
-    {
-      ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen);
-      long lo=0,hi=0;
-      
-      for(i=0;i<tabn;i++){
-	ogg_uint32_t word=i<<(32-c->dec_firsttablen);
-	if(c->dec_firsttable[bitreverse(word)]==0){
-	  while((lo+1)<n && c->codelist[lo+1]<=word)lo++;
-	  while(    hi<n && word>=(c->codelist[hi]&mask))hi++;
-	  
-	  /* we only actually have 15 bits per hint to play with here.
-	     In order to overflow gracefully (nothing breaks, efficiency
-	     just drops), encode as the difference from the extremes. */
-	  {
-	    unsigned long loval=lo;
-	    unsigned long hival=n-hi;
-	    
-	    if(loval>0x7fff)loval=0x7fff;
-	    if(hival>0x7fff)hival=0x7fff;
-	    c->dec_firsttable[bitreverse(word)]=
-	      0x80000000UL | (loval<<15) | hival;
-	  }
-	}
-      }
-    }
-  }
-
-  return(0);
- err_out:
-  vorbis_book_clear(c);
-  return(-1);
-}
-
diff --git a/misc/libtremor/synthesis.c b/misc/libtremor/synthesis.c
deleted file mode 100644
index 962c730..0000000
--- a/misc/libtremor/synthesis.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: single-block PCM synthesis
- last mod: $Id: synthesis.c,v 1.4 2003/03/29 03:07:21 xiphmont Exp $
-
- ********************************************************************/
-
-#include <stdio.h>
-#include "ogg.h"
-#include "ivorbiscodec.h"
-#include "codec_internal.h"
-#include "registry.h"
-#include "misc.h"
-#include "block.h"
-
-int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){
-  vorbis_dsp_state     *vd=vb->vd;
-  private_state        *b=(private_state *)vd->backend_state;
-  vorbis_info          *vi=vd->vi;
-  codec_setup_info     *ci=(codec_setup_info *)vi->codec_setup;
-  oggpack_buffer       *opb=&vb->opb;
-  int                   type,mode,i;
- 
-  /* first things first.  Make sure decode is ready */
-  _vorbis_block_ripcord(vb);
-  oggpack_readinit(opb,op->packet);
-
-  /* Check the packet type */
-  if(oggpack_read(opb,1)!=0){
-    /* Oops.  This is not an audio data packet */
-    return(OV_ENOTAUDIO);
-  }
-
-  /* read our mode and pre/post windowsize */
-  mode=oggpack_read(opb,b->modebits);
-  if(mode==-1)return(OV_EBADPACKET);
-  
-  vb->mode=mode;
-  vb->W=ci->mode_param[mode]->blockflag;
-  if(vb->W){
-    vb->lW=oggpack_read(opb,1);
-    vb->nW=oggpack_read(opb,1);
-    if(vb->nW==-1)   return(OV_EBADPACKET);
-  }else{
-    vb->lW=0;
-    vb->nW=0;
-  }
-  
-  /* more setup */
-  vb->granulepos=op->granulepos;
-  vb->sequence=op->packetno-3; /* first block is third packet */
-  vb->eofflag=op->e_o_s;
-
-  if(decodep){
-    /* alloc pcm passback storage */
-    vb->pcmend=ci->blocksizes[vb->W];
-    vb->pcm=(ogg_int32_t **)_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels);
-    for(i=0;i<vi->channels;i++)
-      vb->pcm[i]=(ogg_int32_t *)_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
-    
-    /* unpack_header enforces range checking */
-    type=ci->map_type[ci->mode_param[mode]->mapping];
-    
-    return(_mapping_P[type]->inverse(vb,b->mode[mode]));
-  }else{
-    /* no pcm */
-    vb->pcmend=0;
-    vb->pcm=NULL;
-    
-    return(0);
-  }
-}
-
-long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){
-  codec_setup_info     *ci=(codec_setup_info *)vi->codec_setup;
-  oggpack_buffer       opb;
-  int                  mode;
- 
-  oggpack_readinit(&opb,op->packet);
-
-  /* Check the packet type */
-  if(oggpack_read(&opb,1)!=0){
-    /* Oops.  This is not an audio data packet */
-    return(OV_ENOTAUDIO);
-  }
-
-  {
-    int modebits=0;
-    int v=ci->modes;
-    while(v>1){
-      modebits++;
-      v>>=1;
-    }
-
-    /* read our mode and pre/post windowsize */
-    mode=oggpack_read(&opb,modebits);
-  }
-  if(mode==-1)return(OV_EBADPACKET);
-  return(ci->blocksizes[ci->mode_param[mode]->blockflag]);
-}
-
-
diff --git a/misc/libtremor/CHANGELOG b/misc/libtremor/tremor/CHANGELOG
similarity index 100%
rename from misc/libtremor/CHANGELOG
rename to misc/libtremor/tremor/CHANGELOG
diff --git a/misc/libtremor/COPYING b/misc/libtremor/tremor/COPYING
similarity index 100%
rename from misc/libtremor/COPYING
rename to misc/libtremor/tremor/COPYING
diff --git a/misc/libtremor/README b/misc/libtremor/tremor/README
similarity index 100%
rename from misc/libtremor/README
rename to misc/libtremor/tremor/README
diff --git a/misc/libtremor/asm_arm.h b/misc/libtremor/tremor/asm_arm.h
similarity index 100%
rename from misc/libtremor/asm_arm.h
rename to misc/libtremor/tremor/asm_arm.h
diff --git a/misc/libtremor/bitwise.c b/misc/libtremor/tremor/bitwise.c
similarity index 100%
rename from misc/libtremor/bitwise.c
rename to misc/libtremor/tremor/bitwise.c
diff --git a/misc/libtremor/codebook.c b/misc/libtremor/tremor/codebook.c
similarity index 100%
rename from misc/libtremor/codebook.c
rename to misc/libtremor/tremor/codebook.c
diff --git a/misc/libtremor/codebook.h b/misc/libtremor/tremor/codebook.h
similarity index 100%
rename from misc/libtremor/codebook.h
rename to misc/libtremor/tremor/codebook.h
diff --git a/misc/libtremor/codec_internal.h b/misc/libtremor/tremor/codec_internal.h
similarity index 100%
rename from misc/libtremor/codec_internal.h
rename to misc/libtremor/tremor/codec_internal.h
diff --git a/misc/libtremor/config_types.h b/misc/libtremor/tremor/config_types.h
similarity index 100%
rename from misc/libtremor/config_types.h
rename to misc/libtremor/tremor/config_types.h
diff --git a/misc/libtremor/configure.in b/misc/libtremor/tremor/configure.in
similarity index 100%
rename from misc/libtremor/configure.in
rename to misc/libtremor/tremor/configure.in
diff --git a/misc/libtremor/floor0.c b/misc/libtremor/tremor/floor0.c
similarity index 100%
rename from misc/libtremor/floor0.c
rename to misc/libtremor/tremor/floor0.c
diff --git a/misc/libtremor/floor1.c b/misc/libtremor/tremor/floor1.c
similarity index 100%
rename from misc/libtremor/floor1.c
rename to misc/libtremor/tremor/floor1.c
diff --git a/misc/libtremor/framing.c b/misc/libtremor/tremor/framing.c
similarity index 100%
rename from misc/libtremor/framing.c
rename to misc/libtremor/tremor/framing.c
diff --git a/misc/libtremor/info.c b/misc/libtremor/tremor/info.c
similarity index 100%
rename from misc/libtremor/info.c
rename to misc/libtremor/tremor/info.c
diff --git a/misc/libtremor/ivorbiscodec.h b/misc/libtremor/tremor/ivorbiscodec.h
similarity index 100%
rename from misc/libtremor/ivorbiscodec.h
rename to misc/libtremor/tremor/ivorbiscodec.h
diff --git a/misc/libtremor/ivorbisfile.h b/misc/libtremor/tremor/ivorbisfile.h
similarity index 100%
rename from misc/libtremor/ivorbisfile.h
rename to misc/libtremor/tremor/ivorbisfile.h
diff --git a/misc/libtremor/ivorbisfile_example.c b/misc/libtremor/tremor/ivorbisfile_example.c
similarity index 100%
rename from misc/libtremor/ivorbisfile_example.c
rename to misc/libtremor/tremor/ivorbisfile_example.c
diff --git a/misc/libtremor/lsp_lookup.h b/misc/libtremor/tremor/lsp_lookup.h
similarity index 100%
rename from misc/libtremor/lsp_lookup.h
rename to misc/libtremor/tremor/lsp_lookup.h
diff --git a/misc/libtremor/mapping0.c b/misc/libtremor/tremor/mapping0.c
similarity index 100%
rename from misc/libtremor/mapping0.c
rename to misc/libtremor/tremor/mapping0.c
diff --git a/misc/libtremor/mdct.c b/misc/libtremor/tremor/mdct.c
similarity index 100%
rename from misc/libtremor/mdct.c
rename to misc/libtremor/tremor/mdct.c
diff --git a/misc/libtremor/mdct.h b/misc/libtremor/tremor/mdct.h
similarity index 100%
rename from misc/libtremor/mdct.h
rename to misc/libtremor/tremor/mdct.h
diff --git a/misc/libtremor/mdct_lookup.h b/misc/libtremor/tremor/mdct_lookup.h
similarity index 100%
rename from misc/libtremor/mdct_lookup.h
rename to misc/libtremor/tremor/mdct_lookup.h
diff --git a/misc/libtremor/tremor/misc.h b/misc/libtremor/tremor/misc.h
new file mode 100644
index 0000000..017f25e
--- /dev/null
+++ b/misc/libtremor/tremor/misc.h
@@ -0,0 +1,244 @@
+/********************************************************************
+ *                                                                  *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
+ *                                                                  *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
+ *                                                                  *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
+ *                                                                  *
+ ********************************************************************
+
+ function: miscellaneous math and prototypes
+
+ ********************************************************************/
+
+#ifndef _V_RANDOM_H_
+#define _V_RANDOM_H_
+#include "ivorbiscodec.h"
+#include "os.h"
+
+#include "asm_arm.h"
+#include <stdlib.h> /* for abs() */
+  
+#ifndef _V_WIDE_MATH
+#define _V_WIDE_MATH
+  
+#ifndef  _LOW_ACCURACY_
+/* 64 bit multiply */
+
+#if !(defined WIN32 && defined WINCE)
+#include <sys/types.h>
+#endif
+
+#if BYTE_ORDER==LITTLE_ENDIAN
+union magic {
+  struct {
+    ogg_int32_t lo;
+    ogg_int32_t hi;
+  } halves;
+  ogg_int64_t whole;
+};
+#endif 
+
+#if BYTE_ORDER==BIG_ENDIAN
+/*union magic {
+  struct {
+    ogg_int32_t hi;
+    ogg_int32_t lo;
+  } halves;
+  ogg_int64_t whole;
+};*/
+#endif
+
+STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
+  union magic magic;
+  magic.whole = (ogg_int64_t)x * y;
+  return magic.halves.hi;
+}
+
+STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
+  return MULT32(x,y)<<1;
+}
+
+STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
+  union magic magic;
+  magic.whole  = (ogg_int64_t)x * y;
+  return ((ogg_uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17);
+}
+
+#else
+/* 32 bit multiply, more portable but less accurate */
+
+/*
+ * Note: Precision is biased towards the first argument therefore ordering
+ * is important.  Shift values were chosen for the best sound quality after
+ * many listening tests.
+ */
+
+/*
+ * For MULT32 and MULT31: The second argument is always a lookup table
+ * value already preshifted from 31 to 8 bits.  We therefore take the 
+ * opportunity to save on text space and use unsigned char for those
+ * tables in this case.
+ */
+
+STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
+  return (x >> 9) * y;  /* y preshifted >>23 */
+}
+
+STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
+  return (x >> 8) * y;  /* y preshifted >>23 */
+}
+
+STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
+  return (x >> 6) * y;  /* y preshifted >>9 */
+}
+
+#endif
+
+/*
+ * This should be used as a memory barrier, forcing all cached values in
+ * registers to wr writen back to memory.  Might or might not be beneficial
+ * depending on the architecture and compiler.
+ */
+#define MB()
+
+/*
+ * The XPROD functions are meant to optimize the cross products found all
+ * over the place in mdct.c by forcing memory operation ordering to avoid
+ * unnecessary register reloads as soon as memory is being written to.
+ * However this is only beneficial on CPUs with a sane number of general
+ * purpose registers which exclude the Intel x86.  On Intel, better let the
+ * compiler actually reload registers directly from original memory by using
+ * macros.
+ */
+
+#ifdef __i386__
+
+#define XPROD32(_a, _b, _t, _v, _x, _y)		\
+  { *(_x)=MULT32(_a,_t)+MULT32(_b,_v);		\
+    *(_y)=MULT32(_b,_t)-MULT32(_a,_v); }
+#define XPROD31(_a, _b, _t, _v, _x, _y)		\
+  { *(_x)=MULT31(_a,_t)+MULT31(_b,_v);		\
+    *(_y)=MULT31(_b,_t)-MULT31(_a,_v); }
+#define XNPROD31(_a, _b, _t, _v, _x, _y)	\
+  { *(_x)=MULT31(_a,_t)-MULT31(_b,_v);		\
+    *(_y)=MULT31(_b,_t)+MULT31(_a,_v); }
+
+#else
+
+STIN void XPROD32(ogg_int32_t  a, ogg_int32_t  b,
+			   ogg_int32_t  t, ogg_int32_t  v,
+			   ogg_int32_t *x, ogg_int32_t *y)
+{
+  *x = MULT32(a, t) + MULT32(b, v);
+  *y = MULT32(b, t) - MULT32(a, v);
+}
+
+STIN void XPROD31(ogg_int32_t  a, ogg_int32_t  b,
+			   ogg_int32_t  t, ogg_int32_t  v,
+			   ogg_int32_t *x, ogg_int32_t *y)
+{
+  *x = MULT31(a, t) + MULT31(b, v);
+  *y = MULT31(b, t) - MULT31(a, v);
+}
+
+STIN void XNPROD31(ogg_int32_t  a, ogg_int32_t  b,
+			    ogg_int32_t  t, ogg_int32_t  v,
+			    ogg_int32_t *x, ogg_int32_t *y)
+{
+  *x = MULT31(a, t) - MULT31(b, v);
+  *y = MULT31(b, t) + MULT31(a, v);
+}
+
+#endif
+
+#endif
+
+#ifndef _V_CLIP_MATH
+#define _V_CLIP_MATH
+
+STIN ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+  int ret=x;
+  ret-= ((x<=32767)-1)&(x-32767);
+  ret-= ((x>=-32768)-1)&(x+32768);
+  return(ret);
+}
+
+#endif
+
+STIN ogg_int32_t VFLOAT_MULT(ogg_int32_t a,ogg_int32_t ap,
+				      ogg_int32_t b,ogg_int32_t bp,
+				      ogg_int32_t *p){
+  if(a && b){
+#ifndef _LOW_ACCURACY_
+    *p=ap+bp+32;
+    return MULT32(a,b);
+#else
+    *p=ap+bp+31;
+    return (a>>15)*(b>>16); 
+#endif
+  }else
+    return 0;
+}
+
+int _ilog(unsigned int);
+
+STIN ogg_int32_t VFLOAT_MULTI(ogg_int32_t a,ogg_int32_t ap,
+				      ogg_int32_t i,
+				      ogg_int32_t *p){
+
+  int ip=_ilog(abs(i))-31;
+  return VFLOAT_MULT(a,ap,i<<-ip,ip,p);
+}
+
+STIN ogg_int32_t VFLOAT_ADD(ogg_int32_t a,ogg_int32_t ap,
+				      ogg_int32_t b,ogg_int32_t bp,
+				      ogg_int32_t *p){
+
+  if(!a){
+    *p=bp;
+    return b;
+  }else if(!b){
+    *p=ap;
+    return a;
+  }
+
+  /* yes, this can leak a bit. */
+  if(ap>bp){
+    int shift=ap-bp+1;
+    *p=ap+1;
+    a>>=1;
+    if(shift<32){
+      b=(b+(1<<(shift-1)))>>shift;
+    }else{
+      b=0;
+    }
+  }else{
+    int shift=bp-ap+1;
+    *p=bp+1;
+    b>>=1;
+    if(shift<32){
+      a=(a+(1<<(shift-1)))>>shift;
+    }else{
+      a=0;
+    }
+  }
+
+  a+=b;
+  if((a&0xc0000000)==0xc0000000 || 
+     (a&0xc0000000)==0){
+    a<<=1;
+    (*p)--;
+  }
+  return(a);
+}
+
+#endif
+
+
+
+
diff --git a/misc/libtremor/ogg.h b/misc/libtremor/tremor/ogg.h
similarity index 100%
rename from misc/libtremor/ogg.h
rename to misc/libtremor/tremor/ogg.h
diff --git a/misc/libtremor/os.h b/misc/libtremor/tremor/os.h
similarity index 100%
rename from misc/libtremor/os.h
rename to misc/libtremor/tremor/os.h
diff --git a/misc/libtremor/os_types.h b/misc/libtremor/tremor/os_types.h
similarity index 100%
rename from misc/libtremor/os_types.h
rename to misc/libtremor/tremor/os_types.h
diff --git a/misc/libtremor/res012.c b/misc/libtremor/tremor/res012.c
similarity index 100%
rename from misc/libtremor/res012.c
rename to misc/libtremor/tremor/res012.c
diff --git a/misc/libtremor/tremor/vorbisfile.c b/misc/libtremor/tremor/vorbisfile.c
new file mode 100644
index 0000000..7af5b8d
--- /dev/null
+++ b/misc/libtremor/tremor/vorbisfile.c
@@ -0,0 +1,1587 @@
+/********************************************************************
+ *                                                                  *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
+ *                                                                  *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
+ *                                                                  *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003    *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
+ *                                                                  *
+ ********************************************************************
+
+ function: stdio-based convenience library for opening/seeking/decoding
+ last mod: $Id: vorbisfile.c,v 1.6 2003/03/30 23:40:56 xiphmont Exp $
+
+ ********************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <math.h>
+
+#include "ivorbiscodec.h"
+#include "ivorbisfile.h"
+
+#include "misc.h"
+
+/* A 'chained bitstream' is a Vorbis bitstream that contains more than
+   one logical bitstream arranged end to end (the only form of Ogg
+   multiplexing allowed in a Vorbis bitstream; grouping [parallel
+   multiplexing] is not allowed in Vorbis) */
+
+/* A Vorbis file can be played beginning to end (streamed) without
+   worrying ahead of time about chaining (see decoder_example.c).  If
+   we have the whole file, however, and want random access
+   (seeking/scrubbing) or desire to know the total length/time of a
+   file, we need to account for the possibility of chaining. */
+
+/* We can handle things a number of ways; we can determine the entire
+   bitstream structure right off the bat, or find pieces on demand.
+   This example determines and caches structure for the entire
+   bitstream, but builds a virtual decoder on the fly when moving
+   between links in the chain. */
+
+/* There are also different ways to implement seeking.  Enough
+   information exists in an Ogg bitstream to seek to
+   sample-granularity positions in the output.  Or, one can seek by
+   picking some portion of the stream roughly in the desired area if
+   we only want coarse navigation through the stream. */
+
+/*************************************************************************
+ * Many, many internal helpers.  The intention is not to be confusing; 
+ * rampant duplication and monolithic function implementation would be 
+ * harder to understand anyway.  The high level functions are last.  Begin
+ * grokking near the end of the file */
+
+
+/* read a little more data from the file/pipe into the ogg_sync framer */
+static long _get_data(OggVorbis_File *vf){
+  errno=0;
+  if(vf->datasource){
+    unsigned char *buffer=ogg_sync_bufferin(vf->oy,CHUNKSIZE);
+    long bytes=(vf->callbacks.read_func)(buffer,1,CHUNKSIZE,vf->datasource);
+    if(bytes>0)ogg_sync_wrote(vf->oy,bytes);
+    if(bytes==0 && errno)return(-1);
+    return(bytes);
+  }else
+    return(0);
+}
+
+/* save a tiny smidge of verbosity to make the code more readable */
+static void _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
+  if(vf->datasource){ 
+    (vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET);
+    vf->offset=offset;
+    ogg_sync_reset(vf->oy);
+  }else{
+    /* shouldn't happen unless someone writes a broken callback */
+    return;
+  }
+}
+
+/* The read/seek functions track absolute position within the stream */
+
+/* from the head of the stream, get the next page.  boundary specifies
+   if the function is allowed to fetch more data from the stream (and
+   how much) or only use internally buffered data.
+
+   boundary: -1) unbounded search
+              0) read no additional data; use cached only
+	      n) search for a new page beginning for n bytes
+
+   return:   <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
+              n) found a page at absolute offset n 
+
+              produces a refcounted page */
+
+static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
+				  ogg_int64_t boundary){
+  if(boundary>0)boundary+=vf->offset;
+  while(1){
+    long more;
+
+    if(boundary>0 && vf->offset>=boundary)return(OV_FALSE);
+    more=ogg_sync_pageseek(vf->oy,og);
+    
+    if(more<0){
+      /* skipped n bytes */
+      vf->offset-=more;
+    }else{
+      if(more==0){
+	/* send more paramedics */
+	if(!boundary)return(OV_FALSE);
+	{
+	  long ret=_get_data(vf);
+	  if(ret==0)return(OV_EOF);
+	  if(ret<0)return(OV_EREAD);
+	}
+      }else{
+	/* got a page.  Return the offset at the page beginning,
+           advance the internal offset past the page end */
+	ogg_int64_t ret=vf->offset;
+	vf->offset+=more;
+	return(ret);
+	
+      }
+    }
+  }
+}
+
+/* find the latest page beginning before the current stream cursor
+   position. Much dirtier than the above as Ogg doesn't have any
+   backward search linkage.  no 'readp' as it will certainly have to
+   read. */
+/* returns offset or OV_EREAD, OV_FAULT and produces a refcounted page */
+
+static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_page *og){
+  ogg_int64_t begin=vf->offset;
+  ogg_int64_t end=begin;
+  ogg_int64_t ret;
+  ogg_int64_t offset=-1;
+
+  while(offset==-1){
+    begin-=CHUNKSIZE;
+    if(begin<0)
+      begin=0;
+    _seek_helper(vf,begin);
+    while(vf->offset<end){
+      ret=_get_next_page(vf,og,end-vf->offset);
+      if(ret==OV_EREAD)return(OV_EREAD);
+      if(ret<0){
+	break;
+      }else{
+	offset=ret;
+      }
+    }
+  }
+
+  /* we have the offset.  Actually snork and hold the page now */
+  _seek_helper(vf,offset);
+  ret=_get_next_page(vf,og,CHUNKSIZE);
+  if(ret<0)
+    /* this shouldn't be possible */
+    return(OV_EFAULT);
+
+  return(offset);
+}
+
+/* finds each bitstream link one at a time using a bisection search
+   (has to begin by knowing the offset of the lb's initial page).
+   Recurses for each link so it can alloc the link storage after
+   finding them all, then unroll and fill the cache at the same time */
+static int _bisect_forward_serialno(OggVorbis_File *vf,
+				    ogg_int64_t begin,
+				    ogg_int64_t searched,
+				    ogg_int64_t end,
+				    ogg_uint32_t currentno,
+				    long m){
+  ogg_int64_t endsearched=end;
+  ogg_int64_t next=end;
+  ogg_page og={0,0,0,0};
+  ogg_int64_t ret;
+  
+  /* the below guards against garbage seperating the last and
+     first pages of two links. */
+  while(searched<endsearched){
+    ogg_int64_t bisect;
+    
+    if(endsearched-searched<CHUNKSIZE){
+      bisect=searched;
+    }else{
+      bisect=(searched+endsearched)/2;
+    }
+    
+    _seek_helper(vf,bisect);
+    ret=_get_next_page(vf,&og,-1);
+    if(ret==OV_EREAD)return(OV_EREAD);
+    if(ret<0 || ogg_page_serialno(&og)!=currentno){
+      endsearched=bisect;
+      if(ret>=0)next=ret;
+    }else{
+      searched=ret+og.header_len+og.body_len;
+    }
+    ogg_page_release(&og);
+  }
+
+  _seek_helper(vf,next);
+  ret=_get_next_page(vf,&og,-1);
+  if(ret==OV_EREAD)return(OV_EREAD);
+  
+  if(searched>=end || ret<0){
+    ogg_page_release(&og);
+    vf->links=m+1;
+    vf->offsets=_ogg_malloc((vf->links+1)*sizeof(*vf->offsets));
+    vf->serialnos=_ogg_malloc(vf->links*sizeof(*vf->serialnos));
+    vf->offsets[m+1]=searched;
+  }else{
+    ret=_bisect_forward_serialno(vf,next,vf->offset,
+				 end,ogg_page_serialno(&og),m+1);
+    ogg_page_release(&og);
+    if(ret==OV_EREAD)return(OV_EREAD);
+  }
+  
+  vf->offsets[m]=begin;
+  vf->serialnos[m]=currentno;
+  return(0);
+}
+
+/* uses the local ogg_stream storage in vf; this is important for
+   non-streaming input sources */
+/* consumes the page that's passed in (if any) */
+
+static int _fetch_headers(OggVorbis_File *vf,
+			  vorbis_info *vi,
+			  vorbis_comment *vc,
+			  ogg_uint32_t *serialno,
+			  ogg_page *og_ptr){
+  ogg_page og={0,0,0,0};
+  ogg_packet op={0,0,0,0,0,0};
+  int i,ret;
+  
+  if(!og_ptr){
+    ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE);
+    if(llret==OV_EREAD)return(OV_EREAD);
+    if(llret<0)return OV_ENOTVORBIS;
+    og_ptr=&og;
+  }
+
+  ogg_stream_reset_serialno(vf->os,ogg_page_serialno(og_ptr));
+  if(serialno)*serialno=vf->os->serialno;
+  vf->ready_state=STREAMSET;
+  
+  /* extract the initial header from the first page and verify that the
+     Ogg bitstream is in fact Vorbis data */
+  
+  vorbis_info_init(vi);
+  vorbis_comment_init(vc);
+  
+  i=0;
+  while(i<3){
+    ogg_stream_pagein(vf->os,og_ptr);
+    while(i<3){
+      int result=ogg_stream_packetout(vf->os,&op);
+      if(result==0)break;
+      if(result==-1){
+	ret=OV_EBADHEADER;
+	goto bail_header;
+      }
+      if((ret=vorbis_synthesis_headerin(vi,vc,&op))){
+	goto bail_header;
+      }
+      i++;
+    }
+    if(i<3)
+      if(_get_next_page(vf,og_ptr,CHUNKSIZE)<0){
+	ret=OV_EBADHEADER;
+	goto bail_header;
+      }
+  }
+
+  ogg_packet_release(&op);
+  ogg_page_release(&og);
+  return 0; 
+
+ bail_header:
+  ogg_packet_release(&op);
+  ogg_page_release(&og);
+  vorbis_info_clear(vi);
+  vorbis_comment_clear(vc);
+  vf->ready_state=OPENED;
+
+  return ret;
+}
+
+/* last step of the OggVorbis_File initialization; get all the
+   vorbis_info structs and PCM positions.  Only called by the seekable
+   initialization (local stream storage is hacked slightly; pay
+   attention to how that's done) */
+
+/* this is void and does not propogate errors up because we want to be
+   able to open and use damaged bitstreams as well as we can.  Just
+   watch out for missing information for links in the OggVorbis_File
+   struct */
+static void _prefetch_all_headers(OggVorbis_File *vf, ogg_int64_t dataoffset){
+  ogg_page og={0,0,0,0};
+  int i;
+  ogg_int64_t ret;
+  
+  vf->vi=_ogg_realloc(vf->vi,vf->links*sizeof(*vf->vi));
+  vf->vc=_ogg_realloc(vf->vc,vf->links*sizeof(*vf->vc));
+  vf->dataoffsets=_ogg_malloc(vf->links*sizeof(*vf->dataoffsets));
+  vf->pcmlengths=_ogg_malloc(vf->links*2*sizeof(*vf->pcmlengths));
+  
+  for(i=0;i<vf->links;i++){
+    if(i==0){
+      /* we already grabbed the initial header earlier.  Just set the offset */
+      vf->dataoffsets[i]=dataoffset;
+      _seek_helper(vf,dataoffset);
+
+    }else{
+
+      /* seek to the location of the initial header */
+
+      _seek_helper(vf,vf->offsets[i]);
+      if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL,NULL)<0){
+    	vf->dataoffsets[i]=-1;
+      }else{
+	vf->dataoffsets[i]=vf->offset;
+      }
+    }
+
+    /* fetch beginning PCM offset */
+
+    if(vf->dataoffsets[i]!=-1){
+      ogg_int64_t accumulated=0,pos;
+      long        lastblock=-1;
+      int         result;
+
+      ogg_stream_reset_serialno(vf->os,vf->serialnos[i]);
+
+      while(1){
+	ogg_packet op={0,0,0,0,0,0};
+
+	ret=_get_next_page(vf,&og,-1);
+	if(ret<0)
+	  /* this should not be possible unless the file is
+             truncated/mangled */
+	  break;
+       
+	if(ogg_page_serialno(&og)!=vf->serialnos[i])
+	  break;
+	
+	pos=ogg_page_granulepos(&og);
+
+	/* count blocksizes of all frames in the page */
+	ogg_stream_pagein(vf->os,&og);
+	while((result=ogg_stream_packetout(vf->os,&op))){
+	  if(result>0){ /* ignore holes */
+	    long thisblock=vorbis_packet_blocksize(vf->vi+i,&op);
+	    if(lastblock!=-1)
+	      accumulated+=(lastblock+thisblock)>>2;
+	    lastblock=thisblock;
+	  }
+	}
+	ogg_packet_release(&op);
+
+	if(pos!=-1){
+	  /* pcm offset of last packet on the first audio page */
+	  accumulated= pos-accumulated;
+	  break;
+	}
+      }
+
+      /* less than zero?  This is a stream with samples trimmed off
+         the beginning, a normal occurrence; set the offset to zero */
+      if(accumulated<0)accumulated=0;
+
+      vf->pcmlengths[i*2]=accumulated;
+    }
+
+    /* get the PCM length of this link. To do this,
+       get the last page of the stream */
+    {
+      ogg_int64_t end=vf->offsets[i+1];
+      _seek_helper(vf,end);
+
+      while(1){
+	ret=_get_prev_page(vf,&og);
+	if(ret<0){
+	  /* this should not be possible */
+	  vorbis_info_clear(vf->vi+i);
+	  vorbis_comment_clear(vf->vc+i);
+	  break;
+	}
+	if(ogg_page_granulepos(&og)!=-1){
+	  vf->pcmlengths[i*2+1]=ogg_page_granulepos(&og)-vf->pcmlengths[i*2];
+	  break;
+	}
+	vf->offset=ret;
+      }
+    }
+  }
+  ogg_page_release(&og);
+}
+
+static void _make_decode_ready(OggVorbis_File *vf){
+  if(vf->ready_state!=STREAMSET)return;
+  if(vf->seekable){
+    vorbis_synthesis_init(&vf->vd,vf->vi+vf->current_link);
+  }else{
+    vorbis_synthesis_init(&vf->vd,vf->vi);
+  }    
+  vorbis_block_init(&vf->vd,&vf->vb);
+  vf->ready_state=INITSET;
+  vf->bittrack=0;
+  vf->samptrack=0;
+  return;
+}
+
+static int _open_seekable2(OggVorbis_File *vf){
+  ogg_uint32_t serialno=vf->current_serialno;
+  ogg_uint32_t tempserialno;
+  ogg_int64_t dataoffset=vf->offset, end;
+  ogg_page og={0,0,0,0};
+
+  /* we're partially open and have a first link header state in
+     storage in vf */
+  /* we can seek, so set out learning all about this file */
+  (vf->callbacks.seek_func)(vf->datasource,0,SEEK_END);
+  vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource);
+  
+  /* We get the offset for the last page of the physical bitstream.
+     Most OggVorbis files will contain a single logical bitstream */
+  end=_get_prev_page(vf,&og);
+  if(end<0)return(end);
+
+  /* more than one logical bitstream? */
+  tempserialno=ogg_page_serialno(&og);
+  ogg_page_release(&og);
+
+  if(tempserialno!=serialno){
+
+    /* Chained bitstream. Bisect-search each logical bitstream
+       section.  Do so based on serial number only */
+    if(_bisect_forward_serialno(vf,0,0,end+1,serialno,0)<0)return(OV_EREAD);
+
+  }else{
+
+    /* Only one logical bitstream */
+    if(_bisect_forward_serialno(vf,0,end,end+1,serialno,0))return(OV_EREAD);
+
+  }
+
+  /* the initial header memory is referenced by vf after; don't free it */
+  _prefetch_all_headers(vf,dataoffset);
+  return(ov_raw_seek(vf,0));
+}
+
+/* clear out the current logical bitstream decoder */ 
+static void _decode_clear(OggVorbis_File *vf){
+  vorbis_dsp_clear(&vf->vd);
+  vorbis_block_clear(&vf->vb);
+  vf->ready_state=OPENED;
+}
+
+/* fetch and process a packet.  Handles the case where we're at a
+   bitstream boundary and dumps the decoding machine.  If the decoding
+   machine is unloaded, it loads it.  It also keeps pcm_offset up to
+   date (seek and read both use this.  seek uses a special hack with
+   readp). 
+
+   return: <0) error, OV_HOLE (lost packet) or OV_EOF
+            0) need more data (only if readp==0)
+	    1) got a packet 
+*/
+
+static int _fetch_and_process_packet(OggVorbis_File *vf,
+				     int readp,
+				     int spanp){
+  ogg_page og={0,0,0,0};
+  ogg_packet op={0,0,0,0,0,0};
+  int ret=0;
+
+  /* handle one packet.  Try to fetch it from current stream state */
+  /* extract packets from page */
+  while(1){
+    
+    /* process a packet if we can.  If the machine isn't loaded,
+       neither is a page */
+    if(vf->ready_state==INITSET){
+      while(1) {
+	int result=ogg_stream_packetout(vf->os,&op);
+	ogg_int64_t granulepos;
+
+	if(result<0){
+	  ret=OV_HOLE; /* hole in the data. */
+	  goto cleanup;
+	}
+	if(result>0){
+	  /* got a packet.  process it */
+	  granulepos=op.granulepos;
+	  if(!vorbis_synthesis(&vf->vb,&op,1)){ /* lazy check for lazy
+						      header handling.  The
+						      header packets aren't
+						      audio, so if/when we
+						      submit them,
+						      vorbis_synthesis will
+						      reject them */
+
+	    /* suck in the synthesis data and track bitrate */
+	    {
+	      int oldsamples=vorbis_synthesis_pcmout(&vf->vd,NULL);
+	      /* for proper use of libvorbis within libvorbisfile,
+                 oldsamples will always be zero. */
+	      if(oldsamples){
+		ret=OV_EFAULT;
+		goto cleanup;
+	      }
+
+	      vorbis_synthesis_blockin(&vf->vd,&vf->vb);
+	      vf->samptrack+=vorbis_synthesis_pcmout(&vf->vd,NULL)-oldsamples;
+	      vf->bittrack+=op.bytes*8;
+	    }
+	  
+	    /* update the pcm offset. */
+	    if(granulepos!=-1 && !op.e_o_s){
+	      int link=(vf->seekable?vf->current_link:0);
+	      int i,samples;
+	    
+	      /* this packet has a pcm_offset on it (the last packet
+	         completed on a page carries the offset) After processing
+	         (above), we know the pcm position of the *last* sample
+	         ready to be returned. Find the offset of the *first*
+
+	         As an aside, this trick is inaccurate if we begin
+	         reading anew right at the last page; the end-of-stream
+	         granulepos declares the last frame in the stream, and the
+	         last packet of the last page may be a partial frame.
+	         So, we need a previous granulepos from an in-sequence page
+	         to have a reference point.  Thus the !op.e_o_s clause
+	         above */
+
+	      if(vf->seekable && link>0)
+		granulepos-=vf->pcmlengths[link*2];
+	      if(granulepos<0)granulepos=0; /* actually, this
+					       shouldn't be possible
+					       here unless the stream
+					       is very broken */
+
+	      samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
+	    
+	      granulepos-=samples;
+	      for(i=0;i<link;i++)
+	        granulepos+=vf->pcmlengths[i*2+1];
+	      vf->pcm_offset=granulepos;
+	    }
+	    ret=1;
+	    goto cleanup;
+	  }
+	}
+	else 
+	  break;
+      }
+    }
+
+    if(vf->ready_state>=OPENED){
+      int ret;
+      if(!readp){
+	ret=0;
+	goto cleanup;
+      }
+      if((ret=_get_next_page(vf,&og,-1))<0){
+	ret=OV_EOF; /* eof. leave unitialized */
+	goto cleanup;
+      }
+
+	/* bitrate tracking; add the header's bytes here, the body bytes
+	   are done by packet above */
+      vf->bittrack+=og.header_len*8;
+      
+      /* has our decoding just traversed a bitstream boundary? */
+      if(vf->ready_state==INITSET){
+	if(vf->current_serialno!=ogg_page_serialno(&og)){
+	  if(!spanp){
+	    ret=OV_EOF;
+	    goto cleanup;
+	  }
+
+	  _decode_clear(vf);
+	  
+	  if(!vf->seekable){
+	    vorbis_info_clear(vf->vi);
+	    vorbis_comment_clear(vf->vc);
+	  }
+	}
+      }
+    }
+
+    /* Do we need to load a new machine before submitting the page? */
+    /* This is different in the seekable and non-seekable cases.  
+
+       In the seekable case, we already have all the header
+       information loaded and cached; we just initialize the machine
+       with it and continue on our merry way.
+
+       In the non-seekable (streaming) case, we'll only be at a
+       boundary if we just left the previous logical bitstream and
+       we're now nominally at the header of the next bitstream
+    */
+
+    if(vf->ready_state!=INITSET){ 
+      int link;
+
+      if(vf->ready_state<STREAMSET){
+	if(vf->seekable){
+	  vf->current_serialno=ogg_page_serialno(&og);
+	  
+	  /* match the serialno to bitstream section.  We use this rather than
+	     offset positions to avoid problems near logical bitstream
+	     boundaries */
+	  for(link=0;link<vf->links;link++)
+	    if(vf->serialnos[link]==vf->current_serialno)break;
+	  if(link==vf->links){
+	    ret=OV_EBADLINK; /* sign of a bogus stream.  error out,
+				leave machine uninitialized */
+	    goto cleanup;
+	  }
+	  
+	  vf->current_link=link;
+	  
+	  ogg_stream_reset_serialno(vf->os,vf->current_serialno);
+	  vf->ready_state=STREAMSET;
+	  
+	}else{
+	  /* we're streaming */
+	  /* fetch the three header packets, build the info struct */
+	  
+	  int ret=_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,&og);
+	  if(ret) goto cleanup;
+	  vf->current_link++;
+	  link=0;
+	}
+      }
+      
+      _make_decode_ready(vf);
+    }
+    ogg_stream_pagein(vf->os,&og);
+  }
+ cleanup:
+  ogg_packet_release(&op);
+  ogg_page_release(&og);
+  return ret;
+}
+
+/* if, eg, 64 bit stdio is configured by default, this will build with
+   fseek64 */
+static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
+  if(f==NULL)return(-1);
+  return fseek(f,off,whence);
+}
+
+static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
+		     long ibytes, ov_callbacks callbacks){
+  int offsettest=(f?callbacks.seek_func(f,0,SEEK_CUR):-1);
+  int ret;
+
+  memset(vf,0,sizeof(*vf));
+  vf->datasource=f;
+  vf->callbacks = callbacks;
+
+  /* init the framing state */
+  vf->oy=ogg_sync_create();
+
+  /* perhaps some data was previously read into a buffer for testing
+     against other stream types.  Allow initialization from this
+     previously read data (as we may be reading from a non-seekable
+     stream) */
+  if(initial){
+    unsigned char *buffer=ogg_sync_bufferin(vf->oy,ibytes);
+    memcpy(buffer,initial,ibytes);
+    ogg_sync_wrote(vf->oy,ibytes);
+  }
+
+  /* can we seek? Stevens suggests the seek test was portable */
+  if(offsettest!=-1)vf->seekable=1;
+
+  /* No seeking yet; Set up a 'single' (current) logical bitstream
+     entry for partial open */
+  vf->links=1;
+  vf->vi=_ogg_calloc(vf->links,sizeof(*vf->vi));
+  vf->vc=_ogg_calloc(vf->links,sizeof(*vf->vc));
+  vf->os=ogg_stream_create(-1); /* fill in the serialno later */
+
+  /* Try to fetch the headers, maintaining all the storage */
+  if((ret=_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,NULL))<0){
+    vf->datasource=NULL;
+    ov_clear(vf);
+  }else if(vf->ready_state < PARTOPEN)
+    vf->ready_state=PARTOPEN;
+  return(ret);
+}
+
+static int _ov_open2(OggVorbis_File *vf){
+  if(vf->ready_state < OPENED)
+    vf->ready_state=OPENED;
+  if(vf->seekable){
+    int ret=_open_seekable2(vf);
+    if(ret){
+      vf->datasource=NULL;
+      ov_clear(vf);
+    }
+    return(ret);
+  }
+  return 0;
+}
+
+
+/* clear out the OggVorbis_File struct */
+int ov_clear(OggVorbis_File *vf){
+  if(vf){
+    vorbis_block_clear(&vf->vb);
+    vorbis_dsp_clear(&vf->vd);
+    ogg_stream_destroy(vf->os);
+    
+    if(vf->vi && vf->links){
+      int i;
+      for(i=0;i<vf->links;i++){
+	vorbis_info_clear(vf->vi+i);
+	vorbis_comment_clear(vf->vc+i);
+      }
+      _ogg_free(vf->vi);
+      _ogg_free(vf->vc);
+    }
+    if(vf->dataoffsets)_ogg_free(vf->dataoffsets);
+    if(vf->pcmlengths)_ogg_free(vf->pcmlengths);
+    if(vf->serialnos)_ogg_free(vf->serialnos);
+    if(vf->offsets)_ogg_free(vf->offsets);
+    ogg_sync_destroy(vf->oy);
+
+    if(vf->datasource && vf->callbacks.close_func)
+      (vf->callbacks.close_func)(vf->datasource);
+    memset(vf,0,sizeof(*vf));
+  }
+#ifdef DEBUG_LEAKS
+  _VDBG_dump();
+#endif
+  return(0);
+}
+
+/* inspects the OggVorbis file and finds/documents all the logical
+   bitstreams contained in it.  Tries to be tolerant of logical
+   bitstream sections that are truncated/woogie. 
+
+   return: -1) error
+            0) OK
+*/
+
+int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
+    ov_callbacks callbacks){
+  int ret=_ov_open1(f,vf,initial,ibytes,callbacks);
+  if(ret)return ret;
+  return _ov_open2(vf);
+}
+
+int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
+  ov_callbacks callbacks = {
+    (size_t (*)(void *, size_t, size_t, void *))  fread,
+    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
+    (int (*)(void *))                             fclose,
+    (long (*)(void *))                            ftell
+  };
+
+  return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
+}
+  
+/* Only partially open the vorbis file; test for Vorbisness, and load
+   the headers for the first chain.  Do not seek (although test for
+   seekability).  Use ov_test_open to finish opening the file, else
+   ov_clear to close/free it. Same return codes as open. */
+
+int ov_test_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
+    ov_callbacks callbacks)
+{
+  return _ov_open1(f,vf,initial,ibytes,callbacks);
+}
+
+int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
+  ov_callbacks callbacks = {
+    (size_t (*)(void *, size_t, size_t, void *))  fread,
+    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
+    (int (*)(void *))                             fclose,
+    (long (*)(void *))                            ftell
+  };
+
+  return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
+}
+  
+int ov_test_open(OggVorbis_File *vf){
+  if(vf->ready_state!=PARTOPEN)return(OV_EINVAL);
+  return _ov_open2(vf);
+}
+
+/* How many logical bitstreams in this physical bitstream? */
+long ov_streams(OggVorbis_File *vf){
+  return vf->links;
+}
+
+/* Is the FILE * associated with vf seekable? */
+long ov_seekable(OggVorbis_File *vf){
+  return vf->seekable;
+}
+
+/* returns the bitrate for a given logical bitstream or the entire
+   physical bitstream.  If the file is open for random access, it will
+   find the *actual* average bitrate.  If the file is streaming, it
+   returns the nominal bitrate (if set) else the average of the
+   upper/lower bounds (if set) else -1 (unset).
+
+   If you want the actual bitrate field settings, get them from the
+   vorbis_info structs */
+
+long ov_bitrate(OggVorbis_File *vf,int i){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(i>=vf->links)return(OV_EINVAL);
+  if(!vf->seekable && i!=0)return(ov_bitrate(vf,0));
+  if(i<0){
+    ogg_int64_t bits=0;
+    int i;
+    for(i=0;i<vf->links;i++)
+      bits+=(vf->offsets[i+1]-vf->dataoffsets[i])*8;
+    /* This once read: return(rint(bits/ov_time_total(vf,-1)));
+     * gcc 3.x on x86 miscompiled this at optimisation level 2 and above,
+     * so this is slightly transformed to make it work.
+     */
+    return(bits*1000/ov_time_total(vf,-1));
+  }else{
+    if(vf->seekable){
+      /* return the actual bitrate */
+      return((vf->offsets[i+1]-vf->dataoffsets[i])*8000/ov_time_total(vf,i));
+    }else{
+      /* return nominal if set */
+      if(vf->vi[i].bitrate_nominal>0){
+	return vf->vi[i].bitrate_nominal;
+      }else{
+	if(vf->vi[i].bitrate_upper>0){
+	  if(vf->vi[i].bitrate_lower>0){
+	    return (vf->vi[i].bitrate_upper+vf->vi[i].bitrate_lower)/2;
+	  }else{
+	    return vf->vi[i].bitrate_upper;
+	  }
+	}
+	return(OV_FALSE);
+      }
+    }
+  }
+}
+
+/* returns the actual bitrate since last call.  returns -1 if no
+   additional data to offer since last call (or at beginning of stream),
+   EINVAL if stream is only partially open 
+*/
+long ov_bitrate_instant(OggVorbis_File *vf){
+  int link=(vf->seekable?vf->current_link:0);
+  long ret;
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(vf->samptrack==0)return(OV_FALSE);
+  ret=vf->bittrack/vf->samptrack*vf->vi[link].rate;
+  vf->bittrack=0;
+  vf->samptrack=0;
+  return(ret);
+}
+
+/* Guess */
+long ov_serialnumber(OggVorbis_File *vf,int i){
+  if(i>=vf->links)return(ov_serialnumber(vf,vf->links-1));
+  if(!vf->seekable && i>=0)return(ov_serialnumber(vf,-1));
+  if(i<0){
+    return(vf->current_serialno);
+  }else{
+    return(vf->serialnos[i]);
+  }
+}
+
+/* returns: total raw (compressed) length of content if i==-1
+            raw (compressed) length of that logical bitstream for i==0 to n
+	    OV_EINVAL if the stream is not seekable (we can't know the length)
+	    or if stream is only partially open
+*/
+ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
+  if(i<0){
+    ogg_int64_t acc=0;
+    int i;
+    for(i=0;i<vf->links;i++)
+      acc+=ov_raw_total(vf,i);
+    return(acc);
+  }else{
+    return(vf->offsets[i+1]-vf->offsets[i]);
+  }
+}
+
+/* returns: total PCM length (samples) of content if i==-1 PCM length
+	    (samples) of that logical bitstream for i==0 to n
+	    OV_EINVAL if the stream is not seekable (we can't know the
+	    length) or only partially open 
+*/
+ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
+  if(i<0){
+    ogg_int64_t acc=0;
+    int i;
+    for(i=0;i<vf->links;i++)
+      acc+=ov_pcm_total(vf,i);
+    return(acc);
+  }else{
+    return(vf->pcmlengths[i*2+1]);
+  }
+}
+
+/* returns: total milliseconds of content if i==-1
+            milliseconds in that logical bitstream for i==0 to n
+	    OV_EINVAL if the stream is not seekable (we can't know the
+	    length) or only partially open 
+*/
+ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
+  if(i<0){
+    ogg_int64_t acc=0;
+    int i;
+    for(i=0;i<vf->links;i++)
+      acc+=ov_time_total(vf,i);
+    return(acc);
+  }else{
+    return(((ogg_int64_t)vf->pcmlengths[i*2+1])*1000/vf->vi[i].rate);
+  }
+}
+
+/* seek to an offset relative to the *compressed* data. This also
+   scans packets to update the PCM cursor. It will cross a logical
+   bitstream boundary, but only if it can't get any packets out of the
+   tail of the bitstream we seek to (so no surprises).
+
+   returns zero on success, nonzero on failure */
+
+int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
+  ogg_stream_state *work_os=NULL;
+  ogg_page og={0,0,0,0};
+  ogg_packet op={0,0,0,0,0,0};
+  
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable)
+    return(OV_ENOSEEK); /* don't dump machine if we can't seek */
+
+  if(pos<0 || pos>vf->end)return(OV_EINVAL);
+
+  /* don't yet clear out decoding machine (if it's initialized), in
+     the case we're in the same link.  Restart the decode lapping, and
+     let _fetch_and_process_packet deal with a potential bitstream
+     boundary */
+  vf->pcm_offset=-1;
+  ogg_stream_reset_serialno(vf->os,
+			    vf->current_serialno); /* must set serialno */
+  vorbis_synthesis_restart(&vf->vd);
+    
+  _seek_helper(vf,pos);
+
+  /* we need to make sure the pcm_offset is set, but we don't want to
+     advance the raw cursor past good packets just to get to the first
+     with a granulepos.  That's not equivalent behavior to beginning
+     decoding as immediately after the seek position as possible.
+
+     So, a hack.  We use two stream states; a local scratch state and
+     the shared vf->os stream state.  We use the local state to
+     scan, and the shared state as a buffer for later decode. 
+
+     Unfortuantely, on the last page we still advance to last packet
+     because the granulepos on the last page is not necessarily on a
+     packet boundary, and we need to make sure the granpos is
+     correct. 
+  */
+
+  {
+    int lastblock=0;
+    int accblock=0;
+    int thisblock;
+    int eosflag=0;
+
+    work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */
+    while(1){
+      if(vf->ready_state>=STREAMSET){
+	/* snarf/scan a packet if we can */
+	int result=ogg_stream_packetout(work_os,&op);
+      
+	if(result>0){
+
+	  if(vf->vi[vf->current_link].codec_setup){
+	    thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
+	    if(thisblock<0){
+	      ogg_stream_packetout(vf->os,NULL);
+	      thisblock=0;
+	    }else{
+	      
+	      if(eosflag)
+		ogg_stream_packetout(vf->os,NULL);
+	      else
+		if(lastblock)accblock+=(lastblock+thisblock)>>2;
+	    }	    
+
+	    if(op.granulepos!=-1){
+	      int i,link=vf->current_link;
+	      ogg_int64_t granulepos=op.granulepos-vf->pcmlengths[link*2];
+	      if(granulepos<0)granulepos=0;
+	      
+	      for(i=0;i<link;i++)
+		granulepos+=vf->pcmlengths[i*2+1];
+	      vf->pcm_offset=granulepos-accblock;
+	      break;
+	    }
+	    lastblock=thisblock;
+	    continue;
+	  }else
+	    ogg_stream_packetout(vf->os,NULL);
+	}
+      }
+      
+      if(!lastblock){
+	if(_get_next_page(vf,&og,-1)<0){
+	  vf->pcm_offset=ov_pcm_total(vf,-1);
+	  break;
+	}
+      }else{
+	/* huh?  Bogus stream with packets but no granulepos */
+	vf->pcm_offset=-1;
+	break;
+      }
+      
+      /* has our decoding just traversed a bitstream boundary? */
+      if(vf->ready_state>=STREAMSET)
+	if(vf->current_serialno!=ogg_page_serialno(&og)){
+	  _decode_clear(vf); /* clear out stream state */
+	  ogg_stream_destroy(work_os);
+	}
+
+      if(vf->ready_state<STREAMSET){
+	int link;
+	
+	vf->current_serialno=ogg_page_serialno(&og);
+	for(link=0;link<vf->links;link++)
+	  if(vf->serialnos[link]==vf->current_serialno)break;
+	if(link==vf->links)
+	  goto seek_error; /* sign of a bogus stream.  error out,
+			      leave machine uninitialized */
+ 
+	vf->current_link=link;
+	
+	ogg_stream_reset_serialno(vf->os,vf->current_serialno);
+	ogg_stream_reset_serialno(work_os,vf->current_serialno); 
+	vf->ready_state=STREAMSET;
+	
+      }
+    
+      {
+	ogg_page dup;
+	ogg_page_dup(&dup,&og);
+	eosflag=ogg_page_eos(&og);
+	ogg_stream_pagein(vf->os,&og);
+	ogg_stream_pagein(work_os,&dup);
+      }
+    }
+  }
+
+  ogg_packet_release(&op);
+  ogg_page_release(&og);
+  ogg_stream_destroy(work_os);
+  vf->bittrack=0;
+  vf->samptrack=0;
+  return(0);
+
+ seek_error:
+  ogg_packet_release(&op);
+  ogg_page_release(&og);
+
+  /* dump the machine so we're in a known state */
+  vf->pcm_offset=-1;
+  ogg_stream_destroy(work_os);
+  _decode_clear(vf);
+  return OV_EBADLINK;
+}
+
+/* Page granularity seek (faster than sample granularity because we
+   don't do the last bit of decode to find a specific sample).
+
+   Seek to the last [granule marked] page preceeding the specified pos
+   location, such that decoding past the returned point will quickly
+   arrive at the requested position. */
+int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
+  int link=-1;
+  ogg_int64_t result=0;
+  ogg_int64_t total=ov_pcm_total(vf,-1);
+  ogg_page og={0,0,0,0};
+  ogg_packet op={0,0,0,0,0,0};
+
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable)return(OV_ENOSEEK);
+  if(pos<0 || pos>total)return(OV_EINVAL);
+ 
+  /* which bitstream section does this pcm offset occur in? */
+  for(link=vf->links-1;link>=0;link--){
+    total-=vf->pcmlengths[link*2+1];
+    if(pos>=total)break;
+  }
+
+  /* search within the logical bitstream for the page with the highest
+     pcm_pos preceeding (or equal to) pos.  There is a danger here;
+     missing pages or incorrect frame number information in the
+     bitstream could make our task impossible.  Account for that (it
+     would be an error condition) */
+
+  /* new search algorithm by HB (Nicholas Vinen) */
+  {
+    ogg_int64_t end=vf->offsets[link+1];
+    ogg_int64_t begin=vf->offsets[link];
+    ogg_int64_t begintime = vf->pcmlengths[link*2];
+    ogg_int64_t endtime = vf->pcmlengths[link*2+1]+begintime;
+    ogg_int64_t target=pos-total+begintime;
+    ogg_int64_t best=begin;
+    
+    while(begin<end){
+      ogg_int64_t bisect;
+      
+      if(end-begin<CHUNKSIZE){
+	bisect=begin;
+      }else{
+	/* take a (pretty decent) guess. */
+	bisect=begin + 
+	  (target-begintime)*(end-begin)/(endtime-begintime) - CHUNKSIZE;
+	if(bisect<=begin)
+	  bisect=begin+1;
+      }
+      
+      _seek_helper(vf,bisect);
+    
+      while(begin<end){
+	result=_get_next_page(vf,&og,end-vf->offset);
+	if(result==OV_EREAD) goto seek_error;
+	if(result<0){
+	  if(bisect<=begin+1)
+	    end=begin; /* found it */
+	  else{
+	    if(bisect==0) goto seek_error;
+	    bisect-=CHUNKSIZE;
+	    if(bisect<=begin)bisect=begin+1;
+	    _seek_helper(vf,bisect);
+	  }
+	}else{
+	  ogg_int64_t granulepos=ogg_page_granulepos(&og);
+	  if(granulepos==-1)continue;
+	  if(granulepos<target){
+	    best=result;  /* raw offset of packet with granulepos */ 
+	    begin=vf->offset; /* raw offset of next page */
+	    begintime=granulepos;
+	    
+	    if(target-begintime>44100)break;
+	    bisect=begin; /* *not* begin + 1 */
+	  }else{
+	    if(bisect<=begin+1)
+	      end=begin;  /* found it */
+	    else{
+	      if(end==vf->offset){ /* we're pretty close - we'd be stuck in */
+		end=result;
+		bisect-=CHUNKSIZE; /* an endless loop otherwise. */
+		if(bisect<=begin)bisect=begin+1;
+		_seek_helper(vf,bisect);
+	      }else{
+		end=result;
+		endtime=granulepos;
+		break;
+	      }
+	    }
+	  }
+	}
+      }
+    }
+
+    /* found our page. seek to it, update pcm offset. Easier case than
+       raw_seek, don't keep packets preceeding granulepos. */
+    {
+      
+      /* seek */
+      _seek_helper(vf,best);
+      vf->pcm_offset=-1;
+      
+      if(_get_next_page(vf,&og,-1)<0){
+	ogg_page_release(&og);
+	return(OV_EOF); /* shouldn't happen */
+      }
+
+      if(link!=vf->current_link){
+	/* Different link; dump entire decode machine */
+	_decode_clear(vf);  
+	
+	vf->current_link=link;
+	vf->current_serialno=ogg_page_serialno(&og);
+	vf->ready_state=STREAMSET;
+	
+      }else{
+	vorbis_synthesis_restart(&vf->vd);
+      }
+
+      ogg_stream_reset_serialno(vf->os,vf->current_serialno);
+      ogg_stream_pagein(vf->os,&og);
+
+      /* pull out all but last packet; the one with granulepos */
+      while(1){
+	result=ogg_stream_packetpeek(vf->os,&op);
+	if(result==0){
+	  /* !!! the packet finishing this page originated on a
+             preceeding page. Keep fetching previous pages until we
+             get one with a granulepos or without the 'continued' flag
+             set.  Then just use raw_seek for simplicity. */
+	  
+	  _seek_helper(vf,best);
+	  
+	  while(1){
+	    result=_get_prev_page(vf,&og);
+	    if(result<0) goto seek_error;
+	    if(ogg_page_granulepos(&og)>-1 ||
+	       !ogg_page_continued(&og)){
+	      return ov_raw_seek(vf,result);
+	    }
+	    vf->offset=result;
+	  }
+	}
+	if(result<0){
+	  result = OV_EBADPACKET; 
+	  goto seek_error;
+	}
+	if(op.granulepos!=-1){
+	  vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
+	  if(vf->pcm_offset<0)vf->pcm_offset=0;
+	  vf->pcm_offset+=total;
+	  break;
+	}else
+	  result=ogg_stream_packetout(vf->os,NULL);
+      }
+    }
+  }
+  
+  /* verify result */
+  if(vf->pcm_offset>pos || pos>ov_pcm_total(vf,-1)){
+    result=OV_EFAULT;
+    goto seek_error;
+  }
+  vf->bittrack=0;
+  vf->samptrack=0;
+
+  ogg_page_release(&og);
+  ogg_packet_release(&op);
+  return(0);
+  
+ seek_error:
+
+  ogg_page_release(&og);
+  ogg_packet_release(&op);
+
+  /* dump machine so we're in a known state */
+  vf->pcm_offset=-1;
+  _decode_clear(vf);
+  return (int)result;
+}
+
+/* seek to a sample offset relative to the decompressed pcm stream 
+   returns zero on success, nonzero on failure */
+
+int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
+  ogg_packet op={0,0,0,0,0,0};
+  ogg_page og={0,0,0,0};
+  int thisblock,lastblock=0;
+  int ret=ov_pcm_seek_page(vf,pos);
+  if(ret<0)return(ret);
+  _make_decode_ready(vf);
+
+  /* discard leading packets we don't need for the lapping of the
+     position we want; don't decode them */
+
+  while(1){
+
+    int ret=ogg_stream_packetpeek(vf->os,&op);
+    if(ret>0){
+      thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
+      if(thisblock<0){
+	ogg_stream_packetout(vf->os,NULL);
+	continue; /* non audio packet */
+      }
+      if(lastblock)vf->pcm_offset+=(lastblock+thisblock)>>2;
+      
+      if(vf->pcm_offset+((thisblock+
+			  vorbis_info_blocksize(vf->vi,1))>>2)>=pos)break;
+      
+      /* remove the packet from packet queue and track its granulepos */
+      ogg_stream_packetout(vf->os,NULL);
+      vorbis_synthesis(&vf->vb,&op,0);  /* set up a vb with
+					   only tracking, no
+					   pcm_decode */
+      vorbis_synthesis_blockin(&vf->vd,&vf->vb); 
+      
+      /* end of logical stream case is hard, especially with exact
+	 length positioning. */
+      
+      if(op.granulepos>-1){
+	int i;
+	/* always believe the stream markers */
+	vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
+	if(vf->pcm_offset<0)vf->pcm_offset=0;
+	for(i=0;i<vf->current_link;i++)
+	  vf->pcm_offset+=vf->pcmlengths[i*2+1];
+      }
+	
+      lastblock=thisblock;
+      
+    }else{
+      if(ret<0 && ret!=OV_HOLE)break;
+      
+      /* suck in a new page */
+      if(_get_next_page(vf,&og,-1)<0)break;
+      if(vf->current_serialno!=ogg_page_serialno(&og))_decode_clear(vf);
+      
+      if(vf->ready_state<STREAMSET){
+	int link;
+	
+	vf->current_serialno=ogg_page_serialno(&og);
+	for(link=0;link<vf->links;link++)
+	  if(vf->serialnos[link]==vf->current_serialno)break;
+	if(link==vf->links){
+	  ogg_page_release(&og);
+	  ogg_packet_release(&op);
+	  return(OV_EBADLINK);
+	}
+	vf->current_link=link;
+	
+	ogg_stream_reset_serialno(vf->os,vf->current_serialno); 
+	vf->ready_state=STREAMSET;      
+	_make_decode_ready(vf);
+	lastblock=0;
+      }
+
+      ogg_stream_pagein(vf->os,&og);
+    }
+  }
+
+  vf->bittrack=0;
+  vf->samptrack=0;
+  /* discard samples until we reach the desired position. Crossing a
+     logical bitstream boundary with abandon is OK. */
+  while(vf->pcm_offset<pos){
+    ogg_int64_t target=pos-vf->pcm_offset;
+    long samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
+
+    if(samples>target)samples=target;
+    vorbis_synthesis_read(&vf->vd,samples);
+    vf->pcm_offset+=samples;
+    
+    if(samples<target)
+      if(_fetch_and_process_packet(vf,1,1)<=0)
+	vf->pcm_offset=ov_pcm_total(vf,-1); /* eof */
+  }
+
+  ogg_page_release(&og);
+  ogg_packet_release(&op);
+  return 0;
+}
+
+/* seek to a playback time relative to the decompressed pcm stream 
+   returns zero on success, nonzero on failure */
+int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
+  /* translate time to PCM position and call ov_pcm_seek */
+
+  int link=-1;
+  ogg_int64_t pcm_total=ov_pcm_total(vf,-1);
+  ogg_int64_t time_total=ov_time_total(vf,-1);
+
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable)return(OV_ENOSEEK);
+  if(milliseconds<0 || milliseconds>time_total)return(OV_EINVAL);
+  
+  /* which bitstream section does this time offset occur in? */
+  for(link=vf->links-1;link>=0;link--){
+    pcm_total-=vf->pcmlengths[link*2+1];
+    time_total-=ov_time_total(vf,link);
+    if(milliseconds>=time_total)break;
+  }
+
+  /* enough information to convert time offset to pcm offset */
+  {
+    ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000;
+    return(ov_pcm_seek(vf,target));
+  }
+}
+
+/* page-granularity version of ov_time_seek 
+   returns zero on success, nonzero on failure */
+int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
+  /* translate time to PCM position and call ov_pcm_seek */
+
+  int link=-1;
+  ogg_int64_t pcm_total=ov_pcm_total(vf,-1);
+  ogg_int64_t time_total=ov_time_total(vf,-1);
+
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(!vf->seekable)return(OV_ENOSEEK);
+  if(milliseconds<0 || milliseconds>time_total)return(OV_EINVAL);
+  
+  /* which bitstream section does this time offset occur in? */
+  for(link=vf->links-1;link>=0;link--){
+    pcm_total-=vf->pcmlengths[link*2+1];
+    time_total-=ov_time_total(vf,link);
+    if(milliseconds>=time_total)break;
+  }
+
+  /* enough information to convert time offset to pcm offset */
+  {
+    ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000;
+    return(ov_pcm_seek_page(vf,target));
+  }
+}
+
+/* tell the current stream offset cursor.  Note that seek followed by
+   tell will likely not give the set offset due to caching */
+ogg_int64_t ov_raw_tell(OggVorbis_File *vf){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  return(vf->offset);
+}
+
+/* return PCM offset (sample) of next PCM sample to be read */
+ogg_int64_t ov_pcm_tell(OggVorbis_File *vf){
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  return(vf->pcm_offset);
+}
+
+/* return time offset (milliseconds) of next PCM sample to be read */
+ogg_int64_t ov_time_tell(OggVorbis_File *vf){
+  int link=0;
+  ogg_int64_t pcm_total=0;
+  ogg_int64_t time_total=0;
+  
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+  if(vf->seekable){
+    pcm_total=ov_pcm_total(vf,-1);
+    time_total=ov_time_total(vf,-1);
+  
+    /* which bitstream section does this time offset occur in? */
+    for(link=vf->links-1;link>=0;link--){
+      pcm_total-=vf->pcmlengths[link*2+1];
+      time_total-=ov_time_total(vf,link);
+      if(vf->pcm_offset>=pcm_total)break;
+    }
+  }
+
+  return(time_total+(1000*vf->pcm_offset-pcm_total)/vf->vi[link].rate);
+}
+
+/*  link:   -1) return the vorbis_info struct for the bitstream section
+                currently being decoded
+           0-n) to request information for a specific bitstream section
+    
+    In the case of a non-seekable bitstream, any call returns the
+    current bitstream.  NULL in the case that the machine is not
+    initialized */
+
+vorbis_info *ov_info(OggVorbis_File *vf,int link){
+  if(vf->seekable){
+    if(link<0)
+      if(vf->ready_state>=STREAMSET)
+	return vf->vi+vf->current_link;
+      else
+      return vf->vi;
+    else
+      if(link>=vf->links)
+	return NULL;
+      else
+	return vf->vi+link;
+  }else{
+    return vf->vi;
+  }
+}
+
+/* grr, strong typing, grr, no templates/inheritence, grr */
+vorbis_comment *ov_comment(OggVorbis_File *vf,int link){
+  if(vf->seekable){
+    if(link<0)
+      if(vf->ready_state>=STREAMSET)
+	return vf->vc+vf->current_link;
+      else
+	return vf->vc;
+    else
+      if(link>=vf->links)
+	return NULL;
+      else
+	return vf->vc+link;
+  }else{
+    return vf->vc;
+  }
+}
+
+/* up to this point, everything could more or less hide the multiple
+   logical bitstream nature of chaining from the toplevel application
+   if the toplevel application didn't particularly care.  However, at
+   the point that we actually read audio back, the multiple-section
+   nature must surface: Multiple bitstream sections do not necessarily
+   have to have the same number of channels or sampling rate.
+
+   ov_read returns the sequential logical bitstream number currently
+   being decoded along with the PCM data in order that the toplevel
+   application can take action on channel/sample rate changes.  This
+   number will be incremented even for streamed (non-seekable) streams
+   (for seekable streams, it represents the actual logical bitstream
+   index within the physical bitstream.  Note that the accessor
+   functions above are aware of this dichotomy).
+
+   input values: buffer) a buffer to hold packed PCM data for return
+		 length) the byte length requested to be placed into buffer
+
+   return values: <0) error/hole in data (OV_HOLE), partial open (OV_EINVAL)
+                   0) EOF
+		   n) number of bytes of PCM actually returned.  The
+		   below works on a packet-by-packet basis, so the
+		   return length is not related to the 'length' passed
+		   in, just guaranteed to fit.
+
+	    *section) set to the logical bitstream number */
+
+long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){
+  int i,j;
+
+  ogg_int32_t **pcm;
+  long samples;
+
+  if(vf->ready_state<OPENED)return(OV_EINVAL);
+
+  while(1){
+    if(vf->ready_state==INITSET){
+      samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
+      if(samples)break;
+    }
+
+    /* suck in another packet */
+    {
+      int ret=_fetch_and_process_packet(vf,1,1);
+      if(ret==OV_EOF)
+	return(0);
+      if(ret<=0)
+	return(ret);
+    }
+
+  }
+
+  if(samples>0){
+  
+    /* yay! proceed to pack data into the byte buffer */
+    
+    long channels=ov_info(vf,-1)->channels;
+
+    if(samples>(bytes_req/(2*channels)))
+      samples=bytes_req/(2*channels);      
+    
+    for(i=0;i<channels;i++) { /* It's faster in this order */
+      ogg_int32_t *src=pcm[i];
+      short *dest=((short *)buffer)+i;
+      for(j=0;j<samples;j++) {
+        *dest=CLIP_TO_15(src[j]>>9);
+        dest+=channels;
+      }
+    }
+    
+    vorbis_synthesis_read(&vf->vd,samples);
+    vf->pcm_offset+=samples;
+    if(bitstream)*bitstream=vf->current_link;
+    return(samples*2*channels);
+  }else{
+    return(samples);
+  }
+}
diff --git a/misc/libtremor/window_lookup.h b/misc/libtremor/tremor/window_lookup.h
similarity index 100%
rename from misc/libtremor/window_lookup.h
rename to misc/libtremor/tremor/window_lookup.h
diff --git a/misc/libtremor/vorbisfile.c b/misc/libtremor/vorbisfile.c
deleted file mode 100644
index 0c48f1f..0000000
--- a/misc/libtremor/vorbisfile.c
+++ /dev/null
@@ -1,1586 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.6 2003/03/30 23:40:56 xiphmont Exp $
-
- ********************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <math.h>
-
-#include "ivorbiscodec.h"
-#include "ivorbisfile.h"
-
-#include "misc.h"
-
-/* A 'chained bitstream' is a Vorbis bitstream that contains more than
-   one logical bitstream arranged end to end (the only form of Ogg
-   multiplexing allowed in a Vorbis bitstream; grouping [parallel
-   multiplexing] is not allowed in Vorbis) */
-
-/* A Vorbis file can be played beginning to end (streamed) without
-   worrying ahead of time about chaining (see decoder_example.c).  If
-   we have the whole file, however, and want random access
-   (seeking/scrubbing) or desire to know the total length/time of a
-   file, we need to account for the possibility of chaining. */
-
-/* We can handle things a number of ways; we can determine the entire
-   bitstream structure right off the bat, or find pieces on demand.
-   This example determines and caches structure for the entire
-   bitstream, but builds a virtual decoder on the fly when moving
-   between links in the chain. */
-
-/* There are also different ways to implement seeking.  Enough
-   information exists in an Ogg bitstream to seek to
-   sample-granularity positions in the output.  Or, one can seek by
-   picking some portion of the stream roughly in the desired area if
-   we only want coarse navigation through the stream. */
-
-/*************************************************************************
- * Many, many internal helpers.  The intention is not to be confusing; 
- * rampant duplication and monolithic function implementation would be 
- * harder to understand anyway.  The high level functions are last.  Begin
- * grokking near the end of the file */
-
-
-/* read a little more data from the file/pipe into the ogg_sync framer */
-static long _get_data(OggVorbis_File *vf){
-  errno=0;
-  if(vf->datasource){
-    unsigned char *buffer=ogg_sync_bufferin(vf->oy,CHUNKSIZE);
-    long bytes=(vf->callbacks.read_func)(buffer,1,CHUNKSIZE,vf->datasource);
-    if(bytes>0)ogg_sync_wrote(vf->oy,bytes);
-    if(bytes==0 && errno)return(-1);
-    return(bytes);
-  }else
-    return(0);
-}
-
-/* save a tiny smidge of verbosity to make the code more readable */
-static void _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
-  if(vf->datasource){ 
-    (vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET);
-    vf->offset=offset;
-    ogg_sync_reset(vf->oy);
-  }else{
-    /* shouldn't happen unless someone writes a broken callback */
-    return;
-  }
-}
-
-/* The read/seek functions track absolute position within the stream */
-
-/* from the head of the stream, get the next page.  boundary specifies
-   if the function is allowed to fetch more data from the stream (and
-   how much) or only use internally buffered data.
-
-   boundary: -1) unbounded search
-              0) read no additional data; use cached only
-	      n) search for a new page beginning for n bytes
-
-   return:   <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
-              n) found a page at absolute offset n 
-
-              produces a refcounted page */
-
-static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
-				  ogg_int64_t boundary){
-  if(boundary>0)boundary+=vf->offset;
-  while(1){
-    long more;
-
-    if(boundary>0 && vf->offset>=boundary)return(OV_FALSE);
-    more=ogg_sync_pageseek(vf->oy,og);
-    
-    if(more<0){
-      /* skipped n bytes */
-      vf->offset-=more;
-    }else{
-      if(more==0){
-	/* send more paramedics */
-	if(!boundary)return(OV_FALSE);
-	{
-	  long ret=_get_data(vf);
-	  if(ret==0)return(OV_EOF);
-	  if(ret<0)return(OV_EREAD);
-	}
-      }else{
-	/* got a page.  Return the offset at the page beginning,
-           advance the internal offset past the page end */
-	ogg_int64_t ret=vf->offset;
-	vf->offset+=more;
-	return(ret);
-	
-      }
-    }
-  }
-}
-
-/* find the latest page beginning before the current stream cursor
-   position. Much dirtier than the above as Ogg doesn't have any
-   backward search linkage.  no 'readp' as it will certainly have to
-   read. */
-/* returns offset or OV_EREAD, OV_FAULT and produces a refcounted page */
-
-static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_page *og){
-  ogg_int64_t begin=vf->offset;
-  ogg_int64_t end=begin;
-  ogg_int64_t ret;
-  ogg_int64_t offset=-1;
-
-  while(offset==-1){
-    begin-=CHUNKSIZE;
-    if(begin<0)
-      begin=0;
-    _seek_helper(vf,begin);
-    while(vf->offset<end){
-      ret=_get_next_page(vf,og,end-vf->offset);
-      if(ret==OV_EREAD)return(OV_EREAD);
-      if(ret<0){
-	break;
-      }else{
-	offset=ret;
-      }
-    }
-  }
-
-  /* we have the offset.  Actually snork and hold the page now */
-  _seek_helper(vf,offset);
-  ret=_get_next_page(vf,og,CHUNKSIZE);
-  if(ret<0)
-    /* this shouldn't be possible */
-    return(OV_EFAULT);
-
-  return(offset);
-}
-
-/* finds each bitstream link one at a time using a bisection search
-   (has to begin by knowing the offset of the lb's initial page).
-   Recurses for each link so it can alloc the link storage after
-   finding them all, then unroll and fill the cache at the same time */
-static int _bisect_forward_serialno(OggVorbis_File *vf,
-				    ogg_int64_t begin,
-				    ogg_int64_t searched,
-				    ogg_int64_t end,
-				    ogg_uint32_t currentno,
-				    long m){
-  ogg_int64_t endsearched=end;
-  ogg_int64_t next=end;
-  ogg_page og={0,0,0,0};
-  ogg_int64_t ret;
-  
-  /* the below guards against garbage seperating the last and
-     first pages of two links. */
-  while(searched<endsearched){
-    ogg_int64_t bisect;
-    
-    if(endsearched-searched<CHUNKSIZE){
-      bisect=searched;
-    }else{
-      bisect=(searched+endsearched)/2;
-    }
-    
-    _seek_helper(vf,bisect);
-    ret=_get_next_page(vf,&og,-1);
-    if(ret==OV_EREAD)return(OV_EREAD);
-    if(ret<0 || ogg_page_serialno(&og)!=currentno){
-      endsearched=bisect;
-      if(ret>=0)next=ret;
-    }else{
-      searched=ret+og.header_len+og.body_len;
-    }
-    ogg_page_release(&og);
-  }
-
-  _seek_helper(vf,next);
-  ret=_get_next_page(vf,&og,-1);
-  if(ret==OV_EREAD)return(OV_EREAD);
-  
-  if(searched>=end || ret<0){
-    ogg_page_release(&og);
-    vf->links=m+1;
-    vf->offsets=_ogg_malloc((vf->links+1)*sizeof(*vf->offsets));
-    vf->serialnos=_ogg_malloc(vf->links*sizeof(*vf->serialnos));
-    vf->offsets[m+1]=searched;
-  }else{
-    ret=_bisect_forward_serialno(vf,next,vf->offset,
-				 end,ogg_page_serialno(&og),m+1);
-    ogg_page_release(&og);
-    if(ret==OV_EREAD)return(OV_EREAD);
-  }
-  
-  vf->offsets[m]=begin;
-  vf->serialnos[m]=currentno;
-  return(0);
-}
-
-/* uses the local ogg_stream storage in vf; this is important for
-   non-streaming input sources */
-/* consumes the page that's passed in (if any) */
-
-static int _fetch_headers(OggVorbis_File *vf,
-			  vorbis_info *vi,
-			  vorbis_comment *vc,
-			  ogg_uint32_t *serialno,
-			  ogg_page *og_ptr){
-  ogg_page og={0,0,0,0};
-  ogg_packet op={0,0,0,0,0,0};
-  int i,ret;
-  
-  if(!og_ptr){
-    ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE);
-    if(llret==OV_EREAD)return(OV_EREAD);
-    if(llret<0)return OV_ENOTVORBIS;
-    og_ptr=&og;
-  }
-
-  ogg_stream_reset_serialno(vf->os,ogg_page_serialno(og_ptr));
-  if(serialno)*serialno=vf->os->serialno;
-  vf->ready_state=STREAMSET;
-  
-  /* extract the initial header from the first page and verify that the
-     Ogg bitstream is in fact Vorbis data */
-  
-  vorbis_info_init(vi);
-  vorbis_comment_init(vc);
-  
-  i=0;
-  while(i<3){
-    ogg_stream_pagein(vf->os,og_ptr);
-    while(i<3){
-      int result=ogg_stream_packetout(vf->os,&op);
-      if(result==0)break;
-      if(result==-1){
-	ret=OV_EBADHEADER;
-	goto bail_header;
-      }
-      if((ret=vorbis_synthesis_headerin(vi,vc,&op))){
-	goto bail_header;
-      }
-      i++;
-    }
-    if(i<3)
-      if(_get_next_page(vf,og_ptr,CHUNKSIZE)<0){
-	ret=OV_EBADHEADER;
-	goto bail_header;
-      }
-  }
-
-  ogg_packet_release(&op);
-  ogg_page_release(&og);
-  return 0; 
-
- bail_header:
-  ogg_packet_release(&op);
-  ogg_page_release(&og);
-  vorbis_info_clear(vi);
-  vorbis_comment_clear(vc);
-  vf->ready_state=OPENED;
-
-  return ret;
-}
-
-/* last step of the OggVorbis_File initialization; get all the
-   vorbis_info structs and PCM positions.  Only called by the seekable
-   initialization (local stream storage is hacked slightly; pay
-   attention to how that's done) */
-
-/* this is void and does not propogate errors up because we want to be
-   able to open and use damaged bitstreams as well as we can.  Just
-   watch out for missing information for links in the OggVorbis_File
-   struct */
-static void _prefetch_all_headers(OggVorbis_File *vf, ogg_int64_t dataoffset){
-  ogg_page og={0,0,0,0};
-  int i;
-  ogg_int64_t ret;
-  
-  vf->vi=_ogg_realloc(vf->vi,vf->links*sizeof(*vf->vi));
-  vf->vc=_ogg_realloc(vf->vc,vf->links*sizeof(*vf->vc));
-  vf->dataoffsets=_ogg_malloc(vf->links*sizeof(*vf->dataoffsets));
-  vf->pcmlengths=_ogg_malloc(vf->links*2*sizeof(*vf->pcmlengths));
-  
-  for(i=0;i<vf->links;i++){
-    if(i==0){
-      /* we already grabbed the initial header earlier.  Just set the offset */
-      vf->dataoffsets[i]=dataoffset;
-      _seek_helper(vf,dataoffset);
-
-    }else{
-
-      /* seek to the location of the initial header */
-
-      _seek_helper(vf,vf->offsets[i]);
-      if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL,NULL)<0){
-    	vf->dataoffsets[i]=-1;
-      }else{
-	vf->dataoffsets[i]=vf->offset;
-      }
-    }
-
-    /* fetch beginning PCM offset */
-
-    if(vf->dataoffsets[i]!=-1){
-      ogg_int64_t accumulated=0,pos;
-      long        lastblock=-1;
-      int         result;
-
-      ogg_stream_reset_serialno(vf->os,vf->serialnos[i]);
-
-      while(1){
-	ogg_packet op={0,0,0,0,0,0};
-
-	ret=_get_next_page(vf,&og,-1);
-	if(ret<0)
-	  /* this should not be possible unless the file is
-             truncated/mangled */
-	  break;
-       
-	if(ogg_page_serialno(&og)!=vf->serialnos[i])
-	  break;
-	
-	pos=ogg_page_granulepos(&og);
-
-	/* count blocksizes of all frames in the page */
-	ogg_stream_pagein(vf->os,&og);
-	while((result=ogg_stream_packetout(vf->os,&op))){
-	  if(result>0){ /* ignore holes */
-	    long thisblock=vorbis_packet_blocksize(vf->vi+i,&op);
-	    if(lastblock!=-1)
-	      accumulated+=(lastblock+thisblock)>>2;
-	    lastblock=thisblock;
-	  }
-	}
-	ogg_packet_release(&op);
-
-	if(pos!=-1){
-	  /* pcm offset of last packet on the first audio page */
-	  accumulated= pos-accumulated;
-	  break;
-	}
-      }
-
-      /* less than zero?  This is a stream with samples trimmed off
-         the beginning, a normal occurrence; set the offset to zero */
-      if(accumulated<0)accumulated=0;
-
-      vf->pcmlengths[i*2]=accumulated;
-    }
-
-    /* get the PCM length of this link. To do this,
-       get the last page of the stream */
-    {
-      ogg_int64_t end=vf->offsets[i+1];
-      _seek_helper(vf,end);
-
-      while(1){
-	ret=_get_prev_page(vf,&og);
-	if(ret<0){
-	  /* this should not be possible */
-	  vorbis_info_clear(vf->vi+i);
-	  vorbis_comment_clear(vf->vc+i);
-	  break;
-	}
-	if(ogg_page_granulepos(&og)!=-1){
-	  vf->pcmlengths[i*2+1]=ogg_page_granulepos(&og)-vf->pcmlengths[i*2];
-	  break;
-	}
-	vf->offset=ret;
-      }
-    }
-  }
-  ogg_page_release(&og);
-}
-
-static void _make_decode_ready(OggVorbis_File *vf){
-  if(vf->ready_state!=STREAMSET)return;
-  if(vf->seekable){
-    vorbis_synthesis_init(&vf->vd,vf->vi+vf->current_link);
-  }else{
-    vorbis_synthesis_init(&vf->vd,vf->vi);
-  }    
-  vorbis_block_init(&vf->vd,&vf->vb);
-  vf->ready_state=INITSET;
-  vf->bittrack=0;
-  vf->samptrack=0;
-  return;
-}
-
-static int _open_seekable2(OggVorbis_File *vf){
-  ogg_uint32_t serialno=vf->current_serialno;
-  ogg_uint32_t tempserialno;
-  ogg_int64_t dataoffset=vf->offset, end;
-  ogg_page og={0,0,0,0};
-
-  /* we're partially open and have a first link header state in
-     storage in vf */
-  /* we can seek, so set out learning all about this file */
-  (vf->callbacks.seek_func)(vf->datasource,0,SEEK_END);
-  vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource);
-  
-  /* We get the offset for the last page of the physical bitstream.
-     Most OggVorbis files will contain a single logical bitstream */
-  end=_get_prev_page(vf,&og);
-  if(end<0)return(end);
-
-  /* more than one logical bitstream? */
-  tempserialno=ogg_page_serialno(&og);
-  ogg_page_release(&og);
-
-  if(tempserialno!=serialno){
-
-    /* Chained bitstream. Bisect-search each logical bitstream
-       section.  Do so based on serial number only */
-    if(_bisect_forward_serialno(vf,0,0,end+1,serialno,0)<0)return(OV_EREAD);
-
-  }else{
-
-    /* Only one logical bitstream */
-    if(_bisect_forward_serialno(vf,0,end,end+1,serialno,0))return(OV_EREAD);
-
-  }
-
-  /* the initial header memory is referenced by vf after; don't free it */
-  _prefetch_all_headers(vf,dataoffset);
-  return(ov_raw_seek(vf,0));
-}
-
-/* clear out the current logical bitstream decoder */ 
-static void _decode_clear(OggVorbis_File *vf){
-  vorbis_dsp_clear(&vf->vd);
-  vorbis_block_clear(&vf->vb);
-  vf->ready_state=OPENED;
-}
-
-/* fetch and process a packet.  Handles the case where we're at a
-   bitstream boundary and dumps the decoding machine.  If the decoding
-   machine is unloaded, it loads it.  It also keeps pcm_offset up to
-   date (seek and read both use this.  seek uses a special hack with
-   readp). 
-
-   return: <0) error, OV_HOLE (lost packet) or OV_EOF
-            0) need more data (only if readp==0)
-	    1) got a packet 
-*/
-
-static int _fetch_and_process_packet(OggVorbis_File *vf,
-				     int readp,
-				     int spanp){
-  ogg_page og={0,0,0,0};
-  ogg_packet op={0,0,0,0,0,0};
-  int ret=0;
-
-  /* handle one packet.  Try to fetch it from current stream state */
-  /* extract packets from page */
-  while(1){
-    
-    /* process a packet if we can.  If the machine isn't loaded,
-       neither is a page */
-    if(vf->ready_state==INITSET){
-      while(1) {
-	int result=ogg_stream_packetout(vf->os,&op);
-	ogg_int64_t granulepos;
-
-	if(result<0){
-	  ret=OV_HOLE; /* hole in the data. */
-	  goto cleanup;
-	}
-	if(result>0){
-	  /* got a packet.  process it */
-	  granulepos=op.granulepos;
-	  if(!vorbis_synthesis(&vf->vb,&op,1)){ /* lazy check for lazy
-						      header handling.  The
-						      header packets aren't
-						      audio, so if/when we
-						      submit them,
-						      vorbis_synthesis will
-						      reject them */
-
-	    /* suck in the synthesis data and track bitrate */
-	    {
-	      int oldsamples=vorbis_synthesis_pcmout(&vf->vd,NULL);
-	      /* for proper use of libvorbis within libvorbisfile,
-                 oldsamples will always be zero. */
-	      if(oldsamples){
-		ret=OV_EFAULT;
-		goto cleanup;
-	      }
-
-	      vorbis_synthesis_blockin(&vf->vd,&vf->vb);
-	      vf->samptrack+=vorbis_synthesis_pcmout(&vf->vd,NULL)-oldsamples;
-	      vf->bittrack+=op.bytes*8;
-	    }
-	  
-	    /* update the pcm offset. */
-	    if(granulepos!=-1 && !op.e_o_s){
-	      int link=(vf->seekable?vf->current_link:0);
-	      int i,samples;
-	    
-	      /* this packet has a pcm_offset on it (the last packet
-	         completed on a page carries the offset) After processing
-	         (above), we know the pcm position of the *last* sample
-	         ready to be returned. Find the offset of the *first*
-
-	         As an aside, this trick is inaccurate if we begin
-	         reading anew right at the last page; the end-of-stream
-	         granulepos declares the last frame in the stream, and the
-	         last packet of the last page may be a partial frame.
-	         So, we need a previous granulepos from an in-sequence page
-	         to have a reference point.  Thus the !op.e_o_s clause
-	         above */
-
-	      if(vf->seekable && link>0)
-		granulepos-=vf->pcmlengths[link*2];
-	      if(granulepos<0)granulepos=0; /* actually, this
-					       shouldn't be possible
-					       here unless the stream
-					       is very broken */
-
-	      samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
-	    
-	      granulepos-=samples;
-	      for(i=0;i<link;i++)
-	        granulepos+=vf->pcmlengths[i*2+1];
-	      vf->pcm_offset=granulepos;
-	    }
-	    ret=1;
-	    goto cleanup;
-	  }
-	}
-	else 
-	  break;
-      }
-    }
-
-    if(vf->ready_state>=OPENED){
-      int ret;
-      if(!readp){
-	ret=0;
-	goto cleanup;
-      }
-      if((ret=_get_next_page(vf,&og,-1))<0){
-	ret=OV_EOF; /* eof. leave unitialized */
-	goto cleanup;
-      }
-
-	/* bitrate tracking; add the header's bytes here, the body bytes
-	   are done by packet above */
-      vf->bittrack+=og.header_len*8;
-      
-      /* has our decoding just traversed a bitstream boundary? */
-      if(vf->ready_state==INITSET){
-	if(vf->current_serialno!=ogg_page_serialno(&og)){
-	  if(!spanp){
-	    ret=OV_EOF;
-	    goto cleanup;
-	  }
-
-	  _decode_clear(vf);
-	  
-	  if(!vf->seekable){
-	    vorbis_info_clear(vf->vi);
-	    vorbis_comment_clear(vf->vc);
-	  }
-	}
-      }
-    }
-
-    /* Do we need to load a new machine before submitting the page? */
-    /* This is different in the seekable and non-seekable cases.  
-
-       In the seekable case, we already have all the header
-       information loaded and cached; we just initialize the machine
-       with it and continue on our merry way.
-
-       In the non-seekable (streaming) case, we'll only be at a
-       boundary if we just left the previous logical bitstream and
-       we're now nominally at the header of the next bitstream
-    */
-
-    if(vf->ready_state!=INITSET){ 
-      int link;
-
-      if(vf->ready_state<STREAMSET){
-	if(vf->seekable){
-	  vf->current_serialno=ogg_page_serialno(&og);
-	  
-	  /* match the serialno to bitstream section.  We use this rather than
-	     offset positions to avoid problems near logical bitstream
-	     boundaries */
-	  for(link=0;link<vf->links;link++)
-	    if(vf->serialnos[link]==vf->current_serialno)break;
-	  if(link==vf->links){
-	    ret=OV_EBADLINK; /* sign of a bogus stream.  error out,
-				leave machine uninitialized */
-	    goto cleanup;
-	  }
-	  
-	  vf->current_link=link;
-	  
-	  ogg_stream_reset_serialno(vf->os,vf->current_serialno);
-	  vf->ready_state=STREAMSET;
-	  
-	}else{
-	  /* we're streaming */
-	  /* fetch the three header packets, build the info struct */
-	  
-	  int ret=_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,&og);
-	  if(ret) goto cleanup;
-	  vf->current_link++;
-	  link=0;
-	}
-      }
-      
-      _make_decode_ready(vf);
-    }
-    ogg_stream_pagein(vf->os,&og);
-  }
- cleanup:
-  ogg_packet_release(&op);
-  ogg_page_release(&og);
-  return ret;
-}
-
-/* if, eg, 64 bit stdio is configured by default, this will build with
-   fseek64 */
-static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
-  if(f==NULL)return(-1);
-  return fseek(f,off,whence);
-}
-
-static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
-		     long ibytes, ov_callbacks callbacks){
-  int offsettest=(f?callbacks.seek_func(f,0,SEEK_CUR):-1);
-  int ret;
-
-  memset(vf,0,sizeof(*vf));
-  vf->datasource=f;
-  vf->callbacks = callbacks;
-
-  /* init the framing state */
-  vf->oy=ogg_sync_create();
-
-  /* perhaps some data was previously read into a buffer for testing
-     against other stream types.  Allow initialization from this
-     previously read data (as we may be reading from a non-seekable
-     stream) */
-  if(initial){
-    unsigned char *buffer=ogg_sync_bufferin(vf->oy,ibytes);
-    memcpy(buffer,initial,ibytes);
-    ogg_sync_wrote(vf->oy,ibytes);
-  }
-
-  /* can we seek? Stevens suggests the seek test was portable */
-  if(offsettest!=-1)vf->seekable=1;
-
-  /* No seeking yet; Set up a 'single' (current) logical bitstream
-     entry for partial open */
-  vf->links=1;
-  vf->vi=_ogg_calloc(vf->links,sizeof(*vf->vi));
-  vf->vc=_ogg_calloc(vf->links,sizeof(*vf->vc));
-  vf->os=ogg_stream_create(-1); /* fill in the serialno later */
-
-  /* Try to fetch the headers, maintaining all the storage */
-  if((ret=_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,NULL))<0){
-    vf->datasource=NULL;
-    ov_clear(vf);
-  }else if(vf->ready_state < PARTOPEN)
-    vf->ready_state=PARTOPEN;
-  return(ret);
-}
-
-static int _ov_open2(OggVorbis_File *vf){
-  if(vf->ready_state < OPENED)
-    vf->ready_state=OPENED;
-  if(vf->seekable){
-    int ret=_open_seekable2(vf);
-    if(ret){
-      vf->datasource=NULL;
-      ov_clear(vf);
-    }
-    return(ret);
-  }
-  return 0;
-}
-
-
-/* clear out the OggVorbis_File struct */
-int ov_clear(OggVorbis_File *vf){
-  if(vf){
-    vorbis_block_clear(&vf->vb);
-    vorbis_dsp_clear(&vf->vd);
-    ogg_stream_destroy(vf->os);
-    
-    if(vf->vi && vf->links){
-      int i;
-      for(i=0;i<vf->links;i++){
-	vorbis_info_clear(vf->vi+i);
-	vorbis_comment_clear(vf->vc+i);
-      }
-      _ogg_free(vf->vi);
-      _ogg_free(vf->vc);
-    }
-    if(vf->dataoffsets)_ogg_free(vf->dataoffsets);
-    if(vf->pcmlengths)_ogg_free(vf->pcmlengths);
-    if(vf->serialnos)_ogg_free(vf->serialnos);
-    if(vf->offsets)_ogg_free(vf->offsets);
-    ogg_sync_destroy(vf->oy);
-
-    if(vf->datasource)(vf->callbacks.close_func)(vf->datasource);
-    memset(vf,0,sizeof(*vf));
-  }
-#ifdef DEBUG_LEAKS
-  _VDBG_dump();
-#endif
-  return(0);
-}
-
-/* inspects the OggVorbis file and finds/documents all the logical
-   bitstreams contained in it.  Tries to be tolerant of logical
-   bitstream sections that are truncated/woogie. 
-
-   return: -1) error
-            0) OK
-*/
-
-int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
-    ov_callbacks callbacks){
-  int ret=_ov_open1(f,vf,initial,ibytes,callbacks);
-  if(ret)return ret;
-  return _ov_open2(vf);
-}
-
-int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
-  ov_callbacks callbacks = {
-    (size_t (*)(void *, size_t, size_t, void *))  fread,
-    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
-    (int (*)(void *))                             fclose,
-    (long (*)(void *))                            ftell
-  };
-
-  return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
-}
-  
-/* Only partially open the vorbis file; test for Vorbisness, and load
-   the headers for the first chain.  Do not seek (although test for
-   seekability).  Use ov_test_open to finish opening the file, else
-   ov_clear to close/free it. Same return codes as open. */
-
-int ov_test_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
-    ov_callbacks callbacks)
-{
-  return _ov_open1(f,vf,initial,ibytes,callbacks);
-}
-
-int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
-  ov_callbacks callbacks = {
-    (size_t (*)(void *, size_t, size_t, void *))  fread,
-    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
-    (int (*)(void *))                             fclose,
-    (long (*)(void *))                            ftell
-  };
-
-  return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
-}
-  
-int ov_test_open(OggVorbis_File *vf){
-  if(vf->ready_state!=PARTOPEN)return(OV_EINVAL);
-  return _ov_open2(vf);
-}
-
-/* How many logical bitstreams in this physical bitstream? */
-long ov_streams(OggVorbis_File *vf){
-  return vf->links;
-}
-
-/* Is the FILE * associated with vf seekable? */
-long ov_seekable(OggVorbis_File *vf){
-  return vf->seekable;
-}
-
-/* returns the bitrate for a given logical bitstream or the entire
-   physical bitstream.  If the file is open for random access, it will
-   find the *actual* average bitrate.  If the file is streaming, it
-   returns the nominal bitrate (if set) else the average of the
-   upper/lower bounds (if set) else -1 (unset).
-
-   If you want the actual bitrate field settings, get them from the
-   vorbis_info structs */
-
-long ov_bitrate(OggVorbis_File *vf,int i){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(i>=vf->links)return(OV_EINVAL);
-  if(!vf->seekable && i!=0)return(ov_bitrate(vf,0));
-  if(i<0){
-    ogg_int64_t bits=0;
-    int i;
-    for(i=0;i<vf->links;i++)
-      bits+=(vf->offsets[i+1]-vf->dataoffsets[i])*8;
-    /* This once read: return(rint(bits/ov_time_total(vf,-1)));
-     * gcc 3.x on x86 miscompiled this at optimisation level 2 and above,
-     * so this is slightly transformed to make it work.
-     */
-    return(bits*1000/ov_time_total(vf,-1));
-  }else{
-    if(vf->seekable){
-      /* return the actual bitrate */
-      return((vf->offsets[i+1]-vf->dataoffsets[i])*8000/ov_time_total(vf,i));
-    }else{
-      /* return nominal if set */
-      if(vf->vi[i].bitrate_nominal>0){
-	return vf->vi[i].bitrate_nominal;
-      }else{
-	if(vf->vi[i].bitrate_upper>0){
-	  if(vf->vi[i].bitrate_lower>0){
-	    return (vf->vi[i].bitrate_upper+vf->vi[i].bitrate_lower)/2;
-	  }else{
-	    return vf->vi[i].bitrate_upper;
-	  }
-	}
-	return(OV_FALSE);
-      }
-    }
-  }
-}
-
-/* returns the actual bitrate since last call.  returns -1 if no
-   additional data to offer since last call (or at beginning of stream),
-   EINVAL if stream is only partially open 
-*/
-long ov_bitrate_instant(OggVorbis_File *vf){
-  int link=(vf->seekable?vf->current_link:0);
-  long ret;
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(vf->samptrack==0)return(OV_FALSE);
-  ret=vf->bittrack/vf->samptrack*vf->vi[link].rate;
-  vf->bittrack=0;
-  vf->samptrack=0;
-  return(ret);
-}
-
-/* Guess */
-long ov_serialnumber(OggVorbis_File *vf,int i){
-  if(i>=vf->links)return(ov_serialnumber(vf,vf->links-1));
-  if(!vf->seekable && i>=0)return(ov_serialnumber(vf,-1));
-  if(i<0){
-    return(vf->current_serialno);
-  }else{
-    return(vf->serialnos[i]);
-  }
-}
-
-/* returns: total raw (compressed) length of content if i==-1
-            raw (compressed) length of that logical bitstream for i==0 to n
-	    OV_EINVAL if the stream is not seekable (we can't know the length)
-	    or if stream is only partially open
-*/
-ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
-  if(i<0){
-    ogg_int64_t acc=0;
-    int i;
-    for(i=0;i<vf->links;i++)
-      acc+=ov_raw_total(vf,i);
-    return(acc);
-  }else{
-    return(vf->offsets[i+1]-vf->offsets[i]);
-  }
-}
-
-/* returns: total PCM length (samples) of content if i==-1 PCM length
-	    (samples) of that logical bitstream for i==0 to n
-	    OV_EINVAL if the stream is not seekable (we can't know the
-	    length) or only partially open 
-*/
-ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
-  if(i<0){
-    ogg_int64_t acc=0;
-    int i;
-    for(i=0;i<vf->links;i++)
-      acc+=ov_pcm_total(vf,i);
-    return(acc);
-  }else{
-    return(vf->pcmlengths[i*2+1]);
-  }
-}
-
-/* returns: total milliseconds of content if i==-1
-            milliseconds in that logical bitstream for i==0 to n
-	    OV_EINVAL if the stream is not seekable (we can't know the
-	    length) or only partially open 
-*/
-ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
-  if(i<0){
-    ogg_int64_t acc=0;
-    int i;
-    for(i=0;i<vf->links;i++)
-      acc+=ov_time_total(vf,i);
-    return(acc);
-  }else{
-    return(((ogg_int64_t)vf->pcmlengths[i*2+1])*1000/vf->vi[i].rate);
-  }
-}
-
-/* seek to an offset relative to the *compressed* data. This also
-   scans packets to update the PCM cursor. It will cross a logical
-   bitstream boundary, but only if it can't get any packets out of the
-   tail of the bitstream we seek to (so no surprises).
-
-   returns zero on success, nonzero on failure */
-
-int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
-  ogg_stream_state *work_os=NULL;
-  ogg_page og={0,0,0,0};
-  ogg_packet op={0,0,0,0,0,0};
-  
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable)
-    return(OV_ENOSEEK); /* don't dump machine if we can't seek */
-
-  if(pos<0 || pos>vf->end)return(OV_EINVAL);
-
-  /* don't yet clear out decoding machine (if it's initialized), in
-     the case we're in the same link.  Restart the decode lapping, and
-     let _fetch_and_process_packet deal with a potential bitstream
-     boundary */
-  vf->pcm_offset=-1;
-  ogg_stream_reset_serialno(vf->os,
-			    vf->current_serialno); /* must set serialno */
-  vorbis_synthesis_restart(&vf->vd);
-    
-  _seek_helper(vf,pos);
-
-  /* we need to make sure the pcm_offset is set, but we don't want to
-     advance the raw cursor past good packets just to get to the first
-     with a granulepos.  That's not equivalent behavior to beginning
-     decoding as immediately after the seek position as possible.
-
-     So, a hack.  We use two stream states; a local scratch state and
-     the shared vf->os stream state.  We use the local state to
-     scan, and the shared state as a buffer for later decode. 
-
-     Unfortuantely, on the last page we still advance to last packet
-     because the granulepos on the last page is not necessarily on a
-     packet boundary, and we need to make sure the granpos is
-     correct. 
-  */
-
-  {
-    int lastblock=0;
-    int accblock=0;
-    int thisblock;
-    int eosflag=0;
-
-    work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */
-    while(1){
-      if(vf->ready_state>=STREAMSET){
-	/* snarf/scan a packet if we can */
-	int result=ogg_stream_packetout(work_os,&op);
-      
-	if(result>0){
-
-	  if(vf->vi[vf->current_link].codec_setup){
-	    thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
-	    if(thisblock<0){
-	      ogg_stream_packetout(vf->os,NULL);
-	      thisblock=0;
-	    }else{
-	      
-	      if(eosflag)
-		ogg_stream_packetout(vf->os,NULL);
-	      else
-		if(lastblock)accblock+=(lastblock+thisblock)>>2;
-	    }	    
-
-	    if(op.granulepos!=-1){
-	      int i,link=vf->current_link;
-	      ogg_int64_t granulepos=op.granulepos-vf->pcmlengths[link*2];
-	      if(granulepos<0)granulepos=0;
-	      
-	      for(i=0;i<link;i++)
-		granulepos+=vf->pcmlengths[i*2+1];
-	      vf->pcm_offset=granulepos-accblock;
-	      break;
-	    }
-	    lastblock=thisblock;
-	    continue;
-	  }else
-	    ogg_stream_packetout(vf->os,NULL);
-	}
-      }
-      
-      if(!lastblock){
-	if(_get_next_page(vf,&og,-1)<0){
-	  vf->pcm_offset=ov_pcm_total(vf,-1);
-	  break;
-	}
-      }else{
-	/* huh?  Bogus stream with packets but no granulepos */
-	vf->pcm_offset=-1;
-	break;
-      }
-      
-      /* has our decoding just traversed a bitstream boundary? */
-      if(vf->ready_state>=STREAMSET)
-	if(vf->current_serialno!=ogg_page_serialno(&og)){
-	  _decode_clear(vf); /* clear out stream state */
-	  ogg_stream_destroy(work_os);
-	}
-
-      if(vf->ready_state<STREAMSET){
-	int link;
-	
-	vf->current_serialno=ogg_page_serialno(&og);
-	for(link=0;link<vf->links;link++)
-	  if(vf->serialnos[link]==vf->current_serialno)break;
-	if(link==vf->links)
-	  goto seek_error; /* sign of a bogus stream.  error out,
-			      leave machine uninitialized */
- 
-	vf->current_link=link;
-	
-	ogg_stream_reset_serialno(vf->os,vf->current_serialno);
-	ogg_stream_reset_serialno(work_os,vf->current_serialno); 
-	vf->ready_state=STREAMSET;
-	
-      }
-    
-      {
-	ogg_page dup;
-	ogg_page_dup(&dup,&og);
-	eosflag=ogg_page_eos(&og);
-	ogg_stream_pagein(vf->os,&og);
-	ogg_stream_pagein(work_os,&dup);
-      }
-    }
-  }
-
-  ogg_packet_release(&op);
-  ogg_page_release(&og);
-  ogg_stream_destroy(work_os);
-  vf->bittrack=0;
-  vf->samptrack=0;
-  return(0);
-
- seek_error:
-  ogg_packet_release(&op);
-  ogg_page_release(&og);
-
-  /* dump the machine so we're in a known state */
-  vf->pcm_offset=-1;
-  ogg_stream_destroy(work_os);
-  _decode_clear(vf);
-  return OV_EBADLINK;
-}
-
-/* Page granularity seek (faster than sample granularity because we
-   don't do the last bit of decode to find a specific sample).
-
-   Seek to the last [granule marked] page preceeding the specified pos
-   location, such that decoding past the returned point will quickly
-   arrive at the requested position. */
-int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
-  int link=-1;
-  ogg_int64_t result=0;
-  ogg_int64_t total=ov_pcm_total(vf,-1);
-  ogg_page og={0,0,0,0};
-  ogg_packet op={0,0,0,0,0,0};
-
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable)return(OV_ENOSEEK);
-  if(pos<0 || pos>total)return(OV_EINVAL);
- 
-  /* which bitstream section does this pcm offset occur in? */
-  for(link=vf->links-1;link>=0;link--){
-    total-=vf->pcmlengths[link*2+1];
-    if(pos>=total)break;
-  }
-
-  /* search within the logical bitstream for the page with the highest
-     pcm_pos preceeding (or equal to) pos.  There is a danger here;
-     missing pages or incorrect frame number information in the
-     bitstream could make our task impossible.  Account for that (it
-     would be an error condition) */
-
-  /* new search algorithm by HB (Nicholas Vinen) */
-  {
-    ogg_int64_t end=vf->offsets[link+1];
-    ogg_int64_t begin=vf->offsets[link];
-    ogg_int64_t begintime = vf->pcmlengths[link*2];
-    ogg_int64_t endtime = vf->pcmlengths[link*2+1]+begintime;
-    ogg_int64_t target=pos-total+begintime;
-    ogg_int64_t best=begin;
-    
-    while(begin<end){
-      ogg_int64_t bisect;
-      
-      if(end-begin<CHUNKSIZE){
-	bisect=begin;
-      }else{
-	/* take a (pretty decent) guess. */
-	bisect=begin + 
-	  (target-begintime)*(end-begin)/(endtime-begintime) - CHUNKSIZE;
-	if(bisect<=begin)
-	  bisect=begin+1;
-      }
-      
-      _seek_helper(vf,bisect);
-    
-      while(begin<end){
-	result=_get_next_page(vf,&og,end-vf->offset);
-	if(result==OV_EREAD) goto seek_error;
-	if(result<0){
-	  if(bisect<=begin+1)
-	    end=begin; /* found it */
-	  else{
-	    if(bisect==0) goto seek_error;
-	    bisect-=CHUNKSIZE;
-	    if(bisect<=begin)bisect=begin+1;
-	    _seek_helper(vf,bisect);
-	  }
-	}else{
-	  ogg_int64_t granulepos=ogg_page_granulepos(&og);
-	  if(granulepos==-1)continue;
-	  if(granulepos<target){
-	    best=result;  /* raw offset of packet with granulepos */ 
-	    begin=vf->offset; /* raw offset of next page */
-	    begintime=granulepos;
-	    
-	    if(target-begintime>44100)break;
-	    bisect=begin; /* *not* begin + 1 */
-	  }else{
-	    if(bisect<=begin+1)
-	      end=begin;  /* found it */
-	    else{
-	      if(end==vf->offset){ /* we're pretty close - we'd be stuck in */
-		end=result;
-		bisect-=CHUNKSIZE; /* an endless loop otherwise. */
-		if(bisect<=begin)bisect=begin+1;
-		_seek_helper(vf,bisect);
-	      }else{
-		end=result;
-		endtime=granulepos;
-		break;
-	      }
-	    }
-	  }
-	}
-      }
-    }
-
-    /* found our page. seek to it, update pcm offset. Easier case than
-       raw_seek, don't keep packets preceeding granulepos. */
-    {
-      
-      /* seek */
-      _seek_helper(vf,best);
-      vf->pcm_offset=-1;
-      
-      if(_get_next_page(vf,&og,-1)<0){
-	ogg_page_release(&og);
-	return(OV_EOF); /* shouldn't happen */
-      }
-
-      if(link!=vf->current_link){
-	/* Different link; dump entire decode machine */
-	_decode_clear(vf);  
-	
-	vf->current_link=link;
-	vf->current_serialno=ogg_page_serialno(&og);
-	vf->ready_state=STREAMSET;
-	
-      }else{
-	vorbis_synthesis_restart(&vf->vd);
-      }
-
-      ogg_stream_reset_serialno(vf->os,vf->current_serialno);
-      ogg_stream_pagein(vf->os,&og);
-
-      /* pull out all but last packet; the one with granulepos */
-      while(1){
-	result=ogg_stream_packetpeek(vf->os,&op);
-	if(result==0){
-	  /* !!! the packet finishing this page originated on a
-             preceeding page. Keep fetching previous pages until we
-             get one with a granulepos or without the 'continued' flag
-             set.  Then just use raw_seek for simplicity. */
-	  
-	  _seek_helper(vf,best);
-	  
-	  while(1){
-	    result=_get_prev_page(vf,&og);
-	    if(result<0) goto seek_error;
-	    if(ogg_page_granulepos(&og)>-1 ||
-	       !ogg_page_continued(&og)){
-	      return ov_raw_seek(vf,result);
-	    }
-	    vf->offset=result;
-	  }
-	}
-	if(result<0){
-	  result = OV_EBADPACKET; 
-	  goto seek_error;
-	}
-	if(op.granulepos!=-1){
-	  vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
-	  if(vf->pcm_offset<0)vf->pcm_offset=0;
-	  vf->pcm_offset+=total;
-	  break;
-	}else
-	  result=ogg_stream_packetout(vf->os,NULL);
-      }
-    }
-  }
-  
-  /* verify result */
-  if(vf->pcm_offset>pos || pos>ov_pcm_total(vf,-1)){
-    result=OV_EFAULT;
-    goto seek_error;
-  }
-  vf->bittrack=0;
-  vf->samptrack=0;
-
-  ogg_page_release(&og);
-  ogg_packet_release(&op);
-  return(0);
-  
- seek_error:
-
-  ogg_page_release(&og);
-  ogg_packet_release(&op);
-
-  /* dump machine so we're in a known state */
-  vf->pcm_offset=-1;
-  _decode_clear(vf);
-  return (int)result;
-}
-
-/* seek to a sample offset relative to the decompressed pcm stream 
-   returns zero on success, nonzero on failure */
-
-int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
-  ogg_packet op={0,0,0,0,0,0};
-  ogg_page og={0,0,0,0};
-  int thisblock,lastblock=0;
-  int ret=ov_pcm_seek_page(vf,pos);
-  if(ret<0)return(ret);
-  _make_decode_ready(vf);
-
-  /* discard leading packets we don't need for the lapping of the
-     position we want; don't decode them */
-
-  while(1){
-
-    int ret=ogg_stream_packetpeek(vf->os,&op);
-    if(ret>0){
-      thisblock=vorbis_packet_blocksize(vf->vi+vf->current_link,&op);
-      if(thisblock<0){
-	ogg_stream_packetout(vf->os,NULL);
-	continue; /* non audio packet */
-      }
-      if(lastblock)vf->pcm_offset+=(lastblock+thisblock)>>2;
-      
-      if(vf->pcm_offset+((thisblock+
-			  vorbis_info_blocksize(vf->vi,1))>>2)>=pos)break;
-      
-      /* remove the packet from packet queue and track its granulepos */
-      ogg_stream_packetout(vf->os,NULL);
-      vorbis_synthesis(&vf->vb,&op,0);  /* set up a vb with
-					   only tracking, no
-					   pcm_decode */
-      vorbis_synthesis_blockin(&vf->vd,&vf->vb); 
-      
-      /* end of logical stream case is hard, especially with exact
-	 length positioning. */
-      
-      if(op.granulepos>-1){
-	int i;
-	/* always believe the stream markers */
-	vf->pcm_offset=op.granulepos-vf->pcmlengths[vf->current_link*2];
-	if(vf->pcm_offset<0)vf->pcm_offset=0;
-	for(i=0;i<vf->current_link;i++)
-	  vf->pcm_offset+=vf->pcmlengths[i*2+1];
-      }
-	
-      lastblock=thisblock;
-      
-    }else{
-      if(ret<0 && ret!=OV_HOLE)break;
-      
-      /* suck in a new page */
-      if(_get_next_page(vf,&og,-1)<0)break;
-      if(vf->current_serialno!=ogg_page_serialno(&og))_decode_clear(vf);
-      
-      if(vf->ready_state<STREAMSET){
-	int link;
-	
-	vf->current_serialno=ogg_page_serialno(&og);
-	for(link=0;link<vf->links;link++)
-	  if(vf->serialnos[link]==vf->current_serialno)break;
-	if(link==vf->links){
-	  ogg_page_release(&og);
-	  ogg_packet_release(&op);
-	  return(OV_EBADLINK);
-	}
-	vf->current_link=link;
-	
-	ogg_stream_reset_serialno(vf->os,vf->current_serialno); 
-	vf->ready_state=STREAMSET;      
-	_make_decode_ready(vf);
-	lastblock=0;
-      }
-
-      ogg_stream_pagein(vf->os,&og);
-    }
-  }
-
-  vf->bittrack=0;
-  vf->samptrack=0;
-  /* discard samples until we reach the desired position. Crossing a
-     logical bitstream boundary with abandon is OK. */
-  while(vf->pcm_offset<pos){
-    ogg_int64_t target=pos-vf->pcm_offset;
-    long samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
-
-    if(samples>target)samples=target;
-    vorbis_synthesis_read(&vf->vd,samples);
-    vf->pcm_offset+=samples;
-    
-    if(samples<target)
-      if(_fetch_and_process_packet(vf,1,1)<=0)
-	vf->pcm_offset=ov_pcm_total(vf,-1); /* eof */
-  }
-
-  ogg_page_release(&og);
-  ogg_packet_release(&op);
-  return 0;
-}
-
-/* seek to a playback time relative to the decompressed pcm stream 
-   returns zero on success, nonzero on failure */
-int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
-  /* translate time to PCM position and call ov_pcm_seek */
-
-  int link=-1;
-  ogg_int64_t pcm_total=ov_pcm_total(vf,-1);
-  ogg_int64_t time_total=ov_time_total(vf,-1);
-
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable)return(OV_ENOSEEK);
-  if(milliseconds<0 || milliseconds>time_total)return(OV_EINVAL);
-  
-  /* which bitstream section does this time offset occur in? */
-  for(link=vf->links-1;link>=0;link--){
-    pcm_total-=vf->pcmlengths[link*2+1];
-    time_total-=ov_time_total(vf,link);
-    if(milliseconds>=time_total)break;
-  }
-
-  /* enough information to convert time offset to pcm offset */
-  {
-    ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000;
-    return(ov_pcm_seek(vf,target));
-  }
-}
-
-/* page-granularity version of ov_time_seek 
-   returns zero on success, nonzero on failure */
-int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
-  /* translate time to PCM position and call ov_pcm_seek */
-
-  int link=-1;
-  ogg_int64_t pcm_total=ov_pcm_total(vf,-1);
-  ogg_int64_t time_total=ov_time_total(vf,-1);
-
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(!vf->seekable)return(OV_ENOSEEK);
-  if(milliseconds<0 || milliseconds>time_total)return(OV_EINVAL);
-  
-  /* which bitstream section does this time offset occur in? */
-  for(link=vf->links-1;link>=0;link--){
-    pcm_total-=vf->pcmlengths[link*2+1];
-    time_total-=ov_time_total(vf,link);
-    if(milliseconds>=time_total)break;
-  }
-
-  /* enough information to convert time offset to pcm offset */
-  {
-    ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000;
-    return(ov_pcm_seek_page(vf,target));
-  }
-}
-
-/* tell the current stream offset cursor.  Note that seek followed by
-   tell will likely not give the set offset due to caching */
-ogg_int64_t ov_raw_tell(OggVorbis_File *vf){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  return(vf->offset);
-}
-
-/* return PCM offset (sample) of next PCM sample to be read */
-ogg_int64_t ov_pcm_tell(OggVorbis_File *vf){
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  return(vf->pcm_offset);
-}
-
-/* return time offset (milliseconds) of next PCM sample to be read */
-ogg_int64_t ov_time_tell(OggVorbis_File *vf){
-  int link=0;
-  ogg_int64_t pcm_total=0;
-  ogg_int64_t time_total=0;
-  
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-  if(vf->seekable){
-    pcm_total=ov_pcm_total(vf,-1);
-    time_total=ov_time_total(vf,-1);
-  
-    /* which bitstream section does this time offset occur in? */
-    for(link=vf->links-1;link>=0;link--){
-      pcm_total-=vf->pcmlengths[link*2+1];
-      time_total-=ov_time_total(vf,link);
-      if(vf->pcm_offset>=pcm_total)break;
-    }
-  }
-
-  return(time_total+(1000*vf->pcm_offset-pcm_total)/vf->vi[link].rate);
-}
-
-/*  link:   -1) return the vorbis_info struct for the bitstream section
-                currently being decoded
-           0-n) to request information for a specific bitstream section
-    
-    In the case of a non-seekable bitstream, any call returns the
-    current bitstream.  NULL in the case that the machine is not
-    initialized */
-
-vorbis_info *ov_info(OggVorbis_File *vf,int link){
-  if(vf->seekable){
-    if(link<0)
-      if(vf->ready_state>=STREAMSET)
-	return vf->vi+vf->current_link;
-      else
-      return vf->vi;
-    else
-      if(link>=vf->links)
-	return NULL;
-      else
-	return vf->vi+link;
-  }else{
-    return vf->vi;
-  }
-}
-
-/* grr, strong typing, grr, no templates/inheritence, grr */
-vorbis_comment *ov_comment(OggVorbis_File *vf,int link){
-  if(vf->seekable){
-    if(link<0)
-      if(vf->ready_state>=STREAMSET)
-	return vf->vc+vf->current_link;
-      else
-	return vf->vc;
-    else
-      if(link>=vf->links)
-	return NULL;
-      else
-	return vf->vc+link;
-  }else{
-    return vf->vc;
-  }
-}
-
-/* up to this point, everything could more or less hide the multiple
-   logical bitstream nature of chaining from the toplevel application
-   if the toplevel application didn't particularly care.  However, at
-   the point that we actually read audio back, the multiple-section
-   nature must surface: Multiple bitstream sections do not necessarily
-   have to have the same number of channels or sampling rate.
-
-   ov_read returns the sequential logical bitstream number currently
-   being decoded along with the PCM data in order that the toplevel
-   application can take action on channel/sample rate changes.  This
-   number will be incremented even for streamed (non-seekable) streams
-   (for seekable streams, it represents the actual logical bitstream
-   index within the physical bitstream.  Note that the accessor
-   functions above are aware of this dichotomy).
-
-   input values: buffer) a buffer to hold packed PCM data for return
-		 length) the byte length requested to be placed into buffer
-
-   return values: <0) error/hole in data (OV_HOLE), partial open (OV_EINVAL)
-                   0) EOF
-		   n) number of bytes of PCM actually returned.  The
-		   below works on a packet-by-packet basis, so the
-		   return length is not related to the 'length' passed
-		   in, just guaranteed to fit.
-
-	    *section) set to the logical bitstream number */
-
-long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){
-  int i,j;
-
-  ogg_int32_t **pcm;
-  long samples;
-
-  if(vf->ready_state<OPENED)return(OV_EINVAL);
-
-  while(1){
-    if(vf->ready_state==INITSET){
-      samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
-      if(samples)break;
-    }
-
-    /* suck in another packet */
-    {
-      int ret=_fetch_and_process_packet(vf,1,1);
-      if(ret==OV_EOF)
-	return(0);
-      if(ret<=0)
-	return(ret);
-    }
-
-  }
-
-  if(samples>0){
-  
-    /* yay! proceed to pack data into the byte buffer */
-    
-    long channels=ov_info(vf,-1)->channels;
-
-    if(samples>(bytes_req/(2*channels)))
-      samples=bytes_req/(2*channels);      
-    
-    for(i=0;i<channels;i++) { /* It's faster in this order */
-      ogg_int32_t *src=pcm[i];
-      short *dest=((short *)buffer)+i;
-      for(j=0;j<samples;j++) {
-        *dest=CLIP_TO_15(src[j]>>9);
-        dest+=channels;
-      }
-    }
-    
-    vorbis_synthesis_read(&vf->vd,samples);
-    vf->pcm_offset+=samples;
-    if(bitstream)*bitstream=vf->current_link;
-    return(samples*2*channels);
-  }else{
-    return(samples);
-  }
-}
diff --git a/misc/libtremor/window.c b/misc/libtremor/window.c
deleted file mode 100644
index 006a1ee..0000000
--- a/misc/libtremor/window.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: window functions
-
- ********************************************************************/
-
-#include <stdlib.h>
-#include <math.h>
-#include "misc.h"
-#include "window.h"
-#include "window_lookup.h"
-
-const void *_vorbis_window(int type, int left){
-
-  switch(type){
-  case 0:
-
-    switch(left){
-    case 32:
-      return vwin64;
-    case 64:
-      return vwin128;
-    case 128:
-      return vwin256;
-    case 256:
-      return vwin512;
-    case 512:
-      return vwin1024;
-    case 1024:
-      return vwin2048;
-    case 2048:
-      return vwin4096;
-    case 4096:
-      return vwin8192;
-    default:
-      return(0);
-    }
-    break;
-  default:
-    return(0);
-  }
-}
-
-void _vorbis_apply_window(ogg_int32_t *d,const void *window_p[2],
-			  long *blocksizes,
-			  int lW,int W,int nW){
-  
-  LOOKUP_T *window[2]={window_p[0],window_p[1]};
-  long n=blocksizes[W];
-  long ln=blocksizes[lW];
-  long rn=blocksizes[nW];
-
-  long leftbegin=n/4-ln/4;
-  long leftend=leftbegin+ln/2;
-
-  long rightbegin=n/2+n/4-rn/4;
-  long rightend=rightbegin+rn/2;
-  
-  int i,p;
-
-  for(i=0;i<leftbegin;i++)
-    d[i]=0;
-
-  for(p=0;i<leftend;i++,p++)
-    d[i]=MULT31(d[i],window[lW][p]);
-
-  for(i=rightbegin,p=rn/2-1;i<rightend;i++,p--)
-    d[i]=MULT31(d[i],window[nW][p]);
-
-  for(;i<n;i++)
-    d[i]=0;
-}
diff --git a/misc/libtremor/window.h b/misc/libtremor/window.h
deleted file mode 100644
index 27647fe..0000000
--- a/misc/libtremor/window.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
- *                                                                  *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
- * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
- function: window functions
-
- ********************************************************************/
-
-#ifndef _V_WINDOW_
-#define _V_WINDOW_
-
-extern const void *_vorbis_window(int type,int left);
-extern void _vorbis_apply_window(ogg_int32_t *d,const void *window[2],
-				 long *blocksizes,
-				 int lW,int W,int nW);
-
-
-#endif
diff --git a/misc/loc_gen.txt b/misc/loc_gen.txt
new file mode 100644
index 0000000..3ec30d4
--- /dev/null
+++ b/misc/loc_gen.txt
@@ -0,0 +1,10 @@
+# this is inefficient and clunky, but, figured it might as well be kept somewhere so people are aware of it
+# Is how I'm currently updated the locale files.
+# collect strings - run in Data
+grep -F 'loc("' */*/*.lua | sed 's/)/)\n/g' | sed 's/.*loc(/loc(/;s/).*/)/' | grep loc | sort | uniq  > loc.txt
+# Update locale files - run in Locale
+for i in *.lua;do cat ../loc.txt | while read f;do STR=$(echo "$f" | sed 's/loc("//;s/")\s*$//;s/"/\\"/g');MAPS=$(grep -F -l -- "loc(\"${STR}\")" ../*/*/*.lua ../*/*/*/*.lua | sed 's/.*\/\([^\/]*\)\/map.lua/\1/;s/.*Campaign\/\([^\/]*\)\//\1:/;s/.*\///;s/.lua//;s/ /_/g' | xargs | sed 's/ /, /g');C=$(echo $MAPS | sed 's/,/\n/' | wc -l);grep -Fq -- "[\"${STR}\"]" $i;if(($?));then if((C>0));then echo "--      [\"${STR}\"] = \"\", -- $MAPS" >> $i;else echo "--      [\"${STR}\"] = \"\"," >> $i;fi;fi;done;done
+# sort - run in Locale
+for i in *.lua;do rm temphead temptail templua;cat $i | grep -Ev "}|{" | grep -Ev "^[[:space:]]*$" | sort > templua;echo "locale = {" > temphead;echo "    }" > temptail;cat temphead templua temptail > $i;done
+# drop unused - run in Locale
+cat stub.lua | grep '"] =' | while read f;do PHRASE=$(echo "$f" | sed 's/[^[]*\["//;s/"] =.*//;s/"/\\"/g');CNT=$(grep -Frc "loc(\"$PHRASE\")" ../*/*/*.lua ../*/*/*/*.lua | grep -v ":0" | wc -l);if(($CNT==0));then echo "|$PHRASE|";sed -i "s/.*\[\"$PHRASE\"].*//" *.lua;fi;done
diff --git a/misc/quazip/CMakeLists.txt b/misc/quazip/CMakeLists.txt
index ff405c0..51b8d8a 100644
--- a/misc/quazip/CMakeLists.txt
+++ b/misc/quazip/CMakeLists.txt
@@ -1,7 +1,9 @@
 set(QT_USE_QTCORE TRUE)
 
 find_package(Qt4 REQUIRED)
-include(${QT_USE_FILE})
+if(NOT CROSSAPPLE)
+    include(${QT_USE_FILE})
+endif()
 
 
 file(GLOB SRCS "*.c" "*.cpp")
diff --git a/misc/quazip/crypt.h b/misc/quazip/crypt.h
index 640de0f..1d6da62 100644
--- a/misc/quazip/crypt.h
+++ b/misc/quazip/crypt.h
@@ -1,135 +1,135 @@
-/* crypt.h -- base code for crypt/uncrypt ZIPfile
-
-
-   Version 1.01e, February 12th, 2005
-
-   Copyright (C) 1998-2005 Gilles Vollant
-
-   This code is a modified version of crypting code in Infozip distribution
-
-   The encryption/decryption parts of this source code (as opposed to the
-   non-echoing password parts) were originally written in Europe.  The
-   whole source package can be freely distributed, including from the USA.
-   (Prior to January 2000, re-export from the US was a violation of US law.)
-
-   This encryption code is a direct transcription of the algorithm from
-   Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
-   file (appnote.txt) is distributed with the PKZIP program (even in the
-   version without encryption capabilities).
-
-   If you don't need crypting in your application, just define symbols
-   NOCRYPT and NOUNCRYPT.
-
-   This code support the "Traditional PKWARE Encryption".
-
-   The new AES encryption added on Zip format by Winzip (see the page
-   http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
-   Encryption is not supported.
-*/
-
-#include "quazip_global.h"
-
-#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
-
-/***********************************************************************
- * Return the next byte in the pseudo-random sequence
- */
-static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab UNUSED)
-{
-    //(void) pcrc_32_tab; /* avoid "unused parameter" warning */
-    unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
-                     * unpredictable manner on 16-bit systems; not a problem
-                     * with any known compiler so far, though */
-
-    temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
-    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
-}
-
-/***********************************************************************
- * Update the encryption keys with the next byte of plain text
- */
-static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
-{
-    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
-    (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
-    (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
-    {
-      register int keyshift = (int)((*(pkeys+1)) >> 24);
-      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
-    }
-    return c;
-}
-
-
-/***********************************************************************
- * Initialize the encryption keys and the random header according to
- * the given password.
- */
-static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
-{
-    *(pkeys+0) = 305419896L;
-    *(pkeys+1) = 591751049L;
-    *(pkeys+2) = 878082192L;
-    while (*passwd != '\0') {
-        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
-        passwd++;
-    }
-}
-
-#define zdecode(pkeys,pcrc_32_tab,c) \
-    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
-
-#define zencode(pkeys,pcrc_32_tab,c,t) \
-    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
-
-#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
-
-#define RAND_HEAD_LEN  12
-   /* "last resort" source for second part of crypt seed pattern */
-#  ifndef ZCR_SEED2
-#    define ZCR_SEED2 3141592654UL     /* use PI as default pattern */
-#  endif
-
-static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
-    const char *passwd;         /* password string */
-    unsigned char *buf;         /* where to write header */
-    int bufSize;
-    unsigned long* pkeys;
-    const unsigned long* pcrc_32_tab;
-    unsigned long crcForCrypting;
-{
-    int n;                       /* index in random header */
-    int t;                       /* temporary */
-    int c;                       /* random byte */
-    unsigned char header[RAND_HEAD_LEN-2]; /* random header */
-    static unsigned calls = 0;   /* ensure different random header each time */
-
-    if (bufSize<RAND_HEAD_LEN)
-      return 0;
-
-    /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
-     * output of rand() to get less predictability, since rand() is
-     * often poorly implemented.
-     */
-    if (++calls == 1)
-    {
-        srand((unsigned)(time(NULL) ^ ZCR_SEED2));
-    }
-    init_keys(passwd, pkeys, pcrc_32_tab);
-    for (n = 0; n < RAND_HEAD_LEN-2; n++)
-    {
-        c = (rand() >> 7) & 0xff;
-        header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
-    }
-    /* Encrypt random header (last two bytes is high word of crc) */
-    init_keys(passwd, pkeys, pcrc_32_tab);
-    for (n = 0; n < RAND_HEAD_LEN-2; n++)
-    {
-        buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
-    }
-    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
-    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
-    return n;
-}
-
-#endif
+/* crypt.h -- base code for crypt/uncrypt ZIPfile
+
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This code is a modified version of crypting code in Infozip distribution
+
+   The encryption/decryption parts of this source code (as opposed to the
+   non-echoing password parts) were originally written in Europe.  The
+   whole source package can be freely distributed, including from the USA.
+   (Prior to January 2000, re-export from the US was a violation of US law.)
+
+   This encryption code is a direct transcription of the algorithm from
+   Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
+   file (appnote.txt) is distributed with the PKZIP program (even in the
+   version without encryption capabilities).
+
+   If you don't need crypting in your application, just define symbols
+   NOCRYPT and NOUNCRYPT.
+
+   This code support the "Traditional PKWARE Encryption".
+
+   The new AES encryption added on Zip format by Winzip (see the page
+   http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
+   Encryption is not supported.
+*/
+
+#include "quazip_global.h"
+
+#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
+
+/***********************************************************************
+ * Return the next byte in the pseudo-random sequence
+ */
+static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab UNUSED)
+{
+    //(void) pcrc_32_tab; /* avoid "unused parameter" warning */
+    unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
+                     * unpredictable manner on 16-bit systems; not a problem
+                     * with any known compiler so far, though */
+
+    temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
+    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/***********************************************************************
+ * Update the encryption keys with the next byte of plain text
+ */
+static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
+{
+    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
+    (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
+    (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
+    {
+      register int keyshift = (int)((*(pkeys+1)) >> 24);
+      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
+    }
+    return c;
+}
+
+
+/***********************************************************************
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ */
+static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
+{
+    *(pkeys+0) = 305419896L;
+    *(pkeys+1) = 591751049L;
+    *(pkeys+2) = 878082192L;
+    while (*passwd != '\0') {
+        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
+        passwd++;
+    }
+}
+
+#define zdecode(pkeys,pcrc_32_tab,c) \
+    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
+
+#define zencode(pkeys,pcrc_32_tab,c,t) \
+    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
+
+#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
+
+#define RAND_HEAD_LEN  12
+   /* "last resort" source for second part of crypt seed pattern */
+#  ifndef ZCR_SEED2
+#    define ZCR_SEED2 3141592654UL     /* use PI as default pattern */
+#  endif
+
+static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
+    const char *passwd;         /* password string */
+    unsigned char *buf;         /* where to write header */
+    int bufSize;
+    unsigned long* pkeys;
+    const unsigned long* pcrc_32_tab;
+    unsigned long crcForCrypting;
+{
+    int n;                       /* index in random header */
+    int t;                       /* temporary */
+    int c;                       /* random byte */
+    unsigned char header[RAND_HEAD_LEN-2]; /* random header */
+    static unsigned calls = 0;   /* ensure different random header each time */
+
+    if (bufSize<RAND_HEAD_LEN)
+      return 0;
+
+    /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+     * output of rand() to get less predictability, since rand() is
+     * often poorly implemented.
+     */
+    if (++calls == 1)
+    {
+        srand((unsigned)(time(NULL) ^ ZCR_SEED2));
+    }
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        c = (rand() >> 7) & 0xff;
+        header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
+    }
+    /* Encrypt random header (last two bytes is high word of crc) */
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
+    }
+    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
+    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
+    return n;
+}
+
+#endif
diff --git a/misc/quazip/ioapi.h b/misc/quazip/ioapi.h
index 716dd4b..f4c2180 100644
--- a/misc/quazip/ioapi.h
+++ b/misc/quazip/ioapi.h
@@ -1,77 +1,77 @@
-/* ioapi.h -- IO base function header for compress/uncompress .zip
-   files using zlib + zip or unzip API
-
-   Version 1.01e, February 12th, 2005
-
-   Copyright (C) 1998-2005 Gilles Vollant
-
-   Modified by Sergey A. Tachenov to integrate with Qt.
-*/
-
-#ifndef _ZLIBIOAPI_H
-#define _ZLIBIOAPI_H
-
-
-#define ZLIB_FILEFUNC_SEEK_CUR (1)
-#define ZLIB_FILEFUNC_SEEK_END (2)
-#define ZLIB_FILEFUNC_SEEK_SET (0)
-
-#define ZLIB_FILEFUNC_MODE_READ      (1)
-#define ZLIB_FILEFUNC_MODE_WRITE     (2)
-#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
-
-#define ZLIB_FILEFUNC_MODE_EXISTING (4)
-#define ZLIB_FILEFUNC_MODE_CREATE   (8)
-
-
-#ifndef ZCALLBACK
-
-#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
-#define ZCALLBACK CALLBACK
-#else
-#define ZCALLBACK
-#endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode));
-typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
-typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
-typedef uLong   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
-typedef int   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
-typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
-typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
-
-typedef struct zlib_filefunc_def_s
-{
-    open_file_func      zopen_file;
-    read_file_func      zread_file;
-    write_file_func     zwrite_file;
-    tell_file_func      ztell_file;
-    seek_file_func      zseek_file;
-    close_file_func     zclose_file;
-    testerror_file_func zerror_file;
-    voidpf              opaque;
-} zlib_filefunc_def;
-
-
-
-void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
-
-#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
-#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
-#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
-#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
-#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
-#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+   files using zlib + zip or unzip API
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   Modified by Sergey A. Tachenov to integrate with Qt.
+*/
+
+#ifndef _ZLIBIOAPI_H
+#define _ZLIBIOAPI_H
+
+
+#define ZLIB_FILEFUNC_SEEK_CUR (1)
+#define ZLIB_FILEFUNC_SEEK_END (2)
+#define ZLIB_FILEFUNC_SEEK_SET (0)
+
+#define ZLIB_FILEFUNC_MODE_READ      (1)
+#define ZLIB_FILEFUNC_MODE_WRITE     (2)
+#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
+
+#define ZLIB_FILEFUNC_MODE_EXISTING (4)
+#define ZLIB_FILEFUNC_MODE_CREATE   (8)
+
+
+#ifndef ZCALLBACK
+
+#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
+#define ZCALLBACK CALLBACK
+#else
+#define ZCALLBACK
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode));
+typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+typedef uLong   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
+typedef int   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
+typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
+
+typedef struct zlib_filefunc_def_s
+{
+    open_file_func      zopen_file;
+    read_file_func      zread_file;
+    write_file_func     zwrite_file;
+    tell_file_func      ztell_file;
+    seek_file_func      zseek_file;
+    close_file_func     zclose_file;
+    testerror_file_func zerror_file;
+    voidpf              opaque;
+} zlib_filefunc_def;
+
+
+
+void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
+
+#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
+#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
+#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
+#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
+#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
+#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/misc/quazip/qioapi.cpp b/misc/quazip/qioapi.cpp
index 407e2f8..49cb02e 100644
--- a/misc/quazip/qioapi.cpp
+++ b/misc/quazip/qioapi.cpp
@@ -1,142 +1,142 @@
-/* ioapi.c -- IO base function header for compress/uncompress .zip
-   files using zlib + zip or unzip API
-
-   Version 1.01e, February 12th, 2005
-
-   Copyright (C) 1998-2005 Gilles Vollant
-
-   Modified by Sergey A. Tachenov to integrate with Qt.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "zlib.h"
-#include "ioapi.h"
-#include "quazip_global.h"
-#include <QIODevice>
-
-
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR    1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END    2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET    0
-#endif
-
-voidpf ZCALLBACK qiodevice_open_file_func (
-   voidpf opaque UNUSED,
-   voidpf file,
-   int mode)
-{
-    QIODevice *iodevice = reinterpret_cast<QIODevice*>(file);
-    if(iodevice->isSequential())
-        return NULL;
-    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
-        iodevice->open(QIODevice::ReadOnly);
-    else
-    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
-        iodevice->open(QIODevice::ReadWrite);
-    else
-    if (mode & ZLIB_FILEFUNC_MODE_CREATE)
-        iodevice->open(QIODevice::WriteOnly);
-
-    if(iodevice->isOpen())
-        return iodevice;
-    else
-        return NULL;
-}
-
-
-uLong ZCALLBACK qiodevice_read_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream,
-   void* buf,
-   uLong size)
-{
-    uLong ret;
-    ret = (uLong)((QIODevice*)stream)->read((char*)buf,size);
-    return ret;
-}
-
-
-uLong ZCALLBACK qiodevice_write_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream,
-   const void* buf,
-   uLong size)
-{
-    uLong ret;
-    ret = (uLong)((QIODevice*)stream)->write((char*)buf,size);
-    return ret;
-}
-
-uLong ZCALLBACK qiodevice_tell_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream)
-{
-    uLong ret;
-    ret = ((QIODevice*)stream)->pos();
-    return ret;
-}
-
-int ZCALLBACK qiodevice_seek_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream,
-   uLong offset,
-   int origin)
-{
-    uLong qiodevice_seek_result=0;
-    int ret;
-    switch (origin)
-    {
-    case ZLIB_FILEFUNC_SEEK_CUR :
-        qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset;
-        break;
-    case ZLIB_FILEFUNC_SEEK_END :
-        qiodevice_seek_result = ((QIODevice*)stream)->size() - offset;
-        break;
-    case ZLIB_FILEFUNC_SEEK_SET :
-        qiodevice_seek_result = offset;
-        break;
-    default: return -1;
-    }
-    ret = !((QIODevice*)stream)->seek(qiodevice_seek_result);
-    return ret;
-}
-
-int ZCALLBACK qiodevice_close_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream)
-{
-    ((QIODevice*)stream)->close();
-    return 0;
-}
-
-int ZCALLBACK qiodevice_error_file_func (
-   voidpf opaque UNUSED,
-   voidpf stream)
-{
-    return !((QIODevice*)stream)->errorString().isEmpty();
-}
-
-void fill_qiodevice_filefunc (
-  zlib_filefunc_def* pzlib_filefunc_def)
-{
-    pzlib_filefunc_def->zopen_file = qiodevice_open_file_func;
-    pzlib_filefunc_def->zread_file = qiodevice_read_file_func;
-    pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func;
-    pzlib_filefunc_def->ztell_file = qiodevice_tell_file_func;
-    pzlib_filefunc_def->zseek_file = qiodevice_seek_file_func;
-    pzlib_filefunc_def->zclose_file = qiodevice_close_file_func;
-    pzlib_filefunc_def->zerror_file = qiodevice_error_file_func;
-    pzlib_filefunc_def->opaque = NULL;
-}
+/* ioapi.c -- IO base function header for compress/uncompress .zip
+   files using zlib + zip or unzip API
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   Modified by Sergey A. Tachenov to integrate with Qt.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "zlib.h"
+#include "ioapi.h"
+#include "quazip_global.h"
+#include <QIODevice>
+
+
+/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
+
+#ifndef SEEK_CUR
+#define SEEK_CUR    1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END    2
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET    0
+#endif
+
+voidpf ZCALLBACK qiodevice_open_file_func (
+   voidpf opaque UNUSED,
+   voidpf file,
+   int mode)
+{
+    QIODevice *iodevice = reinterpret_cast<QIODevice*>(file);
+    if(iodevice->isSequential())
+        return NULL;
+    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+        iodevice->open(QIODevice::ReadOnly);
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+        iodevice->open(QIODevice::ReadWrite);
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+        iodevice->open(QIODevice::WriteOnly);
+
+    if(iodevice->isOpen())
+        return iodevice;
+    else
+        return NULL;
+}
+
+
+uLong ZCALLBACK qiodevice_read_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream,
+   void* buf,
+   uLong size)
+{
+    uLong ret;
+    ret = (uLong)((QIODevice*)stream)->read((char*)buf,size);
+    return ret;
+}
+
+
+uLong ZCALLBACK qiodevice_write_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream,
+   const void* buf,
+   uLong size)
+{
+    uLong ret;
+    ret = (uLong)((QIODevice*)stream)->write((char*)buf,size);
+    return ret;
+}
+
+uLong ZCALLBACK qiodevice_tell_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream)
+{
+    uLong ret;
+    ret = ((QIODevice*)stream)->pos();
+    return ret;
+}
+
+int ZCALLBACK qiodevice_seek_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream,
+   uLong offset,
+   int origin)
+{
+    uLong qiodevice_seek_result=0;
+    int ret;
+    switch (origin)
+    {
+    case ZLIB_FILEFUNC_SEEK_CUR :
+        qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset;
+        break;
+    case ZLIB_FILEFUNC_SEEK_END :
+        qiodevice_seek_result = ((QIODevice*)stream)->size() - offset;
+        break;
+    case ZLIB_FILEFUNC_SEEK_SET :
+        qiodevice_seek_result = offset;
+        break;
+    default: return -1;
+    }
+    ret = !((QIODevice*)stream)->seek(qiodevice_seek_result);
+    return ret;
+}
+
+int ZCALLBACK qiodevice_close_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream)
+{
+    ((QIODevice*)stream)->close();
+    return 0;
+}
+
+int ZCALLBACK qiodevice_error_file_func (
+   voidpf opaque UNUSED,
+   voidpf stream)
+{
+    return !((QIODevice*)stream)->errorString().isEmpty();
+}
+
+void fill_qiodevice_filefunc (
+  zlib_filefunc_def* pzlib_filefunc_def)
+{
+    pzlib_filefunc_def->zopen_file = qiodevice_open_file_func;
+    pzlib_filefunc_def->zread_file = qiodevice_read_file_func;
+    pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func;
+    pzlib_filefunc_def->ztell_file = qiodevice_tell_file_func;
+    pzlib_filefunc_def->zseek_file = qiodevice_seek_file_func;
+    pzlib_filefunc_def->zclose_file = qiodevice_close_file_func;
+    pzlib_filefunc_def->zerror_file = qiodevice_error_file_func;
+    pzlib_filefunc_def->opaque = NULL;
+}
diff --git a/misc/quazip/quazip.cpp b/misc/quazip/quazip.cpp
index cddf0df..06e63fd 100644
--- a/misc/quazip/quazip.cpp
+++ b/misc/quazip/quazip.cpp
@@ -1,427 +1,427 @@
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include <QFile>
-
-#include "quazip.h"
-
-class QuaZipPrivate {
-  friend class QuaZip;
-  private:
-    QTextCodec *fileNameCodec, *commentCodec;
-    QString zipName;
-    QIODevice *ioDevice;
-    QString comment;
-    QuaZip::Mode mode;
-    union {
-      unzFile unzFile_f;
-      zipFile zipFile_f;
-    };
-    bool hasCurrentFile_f;
-    int zipError;
-    inline QuaZipPrivate():
-      fileNameCodec(QTextCodec::codecForLocale()),
-      commentCodec(QTextCodec::codecForLocale()),
-      ioDevice(NULL),
-      mode(QuaZip::mdNotOpen),
-      hasCurrentFile_f(false),
-      zipError(UNZ_OK) {}
-    inline QuaZipPrivate(const QString &zipName):
-      fileNameCodec(QTextCodec::codecForLocale()),
-      commentCodec(QTextCodec::codecForLocale()),
-      zipName(zipName),
-      ioDevice(NULL),
-      mode(QuaZip::mdNotOpen),
-      hasCurrentFile_f(false),
-      zipError(UNZ_OK) {}
-    inline QuaZipPrivate(QIODevice *ioDevice):
-      fileNameCodec(QTextCodec::codecForLocale()),
-      commentCodec(QTextCodec::codecForLocale()),
-      ioDevice(ioDevice),
-      mode(QuaZip::mdNotOpen),
-      hasCurrentFile_f(false),
-      zipError(UNZ_OK) {}
-};
-
-QuaZip::QuaZip():
-  p(new QuaZipPrivate())
-{
-}
-
-QuaZip::QuaZip(const QString& zipName):
-  p(new QuaZipPrivate(zipName))
-{
-}
-
-QuaZip::QuaZip(QIODevice *ioDevice):
-  p(new QuaZipPrivate(ioDevice))
-{
-}
-
-QuaZip::~QuaZip()
-{
-  if(isOpen())
-    close();
-  delete p;
-}
-
-bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi)
-{
-  p->zipError=UNZ_OK;
-  if(isOpen()) {
-    qWarning("QuaZip::open(): ZIP already opened");
-    return false;
-  }
-  QIODevice *ioDevice = p->ioDevice;
-  if (ioDevice == NULL) {
-    if (p->zipName.isEmpty()) {
-      qWarning("QuaZip::open(): set either ZIP file name or IO device first");
-      return false;
-    } else {
-      ioDevice = new QFile(p->zipName);
-    }
-  }
-  switch(mode) {
-    case mdUnzip:
-      p->unzFile_f=unzOpen2(ioDevice, ioApi);
-      if(p->unzFile_f!=NULL) {
-        p->mode=mode;
-        p->ioDevice = ioDevice;
-        return true;
-      } else {
-        p->zipError=UNZ_OPENERROR;
-        if (!p->zipName.isEmpty())
-          delete ioDevice;
-        return false;
-      }
-    case mdCreate:
-    case mdAppend:
-    case mdAdd:
-      p->zipFile_f=zipOpen2(ioDevice,
-          mode==mdCreate?APPEND_STATUS_CREATE:
-          mode==mdAppend?APPEND_STATUS_CREATEAFTER:
-          APPEND_STATUS_ADDINZIP,
-          NULL,
-          ioApi);
-      if(p->zipFile_f!=NULL) {
-        p->mode=mode;
-        p->ioDevice = ioDevice;
-        return true;
-      } else {
-        p->zipError=UNZ_OPENERROR;
-        if (!p->zipName.isEmpty())
-          delete ioDevice;
-        return false;
-      }
-    default:
-      qWarning("QuaZip::open(): unknown mode: %d", (int)mode);
-      if (!p->zipName.isEmpty())
-        delete ioDevice;
-      return false;
-      break;
-  }
-}
-
-void QuaZip::close()
-{
-  p->zipError=UNZ_OK;
-  switch(p->mode) {
-    case mdNotOpen:
-      qWarning("QuaZip::close(): ZIP is not open");
-      return;
-    case mdUnzip:
-      p->zipError=unzClose(p->unzFile_f);
-      break;
-    case mdCreate:
-    case mdAppend:
-    case mdAdd:
-      p->zipError=zipClose(p->zipFile_f, p->commentCodec->fromUnicode(p->comment).constData());
-      break;
-    default:
-      qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode);
-      return;
-  }
-  // opened by name, need to delete the internal IO device
-  if (!p->zipName.isEmpty())
-    delete p->ioDevice;
-  if(p->zipError==UNZ_OK)
-    p->mode=mdNotOpen;
-}
-
-void QuaZip::setZipName(const QString& zipName)
-{
-  if(isOpen()) {
-    qWarning("QuaZip::setZipName(): ZIP is already open!");
-    return;
-  }
-  p->zipName=zipName;
-  p->ioDevice = NULL;
-}
-
-void QuaZip::setIoDevice(QIODevice *ioDevice)
-{
-  if(isOpen()) {
-    qWarning("QuaZip::setIoDevice(): ZIP is already open!");
-    return;
-  }
-  p->ioDevice = ioDevice;
-  p->zipName = QString();
-}
-
-int QuaZip::getEntriesCount()const
-{
-  QuaZip *fakeThis=(QuaZip*)this; // non-const
-  fakeThis->p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode");
-    return -1;
-  }
-  unz_global_info globalInfo;
-  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
-    return p->zipError;
-  return (int)globalInfo.number_entry;
-}
-
-QString QuaZip::getComment()const
-{
-  QuaZip *fakeThis=(QuaZip*)this; // non-const
-  fakeThis->p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode");
-    return QString();
-  }
-  unz_global_info globalInfo;
-  QByteArray comment;
-  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
-    return QString();
-  comment.resize(globalInfo.size_comment);
-  if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0)
-    return QString();
-  fakeThis->p->zipError = UNZ_OK;
-  return p->commentCodec->toUnicode(comment);
-}
-
-bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs)
-{
-  p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode");
-    return false;
-  }
-  if(fileName.isEmpty()) {
-    p->hasCurrentFile_f=false;
-    return true;
-  }
-  // Unicode-aware reimplementation of the unzLocateFile function
-  if(p->unzFile_f==NULL) {
-    p->zipError=UNZ_PARAMERROR;
-    return false;
-  }
-  if(fileName.length()>MAX_FILE_NAME_LENGTH) {
-    p->zipError=UNZ_PARAMERROR;
-    return false;
-  }
-  bool sens;
-  if(cs==csDefault) {
-#ifdef Q_WS_WIN
-    sens=false;
-#else
-    sens=true;
-#endif
-  } else sens=cs==csSensitive;
-  QString lower, current;
-  if(!sens) lower=fileName.toLower();
-  p->hasCurrentFile_f=false;
-  for(bool more=goToFirstFile(); more; more=goToNextFile()) {
-    current=getCurrentFileName();
-    if(current.isEmpty()) return false;
-    if(sens) {
-      if(current==fileName) break;
-    } else {
-      if(current.toLower()==lower) break;
-    }
-  }
-  return p->hasCurrentFile_f;
-}
-
-bool QuaZip::goToFirstFile()
-{
-  p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
-    return false;
-  }
-  p->zipError=unzGoToFirstFile(p->unzFile_f);
-  p->hasCurrentFile_f=p->zipError==UNZ_OK;
-  return p->hasCurrentFile_f;
-}
-
-bool QuaZip::goToNextFile()
-{
-  p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
-    return false;
-  }
-  p->zipError=unzGoToNextFile(p->unzFile_f);
-  p->hasCurrentFile_f=p->zipError==UNZ_OK;
-  if(p->zipError==UNZ_END_OF_LIST_OF_FILE)
-    p->zipError=UNZ_OK;
-  return p->hasCurrentFile_f;
-}
-
-bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const
-{
-  QuaZip *fakeThis=(QuaZip*)this; // non-const
-  fakeThis->p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode");
-    return false;
-  }
-  unz_file_info info_z;
-  QByteArray fileName;
-  QByteArray extra;
-  QByteArray comment;
-  if(info==NULL) return false;
-  if(!isOpen()||!hasCurrentFile()) return false;
-  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK)
-    return false;
-  fileName.resize(info_z.size_filename);
-  extra.resize(info_z.size_file_extra);
-  comment.resize(info_z.size_file_comment);
-  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL,
-      fileName.data(), fileName.size(),
-      extra.data(), extra.size(),
-      comment.data(), comment.size()))!=UNZ_OK)
-    return false;
-  info->versionCreated=info_z.version;
-  info->versionNeeded=info_z.version_needed;
-  info->flags=info_z.flag;
-  info->method=info_z.compression_method;
-  info->crc=info_z.crc;
-  info->compressedSize=info_z.compressed_size;
-  info->uncompressedSize=info_z.uncompressed_size;
-  info->diskNumberStart=info_z.disk_num_start;
-  info->internalAttr=info_z.internal_fa;
-  info->externalAttr=info_z.external_fa;
-  info->name=p->fileNameCodec->toUnicode(fileName);
-  info->comment=p->commentCodec->toUnicode(comment);
-  info->extra=extra;
-  info->dateTime=QDateTime(
-      QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday),
-      QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec));
-  return true;
-}
-
-QString QuaZip::getCurrentFileName()const
-{
-  QuaZip *fakeThis=(QuaZip*)this; // non-const
-  fakeThis->p->zipError=UNZ_OK;
-  if(p->mode!=mdUnzip) {
-    qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode");
-    return QString();
-  }
-  if(!isOpen()||!hasCurrentFile()) return QString();
-  QByteArray fileName(MAX_FILE_NAME_LENGTH, 0);
-  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, fileName.data(), fileName.size(),
-      NULL, 0, NULL, 0))!=UNZ_OK)
-    return QString();
-  return p->fileNameCodec->toUnicode(fileName.constData());
-}
-
-void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec)
-{
-  p->fileNameCodec=fileNameCodec;
-}
-
-void QuaZip::setFileNameCodec(const char *fileNameCodecName)
-{
-  p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName);
-}
-
-QTextCodec *QuaZip::getFileNameCodec()const
-{
-  return p->fileNameCodec;
-}
-
-void QuaZip::setCommentCodec(QTextCodec *commentCodec)
-{
-  p->commentCodec=commentCodec;
-}
-
-void QuaZip::setCommentCodec(const char *commentCodecName)
-{
-  p->commentCodec=QTextCodec::codecForName(commentCodecName);
-}
-
-QTextCodec *QuaZip::getCommentCodec()const
-{
-  return p->commentCodec;
-}
-
-QString QuaZip::getZipName() const
-{
-  return p->zipName;
-}
-
-QIODevice *QuaZip::getIoDevice() const
-{
-  if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice
-    return NULL;
-  return p->ioDevice;
-}
-
-QuaZip::Mode QuaZip::getMode()const
-{
-  return p->mode;
-}
-
-bool QuaZip::isOpen()const
-{
-  return p->mode!=mdNotOpen;
-}
-
-int QuaZip::getZipError() const
-{
-  return p->zipError;
-}
-
-void QuaZip::setComment(const QString& comment)
-{
-  p->comment=comment;
-}
-
-bool QuaZip::hasCurrentFile()const
-{
-  return p->hasCurrentFile_f;
-}
-
-unzFile QuaZip::getUnzFile()
-{
-  return p->unzFile_f;
-}
-
-zipFile QuaZip::getZipFile()
-{
-  return p->zipFile_f;
-}
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include <QFile>
+
+#include "quazip.h"
+
+class QuaZipPrivate {
+  friend class QuaZip;
+  private:
+    QTextCodec *fileNameCodec, *commentCodec;
+    QString zipName;
+    QIODevice *ioDevice;
+    QString comment;
+    QuaZip::Mode mode;
+    union {
+      unzFile unzFile_f;
+      zipFile zipFile_f;
+    };
+    bool hasCurrentFile_f;
+    int zipError;
+    inline QuaZipPrivate():
+      fileNameCodec(QTextCodec::codecForLocale()),
+      commentCodec(QTextCodec::codecForLocale()),
+      ioDevice(NULL),
+      mode(QuaZip::mdNotOpen),
+      hasCurrentFile_f(false),
+      zipError(UNZ_OK) {}
+    inline QuaZipPrivate(const QString &zipName):
+      fileNameCodec(QTextCodec::codecForLocale()),
+      commentCodec(QTextCodec::codecForLocale()),
+      zipName(zipName),
+      ioDevice(NULL),
+      mode(QuaZip::mdNotOpen),
+      hasCurrentFile_f(false),
+      zipError(UNZ_OK) {}
+    inline QuaZipPrivate(QIODevice *ioDevice):
+      fileNameCodec(QTextCodec::codecForLocale()),
+      commentCodec(QTextCodec::codecForLocale()),
+      ioDevice(ioDevice),
+      mode(QuaZip::mdNotOpen),
+      hasCurrentFile_f(false),
+      zipError(UNZ_OK) {}
+};
+
+QuaZip::QuaZip():
+  p(new QuaZipPrivate())
+{
+}
+
+QuaZip::QuaZip(const QString& zipName):
+  p(new QuaZipPrivate(zipName))
+{
+}
+
+QuaZip::QuaZip(QIODevice *ioDevice):
+  p(new QuaZipPrivate(ioDevice))
+{
+}
+
+QuaZip::~QuaZip()
+{
+  if(isOpen())
+    close();
+  delete p;
+}
+
+bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi)
+{
+  p->zipError=UNZ_OK;
+  if(isOpen()) {
+    qWarning("QuaZip::open(): ZIP already opened");
+    return false;
+  }
+  QIODevice *ioDevice = p->ioDevice;
+  if (ioDevice == NULL) {
+    if (p->zipName.isEmpty()) {
+      qWarning("QuaZip::open(): set either ZIP file name or IO device first");
+      return false;
+    } else {
+      ioDevice = new QFile(p->zipName);
+    }
+  }
+  switch(mode) {
+    case mdUnzip:
+      p->unzFile_f=unzOpen2(ioDevice, ioApi);
+      if(p->unzFile_f!=NULL) {
+        p->mode=mode;
+        p->ioDevice = ioDevice;
+        return true;
+      } else {
+        p->zipError=UNZ_OPENERROR;
+        if (!p->zipName.isEmpty())
+          delete ioDevice;
+        return false;
+      }
+    case mdCreate:
+    case mdAppend:
+    case mdAdd:
+      p->zipFile_f=zipOpen2(ioDevice,
+          mode==mdCreate?APPEND_STATUS_CREATE:
+          mode==mdAppend?APPEND_STATUS_CREATEAFTER:
+          APPEND_STATUS_ADDINZIP,
+          NULL,
+          ioApi);
+      if(p->zipFile_f!=NULL) {
+        p->mode=mode;
+        p->ioDevice = ioDevice;
+        return true;
+      } else {
+        p->zipError=UNZ_OPENERROR;
+        if (!p->zipName.isEmpty())
+          delete ioDevice;
+        return false;
+      }
+    default:
+      qWarning("QuaZip::open(): unknown mode: %d", (int)mode);
+      if (!p->zipName.isEmpty())
+        delete ioDevice;
+      return false;
+      break;
+  }
+}
+
+void QuaZip::close()
+{
+  p->zipError=UNZ_OK;
+  switch(p->mode) {
+    case mdNotOpen:
+      qWarning("QuaZip::close(): ZIP is not open");
+      return;
+    case mdUnzip:
+      p->zipError=unzClose(p->unzFile_f);
+      break;
+    case mdCreate:
+    case mdAppend:
+    case mdAdd:
+      p->zipError=zipClose(p->zipFile_f, p->commentCodec->fromUnicode(p->comment).constData());
+      break;
+    default:
+      qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode);
+      return;
+  }
+  // opened by name, need to delete the internal IO device
+  if (!p->zipName.isEmpty())
+    delete p->ioDevice;
+  if(p->zipError==UNZ_OK)
+    p->mode=mdNotOpen;
+}
+
+void QuaZip::setZipName(const QString& zipName)
+{
+  if(isOpen()) {
+    qWarning("QuaZip::setZipName(): ZIP is already open!");
+    return;
+  }
+  p->zipName=zipName;
+  p->ioDevice = NULL;
+}
+
+void QuaZip::setIoDevice(QIODevice *ioDevice)
+{
+  if(isOpen()) {
+    qWarning("QuaZip::setIoDevice(): ZIP is already open!");
+    return;
+  }
+  p->ioDevice = ioDevice;
+  p->zipName = QString();
+}
+
+int QuaZip::getEntriesCount()const
+{
+  QuaZip *fakeThis=(QuaZip*)this; // non-const
+  fakeThis->p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode");
+    return -1;
+  }
+  unz_global_info globalInfo;
+  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
+    return p->zipError;
+  return (int)globalInfo.number_entry;
+}
+
+QString QuaZip::getComment()const
+{
+  QuaZip *fakeThis=(QuaZip*)this; // non-const
+  fakeThis->p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode");
+    return QString();
+  }
+  unz_global_info globalInfo;
+  QByteArray comment;
+  if((fakeThis->p->zipError=unzGetGlobalInfo(p->unzFile_f, &globalInfo))!=UNZ_OK)
+    return QString();
+  comment.resize(globalInfo.size_comment);
+  if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0)
+    return QString();
+  fakeThis->p->zipError = UNZ_OK;
+  return p->commentCodec->toUnicode(comment);
+}
+
+bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs)
+{
+  p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode");
+    return false;
+  }
+  if(fileName.isEmpty()) {
+    p->hasCurrentFile_f=false;
+    return true;
+  }
+  // Unicode-aware reimplementation of the unzLocateFile function
+  if(p->unzFile_f==NULL) {
+    p->zipError=UNZ_PARAMERROR;
+    return false;
+  }
+  if(fileName.length()>MAX_FILE_NAME_LENGTH) {
+    p->zipError=UNZ_PARAMERROR;
+    return false;
+  }
+  bool sens;
+  if(cs==csDefault) {
+#ifdef Q_WS_WIN
+    sens=false;
+#else
+    sens=true;
+#endif
+  } else sens=cs==csSensitive;
+  QString lower, current;
+  if(!sens) lower=fileName.toLower();
+  p->hasCurrentFile_f=false;
+  for(bool more=goToFirstFile(); more; more=goToNextFile()) {
+    current=getCurrentFileName();
+    if(current.isEmpty()) return false;
+    if(sens) {
+      if(current==fileName) break;
+    } else {
+      if(current.toLower()==lower) break;
+    }
+  }
+  return p->hasCurrentFile_f;
+}
+
+bool QuaZip::goToFirstFile()
+{
+  p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
+    return false;
+  }
+  p->zipError=unzGoToFirstFile(p->unzFile_f);
+  p->hasCurrentFile_f=p->zipError==UNZ_OK;
+  return p->hasCurrentFile_f;
+}
+
+bool QuaZip::goToNextFile()
+{
+  p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode");
+    return false;
+  }
+  p->zipError=unzGoToNextFile(p->unzFile_f);
+  p->hasCurrentFile_f=p->zipError==UNZ_OK;
+  if(p->zipError==UNZ_END_OF_LIST_OF_FILE)
+    p->zipError=UNZ_OK;
+  return p->hasCurrentFile_f;
+}
+
+bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const
+{
+  QuaZip *fakeThis=(QuaZip*)this; // non-const
+  fakeThis->p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode");
+    return false;
+  }
+  unz_file_info info_z;
+  QByteArray fileName;
+  QByteArray extra;
+  QByteArray comment;
+  if(info==NULL) return false;
+  if(!isOpen()||!hasCurrentFile()) return false;
+  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK)
+    return false;
+  fileName.resize(info_z.size_filename);
+  extra.resize(info_z.size_file_extra);
+  comment.resize(info_z.size_file_comment);
+  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL,
+      fileName.data(), fileName.size(),
+      extra.data(), extra.size(),
+      comment.data(), comment.size()))!=UNZ_OK)
+    return false;
+  info->versionCreated=info_z.version;
+  info->versionNeeded=info_z.version_needed;
+  info->flags=info_z.flag;
+  info->method=info_z.compression_method;
+  info->crc=info_z.crc;
+  info->compressedSize=info_z.compressed_size;
+  info->uncompressedSize=info_z.uncompressed_size;
+  info->diskNumberStart=info_z.disk_num_start;
+  info->internalAttr=info_z.internal_fa;
+  info->externalAttr=info_z.external_fa;
+  info->name=p->fileNameCodec->toUnicode(fileName);
+  info->comment=p->commentCodec->toUnicode(comment);
+  info->extra=extra;
+  info->dateTime=QDateTime(
+      QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday),
+      QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec));
+  return true;
+}
+
+QString QuaZip::getCurrentFileName()const
+{
+  QuaZip *fakeThis=(QuaZip*)this; // non-const
+  fakeThis->p->zipError=UNZ_OK;
+  if(p->mode!=mdUnzip) {
+    qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode");
+    return QString();
+  }
+  if(!isOpen()||!hasCurrentFile()) return QString();
+  QByteArray fileName(MAX_FILE_NAME_LENGTH, 0);
+  if((fakeThis->p->zipError=unzGetCurrentFileInfo(p->unzFile_f, NULL, fileName.data(), fileName.size(),
+      NULL, 0, NULL, 0))!=UNZ_OK)
+    return QString();
+  return p->fileNameCodec->toUnicode(fileName.constData());
+}
+
+void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec)
+{
+  p->fileNameCodec=fileNameCodec;
+}
+
+void QuaZip::setFileNameCodec(const char *fileNameCodecName)
+{
+  p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName);
+}
+
+QTextCodec *QuaZip::getFileNameCodec()const
+{
+  return p->fileNameCodec;
+}
+
+void QuaZip::setCommentCodec(QTextCodec *commentCodec)
+{
+  p->commentCodec=commentCodec;
+}
+
+void QuaZip::setCommentCodec(const char *commentCodecName)
+{
+  p->commentCodec=QTextCodec::codecForName(commentCodecName);
+}
+
+QTextCodec *QuaZip::getCommentCodec()const
+{
+  return p->commentCodec;
+}
+
+QString QuaZip::getZipName() const
+{
+  return p->zipName;
+}
+
+QIODevice *QuaZip::getIoDevice() const
+{
+  if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice
+    return NULL;
+  return p->ioDevice;
+}
+
+QuaZip::Mode QuaZip::getMode()const
+{
+  return p->mode;
+}
+
+bool QuaZip::isOpen()const
+{
+  return p->mode!=mdNotOpen;
+}
+
+int QuaZip::getZipError() const
+{
+  return p->zipError;
+}
+
+void QuaZip::setComment(const QString& comment)
+{
+  p->comment=comment;
+}
+
+bool QuaZip::hasCurrentFile()const
+{
+  return p->hasCurrentFile_f;
+}
+
+unzFile QuaZip::getUnzFile()
+{
+  return p->unzFile_f;
+}
+
+zipFile QuaZip::getZipFile()
+{
+  return p->zipFile_f;
+}
diff --git a/misc/quazip/quazip.h b/misc/quazip/quazip.h
index 396c3e8..a21fb92 100644
--- a/misc/quazip/quazip.h
+++ b/misc/quazip/quazip.h
@@ -1,359 +1,359 @@
-#ifndef QUA_ZIP_H
-#define QUA_ZIP_H
-
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include <QString>
-#include <QTextCodec>
-
-#include "zip.h"
-#include "unzip.h"
-
-#include "quazip_global.h"
-#include "quazipfileinfo.h"
-
-// just in case it will be defined in the later versions of the ZIP/UNZIP
-#ifndef UNZ_OPENERROR
-// define additional error code
-#define UNZ_OPENERROR -1000
-#endif
-
-class QuaZipPrivate;
-
-/// ZIP archive.
-/** \class QuaZip quazip.h <quazip/quazip.h>
- * This class implements basic interface to the ZIP archive. It can be
- * used to read table contents of the ZIP archive and retreiving
- * information about the files inside it.
- *
- * You can also use this class to open files inside archive by passing
- * pointer to the instance of this class to the constructor of the
- * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*)
- * for the possible pitfalls.
- *
- * This class is indended to provide interface to the ZIP subpackage of
- * the ZIP/UNZIP package as well as to the UNZIP subpackage. But
- * currently it supports only UNZIP.
- *
- * The use of this class is simple - just create instance using
- * constructor, then set ZIP archive file name using setFile() function
- * (if you did not passed the name to the constructor), then open() and
- * then use different functions to work with it! Well, if you are
- * paranoid, you may also wish to call close before destructing the
- * instance, to check for errors on close.
- *
- * You may also use getUnzFile() and getZipFile() functions to get the
- * ZIP archive handle and use it with ZIP/UNZIP package API directly.
- *
- * This class supports localized file names inside ZIP archive, but you
- * have to set up proper codec with setCodec() function. By default,
- * locale codec will be used, which is probably ok for UNIX systems, but
- * will almost certainly fail with ZIP archives created in Windows. This
- * is because Windows ZIP programs have strange habit of using DOS
- * encoding for file names in ZIP archives. For example, ZIP archive
- * with cyrillic names created in Windows will have file names in \c
- * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one
- * function is not much trouble, but for true platform independency it
- * would be nice to have some mechanism for file name encoding auto
- * detection using locale information. Does anyone know a good way to do
- * it?
- **/
-class QUAZIP_EXPORT QuaZip {
-  friend class QuaZipPrivate;
-  public:
-    /// Useful constants.
-    enum Constants {
-      MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from
-                                 \c UNZ_MAXFILENAMEINZIP constant in
-                                 unzip.c. */
-    };
-    /// Open mode of the ZIP file.
-    enum Mode {
-      mdNotOpen, ///< ZIP file is not open. This is the initial mode.
-      mdUnzip, ///< ZIP file is open for reading files inside it.
-      mdCreate, ///< ZIP file was created with open() call.
-      mdAppend, /**< ZIP file was opened in append mode. This refers to
-                  * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package
-                  * and means that zip is appended to some existing file
-                  * what is useful when that file contains
-                  * self-extractor code. This is obviously \em not what
-                  * you whant to use to add files to the existing ZIP
-                  * archive.
-                  **/
-      mdAdd ///< ZIP file was opened for adding files in the archive.
-    };
-    /// Case sensitivity for the file names.
-    /** This is what you specify when accessing files in the archive.
-     * Works perfectly fine with any characters thanks to Qt's great
-     * unicode support. This is different from ZIP/UNZIP API, where
-     * only US-ASCII characters was supported.
-     **/
-    enum CaseSensitivity {
-      csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows.
-      csSensitive=1, ///< Case sensitive.
-      csInsensitive=2 ///< Case insensitive.
-    };
-  private:
-    QuaZipPrivate *p;
-    // not (and will not be) implemented
-    QuaZip(const QuaZip& that);
-    // not (and will not be) implemented
-    QuaZip& operator=(const QuaZip& that);
-  public:
-    /// Constructs QuaZip object.
-    /** Call setName() before opening constructed object. */
-    QuaZip();
-    /// Constructs QuaZip object associated with ZIP file \a zipName.
-    QuaZip(const QString& zipName);
-    /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice.
-    /** The IO device must be seekable, otherwise an error will occur when opening. */
-    QuaZip(QIODevice *ioDevice);
-    /// Destroys QuaZip object.
-    /** Calls close() if necessary. */
-    ~QuaZip();
-    /// Opens ZIP file.
-    /**
-     * Argument \a mode specifies open mode of the ZIP archive. See Mode
-     * for details. Note that there is zipOpen2() function in the
-     * ZIP/UNZIP API which accepts \a globalcomment argument, but it
-     * does not use it anywhere, so this open() function does not have this
-     * argument. See setComment() if you need to set global comment.
-     *
-     * If the ZIP file is accessed via explicitly set QIODevice, then
-     * this device is opened in the necessary mode. If the device was
-     * already opened by some other means, then the behaviour is defined by
-     * the device implementation, but generally it is not a very good
-     * idea. For example, QFile will at least issue a warning.
-     *
-     * \return \c true if successful, \c false otherwise.
-     *
-     * \note ZIP/UNZIP API open calls do not return error code - they
-     * just return \c NULL indicating an error. But to make things
-     * easier, quazip.h header defines additional error code \c
-     * UNZ_ERROROPEN and getZipError() will return it if the open call
-     * of the ZIP/UNZIP API returns \c NULL.
-     *
-     * Argument \a ioApi specifies IO function set for ZIP/UNZIP
-     * package to use. See unzip.h, zip.h and ioapi.h for details. Note
-     * that IO API for QuaZip is different from the original package.
-     * The file path argument was changed to be of type \c voidpf, and
-     * QuaZip passes a QIODevice pointer there. This QIODevice is either
-     * set explicitly via setIoDevice() or the QuaZip(QIODevice*)
-     * constructor, or it is created internally when opening the archive
-     * by its file name. The default API (qioapi.cpp) just delegates
-     * everything to the QIODevice API. Not only this allows to use a
-     * QIODevice instead of file name, but also has a nice side effect
-     * of raising the file size limit from 2G to 4G.
-     *
-     * In short: just forget about the \a ioApi argument and you'll be
-     * fine.
-     **/
-    bool open(Mode mode, zlib_filefunc_def *ioApi =NULL);
-    /// Closes ZIP file.
-    /** Call getZipError() to determine if the close was successful. The
-     * underlying QIODevice is also closed, regardless of whether it was
-     * set explicitly or not. */
-    void close();
-    /// Sets the codec used to encode/decode file names inside archive.
-    /** This is necessary to access files in the ZIP archive created
-     * under Windows with non-latin characters in file names. For
-     * example, file names with cyrillic letters will be in \c IBM866
-     * encoding.
-     **/
-    void setFileNameCodec(QTextCodec *fileNameCodec);
-    /// Sets the codec used to encode/decode file names inside archive.
-    /** \overload
-     * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName));
-     **/
-    void setFileNameCodec(const char *fileNameCodecName);
-    /// Returns the codec used to encode/decode comments inside archive.
-    QTextCodec* getFileNameCodec() const;
-    /// Sets the codec used to encode/decode comments inside archive.
-    /** This codec defaults to locale codec, which is probably ok.
-     **/
-    void setCommentCodec(QTextCodec *commentCodec);
-    /// Sets the codec used to encode/decode comments inside archive.
-    /** \overload
-     * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName));
-     **/
-    void setCommentCodec(const char *commentCodecName);
-    /// Returns the codec used to encode/decode comments inside archive.
-    QTextCodec* getCommentCodec() const;
-    /// Returns the name of the ZIP file.
-    /** Returns null string if no ZIP file name has been set, for
-     * example when the QuaZip instance is set up to use a QIODevice
-     * instead.
-     * \sa setZipName(), setIoDevice(), getIoDevice()
-     **/
-    QString getZipName() const;
-    /// Sets the name of the ZIP file.
-    /** Does nothing if the ZIP file is open.
-     *
-     * Does not reset error code returned by getZipError().
-     * \sa setIoDevice(), getIoDevice(), getZipName()
-     **/
-    void setZipName(const QString& zipName);
-    /// Returns the device representing this ZIP file.
-    /** Returns null string if no device has been set explicitly, for
-     * example when opening a ZIP file by name.
-     * \sa setIoDevice(), getZipName(), setZipName()
-     **/
-    QIODevice *getIoDevice() const;
-    /// Sets the device representing the ZIP file.
-    /** Does nothing if the ZIP file is open.
-     *
-     * Does not reset error code returned by getZipError().
-     * \sa getIoDevice(), getZipName(), setZipName()
-     **/
-    void setIoDevice(QIODevice *ioDevice);
-    /// Returns the mode in which ZIP file was opened.
-    Mode getMode() const;
-    /// Returns \c true if ZIP file is open, \c false otherwise.
-    bool isOpen() const;
-    /// Returns the error code of the last operation.
-    /** Returns \c UNZ_OK if the last operation was successful.
-     *
-     * Error code resets to \c UNZ_OK every time you call any function
-     * that accesses something inside ZIP archive, even if it is \c
-     * const (like getEntriesCount()). open() and close() calls reset
-     * error code too. See documentation for the specific functions for
-     * details on error detection.
-     **/
-    int getZipError() const;
-    /// Returns number of the entries in the ZIP central directory.
-    /** Returns negative error code in the case of error. The same error
-     * code will be returned by subsequent getZipError() call.
-     **/
-    int getEntriesCount() const;
-    /// Returns global comment in the ZIP file.
-    QString getComment() const;
-    /// Sets global comment in the ZIP file.
-    /** Comment will be written to the archive on close operation.
-     *
-     * \sa open()
-     **/
-    void setComment(const QString& comment);
-    /// Sets the current file to the first file in the archive.
-    /** Returns \c true on success, \c false otherwise. Call
-     * getZipError() to get the error code.
-     **/
-    bool goToFirstFile();
-    /// Sets the current file to the next file in the archive.
-    /** Returns \c true on success, \c false otherwise. Call
-     * getZipError() to determine if there was an error.
-     *
-     * Should be used only in QuaZip::mdUnzip mode.
-     *
-     * \note If the end of file was reached, getZipError() will return
-     * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make
-     * things like this easier:
-     * \code
-     * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
-     *   // do something
-     * }
-     * if(zip.getZipError()==UNZ_OK) {
-     *   // ok, there was no error
-     * }
-     * \endcode
-     **/
-    bool goToNextFile();
-    /// Sets current file by its name.
-    /** Returns \c true if successful, \c false otherwise. Argument \a
-     * cs specifies case sensitivity of the file name. Call
-     * getZipError() in the case of a failure to get error code.
-     *
-     * This is not a wrapper to unzLocateFile() function. That is
-     * because I had to implement locale-specific case-insensitive
-     * comparison.
-     *
-     * Here are the differences from the original implementation:
-     *
-     * - If the file was not found, error code is \c UNZ_OK, not \c
-     *   UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()).
-     * - If this function fails, it unsets the current file rather than
-     *   resetting it back to what it was before the call.
-     *
-     * If \a fileName is null string then this function unsets the
-     * current file and return \c true. Note that you should close the
-     * file first if it is open! See
-     * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details.
-     *
-     * Should be used only in QuaZip::mdUnzip mode.
-     *
-     * \sa setFileNameCodec(), CaseSensitivity
-     **/
-    bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault);
-    /// Returns \c true if the current file has been set.
-    bool hasCurrentFile() const;
-    /// Retrieves information about the current file.
-    /** Fills the structure pointed by \a info. Returns \c true on
-     * success, \c false otherwise. In the latter case structure pointed
-     * by \a info remains untouched. If there was an error,
-     * getZipError() returns error code.
-     *
-     * Should be used only in QuaZip::mdUnzip mode.
-     *
-     * Does nothing and returns \c false in any of the following cases.
-     * - ZIP is not open;
-     * - ZIP does not have current file;
-     * - \a info is \c NULL;
-     *
-     * In all these cases getZipError() returns \c UNZ_OK since there
-     * is no ZIP/UNZIP API call.
-     **/
-    bool getCurrentFileInfo(QuaZipFileInfo* info)const;
-    /// Returns the current file name.
-    /** Equivalent to calling getCurrentFileInfo() and then getting \c
-     * name field of the QuaZipFileInfo structure, but faster and more
-     * convenient.
-     *
-     * Should be used only in QuaZip::mdUnzip mode.
-     **/
-    QString getCurrentFileName()const;
-    /// Returns \c unzFile handle.
-    /** You can use this handle to directly call UNZIP part of the
-     * ZIP/UNZIP package functions (see unzip.h).
-     *
-     * \warning When using the handle returned by this function, please
-     * keep in mind that QuaZip class is unable to detect any changes
-     * you make in the ZIP file state (e. g. changing current file, or
-     * closing the handle). So please do not do anything with this
-     * handle that is possible to do with the functions of this class.
-     * Or at least return the handle in the original state before
-     * calling some another function of this class (including implicit
-     * destructor calls and calls from the QuaZipFile objects that refer
-     * to this QuaZip instance!). So if you have changed the current
-     * file in the ZIP archive - then change it back or you may
-     * experience some strange behavior or even crashes.
-     **/
-    unzFile getUnzFile();
-    /// Returns \c zipFile handle.
-    /** You can use this handle to directly call ZIP part of the
-     * ZIP/UNZIP package functions (see zip.h). Warnings about the
-     * getUnzFile() function also apply to this function.
-     **/
-    zipFile getZipFile();
-};
-
-#endif
+#ifndef QUA_ZIP_H
+#define QUA_ZIP_H
+
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include <QString>
+#include <QTextCodec>
+
+#include "zip.h"
+#include "unzip.h"
+
+#include "quazip_global.h"
+#include "quazipfileinfo.h"
+
+// just in case it will be defined in the later versions of the ZIP/UNZIP
+#ifndef UNZ_OPENERROR
+// define additional error code
+#define UNZ_OPENERROR -1000
+#endif
+
+class QuaZipPrivate;
+
+/// ZIP archive.
+/** \class QuaZip quazip.h <quazip/quazip.h>
+ * This class implements basic interface to the ZIP archive. It can be
+ * used to read table contents of the ZIP archive and retreiving
+ * information about the files inside it.
+ *
+ * You can also use this class to open files inside archive by passing
+ * pointer to the instance of this class to the constructor of the
+ * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*)
+ * for the possible pitfalls.
+ *
+ * This class is indended to provide interface to the ZIP subpackage of
+ * the ZIP/UNZIP package as well as to the UNZIP subpackage. But
+ * currently it supports only UNZIP.
+ *
+ * The use of this class is simple - just create instance using
+ * constructor, then set ZIP archive file name using setFile() function
+ * (if you did not passed the name to the constructor), then open() and
+ * then use different functions to work with it! Well, if you are
+ * paranoid, you may also wish to call close before destructing the
+ * instance, to check for errors on close.
+ *
+ * You may also use getUnzFile() and getZipFile() functions to get the
+ * ZIP archive handle and use it with ZIP/UNZIP package API directly.
+ *
+ * This class supports localized file names inside ZIP archive, but you
+ * have to set up proper codec with setCodec() function. By default,
+ * locale codec will be used, which is probably ok for UNIX systems, but
+ * will almost certainly fail with ZIP archives created in Windows. This
+ * is because Windows ZIP programs have strange habit of using DOS
+ * encoding for file names in ZIP archives. For example, ZIP archive
+ * with cyrillic names created in Windows will have file names in \c
+ * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one
+ * function is not much trouble, but for true platform independency it
+ * would be nice to have some mechanism for file name encoding auto
+ * detection using locale information. Does anyone know a good way to do
+ * it?
+ **/
+class QUAZIP_EXPORT QuaZip {
+  friend class QuaZipPrivate;
+  public:
+    /// Useful constants.
+    enum Constants {
+      MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from
+                                 \c UNZ_MAXFILENAMEINZIP constant in
+                                 unzip.c. */
+    };
+    /// Open mode of the ZIP file.
+    enum Mode {
+      mdNotOpen, ///< ZIP file is not open. This is the initial mode.
+      mdUnzip, ///< ZIP file is open for reading files inside it.
+      mdCreate, ///< ZIP file was created with open() call.
+      mdAppend, /**< ZIP file was opened in append mode. This refers to
+                  * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package
+                  * and means that zip is appended to some existing file
+                  * what is useful when that file contains
+                  * self-extractor code. This is obviously \em not what
+                  * you whant to use to add files to the existing ZIP
+                  * archive.
+                  **/
+      mdAdd ///< ZIP file was opened for adding files in the archive.
+    };
+    /// Case sensitivity for the file names.
+    /** This is what you specify when accessing files in the archive.
+     * Works perfectly fine with any characters thanks to Qt's great
+     * unicode support. This is different from ZIP/UNZIP API, where
+     * only US-ASCII characters was supported.
+     **/
+    enum CaseSensitivity {
+      csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows.
+      csSensitive=1, ///< Case sensitive.
+      csInsensitive=2 ///< Case insensitive.
+    };
+  private:
+    QuaZipPrivate *p;
+    // not (and will not be) implemented
+    QuaZip(const QuaZip& that);
+    // not (and will not be) implemented
+    QuaZip& operator=(const QuaZip& that);
+  public:
+    /// Constructs QuaZip object.
+    /** Call setName() before opening constructed object. */
+    QuaZip();
+    /// Constructs QuaZip object associated with ZIP file \a zipName.
+    QuaZip(const QString& zipName);
+    /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice.
+    /** The IO device must be seekable, otherwise an error will occur when opening. */
+    QuaZip(QIODevice *ioDevice);
+    /// Destroys QuaZip object.
+    /** Calls close() if necessary. */
+    ~QuaZip();
+    /// Opens ZIP file.
+    /**
+     * Argument \a mode specifies open mode of the ZIP archive. See Mode
+     * for details. Note that there is zipOpen2() function in the
+     * ZIP/UNZIP API which accepts \a globalcomment argument, but it
+     * does not use it anywhere, so this open() function does not have this
+     * argument. See setComment() if you need to set global comment.
+     *
+     * If the ZIP file is accessed via explicitly set QIODevice, then
+     * this device is opened in the necessary mode. If the device was
+     * already opened by some other means, then the behaviour is defined by
+     * the device implementation, but generally it is not a very good
+     * idea. For example, QFile will at least issue a warning.
+     *
+     * \return \c true if successful, \c false otherwise.
+     *
+     * \note ZIP/UNZIP API open calls do not return error code - they
+     * just return \c NULL indicating an error. But to make things
+     * easier, quazip.h header defines additional error code \c
+     * UNZ_ERROROPEN and getZipError() will return it if the open call
+     * of the ZIP/UNZIP API returns \c NULL.
+     *
+     * Argument \a ioApi specifies IO function set for ZIP/UNZIP
+     * package to use. See unzip.h, zip.h and ioapi.h for details. Note
+     * that IO API for QuaZip is different from the original package.
+     * The file path argument was changed to be of type \c voidpf, and
+     * QuaZip passes a QIODevice pointer there. This QIODevice is either
+     * set explicitly via setIoDevice() or the QuaZip(QIODevice*)
+     * constructor, or it is created internally when opening the archive
+     * by its file name. The default API (qioapi.cpp) just delegates
+     * everything to the QIODevice API. Not only this allows to use a
+     * QIODevice instead of file name, but also has a nice side effect
+     * of raising the file size limit from 2G to 4G.
+     *
+     * In short: just forget about the \a ioApi argument and you'll be
+     * fine.
+     **/
+    bool open(Mode mode, zlib_filefunc_def *ioApi =NULL);
+    /// Closes ZIP file.
+    /** Call getZipError() to determine if the close was successful. The
+     * underlying QIODevice is also closed, regardless of whether it was
+     * set explicitly or not. */
+    void close();
+    /// Sets the codec used to encode/decode file names inside archive.
+    /** This is necessary to access files in the ZIP archive created
+     * under Windows with non-latin characters in file names. For
+     * example, file names with cyrillic letters will be in \c IBM866
+     * encoding.
+     **/
+    void setFileNameCodec(QTextCodec *fileNameCodec);
+    /// Sets the codec used to encode/decode file names inside archive.
+    /** \overload
+     * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName));
+     **/
+    void setFileNameCodec(const char *fileNameCodecName);
+    /// Returns the codec used to encode/decode comments inside archive.
+    QTextCodec* getFileNameCodec() const;
+    /// Sets the codec used to encode/decode comments inside archive.
+    /** This codec defaults to locale codec, which is probably ok.
+     **/
+    void setCommentCodec(QTextCodec *commentCodec);
+    /// Sets the codec used to encode/decode comments inside archive.
+    /** \overload
+     * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName));
+     **/
+    void setCommentCodec(const char *commentCodecName);
+    /// Returns the codec used to encode/decode comments inside archive.
+    QTextCodec* getCommentCodec() const;
+    /// Returns the name of the ZIP file.
+    /** Returns null string if no ZIP file name has been set, for
+     * example when the QuaZip instance is set up to use a QIODevice
+     * instead.
+     * \sa setZipName(), setIoDevice(), getIoDevice()
+     **/
+    QString getZipName() const;
+    /// Sets the name of the ZIP file.
+    /** Does nothing if the ZIP file is open.
+     *
+     * Does not reset error code returned by getZipError().
+     * \sa setIoDevice(), getIoDevice(), getZipName()
+     **/
+    void setZipName(const QString& zipName);
+    /// Returns the device representing this ZIP file.
+    /** Returns null string if no device has been set explicitly, for
+     * example when opening a ZIP file by name.
+     * \sa setIoDevice(), getZipName(), setZipName()
+     **/
+    QIODevice *getIoDevice() const;
+    /// Sets the device representing the ZIP file.
+    /** Does nothing if the ZIP file is open.
+     *
+     * Does not reset error code returned by getZipError().
+     * \sa getIoDevice(), getZipName(), setZipName()
+     **/
+    void setIoDevice(QIODevice *ioDevice);
+    /// Returns the mode in which ZIP file was opened.
+    Mode getMode() const;
+    /// Returns \c true if ZIP file is open, \c false otherwise.
+    bool isOpen() const;
+    /// Returns the error code of the last operation.
+    /** Returns \c UNZ_OK if the last operation was successful.
+     *
+     * Error code resets to \c UNZ_OK every time you call any function
+     * that accesses something inside ZIP archive, even if it is \c
+     * const (like getEntriesCount()). open() and close() calls reset
+     * error code too. See documentation for the specific functions for
+     * details on error detection.
+     **/
+    int getZipError() const;
+    /// Returns number of the entries in the ZIP central directory.
+    /** Returns negative error code in the case of error. The same error
+     * code will be returned by subsequent getZipError() call.
+     **/
+    int getEntriesCount() const;
+    /// Returns global comment in the ZIP file.
+    QString getComment() const;
+    /// Sets global comment in the ZIP file.
+    /** Comment will be written to the archive on close operation.
+     *
+     * \sa open()
+     **/
+    void setComment(const QString& comment);
+    /// Sets the current file to the first file in the archive.
+    /** Returns \c true on success, \c false otherwise. Call
+     * getZipError() to get the error code.
+     **/
+    bool goToFirstFile();
+    /// Sets the current file to the next file in the archive.
+    /** Returns \c true on success, \c false otherwise. Call
+     * getZipError() to determine if there was an error.
+     *
+     * Should be used only in QuaZip::mdUnzip mode.
+     *
+     * \note If the end of file was reached, getZipError() will return
+     * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make
+     * things like this easier:
+     * \code
+     * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
+     *   // do something
+     * }
+     * if(zip.getZipError()==UNZ_OK) {
+     *   // ok, there was no error
+     * }
+     * \endcode
+     **/
+    bool goToNextFile();
+    /// Sets current file by its name.
+    /** Returns \c true if successful, \c false otherwise. Argument \a
+     * cs specifies case sensitivity of the file name. Call
+     * getZipError() in the case of a failure to get error code.
+     *
+     * This is not a wrapper to unzLocateFile() function. That is
+     * because I had to implement locale-specific case-insensitive
+     * comparison.
+     *
+     * Here are the differences from the original implementation:
+     *
+     * - If the file was not found, error code is \c UNZ_OK, not \c
+     *   UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()).
+     * - If this function fails, it unsets the current file rather than
+     *   resetting it back to what it was before the call.
+     *
+     * If \a fileName is null string then this function unsets the
+     * current file and return \c true. Note that you should close the
+     * file first if it is open! See
+     * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details.
+     *
+     * Should be used only in QuaZip::mdUnzip mode.
+     *
+     * \sa setFileNameCodec(), CaseSensitivity
+     **/
+    bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault);
+    /// Returns \c true if the current file has been set.
+    bool hasCurrentFile() const;
+    /// Retrieves information about the current file.
+    /** Fills the structure pointed by \a info. Returns \c true on
+     * success, \c false otherwise. In the latter case structure pointed
+     * by \a info remains untouched. If there was an error,
+     * getZipError() returns error code.
+     *
+     * Should be used only in QuaZip::mdUnzip mode.
+     *
+     * Does nothing and returns \c false in any of the following cases.
+     * - ZIP is not open;
+     * - ZIP does not have current file;
+     * - \a info is \c NULL;
+     *
+     * In all these cases getZipError() returns \c UNZ_OK since there
+     * is no ZIP/UNZIP API call.
+     **/
+    bool getCurrentFileInfo(QuaZipFileInfo* info)const;
+    /// Returns the current file name.
+    /** Equivalent to calling getCurrentFileInfo() and then getting \c
+     * name field of the QuaZipFileInfo structure, but faster and more
+     * convenient.
+     *
+     * Should be used only in QuaZip::mdUnzip mode.
+     **/
+    QString getCurrentFileName()const;
+    /// Returns \c unzFile handle.
+    /** You can use this handle to directly call UNZIP part of the
+     * ZIP/UNZIP package functions (see unzip.h).
+     *
+     * \warning When using the handle returned by this function, please
+     * keep in mind that QuaZip class is unable to detect any changes
+     * you make in the ZIP file state (e. g. changing current file, or
+     * closing the handle). So please do not do anything with this
+     * handle that is possible to do with the functions of this class.
+     * Or at least return the handle in the original state before
+     * calling some another function of this class (including implicit
+     * destructor calls and calls from the QuaZipFile objects that refer
+     * to this QuaZip instance!). So if you have changed the current
+     * file in the ZIP archive - then change it back or you may
+     * experience some strange behavior or even crashes.
+     **/
+    unzFile getUnzFile();
+    /// Returns \c zipFile handle.
+    /** You can use this handle to directly call ZIP part of the
+     * ZIP/UNZIP package functions (see zip.h). Warnings about the
+     * getUnzFile() function also apply to this function.
+     **/
+    zipFile getZipFile();
+};
+
+#endif
diff --git a/misc/quazip/quazipfile.cpp b/misc/quazip/quazipfile.cpp
index 974e940..d422ad2 100644
--- a/misc/quazip/quazipfile.cpp
+++ b/misc/quazip/quazipfile.cpp
@@ -1,428 +1,428 @@
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include "quazipfile.h"
-
-using namespace std;
-
-class QuaZipFilePrivate {
-  friend class QuaZipFile;
-  private:
-    QuaZipFile *q;
-    QuaZip *zip;
-    QString fileName;
-    QuaZip::CaseSensitivity caseSensitivity;
-    bool raw;
-    qint64 writePos;
-    // these two are for writing raw files
-    ulong uncompressedSize;
-    quint32 crc;
-    bool internal;
-    int zipError;
-    inline void resetZipError() const {setZipError(UNZ_OK);}
-    // const, but sets zipError!
-    void setZipError(int zipError) const;
-    inline QuaZipFilePrivate(QuaZipFile *q):
-      q(q), zip(NULL), internal(true), zipError(UNZ_OK) {}
-    inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName):
-      q(q), internal(true), zipError(UNZ_OK)
-      {
-        zip=new QuaZip(zipName);
-      }
-    inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName, const QString &fileName,
-        QuaZip::CaseSensitivity cs):
-      q(q), internal(true), zipError(UNZ_OK)
-      {
-        zip=new QuaZip(zipName);
-        this->fileName=fileName;
-        this->caseSensitivity=cs;
-      }
-    inline QuaZipFilePrivate(QuaZipFile *q, QuaZip *zip):
-      q(q), zip(zip), internal(false), zipError(UNZ_OK) {}
-    inline ~QuaZipFilePrivate()
-    {
-      if (internal)
-        delete zip;
-    }
-};
-
-QuaZipFile::QuaZipFile():
-  p(new QuaZipFilePrivate(this))
-{
-}
-
-QuaZipFile::QuaZipFile(QObject *parent):
-  QIODevice(parent),
-  p(new QuaZipFilePrivate(this))
-{
-}
-
-QuaZipFile::QuaZipFile(const QString& zipName, QObject *parent):
-  QIODevice(parent),
-  p(new QuaZipFilePrivate(this, zipName))
-{
-}
-
-QuaZipFile::QuaZipFile(const QString& zipName, const QString& fileName,
-    QuaZip::CaseSensitivity cs, QObject *parent):
-  QIODevice(parent),
-  p(new QuaZipFilePrivate(this, zipName, fileName, cs))
-{
-}
-
-QuaZipFile::QuaZipFile(QuaZip *zip, QObject *parent):
-  QIODevice(parent),
-  p(new QuaZipFilePrivate(this, zip))
-{
-}
-
-QuaZipFile::~QuaZipFile()
-{
-  if (isOpen())
-    close();
-  delete p;
-}
-
-QString QuaZipFile::getZipName() const
-{
-  return p->zip==NULL ? QString() : p->zip->getZipName();
-}
-
-QString QuaZipFile::getActualFileName()const
-{
-  p->setZipError(UNZ_OK);
-  if (p->zip == NULL || (openMode() & WriteOnly))
-    return QString();
-  QString name=p->zip->getCurrentFileName();
-  if(name.isNull())
-    p->setZipError(p->zip->getZipError());
-  return name;
-}
-
-void QuaZipFile::setZipName(const QString& zipName)
-{
-  if(isOpen()) {
-    qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name");
-    return;
-  }
-  if(p->zip!=NULL && p->internal)
-    delete p->zip;
-  p->zip=new QuaZip(zipName);
-  p->internal=true;
-}
-
-void QuaZipFile::setZip(QuaZip *zip)
-{
-  if(isOpen()) {
-    qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP");
-    return;
-  }
-  if(p->zip!=NULL && p->internal)
-    delete p->zip;
-  p->zip=zip;
-  p->fileName=QString();
-  p->internal=false;
-}
-
-void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs)
-{
-  if(p->zip==NULL) {
-    qWarning("QuaZipFile::setFileName(): call setZipName() first");
-    return;
-  }
-  if(!p->internal) {
-    qWarning("QuaZipFile::setFileName(): should not be used when not using internal QuaZip");
-    return;
-  }
-  if(isOpen()) {
-    qWarning("QuaZipFile::setFileName(): can not set file name for already opened file");
-    return;
-  }
-  p->fileName=fileName;
-  p->caseSensitivity=cs;
-}
-
-void QuaZipFilePrivate::setZipError(int zipError) const
-{
-  QuaZipFilePrivate *fakeThis = const_cast<QuaZipFilePrivate*>(this); // non-const
-  fakeThis->zipError=zipError;
-  if(zipError==UNZ_OK)
-    q->setErrorString(QString());
-  else
-    q->setErrorString(q->tr("ZIP/UNZIP API error %1").arg(zipError));
-}
-
-bool QuaZipFile::open(OpenMode mode)
-{
-  return open(mode, NULL);
-}
-
-bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password)
-{
-  p->resetZipError();
-  if(isOpen()) {
-    qWarning("QuaZipFile::open(): already opened");
-    return false;
-  }
-  if(mode&Unbuffered) {
-    qWarning("QuaZipFile::open(): Unbuffered mode is not supported");
-    return false;
-  }
-  if((mode&ReadOnly)&&!(mode&WriteOnly)) {
-    if(p->internal) {
-      if(!p->zip->open(QuaZip::mdUnzip)) {
-        p->setZipError(p->zip->getZipError());
-        return false;
-      }
-      if(!p->zip->setCurrentFile(p->fileName, p->caseSensitivity)) {
-        p->setZipError(p->zip->getZipError());
-        p->zip->close();
-        return false;
-      }
-    } else {
-      if(p->zip==NULL) {
-        qWarning("QuaZipFile::open(): zip is NULL");
-        return false;
-      }
-      if(p->zip->getMode()!=QuaZip::mdUnzip) {
-        qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d",
-            (int)mode, (int)p->zip->getMode());
-        return false;
-      }
-      if(!p->zip->hasCurrentFile()) {
-        qWarning("QuaZipFile::open(): zip does not have current file");
-        return false;
-      }
-    }
-    p->setZipError(unzOpenCurrentFile3(p->zip->getUnzFile(), method, level, (int)raw, password));
-    if(p->zipError==UNZ_OK) {
-      setOpenMode(mode);
-      p->raw=raw;
-      return true;
-    } else
-      return false;
-  }
-  qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode);
-  return false;
-}
-
-bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info,
-    const char *password, quint32 crc,
-    int method, int level, bool raw,
-    int windowBits, int memLevel, int strategy)
-{
-  zip_fileinfo info_z;
-  p->resetZipError();
-  if(isOpen()) {
-    qWarning("QuaZipFile::open(): already opened");
-    return false;
-  }
-  if((mode&WriteOnly)&&!(mode&ReadOnly)) {
-    if(p->internal) {
-      qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach");
-      return false;
-    }
-    if(p->zip==NULL) {
-      qWarning("QuaZipFile::open(): zip is NULL");
-      return false;
-    }
-    if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) {
-      qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d",
-          (int)mode, (int)p->zip->getMode());
-      return false;
-    }
-    info_z.tmz_date.tm_year=info.dateTime.date().year();
-    info_z.tmz_date.tm_mon=info.dateTime.date().month() - 1;
-    info_z.tmz_date.tm_mday=info.dateTime.date().day();
-    info_z.tmz_date.tm_hour=info.dateTime.time().hour();
-    info_z.tmz_date.tm_min=info.dateTime.time().minute();
-    info_z.tmz_date.tm_sec=info.dateTime.time().second();
-    info_z.dosDate = 0;
-    info_z.internal_fa=(uLong)info.internalAttr;
-    info_z.external_fa=(uLong)info.externalAttr;
-    p->setZipError(zipOpenNewFileInZip3(p->zip->getZipFile(),
-          p->zip->getFileNameCodec()->fromUnicode(info.name).constData(), &info_z,
-          info.extraLocal.constData(), info.extraLocal.length(),
-          info.extraGlobal.constData(), info.extraGlobal.length(),
-          p->zip->getCommentCodec()->fromUnicode(info.comment).constData(),
-          method, level, (int)raw,
-          windowBits, memLevel, strategy,
-          password, (uLong)crc));
-    if(p->zipError==UNZ_OK) {
-      p->writePos=0;
-      setOpenMode(mode);
-      p->raw=raw;
-      if(raw) {
-        p->crc=crc;
-        p->uncompressedSize=info.uncompressedSize;
-      }
-      return true;
-    } else
-      return false;
-  }
-  qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode);
-  return false;
-}
-
-bool QuaZipFile::isSequential()const
-{
-  return true;
-}
-
-qint64 QuaZipFile::pos()const
-{
-  if(p->zip==NULL) {
-    qWarning("QuaZipFile::pos(): call setZipName() or setZip() first");
-    return -1;
-  }
-  if(!isOpen()) {
-    qWarning("QuaZipFile::pos(): file is not open");
-    return -1;
-  }
-  if(openMode()&ReadOnly)
-    return unztell(p->zip->getUnzFile());
-  else
-    return p->writePos;
-}
-
-bool QuaZipFile::atEnd()const
-{
-  if(p->zip==NULL) {
-    qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first");
-    return false;
-  }
-  if(!isOpen()) {
-    qWarning("QuaZipFile::atEnd(): file is not open");
-    return false;
-  }
-  if(openMode()&ReadOnly)
-    return unzeof(p->zip->getUnzFile())==1;
-  else
-    return true;
-}
-
-qint64 QuaZipFile::size()const
-{
-  if(!isOpen()) {
-    qWarning("QuaZipFile::atEnd(): file is not open");
-    return -1;
-  }
-  if(openMode()&ReadOnly)
-    return p->raw?csize():usize();
-  else
-    return p->writePos;
-}
-
-qint64 QuaZipFile::csize()const
-{
-  unz_file_info info_z;
-  p->setZipError(UNZ_OK);
-  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1;
-  p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0));
-  if(p->zipError!=UNZ_OK)
-    return -1;
-  return info_z.compressed_size;
-}
-
-qint64 QuaZipFile::usize()const
-{
-  unz_file_info info_z;
-  p->setZipError(UNZ_OK);
-  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1;
-  p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0));
-  if(p->zipError!=UNZ_OK)
-    return -1;
-  return info_z.uncompressed_size;
-}
-
-bool QuaZipFile::getFileInfo(QuaZipFileInfo *info)
-{
-  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false;
-  p->zip->getCurrentFileInfo(info);
-  p->setZipError(p->zip->getZipError());
-  return p->zipError==UNZ_OK;
-}
-
-void QuaZipFile::close()
-{
-  p->resetZipError();
-  if(p->zip==NULL||!p->zip->isOpen()) return;
-  if(!isOpen()) {
-    qWarning("QuaZipFile::close(): file isn't open");
-    return;
-  }
-  if(openMode()&ReadOnly)
-    p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile()));
-  else if(openMode()&WriteOnly)
-    if(isRaw()) p->setZipError(zipCloseFileInZipRaw(p->zip->getZipFile(), p->uncompressedSize, p->crc));
-    else p->setZipError(zipCloseFileInZip(p->zip->getZipFile()));
-  else {
-    qWarning("Wrong open mode: %d", (int)openMode());
-    return;
-  }
-  if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen);
-  else return;
-  if(p->internal) {
-    p->zip->close();
-    p->setZipError(p->zip->getZipError());
-  }
-}
-
-qint64 QuaZipFile::readData(char *data, qint64 maxSize)
-{
-  p->setZipError(UNZ_OK);
-  qint64 bytesRead=unzReadCurrentFile(p->zip->getUnzFile(), data, (unsigned)maxSize);
-  if(bytesRead<0) p->setZipError((int)bytesRead);
-  return bytesRead;
-}
-
-qint64 QuaZipFile::writeData(const char* data, qint64 maxSize)
-{
-  p->setZipError(ZIP_OK);
-  p->setZipError(zipWriteInFileInZip(p->zip->getZipFile(), data, (uint)maxSize));
-  if(p->zipError!=ZIP_OK) return -1;
-  else {
-    p->writePos+=maxSize;
-    return maxSize;
-  }
-}
-
-QString QuaZipFile::getFileName() const
-{
-  return p->fileName;
-}
-
-QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity() const
-{
-  return p->caseSensitivity;
-}
-
-bool QuaZipFile::isRaw() const
-{
-  return p->raw;
-}
-
-int QuaZipFile::getZipError() const
-{
-  return p->zipError;
-}
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include "quazipfile.h"
+
+using namespace std;
+
+class QuaZipFilePrivate {
+  friend class QuaZipFile;
+  private:
+    QuaZipFile *q;
+    QuaZip *zip;
+    QString fileName;
+    QuaZip::CaseSensitivity caseSensitivity;
+    bool raw;
+    qint64 writePos;
+    // these two are for writing raw files
+    ulong uncompressedSize;
+    quint32 crc;
+    bool internal;
+    int zipError;
+    inline void resetZipError() const {setZipError(UNZ_OK);}
+    // const, but sets zipError!
+    void setZipError(int zipError) const;
+    inline QuaZipFilePrivate(QuaZipFile *q):
+      q(q), zip(NULL), internal(true), zipError(UNZ_OK) {}
+    inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName):
+      q(q), internal(true), zipError(UNZ_OK)
+      {
+        zip=new QuaZip(zipName);
+      }
+    inline QuaZipFilePrivate(QuaZipFile *q, const QString &zipName, const QString &fileName,
+        QuaZip::CaseSensitivity cs):
+      q(q), internal(true), zipError(UNZ_OK)
+      {
+        zip=new QuaZip(zipName);
+        this->fileName=fileName;
+        this->caseSensitivity=cs;
+      }
+    inline QuaZipFilePrivate(QuaZipFile *q, QuaZip *zip):
+      q(q), zip(zip), internal(false), zipError(UNZ_OK) {}
+    inline ~QuaZipFilePrivate()
+    {
+      if (internal)
+        delete zip;
+    }
+};
+
+QuaZipFile::QuaZipFile():
+  p(new QuaZipFilePrivate(this))
+{
+}
+
+QuaZipFile::QuaZipFile(QObject *parent):
+  QIODevice(parent),
+  p(new QuaZipFilePrivate(this))
+{
+}
+
+QuaZipFile::QuaZipFile(const QString& zipName, QObject *parent):
+  QIODevice(parent),
+  p(new QuaZipFilePrivate(this, zipName))
+{
+}
+
+QuaZipFile::QuaZipFile(const QString& zipName, const QString& fileName,
+    QuaZip::CaseSensitivity cs, QObject *parent):
+  QIODevice(parent),
+  p(new QuaZipFilePrivate(this, zipName, fileName, cs))
+{
+}
+
+QuaZipFile::QuaZipFile(QuaZip *zip, QObject *parent):
+  QIODevice(parent),
+  p(new QuaZipFilePrivate(this, zip))
+{
+}
+
+QuaZipFile::~QuaZipFile()
+{
+  if (isOpen())
+    close();
+  delete p;
+}
+
+QString QuaZipFile::getZipName() const
+{
+  return p->zip==NULL ? QString() : p->zip->getZipName();
+}
+
+QString QuaZipFile::getActualFileName()const
+{
+  p->setZipError(UNZ_OK);
+  if (p->zip == NULL || (openMode() & WriteOnly))
+    return QString();
+  QString name=p->zip->getCurrentFileName();
+  if(name.isNull())
+    p->setZipError(p->zip->getZipError());
+  return name;
+}
+
+void QuaZipFile::setZipName(const QString& zipName)
+{
+  if(isOpen()) {
+    qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name");
+    return;
+  }
+  if(p->zip!=NULL && p->internal)
+    delete p->zip;
+  p->zip=new QuaZip(zipName);
+  p->internal=true;
+}
+
+void QuaZipFile::setZip(QuaZip *zip)
+{
+  if(isOpen()) {
+    qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP");
+    return;
+  }
+  if(p->zip!=NULL && p->internal)
+    delete p->zip;
+  p->zip=zip;
+  p->fileName=QString();
+  p->internal=false;
+}
+
+void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs)
+{
+  if(p->zip==NULL) {
+    qWarning("QuaZipFile::setFileName(): call setZipName() first");
+    return;
+  }
+  if(!p->internal) {
+    qWarning("QuaZipFile::setFileName(): should not be used when not using internal QuaZip");
+    return;
+  }
+  if(isOpen()) {
+    qWarning("QuaZipFile::setFileName(): can not set file name for already opened file");
+    return;
+  }
+  p->fileName=fileName;
+  p->caseSensitivity=cs;
+}
+
+void QuaZipFilePrivate::setZipError(int zipError) const
+{
+  QuaZipFilePrivate *fakeThis = const_cast<QuaZipFilePrivate*>(this); // non-const
+  fakeThis->zipError=zipError;
+  if(zipError==UNZ_OK)
+    q->setErrorString(QString());
+  else
+    q->setErrorString(q->tr("ZIP/UNZIP API error %1").arg(zipError));
+}
+
+bool QuaZipFile::open(OpenMode mode)
+{
+  return open(mode, NULL);
+}
+
+bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password)
+{
+  p->resetZipError();
+  if(isOpen()) {
+    qWarning("QuaZipFile::open(): already opened");
+    return false;
+  }
+  if(mode&Unbuffered) {
+    qWarning("QuaZipFile::open(): Unbuffered mode is not supported");
+    return false;
+  }
+  if((mode&ReadOnly)&&!(mode&WriteOnly)) {
+    if(p->internal) {
+      if(!p->zip->open(QuaZip::mdUnzip)) {
+        p->setZipError(p->zip->getZipError());
+        return false;
+      }
+      if(!p->zip->setCurrentFile(p->fileName, p->caseSensitivity)) {
+        p->setZipError(p->zip->getZipError());
+        p->zip->close();
+        return false;
+      }
+    } else {
+      if(p->zip==NULL) {
+        qWarning("QuaZipFile::open(): zip is NULL");
+        return false;
+      }
+      if(p->zip->getMode()!=QuaZip::mdUnzip) {
+        qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d",
+            (int)mode, (int)p->zip->getMode());
+        return false;
+      }
+      if(!p->zip->hasCurrentFile()) {
+        qWarning("QuaZipFile::open(): zip does not have current file");
+        return false;
+      }
+    }
+    p->setZipError(unzOpenCurrentFile3(p->zip->getUnzFile(), method, level, (int)raw, password));
+    if(p->zipError==UNZ_OK) {
+      setOpenMode(mode);
+      p->raw=raw;
+      return true;
+    } else
+      return false;
+  }
+  qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode);
+  return false;
+}
+
+bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info,
+    const char *password, quint32 crc,
+    int method, int level, bool raw,
+    int windowBits, int memLevel, int strategy)
+{
+  zip_fileinfo info_z;
+  p->resetZipError();
+  if(isOpen()) {
+    qWarning("QuaZipFile::open(): already opened");
+    return false;
+  }
+  if((mode&WriteOnly)&&!(mode&ReadOnly)) {
+    if(p->internal) {
+      qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach");
+      return false;
+    }
+    if(p->zip==NULL) {
+      qWarning("QuaZipFile::open(): zip is NULL");
+      return false;
+    }
+    if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) {
+      qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d",
+          (int)mode, (int)p->zip->getMode());
+      return false;
+    }
+    info_z.tmz_date.tm_year=info.dateTime.date().year();
+    info_z.tmz_date.tm_mon=info.dateTime.date().month() - 1;
+    info_z.tmz_date.tm_mday=info.dateTime.date().day();
+    info_z.tmz_date.tm_hour=info.dateTime.time().hour();
+    info_z.tmz_date.tm_min=info.dateTime.time().minute();
+    info_z.tmz_date.tm_sec=info.dateTime.time().second();
+    info_z.dosDate = 0;
+    info_z.internal_fa=(uLong)info.internalAttr;
+    info_z.external_fa=(uLong)info.externalAttr;
+    p->setZipError(zipOpenNewFileInZip3(p->zip->getZipFile(),
+          p->zip->getFileNameCodec()->fromUnicode(info.name).constData(), &info_z,
+          info.extraLocal.constData(), info.extraLocal.length(),
+          info.extraGlobal.constData(), info.extraGlobal.length(),
+          p->zip->getCommentCodec()->fromUnicode(info.comment).constData(),
+          method, level, (int)raw,
+          windowBits, memLevel, strategy,
+          password, (uLong)crc));
+    if(p->zipError==UNZ_OK) {
+      p->writePos=0;
+      setOpenMode(mode);
+      p->raw=raw;
+      if(raw) {
+        p->crc=crc;
+        p->uncompressedSize=info.uncompressedSize;
+      }
+      return true;
+    } else
+      return false;
+  }
+  qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode);
+  return false;
+}
+
+bool QuaZipFile::isSequential()const
+{
+  return true;
+}
+
+qint64 QuaZipFile::pos()const
+{
+  if(p->zip==NULL) {
+    qWarning("QuaZipFile::pos(): call setZipName() or setZip() first");
+    return -1;
+  }
+  if(!isOpen()) {
+    qWarning("QuaZipFile::pos(): file is not open");
+    return -1;
+  }
+  if(openMode()&ReadOnly)
+    return unztell(p->zip->getUnzFile());
+  else
+    return p->writePos;
+}
+
+bool QuaZipFile::atEnd()const
+{
+  if(p->zip==NULL) {
+    qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first");
+    return false;
+  }
+  if(!isOpen()) {
+    qWarning("QuaZipFile::atEnd(): file is not open");
+    return false;
+  }
+  if(openMode()&ReadOnly)
+    return unzeof(p->zip->getUnzFile())==1;
+  else
+    return true;
+}
+
+qint64 QuaZipFile::size()const
+{
+  if(!isOpen()) {
+    qWarning("QuaZipFile::atEnd(): file is not open");
+    return -1;
+  }
+  if(openMode()&ReadOnly)
+    return p->raw?csize():usize();
+  else
+    return p->writePos;
+}
+
+qint64 QuaZipFile::csize()const
+{
+  unz_file_info info_z;
+  p->setZipError(UNZ_OK);
+  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1;
+  p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0));
+  if(p->zipError!=UNZ_OK)
+    return -1;
+  return info_z.compressed_size;
+}
+
+qint64 QuaZipFile::usize()const
+{
+  unz_file_info info_z;
+  p->setZipError(UNZ_OK);
+  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1;
+  p->setZipError(unzGetCurrentFileInfo(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0));
+  if(p->zipError!=UNZ_OK)
+    return -1;
+  return info_z.uncompressed_size;
+}
+
+bool QuaZipFile::getFileInfo(QuaZipFileInfo *info)
+{
+  if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false;
+  p->zip->getCurrentFileInfo(info);
+  p->setZipError(p->zip->getZipError());
+  return p->zipError==UNZ_OK;
+}
+
+void QuaZipFile::close()
+{
+  p->resetZipError();
+  if(p->zip==NULL||!p->zip->isOpen()) return;
+  if(!isOpen()) {
+    qWarning("QuaZipFile::close(): file isn't open");
+    return;
+  }
+  if(openMode()&ReadOnly)
+    p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile()));
+  else if(openMode()&WriteOnly)
+    if(isRaw()) p->setZipError(zipCloseFileInZipRaw(p->zip->getZipFile(), p->uncompressedSize, p->crc));
+    else p->setZipError(zipCloseFileInZip(p->zip->getZipFile()));
+  else {
+    qWarning("Wrong open mode: %d", (int)openMode());
+    return;
+  }
+  if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen);
+  else return;
+  if(p->internal) {
+    p->zip->close();
+    p->setZipError(p->zip->getZipError());
+  }
+}
+
+qint64 QuaZipFile::readData(char *data, qint64 maxSize)
+{
+  p->setZipError(UNZ_OK);
+  qint64 bytesRead=unzReadCurrentFile(p->zip->getUnzFile(), data, (unsigned)maxSize);
+  if(bytesRead<0) p->setZipError((int)bytesRead);
+  return bytesRead;
+}
+
+qint64 QuaZipFile::writeData(const char* data, qint64 maxSize)
+{
+  p->setZipError(ZIP_OK);
+  p->setZipError(zipWriteInFileInZip(p->zip->getZipFile(), data, (uint)maxSize));
+  if(p->zipError!=ZIP_OK) return -1;
+  else {
+    p->writePos+=maxSize;
+    return maxSize;
+  }
+}
+
+QString QuaZipFile::getFileName() const
+{
+  return p->fileName;
+}
+
+QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity() const
+{
+  return p->caseSensitivity;
+}
+
+bool QuaZipFile::isRaw() const
+{
+  return p->raw;
+}
+
+int QuaZipFile::getZipError() const
+{
+  return p->zipError;
+}
diff --git a/misc/quazip/quazipfile.h b/misc/quazip/quazipfile.h
index e4925a2..62dc7ae 100644
--- a/misc/quazip/quazipfile.h
+++ b/misc/quazip/quazipfile.h
@@ -1,433 +1,433 @@
-#ifndef QUA_ZIPFILE_H
-#define QUA_ZIPFILE_H
-
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include <QIODevice>
-
-#include "quazip_global.h"
-#include "quazip.h"
-#include "quazipnewinfo.h"
-
-class QuaZipFilePrivate;
-
-/// A file inside ZIP archive.
-/** \class QuaZipFile quazipfile.h <quazip/quazipfile.h>
- * This is the most interesting class. Not only it provides C++
- * interface to the ZIP/UNZIP package, but also integrates it with Qt by
- * subclassing QIODevice. This makes possible to access files inside ZIP
- * archive using QTextStream or QDataStream, for example. Actually, this
- * is the main purpose of the whole QuaZIP library.
- *
- * You can either use existing QuaZip instance to create instance of
- * this class or pass ZIP archive file name to this class, in which case
- * it will create internal QuaZip object. See constructors' descriptions
- * for details. Writing is only possible with the existing instance.
- *
- * Note that due to the underlying library's limitation it is not
- * possible to use multiple QuaZipFile instances to open several files
- * in the same archive at the same time. If you need to write to
- * multiple files in parallel, then you should write to temporary files
- * first, then pack them all at once when you have finished writing. If
- * you need to read multiple files inside the same archive in parallel,
- * you should extract them all into a temporary directory first.
- *
- * \section quazipfile-sequential Sequential or random-access?
- *
- * At the first thought, QuaZipFile has fixed size, the start and the
- * end and should be therefore considered random-access device. But
- * there is one major obstacle to making it random-access: ZIP/UNZIP API
- * does not support seek() operation and the only way to implement it is
- * through reopening the file and re-reading to the required position,
- * but this is prohibitively slow.
- *
- * Therefore, QuaZipFile is considered to be a sequential device. This
- * has advantage of availability of the ungetChar() operation (QIODevice
- * does not implement it properly for non-sequential devices unless they
- * support seek()). Disadvantage is a somewhat strange behaviour of the
- * size() and pos() functions. This should be kept in mind while using
- * this class.
- *
- **/
-class QUAZIP_EXPORT QuaZipFile: public QIODevice {
-  friend class QuaZipFilePrivate;
-  Q_OBJECT
-  private:
-    QuaZipFilePrivate *p;
-    // these are not supported nor implemented
-    QuaZipFile(const QuaZipFile& that);
-    QuaZipFile& operator=(const QuaZipFile& that);
-  protected:
-    /// Implementation of the QIODevice::readData().
-    qint64 readData(char *data, qint64 maxSize);
-    /// Implementation of the QIODevice::writeData().
-    qint64 writeData(const char *data, qint64 maxSize);
-  public:
-    /// Constructs a QuaZipFile instance.
-    /** You should use setZipName() and setFileName() or setZip() before
-     * trying to call open() on the constructed object.
-     **/
-    QuaZipFile();
-    /// Constructs a QuaZipFile instance.
-    /** \a parent argument specifies this object's parent object.
-     *
-     * You should use setZipName() and setFileName() or setZip() before
-     * trying to call open() on the constructed object.
-     **/
-    QuaZipFile(QObject *parent);
-    /// Constructs a QuaZipFile instance.
-    /** \a parent argument specifies this object's parent object and \a
-     * zipName specifies ZIP archive file name.
-     *
-     * You should use setFileName() before trying to call open() on the
-     * constructed object.
-     *
-     * QuaZipFile constructed by this constructor can be used for read
-     * only access. Use QuaZipFile(QuaZip*,QObject*) for writing.
-     **/
-    QuaZipFile(const QString& zipName, QObject *parent =NULL);
-    /// Constructs a QuaZipFile instance.
-    /** \a parent argument specifies this object's parent object, \a
-     * zipName specifies ZIP archive file name and \a fileName and \a cs
-     * specify a name of the file to open inside archive.
-     *
-     * QuaZipFile constructed by this constructor can be used for read
-     * only access. Use QuaZipFile(QuaZip*,QObject*) for writing.
-     *
-     * \sa QuaZip::setCurrentFile()
-     **/
-    QuaZipFile(const QString& zipName, const QString& fileName,
-        QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL);
-    /// Constructs a QuaZipFile instance.
-    /** \a parent argument specifies this object's parent object.
-     *
-     * \a zip is the pointer to the existing QuaZip object. This
-     * QuaZipFile object then can be used to read current file in the
-     * \a zip or to write to the file inside it.
-     *
-     * \warning Using this constructor for reading current file can be
-     * tricky. Let's take the following example:
-     * \code
-     * QuaZip zip("archive.zip");
-     * zip.open(QuaZip::mdUnzip);
-     * zip.setCurrentFile("file-in-archive");
-     * QuaZipFile file(&zip);
-     * file.open(QIODevice::ReadOnly);
-     * // ok, now we can read from the file
-     * file.read(somewhere, some);
-     * zip.setCurrentFile("another-file-in-archive"); // oops...
-     * QuaZipFile anotherFile(&zip);
-     * anotherFile.open(QIODevice::ReadOnly);
-     * anotherFile.read(somewhere, some); // this is still ok...
-     * file.read(somewhere, some); // and this is NOT
-     * \endcode
-     * So, what exactly happens here? When we change current file in the
-     * \c zip archive, \c file that references it becomes invalid
-     * (actually, as far as I understand ZIP/UNZIP sources, it becomes
-     * closed, but QuaZipFile has no means to detect it).
-     *
-     * Summary: do not close \c zip object or change its current file as
-     * long as QuaZipFile is open. Even better - use another constructors
-     * which create internal QuaZip instances, one per object, and
-     * therefore do not cause unnecessary trouble. This constructor may
-     * be useful, though, if you already have a QuaZip instance and do
-     * not want to access several files at once. Good example:
-     * \code
-     * QuaZip zip("archive.zip");
-     * zip.open(QuaZip::mdUnzip);
-     * // first, we need some information about archive itself
-     * QByteArray comment=zip.getComment();
-     * // and now we are going to access files inside it
-     * QuaZipFile file(&zip);
-     * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
-     *   file.open(QIODevice::ReadOnly);
-     *   // do something cool with file here
-     *   file.close(); // do not forget to close!
-     * }
-     * zip.close();
-     * \endcode
-     **/
-    QuaZipFile(QuaZip *zip, QObject *parent =NULL);
-    /// Destroys a QuaZipFile instance.
-    /** Closes file if open, destructs internal QuaZip object (if it
-     * exists and \em is internal, of course).
-     **/
-    virtual ~QuaZipFile();
-    /// Returns the ZIP archive file name.
-    /** If this object was created by passing QuaZip pointer to the
-     * constructor, this function will return that QuaZip's file name
-     * (or null string if that object does not have file name yet).
-     *
-     * Otherwise, returns associated ZIP archive file name or null
-     * string if there are no name set yet.
-     *
-     * \sa setZipName() getFileName()
-     **/
-    QString getZipName()const;
-    /// Returns a pointer to the associated QuaZip object.
-    /** Returns \c NULL if there is no associated QuaZip or it is
-     * internal (so you will not mess with it).
-     **/
-    QuaZip* getZip()const;
-    /// Returns file name.
-    /** This function returns file name you passed to this object either
-     * by using
-     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*)
-     * or by calling setFileName(). Real name of the file may differ in
-     * case if you used case-insensitivity.
-     *
-     * Returns null string if there is no file name set yet. This is the
-     * case when this QuaZipFile operates on the existing QuaZip object
-     * (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used).
-     * 
-     * \sa getActualFileName
-     **/
-    QString getFileName() const;
-    /// Returns case sensitivity of the file name.
-    /** This function returns case sensitivity argument you passed to
-     * this object either by using
-     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*)
-     * or by calling setFileName().
-     *
-     * Returns unpredictable value if getFileName() returns null string
-     * (this is the case when you did not used setFileName() or
-     * constructor above).
-     *
-     * \sa getFileName
-     **/
-    QuaZip::CaseSensitivity getCaseSensitivity() const;
-    /// Returns the actual file name in the archive.
-    /** This is \em not a ZIP archive file name, but a name of file inside
-     * archive. It is not necessary the same name that you have passed
-     * to the
-     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*),
-     * setFileName() or QuaZip::setCurrentFile() - this is the real file
-     * name inside archive, so it may differ in case if the file name
-     * search was case-insensitive.
-     *
-     * Equivalent to calling getCurrentFileName() on the associated
-     * QuaZip object. Returns null string if there is no associated
-     * QuaZip object or if it does not have a current file yet. And this
-     * is the case if you called setFileName() but did not open the
-     * file yet. So this is perfectly fine:
-     * \code
-     * QuaZipFile file("somezip.zip");
-     * file.setFileName("somefile");
-     * QString name=file.getName(); // name=="somefile"
-     * QString actual=file.getActualFileName(); // actual is null string
-     * file.open(QIODevice::ReadOnly);
-     * QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows
-     * \endcode
-     *
-     * \sa getZipName(), getFileName(), QuaZip::CaseSensitivity
-     **/
-    QString getActualFileName()const;
-    /// Sets the ZIP archive file name.
-    /** Automatically creates internal QuaZip object and destroys
-     * previously created internal QuaZip object, if any.
-     *
-     * Will do nothing if this file is already open. You must close() it
-     * first.
-     **/
-    void setZipName(const QString& zipName);
-    /// Returns \c true if the file was opened in raw mode.
-    /** If the file is not open, the returned value is undefined.
-     *
-     * \sa open(OpenMode,int*,int*,bool,const char*)
-     **/
-    bool isRaw() const;
-    /// Binds to the existing QuaZip instance.
-    /** This function destroys internal QuaZip object, if any, and makes
-     * this QuaZipFile to use current file in the \a zip object for any
-     * further operations. See QuaZipFile(QuaZip*,QObject*) for the
-     * possible pitfalls.
-     *
-     * Will do nothing if the file is currently open. You must close()
-     * it first.
-     **/
-    void setZip(QuaZip *zip);
-    /// Sets the file name.
-    /** Will do nothing if at least one of the following conditions is
-     * met:
-     * - ZIP name has not been set yet (getZipName() returns null
-     *   string).
-     * - This QuaZipFile is associated with external QuaZip. In this
-     *   case you should call that QuaZip's setCurrentFile() function
-     *   instead!
-     * - File is already open so setting the name is meaningless.
-     *
-     * \sa QuaZip::setCurrentFile
-     **/
-    void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault);
-    /// Opens a file for reading.
-    /** Returns \c true on success, \c false otherwise.
-     * Call getZipError() to get error code.
-     *
-     * \note Since ZIP/UNZIP API provides buffered reading only,
-     * QuaZipFile does not support unbuffered reading. So do not pass
-     * QIODevice::Unbuffered flag in \a mode, or open will fail.
-     **/
-    virtual bool open(OpenMode mode);
-    /// Opens a file for reading.
-    /** \overload
-     * Argument \a password specifies a password to decrypt the file. If
-     * it is NULL then this function behaves just like open(OpenMode).
-     **/
-    inline bool open(OpenMode mode, const char *password)
-    {return open(mode, NULL, NULL, false, password);}
-    /// Opens a file for reading.
-    /** \overload
-     * Argument \a password specifies a password to decrypt the file.
-     *
-     * An integers pointed by \a method and \a level will receive codes
-     * of the compression method and level used. See unzip.h.
-     *
-     * If raw is \c true then no decompression is performed.
-     *
-     * \a method should not be \c NULL. \a level can be \c NULL if you
-     * don't want to know the compression level.
-     **/
-    bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL);
-    /// Opens a file for writing.
-    /** \a info argument specifies information about file. It should at
-     * least specify a correct file name. Also, it is a good idea to
-     * specify correct timestamp (by default, current time will be
-     * used). See QuaZipNewInfo.
-     *
-     * Arguments \a password and \a crc provide necessary information
-     * for crypting. Note that you should specify both of them if you
-     * need crypting. If you do not, pass \c NULL as password, but you
-     * still need to specify \a crc if you are going to use raw mode
-     * (see below).
-     *
-     * Arguments \a method and \a level specify compression method and
-     * level.
-     *
-     * If \a raw is \c true, no compression is performed. In this case,
-     * \a crc and uncompressedSize field of the \a info are required.
-     *
-     * Arguments \a windowBits, \a memLevel, \a strategy provide zlib
-     * algorithms tuning. See deflateInit2() in zlib.
-     **/
-    bool open(OpenMode mode, const QuaZipNewInfo& info,
-        const char *password =NULL, quint32 crc =0,
-        int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false,
-        int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY);
-    /// Returns \c true, but \ref quazipfile-sequential "beware"!
-    virtual bool isSequential()const;
-    /// Returns current position in the file.
-    /** Implementation of the QIODevice::pos(). When reading, this
-     * function is a wrapper to the ZIP/UNZIP unztell(), therefore it is
-     * unable to keep track of the ungetChar() calls (which is
-     * non-virtual and therefore is dangerous to reimplement). So if you
-     * are using ungetChar() feature of the QIODevice, this function
-     * reports incorrect value until you get back characters which you
-     * ungot.
-     *
-     * When writing, pos() returns number of bytes already written
-     * (uncompressed unless you use raw mode).
-     *
-     * \note Although
-     * \ref quazipfile-sequential "QuaZipFile is a sequential device"
-     * and therefore pos() should always return zero, it does not,
-     * because it would be misguiding. Keep this in mind.
-     *
-     * This function returns -1 if the file or archive is not open.
-     *
-     * Error code returned by getZipError() is not affected by this
-     * function call.
-     **/
-    virtual qint64 pos()const;
-    /// Returns \c true if the end of file was reached.
-    /** This function returns \c false in the case of error. This means
-     * that you called this function on either not open file, or a file
-     * in the not open archive or even on a QuaZipFile instance that
-     * does not even have QuaZip instance associated. Do not do that
-     * because there is no means to determine whether \c false is
-     * returned because of error or because end of file was reached.
-     * Well, on the other side you may interpret \c false return value
-     * as "there is no file open to check for end of file and there is
-     * no end of file therefore".
-     *
-     * When writing, this function always returns \c true (because you
-     * are always writing to the end of file).
-     *
-     * Error code returned by getZipError() is not affected by this
-     * function call.
-     **/
-    virtual bool atEnd()const;
-    /// Returns file size.
-    /** This function returns csize() if the file is open for reading in
-     * raw mode, usize() if it is open for reading in normal mode and
-     * pos() if it is open for writing.
-     *
-     * Returns -1 on error, call getZipError() to get error code.
-     *
-     * \note This function returns file size despite that
-     * \ref quazipfile-sequential "QuaZipFile is considered to be sequential device",
-     * for which size() should return bytesAvailable() instead. But its
-     * name would be very misguiding otherwise, so just keep in mind
-     * this inconsistence.
-     **/
-    virtual qint64 size()const;
-    /// Returns compressed file size.
-    /** Equivalent to calling getFileInfo() and then getting
-     * compressedSize field, but more convenient and faster.
-     *
-     * File must be open for reading before calling this function.
-     *
-     * Returns -1 on error, call getZipError() to get error code.
-     **/
-    qint64 csize()const;
-    /// Returns uncompressed file size.
-    /** Equivalent to calling getFileInfo() and then getting
-     * uncompressedSize field, but more convenient and faster. See
-     * getFileInfo() for a warning.
-     *
-     * File must be open for reading before calling this function.
-     *
-     * Returns -1 on error, call getZipError() to get error code.
-     **/
-    qint64 usize()const;
-    /// Gets information about current file.
-    /** This function does the same thing as calling
-     * QuaZip::getCurrentFileInfo() on the associated QuaZip object,
-     * but you can not call getCurrentFileInfo() if the associated
-     * QuaZip is internal (because you do not have access to it), while
-     * you still can call this function in that case.
-     *
-     * File must be open for reading before calling this function.
-     *
-     * Returns \c false in the case of an error.
-     **/
-    bool getFileInfo(QuaZipFileInfo *info);
-    /// Closes the file.
-    /** Call getZipError() to determine if the close was successful.
-     **/
-    virtual void close();
-    /// Returns the error code returned by the last ZIP/UNZIP API call.
-    int getZipError() const;
-};
-
-#endif
+#ifndef QUA_ZIPFILE_H
+#define QUA_ZIPFILE_H
+
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include <QIODevice>
+
+#include "quazip_global.h"
+#include "quazip.h"
+#include "quazipnewinfo.h"
+
+class QuaZipFilePrivate;
+
+/// A file inside ZIP archive.
+/** \class QuaZipFile quazipfile.h <quazip/quazipfile.h>
+ * This is the most interesting class. Not only it provides C++
+ * interface to the ZIP/UNZIP package, but also integrates it with Qt by
+ * subclassing QIODevice. This makes possible to access files inside ZIP
+ * archive using QTextStream or QDataStream, for example. Actually, this
+ * is the main purpose of the whole QuaZIP library.
+ *
+ * You can either use existing QuaZip instance to create instance of
+ * this class or pass ZIP archive file name to this class, in which case
+ * it will create internal QuaZip object. See constructors' descriptions
+ * for details. Writing is only possible with the existing instance.
+ *
+ * Note that due to the underlying library's limitation it is not
+ * possible to use multiple QuaZipFile instances to open several files
+ * in the same archive at the same time. If you need to write to
+ * multiple files in parallel, then you should write to temporary files
+ * first, then pack them all at once when you have finished writing. If
+ * you need to read multiple files inside the same archive in parallel,
+ * you should extract them all into a temporary directory first.
+ *
+ * \section quazipfile-sequential Sequential or random-access?
+ *
+ * At the first thought, QuaZipFile has fixed size, the start and the
+ * end and should be therefore considered random-access device. But
+ * there is one major obstacle to making it random-access: ZIP/UNZIP API
+ * does not support seek() operation and the only way to implement it is
+ * through reopening the file and re-reading to the required position,
+ * but this is prohibitively slow.
+ *
+ * Therefore, QuaZipFile is considered to be a sequential device. This
+ * has advantage of availability of the ungetChar() operation (QIODevice
+ * does not implement it properly for non-sequential devices unless they
+ * support seek()). Disadvantage is a somewhat strange behaviour of the
+ * size() and pos() functions. This should be kept in mind while using
+ * this class.
+ *
+ **/
+class QUAZIP_EXPORT QuaZipFile: public QIODevice {
+  friend class QuaZipFilePrivate;
+  Q_OBJECT
+  private:
+    QuaZipFilePrivate *p;
+    // these are not supported nor implemented
+    QuaZipFile(const QuaZipFile& that);
+    QuaZipFile& operator=(const QuaZipFile& that);
+  protected:
+    /// Implementation of the QIODevice::readData().
+    qint64 readData(char *data, qint64 maxSize);
+    /// Implementation of the QIODevice::writeData().
+    qint64 writeData(const char *data, qint64 maxSize);
+  public:
+    /// Constructs a QuaZipFile instance.
+    /** You should use setZipName() and setFileName() or setZip() before
+     * trying to call open() on the constructed object.
+     **/
+    QuaZipFile();
+    /// Constructs a QuaZipFile instance.
+    /** \a parent argument specifies this object's parent object.
+     *
+     * You should use setZipName() and setFileName() or setZip() before
+     * trying to call open() on the constructed object.
+     **/
+    QuaZipFile(QObject *parent);
+    /// Constructs a QuaZipFile instance.
+    /** \a parent argument specifies this object's parent object and \a
+     * zipName specifies ZIP archive file name.
+     *
+     * You should use setFileName() before trying to call open() on the
+     * constructed object.
+     *
+     * QuaZipFile constructed by this constructor can be used for read
+     * only access. Use QuaZipFile(QuaZip*,QObject*) for writing.
+     **/
+    QuaZipFile(const QString& zipName, QObject *parent =NULL);
+    /// Constructs a QuaZipFile instance.
+    /** \a parent argument specifies this object's parent object, \a
+     * zipName specifies ZIP archive file name and \a fileName and \a cs
+     * specify a name of the file to open inside archive.
+     *
+     * QuaZipFile constructed by this constructor can be used for read
+     * only access. Use QuaZipFile(QuaZip*,QObject*) for writing.
+     *
+     * \sa QuaZip::setCurrentFile()
+     **/
+    QuaZipFile(const QString& zipName, const QString& fileName,
+        QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL);
+    /// Constructs a QuaZipFile instance.
+    /** \a parent argument specifies this object's parent object.
+     *
+     * \a zip is the pointer to the existing QuaZip object. This
+     * QuaZipFile object then can be used to read current file in the
+     * \a zip or to write to the file inside it.
+     *
+     * \warning Using this constructor for reading current file can be
+     * tricky. Let's take the following example:
+     * \code
+     * QuaZip zip("archive.zip");
+     * zip.open(QuaZip::mdUnzip);
+     * zip.setCurrentFile("file-in-archive");
+     * QuaZipFile file(&zip);
+     * file.open(QIODevice::ReadOnly);
+     * // ok, now we can read from the file
+     * file.read(somewhere, some);
+     * zip.setCurrentFile("another-file-in-archive"); // oops...
+     * QuaZipFile anotherFile(&zip);
+     * anotherFile.open(QIODevice::ReadOnly);
+     * anotherFile.read(somewhere, some); // this is still ok...
+     * file.read(somewhere, some); // and this is NOT
+     * \endcode
+     * So, what exactly happens here? When we change current file in the
+     * \c zip archive, \c file that references it becomes invalid
+     * (actually, as far as I understand ZIP/UNZIP sources, it becomes
+     * closed, but QuaZipFile has no means to detect it).
+     *
+     * Summary: do not close \c zip object or change its current file as
+     * long as QuaZipFile is open. Even better - use another constructors
+     * which create internal QuaZip instances, one per object, and
+     * therefore do not cause unnecessary trouble. This constructor may
+     * be useful, though, if you already have a QuaZip instance and do
+     * not want to access several files at once. Good example:
+     * \code
+     * QuaZip zip("archive.zip");
+     * zip.open(QuaZip::mdUnzip);
+     * // first, we need some information about archive itself
+     * QByteArray comment=zip.getComment();
+     * // and now we are going to access files inside it
+     * QuaZipFile file(&zip);
+     * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) {
+     *   file.open(QIODevice::ReadOnly);
+     *   // do something cool with file here
+     *   file.close(); // do not forget to close!
+     * }
+     * zip.close();
+     * \endcode
+     **/
+    QuaZipFile(QuaZip *zip, QObject *parent =NULL);
+    /// Destroys a QuaZipFile instance.
+    /** Closes file if open, destructs internal QuaZip object (if it
+     * exists and \em is internal, of course).
+     **/
+    virtual ~QuaZipFile();
+    /// Returns the ZIP archive file name.
+    /** If this object was created by passing QuaZip pointer to the
+     * constructor, this function will return that QuaZip's file name
+     * (or null string if that object does not have file name yet).
+     *
+     * Otherwise, returns associated ZIP archive file name or null
+     * string if there are no name set yet.
+     *
+     * \sa setZipName() getFileName()
+     **/
+    QString getZipName()const;
+    /// Returns a pointer to the associated QuaZip object.
+    /** Returns \c NULL if there is no associated QuaZip or it is
+     * internal (so you will not mess with it).
+     **/
+    QuaZip* getZip()const;
+    /// Returns file name.
+    /** This function returns file name you passed to this object either
+     * by using
+     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*)
+     * or by calling setFileName(). Real name of the file may differ in
+     * case if you used case-insensitivity.
+     *
+     * Returns null string if there is no file name set yet. This is the
+     * case when this QuaZipFile operates on the existing QuaZip object
+     * (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used).
+     * 
+     * \sa getActualFileName
+     **/
+    QString getFileName() const;
+    /// Returns case sensitivity of the file name.
+    /** This function returns case sensitivity argument you passed to
+     * this object either by using
+     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*)
+     * or by calling setFileName().
+     *
+     * Returns unpredictable value if getFileName() returns null string
+     * (this is the case when you did not used setFileName() or
+     * constructor above).
+     *
+     * \sa getFileName
+     **/
+    QuaZip::CaseSensitivity getCaseSensitivity() const;
+    /// Returns the actual file name in the archive.
+    /** This is \em not a ZIP archive file name, but a name of file inside
+     * archive. It is not necessary the same name that you have passed
+     * to the
+     * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*),
+     * setFileName() or QuaZip::setCurrentFile() - this is the real file
+     * name inside archive, so it may differ in case if the file name
+     * search was case-insensitive.
+     *
+     * Equivalent to calling getCurrentFileName() on the associated
+     * QuaZip object. Returns null string if there is no associated
+     * QuaZip object or if it does not have a current file yet. And this
+     * is the case if you called setFileName() but did not open the
+     * file yet. So this is perfectly fine:
+     * \code
+     * QuaZipFile file("somezip.zip");
+     * file.setFileName("somefile");
+     * QString name=file.getName(); // name=="somefile"
+     * QString actual=file.getActualFileName(); // actual is null string
+     * file.open(QIODevice::ReadOnly);
+     * QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows
+     * \endcode
+     *
+     * \sa getZipName(), getFileName(), QuaZip::CaseSensitivity
+     **/
+    QString getActualFileName()const;
+    /// Sets the ZIP archive file name.
+    /** Automatically creates internal QuaZip object and destroys
+     * previously created internal QuaZip object, if any.
+     *
+     * Will do nothing if this file is already open. You must close() it
+     * first.
+     **/
+    void setZipName(const QString& zipName);
+    /// Returns \c true if the file was opened in raw mode.
+    /** If the file is not open, the returned value is undefined.
+     *
+     * \sa open(OpenMode,int*,int*,bool,const char*)
+     **/
+    bool isRaw() const;
+    /// Binds to the existing QuaZip instance.
+    /** This function destroys internal QuaZip object, if any, and makes
+     * this QuaZipFile to use current file in the \a zip object for any
+     * further operations. See QuaZipFile(QuaZip*,QObject*) for the
+     * possible pitfalls.
+     *
+     * Will do nothing if the file is currently open. You must close()
+     * it first.
+     **/
+    void setZip(QuaZip *zip);
+    /// Sets the file name.
+    /** Will do nothing if at least one of the following conditions is
+     * met:
+     * - ZIP name has not been set yet (getZipName() returns null
+     *   string).
+     * - This QuaZipFile is associated with external QuaZip. In this
+     *   case you should call that QuaZip's setCurrentFile() function
+     *   instead!
+     * - File is already open so setting the name is meaningless.
+     *
+     * \sa QuaZip::setCurrentFile
+     **/
+    void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault);
+    /// Opens a file for reading.
+    /** Returns \c true on success, \c false otherwise.
+     * Call getZipError() to get error code.
+     *
+     * \note Since ZIP/UNZIP API provides buffered reading only,
+     * QuaZipFile does not support unbuffered reading. So do not pass
+     * QIODevice::Unbuffered flag in \a mode, or open will fail.
+     **/
+    virtual bool open(OpenMode mode);
+    /// Opens a file for reading.
+    /** \overload
+     * Argument \a password specifies a password to decrypt the file. If
+     * it is NULL then this function behaves just like open(OpenMode).
+     **/
+    inline bool open(OpenMode mode, const char *password)
+    {return open(mode, NULL, NULL, false, password);}
+    /// Opens a file for reading.
+    /** \overload
+     * Argument \a password specifies a password to decrypt the file.
+     *
+     * An integers pointed by \a method and \a level will receive codes
+     * of the compression method and level used. See unzip.h.
+     *
+     * If raw is \c true then no decompression is performed.
+     *
+     * \a method should not be \c NULL. \a level can be \c NULL if you
+     * don't want to know the compression level.
+     **/
+    bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL);
+    /// Opens a file for writing.
+    /** \a info argument specifies information about file. It should at
+     * least specify a correct file name. Also, it is a good idea to
+     * specify correct timestamp (by default, current time will be
+     * used). See QuaZipNewInfo.
+     *
+     * Arguments \a password and \a crc provide necessary information
+     * for crypting. Note that you should specify both of them if you
+     * need crypting. If you do not, pass \c NULL as password, but you
+     * still need to specify \a crc if you are going to use raw mode
+     * (see below).
+     *
+     * Arguments \a method and \a level specify compression method and
+     * level.
+     *
+     * If \a raw is \c true, no compression is performed. In this case,
+     * \a crc and uncompressedSize field of the \a info are required.
+     *
+     * Arguments \a windowBits, \a memLevel, \a strategy provide zlib
+     * algorithms tuning. See deflateInit2() in zlib.
+     **/
+    bool open(OpenMode mode, const QuaZipNewInfo& info,
+        const char *password =NULL, quint32 crc =0,
+        int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false,
+        int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY);
+    /// Returns \c true, but \ref quazipfile-sequential "beware"!
+    virtual bool isSequential()const;
+    /// Returns current position in the file.
+    /** Implementation of the QIODevice::pos(). When reading, this
+     * function is a wrapper to the ZIP/UNZIP unztell(), therefore it is
+     * unable to keep track of the ungetChar() calls (which is
+     * non-virtual and therefore is dangerous to reimplement). So if you
+     * are using ungetChar() feature of the QIODevice, this function
+     * reports incorrect value until you get back characters which you
+     * ungot.
+     *
+     * When writing, pos() returns number of bytes already written
+     * (uncompressed unless you use raw mode).
+     *
+     * \note Although
+     * \ref quazipfile-sequential "QuaZipFile is a sequential device"
+     * and therefore pos() should always return zero, it does not,
+     * because it would be misguiding. Keep this in mind.
+     *
+     * This function returns -1 if the file or archive is not open.
+     *
+     * Error code returned by getZipError() is not affected by this
+     * function call.
+     **/
+    virtual qint64 pos()const;
+    /// Returns \c true if the end of file was reached.
+    /** This function returns \c false in the case of error. This means
+     * that you called this function on either not open file, or a file
+     * in the not open archive or even on a QuaZipFile instance that
+     * does not even have QuaZip instance associated. Do not do that
+     * because there is no means to determine whether \c false is
+     * returned because of error or because end of file was reached.
+     * Well, on the other side you may interpret \c false return value
+     * as "there is no file open to check for end of file and there is
+     * no end of file therefore".
+     *
+     * When writing, this function always returns \c true (because you
+     * are always writing to the end of file).
+     *
+     * Error code returned by getZipError() is not affected by this
+     * function call.
+     **/
+    virtual bool atEnd()const;
+    /// Returns file size.
+    /** This function returns csize() if the file is open for reading in
+     * raw mode, usize() if it is open for reading in normal mode and
+     * pos() if it is open for writing.
+     *
+     * Returns -1 on error, call getZipError() to get error code.
+     *
+     * \note This function returns file size despite that
+     * \ref quazipfile-sequential "QuaZipFile is considered to be sequential device",
+     * for which size() should return bytesAvailable() instead. But its
+     * name would be very misguiding otherwise, so just keep in mind
+     * this inconsistence.
+     **/
+    virtual qint64 size()const;
+    /// Returns compressed file size.
+    /** Equivalent to calling getFileInfo() and then getting
+     * compressedSize field, but more convenient and faster.
+     *
+     * File must be open for reading before calling this function.
+     *
+     * Returns -1 on error, call getZipError() to get error code.
+     **/
+    qint64 csize()const;
+    /// Returns uncompressed file size.
+    /** Equivalent to calling getFileInfo() and then getting
+     * uncompressedSize field, but more convenient and faster. See
+     * getFileInfo() for a warning.
+     *
+     * File must be open for reading before calling this function.
+     *
+     * Returns -1 on error, call getZipError() to get error code.
+     **/
+    qint64 usize()const;
+    /// Gets information about current file.
+    /** This function does the same thing as calling
+     * QuaZip::getCurrentFileInfo() on the associated QuaZip object,
+     * but you can not call getCurrentFileInfo() if the associated
+     * QuaZip is internal (because you do not have access to it), while
+     * you still can call this function in that case.
+     *
+     * File must be open for reading before calling this function.
+     *
+     * Returns \c false in the case of an error.
+     **/
+    bool getFileInfo(QuaZipFileInfo *info);
+    /// Closes the file.
+    /** Call getZipError() to determine if the close was successful.
+     **/
+    virtual void close();
+    /// Returns the error code returned by the last ZIP/UNZIP API call.
+    int getZipError() const;
+};
+
+#endif
diff --git a/misc/quazip/quazipfileinfo.h b/misc/quazip/quazipfileinfo.h
index 1cf12c7..9954022 100644
--- a/misc/quazip/quazipfileinfo.h
+++ b/misc/quazip/quazipfileinfo.h
@@ -1,66 +1,66 @@
-#ifndef QUA_ZIPFILEINFO_H
-#define QUA_ZIPFILEINFO_H
-
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include <QByteArray>
-#include <QDateTime>
-
-#include "quazip_global.h"
-
-/// Information about a file inside archive.
-/** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to
- * fill this structure. */
-struct QUAZIP_EXPORT QuaZipFileInfo {
-  /// File name.
-  QString name;
-  /// Version created by.
-  quint16 versionCreated;
-  /// Version needed to extract.
-  quint16 versionNeeded;
-  /// General purpose flags.
-  quint16 flags;
-  /// Compression method.
-  quint16 method;
-  /// Last modification date and time.
-  QDateTime dateTime;
-  /// CRC.
-  quint32 crc;
-  /// Compressed file size.
-  quint32 compressedSize;
-  /// Uncompressed file size.
-  quint32 uncompressedSize;
-  /// Disk number start.
-  quint16 diskNumberStart;
-  /// Internal file attributes.
-  quint16 internalAttr;
-  /// External file attributes.
-  quint32 externalAttr;
-  /// Comment.
-  QString comment;
-  /// Extra field.
-  QByteArray extra;
-};
-
-#endif
+#ifndef QUA_ZIPFILEINFO_H
+#define QUA_ZIPFILEINFO_H
+
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include <QByteArray>
+#include <QDateTime>
+
+#include "quazip_global.h"
+
+/// Information about a file inside archive.
+/** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to
+ * fill this structure. */
+struct QUAZIP_EXPORT QuaZipFileInfo {
+  /// File name.
+  QString name;
+  /// Version created by.
+  quint16 versionCreated;
+  /// Version needed to extract.
+  quint16 versionNeeded;
+  /// General purpose flags.
+  quint16 flags;
+  /// Compression method.
+  quint16 method;
+  /// Last modification date and time.
+  QDateTime dateTime;
+  /// CRC.
+  quint32 crc;
+  /// Compressed file size.
+  quint32 compressedSize;
+  /// Uncompressed file size.
+  quint32 uncompressedSize;
+  /// Disk number start.
+  quint16 diskNumberStart;
+  /// Internal file attributes.
+  quint16 internalAttr;
+  /// External file attributes.
+  quint32 externalAttr;
+  /// Comment.
+  QString comment;
+  /// Extra field.
+  QByteArray extra;
+};
+
+#endif
diff --git a/misc/quazip/quazipnewinfo.cpp b/misc/quazip/quazipnewinfo.cpp
index fb4df6e..ed57e09 100644
--- a/misc/quazip/quazipnewinfo.cpp
+++ b/misc/quazip/quazipnewinfo.cpp
@@ -1,51 +1,51 @@
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
-*/
-
-#include <QFileInfo>
-
-#include "quazipnewinfo.h"
-
-
-QuaZipNewInfo::QuaZipNewInfo(const QString& name):
-  name(name), dateTime(QDateTime::currentDateTime()), internalAttr(0), externalAttr(0)
-{
-}
-
-QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file):
-  name(name), internalAttr(0), externalAttr(0)
-{
-  QFileInfo info(file);
-  QDateTime lm = info.lastModified();
-  if (!info.exists())
-    dateTime = QDateTime::currentDateTime();
-  else
-    dateTime = lm;
-}
-
-void QuaZipNewInfo::setFileDateTime(const QString& file)
-{
-  QFileInfo info(file);
-  QDateTime lm = info.lastModified();
-  if (info.exists())
-    dateTime = lm;
-}
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+*/
+
+#include <QFileInfo>
+
+#include "quazipnewinfo.h"
+
+
+QuaZipNewInfo::QuaZipNewInfo(const QString& name):
+  name(name), dateTime(QDateTime::currentDateTime()), internalAttr(0), externalAttr(0)
+{
+}
+
+QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file):
+  name(name), internalAttr(0), externalAttr(0)
+{
+  QFileInfo info(file);
+  QDateTime lm = info.lastModified();
+  if (!info.exists())
+    dateTime = QDateTime::currentDateTime();
+  else
+    dateTime = lm;
+}
+
+void QuaZipNewInfo::setFileDateTime(const QString& file)
+{
+  QFileInfo info(file);
+  QDateTime lm = info.lastModified();
+  if (info.exists())
+    dateTime = lm;
+}
diff --git a/misc/quazip/quazipnewinfo.h b/misc/quazip/quazipnewinfo.h
index 08c4eae..62159ea 100644
--- a/misc/quazip/quazipnewinfo.h
+++ b/misc/quazip/quazipnewinfo.h
@@ -1,102 +1,102 @@
-#ifndef QUA_ZIPNEWINFO_H
-#define QUA_ZIPNEWINFO_H
-
-/*
-Copyright (C) 2005-2011 Sergey A. Tachenov
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser 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 Lesser
-General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-See COPYING file for the full LGPL text.
-
-Original ZIP package is copyrighted by Gilles Vollant, see
-quazip/(un)zip.h files for details, basically it's zlib license.
- **/
-
-#include <QDateTime>
-#include <QString>
-
-#include "quazip_global.h"
-
-/// Information about a file to be created.
-/** This structure holds information about a file to be created inside
- * ZIP archive. At least name should be set to something correct before
- * passing this structure to
- * QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool).
- **/
-struct QUAZIP_EXPORT QuaZipNewInfo {
-  /// File name.
-  /** This field holds file name inside archive, including path relative
-   * to archive root.
-   **/
-  QString name;
-  /// File timestamp.
-  /** This is the last file modification date and time. Will be stored
-   * in the archive central directory. It is a good practice to set it
-   * to the source file timestamp instead of archive creating time. Use
-   * setFileDateTime() or QuaZipNewInfo(const QString&, const QString&).
-   **/
-  QDateTime dateTime;
-  /// File internal attributes.
-  quint16 internalAttr;
-  /// File external attributes.
-  quint32 externalAttr;
-  /// File comment.
-  /** Will be encoded using QuaZip::getCommentCodec().
-   **/
-  QString comment;
-  /// File local extra field.
-  QByteArray extraLocal;
-  /// File global extra field.
-  QByteArray extraGlobal;
-  /// Uncompressed file size.
-  /** This is only needed if you are using raw file zipping mode, i. e.
-   * adding precompressed file in the zip archive.
-   **/
-  ulong uncompressedSize;
-  /// Constructs QuaZipNewInfo instance.
-  /** Initializes name with \a name, dateTime with current date and
-   * time. Attributes are initialized with zeros, comment and extra
-   * field with null values.
-   **/
-  QuaZipNewInfo(const QString& name);
-  /// Constructs QuaZipNewInfo instance.
-  /** Initializes name with \a name and dateTime with timestamp of the
-   * file named \a file. If the \a file does not exists or its timestamp
-   * is inaccessible (e. g. you do not have read permission for the
-   * directory file in), uses current date and time. Attributes are
-   * initialized with zeros, comment and extra field with null values.
-   * 
-   * \sa setFileDateTime()
-   **/
-  QuaZipNewInfo(const QString& name, const QString& file);
-  /// Sets the file timestamp from the existing file.
-  /** Use this function to set the file timestamp from the existing
-   * file. Use it like this:
-   * \code
-   * QuaZipFile zipFile(&zip);
-   * QFile file("file-to-add");
-   * file.open(QIODevice::ReadOnly);
-   * QuaZipNewInfo info("file-name-in-archive");
-   * info.setFileDateTime("file-to-add"); // take the timestamp from file
-   * zipFile.open(QIODevice::WriteOnly, info);
-   * \endcode
-   *
-   * This function does not change dateTime if some error occured (e. g.
-   * file is inaccessible).
-   **/
-  void setFileDateTime(const QString& file);
-};
-
-#endif
+#ifndef QUA_ZIPNEWINFO_H
+#define QUA_ZIPNEWINFO_H
+
+/*
+Copyright (C) 2005-2011 Sergey A. Tachenov
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser 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 Lesser
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+See COPYING file for the full LGPL text.
+
+Original ZIP package is copyrighted by Gilles Vollant, see
+quazip/(un)zip.h files for details, basically it's zlib license.
+ **/
+
+#include <QDateTime>
+#include <QString>
+
+#include "quazip_global.h"
+
+/// Information about a file to be created.
+/** This structure holds information about a file to be created inside
+ * ZIP archive. At least name should be set to something correct before
+ * passing this structure to
+ * QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool).
+ **/
+struct QUAZIP_EXPORT QuaZipNewInfo {
+  /// File name.
+  /** This field holds file name inside archive, including path relative
+   * to archive root.
+   **/
+  QString name;
+  /// File timestamp.
+  /** This is the last file modification date and time. Will be stored
+   * in the archive central directory. It is a good practice to set it
+   * to the source file timestamp instead of archive creating time. Use
+   * setFileDateTime() or QuaZipNewInfo(const QString&, const QString&).
+   **/
+  QDateTime dateTime;
+  /// File internal attributes.
+  quint16 internalAttr;
+  /// File external attributes.
+  quint32 externalAttr;
+  /// File comment.
+  /** Will be encoded using QuaZip::getCommentCodec().
+   **/
+  QString comment;
+  /// File local extra field.
+  QByteArray extraLocal;
+  /// File global extra field.
+  QByteArray extraGlobal;
+  /// Uncompressed file size.
+  /** This is only needed if you are using raw file zipping mode, i. e.
+   * adding precompressed file in the zip archive.
+   **/
+  ulong uncompressedSize;
+  /// Constructs QuaZipNewInfo instance.
+  /** Initializes name with \a name, dateTime with current date and
+   * time. Attributes are initialized with zeros, comment and extra
+   * field with null values.
+   **/
+  QuaZipNewInfo(const QString& name);
+  /// Constructs QuaZipNewInfo instance.
+  /** Initializes name with \a name and dateTime with timestamp of the
+   * file named \a file. If the \a file does not exists or its timestamp
+   * is inaccessible (e. g. you do not have read permission for the
+   * directory file in), uses current date and time. Attributes are
+   * initialized with zeros, comment and extra field with null values.
+   * 
+   * \sa setFileDateTime()
+   **/
+  QuaZipNewInfo(const QString& name, const QString& file);
+  /// Sets the file timestamp from the existing file.
+  /** Use this function to set the file timestamp from the existing
+   * file. Use it like this:
+   * \code
+   * QuaZipFile zipFile(&zip);
+   * QFile file("file-to-add");
+   * file.open(QIODevice::ReadOnly);
+   * QuaZipNewInfo info("file-name-in-archive");
+   * info.setFileDateTime("file-to-add"); // take the timestamp from file
+   * zipFile.open(QIODevice::WriteOnly, info);
+   * \endcode
+   *
+   * This function does not change dateTime if some error occured (e. g.
+   * file is inaccessible).
+   **/
+  void setFileDateTime(const QString& file);
+};
+
+#endif
diff --git a/misc/quazip/unzip.h b/misc/quazip/unzip.h
index 8ef4541..33c9dc1 100644
--- a/misc/quazip/unzip.h
+++ b/misc/quazip/unzip.h
@@ -1,356 +1,356 @@
-/* unzip.h -- IO for uncompress .zip files using zlib
-   Version 1.01e, February 12th, 2005
-
-   Copyright (C) 1998-2005 Gilles Vollant
-
-   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
-     WinZip, InfoZip tools and compatible.
-
-   Multi volume ZipFile (span) are not supported.
-   Encryption compatible with pkzip 2.04g only supported
-   Old compressions used by old PKZip 1.x are not supported
-
-
-   I WAIT FEEDBACK at mail info at winimage.com
-   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
-   Condition of use and distribution are the same than zlib :
-
-  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.
-
-   Modified by Sergey A. Tachenov to integrate with Qt.
-
-
-*/
-
-/* for more info about .ZIP format, see
-      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
-      http://www.info-zip.org/pub/infozip/doc/
-   PkWare has also a specification at :
-      ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _unz_H
-#define _unz_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#ifndef _ZLIBIOAPI_H
-#include "ioapi.h"
-#endif
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
-    from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK                          (0)
-#define UNZ_END_OF_LIST_OF_FILE         (-100)
-#define UNZ_ERRNO                       (Z_ERRNO)
-#define UNZ_EOF                         (0)
-#define UNZ_PARAMERROR                  (-102)
-#define UNZ_BADZIPFILE                  (-103)
-#define UNZ_INTERNALERROR               (-104)
-#define UNZ_CRCERROR                    (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
-    uInt tm_sec;            /* seconds after the minute - [0,59] */
-    uInt tm_min;            /* minutes after the hour - [0,59] */
-    uInt tm_hour;           /* hours since midnight - [0,23] */
-    uInt tm_mday;           /* day of the month - [1,31] */
-    uInt tm_mon;            /* months since January - [0,11] */
-    uInt tm_year;           /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
-   These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
-    uLong number_entry;         /* total number of entries in
-                       the central dir on this disk */
-    uLong size_comment;         /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
-    uLong version;              /* version made by                 2 bytes */
-    uLong version_needed;       /* version needed to extract       2 bytes */
-    uLong flag;                 /* general purpose bit flag        2 bytes */
-    uLong compression_method;   /* compression method              2 bytes */
-    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
-    uLong crc;                  /* crc-32                          4 bytes */
-    uLong compressed_size;      /* compressed size                 4 bytes */
-    uLong uncompressed_size;    /* uncompressed size               4 bytes */
-    uLong size_filename;        /* filename length                 2 bytes */
-    uLong size_file_extra;      /* extra field length              2 bytes */
-    uLong size_file_comment;    /* file comment length             2 bytes */
-
-    uLong disk_num_start;       /* disk number start               2 bytes */
-    uLong internal_fa;          /* internal file attributes        2 bytes */
-    uLong external_fa;          /* external file attributes        4 bytes */
-
-    tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
-                                                 const char* fileName2,
-                                                 int iCaseSensitivity));
-/*
-   Compare two filename (fileName1,fileName2).
-   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
-   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
-                                or strcasecmp)
-   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
-    (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((voidpf file));
-/*
-  Open a Zip file. path contain whatever zopen_file from the IO API
-  accepts. For Qt implementation it is a pointer to QIODevice, for
-  fopen() implementation it's a file name.
-     If the zipfile cannot be opened (file don't exist or in not valid), the
-       return value is NULL.
-     Else, the return value is a unzFile Handle, usable with other function
-       of this unzip package.
-*/
-
-extern unzFile ZEXPORT unzOpen2 OF((voidpf file,
-                                    zlib_filefunc_def* pzlib_filefunc_def));
-/*
-   Open a Zip file, like unzOpen, but provide a set of file low level API
-      for read/write the zip file (see ioapi.h)
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
-  Close a ZipFile opened with unzipOpen.
-  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
-    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
-  return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
-                                        unz_global_info *pglobal_info));
-/*
-  Write info about the ZipFile in the *pglobal_info structure.
-  No preparation of the structure is needed
-  return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
-                                           char *szComment,
-                                           uLong uSizeBuf));
-/*
-  Get the global comment string of the ZipFile, in the szComment buffer.
-  uSizeBuf is the size of the szComment buffer.
-  return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the first file.
-  return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
-  Set the current file of the zipfile to the next file.
-  return UNZ_OK if there is no problem
-  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file,
-                     const char *szFileName,
-                     int iCaseSensitivity));
-/*
-  Try locate the file szFileName in the zipfile.
-  For the iCaseSensitivity signification, see unzStringFileNameCompare
-
-  return value :
-  UNZ_OK if the file is found. It becomes the current file.
-  UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-/* ****************************************** */
-/* Ryan supplied functions */
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_pos_s
-{
-    uLong pos_in_zip_directory;   /* offset in zip file directory */
-    uLong num_of_file;            /* # of file */
-} unz_file_pos;
-
-extern int ZEXPORT unzGetFilePos(
-    unzFile file,
-    unz_file_pos* file_pos);
-
-extern int ZEXPORT unzGoToFilePos(
-    unzFile file,
-    unz_file_pos* file_pos);
-
-/* ****************************************** */
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
-                         unz_file_info *pfile_info,
-                         char *szFileName,
-                         uLong fileNameBufferSize,
-                         void *extraField,
-                         uLong extraFieldBufferSize,
-                         char *szComment,
-                         uLong commentBufferSize));
-/*
-  Get Info about the current file
-  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
-        the current file
-  if szFileName!=NULL, the filemane string will be copied in szFileName
-            (fileNameBufferSize is the size of the buffer)
-  if extraField!=NULL, the extra field information will be copied in extraField
-            (extraFieldBufferSize is the size of the buffer).
-            This is the Central-header version of the extra field
-  if szComment!=NULL, the comment string of the file will be copied in szComment
-            (commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
-   from it, and close it (you can close it before reading all the file)
-   */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
-  Open for reading data the current file in the zipfile.
-  If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
-                                                  const char* password));
-/*
-  Open for reading data the current file in the zipfile.
-  password is a crypting password
-  If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
-                                           int* method,
-                                           int* level,
-                                           int raw));
-/*
-  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
-    if raw==1
-  *method will receive method of compression, *level will receive level of
-     compression
-  note : you can set level parameter as NULL (if you did not want known level,
-         but you CANNOT set method parameter as NULL
-*/
-
-extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
-                                           int* method,
-                                           int* level,
-                                           int raw,
-                                           const char* password));
-/*
-  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
-    if raw==1
-  *method will receive method of compression, *level will receive level of
-     compression
-  note : you can set level parameter as NULL (if you did not want known level,
-         but you CANNOT set method parameter as NULL
-*/
-
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
-  Close the file in zip opened with unzOpenCurrentFile
-  Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
-                      voidp buf,
-                      unsigned len));
-/*
-  Read bytes from the current file (opened by unzOpenCurrentFile)
-  buf contain buffer where data must be copied
-  len the size of buf.
-
-  return the number of byte copied if somes bytes are copied
-  return 0 if the end of file was reached
-  return <0 with error code if there is an error
-    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-/*
-  Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
-  return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
-                                             voidp buf,
-                                             unsigned len));
-/*
-  Read extra field from the current file (opened by unzOpenCurrentFile)
-  This is the local-header version of the extra field (sometimes, there is
-    more info in the local-header version than in the central-header)
-
-  if buf==NULL, it return the size of the local extra field
-
-  if buf!=NULL, len is the size of the buffer, the extra header is copied in
-    buf.
-  the return value is the number of bytes copied in buf, or (if <0)
-    the error code
-*/
-
-/***************************************************************************/
-
-/* Get the current file offset */
-extern uLong ZEXPORT unzGetOffset (unzFile file);
-
-/* Set the current file offset */
-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz_H */
+/* unzip.h -- IO for uncompress .zip files using zlib
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
+     WinZip, InfoZip tools and compatible.
+
+   Multi volume ZipFile (span) are not supported.
+   Encryption compatible with pkzip 2.04g only supported
+   Old compressions used by old PKZip 1.x are not supported
+
+
+   I WAIT FEEDBACK at mail info at winimage.com
+   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+
+   Condition of use and distribution are the same than zlib :
+
+  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.
+
+   Modified by Sergey A. Tachenov to integrate with Qt.
+
+
+*/
+
+/* for more info about .ZIP format, see
+      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
+      http://www.info-zip.org/pub/infozip/doc/
+   PkWare has also a specification at :
+      ftp://ftp.pkware.com/probdesc.zip
+*/
+
+#ifndef _unz_H
+#define _unz_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
+#else
+typedef voidp unzFile;
+#endif
+
+
+#define UNZ_OK                          (0)
+#define UNZ_END_OF_LIST_OF_FILE         (-100)
+#define UNZ_ERRNO                       (Z_ERRNO)
+#define UNZ_EOF                         (0)
+#define UNZ_PARAMERROR                  (-102)
+#define UNZ_BADZIPFILE                  (-103)
+#define UNZ_INTERNALERROR               (-104)
+#define UNZ_CRCERROR                    (-105)
+
+/* tm_unz contain date/time info */
+typedef struct tm_unz_s
+{
+    uInt tm_sec;            /* seconds after the minute - [0,59] */
+    uInt tm_min;            /* minutes after the hour - [0,59] */
+    uInt tm_hour;           /* hours since midnight - [0,23] */
+    uInt tm_mday;           /* day of the month - [1,31] */
+    uInt tm_mon;            /* months since January - [0,11] */
+    uInt tm_year;           /* years - [1980..2044] */
+} tm_unz;
+
+/* unz_global_info structure contain global data about the ZIPfile
+   These data comes from the end of central dir */
+typedef struct unz_global_info_s
+{
+    uLong number_entry;         /* total number of entries in
+                       the central dir on this disk */
+    uLong size_comment;         /* size of the global comment of the zipfile */
+} unz_global_info;
+
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info_s
+{
+    uLong version;              /* version made by                 2 bytes */
+    uLong version_needed;       /* version needed to extract       2 bytes */
+    uLong flag;                 /* general purpose bit flag        2 bytes */
+    uLong compression_method;   /* compression method              2 bytes */
+    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+    uLong crc;                  /* crc-32                          4 bytes */
+    uLong compressed_size;      /* compressed size                 4 bytes */
+    uLong uncompressed_size;    /* uncompressed size               4 bytes */
+    uLong size_filename;        /* filename length                 2 bytes */
+    uLong size_file_extra;      /* extra field length              2 bytes */
+    uLong size_file_comment;    /* file comment length             2 bytes */
+
+    uLong disk_num_start;       /* disk number start               2 bytes */
+    uLong internal_fa;          /* internal file attributes        2 bytes */
+    uLong external_fa;          /* external file attributes        4 bytes */
+
+    tm_unz tmu_date;
+} unz_file_info;
+
+extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
+                                                 const char* fileName2,
+                                                 int iCaseSensitivity));
+/*
+   Compare two filename (fileName1,fileName2).
+   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+                                or strcasecmp)
+   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+    (like 1 on Unix, 2 on Windows)
+*/
+
+
+extern unzFile ZEXPORT unzOpen OF((voidpf file));
+/*
+  Open a Zip file. path contain whatever zopen_file from the IO API
+  accepts. For Qt implementation it is a pointer to QIODevice, for
+  fopen() implementation it's a file name.
+     If the zipfile cannot be opened (file don't exist or in not valid), the
+       return value is NULL.
+     Else, the return value is a unzFile Handle, usable with other function
+       of this unzip package.
+*/
+
+extern unzFile ZEXPORT unzOpen2 OF((voidpf file,
+                                    zlib_filefunc_def* pzlib_filefunc_def));
+/*
+   Open a Zip file, like unzOpen, but provide a set of file low level API
+      for read/write the zip file (see ioapi.h)
+*/
+
+extern int ZEXPORT unzClose OF((unzFile file));
+/*
+  Close a ZipFile opened with unzipOpen.
+  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+  return UNZ_OK if there is no problem. */
+
+extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+                                        unz_global_info *pglobal_info));
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem. */
+
+
+extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
+                                           char *szComment,
+                                           uLong uSizeBuf));
+/*
+  Get the global comment string of the ZipFile, in the szComment buffer.
+  uSizeBuf is the size of the szComment buffer.
+  return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the first file.
+  return UNZ_OK if there is no problem
+*/
+
+extern int ZEXPORT unzGoToNextFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the next file.
+  return UNZ_OK if there is no problem
+  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+                     const char *szFileName,
+                     int iCaseSensitivity));
+/*
+  Try locate the file szFileName in the zipfile.
+  For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+  return value :
+  UNZ_OK if the file is found. It becomes the current file.
+  UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+/* ****************************************** */
+/* Ryan supplied functions */
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_pos_s
+{
+    uLong pos_in_zip_directory;   /* offset in zip file directory */
+    uLong num_of_file;            /* # of file */
+} unz_file_pos;
+
+extern int ZEXPORT unzGetFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+/* ****************************************** */
+
+extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
+                         unz_file_info *pfile_info,
+                         char *szFileName,
+                         uLong fileNameBufferSize,
+                         void *extraField,
+                         uLong extraFieldBufferSize,
+                         char *szComment,
+                         uLong commentBufferSize));
+/*
+  Get Info about the current file
+  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+        the current file
+  if szFileName!=NULL, the filemane string will be copied in szFileName
+            (fileNameBufferSize is the size of the buffer)
+  if extraField!=NULL, the extra field information will be copied in extraField
+            (extraFieldBufferSize is the size of the buffer).
+            This is the Central-header version of the extra field
+  if szComment!=NULL, the comment string of the file will be copied in szComment
+            (commentBufferSize is the size of the buffer)
+*/
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+   from it, and close it (you can close it before reading all the file)
+   */
+
+extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
+/*
+  Open for reading data the current file in the zipfile.
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
+                                                  const char* password));
+/*
+  Open for reading data the current file in the zipfile.
+  password is a crypting password
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw,
+                                           const char* password));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+
+extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
+/*
+  Close the file in zip opened with unzOpenCurrentFile
+  Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+                      voidp buf,
+                      unsigned len));
+/*
+  Read bytes from the current file (opened by unzOpenCurrentFile)
+  buf contain buffer where data must be copied
+  len the size of buf.
+
+  return the number of byte copied if somes bytes are copied
+  return 0 if the end of file was reached
+  return <0 with error code if there is an error
+    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+extern z_off_t ZEXPORT unztell OF((unzFile file));
+/*
+  Give the current position in uncompressed data
+*/
+
+extern int ZEXPORT unzeof OF((unzFile file));
+/*
+  return 1 if the end of file was reached, 0 elsewhere
+*/
+
+extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
+                                             voidp buf,
+                                             unsigned len));
+/*
+  Read extra field from the current file (opened by unzOpenCurrentFile)
+  This is the local-header version of the extra field (sometimes, there is
+    more info in the local-header version than in the central-header)
+
+  if buf==NULL, it return the size of the local extra field
+
+  if buf!=NULL, len is the size of the buffer, the extra header is copied in
+    buf.
+  the return value is the number of bytes copied in buf, or (if <0)
+    the error code
+*/
+
+/***************************************************************************/
+
+/* Get the current file offset */
+extern uLong ZEXPORT unzGetOffset (unzFile file);
+
+/* Set the current file offset */
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _unz_H */
diff --git a/misc/quazip/zip.h b/misc/quazip/zip.h
index 0681085..5d9be52 100644
--- a/misc/quazip/zip.h
+++ b/misc/quazip/zip.h
@@ -1,237 +1,237 @@
-/* zip.h -- IO for compress .zip files using zlib
-   Version 1.01e, February 12th, 2005
-
-   Copyright (C) 1998-2005 Gilles Vollant
-
-   This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
-     WinZip, InfoZip tools and compatible.
-   Multi volume ZipFile (span) are not supported.
-   Encryption compatible with pkzip 2.04g only supported
-   Old compressions used by old PKZip 1.x are not supported
-
-  For uncompress .zip file, look at unzip.h
-
-
-   I WAIT FEEDBACK at mail info at winimage.com
-   Visit also http://www.winimage.com/zLibDll/unzip.html for evolution
-
-   Condition of use and distribution are the same than zlib :
-
-  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.
-
-   Modified by Sergey A. Tachenov to integrate with Qt.
-
-
-*/
-
-/* for more info about .ZIP format, see
-      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
-      http://www.info-zip.org/pub/infozip/doc/
-   PkWare has also a specification at :
-      ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _zip_H
-#define _zip_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
-
-#ifndef _ZLIBIOAPI_H
-#include "ioapi.h"
-#endif
-
-#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
-    from (void*) without cast */
-typedef struct TagzipFile__ { int unused; } zipFile__;
-typedef zipFile__ *zipFile;
-#else
-typedef voidp zipFile;
-#endif
-
-#define ZIP_OK                          (0)
-#define ZIP_EOF                         (0)
-#define ZIP_ERRNO                       (Z_ERRNO)
-#define ZIP_PARAMERROR                  (-102)
-#define ZIP_BADZIPFILE                  (-103)
-#define ZIP_INTERNALERROR               (-104)
-
-#ifndef DEF_MEM_LEVEL
-#  if MAX_MEM_LEVEL >= 8
-#    define DEF_MEM_LEVEL 8
-#  else
-#    define DEF_MEM_LEVEL  MAX_MEM_LEVEL
-#  endif
-#endif
-/* default memLevel */
-
-/* tm_zip contain date/time info */
-typedef struct tm_zip_s
-{
-    uInt tm_sec;            /* seconds after the minute - [0,59] */
-    uInt tm_min;            /* minutes after the hour - [0,59] */
-    uInt tm_hour;           /* hours since midnight - [0,23] */
-    uInt tm_mday;           /* day of the month - [1,31] */
-    uInt tm_mon;            /* months since January - [0,11] */
-    uInt tm_year;           /* years - [1980..2044] */
-} tm_zip;
-
-typedef struct
-{
-    tm_zip      tmz_date;       /* date in understandable format           */
-    uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */
-/*    uLong       flag;        */   /* general purpose bit flag        2 bytes */
-
-    uLong       internal_fa;    /* internal file attributes        2 bytes */
-    uLong       external_fa;    /* external file attributes        4 bytes */
-} zip_fileinfo;
-
-typedef const char* zipcharpc;
-
-
-#define APPEND_STATUS_CREATE        (0)
-#define APPEND_STATUS_CREATEAFTER   (1)
-#define APPEND_STATUS_ADDINZIP      (2)
-
-extern zipFile ZEXPORT zipOpen OF((voidpf file, int append));
-/*
-  Create a zipfile.
-     file is whatever the IO API accepts. For Qt IO API it's a pointer to
-       QIODevice. For fopen() IO API it's a file name (const char*).
-     if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
-       will be created at the end of the file.
-         (useful if the file contain a self extractor code)
-     if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
-       add files in existing zip (be sure you don't add file that doesn't exist)
-     If the zipfile cannot be opened, the return value is NULL.
-     Else, the return value is a zipFile Handle, usable with other function
-       of this zip package.
-*/
-
-/* Note : there is no delete function into a zipfile.
-   If you want delete file into a zipfile, you must open a zipfile, and create another
-   Of couse, you can use RAW reading and writing to copy the file you did not want delte
-*/
-
-extern zipFile ZEXPORT zipOpen2 OF((voidpf file,
-                                   int append,
-                                   zipcharpc* globalcomment,
-                                   zlib_filefunc_def* pzlib_filefunc_def));
-
-extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
-                       const char* filename,
-                       const zip_fileinfo* zipfi,
-                       const void* extrafield_local,
-                       uInt size_extrafield_local,
-                       const void* extrafield_global,
-                       uInt size_extrafield_global,
-                       const char* comment,
-                       int method,
-                       int level));
-/*
-  Open a file in the ZIP for writing.
-  filename : the filename in zip (if NULL, '-' without quote will be used
-  *zipfi contain supplemental information
-  if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
-    contains the extrafield data the the local header
-  if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
-    contains the extrafield data the the local header
-  if comment != NULL, comment contain the comment string
-  method contain the compression method (0 for store, Z_DEFLATED for deflate)
-  level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
-*/
-
-
-extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
-                                            const char* filename,
-                                            const zip_fileinfo* zipfi,
-                                            const void* extrafield_local,
-                                            uInt size_extrafield_local,
-                                            const void* extrafield_global,
-                                            uInt size_extrafield_global,
-                                            const char* comment,
-                                            int method,
-                                            int level,
-                                            int raw));
-
-/*
-  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
- */
-
-extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
-                                            const char* filename,
-                                            const zip_fileinfo* zipfi,
-                                            const void* extrafield_local,
-                                            uInt size_extrafield_local,
-                                            const void* extrafield_global,
-                                            uInt size_extrafield_global,
-                                            const char* comment,
-                                            int method,
-                                            int level,
-                                            int raw,
-                                            int windowBits,
-                                            int memLevel,
-                                            int strategy,
-                                            const char* password,
-                                            uLong crcForCtypting));
-
-/*
-  Same than zipOpenNewFileInZip2, except
-    windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
-    password : crypting password (NULL for no crypting)
-    crcForCtypting : crc of file to compress (needed for crypting)
- */
-
-
-extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
-                       const void* buf,
-                       unsigned len));
-/*
-  Write data in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
-/*
-  Close the current file in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
-                                            uLong uncompressed_size,
-                                            uLong crc32));
-/*
-  Close the current file in the zipfile, for fiel opened with
-    parameter raw=1 in zipOpenNewFileInZip2
-  uncompressed_size and crc32 are value for the uncompressed size
-*/
-
-extern int ZEXPORT zipClose OF((zipFile file,
-                const char* global_comment));
-/*
-  Close the zipfile
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _zip_H */
+/* zip.h -- IO for compress .zip files using zlib
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
+     WinZip, InfoZip tools and compatible.
+   Multi volume ZipFile (span) are not supported.
+   Encryption compatible with pkzip 2.04g only supported
+   Old compressions used by old PKZip 1.x are not supported
+
+  For uncompress .zip file, look at unzip.h
+
+
+   I WAIT FEEDBACK at mail info at winimage.com
+   Visit also http://www.winimage.com/zLibDll/unzip.html for evolution
+
+   Condition of use and distribution are the same than zlib :
+
+  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.
+
+   Modified by Sergey A. Tachenov to integrate with Qt.
+
+
+*/
+
+/* for more info about .ZIP format, see
+      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
+      http://www.info-zip.org/pub/infozip/doc/
+   PkWare has also a specification at :
+      ftp://ftp.pkware.com/probdesc.zip
+*/
+
+#ifndef _zip_H
+#define _zip_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagzipFile__ { int unused; } zipFile__;
+typedef zipFile__ *zipFile;
+#else
+typedef voidp zipFile;
+#endif
+
+#define ZIP_OK                          (0)
+#define ZIP_EOF                         (0)
+#define ZIP_ERRNO                       (Z_ERRNO)
+#define ZIP_PARAMERROR                  (-102)
+#define ZIP_BADZIPFILE                  (-103)
+#define ZIP_INTERNALERROR               (-104)
+
+#ifndef DEF_MEM_LEVEL
+#  if MAX_MEM_LEVEL >= 8
+#    define DEF_MEM_LEVEL 8
+#  else
+#    define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#  endif
+#endif
+/* default memLevel */
+
+/* tm_zip contain date/time info */
+typedef struct tm_zip_s
+{
+    uInt tm_sec;            /* seconds after the minute - [0,59] */
+    uInt tm_min;            /* minutes after the hour - [0,59] */
+    uInt tm_hour;           /* hours since midnight - [0,23] */
+    uInt tm_mday;           /* day of the month - [1,31] */
+    uInt tm_mon;            /* months since January - [0,11] */
+    uInt tm_year;           /* years - [1980..2044] */
+} tm_zip;
+
+typedef struct
+{
+    tm_zip      tmz_date;       /* date in understandable format           */
+    uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */
+/*    uLong       flag;        */   /* general purpose bit flag        2 bytes */
+
+    uLong       internal_fa;    /* internal file attributes        2 bytes */
+    uLong       external_fa;    /* external file attributes        4 bytes */
+} zip_fileinfo;
+
+typedef const char* zipcharpc;
+
+
+#define APPEND_STATUS_CREATE        (0)
+#define APPEND_STATUS_CREATEAFTER   (1)
+#define APPEND_STATUS_ADDINZIP      (2)
+
+extern zipFile ZEXPORT zipOpen OF((voidpf file, int append));
+/*
+  Create a zipfile.
+     file is whatever the IO API accepts. For Qt IO API it's a pointer to
+       QIODevice. For fopen() IO API it's a file name (const char*).
+     if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
+       will be created at the end of the file.
+         (useful if the file contain a self extractor code)
+     if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
+       add files in existing zip (be sure you don't add file that doesn't exist)
+     If the zipfile cannot be opened, the return value is NULL.
+     Else, the return value is a zipFile Handle, usable with other function
+       of this zip package.
+*/
+
+/* Note : there is no delete function into a zipfile.
+   If you want delete file into a zipfile, you must open a zipfile, and create another
+   Of couse, you can use RAW reading and writing to copy the file you did not want delte
+*/
+
+extern zipFile ZEXPORT zipOpen2 OF((voidpf file,
+                                   int append,
+                                   zipcharpc* globalcomment,
+                                   zlib_filefunc_def* pzlib_filefunc_def));
+
+extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
+                       const char* filename,
+                       const zip_fileinfo* zipfi,
+                       const void* extrafield_local,
+                       uInt size_extrafield_local,
+                       const void* extrafield_global,
+                       uInt size_extrafield_global,
+                       const char* comment,
+                       int method,
+                       int level));
+/*
+  Open a file in the ZIP for writing.
+  filename : the filename in zip (if NULL, '-' without quote will be used
+  *zipfi contain supplemental information
+  if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
+    contains the extrafield data the the local header
+  if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
+    contains the extrafield data the the local header
+  if comment != NULL, comment contain the comment string
+  method contain the compression method (0 for store, Z_DEFLATED for deflate)
+  level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
+*/
+
+
+extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw));
+
+/*
+  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int windowBits,
+                                            int memLevel,
+                                            int strategy,
+                                            const char* password,
+                                            uLong crcForCtypting));
+
+/*
+  Same than zipOpenNewFileInZip2, except
+    windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
+    password : crypting password (NULL for no crypting)
+    crcForCtypting : crc of file to compress (needed for crypting)
+ */
+
+
+extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
+                       const void* buf,
+                       unsigned len));
+/*
+  Write data in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
+/*
+  Close the current file in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
+                                            uLong uncompressed_size,
+                                            uLong crc32));
+/*
+  Close the current file in the zipfile, for fiel opened with
+    parameter raw=1 in zipOpenNewFileInZip2
+  uncompressed_size and crc32 are value for the uncompressed size
+*/
+
+extern int ZEXPORT zipClose OF((zipFile file,
+                const char* global_comment));
+/*
+  Close the zipfile
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _zip_H */
diff --git a/misc/winutils/Hedgewars.lnk b/misc/winutils/Hedgewars.lnk
new file mode 100644
index 0000000..4f85073
Binary files /dev/null and b/misc/winutils/Hedgewars.lnk differ
diff --git a/misc/winutils/include/SDL.h b/misc/winutils/include/SDL.h
new file mode 100644
index 0000000..6087b7c
--- /dev/null
+++ b/misc/winutils/include/SDL.h
@@ -0,0 +1,101 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL.h
+ *  Main include header for the SDL library
+ */
+
+#ifndef _SDL_H
+#define _SDL_H
+
+#include "SDL_main.h"
+#include "SDL_stdinc.h"
+#include "SDL_audio.h"
+#include "SDL_cdrom.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_endian.h"
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_loadso.h"
+#include "SDL_mutex.h"
+#include "SDL_rwops.h"
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL.h
+ *  @note As of version 0.5, SDL is loaded dynamically into the application
+ */
+
+/** @name SDL_INIT Flags
+ *  These are the flags which may be passed to SDL_Init() -- you should
+ *  specify the subsystems which you will be using in your application.
+ */
+/*@{*/
+#define	SDL_INIT_TIMER		0x00000001
+#define SDL_INIT_AUDIO		0x00000010
+#define SDL_INIT_VIDEO		0x00000020
+#define SDL_INIT_CDROM		0x00000100
+#define SDL_INIT_JOYSTICK	0x00000200
+#define SDL_INIT_NOPARACHUTE	0x00100000	/**< Don't catch fatal signals */
+#define SDL_INIT_EVENTTHREAD	0x01000000	/**< Not supported on all OS's */
+#define SDL_INIT_EVERYTHING	0x0000FFFF
+/*@}*/
+
+/** This function loads the SDL dynamically linked library and initializes 
+ *  the subsystems specified by 'flags' (and those satisfying dependencies)
+ *  Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
+ *  signal handlers for some commonly ignored fatal signals (like SIGSEGV)
+ */
+extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
+
+/** This function initializes specific SDL subsystems */
+extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
+
+/** This function cleans up specific SDL subsystems */
+extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
+
+/** This function returns mask of the specified subsystems which have
+ *  been initialized.
+ *  If 'flags' is 0, it returns a mask of all initialized subsystems.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
+
+/** This function cleans up all initialized subsystems and unloads the
+ *  dynamically linked library.  You should call it upon all exit conditions.
+ */
+extern DECLSPEC void SDLCALL SDL_Quit(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_H */
diff --git a/misc/winutils/include/SDL_active.h b/misc/winutils/include/SDL_active.h
new file mode 100644
index 0000000..cd854e8
--- /dev/null
+++ b/misc/winutils/include/SDL_active.h
@@ -0,0 +1,63 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_active.h
+ *  Include file for SDL application focus event handling 
+ */
+
+#ifndef _SDL_active_h
+#define _SDL_active_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name The available application states */
+/*@{*/
+#define SDL_APPMOUSEFOCUS	0x01		/**< The app has mouse coverage */
+#define SDL_APPINPUTFOCUS	0x02		/**< The app has input focus */
+#define SDL_APPACTIVE		0x04		/**< The application is active */
+/*@}*/
+
+/* Function prototypes */
+/** 
+ * This function returns the current state of the application, which is a
+ * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
+ * SDL_APPACTIVE.  If SDL_APPACTIVE is set, then the user is able to
+ * see your application, otherwise it has been iconified or disabled.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_active_h */
diff --git a/misc/winutils/include/SDL_audio.h b/misc/winutils/include/SDL_audio.h
new file mode 100644
index 0000000..e879c98
--- /dev/null
+++ b/misc/winutils/include/SDL_audio.h
@@ -0,0 +1,284 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_audio.h
+ *  Access to the raw audio mixing buffer for the SDL library
+ */
+
+#ifndef _SDL_audio_h
+#define _SDL_audio_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_endian.h"
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * When filling in the desired audio spec structure,
+ * - 'desired->freq' should be the desired audio frequency in samples-per-second.
+ * - 'desired->format' should be the desired audio format.
+ * - 'desired->samples' is the desired size of the audio buffer, in samples.
+ *     This number should be a power of two, and may be adjusted by the audio
+ *     driver to a value more suitable for the hardware.  Good values seem to
+ *     range between 512 and 8096 inclusive, depending on the application and
+ *     CPU speed.  Smaller values yield faster response time, but can lead
+ *     to underflow if the application is doing heavy processing and cannot
+ *     fill the audio buffer in time.  A stereo sample consists of both right
+ *     and left channels in LR ordering.
+ *     Note that the number of samples is directly related to time by the
+ *     following formula:  ms = (samples*1000)/freq
+ * - 'desired->size' is the size in bytes of the audio buffer, and is
+ *     calculated by SDL_OpenAudio().
+ * - 'desired->silence' is the value used to set the buffer to silence,
+ *     and is calculated by SDL_OpenAudio().
+ * - 'desired->callback' should be set to a function that will be called
+ *     when the audio device is ready for more data.  It is passed a pointer
+ *     to the audio buffer, and the length in bytes of the audio buffer.
+ *     This function usually runs in a separate thread, and so you should
+ *     protect data structures that it accesses by calling SDL_LockAudio()
+ *     and SDL_UnlockAudio() in your code.
+ * - 'desired->userdata' is passed as the first parameter to your callback
+ *     function.
+ *
+ * @note The calculated values in this structure are calculated by SDL_OpenAudio()
+ *
+ */
+typedef struct SDL_AudioSpec {
+	int freq;		/**< DSP frequency -- samples per second */
+	Uint16 format;		/**< Audio data format */
+	Uint8  channels;	/**< Number of channels: 1 mono, 2 stereo */
+	Uint8  silence;		/**< Audio buffer silence value (calculated) */
+	Uint16 samples;		/**< Audio buffer size in samples (power of 2) */
+	Uint16 padding;		/**< Necessary for some compile environments */
+	Uint32 size;		/**< Audio buffer size in bytes (calculated) */
+	/**
+	 *  This function is called when the audio device needs more data.
+	 *
+	 *  @param[out] stream	A pointer to the audio data buffer
+	 *  @param[in]  len	The length of the audio buffer in bytes.
+	 *
+	 *  Once the callback returns, the buffer will no longer be valid.
+	 *  Stereo samples are stored in a LRLRLR ordering.
+	 */
+	void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
+	void  *userdata;
+} SDL_AudioSpec;
+
+/**
+ *  @name Audio format flags
+ *  defaults to LSB byte order
+ */
+/*@{*/
+#define AUDIO_U8	0x0008	/**< Unsigned 8-bit samples */
+#define AUDIO_S8	0x8008	/**< Signed 8-bit samples */
+#define AUDIO_U16LSB	0x0010	/**< Unsigned 16-bit samples */
+#define AUDIO_S16LSB	0x8010	/**< Signed 16-bit samples */
+#define AUDIO_U16MSB	0x1010	/**< As above, but big-endian byte order */
+#define AUDIO_S16MSB	0x9010	/**< As above, but big-endian byte order */
+#define AUDIO_U16	AUDIO_U16LSB
+#define AUDIO_S16	AUDIO_S16LSB
+
+/**
+ *  @name Native audio byte ordering
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define AUDIO_U16SYS	AUDIO_U16LSB
+#define AUDIO_S16SYS	AUDIO_S16LSB
+#else
+#define AUDIO_U16SYS	AUDIO_U16MSB
+#define AUDIO_S16SYS	AUDIO_S16MSB
+#endif
+/*@}*/
+
+/*@}*/
+
+
+/** A structure to hold a set of audio conversion filters and buffers */
+typedef struct SDL_AudioCVT {
+	int needed;			/**< Set to 1 if conversion possible */
+	Uint16 src_format;		/**< Source audio format */
+	Uint16 dst_format;		/**< Target audio format */
+	double rate_incr;		/**< Rate conversion increment */
+	Uint8 *buf;			/**< Buffer to hold entire audio data */
+	int    len;			/**< Length of original audio buffer */
+	int    len_cvt;			/**< Length of converted audio buffer */
+	int    len_mult;		/**< buffer must be len*len_mult big */
+	double len_ratio; 	/**< Given len, final size is len*len_ratio */
+	void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+	int filter_index;		/**< Current audio conversion function */
+} SDL_AudioCVT;
+
+
+/* Function prototypes */
+
+/**
+ * @name Audio Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the audio driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
+extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * current audio driver, and returns a pointer to it if the audio driver has
+ * been initialized.  It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function opens the audio device with the desired parameters, and
+ * returns 0 if successful, placing the actual hardware parameters in the
+ * structure pointed to by 'obtained'.  If 'obtained' is NULL, the audio
+ * data passed to the callback function will be guaranteed to be in the
+ * requested format, and will be automatically converted to the hardware
+ * audio format if necessary.  This function returns -1 if it failed 
+ * to open the audio device, or couldn't set up the audio thread.
+ *
+ * The audio device starts out playing silence when it's opened, and should
+ * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
+ * for your audio callback function to be called.  Since the audio driver
+ * may modify the requested size of the audio buffer, you should allocate
+ * any local mixing buffers after you open the audio device.
+ *
+ * @sa SDL_AudioSpec
+ */
+extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
+
+typedef enum {
+	SDL_AUDIO_STOPPED = 0,
+	SDL_AUDIO_PLAYING,
+	SDL_AUDIO_PAUSED
+} SDL_audiostatus;
+
+/** Get the current audio state */
+extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
+
+/**
+ * This function pauses and unpauses the audio callback processing.
+ * It should be called with a parameter of 0 after opening the audio
+ * device to start playing sound.  This is so you can safely initialize
+ * data for your callback function after opening the audio device.
+ * Silence will be written to the audio device during the pause.
+ */
+extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
+
+/**
+ * This function loads a WAVE from the data source, automatically freeing
+ * that source if 'freesrc' is non-zero.  For example, to load a WAVE file,
+ * you could do:
+ *	@code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
+ *
+ * If this function succeeds, it returns the given SDL_AudioSpec,
+ * filled with the audio data format of the wave data, and sets
+ * 'audio_buf' to a malloc()'d buffer containing the audio data,
+ * and sets 'audio_len' to the length of that audio buffer, in bytes.
+ * You need to free the audio buffer with SDL_FreeWAV() when you are 
+ * done with it.
+ *
+ * This function returns NULL and sets the SDL error message if the 
+ * wave file cannot be opened, uses an unknown data format, or is 
+ * corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
+ */
+extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
+
+/** Compatibility convenience function -- loads a WAV from a file */
+#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
+	SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
+
+/**
+ * This function frees data previously allocated with SDL_LoadWAV_RW()
+ */
+extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
+
+/**
+ * This function takes a source format and rate and a destination format
+ * and rate, and initializes the 'cvt' structure with information needed
+ * by SDL_ConvertAudio() to convert a buffer of audio data from one format
+ * to the other.
+ *
+ * @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
+		Uint16 src_format, Uint8 src_channels, int src_rate,
+		Uint16 dst_format, Uint8 dst_channels, int dst_rate);
+
+/**
+ * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
+ * created an audio buffer cvt->buf, and filled it with cvt->len bytes of
+ * audio data in the source format, this function will convert it in-place
+ * to the desired format.
+ * The data conversion may expand the size of the audio data, so the buffer
+ * cvt->buf should be allocated after the cvt structure is initialized by
+ * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
+ */
+extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
+
+
+#define SDL_MIX_MAXVOLUME 128
+/**
+ * This takes two audio buffers of the playing audio format and mixes
+ * them, performing addition, volume adjustment, and overflow clipping.
+ * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
+ * for full audio volume.  Note this does not change hardware volume.
+ * This is provided for convenience -- you can mix your own audio data.
+ */
+extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
+
+/**
+ * @name Audio Locks
+ * The lock manipulated by these functions protects the callback function.
+ * During a LockAudio/UnlockAudio pair, you can be guaranteed that the
+ * callback function is not running.  Do not call these from the callback
+ * function or you will cause deadlock.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_LockAudio(void);
+extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
+/*@}*/
+
+/**
+ * This function shuts down audio processing and closes the audio device.
+ */
+extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_audio_h */
diff --git a/misc/winutils/include/SDL_byteorder.h b/misc/winutils/include/SDL_byteorder.h
new file mode 100644
index 0000000..47332c3
--- /dev/null
+++ b/misc/winutils/include/SDL_byteorder.h
@@ -0,0 +1,29 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_byteorder.h
+ *  @deprecated Use SDL_endian.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_endian.h"
diff --git a/misc/winutils/include/SDL_cdrom.h b/misc/winutils/include/SDL_cdrom.h
new file mode 100644
index 0000000..febb19d
--- /dev/null
+++ b/misc/winutils/include/SDL_cdrom.h
@@ -0,0 +1,202 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_cdrom.h
+ *  This is the CD-audio control API for Simple DirectMedia Layer
+ */
+
+#ifndef _SDL_cdrom_h
+#define _SDL_cdrom_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  @file SDL_cdrom.h
+ *  In order to use these functions, SDL_Init() must have been called
+ *  with the SDL_INIT_CDROM flag.  This causes SDL to scan the system
+ *  for CD-ROM drives, and load appropriate drivers.
+ */
+
+/** The maximum number of CD-ROM tracks on a disk */
+#define SDL_MAX_TRACKS	99
+
+/** @name Track Types
+ *  The types of CD-ROM track possible
+ */
+/*@{*/
+#define SDL_AUDIO_TRACK	0x00
+#define SDL_DATA_TRACK	0x04
+/*@}*/
+
+/** The possible states which a CD-ROM drive can be in. */
+typedef enum {
+	CD_TRAYEMPTY,
+	CD_STOPPED,
+	CD_PLAYING,
+	CD_PAUSED,
+	CD_ERROR = -1
+} CDstatus;
+
+/** Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status)	((int)(status) > 0)
+
+typedef struct SDL_CDtrack {
+	Uint8 id;		/**< Track number */
+	Uint8 type;		/**< Data or audio track */
+	Uint16 unused;
+	Uint32 length;		/**< Length, in frames, of this track */
+	Uint32 offset;		/**< Offset, in frames, from start of disk */
+} SDL_CDtrack;
+
+/** This structure is only current as of the last call to SDL_CDStatus() */
+typedef struct SDL_CD {
+	int id;			/**< Private drive identifier */
+	CDstatus status;	/**< Current drive status */
+
+	/** The rest of this structure is only valid if there's a CD in drive */
+        /*@{*/
+	int numtracks;		/**< Number of tracks on disk */
+	int cur_track;		/**< Current track position */
+	int cur_frame;		/**< Current frame offset within current track */
+	SDL_CDtrack track[SDL_MAX_TRACKS+1];
+        /*@}*/
+} SDL_CD;
+
+/** @name Frames / MSF Conversion Functions
+ *  Conversion functions from frames to Minute/Second/Frames and vice versa
+ */
+/*@{*/
+#define CD_FPS	75
+#define FRAMES_TO_MSF(f, M,S,F)	{					\
+	int value = f;							\
+	*(F) = value%CD_FPS;						\
+	value /= CD_FPS;						\
+	*(S) = value%60;						\
+	value /= 60;							\
+	*(M) = value;							\
+}
+#define MSF_TO_FRAMES(M, S, F)	((M)*60*CD_FPS+(S)*CD_FPS+(F))
+/*@}*/
+
+/* CD-audio API functions: */
+
+/**
+ *  Returns the number of CD-ROM drives on the system, or -1 if
+ *  SDL_Init() has not been called with the SDL_INIT_CDROM flag.
+ */
+extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
+
+/**
+ *  Returns a human-readable, system-dependent identifier for the CD-ROM.
+ *  Example:
+ *   - "/dev/cdrom"
+ *   - "E:"
+ *   - "/dev/disk/ide/1/master"
+ */
+extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
+
+/**
+ *  Opens a CD-ROM drive for access.  It returns a drive handle on success,
+ *  or NULL if the drive was invalid or busy.  This newly opened CD-ROM
+ *  becomes the default CD used when other CD functions are passed a NULL
+ *  CD-ROM handle.
+ *  Drives are numbered starting with 0.  Drive 0 is the system default CD-ROM.
+ */
+extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
+
+/**
+ *  This function returns the current status of the given drive.
+ *  If the drive has a CD in it, the table of contents of the CD and current
+ *  play position of the CD will be stored in the SDL_CD structure.
+ */
+extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
+
+/**
+ *  Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
+ *  tracks and 'nframes' frames.  If both 'ntrack' and 'nframe' are 0, play 
+ *  until the end of the CD.  This function will skip data tracks.
+ *  This function should only be called after calling SDL_CDStatus() to 
+ *  get track information about the CD.
+ *  For example:
+ *      @code
+ *	// Play entire CD:
+ *	if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ *		SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+ *	// Play last track:
+ *	if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ *		SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+ *	}
+ *	// Play first and second track and 10 seconds of third track:
+ *	if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ *		SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
+ *      @endcode
+ *
+ *  @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
+		int start_track, int start_frame, int ntracks, int nframes);
+
+/**
+ *  Play the given CD starting at 'start' frame for 'length' frames.
+ *  @return It returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
+
+/** Pause play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
+
+/** Resume play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
+
+/** Stop play
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
+
+/** Eject CD-ROM
+ *  @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
+
+/** Closes the handle for the CD-ROM drive */
+extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/misc/winutils/include/SDL_config.h b/misc/winutils/include/SDL_config.h
new file mode 100644
index 0000000..09ba38a
--- /dev/null
+++ b/misc/winutils/include/SDL_config.h
@@ -0,0 +1,45 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_config_h
+#define _SDL_config_h
+
+#include "SDL_platform.h"
+
+/* Add any platform that doesn't build using the configure system */
+#if defined(__DREAMCAST__)
+#include "SDL_config_dreamcast.h"
+#elif defined(__MACOS__)
+#include "SDL_config_macos.h"
+#elif defined(__MACOSX__)
+#include "SDL_config_macosx.h"
+#elif defined(__SYMBIAN32__)
+#include "SDL_config_symbian.h"  /* must be before win32! */
+#elif defined(__WIN32__)
+#include "SDL_config_win32.h"
+#elif defined(__OS2__)
+#include "SDL_config_os2.h"
+#else
+#include "SDL_config_minimal.h"
+#endif /* platform config */
+
+#endif /* _SDL_config_h */
diff --git a/misc/winutils/include/SDL_config_win32.h b/misc/winutils/include/SDL_config_win32.h
new file mode 100644
index 0000000..da2c15d
--- /dev/null
+++ b/misc/winutils/include/SDL_config_win32.h
@@ -0,0 +1,183 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_config_win32_h
+#define _SDL_config_win32_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+#if defined(__GNUC__) || defined(__DMC__)
+#define HAVE_STDINT_H	1
+#elif defined(_MSC_VER)
+typedef signed __int8		int8_t;
+typedef unsigned __int8		uint8_t;
+typedef signed __int16		int16_t;
+typedef unsigned __int16	uint16_t;
+typedef signed __int32		int32_t;
+typedef unsigned __int32	uint32_t;
+typedef signed __int64		int64_t;
+typedef unsigned __int64	uint64_t;
+#ifndef _UINTPTR_T_DEFINED
+#ifdef  _WIN64
+typedef unsigned __int64    uintptr_t;
+#else
+typedef unsigned int   uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
+#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
+#define DWORD_PTR DWORD
+#endif
+#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
+#define LONG_PTR LONG
+#endif
+#else	/* !__GNUC__ && !_MSC_VER */
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+#ifndef _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED_
+typedef unsigned int size_t;
+#endif
+typedef unsigned int uintptr_t;
+#endif /* __GNUC__ || _MSC_VER */
+#define SDL_HAS_64BIT_TYPE	1
+
+/* Enabled for SDL 1.2 (binary compatibility) */
+#define HAVE_LIBC	1
+#ifdef HAVE_LIBC
+/* Useful headers */
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#ifndef _WIN32_WCE
+#define HAVE_SIGNAL_H 1
+#endif
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE__STRICMP 1
+#define HAVE__STRNICMP 1
+#define HAVE_SSCANF 1
+#else
+#define HAVE_STDARG_H	1
+#define HAVE_STDDEF_H	1
+#endif
+
+/* Enable various audio drivers */
+#ifndef _WIN32_WCE
+#define SDL_AUDIO_DRIVER_DSOUND	1
+#endif
+#define SDL_AUDIO_DRIVER_WAVEOUT	1
+#define SDL_AUDIO_DRIVER_DISK	1
+#define SDL_AUDIO_DRIVER_DUMMY	1
+
+/* Enable various cdrom drivers */
+#ifdef _WIN32_WCE
+#define SDL_CDROM_DISABLED      1
+#else
+#define SDL_CDROM_WIN32		1
+#endif
+
+/* Enable various input drivers */
+#ifdef _WIN32_WCE
+#define SDL_JOYSTICK_DISABLED   1
+#else
+#define SDL_JOYSTICK_WINMM	1
+#endif
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_WIN32	1
+
+/* Enable various threading systems */
+#define SDL_THREAD_WIN32	1
+
+/* Enable various timer systems */
+#ifdef _WIN32_WCE
+#define SDL_TIMER_WINCE	1
+#else
+#define SDL_TIMER_WIN32	1
+#endif
+
+/* Enable various video drivers */
+#ifdef _WIN32_WCE
+#define SDL_VIDEO_DRIVER_GAPI	1
+#endif
+#ifndef _WIN32_WCE
+#define SDL_VIDEO_DRIVER_DDRAW	1
+#endif
+#define SDL_VIDEO_DRIVER_DUMMY	1
+#define SDL_VIDEO_DRIVER_WINDIB	1
+
+/* Enable OpenGL support */
+#ifndef _WIN32_WCE
+#define SDL_VIDEO_OPENGL	1
+#define SDL_VIDEO_OPENGL_WGL	1
+#endif
+
+/* Disable screensaver */
+#define SDL_VIDEO_DISABLE_SCREENSAVER	1
+
+/* Enable assembly routines (Win64 doesn't have inline asm) */
+#ifndef _WIN64
+#define SDL_ASSEMBLY_ROUTINES	1
+#endif
+
+#endif /* _SDL_config_win32_h */
diff --git a/misc/winutils/include/SDL_copying.h b/misc/winutils/include/SDL_copying.h
new file mode 100644
index 0000000..1bd6b84
--- /dev/null
+++ b/misc/winutils/include/SDL_copying.h
@@ -0,0 +1,22 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2009 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
diff --git a/misc/winutils/include/SDL_cpuinfo.h b/misc/winutils/include/SDL_cpuinfo.h
new file mode 100644
index 0000000..4200d6d
--- /dev/null
+++ b/misc/winutils/include/SDL_cpuinfo.h
@@ -0,0 +1,69 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_cpuinfo.h
+ *  CPU feature detection for SDL
+ */
+
+#ifndef _SDL_cpuinfo_h
+#define _SDL_cpuinfo_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This function returns true if the CPU has the RDTSC instruction */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
+
+/** This function returns true if the CPU has MMX features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
+
+/** This function returns true if the CPU has MMX Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
+
+/** This function returns true if the CPU has 3DNow features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
+
+/** This function returns true if the CPU has 3DNow! Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
+
+/** This function returns true if the CPU has SSE features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
+
+/** This function returns true if the CPU has SSE2 features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
+
+/** This function returns true if the CPU has AltiVec features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_cpuinfo_h */
diff --git a/misc/winutils/include/SDL_endian.h b/misc/winutils/include/SDL_endian.h
new file mode 100644
index 0000000..fd9fc86
--- /dev/null
+++ b/misc/winutils/include/SDL_endian.h
@@ -0,0 +1,214 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_endian.h
+ *  Functions for reading and writing endian-specific values
+ */
+
+#ifndef _SDL_endian_h
+#define _SDL_endian_h
+
+#include "SDL_stdinc.h"
+
+/** @name SDL_ENDIANs
+ *  The two types of endianness 
+ */
+/*@{*/
+#define SDL_LIL_ENDIAN	1234
+#define SDL_BIG_ENDIAN	4321
+/*@}*/
+
+#ifndef SDL_BYTEORDER	/* Not defined in SDL_config.h? */
+#ifdef __linux__
+#include <endian.h>
+#define SDL_BYTEORDER  __BYTE_ORDER
+#else /* __linux __ */
+#if defined(__hppa__) || \
+    defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
+    (defined(__MIPS__) && defined(__MISPEB__)) || \
+    defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
+    defined(__sparc__)
+#define SDL_BYTEORDER	SDL_BIG_ENDIAN
+#else
+#define SDL_BYTEORDER	SDL_LIL_ENDIAN
+#endif
+#endif /* __linux __ */
+#endif /* !SDL_BYTEORDER */
+
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  @name SDL_Swap Functions
+ *  Use inline functions for compilers that support them, and static
+ *  functions for those that do not.  Because these functions become
+ *  static for compilers that do not support inline functions, this
+ *  header should only be included in files that actually use them.
+ */
+/*@{*/
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+	__asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
+	return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+	__asm__("xchgb %b0,%h0" : "=Q" (x) :  "0" (x));
+	return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+	Uint16 result;
+
+	__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
+	return result;
+}
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+	__asm__("rorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
+	return x;
+}
+#else
+static __inline__ Uint16 SDL_Swap16(Uint16 x) {
+	return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
+}
+#endif
+
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+	__asm__("bswap %0" : "=r" (x) : "0" (x));
+	return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+	__asm__("bswapl %0" : "=r" (x) : "0" (x));
+	return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+	Uint32 result;
+
+	__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
+	__asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
+	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
+	return result;
+}
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+	__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
+	return x;
+}
+#else
+static __inline__ Uint32 SDL_Swap32(Uint32 x) {
+	return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
+}
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+#if defined(__GNUC__) && defined(__i386__) && \
+   !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+	union { 
+		struct { Uint32 a,b; } s;
+		Uint64 u;
+	} v;
+	v.u = x;
+	__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 
+	        : "=r" (v.s.a), "=r" (v.s.b) 
+	        : "0" (v.s.a), "1" (v.s.b)); 
+	return v.u;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+	__asm__("bswapq %0" : "=r" (x) : "0" (x));
+	return x;
+}
+#else
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+	Uint32 hi, lo;
+
+	/* Separate into high and low 32-bit values and swap them */
+	lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+	x >>= 32;
+	hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+	x = SDL_Swap32(lo);
+	x <<= 32;
+	x |= SDL_Swap32(hi);
+	return (x);
+}
+#endif
+#else
+/* This is mainly to keep compilers from complaining in SDL code.
+ * If there is no real 64-bit datatype, then compilers will complain about
+ * the fake 64-bit datatype that SDL provides when it compiles user code.
+ */
+#define SDL_Swap64(X)	(X)
+#endif /* SDL_HAS_64BIT_TYPE */
+/*@}*/
+
+/**
+ *  @name SDL_SwapLE and SDL_SwapBE Functions
+ *  Byteswap item from the specified endianness to the native endianness
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define SDL_SwapLE16(X)	(X)
+#define SDL_SwapLE32(X)	(X)
+#define SDL_SwapLE64(X)	(X)
+#define SDL_SwapBE16(X)	SDL_Swap16(X)
+#define SDL_SwapBE32(X)	SDL_Swap32(X)
+#define SDL_SwapBE64(X)	SDL_Swap64(X)
+#else
+#define SDL_SwapLE16(X)	SDL_Swap16(X)
+#define SDL_SwapLE32(X)	SDL_Swap32(X)
+#define SDL_SwapLE64(X)	SDL_Swap64(X)
+#define SDL_SwapBE16(X)	(X)
+#define SDL_SwapBE32(X)	(X)
+#define SDL_SwapBE64(X)	(X)
+#endif
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_endian_h */
diff --git a/misc/winutils/include/SDL_error.h b/misc/winutils/include/SDL_error.h
new file mode 100644
index 0000000..4e1cce3
--- /dev/null
+++ b/misc/winutils/include/SDL_error.h
@@ -0,0 +1,72 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_error.h
+ *  Simple error message routines for SDL
+ */
+
+#ifndef _SDL_error_h
+#define _SDL_error_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** 
+ *  @name Public functions
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
+extern DECLSPEC char * SDLCALL SDL_GetError(void);
+extern DECLSPEC void SDLCALL SDL_ClearError(void);
+/*@}*/
+
+/**
+ *  @name Private functions
+ *  @internal Private error message function - used internally
+ */
+/*@{*/
+#define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)
+#define SDL_Unsupported()	SDL_Error(SDL_UNSUPPORTED)
+typedef enum {
+	SDL_ENOMEM,
+	SDL_EFREAD,
+	SDL_EFWRITE,
+	SDL_EFSEEK,
+	SDL_UNSUPPORTED,
+	SDL_LASTERROR
+} SDL_errorcode;
+extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_error_h */
diff --git a/misc/winutils/include/SDL_events.h b/misc/winutils/include/SDL_events.h
new file mode 100644
index 0000000..94b4202
--- /dev/null
+++ b/misc/winutils/include/SDL_events.h
@@ -0,0 +1,356 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file SDL_events.h
+ *  Include file for SDL event handling
+ */
+
+#ifndef _SDL_events_h
+#define _SDL_events_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_active.h"
+#include "SDL_keyboard.h"
+#include "SDL_mouse.h"
+#include "SDL_joystick.h"
+#include "SDL_quit.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name General keyboard/mouse state definitions */
+/*@{*/
+#define SDL_RELEASED	0
+#define SDL_PRESSED	1
+/*@}*/
+
+/** Event enumerations */
+typedef enum {
+       SDL_NOEVENT = 0,			/**< Unused (do not remove) */
+       SDL_ACTIVEEVENT,			/**< Application loses/gains visibility */
+       SDL_KEYDOWN,			/**< Keys pressed */
+       SDL_KEYUP,			/**< Keys released */
+       SDL_MOUSEMOTION,			/**< Mouse moved */
+       SDL_MOUSEBUTTONDOWN,		/**< Mouse button pressed */
+       SDL_MOUSEBUTTONUP,		/**< Mouse button released */
+       SDL_JOYAXISMOTION,		/**< Joystick axis motion */
+       SDL_JOYBALLMOTION,		/**< Joystick trackball motion */
+       SDL_JOYHATMOTION,		/**< Joystick hat position change */
+       SDL_JOYBUTTONDOWN,		/**< Joystick button pressed */
+       SDL_JOYBUTTONUP,			/**< Joystick button released */
+       SDL_QUIT,			/**< User-requested quit */
+       SDL_SYSWMEVENT,			/**< System specific event */
+       SDL_EVENT_RESERVEDA,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVEDB,		/**< Reserved for future use.. */
+       SDL_VIDEORESIZE,			/**< User resized video mode */
+       SDL_VIDEOEXPOSE,			/**< Screen needs to be redrawn */
+       SDL_EVENT_RESERVED2,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVED3,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVED4,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVED5,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVED6,		/**< Reserved for future use.. */
+       SDL_EVENT_RESERVED7,		/**< Reserved for future use.. */
+       /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
+       SDL_USEREVENT = 24,
+       /** This last event is only for bounding internal arrays
+	*  It is the number of bits in the event mask datatype -- Uint32
+        */
+       SDL_NUMEVENTS = 32
+} SDL_EventType;
+
+/** @name Predefined event masks */
+/*@{*/
+#define SDL_EVENTMASK(X)	(1<<(X))
+typedef enum {
+	SDL_ACTIVEEVENTMASK	= SDL_EVENTMASK(SDL_ACTIVEEVENT),
+	SDL_KEYDOWNMASK		= SDL_EVENTMASK(SDL_KEYDOWN),
+	SDL_KEYUPMASK		= SDL_EVENTMASK(SDL_KEYUP),
+	SDL_KEYEVENTMASK	= SDL_EVENTMASK(SDL_KEYDOWN)|
+	                          SDL_EVENTMASK(SDL_KEYUP),
+	SDL_MOUSEMOTIONMASK	= SDL_EVENTMASK(SDL_MOUSEMOTION),
+	SDL_MOUSEBUTTONDOWNMASK	= SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
+	SDL_MOUSEBUTTONUPMASK	= SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+	SDL_MOUSEEVENTMASK	= SDL_EVENTMASK(SDL_MOUSEMOTION)|
+	                          SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
+	                          SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+	SDL_JOYAXISMOTIONMASK	= SDL_EVENTMASK(SDL_JOYAXISMOTION),
+	SDL_JOYBALLMOTIONMASK	= SDL_EVENTMASK(SDL_JOYBALLMOTION),
+	SDL_JOYHATMOTIONMASK	= SDL_EVENTMASK(SDL_JOYHATMOTION),
+	SDL_JOYBUTTONDOWNMASK	= SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
+	SDL_JOYBUTTONUPMASK	= SDL_EVENTMASK(SDL_JOYBUTTONUP),
+	SDL_JOYEVENTMASK	= SDL_EVENTMASK(SDL_JOYAXISMOTION)|
+	                          SDL_EVENTMASK(SDL_JOYBALLMOTION)|
+	                          SDL_EVENTMASK(SDL_JOYHATMOTION)|
+	                          SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
+	                          SDL_EVENTMASK(SDL_JOYBUTTONUP),
+	SDL_VIDEORESIZEMASK	= SDL_EVENTMASK(SDL_VIDEORESIZE),
+	SDL_VIDEOEXPOSEMASK	= SDL_EVENTMASK(SDL_VIDEOEXPOSE),
+	SDL_QUITMASK		= SDL_EVENTMASK(SDL_QUIT),
+	SDL_SYSWMEVENTMASK	= SDL_EVENTMASK(SDL_SYSWMEVENT)
+} SDL_EventMask ;
+#define SDL_ALLEVENTS		0xFFFFFFFF
+/*@}*/
+
+/** Application visibility event structure */
+typedef struct SDL_ActiveEvent {
+	Uint8 type;	/**< SDL_ACTIVEEVENT */
+	Uint8 gain;	/**< Whether given states were gained or lost (1/0) */
+	Uint8 state;	/**< A mask of the focus states */
+} SDL_ActiveEvent;
+
+/** Keyboard event structure */
+typedef struct SDL_KeyboardEvent {
+	Uint8 type;	/**< SDL_KEYDOWN or SDL_KEYUP */
+	Uint8 which;	/**< The keyboard device index */
+	Uint8 state;	/**< SDL_PRESSED or SDL_RELEASED */
+	SDL_keysym keysym;
+} SDL_KeyboardEvent;
+
+/** Mouse motion event structure */
+typedef struct SDL_MouseMotionEvent {
+	Uint8 type;	/**< SDL_MOUSEMOTION */
+	Uint8 which;	/**< The mouse device index */
+	Uint8 state;	/**< The current button state */
+	Uint16 x, y;	/**< The X/Y coordinates of the mouse */
+	Sint16 xrel;	/**< The relative motion in the X direction */
+	Sint16 yrel;	/**< The relative motion in the Y direction */
+} SDL_MouseMotionEvent;
+
+/** Mouse button event structure */
+typedef struct SDL_MouseButtonEvent {
+	Uint8 type;	/**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
+	Uint8 which;	/**< The mouse device index */
+	Uint8 button;	/**< The mouse button index */
+	Uint8 state;	/**< SDL_PRESSED or SDL_RELEASED */
+	Uint16 x, y;	/**< The X/Y coordinates of the mouse at press time */
+} SDL_MouseButtonEvent;
+
+/** Joystick axis motion event structure */
+typedef struct SDL_JoyAxisEvent {
+	Uint8 type;	/**< SDL_JOYAXISMOTION */
+	Uint8 which;	/**< The joystick device index */
+	Uint8 axis;	/**< The joystick axis index */
+	Sint16 value;	/**< The axis value (range: -32768 to 32767) */
+} SDL_JoyAxisEvent;
+
+/** Joystick trackball motion event structure */
+typedef struct SDL_JoyBallEvent {
+	Uint8 type;	/**< SDL_JOYBALLMOTION */
+	Uint8 which;	/**< The joystick device index */
+	Uint8 ball;	/**< The joystick trackball index */
+	Sint16 xrel;	/**< The relative motion in the X direction */
+	Sint16 yrel;	/**< The relative motion in the Y direction */
+} SDL_JoyBallEvent;
+
+/** Joystick hat position change event structure */
+typedef struct SDL_JoyHatEvent {
+	Uint8 type;	/**< SDL_JOYHATMOTION */
+	Uint8 which;	/**< The joystick device index */
+	Uint8 hat;	/**< The joystick hat index */
+	Uint8 value;	/**< The hat position value:
+			 *   SDL_HAT_LEFTUP   SDL_HAT_UP       SDL_HAT_RIGHTUP
+			 *   SDL_HAT_LEFT     SDL_HAT_CENTERED SDL_HAT_RIGHT
+			 *   SDL_HAT_LEFTDOWN SDL_HAT_DOWN     SDL_HAT_RIGHTDOWN
+			 *  Note that zero means the POV is centered.
+			 */
+} SDL_JoyHatEvent;
+
+/** Joystick button event structure */
+typedef struct SDL_JoyButtonEvent {
+	Uint8 type;	/**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
+	Uint8 which;	/**< The joystick device index */
+	Uint8 button;	/**< The joystick button index */
+	Uint8 state;	/**< SDL_PRESSED or SDL_RELEASED */
+} SDL_JoyButtonEvent;
+
+/** The "window resized" event
+ *  When you get this event, you are responsible for setting a new video
+ *  mode with the new width and height.
+ */
+typedef struct SDL_ResizeEvent {
+	Uint8 type;	/**< SDL_VIDEORESIZE */
+	int w;		/**< New width */
+	int h;		/**< New height */
+} SDL_ResizeEvent;
+
+/** The "screen redraw" event */
+typedef struct SDL_ExposeEvent {
+	Uint8 type;	/**< SDL_VIDEOEXPOSE */
+} SDL_ExposeEvent;
+
+/** The "quit requested" event */
+typedef struct SDL_QuitEvent {
+	Uint8 type;	/**< SDL_QUIT */
+} SDL_QuitEvent;
+
+/** A user-defined event type */
+typedef struct SDL_UserEvent {
+	Uint8 type;	/**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
+	int code;	/**< User defined event code */
+	void *data1;	/**< User defined data pointer */
+	void *data2;	/**< User defined data pointer */
+} SDL_UserEvent;
+
+/** If you want to use this event, you should include SDL_syswm.h */
+struct SDL_SysWMmsg;
+typedef struct SDL_SysWMmsg SDL_SysWMmsg;
+typedef struct SDL_SysWMEvent {
+	Uint8 type;
+	SDL_SysWMmsg *msg;
+} SDL_SysWMEvent;
+
+/** General event structure */
+typedef union SDL_Event {
+	Uint8 type;
+	SDL_ActiveEvent active;
+	SDL_KeyboardEvent key;
+	SDL_MouseMotionEvent motion;
+	SDL_MouseButtonEvent button;
+	SDL_JoyAxisEvent jaxis;
+	SDL_JoyBallEvent jball;
+	SDL_JoyHatEvent jhat;
+	SDL_JoyButtonEvent jbutton;
+	SDL_ResizeEvent resize;
+	SDL_ExposeEvent expose;
+	SDL_QuitEvent quit;
+	SDL_UserEvent user;
+	SDL_SysWMEvent syswm;
+} SDL_Event;
+
+
+/* Function prototypes */
+
+/** Pumps the event loop, gathering events from the input devices.
+ *  This function updates the event queue and internal input device state.
+ *  This should only be run in the thread that sets the video mode.
+ */
+extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
+
+typedef enum {
+	SDL_ADDEVENT,
+	SDL_PEEKEVENT,
+	SDL_GETEVENT
+} SDL_eventaction;
+
+/**
+ *  Checks the event queue for messages and optionally returns them.
+ *
+ *  If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
+ *  the back of the event queue.
+ *  If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
+ *  of the event queue, matching 'mask', will be returned and will not
+ *  be removed from the queue.
+ *  If 'action' is SDL_GETEVENT, up to 'numevents' events at the front 
+ *  of the event queue, matching 'mask', will be returned and will be
+ *  removed from the queue.
+ *
+ *  @return
+ *  This function returns the number of events actually stored, or -1
+ *  if there was an error.
+ *
+ *  This function is thread-safe.
+ */
+extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
+				SDL_eventaction action, Uint32 mask);
+
+/** Polls for currently pending events, and returns 1 if there are any pending
+ *  events, or 0 if there are none available.  If 'event' is not NULL, the next
+ *  event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
+
+/** Waits indefinitely for the next available event, returning 1, or 0 if there
+ *  was an error while waiting for events.  If 'event' is not NULL, the next
+ *  event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
+
+/** Add an event to the event queue.
+ *  This function returns 0 on success, or -1 if the event queue was full
+ *  or there was some other error.
+ */
+extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
+
+/** @name Event Filtering */
+/*@{*/
+typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
+/**
+ *  This function sets up a filter to process all events before they
+ *  change internal state and are posted to the internal event queue.
+ *
+ *  The filter is protypted as:
+ *      @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode
+ *
+ * If the filter returns 1, then the event will be added to the internal queue.
+ * If it returns 0, then the event will be dropped from the queue, but the 
+ * internal state will still be updated.  This allows selective filtering of
+ * dynamically arriving events.
+ *
+ * @warning  Be very careful of what you do in the event filter function, as 
+ *           it may run in a different thread!
+ *
+ * There is one caveat when dealing with the SDL_QUITEVENT event type.  The
+ * event filter is only called when the window manager desires to close the
+ * application window.  If the event filter returns 1, then the window will
+ * be closed, otherwise the window will remain open if possible.
+ * If the quit event is generated by an interrupt signal, it will bypass the
+ * internal queue and be delivered to the application at the next event poll.
+ */
+extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
+
+/**
+ *  Return the current event filter - can be used to "chain" filters.
+ *  If there is no event filter set, this function returns NULL.
+ */
+extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
+/*@}*/
+
+/** @name Event State */
+/*@{*/
+#define SDL_QUERY	-1
+#define SDL_IGNORE	 0
+#define SDL_DISABLE	 0
+#define SDL_ENABLE	 1
+/*@}*/
+
+/**
+* This function allows you to set the state of processing certain events.
+* If 'state' is set to SDL_IGNORE, that event will be automatically dropped
+* from the event queue and will not event be filtered.
+* If 'state' is set to SDL_ENABLE, that event will be processed normally.
+* If 'state' is set to SDL_QUERY, SDL_EventState() will return the 
+* current processing state of the specified event.
+*/
+extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_events_h */
diff --git a/misc/winutils/include/SDL_getenv.h b/misc/winutils/include/SDL_getenv.h
new file mode 100644
index 0000000..bea6300
--- /dev/null
+++ b/misc/winutils/include/SDL_getenv.h
@@ -0,0 +1,28 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_getenv.h
+ *  @deprecated Use SDL_stdinc.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/misc/winutils/include/SDL_joystick.h b/misc/winutils/include/SDL_joystick.h
new file mode 100644
index 0000000..708d1a9
--- /dev/null
+++ b/misc/winutils/include/SDL_joystick.h
@@ -0,0 +1,187 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_joystick.h
+ *  Include file for SDL joystick event handling
+ */
+
+#ifndef _SDL_joystick_h
+#define _SDL_joystick_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL_joystick.h
+ *  @note In order to use these functions, SDL_Init() must have been called
+ *        with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
+ *        for joysticks, and load appropriate drivers.
+ */
+
+/** The joystick structure used to identify an SDL joystick */
+struct _SDL_Joystick;
+typedef struct _SDL_Joystick SDL_Joystick;
+
+/* Function prototypes */
+/**
+ * Count the number of joysticks attached to the system
+ */
+extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
+
+/**
+ * Get the implementation dependent name of a joystick.
+ *
+ * This can be called before any joysticks are opened.
+ * If no name can be found, this function returns NULL.
+ */
+extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
+
+/**
+ * Open a joystick for use.
+ *
+ * @param[in] device_index
+ * The index passed as an argument refers to
+ * the N'th joystick on the system.  This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * @return This function returns a joystick identifier, or NULL if an error occurred.
+ */
+extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
+
+/**
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
+
+/**
+ * Get the device index of an opened joystick.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
+
+/**
+ * Get the number of general axis controls on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
+
+/**
+ * Get the number of trackballs on a joystick
+ *
+ * Joystick trackballs have only relative motion events associated
+ * with them and their state cannot be polled.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
+
+/**
+ * Get the number of POV hats on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
+
+/**
+ * Get the number of buttons on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
+
+/**
+ * Update the current state of the open joysticks.
+ *
+ * This is called automatically by the event loop if any joystick
+ * events are enabled.
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
+
+/**
+ * Enable/disable joystick event polling.
+ *
+ * If joystick events are disabled, you must call SDL_JoystickUpdate()
+ * yourself and check the state of the joystick when you want joystick
+ * information.
+ *
+ * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
+
+/**
+ * Get the current state of an axis control on a joystick
+ *
+ * @param[in] axis The axis indices start at index 0.
+ *
+ * @return The state is a value ranging from -32768 to 32767.
+ */
+extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
+
+/**
+ *  @name Hat Positions
+ *  The return value of SDL_JoystickGetHat() is one of the following positions:
+ */
+/*@{*/
+#define SDL_HAT_CENTERED	0x00
+#define SDL_HAT_UP		0x01
+#define SDL_HAT_RIGHT		0x02
+#define SDL_HAT_DOWN		0x04
+#define SDL_HAT_LEFT		0x08
+#define SDL_HAT_RIGHTUP		(SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN	(SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP		(SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN	(SDL_HAT_LEFT|SDL_HAT_DOWN)
+/*@}*/
+
+/** 
+ *  Get the current state of a POV hat on a joystick
+ *
+ *  @param[in] hat The hat indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
+
+/**
+ * Get the ball axis change since the last poll
+ *
+ * @param[in] ball The ball indices start at index 0.
+ *
+ * @return This returns 0, or -1 if you passed it invalid parameters.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
+
+/**
+ * Get the current state of a button on a joystick
+ *
+ * @param[in] button The button indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
+
+/**
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_joystick_h */
diff --git a/misc/winutils/include/SDL_keyboard.h b/misc/winutils/include/SDL_keyboard.h
new file mode 100644
index 0000000..9d7129c
--- /dev/null
+++ b/misc/winutils/include/SDL_keyboard.h
@@ -0,0 +1,135 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_keyboard.h
+ *  Include file for SDL keyboard event handling
+ */
+
+#ifndef _SDL_keyboard_h
+#define _SDL_keyboard_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_keysym.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Keysym structure
+ *
+ *  - The scancode is hardware dependent, and should not be used by general
+ *    applications.  If no hardware scancode is available, it will be 0.
+ *
+ *  - The 'unicode' translated character is only available when character
+ *    translation is enabled by the SDL_EnableUNICODE() API.  If non-zero,
+ *    this is a UNICODE character corresponding to the keypress.  If the
+ *    high 9 bits of the character are 0, then this maps to the equivalent
+ *    ASCII character:
+ *      @code
+ *	char ch;
+ *	if ( (keysym.unicode & 0xFF80) == 0 ) {
+ *		ch = keysym.unicode & 0x7F;
+ *	} else {
+ *		An international character..
+ *	}
+ *      @endcode
+ */
+typedef struct SDL_keysym {
+	Uint8 scancode;			/**< hardware specific scancode */
+	SDLKey sym;			/**< SDL virtual keysym */
+	SDLMod mod;			/**< current key modifiers */
+	Uint16 unicode;			/**< translated character */
+} SDL_keysym;
+
+/** This is the mask which refers to all hotkey bindings */
+#define SDL_ALL_HOTKEYS		0xFFFFFFFF
+
+/* Function prototypes */
+/**
+ * Enable/Disable UNICODE translation of keyboard input.
+ *
+ * This translation has some overhead, so translation defaults off.
+ *
+ * @param[in] enable
+ * If 'enable' is 1, translation is enabled.
+ * If 'enable' is 0, translation is disabled.
+ * If 'enable' is -1, the translation state is not changed.
+ *
+ * @return It returns the previous state of keyboard translation.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
+
+#define SDL_DEFAULT_REPEAT_DELAY	500
+#define SDL_DEFAULT_REPEAT_INTERVAL	30
+/**
+ * Enable/Disable keyboard repeat.  Keyboard repeat defaults to off.
+ *
+ *  @param[in] delay
+ *  'delay' is the initial delay in ms between the time when a key is
+ *  pressed, and keyboard repeat begins.
+ *
+ *  @param[in] interval
+ *  'interval' is the time in ms between keyboard repeat events.
+ *
+ *  If 'delay' is set to 0, keyboard repeat is disabled.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
+extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
+
+/**
+ * Get a snapshot of the current state of the keyboard.
+ * Returns an array of keystates, indexed by the SDLK_* syms.
+ * Usage:
+ *	@code
+ * 	Uint8 *keystate = SDL_GetKeyState(NULL);
+ *	if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed.
+ *	@endcode
+ */
+extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
+
+/**
+ * Get the current key modifier state
+ */
+extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
+
+/**
+ * Set the current key modifier state.
+ * This does not change the keyboard state, only the key modifier flags.
+ */
+extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
+
+/**
+ * Get the name of an SDL virtual keysym
+ */
+extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_keyboard_h */
diff --git a/misc/winutils/include/SDL_keysym.h b/misc/winutils/include/SDL_keysym.h
new file mode 100644
index 0000000..f2ad12b
--- /dev/null
+++ b/misc/winutils/include/SDL_keysym.h
@@ -0,0 +1,326 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_keysym_h
+#define _SDL_keysym_h
+
+/** What we really want is a mapping of every raw key on the keyboard.
+ *  To support international keyboards, we use the range 0xA1 - 0xFF
+ *  as international virtual keycodes.  We'll follow in the footsteps of X11...
+ *  @brief The names of the keys
+ */
+typedef enum {
+        /** @name ASCII mapped keysyms
+         *  The keyboard syms have been cleverly chosen to map to ASCII
+         */
+        /*@{*/
+	SDLK_UNKNOWN		= 0,
+	SDLK_FIRST		= 0,
+	SDLK_BACKSPACE		= 8,
+	SDLK_TAB		= 9,
+	SDLK_CLEAR		= 12,
+	SDLK_RETURN		= 13,
+	SDLK_PAUSE		= 19,
+	SDLK_ESCAPE		= 27,
+	SDLK_SPACE		= 32,
+	SDLK_EXCLAIM		= 33,
+	SDLK_QUOTEDBL		= 34,
+	SDLK_HASH		= 35,
+	SDLK_DOLLAR		= 36,
+	SDLK_AMPERSAND		= 38,
+	SDLK_QUOTE		= 39,
+	SDLK_LEFTPAREN		= 40,
+	SDLK_RIGHTPAREN		= 41,
+	SDLK_ASTERISK		= 42,
+	SDLK_PLUS		= 43,
+	SDLK_COMMA		= 44,
+	SDLK_MINUS		= 45,
+	SDLK_PERIOD		= 46,
+	SDLK_SLASH		= 47,
+	SDLK_0			= 48,
+	SDLK_1			= 49,
+	SDLK_2			= 50,
+	SDLK_3			= 51,
+	SDLK_4			= 52,
+	SDLK_5			= 53,
+	SDLK_6			= 54,
+	SDLK_7			= 55,
+	SDLK_8			= 56,
+	SDLK_9			= 57,
+	SDLK_COLON		= 58,
+	SDLK_SEMICOLON		= 59,
+	SDLK_LESS		= 60,
+	SDLK_EQUALS		= 61,
+	SDLK_GREATER		= 62,
+	SDLK_QUESTION		= 63,
+	SDLK_AT			= 64,
+	/* 
+	   Skip uppercase letters
+	 */
+	SDLK_LEFTBRACKET	= 91,
+	SDLK_BACKSLASH		= 92,
+	SDLK_RIGHTBRACKET	= 93,
+	SDLK_CARET		= 94,
+	SDLK_UNDERSCORE		= 95,
+	SDLK_BACKQUOTE		= 96,
+	SDLK_a			= 97,
+	SDLK_b			= 98,
+	SDLK_c			= 99,
+	SDLK_d			= 100,
+	SDLK_e			= 101,
+	SDLK_f			= 102,
+	SDLK_g			= 103,
+	SDLK_h			= 104,
+	SDLK_i			= 105,
+	SDLK_j			= 106,
+	SDLK_k			= 107,
+	SDLK_l			= 108,
+	SDLK_m			= 109,
+	SDLK_n			= 110,
+	SDLK_o			= 111,
+	SDLK_p			= 112,
+	SDLK_q			= 113,
+	SDLK_r			= 114,
+	SDLK_s			= 115,
+	SDLK_t			= 116,
+	SDLK_u			= 117,
+	SDLK_v			= 118,
+	SDLK_w			= 119,
+	SDLK_x			= 120,
+	SDLK_y			= 121,
+	SDLK_z			= 122,
+	SDLK_DELETE		= 127,
+	/* End of ASCII mapped keysyms */
+        /*@}*/
+
+	/** @name International keyboard syms */
+        /*@{*/
+	SDLK_WORLD_0		= 160,		/* 0xA0 */
+	SDLK_WORLD_1		= 161,
+	SDLK_WORLD_2		= 162,
+	SDLK_WORLD_3		= 163,
+	SDLK_WORLD_4		= 164,
+	SDLK_WORLD_5		= 165,
+	SDLK_WORLD_6		= 166,
+	SDLK_WORLD_7		= 167,
+	SDLK_WORLD_8		= 168,
+	SDLK_WORLD_9		= 169,
+	SDLK_WORLD_10		= 170,
+	SDLK_WORLD_11		= 171,
+	SDLK_WORLD_12		= 172,
+	SDLK_WORLD_13		= 173,
+	SDLK_WORLD_14		= 174,
+	SDLK_WORLD_15		= 175,
+	SDLK_WORLD_16		= 176,
+	SDLK_WORLD_17		= 177,
+	SDLK_WORLD_18		= 178,
+	SDLK_WORLD_19		= 179,
+	SDLK_WORLD_20		= 180,
+	SDLK_WORLD_21		= 181,
+	SDLK_WORLD_22		= 182,
+	SDLK_WORLD_23		= 183,
+	SDLK_WORLD_24		= 184,
+	SDLK_WORLD_25		= 185,
+	SDLK_WORLD_26		= 186,
+	SDLK_WORLD_27		= 187,
+	SDLK_WORLD_28		= 188,
+	SDLK_WORLD_29		= 189,
+	SDLK_WORLD_30		= 190,
+	SDLK_WORLD_31		= 191,
+	SDLK_WORLD_32		= 192,
+	SDLK_WORLD_33		= 193,
+	SDLK_WORLD_34		= 194,
+	SDLK_WORLD_35		= 195,
+	SDLK_WORLD_36		= 196,
+	SDLK_WORLD_37		= 197,
+	SDLK_WORLD_38		= 198,
+	SDLK_WORLD_39		= 199,
+	SDLK_WORLD_40		= 200,
+	SDLK_WORLD_41		= 201,
+	SDLK_WORLD_42		= 202,
+	SDLK_WORLD_43		= 203,
+	SDLK_WORLD_44		= 204,
+	SDLK_WORLD_45		= 205,
+	SDLK_WORLD_46		= 206,
+	SDLK_WORLD_47		= 207,
+	SDLK_WORLD_48		= 208,
+	SDLK_WORLD_49		= 209,
+	SDLK_WORLD_50		= 210,
+	SDLK_WORLD_51		= 211,
+	SDLK_WORLD_52		= 212,
+	SDLK_WORLD_53		= 213,
+	SDLK_WORLD_54		= 214,
+	SDLK_WORLD_55		= 215,
+	SDLK_WORLD_56		= 216,
+	SDLK_WORLD_57		= 217,
+	SDLK_WORLD_58		= 218,
+	SDLK_WORLD_59		= 219,
+	SDLK_WORLD_60		= 220,
+	SDLK_WORLD_61		= 221,
+	SDLK_WORLD_62		= 222,
+	SDLK_WORLD_63		= 223,
+	SDLK_WORLD_64		= 224,
+	SDLK_WORLD_65		= 225,
+	SDLK_WORLD_66		= 226,
+	SDLK_WORLD_67		= 227,
+	SDLK_WORLD_68		= 228,
+	SDLK_WORLD_69		= 229,
+	SDLK_WORLD_70		= 230,
+	SDLK_WORLD_71		= 231,
+	SDLK_WORLD_72		= 232,
+	SDLK_WORLD_73		= 233,
+	SDLK_WORLD_74		= 234,
+	SDLK_WORLD_75		= 235,
+	SDLK_WORLD_76		= 236,
+	SDLK_WORLD_77		= 237,
+	SDLK_WORLD_78		= 238,
+	SDLK_WORLD_79		= 239,
+	SDLK_WORLD_80		= 240,
+	SDLK_WORLD_81		= 241,
+	SDLK_WORLD_82		= 242,
+	SDLK_WORLD_83		= 243,
+	SDLK_WORLD_84		= 244,
+	SDLK_WORLD_85		= 245,
+	SDLK_WORLD_86		= 246,
+	SDLK_WORLD_87		= 247,
+	SDLK_WORLD_88		= 248,
+	SDLK_WORLD_89		= 249,
+	SDLK_WORLD_90		= 250,
+	SDLK_WORLD_91		= 251,
+	SDLK_WORLD_92		= 252,
+	SDLK_WORLD_93		= 253,
+	SDLK_WORLD_94		= 254,
+	SDLK_WORLD_95		= 255,		/* 0xFF */
+        /*@}*/
+
+	/** @name Numeric keypad */
+        /*@{*/
+	SDLK_KP0		= 256,
+	SDLK_KP1		= 257,
+	SDLK_KP2		= 258,
+	SDLK_KP3		= 259,
+	SDLK_KP4		= 260,
+	SDLK_KP5		= 261,
+	SDLK_KP6		= 262,
+	SDLK_KP7		= 263,
+	SDLK_KP8		= 264,
+	SDLK_KP9		= 265,
+	SDLK_KP_PERIOD		= 266,
+	SDLK_KP_DIVIDE		= 267,
+	SDLK_KP_MULTIPLY	= 268,
+	SDLK_KP_MINUS		= 269,
+	SDLK_KP_PLUS		= 270,
+	SDLK_KP_ENTER		= 271,
+	SDLK_KP_EQUALS		= 272,
+        /*@}*/
+
+	/** @name Arrows + Home/End pad */
+        /*@{*/
+	SDLK_UP			= 273,
+	SDLK_DOWN		= 274,
+	SDLK_RIGHT		= 275,
+	SDLK_LEFT		= 276,
+	SDLK_INSERT		= 277,
+	SDLK_HOME		= 278,
+	SDLK_END		= 279,
+	SDLK_PAGEUP		= 280,
+	SDLK_PAGEDOWN		= 281,
+        /*@}*/
+
+	/** @name Function keys */
+        /*@{*/
+	SDLK_F1			= 282,
+	SDLK_F2			= 283,
+	SDLK_F3			= 284,
+	SDLK_F4			= 285,
+	SDLK_F5			= 286,
+	SDLK_F6			= 287,
+	SDLK_F7			= 288,
+	SDLK_F8			= 289,
+	SDLK_F9			= 290,
+	SDLK_F10		= 291,
+	SDLK_F11		= 292,
+	SDLK_F12		= 293,
+	SDLK_F13		= 294,
+	SDLK_F14		= 295,
+	SDLK_F15		= 296,
+        /*@}*/
+
+	/** @name Key state modifier keys */
+        /*@{*/
+	SDLK_NUMLOCK		= 300,
+	SDLK_CAPSLOCK		= 301,
+	SDLK_SCROLLOCK		= 302,
+	SDLK_RSHIFT		= 303,
+	SDLK_LSHIFT		= 304,
+	SDLK_RCTRL		= 305,
+	SDLK_LCTRL		= 306,
+	SDLK_RALT		= 307,
+	SDLK_LALT		= 308,
+	SDLK_RMETA		= 309,
+	SDLK_LMETA		= 310,
+	SDLK_LSUPER		= 311,		/**< Left "Windows" key */
+	SDLK_RSUPER		= 312,		/**< Right "Windows" key */
+	SDLK_MODE		= 313,		/**< "Alt Gr" key */
+	SDLK_COMPOSE		= 314,		/**< Multi-key compose key */
+        /*@}*/
+
+	/** @name Miscellaneous function keys */
+        /*@{*/
+	SDLK_HELP		= 315,
+	SDLK_PRINT		= 316,
+	SDLK_SYSREQ		= 317,
+	SDLK_BREAK		= 318,
+	SDLK_MENU		= 319,
+	SDLK_POWER		= 320,		/**< Power Macintosh power key */
+	SDLK_EURO		= 321,		/**< Some european keyboards */
+	SDLK_UNDO		= 322,		/**< Atari keyboard has Undo */
+        /*@}*/
+
+	/* Add any other keys here */
+
+	SDLK_LAST
+} SDLKey;
+
+/** Enumeration of valid key mods (possibly OR'd together) */
+typedef enum {
+	KMOD_NONE  = 0x0000,
+	KMOD_LSHIFT= 0x0001,
+	KMOD_RSHIFT= 0x0002,
+	KMOD_LCTRL = 0x0040,
+	KMOD_RCTRL = 0x0080,
+	KMOD_LALT  = 0x0100,
+	KMOD_RALT  = 0x0200,
+	KMOD_LMETA = 0x0400,
+	KMOD_RMETA = 0x0800,
+	KMOD_NUM   = 0x1000,
+	KMOD_CAPS  = 0x2000,
+	KMOD_MODE  = 0x4000,
+	KMOD_RESERVED = 0x8000
+} SDLMod;
+
+#define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT	(KMOD_LALT|KMOD_RALT)
+#define KMOD_META	(KMOD_LMETA|KMOD_RMETA)
+
+#endif /* _SDL_keysym_h */
diff --git a/misc/winutils/include/SDL_loadso.h b/misc/winutils/include/SDL_loadso.h
new file mode 100644
index 0000000..0c5e536
--- /dev/null
+++ b/misc/winutils/include/SDL_loadso.h
@@ -0,0 +1,78 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_loadso.h
+ *  System dependent library loading routines
+ */
+
+/** @file SDL_loadso.h
+ *  Some things to keep in mind:                                        
+ *  - These functions only work on C function names.  Other languages may
+ *    have name mangling and intrinsic language support that varies from
+ *    compiler to compiler.
+ *  - Make sure you declare your function pointers with the same calling
+ *    convention as the actual library function.  Your code will crash
+ *    mysteriously if you do not do this.
+ *  - Avoid namespace collisions.  If you load a symbol from the library,
+ *    it is not defined whether or not it goes into the global symbol
+ *    namespace for the application.  If it does and it conflicts with
+ *    symbols in your code or other shared libraries, you will not get
+ *    the results you expect. :)
+ */
+
+
+#ifndef _SDL_loadso_h
+#define _SDL_loadso_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * This function dynamically loads a shared object and returns a pointer
+ * to the object handle (or NULL if there was an error).
+ * The 'sofile' parameter is a system dependent name of the object file.
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
+
+/**
+ * Given an object handle, this function looks up the address of the
+ * named function in the shared object and returns it.  This address
+ * is no longer valid after calling SDL_UnloadObject().
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
+
+/** Unload a shared object from memory */
+extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_loadso_h */
diff --git a/misc/winutils/include/SDL_main.h b/misc/winutils/include/SDL_main.h
new file mode 100644
index 0000000..ab50ef1
--- /dev/null
+++ b/misc/winutils/include/SDL_main.h
@@ -0,0 +1,106 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_main_h
+#define _SDL_main_h
+
+#include "SDL_stdinc.h"
+
+/** @file SDL_main.h
+ *  Redefine main() on Win32 and MacOS so that it is called by winmain.c
+ */
+
+#if defined(__WIN32__) || \
+    (defined(__MWERKS__) && !defined(__BEOS__)) || \
+    defined(__MACOS__) || defined(__MACOSX__) || \
+    defined(__SYMBIAN32__) || defined(QWS)
+
+#ifdef __cplusplus
+#define C_LINKAGE	"C"
+#else
+#define C_LINKAGE
+#endif /* __cplusplus */
+
+/** The application's main() function must be called with C linkage,
+ *  and should be declared like this:
+ *      @code
+ *      #ifdef __cplusplus
+ *      extern "C"
+ *      #endif
+ *	int main(int argc, char *argv[])
+ *	{
+ *	}
+ *      @endcode
+ */
+#define main	SDL_main
+
+/** The prototype for the application's main() function */
+extern C_LINKAGE int SDL_main(int argc, char *argv[]);
+
+
+/** @name From the SDL library code -- needed for registering the app on Win32 */
+/*@{*/
+#ifdef __WIN32__
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This should be called from your WinMain() function, if any */
+extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
+/** This can also be called, but is no longer necessary */
+extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
+/** This can also be called, but is no longer necessary (SDL_Quit calls it) */
+extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
+/*@{*/
+#if defined(__MACOS__)
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Forward declaration so we don't need to include QuickDraw.h */
+struct QDGlobals;
+
+/** This should be called from your main() function, if any */
+extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
+
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+#endif /* Need to redefine main()? */
+
+#endif /* _SDL_main_h */
diff --git a/misc/winutils/include/SDL_mixer.h b/misc/winutils/include/SDL_mixer.h
new file mode 100644
index 0000000..9c25ef6
--- /dev/null
+++ b/misc/winutils/include/SDL_mixer.h
@@ -0,0 +1,634 @@
+/*
+  SDL_mixer:  An audio mixer library based on the SDL library
+  Copyright (C) 1997-2012 Sam Lantinga <slouken at libsdl.org>
+
+  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.
+*/
+
+/* $Id$ */
+
+#ifndef _SDL_MIXER_H
+#define _SDL_MIXER_H
+
+#include "SDL_types.h"
+#include "SDL_rwops.h"
+#include "SDL_audio.h"
+#include "SDL_endian.h"
+#include "SDL_version.h"
+#include "begin_code.h"
+
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+*/
+#define SDL_MIXER_MAJOR_VERSION	1
+#define SDL_MIXER_MINOR_VERSION	2
+#define SDL_MIXER_PATCHLEVEL    12
+
+/* This macro can be used to fill a version structure with the compile-time
+ * version of the SDL_mixer library.
+ */
+#define SDL_MIXER_VERSION(X)						\
+{									\
+	(X)->major = SDL_MIXER_MAJOR_VERSION;				\
+	(X)->minor = SDL_MIXER_MINOR_VERSION;				\
+	(X)->patch = SDL_MIXER_PATCHLEVEL;				\
+}
+
+/* Backwards compatibility */
+#define MIX_MAJOR_VERSION	SDL_MIXER_MAJOR_VERSION
+#define MIX_MINOR_VERSION	SDL_MIXER_MINOR_VERSION
+#define MIX_PATCHLEVEL		SDL_MIXER_PATCHLEVEL
+#define MIX_VERSION(X)		SDL_MIXER_VERSION(X)
+
+/* This function gets the version of the dynamically linked SDL_mixer library.
+   it should NOT be used to fill a version structure, instead you should
+   use the SDL_MIXER_VERSION() macro.
+ */
+extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void);
+
+typedef enum
+{
+    MIX_INIT_FLAC        = 0x00000001,
+    MIX_INIT_MOD         = 0x00000002,
+    MIX_INIT_MP3         = 0x00000004,
+    MIX_INIT_OGG         = 0x00000008,
+    MIX_INIT_FLUIDSYNTH  = 0x00000010
+} MIX_InitFlags;
+
+/* Loads dynamic libraries and prepares them for use.  Flags should be
+   one or more flags from MIX_InitFlags OR'd together.
+   It returns the flags successfully initialized, or 0 on failure.
+ */
+extern DECLSPEC int SDLCALL Mix_Init(int flags);
+
+/* Unloads libraries loaded with Mix_Init */
+extern DECLSPEC void SDLCALL Mix_Quit(void);
+
+
+/* The default mixer has 8 simultaneous mixing channels */
+#ifndef MIX_CHANNELS
+#define MIX_CHANNELS	8
+#endif
+
+/* Good default values for a PC soundcard */
+#define MIX_DEFAULT_FREQUENCY	22050
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define MIX_DEFAULT_FORMAT	AUDIO_S16LSB
+#else
+#define MIX_DEFAULT_FORMAT	AUDIO_S16MSB
+#endif
+#define MIX_DEFAULT_CHANNELS	2
+#define MIX_MAX_VOLUME		128	/* Volume of a chunk */
+
+/* The internal format for an audio chunk */
+typedef struct Mix_Chunk {
+	int allocated;
+	Uint8 *abuf;
+	Uint32 alen;
+	Uint8 volume;		/* Per-sample volume, 0-128 */
+} Mix_Chunk;
+
+/* The different fading types supported */
+typedef enum {
+	MIX_NO_FADING,
+	MIX_FADING_OUT,
+	MIX_FADING_IN
+} Mix_Fading;
+
+typedef enum {
+	MUS_NONE,
+	MUS_CMD,
+	MUS_WAV,
+	MUS_MOD,
+	MUS_MID,
+	MUS_OGG,
+	MUS_MP3,
+	MUS_MP3_MAD,
+	MUS_FLAC,
+	MUS_MODPLUG
+} Mix_MusicType;
+
+/* The internal format for a music chunk interpreted via mikmod */
+typedef struct _Mix_Music Mix_Music;
+
+/* Open the mixer with a certain audio format */
+extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels,
+							int chunksize);
+
+/* Dynamically change the number of channels managed by the mixer.
+   If decreasing the number of channels, the upper channels are
+   stopped.
+   This function returns the new number of allocated channels.
+ */
+extern DECLSPEC int SDLCALL Mix_AllocateChannels(int numchans);
+
+/* Find out what the actual audio device parameters are.
+   This function returns 1 if the audio has been opened, 0 otherwise.
+ */
+extern DECLSPEC int SDLCALL Mix_QuerySpec(int *frequency,Uint16 *format,int *channels);
+
+/* Load a wave file or a music (.mod .s3m .it .xm) file */
+extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
+#define Mix_LoadWAV(file)	Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
+extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
+
+/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
+   Matt Campbell (matt at campbellhome.dhs.org) April 2000 */
+extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *rw);
+
+/* Load a music file from an SDL_RWop object assuming a specific format */
+extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUSType_RW(SDL_RWops *rw, Mix_MusicType type, int freesrc);
+
+/* Load a wave file of the mixer format from a memory buffer */
+extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem);
+
+/* Load raw audio data of the mixer format from a memory buffer */
+extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len);
+
+/* Free an audio chunk previously loaded */
+extern DECLSPEC void SDLCALL Mix_FreeChunk(Mix_Chunk *chunk);
+extern DECLSPEC void SDLCALL Mix_FreeMusic(Mix_Music *music);
+
+/* Get a list of chunk/music decoders that this build of SDL_mixer provides.
+   This list can change between builds AND runs of the program, if external
+   libraries that add functionality become available.
+   You must successfully call Mix_OpenAudio() before calling these functions.
+   This API is only available in SDL_mixer 1.2.9 and later.
+
+   // usage...
+   int i;
+   const int total = Mix_GetNumChunkDecoders();
+   for (i = 0; i < total; i++)
+       printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));
+
+   Appearing in this list doesn't promise your specific audio file will
+   decode...but it's handy to know if you have, say, a functioning Timidity
+   install.
+
+   These return values are static, read-only data; do not modify or free it.
+   The pointers remain valid until you call Mix_CloseAudio().
+*/
+extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void);
+extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index);
+extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void);
+extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index);
+
+/* Find out the music format of a mixer music, or the currently playing
+   music, if 'music' is NULL.
+*/
+extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music);
+
+/* Set a function that is called after all mixing is performed.
+   This can be used to provide real-time visual display of the audio stream
+   or add a custom mixer filter for the stream data.
+*/
+extern DECLSPEC void SDLCALL Mix_SetPostMix(void (*mix_func)
+                             (void *udata, Uint8 *stream, int len), void *arg);
+
+/* Add your own music player or additional mixer function.
+   If 'mix_func' is NULL, the default music player is re-enabled.
+ */
+extern DECLSPEC void SDLCALL Mix_HookMusic(void (*mix_func)
+                          (void *udata, Uint8 *stream, int len), void *arg);
+
+/* Add your own callback when the music has finished playing.
+   This callback is only called if the music finishes naturally.
+ */
+extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (*music_finished)(void));
+
+/* Get a pointer to the user data for the current music hook */
+extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
+
+/*
+ * Add your own callback when a channel has finished playing. NULL
+ *  to disable callback. The callback may be called from the mixer's audio 
+ *  callback or it could be called as a result of Mix_HaltChannel(), etc.
+ *  do not call SDL_LockAudio() from this callback; you will either be 
+ *  inside the audio callback, or SDL_mixer will explicitly lock the audio
+ *  before calling your callback.
+ */
+extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (*channel_finished)(int channel));
+
+
+/* Special Effects API by ryan c. gordon. (icculus at icculus.org) */
+
+#define MIX_CHANNEL_POST  -2
+
+/* This is the format of a special effect callback:
+ *
+ *   myeffect(int chan, void *stream, int len, void *udata);
+ *
+ * (chan) is the channel number that your effect is affecting. (stream) is
+ *  the buffer of data to work upon. (len) is the size of (stream), and
+ *  (udata) is a user-defined bit of data, which you pass as the last arg of
+ *  Mix_RegisterEffect(), and is passed back unmolested to your callback.
+ *  Your effect changes the contents of (stream) based on whatever parameters
+ *  are significant, or just leaves it be, if you prefer. You can do whatever
+ *  you like to the buffer, though, and it will continue in its changed state
+ *  down the mixing pipeline, through any other effect functions, then finally
+ *  to be mixed with the rest of the channels and music for the final output
+ *  stream.
+ *
+ * DO NOT EVER call SDL_LockAudio() from your callback function!
+ */
+typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
+
+/*
+ * This is a callback that signifies that a channel has finished all its
+ *  loops and has completed playback. This gets called if the buffer
+ *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
+ *  a channel via Mix_AllocateChannels(), or unregister a callback while
+ *  it's still playing.
+ *
+ * DO NOT EVER call SDL_LockAudio() from your callback function!
+ */
+typedef void (*Mix_EffectDone_t)(int chan, void *udata);
+
+
+/* Register a special effect function. At mixing time, the channel data is
+ *  copied into a buffer and passed through each registered effect function.
+ *  After it passes through all the functions, it is mixed into the final
+ *  output stream. The copy to buffer is performed once, then each effect
+ *  function performs on the output of the previous effect. Understand that
+ *  this extra copy to a buffer is not performed if there are no effects
+ *  registered for a given chunk, which saves CPU cycles, and any given
+ *  effect will be extra cycles, too, so it is crucial that your code run
+ *  fast. Also note that the data that your function is given is in the
+ *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
+ *  although they may in reality be the same. This is an unfortunate but
+ *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
+ *  handle the data before you register your effect, and take appropriate
+ *  actions.
+ * You may also specify a callback (Mix_EffectDone_t) that is called when
+ *  the channel finishes playing. This gives you a more fine-grained control
+ *  than Mix_ChannelFinished(), in case you need to free effect-specific
+ *  resources, etc. If you don't need this, you can specify NULL.
+ * You may set the callbacks before or after calling Mix_PlayChannel().
+ * Things like Mix_SetPanning() are just internal special effect functions,
+ *  so if you are using that, you've already incurred the overhead of a copy
+ *  to a separate buffer, and that these effects will be in the queue with
+ *  any functions you've registered. The list of registered effects for a
+ *  channel is reset when a chunk finishes playing, so you need to explicitly
+ *  set them with each call to Mix_PlayChannel*().
+ * You may also register a special effect function that is to be run after
+ *  final mixing occurs. The rules for these callbacks are identical to those
+ *  in Mix_RegisterEffect, but they are run after all the channels and the
+ *  music have been mixed into a single stream, whereas channel-specific
+ *  effects run on a given channel before any other mixing occurs. These
+ *  global effect callbacks are call "posteffects". Posteffects only have
+ *  their Mix_EffectDone_t function called when they are unregistered (since
+ *  the main output stream is never "done" in the same sense as a channel).
+ *  You must unregister them manually when you've had enough. Your callback
+ *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
+ *  processing is considered a posteffect.
+ *
+ * After all these effects have finished processing, the callback registered
+ *  through Mix_SetPostMix() runs, and then the stream goes to the audio
+ *  device. 
+ *
+ * DO NOT EVER call SDL_LockAudio() from your callback function!
+ *
+ * returns zero if error (no such channel), nonzero if added.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f,
+					Mix_EffectDone_t d, void *arg);
+
+
+/* You may not need to call this explicitly, unless you need to stop an
+ *  effect from processing in the middle of a chunk's playback.
+ * Posteffects are never implicitly unregistered as they are for channels,
+ *  but they may be explicitly unregistered through this function by
+ *  specifying MIX_CHANNEL_POST for a channel.
+ * returns zero if error (no such channel or effect), nonzero if removed.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f);
+
+
+/* You may not need to call this explicitly, unless you need to stop all
+ *  effects from processing in the middle of a chunk's playback. Note that
+ *  this will also shut off some internal effect processing, since
+ *  Mix_SetPanning() and others may use this API under the hood. This is
+ *  called internally when a channel completes playback.
+ * Posteffects are never implicitly unregistered as they are for channels,
+ *  but they may be explicitly unregistered through this function by
+ *  specifying MIX_CHANNEL_POST for a channel.
+ * returns zero if error (no such channel), nonzero if all effects removed.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_UnregisterAllEffects(int channel);
+
+
+#define MIX_EFFECTSMAXSPEED  "MIX_EFFECTSMAXSPEED"
+
+/*
+ * These are the internally-defined mixing effects. They use the same API that
+ *  effects defined in the application use, but are provided here as a
+ *  convenience. Some effects can reduce their quality or use more memory in
+ *  the name of speed; to enable this, make sure the environment variable
+ *  MIX_EFFECTSMAXSPEED (see above) is defined before you call
+ *  Mix_OpenAudio().
+ */
+
+
+/* Set the panning of a channel. The left and right channels are specified
+ *  as integers between 0 and 255, quietest to loudest, respectively.
+ *
+ * Technically, this is just individual volume control for a sample with
+ *  two (stereo) channels, so it can be used for more than just panning.
+ *  If you want real panning, call it like this:
+ *
+ *   Mix_SetPanning(channel, left, 255 - left);
+ *
+ * ...which isn't so hard.
+ *
+ * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
+ *  the panning will be done to the final mixed stream before passing it on
+ *  to the audio device.
+ *
+ * This uses the Mix_RegisterEffect() API internally, and returns without
+ *  registering the effect function if the audio device is not configured
+ *  for stereo output. Setting both (left) and (right) to 255 causes this
+ *  effect to be unregistered, since that is the data's normal state.
+ *
+ * returns zero if error (no such channel or Mix_RegisterEffect() fails),
+ *  nonzero if panning effect enabled. Note that an audio device in mono
+ *  mode is a no-op, but this call will return successful in that case.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right);
+
+
+/* Set the position of a channel. (angle) is an integer from 0 to 360, that
+ *  specifies the location of the sound in relation to the listener. (angle)
+ *  will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
+ *  Angle 0 is due north, and rotates clockwise as the value increases.
+ *  For efficiency, the precision of this effect may be limited (angles 1
+ *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
+ *  (distance) is an integer between 0 and 255 that specifies the space
+ *  between the sound and the listener. The larger the number, the further
+ *  away the sound is. Using 255 does not guarantee that the channel will be
+ *  culled from the mixing process or be completely silent. For efficiency,
+ *  the precision of this effect may be limited (distance 0 through 5 might
+ *  all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
+ *  and (distance) to 0 unregisters this effect, since the data would be
+ *  unchanged.
+ *
+ * If you need more precise positional audio, consider using OpenAL for
+ *  spatialized effects instead of SDL_mixer. This is only meant to be a
+ *  basic effect for simple "3D" games.
+ *
+ * If the audio device is configured for mono output, then you won't get
+ *  any effectiveness from the angle; however, distance attenuation on the
+ *  channel will still occur. While this effect will function with stereo
+ *  voices, it makes more sense to use voices with only one channel of sound,
+ *  so when they are mixed through this effect, the positioning will sound
+ *  correct. You can convert them to mono through SDL before giving them to
+ *  the mixer in the first place if you like.
+ *
+ * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
+ *  the positioning will be done to the final mixed stream before passing it
+ *  on to the audio device.
+ *
+ * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
+ *
+ * returns zero if error (no such channel or Mix_RegisterEffect() fails),
+ *  nonzero if position effect is enabled.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);
+
+
+/* Set the "distance" of a channel. (distance) is an integer from 0 to 255
+ *  that specifies the location of the sound in relation to the listener.
+ *  Distance 0 is overlapping the listener, and 255 is as far away as possible
+ *  A distance of 255 does not guarantee silence; in such a case, you might
+ *  want to try changing the chunk's volume, or just cull the sample from the
+ *  mixing process with Mix_HaltChannel().
+ * For efficiency, the precision of this effect may be limited (distances 1
+ *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
+ *  (distance) is an integer between 0 and 255 that specifies the space
+ *  between the sound and the listener. The larger the number, the further
+ *  away the sound is.
+ * Setting (distance) to 0 unregisters this effect, since the data would be
+ *  unchanged.
+ * If you need more precise positional audio, consider using OpenAL for
+ *  spatialized effects instead of SDL_mixer. This is only meant to be a
+ *  basic effect for simple "3D" games.
+ *
+ * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
+ *  the distance attenuation will be done to the final mixed stream before
+ *  passing it on to the audio device.
+ *
+ * This uses the Mix_RegisterEffect() API internally.
+ *
+ * returns zero if error (no such channel or Mix_RegisterEffect() fails),
+ *  nonzero if position effect is enabled.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_SetDistance(int channel, Uint8 distance);
+
+
+/*
+ * !!! FIXME : Haven't implemented, since the effect goes past the
+ *              end of the sound buffer. Will have to think about this.
+ *               --ryan.
+ */
+#if 0
+/* Causes an echo effect to be mixed into a sound. (echo) is the amount
+ *  of echo to mix. 0 is no echo, 255 is infinite (and probably not
+ *  what you want).
+ *
+ * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
+ *  the reverbing will be done to the final mixed stream before passing it on
+ *  to the audio device.
+ *
+ * This uses the Mix_RegisterEffect() API internally. If you specify an echo
+ *  of zero, the effect is unregistered, as the data is already in that state.
+ *
+ * returns zero if error (no such channel or Mix_RegisterEffect() fails),
+ *  nonzero if reversing effect is enabled.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern no_parse_DECLSPEC int SDLCALL Mix_SetReverb(int channel, Uint8 echo);
+#endif
+
+/* Causes a channel to reverse its stereo. This is handy if the user has his
+ *  speakers hooked up backwards, or you would like to have a minor bit of
+ *  psychedelia in your sound code.  :)  Calling this function with (flip)
+ *  set to non-zero reverses the chunks's usual channels. If (flip) is zero,
+ *  the effect is unregistered.
+ *
+ * This uses the Mix_RegisterEffect() API internally, and thus is probably
+ *  more CPU intensive than having the user just plug in his speakers
+ *  correctly. Mix_SetReverseStereo() returns without registering the effect
+ *  function if the audio device is not configured for stereo output.
+ *
+ * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
+ *  on the final mixed stream before sending it on to the audio device (a
+ *  posteffect).
+ *
+ * returns zero if error (no such channel or Mix_RegisterEffect() fails),
+ *  nonzero if reversing effect is enabled. Note that an audio device in mono
+ *  mode is a no-op, but this call will return successful in that case.
+ *  Error messages can be retrieved from Mix_GetError().
+ */
+extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip);
+
+/* end of effects API. --ryan. */
+
+
+/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
+   them dynamically to the next sample if requested with a -1 value below.
+   Returns the number of reserved channels.
+ */
+extern DECLSPEC int SDLCALL Mix_ReserveChannels(int num);
+
+/* Channel grouping functions */
+
+/* Attach a tag to a channel. A tag can be assigned to several mixer
+   channels, to form groups of channels.
+   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
+   represent the group of all the channels).
+   Returns true if everything was OK.
+ */
+extern DECLSPEC int SDLCALL Mix_GroupChannel(int which, int tag);
+/* Assign several consecutive channels to a group */
+extern DECLSPEC int SDLCALL Mix_GroupChannels(int from, int to, int tag);
+/* Finds the first available channel in a group of channels,
+   returning -1 if none are available.
+ */
+extern DECLSPEC int SDLCALL Mix_GroupAvailable(int tag);
+/* Returns the number of channels in a group. This is also a subtle
+   way to get the total number of channels when 'tag' is -1
+ */
+extern DECLSPEC int SDLCALL Mix_GroupCount(int tag);
+/* Finds the "oldest" sample playing in a group of channels */
+extern DECLSPEC int SDLCALL Mix_GroupOldest(int tag);
+/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
+extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag);
+
+/* Play an audio chunk on a specific channel.
+   If the specified channel is -1, play on the first free channel.
+   If 'loops' is greater than zero, loop the sound that many times.
+   If 'loops' is -1, loop inifinitely (~65000 times).
+   Returns which channel was used to play the sound.
+*/
+#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1)
+/* The same as above, but the sound is played at most 'ticks' milliseconds */
+extern DECLSPEC int SDLCALL Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks);
+extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops);
+
+/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
+extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms);
+extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position);
+#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1)
+extern DECLSPEC int SDLCALL Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks);
+
+/* Set the volume in the range of 0-128 of a specific channel or chunk.
+   If the specified channel is -1, set volume for all channels.
+   Returns the original volume.
+   If the specified volume is -1, just return the current volume.
+*/
+extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);
+extern DECLSPEC int SDLCALL Mix_VolumeChunk(Mix_Chunk *chunk, int volume);
+extern DECLSPEC int SDLCALL Mix_VolumeMusic(int volume);
+
+/* Halt playing of a particular channel */
+extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel);
+extern DECLSPEC int SDLCALL Mix_HaltGroup(int tag);
+extern DECLSPEC int SDLCALL Mix_HaltMusic(void);
+
+/* Change the expiration delay for a particular channel.
+   The sample will stop playing after the 'ticks' milliseconds have elapsed,
+   or remove the expiration if 'ticks' is -1
+*/
+extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks);
+
+/* Halt a channel, fading it out progressively till it's silent
+   The ms parameter indicates the number of milliseconds the fading
+   will take.
+ */
+extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms);
+extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms);
+extern DECLSPEC int SDLCALL Mix_FadeOutMusic(int ms);
+
+/* Query the fading status of a channel */
+extern DECLSPEC Mix_Fading SDLCALL Mix_FadingMusic(void);
+extern DECLSPEC Mix_Fading SDLCALL Mix_FadingChannel(int which);
+
+/* Pause/Resume a particular channel */
+extern DECLSPEC void SDLCALL Mix_Pause(int channel);
+extern DECLSPEC void SDLCALL Mix_Resume(int channel);
+extern DECLSPEC int SDLCALL Mix_Paused(int channel);
+
+/* Pause/Resume the music stream */
+extern DECLSPEC void SDLCALL Mix_PauseMusic(void);
+extern DECLSPEC void SDLCALL Mix_ResumeMusic(void);
+extern DECLSPEC void SDLCALL Mix_RewindMusic(void);
+extern DECLSPEC int SDLCALL Mix_PausedMusic(void);
+
+/* Set the current position in the music stream.
+   This returns 0 if successful, or -1 if it failed or isn't implemented.
+   This function is only implemented for MOD music formats (set pattern
+   order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set 
+   position in seconds), at the moment.
+*/
+extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position);
+
+/* Check the status of a specific channel.
+   If the specified channel is -1, check all channels.
+*/
+extern DECLSPEC int SDLCALL Mix_Playing(int channel);
+extern DECLSPEC int SDLCALL Mix_PlayingMusic(void);
+
+/* Stop music and set external music playback command */
+extern DECLSPEC int SDLCALL Mix_SetMusicCMD(const char *command);
+
+/* Synchro value is set by MikMod from modules while playing */
+extern DECLSPEC int SDLCALL Mix_SetSynchroValue(int value);
+extern DECLSPEC int SDLCALL Mix_GetSynchroValue(void);
+
+/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */
+extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);
+extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
+extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (*function)(const char*, void*), void *data);
+
+/* Get the Mix_Chunk currently associated with a mixer channel
+    Returns NULL if it's an invalid channel, or there's no chunk associated.
+*/
+extern DECLSPEC Mix_Chunk * SDLCALL Mix_GetChunk(int channel);
+
+/* Close the mixer, halting all playing audio */
+extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
+
+/* We'll use SDL for reporting errors */
+#define Mix_SetError	SDL_SetError
+#define Mix_GetError	SDL_GetError
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_MIXER_H */
diff --git a/misc/winutils/include/SDL_mouse.h b/misc/winutils/include/SDL_mouse.h
new file mode 100644
index 0000000..7c563b9
--- /dev/null
+++ b/misc/winutils/include/SDL_mouse.h
@@ -0,0 +1,143 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_mouse.h
+ *  Include file for SDL mouse event handling
+ */
+
+#ifndef _SDL_mouse_h
+#define _SDL_mouse_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct WMcursor WMcursor;	/**< Implementation dependent */
+typedef struct SDL_Cursor {
+	SDL_Rect area;			/**< The area of the mouse cursor */
+	Sint16 hot_x, hot_y;		/**< The "tip" of the cursor */
+	Uint8 *data;			/**< B/W cursor data */
+	Uint8 *mask;			/**< B/W cursor mask */
+	Uint8 *save[2];			/**< Place to save cursor area */
+	WMcursor *wm_cursor;		/**< Window-manager cursor */
+} SDL_Cursor;
+
+/* Function prototypes */
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * current mouse cursor position.  You can pass NULL for either x or y.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
+
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * mouse deltas since the last call to SDL_GetRelativeMouseState().
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
+
+/**
+ * Set the position of the mouse cursor (generates a mouse motion event)
+ */
+extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
+
+/**
+ * Create a cursor using the specified data and mask (in MSB format).
+ * The cursor width must be a multiple of 8 bits.
+ *
+ * The cursor is created in black and white according to the following:
+ * data  mask    resulting pixel on screen
+ *  0     1       White
+ *  1     1       Black
+ *  0     0       Transparent
+ *  1     0       Inverted color if possible, black if not.
+ *
+ * Cursors created with this function must be freed with SDL_FreeCursor().
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
+		(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+
+/**
+ * Set the currently active cursor to the specified one.
+ * If the cursor is currently visible, the change will be immediately 
+ * represented on the display.
+ */
+extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
+
+/**
+ * Returns the currently active cursor.
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
+
+/**
+ * Deallocates a cursor created with SDL_CreateCursor().
+ */
+extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
+
+/**
+ * Toggle whether or not the cursor is shown on the screen.
+ * The cursor start off displayed, but can be turned off.
+ * SDL_ShowCursor() returns 1 if the cursor was being displayed
+ * before the call, or 0 if it was not.  You can query the current
+ * state by passing a 'toggle' value of -1.
+ */
+extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
+
+/*@{*/
+/** Used as a mask when testing buttons in buttonstate
+ *  Button 1:	Left mouse button
+ *  Button 2:	Middle mouse button
+ *  Button 3:	Right mouse button
+ *  Button 4:	Mouse wheel up	 (may also be a real button)
+ *  Button 5:	Mouse wheel down (may also be a real button)
+ */
+#define SDL_BUTTON(X)		(1 << ((X)-1))
+#define SDL_BUTTON_LEFT		1
+#define SDL_BUTTON_MIDDLE	2
+#define SDL_BUTTON_RIGHT	3
+#define SDL_BUTTON_WHEELUP	4
+#define SDL_BUTTON_WHEELDOWN	5
+#define SDL_BUTTON_X1		6
+#define SDL_BUTTON_X2		7
+#define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
+#define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
+#define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
+#define SDL_BUTTON_X1MASK	SDL_BUTTON(SDL_BUTTON_X1)
+#define SDL_BUTTON_X2MASK	SDL_BUTTON(SDL_BUTTON_X2)
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mouse_h */
diff --git a/misc/winutils/include/SDL_mutex.h b/misc/winutils/include/SDL_mutex.h
new file mode 100644
index 0000000..c8da9b1
--- /dev/null
+++ b/misc/winutils/include/SDL_mutex.h
@@ -0,0 +1,177 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_mutex_h
+#define _SDL_mutex_h
+
+/** @file SDL_mutex.h
+ *  Functions to provide thread synchronization primitives
+ *
+ *  @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Synchronization functions which can time out return this value
+ *  if they time out.
+ */
+#define SDL_MUTEX_TIMEDOUT	1
+
+/** This is the timeout value which corresponds to never time out */
+#define SDL_MUTEX_MAXWAIT	(~(Uint32)0)
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Mutex functions                                        */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL mutex structure, defined in SDL_mutex.c */
+struct SDL_mutex;
+typedef struct SDL_mutex SDL_mutex;
+
+/** Create a mutex, initialized unlocked */
+extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
+
+#define SDL_LockMutex(m)	SDL_mutexP(m)
+/** Lock the mutex
+ *  @return 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
+
+#define SDL_UnlockMutex(m)	SDL_mutexV(m)
+/** Unlock the mutex
+ *  @return 0, or -1 on error
+ *
+ *  It is an error to unlock a mutex that has not been locked by
+ *  the current thread, and doing so results in undefined behavior.
+ */
+extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
+
+/** Destroy a mutex */
+extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Semaphore functions                                    */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL semaphore structure, defined in SDL_sem.c */
+struct SDL_semaphore;
+typedef struct SDL_semaphore SDL_sem;
+
+/** Create a semaphore, initialized with value, returns NULL on failure. */
+extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
+
+/** Destroy a semaphore */
+extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
+
+/**
+ * This function suspends the calling thread until the semaphore pointed 
+ * to by sem has a positive count. It then atomically decreases the semaphore
+ * count.
+ */
+extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
+
+/** Non-blocking variant of SDL_SemWait().
+ *  @return 0 if the wait succeeds,
+ *  SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
+
+/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
+ *  the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
+ *  the allotted time, and -1 on error.
+ *
+ *  On some platforms this function is implemented by looping with a delay
+ *  of 1 ms, and so should be avoided if possible.
+ */
+extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
+
+/** Atomically increases the semaphore's count (not blocking).
+ *  @return 0, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
+
+/** Returns the current count of the semaphore */
+extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Condition_variable_functions                           */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*@{*/
+/** The SDL condition variable structure, defined in SDL_cond.c */
+struct SDL_cond;
+typedef struct SDL_cond SDL_cond;
+/*@}*/
+
+/** Create a condition variable */
+extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
+
+/** Destroy a condition variable */
+extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
+
+/** Restart one of the threads that are waiting on the condition variable,
+ *  @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
+
+/** Restart all threads that are waiting on the condition variable,
+ *  @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
+
+/** Wait on the condition variable, unlocking the provided mutex.
+ *  The mutex must be locked before entering this function!
+ *  The mutex is re-locked once the condition variable is signaled.
+ *  @return 0 when it is signaled, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
+
+/** Waits for at most 'ms' milliseconds, and returns 0 if the condition
+ *  variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
+ *  signaled in the allotted time, and -1 on error.
+ *  On some platforms this function is implemented by looping with a delay
+ *  of 1 ms, and so should be avoided if possible.
+ */
+extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mutex_h */
+
diff --git a/misc/winutils/include/SDL_name.h b/misc/winutils/include/SDL_name.h
new file mode 100644
index 0000000..511619a
--- /dev/null
+++ b/misc/winutils/include/SDL_name.h
@@ -0,0 +1,11 @@
+
+#ifndef _SDLname_h_
+#define _SDLname_h_
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define NeedFunctionPrototypes 1
+#endif
+
+#define SDL_NAME(X)	SDL_##X
+
+#endif /* _SDLname_h_ */
diff --git a/misc/winutils/include/SDL_opengl.h b/misc/winutils/include/SDL_opengl.h
new file mode 100644
index 0000000..3d791d6
--- /dev/null
+++ b/misc/winutils/include/SDL_opengl.h
@@ -0,0 +1,6570 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_opengl.h
+ *  This is a simple file to encapsulate the OpenGL API headers
+ */
+
+#include "SDL_config.h"
+
+#ifdef __WIN32__
+#define WIN32_LEAN_AND_MEAN
+#ifndef NOMINMAX
+#define NOMINMAX	/* Don't defined min() and max() */
+#endif
+#include <windows.h>
+#endif
+#ifndef NO_SDL_GLEXT
+#define __glext_h_  /* Don't let gl.h include glext.h */
+#endif
+#if defined(__MACOSX__)
+#include <OpenGL/gl.h>	/* Header File For The OpenGL Library */
+#include <OpenGL/glu.h>	/* Header File For The GLU Library */
+#elif defined(__MACOS__)
+#include <gl.h>		/* Header File For The OpenGL Library */
+#include <glu.h>	/* Header File For The GLU Library */
+#else
+#include <GL/gl.h>	/* Header File For The OpenGL Library */
+#include <GL/glu.h>	/* Header File For The GLU Library */
+#endif
+#ifndef NO_SDL_GLEXT
+#undef __glext_h_
+#endif
+
+/** @name GLext.h
+ *  This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
+ *  It is included here because glext.h is not available on some systems.
+ *  If you don't want this version included, simply define "NO_SDL_GLEXT"
+ */
+/*@{*/
+#ifndef NO_SDL_GLEXT
+#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2005/06/20 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GL_GLEXT_VERSION 29
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2            0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_INT_8_8_8_8           0x8035
+#define GL_UNSIGNED_INT_10_10_10_2        0x8036
+#define GL_RESCALE_NORMAL                 0x803A
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_PACK_SKIP_IMAGES               0x806B
+#define GL_PACK_IMAGE_HEIGHT              0x806C
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_PROXY_TEXTURE_3D               0x8070
+#define GL_TEXTURE_DEPTH                  0x8071
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV        0x8362
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV       0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV     0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV     0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV       0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_BGR                            0x80E0
+#define GL_BGRA                           0x80E1
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL      0x81F8
+#define GL_SINGLE_COLOR                   0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR        0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY  0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_FUNC_ADD                       0x8006
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_CONVOLUTION_1D                 0x8010
+#define GL_CONVOLUTION_2D                 0x8011
+#define GL_SEPARABLE_2D                   0x8012
+#define GL_CONVOLUTION_BORDER_MODE        0x8013
+#define GL_CONVOLUTION_FILTER_SCALE       0x8014
+#define GL_CONVOLUTION_FILTER_BIAS        0x8015
+#define GL_REDUCE                         0x8016
+#define GL_CONVOLUTION_FORMAT             0x8017
+#define GL_CONVOLUTION_WIDTH              0x8018
+#define GL_CONVOLUTION_HEIGHT             0x8019
+#define GL_MAX_CONVOLUTION_WIDTH          0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT         0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE     0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE   0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE    0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE   0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS      0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS    0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS     0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS    0x8023
+#define GL_HISTOGRAM                      0x8024
+#define GL_PROXY_HISTOGRAM                0x8025
+#define GL_HISTOGRAM_WIDTH                0x8026
+#define GL_HISTOGRAM_FORMAT               0x8027
+#define GL_HISTOGRAM_RED_SIZE             0x8028
+#define GL_HISTOGRAM_GREEN_SIZE           0x8029
+#define GL_HISTOGRAM_BLUE_SIZE            0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE           0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE       0x802C
+#define GL_HISTOGRAM_SINK                 0x802D
+#define GL_MINMAX                         0x802E
+#define GL_MINMAX_FORMAT                  0x802F
+#define GL_MINMAX_SINK                    0x8030
+#define GL_TABLE_TOO_LARGE                0x8031
+#define GL_COLOR_MATRIX                   0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH       0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE    0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE  0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE   0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS     0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS   0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS    0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   0x80BB
+#define GL_COLOR_TABLE                    0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE   0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE  0x80D2
+#define GL_PROXY_COLOR_TABLE              0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE              0x80D6
+#define GL_COLOR_TABLE_BIAS               0x80D7
+#define GL_COLOR_TABLE_FORMAT             0x80D8
+#define GL_COLOR_TABLE_WIDTH              0x80D9
+#define GL_COLOR_TABLE_RED_SIZE           0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE         0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE          0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE         0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE     0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE     0x80DF
+#define GL_CONSTANT_BORDER                0x8151
+#define GL_REPLICATE_BORDER               0x8153
+#define GL_CONVOLUTION_BORDER_COLOR       0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
+#define GL_MAX_TEXTURE_UNITS              0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX     0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX    0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX       0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX         0x84E6
+#define GL_MULTISAMPLE                    0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_MULTISAMPLE_BIT                0x20000000
+#define GL_NORMAL_MAP                     0x8511
+#define GL_REFLECTION_MAP                 0x8512
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP         0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_COMPRESSED_ALPHA               0x84E9
+#define GL_COMPRESSED_LUMINANCE           0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA     0x84EB
+#define GL_COMPRESSED_INTENSITY           0x84EC
+#define GL_COMPRESSED_RGB                 0x84ED
+#define GL_COMPRESSED_RGBA                0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT       0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  0x86A0
+#define GL_TEXTURE_COMPRESSED             0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_CLAMP_TO_BORDER                0x812D
+#define GL_COMBINE                        0x8570
+#define GL_COMBINE_RGB                    0x8571
+#define GL_COMBINE_ALPHA                  0x8572
+#define GL_SOURCE0_RGB                    0x8580
+#define GL_SOURCE1_RGB                    0x8581
+#define GL_SOURCE2_RGB                    0x8582
+#define GL_SOURCE0_ALPHA                  0x8588
+#define GL_SOURCE1_ALPHA                  0x8589
+#define GL_SOURCE2_ALPHA                  0x858A
+#define GL_OPERAND0_RGB                   0x8590
+#define GL_OPERAND1_RGB                   0x8591
+#define GL_OPERAND2_RGB                   0x8592
+#define GL_OPERAND0_ALPHA                 0x8598
+#define GL_OPERAND1_ALPHA                 0x8599
+#define GL_OPERAND2_ALPHA                 0x859A
+#define GL_RGB_SCALE                      0x8573
+#define GL_ADD_SIGNED                     0x8574
+#define GL_INTERPOLATE                    0x8575
+#define GL_SUBTRACT                       0x84E7
+#define GL_CONSTANT                       0x8576
+#define GL_PRIMARY_COLOR                  0x8577
+#define GL_PREVIOUS                       0x8578
+#define GL_DOT3_RGB                       0x86AE
+#define GL_DOT3_RGBA                      0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_POINT_SIZE_MIN                 0x8126
+#define GL_POINT_SIZE_MAX                 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
+#define GL_POINT_DISTANCE_ATTENUATION     0x8129
+#define GL_GENERATE_MIPMAP                0x8191
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_DEPTH_COMPONENT32              0x81A7
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FOG_COORDINATE_SOURCE          0x8450
+#define GL_FOG_COORDINATE                 0x8451
+#define GL_FRAGMENT_DEPTH                 0x8452
+#define GL_CURRENT_FOG_COORDINATE         0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE      0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE    0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER   0x8456
+#define GL_FOG_COORDINATE_ARRAY           0x8457
+#define GL_COLOR_SUM                      0x8458
+#define GL_CURRENT_SECONDARY_COLOR        0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE     0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE     0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE   0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER  0x845D
+#define GL_SECONDARY_COLOR_ARRAY          0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_FILTER_CONTROL         0x8500
+#define GL_TEXTURE_LOD_BIAS               0x8501
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_TEXTURE_DEPTH_SIZE             0x884A
+#define GL_DEPTH_TEXTURE_MODE             0x884B
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_COMPARE_R_TO_TEXTURE           0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_QUERY_COUNTER_BITS             0x8864
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING    0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING    0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING     0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING     0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING    0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY                      0x88B8
+#define GL_WRITE_ONLY                     0x88B9
+#define GL_READ_WRITE                     0x88BA
+#define GL_BUFFER_ACCESS                  0x88BB
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_SAMPLES_PASSED                 0x8914
+#define GL_FOG_COORD_SRC                  GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD                      GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD              GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE           GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE         GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER        GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY                GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB                       GL_SOURCE0_RGB
+#define GL_SRC1_RGB                       GL_SOURCE1_RGB
+#define GL_SRC2_RGB                       GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA                     GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA                     GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA                     GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB             GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE      0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE        0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_POINT_SPRITE                   0x8861
+#define GL_COORD_REPLACE                  0x8862
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS             0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_MAX_VARYING_FLOATS             0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_1D                     0x8B5D
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_SAMPLER_1D_SHADOW              0x8B61
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN      0x8CA0
+#define GL_LOWER_LEFT                     0x8CA1
+#define GL_UPPER_LEFT                     0x8CA2
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB                   0x84C0
+#define GL_TEXTURE1_ARB                   0x84C1
+#define GL_TEXTURE2_ARB                   0x84C2
+#define GL_TEXTURE3_ARB                   0x84C3
+#define GL_TEXTURE4_ARB                   0x84C4
+#define GL_TEXTURE5_ARB                   0x84C5
+#define GL_TEXTURE6_ARB                   0x84C6
+#define GL_TEXTURE7_ARB                   0x84C7
+#define GL_TEXTURE8_ARB                   0x84C8
+#define GL_TEXTURE9_ARB                   0x84C9
+#define GL_TEXTURE10_ARB                  0x84CA
+#define GL_TEXTURE11_ARB                  0x84CB
+#define GL_TEXTURE12_ARB                  0x84CC
+#define GL_TEXTURE13_ARB                  0x84CD
+#define GL_TEXTURE14_ARB                  0x84CE
+#define GL_TEXTURE15_ARB                  0x84CF
+#define GL_TEXTURE16_ARB                  0x84D0
+#define GL_TEXTURE17_ARB                  0x84D1
+#define GL_TEXTURE18_ARB                  0x84D2
+#define GL_TEXTURE19_ARB                  0x84D3
+#define GL_TEXTURE20_ARB                  0x84D4
+#define GL_TEXTURE21_ARB                  0x84D5
+#define GL_TEXTURE22_ARB                  0x84D6
+#define GL_TEXTURE23_ARB                  0x84D7
+#define GL_TEXTURE24_ARB                  0x84D8
+#define GL_TEXTURE25_ARB                  0x84D9
+#define GL_TEXTURE26_ARB                  0x84DA
+#define GL_TEXTURE27_ARB                  0x84DB
+#define GL_TEXTURE28_ARB                  0x84DC
+#define GL_TEXTURE29_ARB                  0x84DD
+#define GL_TEXTURE30_ARB                  0x84DE
+#define GL_TEXTURE31_ARB                  0x84DF
+#define GL_ACTIVE_TEXTURE_ARB             0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB      0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB          0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB   0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB     0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB                0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB   0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB        0x809F
+#define GL_SAMPLE_COVERAGE_ARB            0x80A0
+#define GL_SAMPLE_BUFFERS_ARB             0x80A8
+#define GL_SAMPLES_ARB                    0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB      0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB     0x80AB
+#define GL_MULTISAMPLE_BIT_ARB            0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB                 0x8511
+#define GL_REFLECTION_MAP_ARB             0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB  0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB           0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB       0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB       0x84EC
+#define GL_COMPRESSED_RGB_ARB             0x84ED
+#define GL_COMPRESSED_RGBA_ARB            0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB   0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB         0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB            0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB             0x8126
+#define GL_POINT_SIZE_MAX_ARB             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB  0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB           0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB        0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB           0x86A6
+#define GL_VERTEX_BLEND_ARB               0x86A7
+#define GL_CURRENT_WEIGHT_ARB             0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB          0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB        0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB          0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB       0x86AC
+#define GL_WEIGHT_ARRAY_ARB               0x86AD
+#define GL_MODELVIEW0_ARB                 0x1700
+#define GL_MODELVIEW1_ARB                 0x850A
+#define GL_MODELVIEW2_ARB                 0x8722
+#define GL_MODELVIEW3_ARB                 0x8723
+#define GL_MODELVIEW4_ARB                 0x8724
+#define GL_MODELVIEW5_ARB                 0x8725
+#define GL_MODELVIEW6_ARB                 0x8726
+#define GL_MODELVIEW7_ARB                 0x8727
+#define GL_MODELVIEW8_ARB                 0x8728
+#define GL_MODELVIEW9_ARB                 0x8729
+#define GL_MODELVIEW10_ARB                0x872A
+#define GL_MODELVIEW11_ARB                0x872B
+#define GL_MODELVIEW12_ARB                0x872C
+#define GL_MODELVIEW13_ARB                0x872D
+#define GL_MODELVIEW14_ARB                0x872E
+#define GL_MODELVIEW15_ARB                0x872F
+#define GL_MODELVIEW16_ARB                0x8730
+#define GL_MODELVIEW17_ARB                0x8731
+#define GL_MODELVIEW18_ARB                0x8732
+#define GL_MODELVIEW19_ARB                0x8733
+#define GL_MODELVIEW20_ARB                0x8734
+#define GL_MODELVIEW21_ARB                0x8735
+#define GL_MODELVIEW22_ARB                0x8736
+#define GL_MODELVIEW23_ARB                0x8737
+#define GL_MODELVIEW24_ARB                0x8738
+#define GL_MODELVIEW25_ARB                0x8739
+#define GL_MODELVIEW26_ARB                0x873A
+#define GL_MODELVIEW27_ARB                0x873B
+#define GL_MODELVIEW28_ARB                0x873C
+#define GL_MODELVIEW29_ARB                0x873D
+#define GL_MODELVIEW30_ARB                0x873E
+#define GL_MODELVIEW31_ARB                0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB             0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB       0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB     0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB         0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB       0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB    0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB    0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB  0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB                    0x8570
+#define GL_COMBINE_RGB_ARB                0x8571
+#define GL_COMBINE_ALPHA_ARB              0x8572
+#define GL_SOURCE0_RGB_ARB                0x8580
+#define GL_SOURCE1_RGB_ARB                0x8581
+#define GL_SOURCE2_RGB_ARB                0x8582
+#define GL_SOURCE0_ALPHA_ARB              0x8588
+#define GL_SOURCE1_ALPHA_ARB              0x8589
+#define GL_SOURCE2_ALPHA_ARB              0x858A
+#define GL_OPERAND0_RGB_ARB               0x8590
+#define GL_OPERAND1_RGB_ARB               0x8591
+#define GL_OPERAND2_RGB_ARB               0x8592
+#define GL_OPERAND0_ALPHA_ARB             0x8598
+#define GL_OPERAND1_ALPHA_ARB             0x8599
+#define GL_OPERAND2_ALPHA_ARB             0x859A
+#define GL_RGB_SCALE_ARB                  0x8573
+#define GL_ADD_SIGNED_ARB                 0x8574
+#define GL_INTERPOLATE_ARB                0x8575
+#define GL_SUBTRACT_ARB                   0x84E7
+#define GL_CONSTANT_ARB                   0x8576
+#define GL_PRIMARY_COLOR_ARB              0x8577
+#define GL_PREVIOUS_ARB                   0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB                   0x86AE
+#define GL_DOT3_RGBA_ARB                  0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB            0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB          0x81A5
+#define GL_DEPTH_COMPONENT24_ARB          0x81A6
+#define GL_DEPTH_COMPONENT32_ARB          0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB         0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB         0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB       0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB       0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB       0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB                  0x8458
+#define GL_VERTEX_PROGRAM_ARB             0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB   0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB   0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB      0x8626
+#define GL_PROGRAM_LENGTH_ARB             0x8627
+#define GL_PROGRAM_STRING_ARB             0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB       0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB             0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB  0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB    0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB     0x864B
+#define GL_PROGRAM_BINDING_ARB            0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB         0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB       0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB       0x8875
+#define GL_PROGRAM_FORMAT_ARB             0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB       0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB   0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB        0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB    0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB         0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB     0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB  0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB            0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB        0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB     0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB  0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB   0x88B7
+#define GL_MATRIX0_ARB                    0x88C0
+#define GL_MATRIX1_ARB                    0x88C1
+#define GL_MATRIX2_ARB                    0x88C2
+#define GL_MATRIX3_ARB                    0x88C3
+#define GL_MATRIX4_ARB                    0x88C4
+#define GL_MATRIX5_ARB                    0x88C5
+#define GL_MATRIX6_ARB                    0x88C6
+#define GL_MATRIX7_ARB                    0x88C7
+#define GL_MATRIX8_ARB                    0x88C8
+#define GL_MATRIX9_ARB                    0x88C9
+#define GL_MATRIX10_ARB                   0x88CA
+#define GL_MATRIX11_ARB                   0x88CB
+#define GL_MATRIX12_ARB                   0x88CC
+#define GL_MATRIX13_ARB                   0x88CD
+#define GL_MATRIX14_ARB                   0x88CE
+#define GL_MATRIX15_ARB                   0x88CF
+#define GL_MATRIX16_ARB                   0x88D0
+#define GL_MATRIX17_ARB                   0x88D1
+#define GL_MATRIX18_ARB                   0x88D2
+#define GL_MATRIX19_ARB                   0x88D3
+#define GL_MATRIX20_ARB                   0x88D4
+#define GL_MATRIX21_ARB                   0x88D5
+#define GL_MATRIX22_ARB                   0x88D6
+#define GL_MATRIX23_ARB                   0x88D7
+#define GL_MATRIX24_ARB                   0x88D8
+#define GL_MATRIX25_ARB                   0x88D9
+#define GL_MATRIX26_ARB                   0x88DA
+#define GL_MATRIX27_ARB                   0x88DB
+#define GL_MATRIX28_ARB                   0x88DC
+#define GL_MATRIX29_ARB                   0x88DD
+#define GL_MATRIX30_ARB                   0x88DE
+#define GL_MATRIX31_ARB                   0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB           0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB   0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB   0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB   0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB         0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB    0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB                0x8764
+#define GL_BUFFER_USAGE_ARB               0x8765
+#define GL_ARRAY_BUFFER_ARB               0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB       0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB       0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB                  0x88B8
+#define GL_WRITE_ONLY_ARB                 0x88B9
+#define GL_READ_WRITE_ARB                 0x88BA
+#define GL_BUFFER_ACCESS_ARB              0x88BB
+#define GL_BUFFER_MAPPED_ARB              0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB         0x88BD
+#define GL_STREAM_DRAW_ARB                0x88E0
+#define GL_STREAM_READ_ARB                0x88E1
+#define GL_STREAM_COPY_ARB                0x88E2
+#define GL_STATIC_DRAW_ARB                0x88E4
+#define GL_STATIC_READ_ARB                0x88E5
+#define GL_STATIC_COPY_ARB                0x88E6
+#define GL_DYNAMIC_DRAW_ARB               0x88E8
+#define GL_DYNAMIC_READ_ARB               0x88E9
+#define GL_DYNAMIC_COPY_ARB               0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB         0x8864
+#define GL_CURRENT_QUERY_ARB              0x8865
+#define GL_QUERY_RESULT_ARB               0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB     0x8867
+#define GL_SAMPLES_PASSED_ARB             0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB             0x8B40
+#define GL_SHADER_OBJECT_ARB              0x8B48
+#define GL_OBJECT_TYPE_ARB                0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB             0x8B4F
+#define GL_FLOAT_VEC2_ARB                 0x8B50
+#define GL_FLOAT_VEC3_ARB                 0x8B51
+#define GL_FLOAT_VEC4_ARB                 0x8B52
+#define GL_INT_VEC2_ARB                   0x8B53
+#define GL_INT_VEC3_ARB                   0x8B54
+#define GL_INT_VEC4_ARB                   0x8B55
+#define GL_BOOL_ARB                       0x8B56
+#define GL_BOOL_VEC2_ARB                  0x8B57
+#define GL_BOOL_VEC3_ARB                  0x8B58
+#define GL_BOOL_VEC4_ARB                  0x8B59
+#define GL_FLOAT_MAT2_ARB                 0x8B5A
+#define GL_FLOAT_MAT3_ARB                 0x8B5B
+#define GL_FLOAT_MAT4_ARB                 0x8B5C
+#define GL_SAMPLER_1D_ARB                 0x8B5D
+#define GL_SAMPLER_2D_ARB                 0x8B5E
+#define GL_SAMPLER_3D_ARB                 0x8B5F
+#define GL_SAMPLER_CUBE_ARB               0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB          0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB          0x8B62
+#define GL_SAMPLER_2D_RECT_ARB            0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB     0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB       0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB      0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB         0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB     0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB     0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB    0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB     0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB              0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB         0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB   0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB            0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB   0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB               0x8861
+#define GL_COORD_REPLACE_ARB              0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB           0x8824
+#define GL_DRAW_BUFFER0_ARB               0x8825
+#define GL_DRAW_BUFFER1_ARB               0x8826
+#define GL_DRAW_BUFFER2_ARB               0x8827
+#define GL_DRAW_BUFFER3_ARB               0x8828
+#define GL_DRAW_BUFFER4_ARB               0x8829
+#define GL_DRAW_BUFFER5_ARB               0x882A
+#define GL_DRAW_BUFFER6_ARB               0x882B
+#define GL_DRAW_BUFFER7_ARB               0x882C
+#define GL_DRAW_BUFFER8_ARB               0x882D
+#define GL_DRAW_BUFFER9_ARB               0x882E
+#define GL_DRAW_BUFFER10_ARB              0x882F
+#define GL_DRAW_BUFFER11_ARB              0x8830
+#define GL_DRAW_BUFFER12_ARB              0x8831
+#define GL_DRAW_BUFFER13_ARB              0x8832
+#define GL_DRAW_BUFFER14_ARB              0x8833
+#define GL_DRAW_BUFFER15_ARB              0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB          0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB  0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB    0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB            0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB         0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB       0x891B
+#define GL_CLAMP_READ_COLOR_ARB           0x891C
+#define GL_FIXED_ONLY_ARB                 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB                 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB           0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB         0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB          0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB         0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB     0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB     0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB         0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB        0x8C17
+#define GL_RGBA32F_ARB                    0x8814
+#define GL_RGB32F_ARB                     0x8815
+#define GL_ALPHA32F_ARB                   0x8816
+#define GL_INTENSITY32F_ARB               0x8817
+#define GL_LUMINANCE32F_ARB               0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB         0x8819
+#define GL_RGBA16F_ARB                    0x881A
+#define GL_RGB16F_ARB                     0x881B
+#define GL_ALPHA16F_ARB                   0x881C
+#define GL_INTENSITY16F_ARB               0x881D
+#define GL_LUMINANCE16F_ARB               0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB         0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT                       0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT             0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT   0x8002
+#define GL_CONSTANT_ALPHA_EXT             0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT   0x8004
+#define GL_BLEND_COLOR_EXT                0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT             0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT      0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT        0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT                     0x803B
+#define GL_ALPHA8_EXT                     0x803C
+#define GL_ALPHA12_EXT                    0x803D
+#define GL_ALPHA16_EXT                    0x803E
+#define GL_LUMINANCE4_EXT                 0x803F
+#define GL_LUMINANCE8_EXT                 0x8040
+#define GL_LUMINANCE12_EXT                0x8041
+#define GL_LUMINANCE16_EXT                0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT          0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT          0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT         0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT        0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT        0x8048
+#define GL_INTENSITY_EXT                  0x8049
+#define GL_INTENSITY4_EXT                 0x804A
+#define GL_INTENSITY8_EXT                 0x804B
+#define GL_INTENSITY12_EXT                0x804C
+#define GL_INTENSITY16_EXT                0x804D
+#define GL_RGB2_EXT                       0x804E
+#define GL_RGB4_EXT                       0x804F
+#define GL_RGB5_EXT                       0x8050
+#define GL_RGB8_EXT                       0x8051
+#define GL_RGB10_EXT                      0x8052
+#define GL_RGB12_EXT                      0x8053
+#define GL_RGB16_EXT                      0x8054
+#define GL_RGBA2_EXT                      0x8055
+#define GL_RGBA4_EXT                      0x8056
+#define GL_RGB5_A1_EXT                    0x8057
+#define GL_RGBA8_EXT                      0x8058
+#define GL_RGB10_A2_EXT                   0x8059
+#define GL_RGBA12_EXT                     0x805A
+#define GL_RGBA16_EXT                     0x805B
+#define GL_TEXTURE_RED_SIZE_EXT           0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT         0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT          0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT         0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT     0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT     0x8061
+#define GL_REPLACE_EXT                    0x8062
+#define GL_PROXY_TEXTURE_1D_EXT           0x8063
+#define GL_PROXY_TEXTURE_2D_EXT           0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT          0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT           0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT          0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT         0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT        0x806E
+#define GL_TEXTURE_3D_EXT                 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT           0x8070
+#define GL_TEXTURE_DEPTH_EXT              0x8071
+#define GL_TEXTURE_WRAP_R_EXT             0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT        0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS                   0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS      0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT                  0x8024
+#define GL_PROXY_HISTOGRAM_EXT            0x8025
+#define GL_HISTOGRAM_WIDTH_EXT            0x8026
+#define GL_HISTOGRAM_FORMAT_EXT           0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT         0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT       0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT        0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT       0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT   0x802C
+#define GL_HISTOGRAM_SINK_EXT             0x802D
+#define GL_MINMAX_EXT                     0x802E
+#define GL_MINMAX_FORMAT_EXT              0x802F
+#define GL_MINMAX_SINK_EXT                0x8030
+#define GL_TABLE_TOO_LARGE_EXT            0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT             0x8010
+#define GL_CONVOLUTION_2D_EXT             0x8011
+#define GL_SEPARABLE_2D_EXT               0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT    0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT   0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT    0x8015
+#define GL_REDUCE_EXT                     0x8016
+#define GL_CONVOLUTION_FORMAT_EXT         0x8017
+#define GL_CONVOLUTION_WIDTH_EXT          0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT         0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT      0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT     0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT  0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI               0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI   0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI                0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI          0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI          0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI           0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI         0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI          0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI       0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI     0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI      0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI     0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS             0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS         0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX             0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX        0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS         0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS          0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS       0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS        0x8133
+#define GL_TEXTURE_4D_SGIS                0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS          0x8135
+#define GL_TEXTURE_4DSIZE_SGIS            0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS            0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS       0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS        0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI        0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI  0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT                       0x800C
+#define GL_CMYKA_EXT                      0x800D
+#define GL_PACK_CMYK_HINT_EXT             0x800E
+#define GL_UNPACK_CMYK_HINT_EXT           0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT           0x8066
+#define GL_TEXTURE_RESIDENT_EXT           0x8067
+#define GL_TEXTURE_1D_BINDING_EXT         0x8068
+#define GL_TEXTURE_2D_BINDING_EXT         0x8069
+#define GL_TEXTURE_3D_BINDING_EXT         0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS         0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS             0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS       0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS       0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS      0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS       0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS            0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS      0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS      0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT        0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT     0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT     0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT       0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT    0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS           0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS           0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS        0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS         0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS               0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS      0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS       0x809F
+#define GL_SAMPLE_MASK_SGIS               0x80A0
+#define GL_1PASS_SGIS                     0x80A1
+#define GL_2PASS_0_SGIS                   0x80A2
+#define GL_2PASS_1_SGIS                   0x80A3
+#define GL_4PASS_0_SGIS                   0x80A4
+#define GL_4PASS_1_SGIS                   0x80A5
+#define GL_4PASS_2_SGIS                   0x80A6
+#define GL_4PASS_3_SGIS                   0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS            0x80A8
+#define GL_SAMPLES_SGIS                   0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS         0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS        0x80AB
+#define GL_SAMPLE_PATTERN_SGIS            0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT             0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT               0x8074
+#define GL_NORMAL_ARRAY_EXT               0x8075
+#define GL_COLOR_ARRAY_EXT                0x8076
+#define GL_INDEX_ARRAY_EXT                0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT        0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT            0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT          0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT          0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT        0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT         0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT          0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT        0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT         0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT           0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT           0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT         0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT          0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT           0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT         0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT          0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT   0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT   0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT  0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT     0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT      0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT       0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT       0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT        0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT        0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT    0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS           0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS      0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX     0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX    0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX     0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX    0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX     0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX         0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX   0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX    0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX    0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX           0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX  0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX          0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX          0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS             0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS           0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT                   0x8006
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#define GL_BLEND_EQUATION_EXT             0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT              0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT      0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX                 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX          0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX         0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX     0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX    0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX     0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX     0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS               0x8110
+#define GL_DUAL_ALPHA8_SGIS               0x8111
+#define GL_DUAL_ALPHA12_SGIS              0x8112
+#define GL_DUAL_ALPHA16_SGIS              0x8113
+#define GL_DUAL_LUMINANCE4_SGIS           0x8114
+#define GL_DUAL_LUMINANCE8_SGIS           0x8115
+#define GL_DUAL_LUMINANCE12_SGIS          0x8116
+#define GL_DUAL_LUMINANCE16_SGIS          0x8117
+#define GL_DUAL_INTENSITY4_SGIS           0x8118
+#define GL_DUAL_INTENSITY8_SGIS           0x8119
+#define GL_DUAL_INTENSITY12_SGIS          0x811A
+#define GL_DUAL_INTENSITY16_SGIS          0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS     0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS     0x811D
+#define GL_QUAD_ALPHA4_SGIS               0x811E
+#define GL_QUAD_ALPHA8_SGIS               0x811F
+#define GL_QUAD_LUMINANCE4_SGIS           0x8120
+#define GL_QUAD_LUMINANCE8_SGIS           0x8121
+#define GL_QUAD_INTENSITY4_SGIS           0x8122
+#define GL_QUAD_INTENSITY8_SGIS           0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS       0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS       0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX                    0x8148
+#define GL_SPRITE_MODE_SGIX               0x8149
+#define GL_SPRITE_AXIS_SGIX               0x814A
+#define GL_SPRITE_TRANSLATION_SGIX        0x814B
+#define GL_SPRITE_AXIAL_SGIX              0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX     0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX        0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT             0x8126
+#define GL_POINT_SIZE_MAX_EXT             0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT  0x8128
+#define GL_DISTANCE_ATTENUATION_EXT       0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS            0x8126
+#define GL_POINT_SIZE_MAX_SGIS            0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS      0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX   0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX  0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX                 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX          0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX      0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX   0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX  0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX      0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX       0x8195
+#define GL_DEFORMATIONS_MASK_SGIX         0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX     0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX           0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX  0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX         0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX         0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX         0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS                  0x812A
+#define GL_FOG_FUNC_POINTS_SGIS           0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS       0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX                0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX          0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP               0x8155
+#define GL_IMAGE_SCALE_Y_HP               0x8156
+#define GL_IMAGE_TRANSLATE_X_HP           0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP           0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP          0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP       0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP       0x815B
+#define GL_IMAGE_MAG_FILTER_HP            0x815C
+#define GL_IMAGE_MIN_FILTER_HP            0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP          0x815E
+#define GL_CUBIC_HP                       0x815F
+#define GL_AVERAGE_HP                     0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP          0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP               0x8150
+#define GL_CONSTANT_BORDER_HP             0x8151
+#define GL_REPLICATE_BORDER_HP            0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP    0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX          0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI           0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI     0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI         0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI            0x1A22D
+#define GL_COLOR3_BIT_PGI                 0x00010000
+#define GL_COLOR4_BIT_PGI                 0x00020000
+#define GL_EDGEFLAG_BIT_PGI               0x00040000
+#define GL_INDEX_BIT_PGI                  0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI            0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI            0x00400000
+#define GL_MAT_EMISSION_BIT_PGI           0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI      0x01000000
+#define GL_MAT_SHININESS_BIT_PGI          0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI           0x04000000
+#define GL_NORMAL_BIT_PGI                 0x08000000
+#define GL_TEXCOORD1_BIT_PGI              0x10000000
+#define GL_TEXCOORD2_BIT_PGI              0x20000000
+#define GL_TEXCOORD3_BIT_PGI              0x40000000
+#define GL_TEXCOORD4_BIT_PGI              0x80000000
+#define GL_VERTEX23_BIT_PGI               0x00000004
+#define GL_VERTEX4_BIT_PGI                0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI   0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI       0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI        0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI     0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI   0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI           0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI           0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI        0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI        0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI        0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI        0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI      0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI       0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI        0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI          0x1A219
+#define GL_CLIP_NEAR_HINT_PGI             0x1A220
+#define GL_CLIP_FAR_HINT_PGI              0x1A221
+#define GL_WIDE_LINE_HINT_PGI             0x1A222
+#define GL_BACK_NORMALS_HINT_PGI          0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT               0x80E2
+#define GL_COLOR_INDEX2_EXT               0x80E3
+#define GL_COLOR_INDEX4_EXT               0x80E4
+#define GL_COLOR_INDEX8_EXT               0x80E5
+#define GL_COLOR_INDEX12_EXT              0x80E6
+#define GL_COLOR_INDEX16_EXT              0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT         0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT  0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX             0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX            0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX     0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX        0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX        0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX        0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX            0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT             0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT   0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT        0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT                 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT            0x81B6
+#define GL_INDEX_TEST_REF_EXT             0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT                    0x81AD
+#define GL_IUI_V3F_EXT                    0x81AE
+#define GL_IUI_N3F_V2F_EXT                0x81AF
+#define GL_IUI_N3F_V3F_EXT                0x81B0
+#define GL_T2F_IUI_V2F_EXT                0x81B1
+#define GL_T2F_IUI_V3F_EXT                0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT            0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT            0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT   0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT   0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT                0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT   0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX                 0x81BB
+#define GL_YCRCB_444_SGIX                 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX       0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX         0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX     0x8406
+#define GL_LIGHT_ENV_MODE_SGIX            0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX           0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX           0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX           0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX           0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX           0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX           0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX           0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX           0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM  0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP       0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP       0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP        0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT      0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT       0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN                      0x80EA
+#define GL_PHONG_HINT_WIN                 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN       0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT          0x8349
+#define GL_FRAGMENT_NORMAL_EXT            0x834A
+#define GL_FRAGMENT_COLOR_EXT             0x834C
+#define GL_ATTENUATION_EXT                0x834D
+#define GL_SHADOW_ATTENUATION_EXT         0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT   0x834F
+#define GL_TEXTURE_LIGHT_EXT              0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT      0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX                 0x8320
+#define GL_ALPHA_MAX_SGIX                 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX   0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX     0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX     0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX    0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX    0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT                        0x80E0
+#define GL_BGRA_EXT                       0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX              0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX           0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX         0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX         0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX       0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX     0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX     0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX           0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX       0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL          0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP              0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP       0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT         0x8330
+#define GL_PIXEL_MAG_FILTER_EXT           0x8331
+#define GL_PIXEL_MIN_FILTER_EXT           0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT         0x8333
+#define GL_CUBIC_EXT                      0x8334
+#define GL_AVERAGE_EXT                    0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT  0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT     0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
+#define GL_SINGLE_COLOR_EXT               0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT                  0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT    0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT      0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT                    0x85AE
+#define GL_TEXTURE_NORMAL_EXT             0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT      0x8450
+#define GL_FOG_COORDINATE_EXT             0x8451
+#define GL_FRAGMENT_DEPTH_EXT             0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT     0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT  0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT       0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND        0x8490
+#define GL_INVERTED_SCREEN_W_REND         0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT              0x8439
+#define GL_BINORMAL_ARRAY_EXT             0x843A
+#define GL_CURRENT_TANGENT_EXT            0x843B
+#define GL_CURRENT_BINORMAL_EXT           0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT         0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT       0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT        0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT      0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT      0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT     0x8443
+#define GL_MAP1_TANGENT_EXT               0x8444
+#define GL_MAP2_TANGENT_EXT               0x8445
+#define GL_MAP1_BINORMAL_EXT              0x8446
+#define GL_MAP2_BINORMAL_EXT              0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT                    0x8570
+#define GL_COMBINE_RGB_EXT                0x8571
+#define GL_COMBINE_ALPHA_EXT              0x8572
+#define GL_RGB_SCALE_EXT                  0x8573
+#define GL_ADD_SIGNED_EXT                 0x8574
+#define GL_INTERPOLATE_EXT                0x8575
+#define GL_CONSTANT_EXT                   0x8576
+#define GL_PRIMARY_COLOR_EXT              0x8577
+#define GL_PREVIOUS_EXT                   0x8578
+#define GL_SOURCE0_RGB_EXT                0x8580
+#define GL_SOURCE1_RGB_EXT                0x8581
+#define GL_SOURCE2_RGB_EXT                0x8582
+#define GL_SOURCE0_ALPHA_EXT              0x8588
+#define GL_SOURCE1_ALPHA_EXT              0x8589
+#define GL_SOURCE2_ALPHA_EXT              0x858A
+#define GL_OPERAND0_RGB_EXT               0x8590
+#define GL_OPERAND1_RGB_EXT               0x8591
+#define GL_OPERAND2_RGB_EXT               0x8592
+#define GL_OPERAND0_ALPHA_EXT             0x8598
+#define GL_OPERAND1_ALPHA_EXT             0x8599
+#define GL_OPERAND2_ALPHA_EXT             0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE           0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX                 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX           0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX      0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX     0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN               0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN        0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN                    0x0001
+#define GL_REPLACE_MIDDLE_SUN             0x0002
+#define GL_REPLACE_OLDEST_SUN             0x0003
+#define GL_TRIANGLE_LIST_SUN              0x81D7
+#define GL_REPLACEMENT_CODE_SUN           0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN     0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN                   0x85C4
+#define GL_R1UI_C4UB_V3F_SUN              0x85C5
+#define GL_R1UI_C3F_V3F_SUN               0x85C6
+#define GL_R1UI_N3F_V3F_SUN               0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN           0x85C8
+#define GL_R1UI_T2F_V3F_SUN               0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN           0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN       0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT              0x80C8
+#define GL_BLEND_SRC_RGB_EXT              0x80C9
+#define GL_BLEND_DST_ALPHA_EXT            0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT            0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR             0x8560
+#define GL_GREEN_MIN_CLAMP_INGR           0x8561
+#define GL_BLUE_MIN_CLAMP_INGR            0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR           0x8563
+#define GL_RED_MAX_CLAMP_INGR             0x8564
+#define GL_GREEN_MAX_CLAMP_INGR           0x8565
+#define GL_BLUE_MAX_CLAMP_INGR            0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR           0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR            0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT                  0x8507
+#define GL_DECR_WRAP_EXT                  0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT                        0x80CC
+#define GL_422_REV_EXT                    0x80CD
+#define GL_422_AVERAGE_EXT                0x80CE
+#define GL_422_REV_AVERAGE_EXT            0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV                  0x8511
+#define GL_REFLECTION_MAP_NV              0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT                 0x8511
+#define GL_REFLECTION_MAP_EXT             0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT           0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT   0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT     0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT  0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN                0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT       0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT     0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT           0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT     GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT     0x8502
+#define GL_MODELVIEW0_MATRIX_EXT          GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT          0x8506
+#define GL_VERTEX_WEIGHTING_EXT           0x8509
+#define GL_MODELVIEW0_EXT                 GL_MODELVIEW
+#define GL_MODELVIEW1_EXT                 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT      0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT        0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT   0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT   0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV               0x8504
+#define GL_MAX_SPOT_EXPONENT_NV           0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV          0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV   0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV    0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV  0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV          0x8522
+#define GL_VARIABLE_A_NV                  0x8523
+#define GL_VARIABLE_B_NV                  0x8524
+#define GL_VARIABLE_C_NV                  0x8525
+#define GL_VARIABLE_D_NV                  0x8526
+#define GL_VARIABLE_E_NV                  0x8527
+#define GL_VARIABLE_F_NV                  0x8528
+#define GL_VARIABLE_G_NV                  0x8529
+#define GL_CONSTANT_COLOR0_NV             0x852A
+#define GL_CONSTANT_COLOR1_NV             0x852B
+#define GL_PRIMARY_COLOR_NV               0x852C
+#define GL_SECONDARY_COLOR_NV             0x852D
+#define GL_SPARE0_NV                      0x852E
+#define GL_SPARE1_NV                      0x852F
+#define GL_DISCARD_NV                     0x8530
+#define GL_E_TIMES_F_NV                   0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV           0x8536
+#define GL_UNSIGNED_INVERT_NV             0x8537
+#define GL_EXPAND_NORMAL_NV               0x8538
+#define GL_EXPAND_NEGATE_NV               0x8539
+#define GL_HALF_BIAS_NORMAL_NV            0x853A
+#define GL_HALF_BIAS_NEGATE_NV            0x853B
+#define GL_SIGNED_IDENTITY_NV             0x853C
+#define GL_SIGNED_NEGATE_NV               0x853D
+#define GL_SCALE_BY_TWO_NV                0x853E
+#define GL_SCALE_BY_FOUR_NV               0x853F
+#define GL_SCALE_BY_ONE_HALF_NV           0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV   0x8541
+#define GL_COMBINER_INPUT_NV              0x8542
+#define GL_COMBINER_MAPPING_NV            0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV    0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV     0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV     0x8546
+#define GL_COMBINER_MUX_SUM_NV            0x8547
+#define GL_COMBINER_SCALE_NV              0x8548
+#define GL_COMBINER_BIAS_NV               0x8549
+#define GL_COMBINER_AB_OUTPUT_NV          0x854A
+#define GL_COMBINER_CD_OUTPUT_NV          0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV         0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV       0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV       0x854E
+#define GL_COLOR_SUM_CLAMP_NV             0x854F
+#define GL_COMBINER0_NV                   0x8550
+#define GL_COMBINER1_NV                   0x8551
+#define GL_COMBINER2_NV                   0x8552
+#define GL_COMBINER3_NV                   0x8553
+#define GL_COMBINER4_NV                   0x8554
+#define GL_COMBINER5_NV                   0x8555
+#define GL_COMBINER6_NV                   0x8556
+#define GL_COMBINER7_NV                   0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV           0x855A
+#define GL_EYE_RADIAL_NV                  0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV          0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV                0x855D
+#define GL_EMBOSS_CONSTANT_NV             0x855E
+#define GL_EMBOSS_MAP_NV                  0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV                    0x8503
+#define GL_SOURCE3_RGB_NV                 0x8583
+#define GL_SOURCE3_ALPHA_NV               0x858B
+#define GL_OPERAND3_RGB_NV                0x8593
+#define GL_OPERAND3_ALPHA_NV              0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM                103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM          103070
+#define GL_NORMAL_ARRAY_LIST_IBM          103071
+#define GL_COLOR_ARRAY_LIST_IBM           103072
+#define GL_INDEX_ARRAY_LIST_IBM           103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM   103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM       103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM  103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM   103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM   103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM    103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM    103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX       0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX     0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX      0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX      0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX      0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX                     0x8318
+#define GL_YCRCBA_SGIX                    0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX     0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX       0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX      0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX               0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX            0x86B3
+#define GL_SAMPLES_3DFX                   0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX           0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT                0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT        0x809F
+#define GL_SAMPLE_MASK_EXT                0x80A0
+#define GL_1PASS_EXT                      0x80A1
+#define GL_2PASS_0_EXT                    0x80A2
+#define GL_2PASS_1_EXT                    0x80A3
+#define GL_4PASS_0_EXT                    0x80A4
+#define GL_4PASS_1_EXT                    0x80A5
+#define GL_4PASS_2_EXT                    0x80A6
+#define GL_4PASS_3_EXT                    0x80A7
+#define GL_SAMPLE_BUFFERS_EXT             0x80A8
+#define GL_SAMPLES_EXT                    0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT          0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT         0x80AB
+#define GL_SAMPLE_PATTERN_EXT             0x80AC
+#define GL_MULTISAMPLE_BIT_EXT            0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX            0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX       0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX          0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX             0x842C
+#define GL_UNPACK_RESAMPLE_SGIX           0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX        0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX        0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX         0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS     0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS  0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS      0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS   0x81F3
+#define GL_EYE_POINT_SGIS                 0x81F4
+#define GL_OBJECT_POINT_SGIS              0x81F5
+#define GL_EYE_LINE_SGIS                  0x81F6
+#define GL_OBJECT_LINE_SGIS               0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS   0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT                   0x8740
+#define GL_DOT3_RGBA_EXT                  0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI       0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV               0x84F2
+#define GL_FENCE_STATUS_NV                0x84F3
+#define GL_FENCE_CONDITION_NV             0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM            0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV                     0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV          0x86C1
+#define GL_MAP_TESSELLATION_NV            0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV          0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV          0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV         0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV         0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV         0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV         0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV         0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV         0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV         0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV         0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV         0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV         0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV        0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV        0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV        0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV        0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV        0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV        0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV        0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV     0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV               0x84F9
+#define GL_UNSIGNED_INT_24_8_NV           0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV         0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV           0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV   0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV     0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV  0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV    0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV      0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV  0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV          0x86DC
+#define GL_SHADER_CONSISTENT_NV           0x86DD
+#define GL_TEXTURE_SHADER_NV              0x86DE
+#define GL_SHADER_OPERATION_NV            0x86DF
+#define GL_CULL_MODES_NV                  0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV       0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV        0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV         0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV    GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV     GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV      GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV      0x86E4
+#define GL_CONST_EYE_NV                   0x86E5
+#define GL_PASS_THROUGH_NV                0x86E6
+#define GL_CULL_FRAGMENT_NV               0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV           0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV     0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV     0x86EA
+#define GL_DOT_PRODUCT_NV                 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV   0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV      0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV                        0x86F4
+#define GL_DSDT_NV                        0x86F5
+#define GL_DSDT_MAG_NV                    0x86F6
+#define GL_DSDT_MAG_VIB_NV                0x86F7
+#define GL_HILO16_NV                      0x86F8
+#define GL_SIGNED_HILO_NV                 0x86F9
+#define GL_SIGNED_HILO16_NV               0x86FA
+#define GL_SIGNED_RGBA_NV                 0x86FB
+#define GL_SIGNED_RGBA8_NV                0x86FC
+#define GL_SIGNED_RGB_NV                  0x86FE
+#define GL_SIGNED_RGB8_NV                 0x86FF
+#define GL_SIGNED_LUMINANCE_NV            0x8701
+#define GL_SIGNED_LUMINANCE8_NV           0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV      0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV    0x8704
+#define GL_SIGNED_ALPHA_NV                0x8705
+#define GL_SIGNED_ALPHA8_NV               0x8706
+#define GL_SIGNED_INTENSITY_NV            0x8707
+#define GL_SIGNED_INTENSITY8_NV           0x8708
+#define GL_DSDT8_NV                       0x8709
+#define GL_DSDT8_MAG8_NV                  0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV       0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV   0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV                    0x870E
+#define GL_LO_SCALE_NV                    0x870F
+#define GL_DS_SCALE_NV                    0x8710
+#define GL_DT_SCALE_NV                    0x8711
+#define GL_MAGNITUDE_SCALE_NV             0x8712
+#define GL_VIBRANCE_SCALE_NV              0x8713
+#define GL_HI_BIAS_NV                     0x8714
+#define GL_LO_BIAS_NV                     0x8715
+#define GL_DS_BIAS_NV                     0x8716
+#define GL_DT_BIAS_NV                     0x8717
+#define GL_MAGNITUDE_BIAS_NV              0x8718
+#define GL_VIBRANCE_BIAS_NV               0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV       0x871A
+#define GL_TEXTURE_HI_SIZE_NV             0x871B
+#define GL_TEXTURE_LO_SIZE_NV             0x871C
+#define GL_TEXTURE_DS_SIZE_NV             0x871D
+#define GL_TEXTURE_DT_SIZE_NV             0x871E
+#define GL_TEXTURE_MAG_SIZE_NV            0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV      0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV              0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV        0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV           0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV         0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV           0x8625
+#define GL_CURRENT_ATTRIB_NV              0x8626
+#define GL_PROGRAM_LENGTH_NV              0x8627
+#define GL_PROGRAM_STRING_NV              0x8628
+#define GL_MODELVIEW_PROJECTION_NV        0x8629
+#define GL_IDENTITY_NV                    0x862A
+#define GL_INVERSE_NV                     0x862B
+#define GL_TRANSPOSE_NV                   0x862C
+#define GL_INVERSE_TRANSPOSE_NV           0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV          0x862F
+#define GL_MATRIX0_NV                     0x8630
+#define GL_MATRIX1_NV                     0x8631
+#define GL_MATRIX2_NV                     0x8632
+#define GL_MATRIX3_NV                     0x8633
+#define GL_MATRIX4_NV                     0x8634
+#define GL_MATRIX5_NV                     0x8635
+#define GL_MATRIX6_NV                     0x8636
+#define GL_MATRIX7_NV                     0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV  0x8640
+#define GL_CURRENT_MATRIX_NV              0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV   0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV     0x8643
+#define GL_PROGRAM_PARAMETER_NV           0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV        0x8645
+#define GL_PROGRAM_TARGET_NV              0x8646
+#define GL_PROGRAM_RESIDENT_NV            0x8647
+#define GL_TRACK_MATRIX_NV                0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV      0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV      0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV      0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV        0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV        0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV        0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV        0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV        0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV        0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV        0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV        0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV        0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV        0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV       0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV       0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV       0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV       0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV       0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV       0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV       0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV       0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV       0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV       0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV       0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV       0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV       0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV       0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV       0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV       0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV      0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV      0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV      0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV      0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV      0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV      0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV       0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV       0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV       0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV       0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV       0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV       0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV       0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV       0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV       0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV       0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV      0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV      0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV      0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV      0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV      0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV      0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX       0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX       0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX       0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX            0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML                  0x8980
+#define GL_INTERLACE_READ_OML             0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML     0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML   0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML              0x8984
+#define GL_UNPACK_RESAMPLE_OML            0x8985
+#define GL_RESAMPLE_REPLICATE_OML         0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML         0x8987
+#define GL_RESAMPLE_AVERAGE_OML           0x8988
+#define GL_RESAMPLE_DECIMATE_OML          0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV       0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV       0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI            0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI       0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI         0x8777
+#define GL_BUMP_TEX_UNITS_ATI             0x8778
+#define GL_DUDV_ATI                       0x8779
+#define GL_DU8DV8_ATI                     0x877A
+#define GL_BUMP_ENVMAP_ATI                0x877B
+#define GL_BUMP_TARGET_ATI                0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI            0x8920
+#define GL_REG_0_ATI                      0x8921
+#define GL_REG_1_ATI                      0x8922
+#define GL_REG_2_ATI                      0x8923
+#define GL_REG_3_ATI                      0x8924
+#define GL_REG_4_ATI                      0x8925
+#define GL_REG_5_ATI                      0x8926
+#define GL_REG_6_ATI                      0x8927
+#define GL_REG_7_ATI                      0x8928
+#define GL_REG_8_ATI                      0x8929
+#define GL_REG_9_ATI                      0x892A
+#define GL_REG_10_ATI                     0x892B
+#define GL_REG_11_ATI                     0x892C
+#define GL_REG_12_ATI                     0x892D
+#define GL_REG_13_ATI                     0x892E
+#define GL_REG_14_ATI                     0x892F
+#define GL_REG_15_ATI                     0x8930
+#define GL_REG_16_ATI                     0x8931
+#define GL_REG_17_ATI                     0x8932
+#define GL_REG_18_ATI                     0x8933
+#define GL_REG_19_ATI                     0x8934
+#define GL_REG_20_ATI                     0x8935
+#define GL_REG_21_ATI                     0x8936
+#define GL_REG_22_ATI                     0x8937
+#define GL_REG_23_ATI                     0x8938
+#define GL_REG_24_ATI                     0x8939
+#define GL_REG_25_ATI                     0x893A
+#define GL_REG_26_ATI                     0x893B
+#define GL_REG_27_ATI                     0x893C
+#define GL_REG_28_ATI                     0x893D
+#define GL_REG_29_ATI                     0x893E
+#define GL_REG_30_ATI                     0x893F
+#define GL_REG_31_ATI                     0x8940
+#define GL_CON_0_ATI                      0x8941
+#define GL_CON_1_ATI                      0x8942
+#define GL_CON_2_ATI                      0x8943
+#define GL_CON_3_ATI                      0x8944
+#define GL_CON_4_ATI                      0x8945
+#define GL_CON_5_ATI                      0x8946
+#define GL_CON_6_ATI                      0x8947
+#define GL_CON_7_ATI                      0x8948
+#define GL_CON_8_ATI                      0x8949
+#define GL_CON_9_ATI                      0x894A
+#define GL_CON_10_ATI                     0x894B
+#define GL_CON_11_ATI                     0x894C
+#define GL_CON_12_ATI                     0x894D
+#define GL_CON_13_ATI                     0x894E
+#define GL_CON_14_ATI                     0x894F
+#define GL_CON_15_ATI                     0x8950
+#define GL_CON_16_ATI                     0x8951
+#define GL_CON_17_ATI                     0x8952
+#define GL_CON_18_ATI                     0x8953
+#define GL_CON_19_ATI                     0x8954
+#define GL_CON_20_ATI                     0x8955
+#define GL_CON_21_ATI                     0x8956
+#define GL_CON_22_ATI                     0x8957
+#define GL_CON_23_ATI                     0x8958
+#define GL_CON_24_ATI                     0x8959
+#define GL_CON_25_ATI                     0x895A
+#define GL_CON_26_ATI                     0x895B
+#define GL_CON_27_ATI                     0x895C
+#define GL_CON_28_ATI                     0x895D
+#define GL_CON_29_ATI                     0x895E
+#define GL_CON_30_ATI                     0x895F
+#define GL_CON_31_ATI                     0x8960
+#define GL_MOV_ATI                        0x8961
+#define GL_ADD_ATI                        0x8963
+#define GL_MUL_ATI                        0x8964
+#define GL_SUB_ATI                        0x8965
+#define GL_DOT3_ATI                       0x8966
+#define GL_DOT4_ATI                       0x8967
+#define GL_MAD_ATI                        0x8968
+#define GL_LERP_ATI                       0x8969
+#define GL_CND_ATI                        0x896A
+#define GL_CND0_ATI                       0x896B
+#define GL_DOT2_ADD_ATI                   0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI     0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI     0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI     0x896F
+#define GL_NUM_PASSES_ATI                 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI  0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI     0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI    0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI        0x8975
+#define GL_SWIZZLE_STR_ATI                0x8976
+#define GL_SWIZZLE_STQ_ATI                0x8977
+#define GL_SWIZZLE_STR_DR_ATI             0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI             0x8979
+#define GL_SWIZZLE_STRQ_ATI               0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI            0x897B
+#define GL_RED_BIT_ATI                    0x00000001
+#define GL_GREEN_BIT_ATI                  0x00000002
+#define GL_BLUE_BIT_ATI                   0x00000004
+#define GL_2X_BIT_ATI                     0x00000001
+#define GL_4X_BIT_ATI                     0x00000002
+#define GL_8X_BIT_ATI                     0x00000004
+#define GL_HALF_BIT_ATI                   0x00000008
+#define GL_QUARTER_BIT_ATI                0x00000010
+#define GL_EIGHTH_BIT_ATI                 0x00000020
+#define GL_SATURATE_BIT_ATI               0x00000040
+#define GL_COMP_BIT_ATI                   0x00000002
+#define GL_NEGATE_BIT_ATI                 0x00000004
+#define GL_BIAS_BIT_ATI                   0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI               0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI    0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI   0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI                     0x8760
+#define GL_DYNAMIC_ATI                    0x8761
+#define GL_PRESERVE_ATI                   0x8762
+#define GL_DISCARD_ATI                    0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI         0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI        0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI        0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI        0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT              0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT      0x8781
+#define GL_OP_INDEX_EXT                   0x8782
+#define GL_OP_NEGATE_EXT                  0x8783
+#define GL_OP_DOT3_EXT                    0x8784
+#define GL_OP_DOT4_EXT                    0x8785
+#define GL_OP_MUL_EXT                     0x8786
+#define GL_OP_ADD_EXT                     0x8787
+#define GL_OP_MADD_EXT                    0x8788
+#define GL_OP_FRAC_EXT                    0x8789
+#define GL_OP_MAX_EXT                     0x878A
+#define GL_OP_MIN_EXT                     0x878B
+#define GL_OP_SET_GE_EXT                  0x878C
+#define GL_OP_SET_LT_EXT                  0x878D
+#define GL_OP_CLAMP_EXT                   0x878E
+#define GL_OP_FLOOR_EXT                   0x878F
+#define GL_OP_ROUND_EXT                   0x8790
+#define GL_OP_EXP_BASE_2_EXT              0x8791
+#define GL_OP_LOG_BASE_2_EXT              0x8792
+#define GL_OP_POWER_EXT                   0x8793
+#define GL_OP_RECIP_EXT                   0x8794
+#define GL_OP_RECIP_SQRT_EXT              0x8795
+#define GL_OP_SUB_EXT                     0x8796
+#define GL_OP_CROSS_PRODUCT_EXT           0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT         0x8798
+#define GL_OP_MOV_EXT                     0x8799
+#define GL_OUTPUT_VERTEX_EXT              0x879A
+#define GL_OUTPUT_COLOR0_EXT              0x879B
+#define GL_OUTPUT_COLOR1_EXT              0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT      0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT      0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT      0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT      0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT      0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT      0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT      0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT      0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT      0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT      0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT     0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT     0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT     0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT     0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT     0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT     0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT     0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT     0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT     0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT     0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT     0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT     0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT     0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT     0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT     0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT     0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT     0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT     0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT     0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT     0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT     0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT     0x87BC
+#define GL_OUTPUT_FOG_EXT                 0x87BD
+#define GL_SCALAR_EXT                     0x87BE
+#define GL_VECTOR_EXT                     0x87BF
+#define GL_MATRIX_EXT                     0x87C0
+#define GL_VARIANT_EXT                    0x87C1
+#define GL_INVARIANT_EXT                  0x87C2
+#define GL_LOCAL_CONSTANT_EXT             0x87C3
+#define GL_LOCAL_EXT                      0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT   0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT     0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT   0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT       0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT    0x87D4
+#define GL_X_EXT                          0x87D5
+#define GL_Y_EXT                          0x87D6
+#define GL_Z_EXT                          0x87D7
+#define GL_W_EXT                          0x87D8
+#define GL_NEGATIVE_X_EXT                 0x87D9
+#define GL_NEGATIVE_Y_EXT                 0x87DA
+#define GL_NEGATIVE_Z_EXT                 0x87DB
+#define GL_NEGATIVE_W_EXT                 0x87DC
+#define GL_ZERO_EXT                       0x87DD
+#define GL_ONE_EXT                        0x87DE
+#define GL_NEGATIVE_ONE_EXT               0x87DF
+#define GL_NORMALIZED_RANGE_EXT           0x87E0
+#define GL_FULL_RANGE_EXT                 0x87E1
+#define GL_CURRENT_VERTEX_EXT             0x87E2
+#define GL_MVP_MATRIX_EXT                 0x87E3
+#define GL_VARIANT_VALUE_EXT              0x87E4
+#define GL_VARIANT_DATATYPE_EXT           0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT       0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT         0x87E7
+#define GL_VARIANT_ARRAY_EXT              0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT      0x87E9
+#define GL_INVARIANT_VALUE_EXT            0x87EA
+#define GL_INVARIANT_DATATYPE_EXT         0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT       0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT    0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI         0x876B
+#define GL_VERTEX_STREAM0_ATI             0x876C
+#define GL_VERTEX_STREAM1_ATI             0x876D
+#define GL_VERTEX_STREAM2_ATI             0x876E
+#define GL_VERTEX_STREAM3_ATI             0x876F
+#define GL_VERTEX_STREAM4_ATI             0x8770
+#define GL_VERTEX_STREAM5_ATI             0x8771
+#define GL_VERTEX_STREAM6_ATI             0x8772
+#define GL_VERTEX_STREAM7_ATI             0x8773
+#define GL_VERTEX_SOURCE_ATI              0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI              0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI         0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI      0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN                  0x8614
+#define GL_TRIANGLE_MESH_SUN              0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN                0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV     0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV                 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV          0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV  0x8865
+#define GL_PIXEL_COUNT_NV                 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV       0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV                0x8861
+#define GL_COORD_REPLACE_NV               0x8862
+#define GL_POINT_SPRITE_R_MODE_NV         0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV      0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV   0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV    0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV    0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV      0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV                       0x885E
+#define GL_SIGNED_HILO8_NV                0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV           0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT      0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT        0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI       0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE    0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE            0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE       0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE    0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE              0x8A0A
+#define GL_FENCE_APPLE                    0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE     0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE       0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CACHED_APPLE           0x85BE
+#define GL_STORAGE_SHARED_APPLE           0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE                0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC                       0x83A0
+#define GL_RGB4_S3TC                      0x83A1
+#define GL_RGBA_S3TC                      0x83A2
+#define GL_RGBA4_S3TC                     0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI           0x8824
+#define GL_DRAW_BUFFER0_ATI               0x8825
+#define GL_DRAW_BUFFER1_ATI               0x8826
+#define GL_DRAW_BUFFER2_ATI               0x8827
+#define GL_DRAW_BUFFER3_ATI               0x8828
+#define GL_DRAW_BUFFER4_ATI               0x8829
+#define GL_DRAW_BUFFER5_ATI               0x882A
+#define GL_DRAW_BUFFER6_ATI               0x882B
+#define GL_DRAW_BUFFER7_ATI               0x882C
+#define GL_DRAW_BUFFER8_ATI               0x882D
+#define GL_DRAW_BUFFER9_ATI               0x882E
+#define GL_DRAW_BUFFER10_ATI              0x882F
+#define GL_DRAW_BUFFER11_ATI              0x8830
+#define GL_DRAW_BUFFER12_ATI              0x8831
+#define GL_DRAW_BUFFER13_ATI              0x8832
+#define GL_DRAW_BUFFER14_ATI              0x8833
+#define GL_DRAW_BUFFER15_ATI              0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI            0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI               0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI        0x8745
+#define GL_MODULATE_SUBTRACT_ATI          0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI               0x8814
+#define GL_RGB_FLOAT32_ATI                0x8815
+#define GL_ALPHA_FLOAT32_ATI              0x8816
+#define GL_INTENSITY_FLOAT32_ATI          0x8817
+#define GL_LUMINANCE_FLOAT32_ATI          0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI    0x8819
+#define GL_RGBA_FLOAT16_ATI               0x881A
+#define GL_RGB_FLOAT16_ATI                0x881B
+#define GL_ALPHA_FLOAT16_ATI              0x881C
+#define GL_INTENSITY_FLOAT16_ATI          0x881D
+#define GL_LUMINANCE_FLOAT16_ATI          0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI    0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV                     0x8880
+#define GL_FLOAT_RG_NV                    0x8881
+#define GL_FLOAT_RGB_NV                   0x8882
+#define GL_FLOAT_RGBA_NV                  0x8883
+#define GL_FLOAT_R16_NV                   0x8884
+#define GL_FLOAT_R32_NV                   0x8885
+#define GL_FLOAT_RG16_NV                  0x8886
+#define GL_FLOAT_RG32_NV                  0x8887
+#define GL_FLOAT_RGB16_NV                 0x8888
+#define GL_FLOAT_RGB32_NV                 0x8889
+#define GL_FLOAT_RGBA16_NV                0x888A
+#define GL_FLOAT_RGBA32_NV                0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV    0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV     0x888D
+#define GL_FLOAT_RGBA_MODE_NV             0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV            0x8870
+#define GL_MAX_TEXTURE_COORDS_NV          0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV     0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV    0x8873
+#define GL_PROGRAM_ERROR_STRING_NV        0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV                  0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV      0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV       0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV           0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV     0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI          0x8800
+#define GL_STENCIL_BACK_FAIL_ATI          0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT          0x8890
+#define GL_DEPTH_BOUNDS_EXT               0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT               0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT     0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT         GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT       0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA               0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA        0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA    0x85BB
+#define GL_YCBCR_MESA                     0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT          0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT        0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT  0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV      0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV        0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV      0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV      0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT      0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT        0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT       0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT       0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT    0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT           0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT         0x8D20
+#define GL_FRAMEBUFFER_EXT                0x8D40
+#define GL_RENDERBUFFER_EXT               0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT         0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT        0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT             0x8D46
+#define GL_STENCIL_INDEX4_EXT             0x8D47
+#define GL_STENCIL_INDEX8_EXT             0x8D48
+#define GL_STENCIL_INDEX16_EXT            0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT      0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT    0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT     0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT    0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT    0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT  0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;			/* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+#ifdef __APPLE__
+typedef long GLintptr;
+typedef long GLsizeiptr;
+#else
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+#ifdef __APPLE__
+typedef long GLintptrARB;
+typedef long GLsizeiptrARB;
+#else
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB;		/* native character */
+#if defined(__APPLE__)
+typedef void *GLhandleARB;	/* shader object handle */
+#else
+typedef unsigned int GLhandleARB;	/* shader object handle */
+#endif
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_EXT_color_matrix
+#define GL_EXT_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+#endif /* NO_SDL_GLEXT */
+/*@}*/
diff --git a/misc/winutils/include/SDL_platform.h b/misc/winutils/include/SDL_platform.h
new file mode 100644
index 0000000..48540a8
--- /dev/null
+++ b/misc/winutils/include/SDL_platform.h
@@ -0,0 +1,110 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_platform.h
+ *  Try to get a standard set of platform defines
+ */
+
+#ifndef _SDL_platform_h
+#define _SDL_platform_h
+
+#if defined(_AIX)
+#undef __AIX__
+#define __AIX__		1
+#endif
+#if defined(__BEOS__)
+#undef __BEOS__
+#define __BEOS__	1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__ 1
+#endif
+#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
+#undef __BSDI__
+#define __BSDI__	1
+#endif
+#if defined(_arch_dreamcast)
+#undef __DREAMCAST__
+#define __DREAMCAST__	1
+#endif
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#undef __FREEBSD__
+#define __FREEBSD__	1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__	1
+#endif
+#if defined(hpux) || defined(__hpux) || defined(__hpux__)
+#undef __HPUX__
+#define __HPUX__	1
+#endif
+#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
+#undef __IRIX__
+#define __IRIX__	1
+#endif
+#if defined(linux) || defined(__linux) || defined(__linux__)
+#undef __LINUX__
+#define __LINUX__	1
+#endif
+#if defined(__APPLE__)
+#undef __MACOSX__
+#define __MACOSX__	1
+#elif defined(macintosh)
+#undef __MACOS__
+#define __MACOS__	1
+#endif
+#if defined(__NetBSD__)
+#undef __NETBSD__
+#define __NETBSD__	1
+#endif
+#if defined(__OpenBSD__)
+#undef __OPENBSD__
+#define __OPENBSD__	1
+#endif
+#if defined(__OS2__)
+#undef __OS2__
+#define __OS2__		1
+#endif
+#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
+#undef __OSF__
+#define __OSF__		1
+#endif
+#if defined(__QNXNTO__)
+#undef __QNXNTO__
+#define __QNXNTO__	1
+#endif
+#if defined(riscos) || defined(__riscos) || defined(__riscos__)
+#undef __RISCOS__
+#define __RISCOS__	1
+#endif
+#if defined(__SVR4)
+#undef __SOLARIS__
+#define __SOLARIS__	1
+#endif
+#if defined(WIN32) || defined(_WIN32)
+#undef __WIN32__
+#define __WIN32__	1
+#endif
+
+#endif /* _SDL_platform_h */
diff --git a/misc/winutils/include/SDL_quit.h b/misc/winutils/include/SDL_quit.h
new file mode 100644
index 0000000..abd2ec6
--- /dev/null
+++ b/misc/winutils/include/SDL_quit.h
@@ -0,0 +1,55 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_quit.h
+ *  Include file for SDL quit event handling
+ */
+
+#ifndef _SDL_quit_h
+#define _SDL_quit_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/** @file SDL_quit.h
+ *  An SDL_QUITEVENT is generated when the user tries to close the application
+ *  window.  If it is ignored or filtered out, the window will remain open.
+ *  If it is not ignored or filtered, it is queued normally and the window
+ *  is allowed to close.  When the window is closed, screen updates will 
+ *  complete, but have no effect.
+ *
+ *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
+ *  and SIGTERM (system termination request), if handlers do not already
+ *  exist, that generate SDL_QUITEVENT events as well.  There is no way
+ *  to determine the cause of an SDL_QUITEVENT, but setting a signal
+ *  handler in your application will override the default generation of
+ *  quit events for that signal.
+ */
+
+/** @file SDL_quit.h
+ *  There are no functions directly affecting the quit event 
+ */
+
+#define SDL_QuitRequested() \
+        (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
+
+#endif /* _SDL_quit_h */
diff --git a/misc/winutils/include/SDL_rwops.h b/misc/winutils/include/SDL_rwops.h
new file mode 100644
index 0000000..98361d7
--- /dev/null
+++ b/misc/winutils/include/SDL_rwops.h
@@ -0,0 +1,155 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_rwops.h
+ *  This file provides a general interface for SDL to read and write
+ *  data sources.  It can easily be extended to files, memory, etc.
+ */
+
+#ifndef _SDL_rwops_h
+#define _SDL_rwops_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the read/write operation structure -- very basic */
+
+typedef struct SDL_RWops {
+	/** Seek to 'offset' relative to whence, one of stdio's whence values:
+	 *	SEEK_SET, SEEK_CUR, SEEK_END
+	 *  Returns the final offset in the data source.
+	 */
+	int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
+
+	/** Read up to 'maxnum' objects each of size 'size' from the data
+	 *  source to the area pointed at by 'ptr'.
+	 *  Returns the number of objects read, or -1 if the read failed.
+	 */
+	int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
+
+	/** Write exactly 'num' objects each of size 'objsize' from the area
+	 *  pointed at by 'ptr' to data source.
+	 *  Returns 'num', or -1 if the write failed.
+	 */
+	int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
+
+	/** Close and free an allocated SDL_FSops structure */
+	int (SDLCALL *close)(struct SDL_RWops *context);
+
+	Uint32 type;
+	union {
+#if defined(__WIN32__) && !defined(__SYMBIAN32__)
+	    struct {
+		int   append;
+		void *h;
+		struct {
+		    void *data;
+		    int size;
+		    int left;
+		} buffer;
+	    } win32io;
+#endif
+#ifdef HAVE_STDIO_H 
+	    struct {
+		int autoclose;
+	 	FILE *fp;
+	    } stdio;
+#endif
+	    struct {
+		Uint8 *base;
+	 	Uint8 *here;
+		Uint8 *stop;
+	    } mem;
+	    struct {
+		void *data1;
+	    } unknown;
+	} hidden;
+
+} SDL_RWops;
+
+
+/** @name Functions to create SDL_RWops structures from various data sources */
+/*@{*/
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
+
+#ifdef HAVE_STDIO_H
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
+#endif
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
+extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
+
+/*@}*/
+
+/** @name Seek Reference Points */
+/*@{*/
+#define RW_SEEK_SET	0	/**< Seek from the beginning of data */
+#define RW_SEEK_CUR	1	/**< Seek relative to current read point */
+#define RW_SEEK_END	2	/**< Seek relative to the end of data */
+/*@}*/
+
+/** @name Macros to easily read and write from an SDL_RWops structure */
+/*@{*/
+#define SDL_RWseek(ctx, offset, whence)	(ctx)->seek(ctx, offset, whence)
+#define SDL_RWtell(ctx)			(ctx)->seek(ctx, 0, RW_SEEK_CUR)
+#define SDL_RWread(ctx, ptr, size, n)	(ctx)->read(ctx, ptr, size, n)
+#define SDL_RWwrite(ctx, ptr, size, n)	(ctx)->write(ctx, ptr, size, n)
+#define SDL_RWclose(ctx)		(ctx)->close(ctx)
+/*@}*/
+
+/** @name Read an item of the specified endianness and return in native format */
+/*@{*/
+extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
+extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
+/*@}*/
+
+/** @name Write an item of native format to the specified endianness */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_rwops_h */
diff --git a/misc/winutils/include/SDL_stdinc.h b/misc/winutils/include/SDL_stdinc.h
new file mode 100644
index 0000000..35a4fdd
--- /dev/null
+++ b/misc/winutils/include/SDL_stdinc.h
@@ -0,0 +1,620 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_stdinc.h
+ *  This is a general header that includes C language support
+ */
+
+#ifndef _SDL_stdinc_h
+#define _SDL_stdinc_h
+
+#include "SDL_config.h"
+
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if defined(STDC_HEADERS)
+# include <stdlib.h>
+# include <stddef.h>
+# include <stdarg.h>
+#else
+# if defined(HAVE_STDLIB_H)
+#  include <stdlib.h>
+# elif defined(HAVE_MALLOC_H)
+#  include <malloc.h>
+# endif
+# if defined(HAVE_STDDEF_H)
+#  include <stddef.h>
+# endif
+# if defined(HAVE_STDARG_H)
+#  include <stdarg.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+#endif
+#ifdef HAVE_CTYPE_H
+# include <ctype.h>
+#endif
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+# include <iconv.h>
+#endif
+
+/** The number of elements in an array */
+#define SDL_arraysize(array)	(sizeof(array)/sizeof(array[0]))
+#define SDL_TABLESIZE(table)	SDL_arraysize(table)
+
+/* Use proper C++ casts when compiled as C++ to be compatible with the option
+ -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
+#ifdef __cplusplus
+#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
+#define SDL_static_cast(type, expression) static_cast<type>(expression)
+#else
+#define SDL_reinterpret_cast(type, expression) ((type)(expression))
+#define SDL_static_cast(type, expression) ((type)(expression))
+#endif
+
+/** @name Basic data types */
+/*@{*/
+typedef enum {
+	SDL_FALSE = 0,
+	SDL_TRUE  = 1
+} SDL_bool;
+
+typedef int8_t		Sint8;
+typedef uint8_t		Uint8;
+typedef int16_t		Sint16;
+typedef uint16_t	Uint16;
+typedef int32_t		Sint32;
+typedef uint32_t	Uint32;
+
+#ifdef SDL_HAS_64BIT_TYPE
+typedef int64_t		Sint64;
+#ifndef SYMBIAN32_GCCE
+typedef uint64_t	Uint64;
+#endif
+#else
+/* This is really just a hack to prevent the compiler from complaining */
+typedef struct {
+	Uint32 hi;
+	Uint32 lo;
+} Uint64, Sint64;
+#endif
+
+/*@}*/
+
+/** @name Make sure the types really have the right sizes */
+/*@{*/
+#define SDL_COMPILE_TIME_ASSERT(name, x)               \
+       typedef int SDL_dummy_ ## name[(x) * 2 - 1]
+
+SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
+SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
+SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
+SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
+SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
+SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
+SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
+SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
+/*@}*/
+
+/** @name Enum Size Check
+ *  Check to make sure enums are the size of ints, for structure packing.
+ *  For both Watcom C/C++ and Borland C/C++ the compiler option that makes
+ *  enums having the size of an int must be enabled.
+ *  This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
+ */
+/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
+#ifdef __MWERKS__
+#pragma enumsalwaysint on
+#endif
+
+typedef enum {
+	DUMMY_ENUM_VALUE
+} SDL_DUMMY_ENUM;
+
+#ifndef __NDS__
+SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
+#endif
+/*@}*/
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_MALLOC
+#define SDL_malloc	malloc
+#else
+extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
+#endif
+
+#ifdef HAVE_CALLOC
+#define SDL_calloc	calloc
+#else
+extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
+#endif
+
+#ifdef HAVE_REALLOC
+#define SDL_realloc	realloc
+#else
+extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
+#endif
+
+#ifdef HAVE_FREE
+#define SDL_free	free
+#else
+extern DECLSPEC void SDLCALL SDL_free(void *mem);
+#endif
+
+#if defined(HAVE_ALLOCA) && !defined(alloca)
+# if defined(HAVE_ALLOCA_H)
+#  include <alloca.h>
+# elif defined(__GNUC__)
+#  define alloca __builtin_alloca
+# elif defined(_MSC_VER)
+#  include <malloc.h>
+#  define alloca _alloca
+# elif defined(__WATCOMC__)
+#  include <malloc.h>
+# elif defined(__BORLANDC__)
+#  include <malloc.h>
+# elif defined(__DMC__)
+#  include <stdlib.h>
+# elif defined(__AIX__)
+  #pragma alloca
+# elif defined(__MRC__)
+   void *alloca (unsigned);
+# else
+   char *alloca ();
+# endif
+#endif
+#ifdef HAVE_ALLOCA
+#define SDL_stack_alloc(type, count)    (type*)alloca(sizeof(type)*(count))
+#define SDL_stack_free(data)
+#else
+#define SDL_stack_alloc(type, count)    (type*)SDL_malloc(sizeof(type)*(count))
+#define SDL_stack_free(data)            SDL_free(data)
+#endif
+
+#ifdef HAVE_GETENV
+#define SDL_getenv	getenv
+#else
+extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
+#endif
+
+#ifdef HAVE_PUTENV
+#define SDL_putenv	putenv
+#else
+extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
+#endif
+
+#ifdef HAVE_QSORT
+#define SDL_qsort	qsort
+#else
+extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
+           int (*compare)(const void *, const void *));
+#endif
+
+#ifdef HAVE_ABS
+#define SDL_abs		abs
+#else
+#define SDL_abs(X)	((X) < 0 ? -(X) : (X))
+#endif
+
+#define SDL_min(x, y)	(((x) < (y)) ? (x) : (y))
+#define SDL_max(x, y)	(((x) > (y)) ? (x) : (y))
+
+#ifdef HAVE_CTYPE_H
+#define SDL_isdigit(X)  isdigit(X)
+#define SDL_isspace(X)  isspace(X)
+#define SDL_toupper(X)  toupper(X)
+#define SDL_tolower(X)  tolower(X)
+#else
+#define SDL_isdigit(X)  (((X) >= '0') && ((X) <= '9'))
+#define SDL_isspace(X)  (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
+#define SDL_toupper(X)  (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
+#define SDL_tolower(X)  (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
+#endif
+
+#ifdef HAVE_MEMSET
+#define SDL_memset      memset
+#else
+extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_memset4(dst, val, len)				\
+do {								\
+	int u0, u1, u2;						\
+	__asm__ __volatile__ (					\
+		"cld\n\t"					\
+		"rep ; stosl\n\t"				\
+		: "=&D" (u0), "=&a" (u1), "=&c" (u2)		\
+		: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len))	\
+		: "memory" );					\
+} while(0)
+#endif
+#ifndef SDL_memset4
+#define SDL_memset4(dst, val, len)		\
+do {						\
+	unsigned _count = (len);		\
+	unsigned _n = (_count + 3) / 4;		\
+	Uint32 *_p = SDL_static_cast(Uint32 *, dst);	\
+	Uint32 _val = (val);			\
+	if (len == 0) break;			\
+        switch (_count % 4) {			\
+        case 0: do {    *_p++ = _val;		\
+        case 3:         *_p++ = _val;		\
+        case 2:         *_p++ = _val;		\
+        case 1:         *_p++ = _val;		\
+		} while ( --_n );		\
+	}					\
+} while(0)
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy(dst, src, len)					  \
+do {									  \
+	int u0, u1, u2;						  	  \
+	__asm__ __volatile__ (						  \
+		"cld\n\t"						  \
+		"rep ; movsl\n\t"					  \
+		"testb $2,%b4\n\t"					  \
+		"je 1f\n\t"						  \
+		"movsw\n"						  \
+		"1:\ttestb $1,%b4\n\t"					  \
+		"je 2f\n\t"						  \
+		"movsb\n"						  \
+		"2:"							  \
+		: "=&c" (u0), "=&D" (u1), "=&S" (u2)			  \
+		: "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
+		: "memory" );						  \
+} while(0)
+#endif
+#ifndef SDL_memcpy
+#ifdef HAVE_MEMCPY
+#define SDL_memcpy      memcpy
+#elif defined(HAVE_BCOPY)
+#define SDL_memcpy(d, s, n)	bcopy((s), (d), (n))
+#else
+extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
+#endif
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy4(dst, src, len)				\
+do {								\
+	int ecx, edi, esi;					\
+	__asm__ __volatile__ (					\
+		"cld\n\t"					\
+		"rep ; movsl"					\
+		: "=&c" (ecx), "=&D" (edi), "=&S" (esi)		\
+		: "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src)	\
+		: "memory" );					\
+} while(0)
+#endif
+#ifndef SDL_memcpy4
+#define SDL_memcpy4(dst, src, len)	SDL_memcpy(dst, src, (len) << 2)
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_revcpy(dst, src, len)			\
+do {							\
+	int u0, u1, u2;					\
+	char *dstp = SDL_static_cast(char *, dst);	\
+	char *srcp = SDL_static_cast(char *, src);	\
+	int n = (len);					\
+	if ( n >= 4 ) {					\
+	__asm__ __volatile__ (				\
+		"std\n\t"				\
+		"rep ; movsl\n\t"			\
+		"cld\n\t"				\
+		: "=&c" (u0), "=&D" (u1), "=&S" (u2)	\
+		: "0" (n >> 2),				\
+		  "1" (dstp+(n-4)), "2" (srcp+(n-4))	\
+		: "memory" );				\
+	}						\
+	switch (n & 3) {				\
+		case 3: dstp[2] = srcp[2];		\
+		case 2: dstp[1] = srcp[1];		\
+		case 1: dstp[0] = srcp[0];		\
+			break;				\
+		default:				\
+			break;				\
+	}						\
+} while(0)
+#endif
+#ifndef SDL_revcpy
+extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
+#endif
+
+#ifdef HAVE_MEMMOVE
+#define SDL_memmove     memmove
+#elif defined(HAVE_BCOPY)
+#define SDL_memmove(d, s, n)	bcopy((s), (d), (n))
+#else
+#define SDL_memmove(dst, src, len)			\
+do {							\
+	if ( dst < src ) {				\
+		SDL_memcpy(dst, src, len);		\
+	} else {					\
+		SDL_revcpy(dst, src, len);		\
+	}						\
+} while(0)
+#endif
+
+#ifdef HAVE_MEMCMP
+#define SDL_memcmp      memcmp
+#else
+extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
+#endif
+
+#ifdef HAVE_STRLEN
+#define SDL_strlen      strlen
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
+#endif
+
+#ifdef HAVE_STRLCPY
+#define SDL_strlcpy     strlcpy
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRLCAT
+#define SDL_strlcat    strlcat
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRDUP
+#define SDL_strdup     strdup
+#else
+extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
+#endif
+
+#ifdef HAVE__STRREV
+#define SDL_strrev      _strrev
+#else
+extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
+#endif
+
+#ifdef HAVE__STRUPR
+#define SDL_strupr      _strupr
+#else
+extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
+#endif
+
+#ifdef HAVE__STRLWR
+#define SDL_strlwr      _strlwr
+#else
+extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
+#endif
+
+#ifdef HAVE_STRCHR
+#define SDL_strchr      strchr
+#elif defined(HAVE_INDEX)
+#define SDL_strchr      index
+#else
+extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRRCHR
+#define SDL_strrchr     strrchr
+#elif defined(HAVE_RINDEX)
+#define SDL_strrchr     rindex
+#else
+extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRSTR
+#define SDL_strstr      strstr
+#else
+extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
+#endif
+
+#ifdef HAVE_ITOA
+#define SDL_itoa        itoa
+#else
+#define SDL_itoa(value, string, radix)	SDL_ltoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__LTOA
+#define SDL_ltoa        _ltoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UITOA
+#define SDL_uitoa       _uitoa
+#else
+#define SDL_uitoa(value, string, radix)	SDL_ultoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__ULTOA
+#define SDL_ultoa       _ultoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOL
+#define SDL_strtol      strtol
+#else
+extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOUL
+#define SDL_strtoul      strtoul
+#else
+extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+
+#ifdef HAVE__I64TOA
+#define SDL_lltoa       _i64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UI64TOA
+#define SDL_ulltoa      _ui64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOLL
+#define SDL_strtoll     strtoll
+#else
+extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOULL
+#define SDL_strtoull     strtoull
+#else
+extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
+#endif
+
+#endif /* SDL_HAS_64BIT_TYPE */
+
+#ifdef HAVE_STRTOD
+#define SDL_strtod      strtod
+#else
+extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
+#endif
+
+#ifdef HAVE_ATOI
+#define SDL_atoi        atoi
+#else
+#define SDL_atoi(X)     SDL_strtol(X, NULL, 0)
+#endif
+
+#ifdef HAVE_ATOF
+#define SDL_atof        atof
+#else
+#define SDL_atof(X)     SDL_strtod(X, NULL)
+#endif
+
+#ifdef HAVE_STRCMP
+#define SDL_strcmp      strcmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCMP
+#define SDL_strncmp     strncmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRCASECMP
+#define SDL_strcasecmp  strcasecmp
+#elif defined(HAVE__STRICMP)
+#define SDL_strcasecmp  _stricmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCASECMP
+#define SDL_strncasecmp strncasecmp
+#elif defined(HAVE__STRNICMP)
+#define SDL_strncasecmp _strnicmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_SSCANF
+#define SDL_sscanf      sscanf
+#else
+extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_SNPRINTF
+#define SDL_snprintf    snprintf
+#else
+extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_VSNPRINTF
+#define SDL_vsnprintf   vsnprintf
+#else
+extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
+#endif
+
+/** @name SDL_ICONV Error Codes
+ *  The SDL implementation of iconv() returns these error codes 
+ */
+/*@{*/
+#define SDL_ICONV_ERROR		(size_t)-1
+#define SDL_ICONV_E2BIG		(size_t)-2
+#define SDL_ICONV_EILSEQ	(size_t)-3
+#define SDL_ICONV_EINVAL	(size_t)-4
+/*@}*/
+
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+#define SDL_iconv_t     iconv_t
+#define SDL_iconv_open  iconv_open
+#define SDL_iconv_close iconv_close
+#else
+typedef struct _SDL_iconv_t *SDL_iconv_t;
+extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
+extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
+#endif
+extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+/** This function converts a string between encodings in one pass, returning a
+ *  string that must be freed with SDL_free() or NULL on error.
+ */
+extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
+#define SDL_iconv_utf8_locale(S)	SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs2(S)		(Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs4(S)		(Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_stdinc_h */
diff --git a/misc/winutils/include/SDL_syswm.h b/misc/winutils/include/SDL_syswm.h
new file mode 100644
index 0000000..78433c6
--- /dev/null
+++ b/misc/winutils/include/SDL_syswm.h
@@ -0,0 +1,226 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_syswm.h
+ *  Include file for SDL custom system window manager hooks
+ */
+
+#ifndef _SDL_syswm_h
+#define _SDL_syswm_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL_syswm.h
+ *  Your application has access to a special type of event 'SDL_SYSWMEVENT',
+ *  which contains window-manager specific information and arrives whenever
+ *  an unhandled window event occurs.  This event is ignored by default, but
+ *  you can enable it with SDL_EventState()
+ */
+#ifdef SDL_PROTOTYPES_ONLY
+struct SDL_SysWMinfo;
+typedef struct SDL_SysWMinfo SDL_SysWMinfo;
+#else
+
+/* This is the structure for custom window manager events */
+#if defined(SDL_VIDEO_DRIVER_X11)
+#if defined(__APPLE__) && defined(__MACH__)
+/* conflicts with Quickdraw.h */
+#define Cursor X11Cursor
+#endif
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#if defined(__APPLE__) && defined(__MACH__)
+/* matches the re-define above */
+#undef Cursor
+#endif
+
+/** These are the various supported subsystems under UNIX */
+typedef enum {
+	SDL_SYSWM_X11
+} SDL_SYSWM_TYPE;
+
+/** The UNIX custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	SDL_SYSWM_TYPE subsystem;
+	union {
+	    XEvent xevent;
+	} event;
+};
+
+/** The UNIX custom window manager information structure.
+ *  When this structure is returned, it holds information about which
+ *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
+ */
+typedef struct SDL_SysWMinfo {
+	SDL_version version;
+	SDL_SYSWM_TYPE subsystem;
+	union {
+	    struct {
+	    	Display *display;	/**< The X11 display */
+	    	Window window;		/**< The X11 display window */
+		/** These locking functions should be called around
+                 *  any X11 functions using the display variable, 
+                 *  but not the gfxdisplay variable.
+                 *  They lock the event thread, so should not be
+		 *  called around event functions or from event filters.
+		 */
+                /*@{*/
+		void (*lock_func)(void);
+		void (*unlock_func)(void);
+                /*@}*/
+
+		/** @name Introduced in SDL 1.0.2 */
+                /*@{*/
+	    	Window fswindow;	/**< The X11 fullscreen window */
+	    	Window wmwindow;	/**< The X11 managed input window */
+                /*@}*/
+
+		/** @name Introduced in SDL 1.2.12 */
+                /*@{*/
+		Display *gfxdisplay;	/**< The X11 display to which rendering is done */
+                /*@}*/
+	    } x11;
+	} info;
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_NANOX)
+#include <microwin/nano-X.h>
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	int data;
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+	SDL_version version ;
+	GR_WINDOW_ID window ;	/* The display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/** The windows custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	HWND hwnd;			/**< The window for the message */
+	UINT msg;			/**< The type of message */
+	WPARAM wParam;			/**< WORD message parameter */
+	LPARAM lParam;			/**< LONG message parameter */
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+	SDL_version version;
+	HWND window;			/**< The Win32 display window */
+	HGLRC hglrc;			/**< The OpenGL context, if any */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_RISCOS)
+
+/** RISC OS custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	int eventCode;		/**< The window for the message */
+	int pollBlock[64];
+};
+
+/** The RISC OS custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+	SDL_version version;
+	int wimpVersion;    /**< Wimp version running under */
+	int taskHandle;     /**< The RISC OS task handle */
+	int window;		/**< The RISC OS display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_PHOTON)
+#include <sys/neutrino.h>
+#include <Ph.h>
+
+/** The QNX custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	int data;
+};
+
+/** The QNX custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+	SDL_version version;
+	int data;
+} SDL_SysWMinfo;
+
+#else
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+	SDL_version version;
+	int data;
+};
+
+/** The generic custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+	SDL_version version;
+	int data;
+} SDL_SysWMinfo;
+
+#endif /* video driver type */
+
+#endif /* SDL_PROTOTYPES_ONLY */
+
+/* Function prototypes */
+/**
+ * This function gives you custom hooks into the window manager information.
+ * It fills the structure pointed to by 'info' with custom information and
+ * returns 0 if the function is not implemented, 1 if the function is 
+ * implemented and no error occurred, and -1 if the version member of
+ * the 'info' structure is not filled in or not supported.
+ *
+ * You typically use this function like this:
+ * @code
+ * SDL_SysWMinfo info;
+ * SDL_VERSION(&info.version);
+ * if ( SDL_GetWMInfo(&info) ) { ... }
+ * @endcode
+ */
+extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_syswm_h */
diff --git a/misc/winutils/include/SDL_thread.h b/misc/winutils/include/SDL_thread.h
new file mode 100644
index 0000000..9ebe00e
--- /dev/null
+++ b/misc/winutils/include/SDL_thread.h
@@ -0,0 +1,115 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_thread_h
+#define _SDL_thread_h
+
+/** @file SDL_thread.h
+ *  Header for the SDL thread management routines 
+ *
+ *  @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/* Thread synchronization primitives */
+#include "SDL_mutex.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** The SDL thread structure, defined in SDL_thread.c */
+struct SDL_Thread;
+typedef struct SDL_Thread SDL_Thread;
+
+/** Create a thread */
+#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) &&  !defined(__SYMBIAN32__)
+/**
+ *  We compile SDL into a DLL on OS/2. This means, that it's the DLL which
+ *  creates a new thread for the calling process with the SDL_CreateThread()
+ *  API. There is a problem with this, that only the RTL of the SDL.DLL will
+ *  be initialized for those threads, and not the RTL of the calling application!
+ *  To solve this, we make a little hack here.
+ *  We'll always use the caller's _beginthread() and _endthread() APIs to
+ *  start a new thread. This way, if it's the SDL.DLL which uses this API,
+ *  then the RTL of SDL.DLL will be used to create the new thread, and if it's
+ *  the application, then the RTL of the application will be used.
+ *  So, in short:
+ *  Always use the _beginthread() and _endthread() of the calling runtime library!
+ */
+#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
+#ifndef _WIN32_WCE
+#include <process.h> /* This has _beginthread() and _endthread() defined! */
+#endif
+
+#ifdef __OS2__
+typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
+typedef void (*pfnSDL_CurrentEndThread)(void);
+#else
+typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+        unsigned (__stdcall *func)(void *), void *arg, 
+        unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#endif
+
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
+
+#ifdef __OS2__
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
+#elif defined(_WIN32_WCE)
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
+#else
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
+#endif
+#else
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
+#endif
+
+/** Get the 32-bit thread identifier for the current thread */
+extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
+
+/** Get the 32-bit thread identifier for the specified thread,
+ *  equivalent to SDL_ThreadID() if the specified thread is NULL.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
+
+/** Wait for a thread to finish.
+ *  The return code for the thread function is placed in the area
+ *  pointed to by 'status', if 'status' is not NULL.
+ */
+extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
+
+/** Forcefully kill a thread without worrying about its state */
+extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_thread_h */
diff --git a/misc/winutils/include/SDL_timer.h b/misc/winutils/include/SDL_timer.h
new file mode 100644
index 0000000..d764d5f
--- /dev/null
+++ b/misc/winutils/include/SDL_timer.h
@@ -0,0 +1,125 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+#ifndef _SDL_timer_h
+#define _SDL_timer_h
+
+/** @file SDL_timer.h
+ *  Header for the SDL time management routines
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the OS scheduler timeslice, in milliseconds */
+#define SDL_TIMESLICE		10
+
+/** This is the maximum resolution of the SDL timer on all platforms */
+#define TIMER_RESOLUTION	10	/**< Experimentally determined */
+
+/**
+ * Get the number of milliseconds since the SDL library initialization.
+ * Note that this value wraps if the program runs for more than ~49 days.
+ */ 
+extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
+
+/** Wait a specified number of milliseconds before returning */
+extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
+
+/** Function prototype for the timer callback function */
+typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
+
+/**
+ * Set a callback to run after the specified number of milliseconds has
+ * elapsed. The callback function is passed the current timer interval
+ * and returns the next timer interval.  If the returned value is the 
+ * same as the one passed in, the periodic alarm continues, otherwise a
+ * new alarm is scheduled.  If the callback returns 0, the periodic alarm
+ * is cancelled.
+ *
+ * To cancel a currently running timer, call SDL_SetTimer(0, NULL);
+ *
+ * The timer callback function may run in a different thread than your
+ * main code, and so shouldn't call any functions from within itself.
+ *
+ * The maximum resolution of this timer is 10 ms, which means that if
+ * you request a 16 ms timer, your callback will run approximately 20 ms
+ * later on an unloaded system.  If you wanted to set a flag signaling
+ * a frame update at 30 frames per second (every 33 ms), you might set a 
+ * timer for 30 ms:
+ *   @code SDL_SetTimer((33/10)*10, flag_update); @endcode
+ *
+ * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
+ *
+ * Under UNIX, you should not use raise or use SIGALRM and this function
+ * in the same program, as it is implemented using setitimer().  You also
+ * should not use this function in multi-threaded applications as signals
+ * to multi-threaded apps have undefined behavior in some implementations.
+ *
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
+
+/** @name New timer API
+ * New timer API, supports multiple timers
+ * Written by Stephane Peter <megastep at lokigames.com>
+ */
+/*@{*/
+
+/**
+ * Function prototype for the new timer callback function.
+ * The callback function is passed the current timer interval and returns
+ * the next timer interval.  If the returned value is the same as the one
+ * passed in, the periodic alarm continues, otherwise a new alarm is
+ * scheduled.  If the callback returns 0, the periodic alarm is cancelled.
+ */
+typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
+
+/** Definition of the timer ID type */
+typedef struct _SDL_TimerID *SDL_TimerID;
+
+/** Add a new timer to the pool of timers already running.
+ *  Returns a timer ID, or NULL when an error occurs.
+ */
+extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
+
+/**
+ * Remove one of the multiple timers knowing its ID.
+ * Returns a boolean value indicating success.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_timer_h */
diff --git a/misc/winutils/include/SDL_types.h b/misc/winutils/include/SDL_types.h
new file mode 100644
index 0000000..79d8b28
--- /dev/null
+++ b/misc/winutils/include/SDL_types.h
@@ -0,0 +1,28 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_types.h
+ *  @deprecated Use SDL_stdinc.h instead.
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/misc/winutils/include/SDL_version.h b/misc/winutils/include/SDL_version.h
new file mode 100644
index 0000000..fdc17c6
--- /dev/null
+++ b/misc/winutils/include/SDL_version.h
@@ -0,0 +1,91 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_version.h
+ *  This header defines the current SDL version
+ */
+
+#ifndef _SDL_version_h
+#define _SDL_version_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Version Number
+ *  Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+ */
+/*@{*/
+#define SDL_MAJOR_VERSION	1
+#define SDL_MINOR_VERSION	2
+#define SDL_PATCHLEVEL		15
+/*@}*/
+
+typedef struct SDL_version {
+	Uint8 major;
+	Uint8 minor;
+	Uint8 patch;
+} SDL_version;
+
+/**
+ * This macro can be used to fill a version structure with the compile-time
+ * version of the SDL library.
+ */
+#define SDL_VERSION(X)							\
+{									\
+	(X)->major = SDL_MAJOR_VERSION;					\
+	(X)->minor = SDL_MINOR_VERSION;					\
+	(X)->patch = SDL_PATCHLEVEL;					\
+}
+
+/** This macro turns the version numbers into a numeric value:
+ *  (1,2,3) -> (1203)
+ *  This assumes that there will never be more than 100 patchlevels
+ */
+#define SDL_VERSIONNUM(X, Y, Z)						\
+	((X)*1000 + (Y)*100 + (Z))
+
+/** This is the version number macro for the current SDL version */
+#define SDL_COMPILEDVERSION \
+	SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
+
+/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */
+#define SDL_VERSION_ATLEAST(X, Y, Z) \
+	(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
+
+/** This function gets the version of the dynamically linked SDL library.
+ *  it should NOT be used to fill a version structure, instead you should
+ *  use the SDL_Version() macro.
+ */
+extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_version_h */
diff --git a/misc/winutils/include/SDL_video.h b/misc/winutils/include/SDL_video.h
new file mode 100644
index 0000000..f9c4e07
--- /dev/null
+++ b/misc/winutils/include/SDL_video.h
@@ -0,0 +1,951 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** @file SDL_video.h
+ *  Header file for access to the SDL raw framebuffer window
+ */
+
+#ifndef _SDL_video_h
+#define _SDL_video_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Transparency definitions
+ *  These define alpha as the opacity of a surface
+ */
+/*@{*/
+#define SDL_ALPHA_OPAQUE 255
+#define SDL_ALPHA_TRANSPARENT 0
+/*@}*/
+
+/** @name Useful data types */
+/*@{*/
+typedef struct SDL_Rect {
+	Sint16 x, y;
+	Uint16 w, h;
+} SDL_Rect;
+
+typedef struct SDL_Color {
+	Uint8 r;
+	Uint8 g;
+	Uint8 b;
+	Uint8 unused;
+} SDL_Color;
+#define SDL_Colour SDL_Color
+
+typedef struct SDL_Palette {
+	int       ncolors;
+	SDL_Color *colors;
+} SDL_Palette;
+/*@}*/
+
+/** Everything in the pixel format structure is read-only */
+typedef struct SDL_PixelFormat {
+	SDL_Palette *palette;
+	Uint8  BitsPerPixel;
+	Uint8  BytesPerPixel;
+	Uint8  Rloss;
+	Uint8  Gloss;
+	Uint8  Bloss;
+	Uint8  Aloss;
+	Uint8  Rshift;
+	Uint8  Gshift;
+	Uint8  Bshift;
+	Uint8  Ashift;
+	Uint32 Rmask;
+	Uint32 Gmask;
+	Uint32 Bmask;
+	Uint32 Amask;
+
+	/** RGB color key information */
+	Uint32 colorkey;
+	/** Alpha value information (per-surface alpha) */
+	Uint8  alpha;
+} SDL_PixelFormat;
+
+/** This structure should be treated as read-only, except for 'pixels',
+ *  which, if not NULL, contains the raw pixel data for the surface.
+ */
+typedef struct SDL_Surface {
+	Uint32 flags;				/**< Read-only */
+	SDL_PixelFormat *format;		/**< Read-only */
+	int w, h;				/**< Read-only */
+	Uint16 pitch;				/**< Read-only */
+	void *pixels;				/**< Read-write */
+	int offset;				/**< Private */
+
+	/** Hardware-specific surface info */
+	struct private_hwdata *hwdata;
+
+	/** clipping information */
+	SDL_Rect clip_rect;			/**< Read-only */
+	Uint32 unused1;				/**< for binary compatibility */
+
+	/** Allow recursive locks */
+	Uint32 locked;				/**< Private */
+
+	/** info for fast blit mapping to other surfaces */
+	struct SDL_BlitMap *map;		/**< Private */
+
+	/** format version, bumped at every change to invalidate blit maps */
+	unsigned int format_version;		/**< Private */
+
+	/** Reference count -- used when freeing surface */
+	int refcount;				/**< Read-mostly */
+} SDL_Surface;
+
+/** @name SDL_Surface Flags
+ *  These are the currently supported flags for the SDL_surface
+ */
+/*@{*/
+
+/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
+/*@{*/
+#define SDL_SWSURFACE	0x00000000	/**< Surface is in system memory */
+#define SDL_HWSURFACE	0x00000001	/**< Surface is in video memory */
+#define SDL_ASYNCBLIT	0x00000004	/**< Use asynchronous blits if possible */
+/*@}*/
+
+/** Available for SDL_SetVideoMode() */
+/*@{*/
+#define SDL_ANYFORMAT	0x10000000	/**< Allow any video depth/pixel-format */
+#define SDL_HWPALETTE	0x20000000	/**< Surface has exclusive palette */
+#define SDL_DOUBLEBUF	0x40000000	/**< Set up double-buffered video mode */
+#define SDL_FULLSCREEN	0x80000000	/**< Surface is a full screen display */
+#define SDL_OPENGL      0x00000002      /**< Create an OpenGL rendering context */
+#define SDL_OPENGLBLIT	0x0000000A	/**< Create an OpenGL rendering context and use it for blitting */
+#define SDL_RESIZABLE	0x00000010	/**< This video mode may be resized */
+#define SDL_NOFRAME	0x00000020	/**< No window caption or edge frame */
+/*@}*/
+
+/** Used internally (read-only) */
+/*@{*/
+#define SDL_HWACCEL	0x00000100	/**< Blit uses hardware acceleration */
+#define SDL_SRCCOLORKEY	0x00001000	/**< Blit uses a source color key */
+#define SDL_RLEACCELOK	0x00002000	/**< Private flag */
+#define SDL_RLEACCEL	0x00004000	/**< Surface is RLE encoded */
+#define SDL_SRCALPHA	0x00010000	/**< Blit uses source alpha blending */
+#define SDL_PREALLOC	0x01000000	/**< Surface uses preallocated memory */
+/*@}*/
+
+/*@}*/
+
+/** Evaluates to true if the surface needs to be locked before access */
+#define SDL_MUSTLOCK(surface)	\
+  (surface->offset ||		\
+  ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
+
+/** typedef for private surface blitting functions */
+typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
+			struct SDL_Surface *dst, SDL_Rect *dstrect);
+
+
+/** Useful for determining the video hardware capabilities */
+typedef struct SDL_VideoInfo {
+	Uint32 hw_available :1;	/**< Flag: Can you create hardware surfaces? */
+	Uint32 wm_available :1;	/**< Flag: Can you talk to a window manager? */
+	Uint32 UnusedBits1  :6;
+	Uint32 UnusedBits2  :1;
+	Uint32 blit_hw      :1;	/**< Flag: Accelerated blits HW --> HW */
+	Uint32 blit_hw_CC   :1;	/**< Flag: Accelerated blits with Colorkey */
+	Uint32 blit_hw_A    :1;	/**< Flag: Accelerated blits with Alpha */
+	Uint32 blit_sw      :1;	/**< Flag: Accelerated blits SW --> HW */
+	Uint32 blit_sw_CC   :1;	/**< Flag: Accelerated blits with Colorkey */
+	Uint32 blit_sw_A    :1;	/**< Flag: Accelerated blits with Alpha */
+	Uint32 blit_fill    :1;	/**< Flag: Accelerated color fill */
+	Uint32 UnusedBits3  :16;
+	Uint32 video_mem;	/**< The total amount of video memory (in K) */
+	SDL_PixelFormat *vfmt;	/**< Value: The format of the video surface */
+	int    current_w;	/**< Value: The current video mode width */
+	int    current_h;	/**< Value: The current video mode height */
+} SDL_VideoInfo;
+
+
+/** @name Overlay Formats
+ *  The most common video overlay formats.
+ *  For an explanation of these pixel formats, see:
+ *	http://www.webartz.com/fourcc/indexyuv.htm
+ *
+ *  For information on the relationship between color spaces, see:
+ *  http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
+ */
+/*@{*/
+#define SDL_YV12_OVERLAY  0x32315659	/**< Planar mode: Y + V + U  (3 planes) */
+#define SDL_IYUV_OVERLAY  0x56555949	/**< Planar mode: Y + U + V  (3 planes) */
+#define SDL_YUY2_OVERLAY  0x32595559	/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
+#define SDL_UYVY_OVERLAY  0x59565955	/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
+#define SDL_YVYU_OVERLAY  0x55595659	/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
+/*@}*/
+
+/** The YUV hardware video overlay */
+typedef struct SDL_Overlay {
+	Uint32 format;				/**< Read-only */
+	int w, h;				/**< Read-only */
+	int planes;				/**< Read-only */
+	Uint16 *pitches;			/**< Read-only */
+	Uint8 **pixels;				/**< Read-write */
+
+	/** @name Hardware-specific surface info */
+        /*@{*/
+	struct private_yuvhwfuncs *hwfuncs;
+	struct private_yuvhwdata *hwdata;
+        /*@{*/
+
+	/** @name Special flags */
+        /*@{*/
+	Uint32 hw_overlay :1;	/**< Flag: This overlay hardware accelerated? */
+	Uint32 UnusedBits :31;
+        /*@}*/
+} SDL_Overlay;
+
+
+/** Public enumeration for setting the OpenGL window attributes. */
+typedef enum {
+    SDL_GL_RED_SIZE,
+    SDL_GL_GREEN_SIZE,
+    SDL_GL_BLUE_SIZE,
+    SDL_GL_ALPHA_SIZE,
+    SDL_GL_BUFFER_SIZE,
+    SDL_GL_DOUBLEBUFFER,
+    SDL_GL_DEPTH_SIZE,
+    SDL_GL_STENCIL_SIZE,
+    SDL_GL_ACCUM_RED_SIZE,
+    SDL_GL_ACCUM_GREEN_SIZE,
+    SDL_GL_ACCUM_BLUE_SIZE,
+    SDL_GL_ACCUM_ALPHA_SIZE,
+    SDL_GL_STEREO,
+    SDL_GL_MULTISAMPLEBUFFERS,
+    SDL_GL_MULTISAMPLESAMPLES,
+    SDL_GL_ACCELERATED_VISUAL,
+    SDL_GL_SWAP_CONTROL
+} SDL_GLattr;
+
+/** @name flags for SDL_SetPalette() */
+/*@{*/
+#define SDL_LOGPAL 0x01
+#define SDL_PHYSPAL 0x02
+/*@}*/
+
+/* Function prototypes */
+
+/**
+ * @name Video Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the video driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+/**
+ * Initializes the video subsystem. Sets up a connection
+ * to the window manager, etc, and determines the current video mode and
+ * pixel format, but does not initialize a window or graphics mode.
+ * Note that event handling is activated by this routine.
+ *
+ * If you use both sound and video in your application, you need to call
+ * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
+ * you won't be able to set full-screen display modes.
+ */
+extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
+extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * video driver, and returns a pointer to it if the video driver has
+ * been initialized.  It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function returns a pointer to the current display surface.
+ * If SDL is doing format conversion on the display surface, this
+ * function returns the publicly visible surface, not the real video
+ * surface.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
+
+/**
+ * This function returns a read-only pointer to information about the
+ * video hardware.  If this is called before SDL_SetVideoMode(), the 'vfmt'
+ * member of the returned structure will contain the pixel format of the
+ * "best" video mode.
+ */
+extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
+
+/**
+ * Check to see if a particular video mode is supported.
+ * It returns 0 if the requested mode is not supported under any bit depth,
+ * or returns the bits-per-pixel of the closest available mode with the
+ * given width and height.  If this bits-per-pixel is different from the
+ * one used when setting the video mode, SDL_SetVideoMode() will succeed,
+ * but will emulate the requested bits-per-pixel with a shadow surface.
+ *
+ * The arguments to SDL_VideoModeOK() are the same ones you would pass to
+ * SDL_SetVideoMode()
+ */
+extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
+
+/**
+ * Return a pointer to an array of available screen dimensions for the
+ * given format and video flags, sorted largest to smallest.  Returns 
+ * NULL if there are no dimensions available for a particular format, 
+ * or (SDL_Rect **)-1 if any dimension is okay for the given format.
+ *
+ * If 'format' is NULL, the mode list will be for the format given 
+ * by SDL_GetVideoInfo()->vfmt
+ */
+extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
+
+/**
+ * Set up a video mode with the specified width, height and bits-per-pixel.
+ *
+ * If 'bpp' is 0, it is treated as the current display bits per pixel.
+ *
+ * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
+ * requested bits-per-pixel, but will return whatever video pixel format is
+ * available.  The default is to emulate the requested pixel format if it
+ * is not natively available.
+ *
+ * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
+ * video memory, if possible, and you may have to call SDL_LockSurface()
+ * in order to access the raw framebuffer.  Otherwise, the video surface
+ * will be created in system memory.
+ *
+ * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
+ * updates asynchronously, but you must always lock before accessing pixels.
+ * SDL will wait for updates to complete before returning from the lock.
+ *
+ * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
+ * that the colors set by SDL_SetColors() will be the colors you get.
+ * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
+ * of the colors exactly the way they are requested, and you should look
+ * at the video surface structure to determine the actual palette.
+ * If SDL cannot guarantee that the colors you request can be set, 
+ * i.e. if the colormap is shared, then the video surface may be created
+ * under emulation in system memory, overriding the SDL_HWSURFACE flag.
+ *
+ * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
+ * a fullscreen video mode.  The default is to create a windowed mode
+ * if the current graphics system has a window manager.
+ * If the SDL library is able to set a fullscreen video mode, this flag 
+ * will be set in the surface that is returned.
+ *
+ * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
+ * two surfaces in video memory and swap between them when you call 
+ * SDL_Flip().  This is usually slower than the normal single-buffering
+ * scheme, but prevents "tearing" artifacts caused by modifying video 
+ * memory while the monitor is refreshing.  It should only be used by 
+ * applications that redraw the entire screen on every update.
+ *
+ * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
+ * window manager, if any, to resize the window at runtime.  When this
+ * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
+ * and you must respond to the event by re-calling SDL_SetVideoMode()
+ * with the requested size (or another size that suits the application).
+ *
+ * If SDL_NOFRAME is set in 'flags', the SDL library will create a window
+ * without any title bar or frame decoration.  Fullscreen video modes have
+ * this flag set automatically.
+ *
+ * This function returns the video framebuffer surface, or NULL if it fails.
+ *
+ * If you rely on functionality provided by certain video flags, check the
+ * flags of the returned surface to make sure that functionality is available.
+ * SDL will fall back to reduced functionality if the exact flags you wanted
+ * are not available.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
+			(int width, int height, int bpp, Uint32 flags);
+
+/** @name SDL_Update Functions
+ * These functions should not be called while 'screen' is locked.
+ */
+/*@{*/
+/**
+ * Makes sure the given list of rectangles is updated on the given screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRects
+		(SDL_Surface *screen, int numrects, SDL_Rect *rects);
+/**
+ * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
+ * screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRect
+		(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
+/*@}*/
+
+/**
+ * On hardware that supports double-buffering, this function sets up a flip
+ * and returns.  The hardware will wait for vertical retrace, and then swap
+ * video buffers before the next video surface blit or lock will return.
+ * On hardware that doesn not support double-buffering, this is equivalent
+ * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
+ * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
+ * setting the video mode for this function to perform hardware flipping.
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
+
+/**
+ * Set the gamma correction for each of the color channels.
+ * The gamma values range (approximately) between 0.1 and 10.0
+ * 
+ * If this function isn't supported directly by the hardware, it will
+ * be emulated using gamma ramps, if available.  If successful, this
+ * function returns 0, otherwise it returns -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
+
+/**
+ * Set the gamma translation table for the red, green, and blue channels
+ * of the video hardware.  Each table is an array of 256 16-bit quantities,
+ * representing a mapping between the input and output for that channel.
+ * The input is the index into the array, and the output is the 16-bit
+ * gamma value at that index, scaled to the output color precision.
+ * 
+ * You may pass NULL for any of the channels to leave it unchanged.
+ * If the call succeeds, it will return 0.  If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
+
+/**
+ * Retrieve the current values of the gamma translation tables.
+ * 
+ * You must pass in valid pointers to arrays of 256 16-bit quantities.
+ * Any of the pointers may be NULL to ignore that channel.
+ * If the call succeeds, it will return 0.  If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
+
+/**
+ * Sets a portion of the colormap for the given 8-bit surface.  If 'surface'
+ * is not a palettized surface, this function does nothing, returning 0.
+ * If all of the colors were set as passed to SDL_SetColors(), it will
+ * return 1.  If not all the color entries were set exactly as given,
+ * it will return 0, and you should look at the surface palette to
+ * determine the actual color palette.
+ *
+ * When 'surface' is the surface associated with the current display, the
+ * display colormap will be updated with the requested colors.  If 
+ * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
+ * will always return 1, and the palette is guaranteed to be set the way
+ * you desire, even if the window colormap has to be warped or run under
+ * emulation.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, 
+			SDL_Color *colors, int firstcolor, int ncolors);
+
+/**
+ * Sets a portion of the colormap for a given 8-bit surface.
+ * 'flags' is one or both of:
+ * SDL_LOGPAL  -- set logical palette, which controls how blits are mapped
+ *                to/from the surface,
+ * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
+ *                the screen
+ * Only screens have physical palettes. Separate change of physical/logical
+ * palettes is only possible if the screen has SDL_HWPALETTE set.
+ *
+ * The return value is 1 if all colours could be set as requested, and 0
+ * otherwise.
+ *
+ * SDL_SetColors() is equivalent to calling this function with
+ *     flags = (SDL_LOGPAL|SDL_PHYSPAL).
+ */
+extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
+				   SDL_Color *colors, int firstcolor,
+				   int ncolors);
+
+/**
+ * Maps an RGB triple to an opaque pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b);
+
+/**
+ * Maps an RGBA quadruple to a pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
+
+/**
+ * Maps a pixel value into the RGB components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
+				const SDL_PixelFormat * const fmt,
+				Uint8 *r, Uint8 *g, Uint8 *b);
+
+/**
+ * Maps a pixel value into the RGBA components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
+				const SDL_PixelFormat * const fmt,
+				Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
+
+/** @sa SDL_CreateRGBSurface */
+#define SDL_AllocSurface    SDL_CreateRGBSurface
+/**
+ * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
+ * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
+ * If the depth is greater than 8 bits, the pixel format is set using the
+ * flags '[RGB]mask'.
+ * If the function runs out of memory, it will return NULL.
+ *
+ * The 'flags' tell what kind of surface to create.
+ * SDL_SWSURFACE means that the surface should be created in system memory.
+ * SDL_HWSURFACE means that the surface should be created in video memory,
+ * with the same format as the display surface.  This is useful for surfaces
+ * that will not change much, to take advantage of hardware acceleration
+ * when being blitted to the display surface.
+ * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
+ * this surface, but you must always lock it before accessing the pixels.
+ * SDL will wait for current blits to finish before returning from the lock.
+ * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
+ * If the hardware supports acceleration of colorkey blits between
+ * two surfaces in video memory, SDL will try to place the surface in
+ * video memory. If this isn't possible or if there is no hardware
+ * acceleration available, the surface will be placed in system memory.
+ * SDL_SRCALPHA means that the surface will be used for alpha blits and 
+ * if the hardware supports hardware acceleration of alpha blits between
+ * two surfaces in video memory, to place the surface in video memory
+ * if possible, otherwise it will be placed in system memory.
+ * If the surface is created in video memory, blits will be _much_ faster,
+ * but the surface format must be identical to the video surface format,
+ * and the only way to access the pixels member of the surface is to use
+ * the SDL_LockSurface() and SDL_UnlockSurface() calls.
+ * If the requested surface actually resides in video memory, SDL_HWSURFACE
+ * will be set in the flags member of the returned surface.  If for some
+ * reason the surface could not be placed in video memory, it will not have
+ * the SDL_HWSURFACE flag set, and will be created in system memory instead.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
+			(Uint32 flags, int width, int height, int depth, 
+			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+/** @sa SDL_CreateRGBSurface */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
+			int width, int height, int depth, int pitch,
+			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
+
+/**
+ * SDL_LockSurface() sets up a surface for directly accessing the pixels.
+ * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
+ * to and read from 'surface->pixels', using the pixel format stored in 
+ * 'surface->format'.  Once you are done accessing the surface, you should 
+ * use SDL_UnlockSurface() to release it.
+ *
+ * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
+ * to 0, then you can read and write to the surface at any time, and the
+ * pixel format of the surface will not change.  In particular, if the
+ * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
+ * will not need to lock the display surface before accessing it.
+ * 
+ * No operating system or library calls should be made between lock/unlock
+ * pairs, as critical system locks may be held during this time.
+ *
+ * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
+ */
+extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
+extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
+
+/**
+ * Load a surface from a seekable SDL data source (memory or file.)
+ * If 'freesrc' is non-zero, the source will be closed after being read.
+ * Returns the new surface, or NULL if there was an error.
+ * The new surface should be freed with SDL_FreeSurface().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
+
+/** Convenience macro -- load a surface from a file */
+#define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
+
+/**
+ * Save a surface to a seekable SDL data source (memory or file.)
+ * If 'freedst' is non-zero, the source will be closed after being written.
+ * Returns 0 if successful or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
+		(SDL_Surface *surface, SDL_RWops *dst, int freedst);
+
+/** Convenience macro -- save a surface to a file */
+#define SDL_SaveBMP(surface, file) \
+		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
+
+/**
+ * Sets the color key (transparent pixel) in a blittable surface.
+ * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
+ * 'key' will be the transparent pixel in the source image of a blit.
+ * SDL_RLEACCEL requests RLE acceleration for the surface if present,
+ * and removes RLE acceleration if absent.
+ * If 'flag' is 0, this function clears any current color key.
+ * This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColorKey
+			(SDL_Surface *surface, Uint32 flag, Uint32 key);
+
+/**
+ * This function sets the alpha value for the entire surface, as opposed to
+ * using the alpha component of each pixel. This value measures the range
+ * of transparency of the surface, 0 being completely transparent to 255
+ * being completely opaque. An 'alpha' value of 255 causes blits to be
+ * opaque, the source pixels copied to the destination (the default). Note
+ * that per-surface alpha can be combined with colorkey transparency.
+ *
+ * If 'flag' is 0, alpha blending is disabled for the surface.
+ * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
+ * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
+ * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
+ *
+ * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
+ */
+extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
+
+/**
+ * Sets the clipping rectangle for the destination surface in a blit.
+ *
+ * If the clip rectangle is NULL, clipping will be disabled.
+ * If the clip rectangle doesn't intersect the surface, the function will
+ * return SDL_FALSE and blits will be completely clipped.  Otherwise the
+ * function returns SDL_TRUE and blits to the surface will be clipped to
+ * the intersection of the surface area and the clipping rectangle.
+ *
+ * Note that blits are automatically clipped to the edges of the source
+ * and destination surfaces.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
+
+/**
+ * Gets the clipping rectangle for the destination surface in a blit.
+ * 'rect' must be a pointer to a valid rectangle which will be filled
+ * with the correct values.
+ */
+extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
+
+/**
+ * Creates a new surface of the specified format, and then copies and maps 
+ * the given surface to it so the blit of the converted surface will be as 
+ * fast as possible.  If this function fails, it returns NULL.
+ *
+ * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
+ * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
+ * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
+ * surface.
+ *
+ * This function is used internally by SDL_DisplayFormat().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
+			(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
+
+/**
+ * This performs a fast blit from the source surface to the destination
+ * surface.  It assumes that the source and destination rectangles are
+ * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
+ * surface (src or dst) is copied.  The final blit rectangles are saved
+ * in 'srcrect' and 'dstrect' after all clipping is performed.
+ * If the blit is successful, it returns 0, otherwise it returns -1.
+ *
+ * The blit function should not be called on a locked surface.
+ *
+ * The blit semantics for surfaces with and without alpha and colorkey
+ * are defined as follows:
+ *
+ * RGBA->RGB:
+ *     SDL_SRCALPHA set:
+ * 	alpha-blend (using alpha-channel).
+ * 	SDL_SRCCOLORKEY ignored.
+ *     SDL_SRCALPHA not set:
+ * 	copy RGB.
+ * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * 	RGB values of the source colour key, ignoring alpha in the
+ * 	comparison.
+ * 
+ * RGB->RGBA:
+ *     SDL_SRCALPHA set:
+ * 	alpha-blend (using the source per-surface alpha value);
+ * 	set destination alpha to opaque.
+ *     SDL_SRCALPHA not set:
+ * 	copy RGB, set destination alpha to source per-surface alpha value.
+ *     both:
+ * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * 	source colour key.
+ * 
+ * RGBA->RGBA:
+ *     SDL_SRCALPHA set:
+ * 	alpha-blend (using the source alpha channel) the RGB values;
+ * 	leave destination alpha untouched. [Note: is this correct?]
+ * 	SDL_SRCCOLORKEY ignored.
+ *     SDL_SRCALPHA not set:
+ * 	copy all of RGBA to the destination.
+ * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * 	RGB values of the source colour key, ignoring alpha in the
+ * 	comparison.
+ * 
+ * RGB->RGB: 
+ *     SDL_SRCALPHA set:
+ * 	alpha-blend (using the source per-surface alpha value).
+ *     SDL_SRCALPHA not set:
+ * 	copy RGB.
+ *     both:
+ * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * 	source colour key.
+ *
+ * If either of the surfaces were in video memory, and the blit returns -2,
+ * the video memory was lost, so it should be reloaded with artwork and 
+ * re-blitted:
+ * @code
+ *	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ *		while ( SDL_LockSurface(image) < 0 )
+ *			Sleep(10);
+ *		-- Write image pixels to image->pixels --
+ *		SDL_UnlockSurface(image);
+ *	}
+ * @endcode
+ *
+ * This happens under DirectX 5.0 when the system switches away from your
+ * fullscreen application.  The lock will also fail until you have access
+ * to the video memory again.
+ *
+ * You should call SDL_BlitSurface() unless you know exactly how SDL
+ * blitting works internally and how to use the other blit functions.
+ */
+#define SDL_BlitSurface SDL_UpperBlit
+
+/** This is the public blit function, SDL_BlitSurface(), and it performs
+ *  rectangle validation and clipping before passing it to SDL_LowerBlit()
+ */
+extern DECLSPEC int SDLCALL SDL_UpperBlit
+			(SDL_Surface *src, SDL_Rect *srcrect,
+			 SDL_Surface *dst, SDL_Rect *dstrect);
+/** This is a semi-private blit function and it performs low-level surface
+ *  blitting only.
+ */
+extern DECLSPEC int SDLCALL SDL_LowerBlit
+			(SDL_Surface *src, SDL_Rect *srcrect,
+			 SDL_Surface *dst, SDL_Rect *dstrect);
+
+/**
+ * This function performs a fast fill of the given rectangle with 'color'
+ * The given rectangle is clipped to the destination surface clip area
+ * and the final fill rectangle is saved in the passed in pointer.
+ * If 'dstrect' is NULL, the whole surface will be filled with 'color'
+ * The color should be a pixel of the format used by the surface, and 
+ * can be generated by the SDL_MapRGB() function.
+ * This function returns 0 on success, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_FillRect
+		(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer, suitable for fast
+ * blitting onto the display surface.  It calls SDL_ConvertSurface()
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer (if possible),
+ * suitable for fast alpha blitting onto the display surface.
+ * The new surface will always have an alpha channel.
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name YUV video surface overlay functions                                */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** This function creates a video output overlay
+ *  Calling the returned surface an overlay is something of a misnomer because
+ *  the contents of the display surface underneath the area where the overlay
+ *  is shown is undefined - it may be overwritten with the converted YUV data.
+ */
+extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
+				Uint32 format, SDL_Surface *display);
+
+/** Lock an overlay for direct access, and unlock it when you are done */
+extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
+extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
+
+/** Blit a video overlay to the display surface.
+ *  The contents of the video surface underneath the blit destination are
+ *  not defined.  
+ *  The width and height of the destination rectangle may be different from
+ *  that of the overlay, but currently only 2x scaling is supported.
+ */
+extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
+
+/** Free a video overlay */
+extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name OpenGL support functions.                                          */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Dynamically load an OpenGL library, or the default one if path is NULL
+ *
+ * If you do this, you need to retrieve all of the GL functions used in
+ * your program from the dynamic library using SDL_GL_GetProcAddress().
+ */
+extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
+
+/**
+ * Get the address of a GL function
+ */
+extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
+
+/**
+ * Set an attribute of the OpenGL subsystem before intialization.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
+
+/**
+ * Get an attribute of the OpenGL subsystem from the windowing
+ * interface, such as glX. This is of course different from getting
+ * the values from SDL's internal OpenGL subsystem, which only
+ * stores the values you request before initialization.
+ *
+ * Developers should track the values they pass into SDL_GL_SetAttribute
+ * themselves if they want to retrieve these values.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
+
+/**
+ * Swap the OpenGL buffers, if double-buffering is supported.
+ */
+extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
+
+/** @name OpenGL Internal Functions
+ * Internal functions that should not be called unless you have read
+ * and understood the source code for these functions.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
+extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
+extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
+/*@}*/
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Window Manager Functions                                           */
+/** These functions allow interaction with the window manager, if any.       */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Sets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
+/**
+ * Gets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
+
+/**
+ * Sets the icon for the display window.
+ * This function must be called before the first call to SDL_SetVideoMode().
+ * It takes an icon surface, and a mask in MSB format.
+ * If 'mask' is NULL, the entire icon surface will be used as the icon.
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
+
+/**
+ * This function iconifies the window, and returns 1 if it succeeded.
+ * If the function succeeds, it generates an SDL_APPACTIVE loss event.
+ * This function is a noop and returns 0 in non-windowed environments.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
+
+/**
+ * Toggle fullscreen mode without changing the contents of the screen.
+ * If the display surface does not require locking before accessing
+ * the pixel information, then the memory pointers will not change.
+ *
+ * If this function was able to toggle fullscreen mode (change from 
+ * running in a window to fullscreen, or vice-versa), it will return 1.
+ * If it is not implemented, or fails, it returns 0.
+ *
+ * The next call to SDL_SetVideoMode() will set the mode fullscreen
+ * attribute based on the flags parameter - if SDL_FULLSCREEN is not
+ * set, then the display will be windowed by default where supported.
+ *
+ * This is currently only implemented in the X11 video driver.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
+
+typedef enum {
+	SDL_GRAB_QUERY = -1,
+	SDL_GRAB_OFF = 0,
+	SDL_GRAB_ON = 1,
+	SDL_GRAB_FULLSCREEN	/**< Used internally */
+} SDL_GrabMode;
+/**
+ * This function allows you to set and query the input grab state of
+ * the application.  It returns the new input grab state.
+ *
+ * Grabbing means that the mouse is confined to the application window,
+ * and nearly all keyboard input is passed directly to the application,
+ * and not interpreted by a window manager, if any.
+ */
+extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
+
+/*@}*/
+
+/** @internal Not in public API at the moment - do not use! */
+extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
+                                    SDL_Surface *dst, SDL_Rect *dstrect);
+                    
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/misc/winutils/include/begin_code.h b/misc/winutils/include/begin_code.h
new file mode 100644
index 0000000..27e2f7b
--- /dev/null
+++ b/misc/winutils/include/begin_code.h
@@ -0,0 +1,196 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/** 
+ *  @file begin_code.h
+ *  This file sets things up for C dynamic library function definitions,
+ *  static inlined functions, and structures aligned at 4-byte alignment.
+ *  If you don't like ugly C preprocessor code, don't look at this file. :)
+ */
+
+/** 
+ *  @file begin_code.h
+ *  This shouldn't be nested -- included it around code only.
+ */
+#ifdef _begin_code_h
+#error Nested inclusion of begin_code.h
+#endif
+#define _begin_code_h
+
+/** 
+ *  @def DECLSPEC
+ *  Some compilers use a special export keyword
+ */
+#ifndef DECLSPEC
+# if defined(__BEOS__) || defined(__HAIKU__)
+#  if defined(__GNUC__)
+#   define DECLSPEC
+#  else
+#   define DECLSPEC	__declspec(export)
+#  endif
+# elif defined(__WIN32__)
+#  ifdef __BORLANDC__
+#   ifdef BUILD_SDL
+#    define DECLSPEC 
+#   else
+#    define DECLSPEC	__declspec(dllimport)
+#   endif
+#  else
+#   define DECLSPEC	__declspec(dllexport)
+#  endif
+# elif defined(__OS2__)
+#  ifdef __WATCOMC__
+#   ifdef BUILD_SDL
+#    define DECLSPEC	__declspec(dllexport)
+#   else
+#    define DECLSPEC
+#   endif
+#  elif defined (__GNUC__) && __GNUC__ < 4
+#   /* Added support for GCC-EMX <v4.x */
+#   /* this is needed for XFree86/OS2 developement */
+#   /* F. Ambacher(anakor at snafu.de) 05.2008 */
+#   ifdef BUILD_SDL
+#    define DECLSPEC    __declspec(dllexport)
+#   else
+#    define DECLSPEC
+#   endif
+#  else
+#   define DECLSPEC
+#  endif
+# else
+#  if defined(__GNUC__) && __GNUC__ >= 4
+#   define DECLSPEC	__attribute__ ((visibility("default")))
+#  else
+#   define DECLSPEC
+#  endif
+# endif
+#endif
+
+/** 
+ *  @def SDLCALL
+ *  By default SDL uses the C calling convention
+ */
+#ifndef SDLCALL
+# if defined(__WIN32__) && !defined(__GNUC__)
+#  define SDLCALL __cdecl
+# elif defined(__OS2__)
+#  if defined (__GNUC__) && __GNUC__ < 4
+#   /* Added support for GCC-EMX <v4.x */
+#   /* this is needed for XFree86/OS2 developement */
+#   /* F. Ambacher(anakor at snafu.de) 05.2008 */
+#   define SDLCALL _cdecl
+#  else
+#   /* On other compilers on OS/2, we use the _System calling convention */
+#   /* to be compatible with every compiler */
+#   define SDLCALL _System
+#  endif
+# else
+#  define SDLCALL
+# endif
+#endif /* SDLCALL */
+
+#ifdef __SYMBIAN32__ 
+#ifndef EKA2 
+#undef DECLSPEC
+#define DECLSPEC
+#elif !defined(__WINS__)
+#undef DECLSPEC
+#define DECLSPEC __declspec(dllexport)
+#endif /* !EKA2 */
+#endif /* __SYMBIAN32__ */
+
+/**
+ *  @file begin_code.h
+ *  Force structure packing at 4 byte alignment.
+ *  This is necessary if the header is included in code which has structure
+ *  packing set to an alternate value, say for loading structures from disk.
+ *  The packing is reset to the previous value in close_code.h 
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
+#ifdef _MSC_VER
+#pragma warning(disable: 4103)
+#endif
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#ifdef _M_X64
+/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
+#pragma pack(push,8)
+#else
+#pragma pack(push,4)
+#endif
+#elif (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=mac68k4byte
+#pragma enumsalwaysint on
+#endif /* Compiler needs structure packing set */
+
+/**
+ *  @def SDL_INLINE_OKAY
+ *  Set up compiler-specific options for inlining functions
+ */
+#ifndef SDL_INLINE_OKAY
+#ifdef __GNUC__
+#define SDL_INLINE_OKAY
+#else
+/* Add any special compiler-specific cases here */
+#if defined(_MSC_VER) || defined(__BORLANDC__) || \
+    defined(__DMC__) || defined(__SC__) || \
+    defined(__WATCOMC__) || defined(__LCC__) || \
+    defined(__DECC) || defined(__EABI__)
+#ifndef __inline__
+#define __inline__	__inline
+#endif
+#define SDL_INLINE_OKAY
+#else
+#if !defined(__MRC__) && !defined(_SGI_SOURCE)
+#ifndef __inline__
+#define __inline__ inline
+#endif
+#define SDL_INLINE_OKAY
+#endif /* Not a funky compiler */
+#endif /* Visual C++ */
+#endif /* GNU C */
+#endif /* SDL_INLINE_OKAY */
+
+/**
+ *  @def __inline__
+ *  If inlining isn't supported, remove "__inline__", turning static
+ *  inlined functions into static functions (resulting in code bloat
+ *  in all files which include the offending header files)
+ */
+#ifndef SDL_INLINE_OKAY
+#define __inline__
+#endif
+
+/**
+ *  @def NULL
+ *  Apparently this is needed by several Windows compilers
+ */
+#if !defined(__MACH__)
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif /* NULL */
+#endif /* ! Mac OS X - breaks precompiled headers */
diff --git a/misc/winutils/include/close_code.h b/misc/winutils/include/close_code.h
new file mode 100644
index 0000000..19a0024
--- /dev/null
+++ b/misc/winutils/include/close_code.h
@@ -0,0 +1,46 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2012 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken at libsdl.org
+*/
+
+/**
+ *  @file close_code.h
+ *  This file reverses the effects of begin_code.h and should be included
+ *  after you finish any function and structure declarations in your headers
+ */
+
+#undef _begin_code_h
+
+/**
+ *  @file close_code.h
+ *  Reset structure packing at previous byte alignment
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__)  || defined(__BORLANDC__)
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#if (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=reset
+#pragma enumsalwaysint reset
+#else
+#pragma pack(pop)
+#endif
+#endif /* Compiler needs structure packing set */
+
diff --git a/misc/winutils/include/libavcodec/avcodec.h b/misc/winutils/include/libavcodec/avcodec.h
new file mode 100644
index 0000000..cda6703
--- /dev/null
+++ b/misc/winutils/include/libavcodec/avcodec.h
@@ -0,0 +1,4604 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVCODEC_H
+#define AVCODEC_AVCODEC_H
+
+/**
+ * @file
+ * external API header
+ */
+
+#include <errno.h>
+#include "libavutil/samplefmt.h"
+#include "libavutil/avutil.h"
+#include "libavutil/cpu.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+#include "libavutil/pixfmt.h"
+#include "libavutil/rational.h"
+
+#include "libavcodec/version.h"
+/**
+ * @defgroup libavc Encoding/Decoding Library
+ * @{
+ *
+ * @defgroup lavc_decoding Decoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_encoding Encoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_codec Codecs
+ * @{
+ * @defgroup lavc_codec_native Native Codecs
+ * @{
+ * @}
+ * @defgroup lavc_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
+ * @{
+ * @}
+ * @}
+ * @defgroup lavc_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+/**
+ * @defgroup lavc_core Core functions/structures.
+ * @ingroup libavc
+ *
+ * Basic definitions, functions for querying libavcodec capabilities,
+ * allocating core structures, etc.
+ * @{
+ */
+
+
+/**
+ * Identify the syntax and semantics of the bitstream.
+ * The principle is roughly:
+ * Two decoders with the same ID can decode the same streams.
+ * Two encoders with the same ID can encode compatible streams.
+ * There may be slight deviations from the principle due to implementation
+ * details.
+ *
+ * If you add a codec ID to this list, add it so that
+ * 1. no value of a existing codec ID changes (that would break ABI),
+ * 2. it is as close as possible to similar codecs.
+ *
+ * After adding new codec IDs, do not forget to add an entry to the codec
+ * descriptor list and bump libavcodec minor version.
+ */
+enum AVCodecID {
+    AV_CODEC_ID_NONE,
+
+    /* video codecs */
+    AV_CODEC_ID_MPEG1VIDEO,
+    AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+    AV_CODEC_ID_MPEG2VIDEO_XVMC,
+    AV_CODEC_ID_H261,
+    AV_CODEC_ID_H263,
+    AV_CODEC_ID_RV10,
+    AV_CODEC_ID_RV20,
+    AV_CODEC_ID_MJPEG,
+    AV_CODEC_ID_MJPEGB,
+    AV_CODEC_ID_LJPEG,
+    AV_CODEC_ID_SP5X,
+    AV_CODEC_ID_JPEGLS,
+    AV_CODEC_ID_MPEG4,
+    AV_CODEC_ID_RAWVIDEO,
+    AV_CODEC_ID_MSMPEG4V1,
+    AV_CODEC_ID_MSMPEG4V2,
+    AV_CODEC_ID_MSMPEG4V3,
+    AV_CODEC_ID_WMV1,
+    AV_CODEC_ID_WMV2,
+    AV_CODEC_ID_H263P,
+    AV_CODEC_ID_H263I,
+    AV_CODEC_ID_FLV1,
+    AV_CODEC_ID_SVQ1,
+    AV_CODEC_ID_SVQ3,
+    AV_CODEC_ID_DVVIDEO,
+    AV_CODEC_ID_HUFFYUV,
+    AV_CODEC_ID_CYUV,
+    AV_CODEC_ID_H264,
+    AV_CODEC_ID_INDEO3,
+    AV_CODEC_ID_VP3,
+    AV_CODEC_ID_THEORA,
+    AV_CODEC_ID_ASV1,
+    AV_CODEC_ID_ASV2,
+    AV_CODEC_ID_FFV1,
+    AV_CODEC_ID_4XM,
+    AV_CODEC_ID_VCR1,
+    AV_CODEC_ID_CLJR,
+    AV_CODEC_ID_MDEC,
+    AV_CODEC_ID_ROQ,
+    AV_CODEC_ID_INTERPLAY_VIDEO,
+    AV_CODEC_ID_XAN_WC3,
+    AV_CODEC_ID_XAN_WC4,
+    AV_CODEC_ID_RPZA,
+    AV_CODEC_ID_CINEPAK,
+    AV_CODEC_ID_WS_VQA,
+    AV_CODEC_ID_MSRLE,
+    AV_CODEC_ID_MSVIDEO1,
+    AV_CODEC_ID_IDCIN,
+    AV_CODEC_ID_8BPS,
+    AV_CODEC_ID_SMC,
+    AV_CODEC_ID_FLIC,
+    AV_CODEC_ID_TRUEMOTION1,
+    AV_CODEC_ID_VMDVIDEO,
+    AV_CODEC_ID_MSZH,
+    AV_CODEC_ID_ZLIB,
+    AV_CODEC_ID_QTRLE,
+    AV_CODEC_ID_SNOW,
+    AV_CODEC_ID_TSCC,
+    AV_CODEC_ID_ULTI,
+    AV_CODEC_ID_QDRAW,
+    AV_CODEC_ID_VIXL,
+    AV_CODEC_ID_QPEG,
+    AV_CODEC_ID_PNG,
+    AV_CODEC_ID_PPM,
+    AV_CODEC_ID_PBM,
+    AV_CODEC_ID_PGM,
+    AV_CODEC_ID_PGMYUV,
+    AV_CODEC_ID_PAM,
+    AV_CODEC_ID_FFVHUFF,
+    AV_CODEC_ID_RV30,
+    AV_CODEC_ID_RV40,
+    AV_CODEC_ID_VC1,
+    AV_CODEC_ID_WMV3,
+    AV_CODEC_ID_LOCO,
+    AV_CODEC_ID_WNV1,
+    AV_CODEC_ID_AASC,
+    AV_CODEC_ID_INDEO2,
+    AV_CODEC_ID_FRAPS,
+    AV_CODEC_ID_TRUEMOTION2,
+    AV_CODEC_ID_BMP,
+    AV_CODEC_ID_CSCD,
+    AV_CODEC_ID_MMVIDEO,
+    AV_CODEC_ID_ZMBV,
+    AV_CODEC_ID_AVS,
+    AV_CODEC_ID_SMACKVIDEO,
+    AV_CODEC_ID_NUV,
+    AV_CODEC_ID_KMVC,
+    AV_CODEC_ID_FLASHSV,
+    AV_CODEC_ID_CAVS,
+    AV_CODEC_ID_JPEG2000,
+    AV_CODEC_ID_VMNC,
+    AV_CODEC_ID_VP5,
+    AV_CODEC_ID_VP6,
+    AV_CODEC_ID_VP6F,
+    AV_CODEC_ID_TARGA,
+    AV_CODEC_ID_DSICINVIDEO,
+    AV_CODEC_ID_TIERTEXSEQVIDEO,
+    AV_CODEC_ID_TIFF,
+    AV_CODEC_ID_GIF,
+    AV_CODEC_ID_DXA,
+    AV_CODEC_ID_DNXHD,
+    AV_CODEC_ID_THP,
+    AV_CODEC_ID_SGI,
+    AV_CODEC_ID_C93,
+    AV_CODEC_ID_BETHSOFTVID,
+    AV_CODEC_ID_PTX,
+    AV_CODEC_ID_TXD,
+    AV_CODEC_ID_VP6A,
+    AV_CODEC_ID_AMV,
+    AV_CODEC_ID_VB,
+    AV_CODEC_ID_PCX,
+    AV_CODEC_ID_SUNRAST,
+    AV_CODEC_ID_INDEO4,
+    AV_CODEC_ID_INDEO5,
+    AV_CODEC_ID_MIMIC,
+    AV_CODEC_ID_RL2,
+    AV_CODEC_ID_ESCAPE124,
+    AV_CODEC_ID_DIRAC,
+    AV_CODEC_ID_BFI,
+    AV_CODEC_ID_CMV,
+    AV_CODEC_ID_MOTIONPIXELS,
+    AV_CODEC_ID_TGV,
+    AV_CODEC_ID_TGQ,
+    AV_CODEC_ID_TQI,
+    AV_CODEC_ID_AURA,
+    AV_CODEC_ID_AURA2,
+    AV_CODEC_ID_V210X,
+    AV_CODEC_ID_TMV,
+    AV_CODEC_ID_V210,
+    AV_CODEC_ID_DPX,
+    AV_CODEC_ID_MAD,
+    AV_CODEC_ID_FRWU,
+    AV_CODEC_ID_FLASHSV2,
+    AV_CODEC_ID_CDGRAPHICS,
+    AV_CODEC_ID_R210,
+    AV_CODEC_ID_ANM,
+    AV_CODEC_ID_BINKVIDEO,
+    AV_CODEC_ID_IFF_ILBM,
+    AV_CODEC_ID_IFF_BYTERUN1,
+    AV_CODEC_ID_KGV1,
+    AV_CODEC_ID_YOP,
+    AV_CODEC_ID_VP8,
+    AV_CODEC_ID_PICTOR,
+    AV_CODEC_ID_ANSI,
+    AV_CODEC_ID_A64_MULTI,
+    AV_CODEC_ID_A64_MULTI5,
+    AV_CODEC_ID_R10K,
+    AV_CODEC_ID_MXPEG,
+    AV_CODEC_ID_LAGARITH,
+    AV_CODEC_ID_PRORES,
+    AV_CODEC_ID_JV,
+    AV_CODEC_ID_DFA,
+    AV_CODEC_ID_WMV3IMAGE,
+    AV_CODEC_ID_VC1IMAGE,
+    AV_CODEC_ID_UTVIDEO,
+    AV_CODEC_ID_BMV_VIDEO,
+    AV_CODEC_ID_VBLE,
+    AV_CODEC_ID_DXTORY,
+    AV_CODEC_ID_V410,
+    AV_CODEC_ID_XWD,
+    AV_CODEC_ID_CDXL,
+    AV_CODEC_ID_XBM,
+    AV_CODEC_ID_ZEROCODEC,
+    AV_CODEC_ID_MSS1,
+    AV_CODEC_ID_MSA1,
+    AV_CODEC_ID_TSCC2,
+    AV_CODEC_ID_MTS2,
+    AV_CODEC_ID_CLLC,
+    AV_CODEC_ID_MSS2,
+
+    /* various PCM "codecs" */
+    AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
+    AV_CODEC_ID_PCM_S16LE = 0x10000,
+    AV_CODEC_ID_PCM_S16BE,
+    AV_CODEC_ID_PCM_U16LE,
+    AV_CODEC_ID_PCM_U16BE,
+    AV_CODEC_ID_PCM_S8,
+    AV_CODEC_ID_PCM_U8,
+    AV_CODEC_ID_PCM_MULAW,
+    AV_CODEC_ID_PCM_ALAW,
+    AV_CODEC_ID_PCM_S32LE,
+    AV_CODEC_ID_PCM_S32BE,
+    AV_CODEC_ID_PCM_U32LE,
+    AV_CODEC_ID_PCM_U32BE,
+    AV_CODEC_ID_PCM_S24LE,
+    AV_CODEC_ID_PCM_S24BE,
+    AV_CODEC_ID_PCM_U24LE,
+    AV_CODEC_ID_PCM_U24BE,
+    AV_CODEC_ID_PCM_S24DAUD,
+    AV_CODEC_ID_PCM_ZORK,
+    AV_CODEC_ID_PCM_S16LE_PLANAR,
+    AV_CODEC_ID_PCM_DVD,
+    AV_CODEC_ID_PCM_F32BE,
+    AV_CODEC_ID_PCM_F32LE,
+    AV_CODEC_ID_PCM_F64BE,
+    AV_CODEC_ID_PCM_F64LE,
+    AV_CODEC_ID_PCM_BLURAY,
+    AV_CODEC_ID_PCM_LXF,
+    AV_CODEC_ID_S302M,
+    AV_CODEC_ID_PCM_S8_PLANAR,
+
+    /* various ADPCM codecs */
+    AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
+    AV_CODEC_ID_ADPCM_IMA_WAV,
+    AV_CODEC_ID_ADPCM_IMA_DK3,
+    AV_CODEC_ID_ADPCM_IMA_DK4,
+    AV_CODEC_ID_ADPCM_IMA_WS,
+    AV_CODEC_ID_ADPCM_IMA_SMJPEG,
+    AV_CODEC_ID_ADPCM_MS,
+    AV_CODEC_ID_ADPCM_4XM,
+    AV_CODEC_ID_ADPCM_XA,
+    AV_CODEC_ID_ADPCM_ADX,
+    AV_CODEC_ID_ADPCM_EA,
+    AV_CODEC_ID_ADPCM_G726,
+    AV_CODEC_ID_ADPCM_CT,
+    AV_CODEC_ID_ADPCM_SWF,
+    AV_CODEC_ID_ADPCM_YAMAHA,
+    AV_CODEC_ID_ADPCM_SBPRO_4,
+    AV_CODEC_ID_ADPCM_SBPRO_3,
+    AV_CODEC_ID_ADPCM_SBPRO_2,
+    AV_CODEC_ID_ADPCM_THP,
+    AV_CODEC_ID_ADPCM_IMA_AMV,
+    AV_CODEC_ID_ADPCM_EA_R1,
+    AV_CODEC_ID_ADPCM_EA_R3,
+    AV_CODEC_ID_ADPCM_EA_R2,
+    AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
+    AV_CODEC_ID_ADPCM_IMA_EA_EACS,
+    AV_CODEC_ID_ADPCM_EA_XAS,
+    AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
+    AV_CODEC_ID_ADPCM_IMA_ISS,
+    AV_CODEC_ID_ADPCM_G722,
+    AV_CODEC_ID_ADPCM_IMA_APC,
+
+    /* AMR */
+    AV_CODEC_ID_AMR_NB = 0x12000,
+    AV_CODEC_ID_AMR_WB,
+
+    /* RealAudio codecs*/
+    AV_CODEC_ID_RA_144 = 0x13000,
+    AV_CODEC_ID_RA_288,
+
+    /* various DPCM codecs */
+    AV_CODEC_ID_ROQ_DPCM = 0x14000,
+    AV_CODEC_ID_INTERPLAY_DPCM,
+    AV_CODEC_ID_XAN_DPCM,
+    AV_CODEC_ID_SOL_DPCM,
+
+    /* audio codecs */
+    AV_CODEC_ID_MP2 = 0x15000,
+    AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+    AV_CODEC_ID_AAC,
+    AV_CODEC_ID_AC3,
+    AV_CODEC_ID_DTS,
+    AV_CODEC_ID_VORBIS,
+    AV_CODEC_ID_DVAUDIO,
+    AV_CODEC_ID_WMAV1,
+    AV_CODEC_ID_WMAV2,
+    AV_CODEC_ID_MACE3,
+    AV_CODEC_ID_MACE6,
+    AV_CODEC_ID_VMDAUDIO,
+    AV_CODEC_ID_FLAC,
+    AV_CODEC_ID_MP3ADU,
+    AV_CODEC_ID_MP3ON4,
+    AV_CODEC_ID_SHORTEN,
+    AV_CODEC_ID_ALAC,
+    AV_CODEC_ID_WESTWOOD_SND1,
+    AV_CODEC_ID_GSM, ///< as in Berlin toast format
+    AV_CODEC_ID_QDM2,
+    AV_CODEC_ID_COOK,
+    AV_CODEC_ID_TRUESPEECH,
+    AV_CODEC_ID_TTA,
+    AV_CODEC_ID_SMACKAUDIO,
+    AV_CODEC_ID_QCELP,
+    AV_CODEC_ID_WAVPACK,
+    AV_CODEC_ID_DSICINAUDIO,
+    AV_CODEC_ID_IMC,
+    AV_CODEC_ID_MUSEPACK7,
+    AV_CODEC_ID_MLP,
+    AV_CODEC_ID_GSM_MS, /* as found in WAV */
+    AV_CODEC_ID_ATRAC3,
+    AV_CODEC_ID_VOXWARE,
+    AV_CODEC_ID_APE,
+    AV_CODEC_ID_NELLYMOSER,
+    AV_CODEC_ID_MUSEPACK8,
+    AV_CODEC_ID_SPEEX,
+    AV_CODEC_ID_WMAVOICE,
+    AV_CODEC_ID_WMAPRO,
+    AV_CODEC_ID_WMALOSSLESS,
+    AV_CODEC_ID_ATRAC3P,
+    AV_CODEC_ID_EAC3,
+    AV_CODEC_ID_SIPR,
+    AV_CODEC_ID_MP1,
+    AV_CODEC_ID_TWINVQ,
+    AV_CODEC_ID_TRUEHD,
+    AV_CODEC_ID_MP4ALS,
+    AV_CODEC_ID_ATRAC1,
+    AV_CODEC_ID_BINKAUDIO_RDFT,
+    AV_CODEC_ID_BINKAUDIO_DCT,
+    AV_CODEC_ID_AAC_LATM,
+    AV_CODEC_ID_QDMC,
+    AV_CODEC_ID_CELT,
+    AV_CODEC_ID_G723_1,
+    AV_CODEC_ID_G729,
+    AV_CODEC_ID_8SVX_EXP,
+    AV_CODEC_ID_8SVX_FIB,
+    AV_CODEC_ID_BMV_AUDIO,
+    AV_CODEC_ID_RALF,
+    AV_CODEC_ID_IAC,
+    AV_CODEC_ID_ILBC,
+    AV_CODEC_ID_OPUS,
+
+    /* subtitle codecs */
+    AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
+    AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
+    AV_CODEC_ID_DVB_SUBTITLE,
+    AV_CODEC_ID_TEXT,  ///< raw UTF-8 text
+    AV_CODEC_ID_XSUB,
+    AV_CODEC_ID_SSA,
+    AV_CODEC_ID_MOV_TEXT,
+    AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+    AV_CODEC_ID_DVB_TELETEXT,
+    AV_CODEC_ID_SRT,
+
+    /* other specific kind of codecs (generally used for attachments) */
+    AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
+    AV_CODEC_ID_TTF = 0x18000,
+
+    AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
+
+    AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
+
+#if FF_API_CODEC_ID
+#include "old_codec_ids.h"
+#endif
+};
+
+#if FF_API_CODEC_ID
+#define CodecID AVCodecID
+#endif
+
+/**
+ * This struct describes the properties of a single codec described by an
+ * AVCodecID.
+ * @see avcodec_get_descriptor()
+ */
+typedef struct AVCodecDescriptor {
+    enum AVCodecID     id;
+    enum AVMediaType type;
+    /**
+     * Name of the codec described by this descriptor. It is non-empty and
+     * unique for each codec descriptor. It should contain alphanumeric
+     * characters and '_' only.
+     */
+    const char      *name;
+    /**
+     * A more descriptive name for this codec. May be NULL.
+     */
+    const char *long_name;
+    /**
+     * Codec properties, a combination of AV_CODEC_PROP_* flags.
+     */
+    int             props;
+} AVCodecDescriptor;
+
+/**
+ * Codec uses only intra compression.
+ * Video codecs only.
+ */
+#define AV_CODEC_PROP_INTRA_ONLY    (1 << 0)
+/**
+ * Codec supports lossy compression. Audio and video codecs only.
+ * @note a codec may support both lossy and lossless
+ * compression modes
+ */
+#define AV_CODEC_PROP_LOSSY         (1 << 1)
+/**
+ * Codec supports lossless compression. Audio and video codecs only.
+ */
+#define AV_CODEC_PROP_LOSSLESS      (1 << 2)
+
+#if FF_API_OLD_DECODE_AUDIO
+/* in bytes */
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
+#endif
+
+/**
+ * @ingroup lavc_decoding
+ * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
+ * This is mainly needed because some optimized bitstream readers read
+ * 32 or 64 bit at once and could read over the end.<br>
+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged
+ * MPEG bitstreams could cause overread and segfault.
+ */
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
+
+/**
+ * @ingroup lavc_encoding
+ * minimum encoding buffer size
+ * Used to avoid some checks during header writing.
+ */
+#define FF_MIN_BUFFER_SIZE 16384
+
+
+/**
+ * @ingroup lavc_encoding
+ * motion estimation type.
+ */
+enum Motion_Est_ID {
+    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
+    ME_FULL,
+    ME_LOG,
+    ME_PHODS,
+    ME_EPZS,        ///< enhanced predictive zonal search
+    ME_X1,          ///< reserved for experiments
+    ME_HEX,         ///< hexagon based search
+    ME_UMH,         ///< uneven multi-hexagon search
+    ME_ITER,        ///< iterative search
+    ME_TESA,        ///< transformed exhaustive search algorithm
+};
+
+/**
+ * @ingroup lavc_decoding
+ */
+enum AVDiscard{
+    /* We leave some space between them for extensions (drop some
+     * keyframes for intra-only or drop just some bidir frames). */
+    AVDISCARD_NONE    =-16, ///< discard nothing
+    AVDISCARD_DEFAULT =  0, ///< discard useless packets like 0 size packets in avi
+    AVDISCARD_NONREF  =  8, ///< discard all non reference
+    AVDISCARD_BIDIR   = 16, ///< discard all bidirectional frames
+    AVDISCARD_NONKEY  = 32, ///< discard all frames except keyframes
+    AVDISCARD_ALL     = 48, ///< discard all
+};
+
+enum AVColorPrimaries{
+    AVCOL_PRI_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
+    AVCOL_PRI_UNSPECIFIED = 2,
+    AVCOL_PRI_BT470M      = 4,
+    AVCOL_PRI_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_PRI_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
+    AVCOL_PRI_SMPTE240M   = 7, ///< functionally identical to above
+    AVCOL_PRI_FILM        = 8,
+    AVCOL_PRI_NB             , ///< Not part of ABI
+};
+
+enum AVColorTransferCharacteristic{
+    AVCOL_TRC_BT709       = 1, ///< also ITU-R BT1361
+    AVCOL_TRC_UNSPECIFIED = 2,
+    AVCOL_TRC_GAMMA22     = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_TRC_GAMMA28     = 5, ///< also ITU-R BT470BG
+    AVCOL_TRC_SMPTE240M   = 7,
+    AVCOL_TRC_NB             , ///< Not part of ABI
+};
+
+enum AVColorSpace{
+    AVCOL_SPC_RGB         = 0,
+    AVCOL_SPC_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
+    AVCOL_SPC_UNSPECIFIED = 2,
+    AVCOL_SPC_FCC         = 4,
+    AVCOL_SPC_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
+    AVCOL_SPC_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
+    AVCOL_SPC_SMPTE240M   = 7,
+    AVCOL_SPC_YCOCG       = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
+    AVCOL_SPC_NB             , ///< Not part of ABI
+};
+
+enum AVColorRange{
+    AVCOL_RANGE_UNSPECIFIED = 0,
+    AVCOL_RANGE_MPEG        = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
+    AVCOL_RANGE_JPEG        = 2, ///< the normal     2^n-1   "JPEG" YUV ranges
+    AVCOL_RANGE_NB             , ///< Not part of ABI
+};
+
+/**
+ *  X   X      3 4 X      X are luma samples,
+ *             1 2        1-6 are possible chroma positions
+ *  X   X      5 6 X      0 is undefined/unknown position
+ */
+enum AVChromaLocation{
+    AVCHROMA_LOC_UNSPECIFIED = 0,
+    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
+    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
+    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
+    AVCHROMA_LOC_TOP         = 4,
+    AVCHROMA_LOC_BOTTOMLEFT  = 5,
+    AVCHROMA_LOC_BOTTOM      = 6,
+    AVCHROMA_LOC_NB             , ///< Not part of ABI
+};
+
+enum AVAudioServiceType {
+    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
+    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
+    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
+    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
+    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
+    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
+    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
+    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
+    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
+    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
+};
+
+/**
+ * @ingroup lavc_encoding
+ */
+typedef struct RcOverride{
+    int start_frame;
+    int end_frame;
+    int qscale; // If this is 0 then quality_factor will be used instead.
+    float quality_factor;
+} RcOverride;
+
+#define FF_MAX_B_FRAMES 16
+
+/* encoding support
+   These flags can be passed in AVCodecContext.flags before initialization.
+   Note: Not everything is supported yet.
+*/
+
+#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
+#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
+#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
+#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
+#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
+/**
+ * The parent program guarantees that the input for B-frames containing
+ * streams is not written to for at least s->max_b_frames+1 frames, if
+ * this is not set the input will be copied.
+ */
+#define CODEC_FLAG_INPUT_PRESERVED 0x0100
+#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
+#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
+#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
+#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
+#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
+#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
+                                                  location instead of only at frame boundaries. */
+#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
+#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
+#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
+#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
+#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
+/* Fx : Flag for h263+ extra options */
+#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
+#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
+#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
+#define CODEC_FLAG_CLOSED_GOP     0x80000000
+#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
+#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
+#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
+#if FF_API_MPV_GLOBAL_OPTS
+#define CODEC_FLAG_CBP_RD         0x04000000 ///< Use rate distortion optimization for cbp.
+#define CODEC_FLAG_QP_RD          0x08000000 ///< Use rate distortion optimization for qp selectioon.
+#define CODEC_FLAG2_STRICT_GOP    0x00000002 ///< Strictly enforce GOP size.
+#define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
+#endif
+#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
+
+/* Unsupported options :
+ *              Syntax Arithmetic coding (SAC)
+ *              Reference Picture Selection
+ *              Independent Segment Decoding */
+/* /Fx */
+/* codec capabilities */
+
+#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
+/**
+ * Codec uses get_buffer() for allocating buffers and supports custom allocators.
+ * If not set, it might not use get_buffer() at all or use operations that
+ * assume the buffer was allocated by avcodec_default_get_buffer.
+ */
+#define CODEC_CAP_DR1             0x0002
+#define CODEC_CAP_TRUNCATED       0x0008
+/* Codec can export data for HW decoding (XvMC). */
+#define CODEC_CAP_HWACCEL         0x0010
+/**
+ * Encoder or decoder requires flushing with NULL input at the end in order to
+ * give the complete and correct output.
+ *
+ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ *       with NULL data. The user can still send NULL data to the public encode
+ *       or decode function, but libavcodec will not pass it along to the codec
+ *       unless this flag is set.
+ *
+ * Decoders:
+ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ * returns frames.
+ *
+ * Encoders:
+ * The encoder needs to be fed with NULL data at the end of encoding until the
+ * encoder no longer returns data.
+ *
+ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ *       flag also means that the encoder must set the pts and duration for
+ *       each output packet. If this flag is not set, the pts and duration will
+ *       be determined by libavcodec from the input frame.
+ */
+#define CODEC_CAP_DELAY           0x0020
+/**
+ * Codec can be fed a final frame with a smaller size.
+ * This can be used to prevent truncation of the last audio samples.
+ */
+#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
+/**
+ * Codec can export data for HW decoding (VDPAU).
+ */
+#define CODEC_CAP_HWACCEL_VDPAU    0x0080
+/**
+ * Codec can output multiple frames per AVPacket
+ * Normally demuxers return one frame at a time, demuxers which do not do
+ * are connected to a parser to split what they return into proper frames.
+ * This flag is reserved to the very rare category of codecs which have a
+ * bitstream that cannot be split into frames without timeconsuming
+ * operations like full decoding. Demuxers carring such bitstreams thus
+ * may return multiple frames in a packet. This has many disadvantages like
+ * prohibiting stream copy in many cases thus it should only be considered
+ * as a last resort.
+ */
+#define CODEC_CAP_SUBFRAMES        0x0100
+/**
+ * Codec is experimental and is thus avoided in favor of non experimental
+ * encoders
+ */
+#define CODEC_CAP_EXPERIMENTAL     0x0200
+/**
+ * Codec should fill in channel configuration and samplerate instead of container
+ */
+#define CODEC_CAP_CHANNEL_CONF     0x0400
+/**
+ * Codec is able to deal with negative linesizes
+ */
+#define CODEC_CAP_NEG_LINESIZES    0x0800
+/**
+ * Codec supports frame-level multithreading.
+ */
+#define CODEC_CAP_FRAME_THREADS    0x1000
+/**
+ * Codec supports slice-based (or partition-based) multithreading.
+ */
+#define CODEC_CAP_SLICE_THREADS    0x2000
+/**
+ * Codec supports changed parameters at any point.
+ */
+#define CODEC_CAP_PARAM_CHANGE     0x4000
+/**
+ * Codec supports avctx->thread_count == 0 (auto).
+ */
+#define CODEC_CAP_AUTO_THREADS     0x8000
+/**
+ * Audio encoder supports receiving a different number of samples in each call.
+ */
+#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
+
+//The following defines may change, don't expect compatibility if you use them.
+#define MB_TYPE_INTRA4x4   0x0001
+#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
+#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
+#define MB_TYPE_16x16      0x0008
+#define MB_TYPE_16x8       0x0010
+#define MB_TYPE_8x16       0x0020
+#define MB_TYPE_8x8        0x0040
+#define MB_TYPE_INTERLACED 0x0080
+#define MB_TYPE_DIRECT2    0x0100 //FIXME
+#define MB_TYPE_ACPRED     0x0200
+#define MB_TYPE_GMC        0x0400
+#define MB_TYPE_SKIP       0x0800
+#define MB_TYPE_P0L0       0x1000
+#define MB_TYPE_P1L0       0x2000
+#define MB_TYPE_P0L1       0x4000
+#define MB_TYPE_P1L1       0x8000
+#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
+#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
+#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
+#define MB_TYPE_QUANT      0x00010000
+#define MB_TYPE_CBP        0x00020000
+//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
+
+/**
+ * Pan Scan area.
+ * This specifies the area which should be displayed.
+ * Note there may be multiple such areas for one frame.
+ */
+typedef struct AVPanScan{
+    /**
+     * id
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int id;
+
+    /**
+     * width and height in 1/16 pel
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int width;
+    int height;
+
+    /**
+     * position of the top left corner in 1/16 pel for up to 3 fields/frames
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int16_t position[3][2];
+}AVPanScan;
+
+#define FF_QSCALE_TYPE_MPEG1 0
+#define FF_QSCALE_TYPE_MPEG2 1
+#define FF_QSCALE_TYPE_H264  2
+#define FF_QSCALE_TYPE_VP56  3
+
+#define FF_BUFFER_TYPE_INTERNAL 1
+#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
+#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
+#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
+
+#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
+#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
+#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
+#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
+
+/**
+ * @defgroup lavc_packet AVPacket
+ *
+ * Types and functions for working with AVPacket.
+ * @{
+ */
+enum AVPacketSideDataType {
+    AV_PKT_DATA_PALETTE,
+    AV_PKT_DATA_NEW_EXTRADATA,
+
+    /**
+     * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
+     * @code
+     * u32le param_flags
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
+     *     s32le channel_count
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
+     *     u64le channel_layout
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
+     *     s32le sample_rate
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
+     *     s32le width
+     *     s32le height
+     * @endcode
+     */
+    AV_PKT_DATA_PARAM_CHANGE,
+
+    /**
+     * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
+     * structures with info about macroblocks relevant to splitting the
+     * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
+     * That is, it does not necessarily contain info about all macroblocks,
+     * as long as the distance between macroblocks in the info is smaller
+     * than the target payload size.
+     * Each MB info structure is 12 bytes, and is laid out as follows:
+     * @code
+     * u32le bit offset from the start of the packet
+     * u8    current quantizer at the start of the macroblock
+     * u8    GOB number
+     * u16le macroblock address within the GOB
+     * u8    horizontal MV predictor
+     * u8    vertical MV predictor
+     * u8    horizontal MV predictor for block number 3
+     * u8    vertical MV predictor for block number 3
+     * @endcode
+     */
+    AV_PKT_DATA_H263_MB_INFO,
+};
+
+typedef struct AVPacket {
+    /**
+     * Presentation timestamp in AVStream->time_base units; the time at which
+     * the decompressed packet will be presented to the user.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     * pts MUST be larger or equal to dts as presentation cannot happen before
+     * decompression, unless one wants to view hex dumps. Some formats misuse
+     * the terms dts and pts/cts to mean something different. Such timestamps
+     * must be converted to true pts/dts before they are stored in AVPacket.
+     */
+    int64_t pts;
+    /**
+     * Decompression timestamp in AVStream->time_base units; the time at which
+     * the packet is decompressed.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     */
+    int64_t dts;
+    uint8_t *data;
+    int   size;
+    int   stream_index;
+    /**
+     * A combination of AV_PKT_FLAG values
+     */
+    int   flags;
+    /**
+     * Additional packet data that can be provided by the container.
+     * Packet can contain several types of side information.
+     */
+    struct {
+        uint8_t *data;
+        int      size;
+        enum AVPacketSideDataType type;
+    } *side_data;
+    int side_data_elems;
+
+    /**
+     * Duration of this packet in AVStream->time_base units, 0 if unknown.
+     * Equals next_pts - this_pts in presentation order.
+     */
+    int   duration;
+    void  (*destruct)(struct AVPacket *);
+    void  *priv;
+    int64_t pos;                            ///< byte position in stream, -1 if unknown
+
+    /**
+     * Time difference in AVStream->time_base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current packet.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+} AVPacket;
+#define AV_PKT_FLAG_KEY     0x0001 ///< The packet contains a keyframe
+#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
+
+enum AVSideDataParamChangeFlags {
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT  = 0x0001,
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
+    AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE    = 0x0004,
+    AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS     = 0x0008,
+};
+/**
+ * @}
+ */
+
+/**
+ * Audio Video Frame.
+ * New fields can be added to the end of AVFRAME with minor version
+ * bumps. Removal, reordering and changes to existing fields require
+ * a major version bump.
+ * sizeof(AVFrame) must not be used outside libav*.
+ */
+typedef struct AVFrame {
+#define AV_NUM_DATA_POINTERS 8
+    /**
+     * pointer to the picture/channel planes.
+     * This might be different from the first allocated byte
+     * - encoding: Set by user
+     * - decoding: set by AVCodecContext.get_buffer()
+     */
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+
+    /**
+     * Size, in bytes, of the data for each picture/channel plane.
+     *
+     * For audio, only linesize[0] may be set. For planar audio, each channel
+     * plane must be the same size.
+     *
+     * - encoding: Set by user
+     * - decoding: set by AVCodecContext.get_buffer()
+     */
+    int linesize[AV_NUM_DATA_POINTERS];
+
+    /**
+     * pointers to the data planes/channels.
+     *
+     * For video, this should simply point to data[].
+     *
+     * For planar audio, each channel has a separate data pointer, and
+     * linesize[0] contains the size of each channel buffer.
+     * For packed audio, there is just one data pointer, and linesize[0]
+     * contains the total size of the buffer for all channels.
+     *
+     * Note: Both data and extended_data will always be set by get_buffer(),
+     * but for planar audio with more channels that can fit in data,
+     * extended_data must be used by the decoder in order to access all
+     * channels.
+     *
+     * encoding: set by user
+     * decoding: set by AVCodecContext.get_buffer()
+     */
+    uint8_t **extended_data;
+
+    /**
+     * width and height of the video frame
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    int width, height;
+
+    /**
+     * number of audio samples (per channel) described by this frame
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    int nb_samples;
+
+    /**
+     * format of the frame, -1 if unknown or unset
+     * Values correspond to enum AVPixelFormat for video frames,
+     * enum AVSampleFormat for audio)
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    int format;
+
+    /**
+     * 1 -> keyframe, 0-> not
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int key_frame;
+
+    /**
+     * Picture type of the frame, see ?_TYPE below.
+     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).
+     * - decoding: Set by libavcodec.
+     */
+    enum AVPictureType pict_type;
+
+    /**
+     * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.
+     * This isn't used by libavcodec unless the default get/release_buffer() is used.
+     * - encoding:
+     * - decoding:
+     */
+    uint8_t *base[AV_NUM_DATA_POINTERS];
+
+    /**
+     * sample aspect ratio for the video frame, 0/1 if unknown/unspecified
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * presentation timestamp in time_base units (time when frame should be shown to user)
+     * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.
+     * - encoding: MUST be set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int64_t pts;
+
+    /**
+     * reordered pts from the last AVPacket that has been input into the decoder
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    int64_t pkt_pts;
+
+    /**
+     * dts from the last AVPacket that has been input into the decoder
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    int64_t pkt_dts;
+
+    /**
+     * picture number in bitstream order
+     * - encoding: set by
+     * - decoding: Set by libavcodec.
+     */
+    int coded_picture_number;
+    /**
+     * picture number in display order
+     * - encoding: set by
+     * - decoding: Set by libavcodec.
+     */
+    int display_picture_number;
+
+    /**
+     * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+     * - encoding: Set by libavcodec. for coded_picture (and set by user for input).
+     * - decoding: Set by libavcodec.
+     */
+    int quality;
+
+    /**
+     * is this picture used as reference
+     * The values for this are the same as the MpegEncContext.picture_structure
+     * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
+     * Set to 4 for delayed, non-reference frames.
+     * - encoding: unused
+     * - decoding: Set by libavcodec. (before get_buffer() call)).
+     */
+    int reference;
+
+    /**
+     * QP table
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    int8_t *qscale_table;
+    /**
+     * QP store stride
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    int qstride;
+
+    /**
+     *
+     */
+    int qscale_type;
+
+    /**
+     * mbskip_table[mb]>=1 if MB didn't change
+     * stride= mb_width = (width+15)>>4
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    uint8_t *mbskip_table;
+
+    /**
+     * motion vector table
+     * @code
+     * example:
+     * int mv_sample_log2= 4 - motion_subsample_log2;
+     * int mb_width= (width+15)>>4;
+     * int mv_stride= (mb_width << mv_sample_log2) + 1;
+     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
+     * @endcode
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int16_t (*motion_val[2])[2];
+
+    /**
+     * macroblock type table
+     * mb_type_base + mb_width + 2
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    uint32_t *mb_type;
+
+    /**
+     * DCT coefficients
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    short *dct_coeff;
+
+    /**
+     * motion reference frame index
+     * the order in which these are stored can depend on the codec.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int8_t *ref_index[2];
+
+    /**
+     * for some private data of the user
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    void *opaque;
+
+    /**
+     * error
+     * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.
+     * - decoding: unused
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+    /**
+     * type of the buffer (to keep track of who has to deallocate data[*])
+     * - encoding: Set by the one who allocates it.
+     * - decoding: Set by the one who allocates it.
+     * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.
+     */
+    int type;
+
+    /**
+     * When decoding, this signals how much the picture must be delayed.
+     * extra_delay = repeat_pict / (2*fps)
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    int repeat_pict;
+
+    /**
+     * The content of the picture is interlaced.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec. (default 0)
+     */
+    int interlaced_frame;
+
+    /**
+     * If the content is interlaced, is top field displayed first.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int top_field_first;
+
+    /**
+     * Tell user application that palette has changed from previous frame.
+     * - encoding: ??? (no palette-enabled encoder yet)
+     * - decoding: Set by libavcodec. (default 0).
+     */
+    int palette_has_changed;
+
+    /**
+     * codec suggestion on buffer type if != 0
+     * - encoding: unused
+     * - decoding: Set by libavcodec. (before get_buffer() call)).
+     */
+    int buffer_hints;
+
+    /**
+     * Pan scan.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVPanScan *pan_scan;
+
+    /**
+     * reordered opaque 64bit (generally an integer or a double precision float
+     * PTS but can be anything).
+     * The user sets AVCodecContext.reordered_opaque to represent the input at
+     * that time,
+     * the decoder reorders values as needed and sets AVFrame.reordered_opaque
+     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     * - encoding: unused
+     * - decoding: Read by user.
+     */
+    int64_t reordered_opaque;
+
+    /**
+     * hardware accelerator private data (Libav-allocated)
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    void *hwaccel_picture_private;
+
+    /**
+     * the AVCodecContext which ff_thread_get_buffer() was last called on
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    struct AVCodecContext *owner;
+
+    /**
+     * used by multithreading to store frame-specific info
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    void *thread_opaque;
+
+    /**
+     * log2 of the size of the block which a single vector in motion_val represents:
+     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+     * - encoding: unused
+     * - decoding: Set by libavcodec.
+     */
+    uint8_t motion_subsample_log2;
+
+    /**
+     * Sample rate of the audio data.
+     *
+     * - encoding: unused
+     * - decoding: set by get_buffer()
+     */
+    int sample_rate;
+
+    /**
+     * Channel layout of the audio data.
+     *
+     * - encoding: unused
+     * - decoding: set by get_buffer()
+     */
+    uint64_t channel_layout;
+} AVFrame;
+
+struct AVCodecInternal;
+
+enum AVFieldOrder {
+    AV_FIELD_UNKNOWN,
+    AV_FIELD_PROGRESSIVE,
+    AV_FIELD_TT,          //< Top coded_first, top displayed first
+    AV_FIELD_BB,          //< Bottom coded first, bottom displayed first
+    AV_FIELD_TB,          //< Top coded first, bottom displayed first
+    AV_FIELD_BT,          //< Bottom coded first, top displayed first
+};
+
+/**
+ * main external API structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVCodecContext) must not be used outside libav*.
+ */
+typedef struct AVCodecContext {
+    /**
+     * information on struct for av_log
+     * - set by avcodec_alloc_context3
+     */
+    const AVClass *av_class;
+    int log_level_offset;
+
+    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
+    const struct AVCodec  *codec;
+    char             codec_name[32];
+    enum AVCodecID     codec_id; /* see AV_CODEC_ID_xxx */
+
+    /**
+     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * A demuxer should set this to what is stored in the field used to identify the codec.
+     * If there are multiple such fields in a container then the demuxer should choose the one
+     * which maximizes the information about the used codec.
+     * If the codec tag field in a container is larger than 32 bits then the demuxer should
+     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
+     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
+     * first.
+     * - encoding: Set by user, if not then the default based on codec_id will be used.
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int codec_tag;
+
+    /**
+     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * - encoding: unused
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int stream_codec_tag;
+
+#if FF_API_SUB_ID
+    /**
+     * @deprecated this field is unused
+     */
+    attribute_deprecated int sub_id;
+#endif
+
+    void *priv_data;
+
+    /**
+     * Private context used for internal data.
+     *
+     * Unlike priv_data, this is not codec-specific. It is used in general
+     * libavcodec functions.
+     */
+    struct AVCodecInternal *internal;
+
+    /**
+     * Private data of the user, can be used to carry app specific stuff.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    void *opaque;
+
+    /**
+     * the average bitrate
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+     */
+    int bit_rate;
+
+    /**
+     * number of bits the bitstream is allowed to diverge from the reference.
+     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: unused
+     */
+    int bit_rate_tolerance;
+
+    /**
+     * Global quality for codecs which cannot change it per frame.
+     * This should be proportional to MPEG-1/2/4 qscale.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int global_quality;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int compression_level;
+#define FF_COMPRESSION_DEFAULT -1
+
+    /**
+     * CODEC_FLAG_*.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags;
+
+    /**
+     * CODEC_FLAG2_*
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags2;
+
+    /**
+     * some codecs need / can use extradata like Huffman tables.
+     * mjpeg: Huffman tables
+     * rv10: additional flags
+     * mpeg4: global headers (they can be in the bitstream or here)
+     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+     * than extradata_size to avoid prolems if it is read with the bitstream reader.
+     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
+     * - encoding: Set/allocated/freed by libavcodec.
+     * - decoding: Set/allocated/freed by user.
+     */
+    uint8_t *extradata;
+    int extradata_size;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented. For fixed-fps content,
+     * timebase should be 1/framerate and timestamp increments should be
+     * identically 1.
+     * - encoding: MUST be set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational time_base;
+
+    /**
+     * For some codecs, the time base is closer to the field rate than the frame rate.
+     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+     * if no telecine is used ...
+     *
+     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+     */
+    int ticks_per_frame;
+
+    /**
+     * Encoder delay.
+     *
+     * Video:
+     *   Number of frames the decoded output will be delayed relative to the
+     *   encoded input.
+     *
+     * Audio:
+     *   For encoding, this is the number of "priming" samples added to the
+     *   beginning of the stream. The decoded output will be delayed by this
+     *   many samples relative to the input to the encoder. Note that this
+     *   field is purely informational and does not directly affect the pts
+     *   output by the encoder, which should always be based on the actual
+     *   presentation time, including any delay.
+     *   For decoding, this is the number of samples the decoder needs to
+     *   output before the decoder's output is valid. When seeking, you should
+     *   start decoding this many samples prior to your desired seek point.
+     *
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int delay;
+
+
+    /* video only */
+    /**
+     * picture width / height.
+     * - encoding: MUST be set by user.
+     * - decoding: Set by libavcodec.
+     * Note: For compatibility it is possible to set this instead of
+     * coded_width/height before decoding.
+     */
+    int width, height;
+
+    /**
+     * Bitstream width / height, may be different from width/height.
+     * - encoding: unused
+     * - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
+     */
+    int coded_width, coded_height;
+
+#define FF_ASPECT_EXTENDED 15
+
+    /**
+     * the number of pictures in a group of pictures, or 0 for intra_only
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int gop_size;
+
+    /**
+     * Pixel format, see AV_PIX_FMT_xxx.
+     * May be set by the demuxer if known from headers.
+     * May be overriden by the decoder if it knows better.
+     * - encoding: Set by user.
+     * - decoding: Set by user if known, overridden by libavcodec if known
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Motion estimation algorithm used for video coding.
+     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
+     * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific]
+     * - encoding: MUST be set by user.
+     * - decoding: unused
+     */
+    int me_method;
+
+    /**
+     * If non NULL, 'draw_horiz_band' is called by the libavcodec
+     * decoder to draw a horizontal band. It improves cache usage. Not
+     * all codecs can do that. You must check the codec capabilities
+     * beforehand.
+     * When multithreading is used, it may be called from multiple threads
+     * at the same time; threads might draw different parts of the same AVFrame,
+     * or multiple AVFrames, and there is no guarantee that slices will be drawn
+     * in order.
+     * The function is also used by hardware acceleration APIs.
+     * It is called at least once during frame decoding to pass
+     * the data needed for hardware render.
+     * In that mode instead of pixel data, AVFrame points to
+     * a structure specific to the acceleration API. The application
+     * reads the structure and can change some fields to indicate progress
+     * or mark state.
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @param height the height of the slice
+     * @param y the y position of the slice
+     * @param type 1->top field, 2->bottom field, 3->frame
+     * @param offset offset into the AVFrame.data from which the slice should be read
+     */
+    void (*draw_horiz_band)(struct AVCodecContext *s,
+                            const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
+                            int y, int type, int height);
+
+    /**
+     * callback to negotiate the pixelFormat
+     * @param fmt is the list of formats which are supported by the codec,
+     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
+     * The first is always the native one.
+     * @return the chosen format
+     * - encoding: unused
+     * - decoding: Set by user, if not set the native format will be chosen.
+     */
+    enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+    /**
+     * maximum number of B-frames between non-B-frames
+     * Note: The output will be delayed by max_b_frames+1 relative to the input.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_b_frames;
+
+    /**
+     * qscale factor between IP and B-frames
+     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_factor;
+
+    /** obsolete FIXME remove */
+    int rc_strategy;
+#define FF_RC_STRATEGY_XVID 1
+
+    int b_frame_strategy;
+
+#if FF_API_MPV_GLOBAL_OPTS
+    /**
+     * luma single coefficient elimination threshold
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    attribute_deprecated int luma_elim_threshold;
+
+    /**
+     * chroma single coeff elimination threshold
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    attribute_deprecated int chroma_elim_threshold;
+#endif
+
+    /**
+     * qscale offset between IP and B-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_offset;
+
+    /**
+     * Size of the frame reordering buffer in the decoder.
+     * For MPEG-2 it is 1 IPB or 0 low delay IP.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int has_b_frames;
+
+    /**
+     * 0-> h263 quant 1-> mpeg quant
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mpeg_quant;
+
+    /**
+     * qscale factor between P and I-frames
+     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_factor;
+
+    /**
+     * qscale offset between P and I-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_offset;
+
+    /**
+     * luminance masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float lumi_masking;
+
+    /**
+     * temporary complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float temporal_cplx_masking;
+
+    /**
+     * spatial complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float spatial_cplx_masking;
+
+    /**
+     * p block masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float p_masking;
+
+    /**
+     * darkness masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float dark_masking;
+
+    /**
+     * slice count
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user (or 0).
+     */
+    int slice_count;
+    /**
+     * prediction method (needed for huffyuv)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int prediction_method;
+#define FF_PRED_LEFT   0
+#define FF_PRED_PLANE  1
+#define FF_PRED_MEDIAN 2
+
+    /**
+     * slice offsets in the frame in bytes
+     * - encoding: Set/allocated by libavcodec.
+     * - decoding: Set/allocated by user (or NULL).
+     */
+    int *slice_offset;
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * That is the width of a pixel divided by the height of the pixel.
+     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_cmp;
+    /**
+     * subpixel motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_sub_cmp;
+    /**
+     * macroblock comparison function (not supported yet)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_cmp;
+    /**
+     * interlaced DCT comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int ildct_cmp;
+#define FF_CMP_SAD    0
+#define FF_CMP_SSE    1
+#define FF_CMP_SATD   2
+#define FF_CMP_DCT    3
+#define FF_CMP_PSNR   4
+#define FF_CMP_BIT    5
+#define FF_CMP_RD     6
+#define FF_CMP_ZERO   7
+#define FF_CMP_VSAD   8
+#define FF_CMP_VSSE   9
+#define FF_CMP_NSSE   10
+#define FF_CMP_W53    11
+#define FF_CMP_W97    12
+#define FF_CMP_DCTMAX 13
+#define FF_CMP_DCT264 14
+#define FF_CMP_CHROMA 256
+
+    /**
+     * ME diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dia_size;
+
+    /**
+     * amount of previous MV predictors (2a+1 x 2a+1 square)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int last_predictor_count;
+
+    /**
+     * prepass for motion estimation
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_me;
+
+    /**
+     * motion estimation prepass comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_pre_cmp;
+
+    /**
+     * ME prepass diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_dia_size;
+
+    /**
+     * subpel ME quality
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_subpel_quality;
+
+    /**
+     * DTG active format information (additional aspect ratio
+     * information only used in DVB MPEG-2 transport streams)
+     * 0 if not set.
+     *
+     * - encoding: unused
+     * - decoding: Set by decoder.
+     */
+    int dtg_active_format;
+#define FF_DTG_AFD_SAME         8
+#define FF_DTG_AFD_4_3          9
+#define FF_DTG_AFD_16_9         10
+#define FF_DTG_AFD_14_9         11
+#define FF_DTG_AFD_4_3_SP_14_9  13
+#define FF_DTG_AFD_16_9_SP_14_9 14
+#define FF_DTG_AFD_SP_4_3       15
+
+    /**
+     * maximum motion estimation search range in subpel units
+     * If 0 then no limit.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_range;
+
+    /**
+     * intra quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_quant_bias;
+#define FF_DEFAULT_QUANT_BIAS 999999
+
+    /**
+     * inter quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int inter_quant_bias;
+
+#if FF_API_COLOR_TABLE_ID
+    /**
+     * color table ID
+     * - encoding: unused
+     * - decoding: Which clrtable should be used for 8bit RGB images.
+     *             Tables have to be stored somewhere. FIXME
+     */
+    attribute_deprecated int color_table_id;
+#endif
+
+    /**
+     * slice flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int slice_flags;
+#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
+#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
+#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
+
+    /**
+     * XVideo Motion Acceleration
+     * - encoding: forbidden
+     * - decoding: set by decoder
+     */
+    int xvmc_acceleration;
+
+    /**
+     * macroblock decision mode
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_decision;
+#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
+#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
+#define FF_MB_DECISION_RD     2        ///< rate distortion
+
+    /**
+     * custom intra quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *intra_matrix;
+
+    /**
+     * custom inter quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *inter_matrix;
+
+    /**
+     * scene change detection threshold
+     * 0 is default, larger means fewer detected scene changes.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_threshold;
+
+    /**
+     * noise reduction strength
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int noise_reduction;
+
+#if FF_API_INTER_THRESHOLD
+    /**
+     * @deprecated this field is unused
+     */
+    attribute_deprecated int inter_threshold;
+#endif
+
+#if FF_API_MPV_GLOBAL_OPTS
+    /**
+     * @deprecated use mpegvideo private options instead
+     */
+    attribute_deprecated int quantizer_noise_shaping;
+#endif
+
+    /**
+     * Motion estimation threshold below which no motion estimation is
+     * performed, but instead the user specified motion vectors are used.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_threshold;
+
+    /**
+     * Macroblock threshold below which the user specified macroblock types will be used.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_threshold;
+
+    /**
+     * precision of the intra DC coefficient - 8
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_dc_precision;
+
+    /**
+     * Number of macroblock rows at the top which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_top;
+
+    /**
+     * Number of macroblock rows at the bottom which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_bottom;
+
+    /**
+     * Border processing masking, raises the quantizer for mbs on the borders
+     * of the picture.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float border_masking;
+
+    /**
+     * minimum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmin;
+
+    /**
+     * maximum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmax;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_penalty_compensation;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int bidir_refine;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int brd_scale;
+
+    /**
+     * minimum GOP size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int keyint_min;
+
+    /**
+     * number of reference frames
+     * - encoding: Set by user.
+     * - decoding: Set by lavc.
+     */
+    int refs;
+
+    /**
+     * chroma qp offset from luma
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int chromaoffset;
+
+    /**
+     * Multiplied by qscale for each frame and added to scene_change_score.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_factor;
+
+    /**
+     *
+     * Note: Value depends upon the compare function used for fullpel ME.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mv0_threshold;
+
+    /**
+     * Adjust sensitivity of b_frame_strategy 1.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int b_sensitivity;
+
+    /**
+     * Chromaticity coordinates of the source primaries.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorPrimaries color_primaries;
+
+    /**
+     * Color Transfer Characteristic.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorTransferCharacteristic color_trc;
+
+    /**
+     * YUV colorspace type.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorSpace colorspace;
+
+    /**
+     * MPEG vs JPEG YUV range.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorRange color_range;
+
+    /**
+     * This defines the location of chroma samples.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVChromaLocation chroma_sample_location;
+
+    /**
+     * Number of slices.
+     * Indicates number of picture subdivisions. Used for parallelized
+     * decoding.
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    int slices;
+
+    /** Field order
+     * - encoding: set by libavcodec
+     * - decoding: Set by libavcodec
+     */
+    enum AVFieldOrder field_order;
+
+    /* audio only */
+    int sample_rate; ///< samples per second
+    int channels;    ///< number of audio channels
+
+    /**
+     * audio sample format
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVSampleFormat sample_fmt;  ///< sample format
+
+    /* The following data should not be initialized. */
+    /**
+     * Samples per packet, initialized when calling 'init'.
+     */
+    int frame_size;
+
+    /**
+     * Frame counter, set by libavcodec.
+     *
+     * - decoding: total number of frames returned from the decoder so far.
+     * - encoding: total number of frames passed to the encoder so far.
+     *
+     *   @note the counter is not incremented if encoding/decoding resulted in
+     *   an error.
+     */
+    int frame_number;
+
+    /**
+     * number of bytes per packet if constant and known or 0
+     * Used by some WAV based audio codecs.
+     */
+    int block_align;
+
+    /**
+     * Audio cutoff bandwidth (0 means "automatic")
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int cutoff;
+
+#if FF_API_REQUEST_CHANNELS
+    /**
+     * Decoder should decode to this many channels if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @deprecated Deprecated in favor of request_channel_layout.
+     */
+    int request_channels;
+#endif
+
+    /**
+     * Audio channel layout.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    uint64_t channel_layout;
+
+    /**
+     * Request decoder to use this channel layout if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    uint64_t request_channel_layout;
+
+    /**
+     * Type of service that the audio stream conveys.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVAudioServiceType audio_service_type;
+
+    /**
+     * Used to request a sample format from the decoder.
+     * - encoding: unused.
+     * - decoding: Set by user.
+     */
+    enum AVSampleFormat request_sample_fmt;
+
+    /**
+     * Called at the beginning of each frame to get a buffer for it.
+     *
+     * The function will set AVFrame.data[], AVFrame.linesize[].
+     * AVFrame.extended_data[] must also be set, but it should be the same as
+     * AVFrame.data[] except for planar audio with more channels than can fit
+     * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
+     * many data pointers as it can hold.
+     *
+     * if CODEC_CAP_DR1 is not set then get_buffer() must call
+     * avcodec_default_get_buffer() instead of providing buffers allocated by
+     * some other means.
+     *
+     * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
+     * need it. avcodec_default_get_buffer() aligns the output buffer properly,
+     * but if get_buffer() is overridden then alignment considerations should
+     * be taken into account.
+     *
+     * @see avcodec_default_get_buffer()
+     *
+     * Video:
+     *
+     * If pic.reference is set then the frame will be read later by libavcodec.
+     * avcodec_align_dimensions2() should be used to find the required width and
+     * height, as they normally need to be rounded up to the next multiple of 16.
+     *
+     * If frame multithreading is used and thread_safe_callbacks is set,
+     * it may be called from a different thread, but not from more than one at
+     * once. Does not need to be reentrant.
+     *
+     * @see release_buffer(), reget_buffer()
+     * @see avcodec_align_dimensions2()
+     *
+     * Audio:
+     *
+     * Decoders request a buffer of a particular size by setting
+     * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
+     * however, utilize only part of the buffer by setting AVFrame.nb_samples
+     * to a smaller value in the output frame.
+     *
+     * Decoders cannot use the buffer after returning from
+     * avcodec_decode_audio4(), so they will not call release_buffer(), as it
+     * is assumed to be released immediately upon return.
+     *
+     * As a convenience, av_samples_get_buffer_size() and
+     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
+     * functions to find the required data size and to fill data pointers and
+     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+     * since all planes must be the same size.
+     *
+     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called to release buffers which were allocated with get_buffer.
+     * A released buffer can be reused in get_buffer().
+     * pic.data[*] must be set to NULL.
+     * May be called from a different thread if frame multithreading is used,
+     * but not by more than one thread at once, so does not need to be reentrant.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called at the beginning of a frame to get cr buffer for it.
+     * Buffer type (size, hints) must be the same. libavcodec won't check it.
+     * libavcodec will pass previous buffer in pic, function should return
+     * same buffer or new buffer with old frame "painted" into it.
+     * If pic.data[0] == NULL must behave like get_buffer().
+     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
+     * avcodec_default_reget_buffer() instead of providing buffers allocated by
+     * some other means.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+
+    /* - encoding parameters */
+    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
+    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
+
+    /**
+     * minimum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmin;
+
+    /**
+     * maximum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmax;
+
+    /**
+     * maximum quantizer difference between frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_qdiff;
+
+    /**
+     * ratecontrol qmin qmax limiting method
+     * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_qsquish;
+
+    float rc_qmod_amp;
+    int rc_qmod_freq;
+
+    /**
+     * decoder bitstream buffer size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_buffer_size;
+
+    /**
+     * ratecontrol override, see RcOverride
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    int rc_override_count;
+    RcOverride *rc_override;
+
+    /**
+     * rate control equation
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    const char *rc_eq;
+
+    /**
+     * maximum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_max_rate;
+
+    /**
+     * minimum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_min_rate;
+
+    float rc_buffer_aggressivity;
+
+    /**
+     * initial complexity for pass1 ratecontrol
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_initial_cplx;
+
+    /**
+     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_max_available_vbv_use;
+
+    /**
+     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_min_vbv_overflow_use;
+
+    /**
+     * Number of bits which should be loaded into the rc buffer before decoding starts.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_initial_buffer_occupancy;
+
+#define FF_CODER_TYPE_VLC       0
+#define FF_CODER_TYPE_AC        1
+#define FF_CODER_TYPE_RAW       2
+#define FF_CODER_TYPE_RLE       3
+#define FF_CODER_TYPE_DEFLATE   4
+    /**
+     * coder type
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int coder_type;
+
+    /**
+     * context model
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int context_model;
+
+    /**
+     * minimum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmin;
+
+    /**
+     * maximum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmax;
+
+    /**
+     * frame skip threshold
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_threshold;
+
+    /**
+     * frame skip factor
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_factor;
+
+    /**
+     * frame skip exponent
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_exp;
+
+    /**
+     * frame skip comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_cmp;
+
+    /**
+     * trellis RD quantization
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int trellis;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int min_prediction_order;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_prediction_order;
+
+    /**
+     * GOP timecode frame start number, in non drop frame format
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int64_t timecode_frame_start;
+
+    /* The RTP callback: This function is called    */
+    /* every time the encoder has a packet to send. */
+    /* It depends on the encoder if the data starts */
+    /* with a Start Code (it should). H.263 does.   */
+    /* mb_nb contains the number of macroblocks     */
+    /* encoded in the RTP payload.                  */
+    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
+
+    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
+                            /* do its best to deliver a chunk with size     */
+                            /* below rtp_payload_size, the chunk will start */
+                            /* with a start code on some codecs like H.263. */
+                            /* This doesn't take account of any particular  */
+                            /* headers inside the transmitted RTP payload.  */
+
+    /* statistics, used for 2-pass encoding */
+    int mv_bits;
+    int header_bits;
+    int i_tex_bits;
+    int p_tex_bits;
+    int i_count;
+    int p_count;
+    int skip_count;
+    int misc_bits;
+
+    /**
+     * number of bits used for the previously encoded frame
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    int frame_bits;
+
+    /**
+     * pass1 encoding statistics output buffer
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    char *stats_out;
+
+    /**
+     * pass2 encoding statistics input buffer
+     * Concatenated stuff from stats_out of pass1 should be placed here.
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    char *stats_in;
+
+    /**
+     * Work around bugs in encoders which sometimes cannot be detected automatically.
+     * - encoding: Set by user
+     * - decoding: Set by user
+     */
+    int workaround_bugs;
+#define FF_BUG_AUTODETECT       1  ///< autodetection
+#define FF_BUG_OLD_MSMPEG4      2
+#define FF_BUG_XVID_ILACE       4
+#define FF_BUG_UMP4             8
+#define FF_BUG_NO_PADDING       16
+#define FF_BUG_AMV              32
+#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
+#define FF_BUG_QPEL_CHROMA      64
+#define FF_BUG_STD_QPEL         128
+#define FF_BUG_QPEL_CHROMA2     256
+#define FF_BUG_DIRECT_BLOCKSIZE 512
+#define FF_BUG_EDGE             1024
+#define FF_BUG_HPEL_CHROMA      2048
+#define FF_BUG_DC_CLIP          4096
+#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
+#define FF_BUG_TRUNCATED       16384
+
+    /**
+     * strictly follow the standard (MPEG4, ...).
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     * Setting this to STRICT or higher means the encoder and decoder will
+     * generally do stupid things, whereas setting it to unofficial or lower
+     * will mean the encoder might produce output that is not supported by all
+     * spec-compliant decoders. Decoders don't differentiate between normal,
+     * unofficial and experimental (that is, they always try to decode things
+     * when they can) unless they are explicitly asked to behave stupidly
+     * (=strictly conform to the specs)
+     */
+    int strict_std_compliance;
+#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
+#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
+#define FF_COMPLIANCE_NORMAL        0
+#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
+#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
+
+    /**
+     * error concealment flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_concealment;
+#define FF_EC_GUESS_MVS   1
+#define FF_EC_DEBLOCK     2
+
+    /**
+     * debug
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int debug;
+#define FF_DEBUG_PICT_INFO   1
+#define FF_DEBUG_RC          2
+#define FF_DEBUG_BITSTREAM   4
+#define FF_DEBUG_MB_TYPE     8
+#define FF_DEBUG_QP          16
+#define FF_DEBUG_MV          32
+#define FF_DEBUG_DCT_COEFF   0x00000040
+#define FF_DEBUG_SKIP        0x00000080
+#define FF_DEBUG_STARTCODE   0x00000100
+#define FF_DEBUG_PTS         0x00000200
+#define FF_DEBUG_ER          0x00000400
+#define FF_DEBUG_MMCO        0x00000800
+#define FF_DEBUG_BUGS        0x00001000
+#define FF_DEBUG_VIS_QP      0x00002000
+#define FF_DEBUG_VIS_MB_TYPE 0x00004000
+#define FF_DEBUG_BUFFERS     0x00008000
+#define FF_DEBUG_THREADS     0x00010000
+
+    /**
+     * debug
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int debug_mv;
+#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
+#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
+#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
+
+    /**
+     * Error recognition; may misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int err_recognition;
+#define AV_EF_CRCCHECK  (1<<0)
+#define AV_EF_BITSTREAM (1<<1)
+#define AV_EF_BUFFER    (1<<2)
+#define AV_EF_EXPLODE   (1<<3)
+
+    /**
+     * opaque 64bit number (generally a PTS) that will be reordered and
+     * output in AVFrame.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int64_t reordered_opaque;
+
+    /**
+     * Hardware accelerator in use
+     * - encoding: unused.
+     * - decoding: Set by libavcodec
+     */
+    struct AVHWAccel *hwaccel;
+
+    /**
+     * Hardware accelerator context.
+     * For some hardware accelerators, a global context needs to be
+     * provided by the user. In that case, this holds display-dependent
+     * data Libav cannot instantiate itself. Please refer to the
+     * Libav HW accelerator documentation to know how to fill this
+     * is. e.g. for VA API, this is a struct vaapi_context.
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *hwaccel_context;
+
+    /**
+     * error
+     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
+     * - decoding: unused
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+    /**
+     * DCT algorithm, see FF_DCT_* below
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dct_algo;
+#define FF_DCT_AUTO    0
+#define FF_DCT_FASTINT 1
+#define FF_DCT_INT     2
+#define FF_DCT_MMX     3
+#define FF_DCT_ALTIVEC 5
+#define FF_DCT_FAAN    6
+
+    /**
+     * IDCT algorithm, see FF_IDCT_* below.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int idct_algo;
+#define FF_IDCT_AUTO          0
+#define FF_IDCT_INT           1
+#define FF_IDCT_SIMPLE        2
+#define FF_IDCT_SIMPLEMMX     3
+#if FF_API_LIBMPEG2
+#define FF_IDCT_LIBMPEG2MMX   4
+#endif
+#if FF_API_MMI
+#define FF_IDCT_MMI           5
+#endif
+#define FF_IDCT_ARM           7
+#define FF_IDCT_ALTIVEC       8
+#define FF_IDCT_SH4           9
+#define FF_IDCT_SIMPLEARM     10
+#define FF_IDCT_H264          11
+#define FF_IDCT_VP3           12
+#define FF_IDCT_IPP           13
+#define FF_IDCT_XVIDMMX       14
+#define FF_IDCT_CAVS          15
+#define FF_IDCT_SIMPLEARMV5TE 16
+#define FF_IDCT_SIMPLEARMV6   17
+#define FF_IDCT_SIMPLEVIS     18
+#define FF_IDCT_WMV2          19
+#define FF_IDCT_FAAN          20
+#define FF_IDCT_EA            21
+#define FF_IDCT_SIMPLENEON    22
+#define FF_IDCT_SIMPLEALPHA   23
+#define FF_IDCT_BINK          24
+
+#if FF_API_DSP_MASK
+    /**
+     * Unused.
+     * @deprecated use av_set_cpu_flags_mask() instead.
+     */
+    attribute_deprecated unsigned dsp_mask;
+#endif
+
+    /**
+     * bits per sample/pixel from the demuxer (needed for huffyuv).
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user.
+     */
+     int bits_per_coded_sample;
+
+    /**
+     * Bits per sample/pixel of internal libavcodec pixel/sample format.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    int bits_per_raw_sample;
+
+    /**
+     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    attribute_deprecated int lowres;
+
+    /**
+     * the picture in the bitstream
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    AVFrame *coded_frame;
+
+    /**
+     * thread count
+     * is used to decide how many independent tasks should be passed to execute()
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_count;
+
+    /**
+     * Which multithreading methods to use.
+     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
+     * so clients which cannot provide future frames should not use it.
+     *
+     * - encoding: Set by user, otherwise the default is used.
+     * - decoding: Set by user, otherwise the default is used.
+     */
+    int thread_type;
+#define FF_THREAD_FRAME   1 ///< Decode more than one frame at once
+#define FF_THREAD_SLICE   2 ///< Decode more than one part of a single frame at once
+
+    /**
+     * Which multithreading methods are in use by the codec.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int active_thread_type;
+
+    /**
+     * Set by the client if its custom get_buffer() callback can be called
+     * synchronously from another thread, which allows faster multithreaded decoding.
+     * draw_horiz_band() will be called from other threads regardless of this setting.
+     * Ignored if the default get_buffer() is used.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_safe_callbacks;
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * @param count the number of things to execute
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
+     * @param c context passed also to func
+     * @param count the number of things to execute
+     * @param arg2 argument passed unchanged to func
+     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
+     * @param func function that will be called count times, with jobnr from 0 to count-1.
+     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
+     *             two instances of func executing at the same time will have the same threadnr.
+     * @return always 0 currently, but code should handle a future improvement where when any call to func
+     *         returns < 0 no further calls to func may be done and < 0 is returned.
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
+
+    /**
+     * thread opaque
+     * Can be used by execute() to store some per AVCodecContext stuff.
+     * - encoding: set by execute()
+     * - decoding: set by execute()
+     */
+    void *thread_opaque;
+
+    /**
+     * noise vs. sse weight for the nsse comparsion function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int nsse_weight;
+
+    /**
+     * profile
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int profile;
+#define FF_PROFILE_UNKNOWN -99
+#define FF_PROFILE_RESERVED -100
+
+#define FF_PROFILE_AAC_MAIN 0
+#define FF_PROFILE_AAC_LOW  1
+#define FF_PROFILE_AAC_SSR  2
+#define FF_PROFILE_AAC_LTP  3
+#define FF_PROFILE_AAC_HE   4
+#define FF_PROFILE_AAC_HE_V2 28
+#define FF_PROFILE_AAC_LD   22
+#define FF_PROFILE_AAC_ELD  38
+
+#define FF_PROFILE_DTS         20
+#define FF_PROFILE_DTS_ES      30
+#define FF_PROFILE_DTS_96_24   40
+#define FF_PROFILE_DTS_HD_HRA  50
+#define FF_PROFILE_DTS_HD_MA   60
+
+#define FF_PROFILE_MPEG2_422    0
+#define FF_PROFILE_MPEG2_HIGH   1
+#define FF_PROFILE_MPEG2_SS     2
+#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
+#define FF_PROFILE_MPEG2_MAIN   4
+#define FF_PROFILE_MPEG2_SIMPLE 5
+
+#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
+#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
+
+#define FF_PROFILE_H264_BASELINE             66
+#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
+#define FF_PROFILE_H264_MAIN                 77
+#define FF_PROFILE_H264_EXTENDED             88
+#define FF_PROFILE_H264_HIGH                 100
+#define FF_PROFILE_H264_HIGH_10              110
+#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_422             122
+#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_444             144
+#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
+#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_CAVLC_444            44
+
+#define FF_PROFILE_VC1_SIMPLE   0
+#define FF_PROFILE_VC1_MAIN     1
+#define FF_PROFILE_VC1_COMPLEX  2
+#define FF_PROFILE_VC1_ADVANCED 3
+
+#define FF_PROFILE_MPEG4_SIMPLE                     0
+#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE            1
+#define FF_PROFILE_MPEG4_CORE                       2
+#define FF_PROFILE_MPEG4_MAIN                       3
+#define FF_PROFILE_MPEG4_N_BIT                      4
+#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE           5
+#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION      6
+#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE     7
+#define FF_PROFILE_MPEG4_HYBRID                     8
+#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME         9
+#define FF_PROFILE_MPEG4_CORE_SCALABLE             10
+#define FF_PROFILE_MPEG4_ADVANCED_CODING           11
+#define FF_PROFILE_MPEG4_ADVANCED_CORE             12
+#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
+#define FF_PROFILE_MPEG4_SIMPLE_STUDIO             14
+#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE           15
+
+    /**
+     * level
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int level;
+#define FF_LEVEL_UNKNOWN -99
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_loop_filter;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_idct;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_frame;
+
+    /**
+     * Header containing style information for text subtitles.
+     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
+     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
+     * the Format line following. It shouldn't include any Dialogue line.
+     * - encoding: Set/allocated/freed by user (before avcodec_open2())
+     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
+     */
+    uint8_t *subtitle_header;
+    int subtitle_header_size;
+
+    /**
+     * Simulates errors in the bitstream to test error concealment.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int error_rate;
+
+    /**
+     * Current packet as passed into the decoder, to avoid having
+     * to pass the packet into every function. Currently only valid
+     * inside lavc and get/release_buffer callbacks.
+     * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
+     * - encoding: unused
+     */
+    AVPacket *pkt;
+
+    /**
+     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
+     * Used for compliant TS muxing.
+     * - encoding: Set by libavcodec.
+     * - decoding: unused.
+     */
+    uint64_t vbv_delay;
+} AVCodecContext;
+
+/**
+ * AVProfile.
+ */
+typedef struct AVProfile {
+    int profile;
+    const char *name; ///< short name for the profile
+} AVProfile;
+
+typedef struct AVCodecDefault AVCodecDefault;
+
+struct AVSubtitle;
+
+/**
+ * AVCodec.
+ */
+typedef struct AVCodec {
+    /**
+     * Name of the codec implementation.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     * This is the primary way to find a codec from the user perspective.
+     */
+    const char *name;
+    /**
+     * Descriptive name for the codec, meant to be more human readable than name.
+     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
+     */
+    const char *long_name;
+    enum AVMediaType type;
+    enum AVCodecID id;
+    /**
+     * Codec capabilities.
+     * see CODEC_CAP_*
+     */
+    int capabilities;
+    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
+    const enum AVPixelFormat *pix_fmts;     ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
+    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
+    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
+    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
+    attribute_deprecated uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
+    const AVClass *priv_class;              ///< AVClass for the private context
+    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavcodec and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    int priv_data_size;
+    struct AVCodec *next;
+    /**
+     * @name Frame-level threading support functions
+     * @{
+     */
+    /**
+     * If defined, called on thread contexts when they are created.
+     * If the codec allocates writable tables in init(), re-allocate them here.
+     * priv_data will be set to a copy of the original.
+     */
+    int (*init_thread_copy)(AVCodecContext *);
+    /**
+     * Copy necessary context variables from a previous thread context to the current one.
+     * If not defined, the next thread will start automatically; otherwise, the codec
+     * must call ff_thread_finish_setup().
+     *
+     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
+     */
+    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
+    /** @} */
+
+    /**
+     * Private codec-specific defaults.
+     */
+    const AVCodecDefault *defaults;
+
+    /**
+     * Initialize codec static data, called from avcodec_register().
+     */
+    void (*init_static_data)(struct AVCodec *codec);
+
+    int (*init)(AVCodecContext *);
+    int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
+                      const struct AVSubtitle *sub);
+    /**
+     * Encode data to an AVPacket.
+     *
+     * @param      avctx          codec context
+     * @param      avpkt          output AVPacket (may contain a user-provided buffer)
+     * @param[in]  frame          AVFrame containing the raw data to be encoded
+     * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
+     *                            non-empty packet was returned in avpkt.
+     * @return 0 on success, negative error code on failure
+     */
+    int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
+                   int *got_packet_ptr);
+    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
+    int (*close)(AVCodecContext *);
+    /**
+     * Flush buffers.
+     * Will be called when seeking
+     */
+    void (*flush)(AVCodecContext *);
+} AVCodec;
+
+/**
+ * AVHWAccel.
+ */
+typedef struct AVHWAccel {
+    /**
+     * Name of the hardware accelerated codec.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     */
+    const char *name;
+
+    /**
+     * Type of codec implemented by the hardware accelerator.
+     *
+     * See AVMEDIA_TYPE_xxx
+     */
+    enum AVMediaType type;
+
+    /**
+     * Codec implemented by the hardware accelerator.
+     *
+     * See AV_CODEC_ID_xxx
+     */
+    enum AVCodecID id;
+
+    /**
+     * Supported pixel format.
+     *
+     * Only hardware accelerated formats are supported here.
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Hardware accelerated codec capabilities.
+     * see FF_HWACCEL_CODEC_CAP_*
+     */
+    int capabilities;
+
+    struct AVHWAccel *next;
+
+    /**
+     * Called at the beginning of each frame or field picture.
+     *
+     * Meaningful frame information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * Note that buf can be NULL along with buf_size set to 0.
+     * Otherwise, this means the whole frame is available at this point.
+     *
+     * @param avctx the codec context
+     * @param buf the frame data buffer base
+     * @param buf_size the size of the frame in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Callback for each slice.
+     *
+     * Meaningful slice information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @param buf the slice data buffer base
+     * @param buf_size the size of the slice in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Called at the end of each frame or field picture.
+     *
+     * The whole picture is parsed at this point and can now be sent
+     * to the hardware accelerator. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*end_frame)(AVCodecContext *avctx);
+
+    /**
+     * Size of HW accelerator private data.
+     *
+     * Private data is allocated with av_mallocz() before
+     * AVCodecContext.get_buffer() and deallocated after
+     * AVCodecContext.release_buffer().
+     */
+    int priv_data_size;
+} AVHWAccel;
+
+/**
+ * @defgroup lavc_picture AVPicture
+ *
+ * Functions for working with AVPicture
+ * @{
+ */
+
+/**
+ * four components are given, that's all.
+ * the last component is alpha
+ */
+typedef struct AVPicture {
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+    int linesize[AV_NUM_DATA_POINTERS];     ///< number of bytes per line
+} AVPicture;
+
+/**
+ * @}
+ */
+
+#define AVPALETTE_SIZE 1024
+#define AVPALETTE_COUNT 256
+
+enum AVSubtitleType {
+    SUBTITLE_NONE,
+
+    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
+
+    /**
+     * Plain text, the text field must be set by the decoder and is
+     * authoritative. ass and pict fields may contain approximations.
+     */
+    SUBTITLE_TEXT,
+
+    /**
+     * Formatted text, the ass field must be set by the decoder and is
+     * authoritative. pict and text fields may contain approximations.
+     */
+    SUBTITLE_ASS,
+};
+
+typedef struct AVSubtitleRect {
+    int x;         ///< top left corner  of pict, undefined when pict is not set
+    int y;         ///< top left corner  of pict, undefined when pict is not set
+    int w;         ///< width            of pict, undefined when pict is not set
+    int h;         ///< height           of pict, undefined when pict is not set
+    int nb_colors; ///< number of colors in pict, undefined when pict is not set
+
+    /**
+     * data+linesize for the bitmap of this subtitle.
+     * can be set for text/ass as well once they where rendered
+     */
+    AVPicture pict;
+    enum AVSubtitleType type;
+
+    char *text;                     ///< 0 terminated plain UTF-8 text
+
+    /**
+     * 0 terminated ASS/SSA compatible event line.
+     * The pressentation of this is unaffected by the other values in this
+     * struct.
+     */
+    char *ass;
+} AVSubtitleRect;
+
+typedef struct AVSubtitle {
+    uint16_t format; /* 0 = graphics */
+    uint32_t start_display_time; /* relative to packet pts, in ms */
+    uint32_t end_display_time; /* relative to packet pts, in ms */
+    unsigned num_rects;
+    AVSubtitleRect **rects;
+    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
+} AVSubtitle;
+
+/**
+ * If c is NULL, returns the first registered codec,
+ * if c is non-NULL, returns the next registered codec after c,
+ * or NULL if c is the last one.
+ */
+AVCodec *av_codec_next(const AVCodec *c);
+
+/**
+ * Return the LIBAVCODEC_VERSION_INT constant.
+ */
+unsigned avcodec_version(void);
+
+/**
+ * Return the libavcodec build-time configuration.
+ */
+const char *avcodec_configuration(void);
+
+/**
+ * Return the libavcodec license.
+ */
+const char *avcodec_license(void);
+
+/**
+ * Register the codec codec and initialize libavcodec.
+ *
+ * @warning either this function or avcodec_register_all() must be called
+ * before any other libavcodec functions.
+ *
+ * @see avcodec_register_all()
+ */
+void avcodec_register(AVCodec *codec);
+
+/**
+ * Register all the codecs, parsers and bitstream filters which were enabled at
+ * configuration time. If you do not call this function you can select exactly
+ * which formats you want to support, by using the individual registration
+ * functions.
+ *
+ * @see avcodec_register
+ * @see av_register_codec_parser
+ * @see av_register_bitstream_filter
+ */
+void avcodec_register_all(void);
+
+/**
+ * Allocate an AVCodecContext and set its fields to default values.  The
+ * resulting struct can be deallocated by calling avcodec_close() on it followed
+ * by av_free().
+ *
+ * @param codec if non-NULL, allocate private data and initialize defaults
+ *              for the given codec. It is illegal to then call avcodec_open2()
+ *              with a different codec.
+ *              If NULL, then the codec-specific defaults won't be initialized,
+ *              which may result in suboptimal default settings (this is
+ *              important mainly for encoders, e.g. libx264).
+ *
+ * @return An AVCodecContext filled with default values or NULL on failure.
+ * @see avcodec_get_context_defaults
+ */
+AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
+
+/**
+ * Set the fields of the given AVCodecContext to default values corresponding
+ * to the given codec (defaults may be codec-dependent).
+ *
+ * Do not call this function if a non-NULL codec has been passed
+ * to avcodec_alloc_context3() that allocated this AVCodecContext.
+ * If codec is non-NULL, it is illegal to call avcodec_open2() with a
+ * different codec on this AVCodecContext.
+ */
+int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
+
+/**
+ * Get the AVClass for AVCodecContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_class(void);
+
+/**
+ * Copy the settings of the source AVCodecContext into the destination
+ * AVCodecContext. The resulting destination codec context will be
+ * unopened, i.e. you are required to call avcodec_open2() before you
+ * can use this AVCodecContext to decode/encode video/audio data.
+ *
+ * @param dest target codec context, should be initialized with
+ *             avcodec_alloc_context3(), but otherwise uninitialized
+ * @param src source codec context
+ * @return AVERROR() on error (e.g. memory allocation error), 0 on success
+ */
+int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
+
+/**
+ * Allocate an AVFrame and set its fields to default values.  The resulting
+ * struct must be freed using avcodec_free_frame().
+ *
+ * @return An AVFrame filled with default values or NULL on failure.
+ * @see avcodec_get_frame_defaults
+ */
+AVFrame *avcodec_alloc_frame(void);
+
+/**
+ * Set the fields of the given AVFrame to default values.
+ *
+ * @param frame The AVFrame of which the fields should be set to default values.
+ */
+void avcodec_get_frame_defaults(AVFrame *frame);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ *
+ * @warning this function does NOT free the data buffers themselves
+ * (it does not know how, since they might have been allocated with
+ *  a custom get_buffer()).
+ */
+void avcodec_free_frame(AVFrame **frame);
+
+/**
+ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
+ * function the context has to be allocated with avcodec_alloc_context3().
+ *
+ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
+ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
+ * retrieving a codec.
+ *
+ * @warning This function is not thread safe!
+ *
+ * @code
+ * avcodec_register_all();
+ * av_dict_set(&opts, "b", "2.5M", 0);
+ * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
+ * if (!codec)
+ *     exit(1);
+ *
+ * context = avcodec_alloc_context3(codec);
+ *
+ * if (avcodec_open2(context, codec, opts) < 0)
+ *     exit(1);
+ * @endcode
+ *
+ * @param avctx The context to initialize.
+ * @param codec The codec to open this context for. If a non-NULL codec has been
+ *              previously passed to avcodec_alloc_context3() or
+ *              avcodec_get_context_defaults3() for this context, then this
+ *              parameter MUST be either NULL or equal to the previously passed
+ *              codec.
+ * @param options A dictionary filled with AVCodecContext and codec-private options.
+ *                On return this object will be filled with options that were not found.
+ *
+ * @return zero on success, a negative value on error
+ * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
+ *      av_dict_set(), av_opt_find().
+ */
+int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
+
+/**
+ * Close a given AVCodecContext and free all the data associated with it
+ * (but not the AVCodecContext itself).
+ *
+ * Calling this function on an AVCodecContext that hasn't been opened will free
+ * the codec-specific data allocated in avcodec_alloc_context3() /
+ * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
+ * do nothing.
+ */
+int avcodec_close(AVCodecContext *avctx);
+
+/**
+ * Free all allocated data in the given subtitle struct.
+ *
+ * @param sub AVSubtitle to free.
+ */
+void avsubtitle_free(AVSubtitle *sub);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_packet
+ * @{
+ */
+
+/**
+ * Default packet destructor.
+ */
+void av_destruct_packet(AVPacket *pkt);
+
+/**
+ * Initialize optional fields of a packet with default values.
+ *
+ * Note, this does not touch the data and size members, which have to be
+ * initialized separately.
+ *
+ * @param pkt packet
+ */
+void av_init_packet(AVPacket *pkt);
+
+/**
+ * Allocate the payload of a packet and initialize its fields with
+ * default values.
+ *
+ * @param pkt packet
+ * @param size wanted payload size
+ * @return 0 if OK, AVERROR_xxx otherwise
+ */
+int av_new_packet(AVPacket *pkt, int size);
+
+/**
+ * Reduce packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param size new size
+ */
+void av_shrink_packet(AVPacket *pkt, int size);
+
+/**
+ * Increase packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param grow_by number of bytes by which to increase the size of the packet
+ */
+int av_grow_packet(AVPacket *pkt, int grow_by);
+
+/**
+ * @warning This is a hack - the packet memory allocation stuff is broken. The
+ * packet is allocated if it was not really allocated.
+ */
+int av_dup_packet(AVPacket *pkt);
+
+/**
+ * Free a packet.
+ *
+ * @param pkt packet to free
+ */
+void av_free_packet(AVPacket *pkt);
+
+/**
+ * Allocate new information of a packet.
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size side information size
+ * @return pointer to fresh allocated data or NULL otherwise
+ */
+uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int size);
+
+/**
+ * Shrink the already allocated side data buffer
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size new side information size
+ * @return 0 on success, < 0 on failure
+ */
+int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                               int size);
+
+/**
+ * Get side information from packet.
+ *
+ * @param pkt packet
+ * @param type desired side information type
+ * @param size pointer for side information size to store (optional)
+ * @return pointer to data if present or NULL otherwise
+ */
+uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int *size);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_decoding
+ * @{
+ */
+
+/**
+ * Find a registered decoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder(enum AVCodecID id);
+
+/**
+ * Find a registered decoder with the specified name.
+ *
+ * @param name name of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder_by_name(const char *name);
+
+int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
+void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
+int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
+
+/**
+ * Return the amount of padding in pixels which the get_buffer callback must
+ * provide around the edge of the image for codecs which do not have the
+ * CODEC_FLAG_EMU_EDGE flag.
+ *
+ * @return Required padding in pixels.
+ */
+unsigned avcodec_get_edge_width(void);
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you do not use any horizontal
+ * padding.
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ * according to avcodec_get_edge_width() before.
+ */
+void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you also ensure that all
+ * line sizes are a multiple of the respective linesize_align[i].
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
+ * according to avcodec_get_edge_width() before.
+ */
+void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
+                               int linesize_align[AV_NUM_DATA_POINTERS]);
+
+#if FF_API_OLD_DECODE_AUDIO
+/**
+ * Wrapper function which calls avcodec_decode_audio4.
+ *
+ * @deprecated Use avcodec_decode_audio4 instead.
+ *
+ * Decode the audio frame of size avpkt->size from avpkt->data into samples.
+ * Some decoders may support multiple frames in a single AVPacket, such
+ * decoders would then just decode the first frame. In this case,
+ * avcodec_decode_audio3 has to be called again with an AVPacket that contains
+ * the remaining data in order to decode the second frame etc.
+ * If no frame
+ * could be outputted, frame_size_ptr is zero. Otherwise, it is the
+ * decompressed frame size in bytes.
+ *
+ * @warning You must set frame_size_ptr to the allocated size of the
+ * output buffer before calling avcodec_decode_audio3().
+ *
+ * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ * the actual read bytes because some optimized bitstream readers read 32 or 64
+ * bits at once and could read over the end.
+ *
+ * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
+ * no overreading happens for damaged MPEG streams.
+ *
+ * @warning You must not provide a custom get_buffer() when using
+ * avcodec_decode_audio3().  Doing so will override it with
+ * avcodec_default_get_buffer.  Use avcodec_decode_audio4() instead,
+ * which does allow the application to provide a custom get_buffer().
+ *
+ * @note You might have to align the input buffer avpkt->data and output buffer
+ * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
+ * necessary at all, on others it won't work at all if not aligned and on others
+ * it will work but it will have an impact on performance.
+ *
+ * In practice, avpkt->data should have 4 byte alignment at minimum and
+ * samples should be 16 byte aligned unless the CPU doesn't need it
+ * (AltiVec and SSE do).
+ *
+ * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ * between input and output, these need to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to return the remaining frames.
+ *
+ * @param avctx the codec context
+ * @param[out] samples the output buffer, sample type in avctx->sample_fmt
+ *                     If the sample format is planar, each channel plane will
+ *                     be the same size, with no padding between channels.
+ * @param[in,out] frame_size_ptr the output buffer size in bytes
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+ *            You can create such packet with av_init_packet() and by then setting
+ *            data and size, some decoders might in addition need other fields.
+ *            All decoders are designed to use the least fields possible though.
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame data was decompressed (used) from the input AVPacket.
+ */
+attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
+                         int *frame_size_ptr,
+                         AVPacket *avpkt);
+#endif
+
+/**
+ * Decode the audio frame of size avpkt->size from avpkt->data into frame.
+ *
+ * Some decoders may support multiple frames in a single AVPacket. Such
+ * decoders would then just decode the first frame. In this case,
+ * avcodec_decode_audio4 has to be called again with an AVPacket containing
+ * the remaining data in order to decode the second frame, etc...
+ * Even if no frames are returned, the packet needs to be fed to the decoder
+ * with remaining data until it is completely consumed or an error occurs.
+ *
+ * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ *          larger than the actual read bytes because some optimized bitstream
+ *          readers read 32 or 64 bits at once and could read over the end.
+ *
+ * @note You might have to align the input buffer. The alignment requirements
+ *       depend on the CPU and the decoder.
+ *
+ * @param      avctx the codec context
+ * @param[out] frame The AVFrame in which to store decoded audio samples.
+ *                   Decoders request a buffer of a particular size by setting
+ *                   AVFrame.nb_samples prior to calling get_buffer(). The
+ *                   decoder may, however, only utilize part of the buffer by
+ *                   setting AVFrame.nb_samples to a smaller value in the
+ *                   output frame.
+ * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
+ *                           non-zero.
+ * @param[in]  avpkt The input AVPacket containing the input buffer.
+ *                   At least avpkt->data and avpkt->size should be set. Some
+ *                   decoders might also require additional fields to be set.
+ * @return A negative error code is returned if an error occurred during
+ *         decoding, otherwise the number of bytes consumed from the input
+ *         AVPacket is returned.
+ */
+int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
+                          int *got_frame_ptr, AVPacket *avpkt);
+
+/**
+ * Decode the video frame of size avpkt->size from avpkt->data into picture.
+ * Some decoders may support multiple frames in a single AVPacket, such
+ * decoders would then just decode the first frame.
+ *
+ * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ * the actual read bytes because some optimized bitstream readers read 32 or 64
+ * bits at once and could read over the end.
+ *
+ * @warning The end of the input buffer buf should be set to 0 to ensure that
+ * no overreading happens for damaged MPEG streams.
+ *
+ * @note You might have to align the input buffer avpkt->data.
+ * The alignment requirements depend on the CPU: on some CPUs it isn't
+ * necessary at all, on others it won't work at all if not aligned and on others
+ * it will work but it will have an impact on performance.
+ *
+ * In practice, avpkt->data should have 4 byte alignment at minimum.
+ *
+ * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ * between input and output, these need to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to return the remaining frames.
+ *
+ * @param avctx the codec context
+ * @param[out] picture The AVFrame in which the decoded video frame will be stored.
+ *             Use avcodec_alloc_frame to get an AVFrame, the codec will
+ *             allocate memory for the actual bitmap.
+ *             with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit.
+ *             with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder
+ *                   decodes and the decoder tells the user once it does not need the data anymore,
+ *                   the user app can at this point free/reuse/keep the memory as it sees fit.
+ *
+ * @param[in] avpkt The input AVpacket containing the input buffer.
+ *            You can create such packet with av_init_packet() and by then setting
+ *            data and size, some decoders might in addition need other fields like
+ *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
+ *            fields possible.
+ * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame could be decompressed.
+ */
+int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
+                         int *got_picture_ptr,
+                         AVPacket *avpkt);
+
+/**
+ * Decode a subtitle message.
+ * Return a negative value on error, otherwise return the number of bytes used.
+ * If no subtitle could be decompressed, got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in *sub.
+ * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * simplicity, because the performance difference is expect to be negligible
+ * and reusing a get_buffer written for video codecs would probably perform badly
+ * due to a potentially very different allocation pattern.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
+                   freed with avsubtitle_free if *got_sub_ptr is set.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+ */
+int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
+                            int *got_sub_ptr,
+                            AVPacket *avpkt);
+
+/**
+ * @defgroup lavc_parsing Frame parsing
+ * @{
+ */
+
+typedef struct AVCodecParserContext {
+    void *priv_data;
+    struct AVCodecParser *parser;
+    int64_t frame_offset; /* offset of the current frame */
+    int64_t cur_offset; /* current offset
+                           (incremented by each av_parser_parse()) */
+    int64_t next_frame_offset; /* offset of the next frame */
+    /* video info */
+    int pict_type; /* XXX: Put it back in AVCodecContext. */
+    /**
+     * This field is used for proper frame duration computation in lavf.
+     * It signals, how much longer the frame duration of the current frame
+     * is compared to normal frame duration.
+     *
+     * frame_duration = (1 + repeat_pict) * time_base
+     *
+     * It is used by codecs like H.264 to display telecined material.
+     */
+    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
+    int64_t pts;     /* pts of the current frame */
+    int64_t dts;     /* dts of the current frame */
+
+    /* private data */
+    int64_t last_pts;
+    int64_t last_dts;
+    int fetch_timestamp;
+
+#define AV_PARSER_PTS_NB 4
+    int cur_frame_start_index;
+    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
+    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
+    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
+
+    int flags;
+#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
+#define PARSER_FLAG_ONCE                      0x0002
+/// Set if the parser has a valid file offset
+#define PARSER_FLAG_FETCHED_OFFSET            0x0004
+
+    int64_t offset;      ///< byte offset from starting packet start
+    int64_t cur_frame_end[AV_PARSER_PTS_NB];
+
+    /**
+     * Set by parser to 1 for key frames and 0 for non-key frames.
+     * It is initialized to -1, so if the parser doesn't set this flag,
+     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
+     * will be used.
+     */
+    int key_frame;
+
+    /**
+     * Time difference in stream time base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current frame.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+
+    // Timestamp generation support:
+    /**
+     * Synchronization point for start of timestamp generation.
+     *
+     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
+     * (default).
+     *
+     * For example, this corresponds to presence of H.264 buffering period
+     * SEI message.
+     */
+    int dts_sync_point;
+
+    /**
+     * Offset of the current timestamp against last timestamp sync point in
+     * units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain a valid timestamp offset.
+     *
+     * Note that the timestamp of sync point has usually a nonzero
+     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
+     * the next frame after timestamp sync point will be usually 1.
+     *
+     * For example, this corresponds to H.264 cpb_removal_delay.
+     */
+    int dts_ref_dts_delta;
+
+    /**
+     * Presentation delay of current frame in units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain valid non-negative timestamp delta (presentation time of a frame
+     * must not lie in the past).
+     *
+     * This delay represents the difference between decoding and presentation
+     * time of the frame.
+     *
+     * For example, this corresponds to H.264 dpb_output_delay.
+     */
+    int pts_dts_delta;
+
+    /**
+     * Position of the packet in file.
+     *
+     * Analogous to cur_frame_pts/dts
+     */
+    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
+
+    /**
+     * Byte position of currently parsed frame in stream.
+     */
+    int64_t pos;
+
+    /**
+     * Previous frame byte position.
+     */
+    int64_t last_pos;
+
+    /**
+     * Duration of the current frame.
+     * For audio, this is in units of 1 / AVCodecContext.sample_rate.
+     * For all other types, this is in units of AVCodecContext.time_base.
+     */
+    int duration;
+} AVCodecParserContext;
+
+typedef struct AVCodecParser {
+    int codec_ids[5]; /* several codec IDs are permitted */
+    int priv_data_size;
+    int (*parser_init)(AVCodecParserContext *s);
+    int (*parser_parse)(AVCodecParserContext *s,
+                        AVCodecContext *avctx,
+                        const uint8_t **poutbuf, int *poutbuf_size,
+                        const uint8_t *buf, int buf_size);
+    void (*parser_close)(AVCodecParserContext *s);
+    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
+    struct AVCodecParser *next;
+} AVCodecParser;
+
+AVCodecParser *av_parser_next(AVCodecParser *c);
+
+void av_register_codec_parser(AVCodecParser *parser);
+AVCodecParserContext *av_parser_init(int codec_id);
+
+/**
+ * Parse a packet.
+ *
+ * @param s             parser context.
+ * @param avctx         codec context.
+ * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
+ * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
+ * @param buf           input buffer.
+ * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
+ * @param pts           input presentation timestamp.
+ * @param dts           input decoding timestamp.
+ * @param pos           input byte position in stream.
+ * @return the number of bytes of the input bitstream used.
+ *
+ * Example:
+ * @code
+ *   while(in_len){
+ *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
+ *                                        in_data, in_len,
+ *                                        pts, dts, pos);
+ *       in_data += len;
+ *       in_len  -= len;
+ *
+ *       if(size)
+ *          decode_frame(data, size);
+ *   }
+ * @endcode
+ */
+int av_parser_parse2(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size,
+                     int64_t pts, int64_t dts,
+                     int64_t pos);
+
+int av_parser_change(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size, int keyframe);
+void av_parser_close(AVCodecParserContext *s);
+
+/**
+ * @}
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_encoding
+ * @{
+ */
+
+/**
+ * Find a registered encoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder(enum AVCodecID id);
+
+/**
+ * Find a registered encoder with the specified name.
+ *
+ * @param name name of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder_by_name(const char *name);
+
+#if FF_API_OLD_ENCODE_AUDIO
+/**
+ * Encode an audio frame from samples into buf.
+ *
+ * @deprecated Use avcodec_encode_audio2 instead.
+ *
+ * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
+ * However, for codecs with avctx->frame_size equal to 0 (e.g. PCM) the user
+ * will know how much space is needed because it depends on the value passed
+ * in buf_size as described below. In that case a lower value can be used.
+ *
+ * @param avctx the codec context
+ * @param[out] buf the output buffer
+ * @param[in] buf_size the output buffer size
+ * @param[in] samples the input buffer containing the samples
+ * The number of samples read from this buffer is frame_size*channels,
+ * both of which are defined in avctx.
+ * For codecs which have avctx->frame_size equal to 0 (e.g. PCM) the number of
+ * samples read from samples is equal to:
+ * buf_size * 8 / (avctx->channels * av_get_bits_per_sample(avctx->codec_id))
+ * This also implies that av_get_bits_per_sample() must not return 0 for these
+ * codecs.
+ * @return On error a negative value is returned, on success zero or the number
+ * of bytes used to encode the data read from the input buffer.
+ */
+int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
+                                              uint8_t *buf, int buf_size,
+                                              const short *samples);
+#endif
+
+/**
+ * Encode a frame of audio.
+ *
+ * Takes input samples from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay, split, and combine input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw audio data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ *                  If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ *                  can have any number of samples.
+ *                  If it is not set, frame->nb_samples must be equal to
+ *                  avctx->frame_size for all frames except the last.
+ *                  The final frame may be smaller than avctx->frame_size.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+#if FF_API_OLD_ENCODE_VIDEO
+/**
+ * @deprecated use avcodec_encode_video2() instead.
+ *
+ * Encode a video frame from pict into buf.
+ * The input picture should be
+ * stored using a specific format, namely avctx.pix_fmt.
+ *
+ * @param avctx the codec context
+ * @param[out] buf the output buffer for the bitstream of encoded frame
+ * @param[in] buf_size the size of the output buffer in bytes
+ * @param[in] pict the input picture to encode
+ * @return On error a negative value is returned, on success zero or the number
+ * of bytes used from the output buffer.
+ */
+attribute_deprecated
+int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+                         const AVFrame *pict);
+#endif
+
+/**
+ * Encode a frame of video.
+ *
+ * Takes input raw video data from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay and reorder input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet. The returned data (if any) belongs to the
+ *                  caller, he is responsible for freeing it.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw video data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+                            const AVSubtitle *sub);
+
+
+/**
+ * @}
+ */
+
+#if FF_API_AVCODEC_RESAMPLE
+/**
+ * @defgroup lavc_resample Audio resampling
+ * @ingroup libavc
+ * @deprecated use libavresample instead
+ *
+ * @{
+ */
+struct ReSampleContext;
+struct AVResampleContext;
+
+typedef struct ReSampleContext ReSampleContext;
+
+/**
+ *  Initialize audio resampling context.
+ *
+ * @param output_channels  number of output channels
+ * @param input_channels   number of input channels
+ * @param output_rate      output sample rate
+ * @param input_rate       input sample rate
+ * @param sample_fmt_out   requested output sample format
+ * @param sample_fmt_in    input sample format
+ * @param filter_length    length of each FIR filter in the filterbank relative to the cutoff frequency
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear           if 1 then the used FIR filter will be linearly interpolated
+                           between the 2 closest, if 0 the closest will be used
+ * @param cutoff           cutoff frequency, 1.0 corresponds to half the output sampling rate
+ * @return allocated ReSampleContext, NULL if error occurred
+ */
+attribute_deprecated
+ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
+                                        int output_rate, int input_rate,
+                                        enum AVSampleFormat sample_fmt_out,
+                                        enum AVSampleFormat sample_fmt_in,
+                                        int filter_length, int log2_phase_count,
+                                        int linear, double cutoff);
+
+attribute_deprecated
+int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
+
+/**
+ * Free resample context.
+ *
+ * @param s a non-NULL pointer to a resample context previously
+ *          created with av_audio_resample_init()
+ */
+attribute_deprecated
+void audio_resample_close(ReSampleContext *s);
+
+
+/**
+ * Initialize an audio resampler.
+ * Note, if either rate is not an integer then simply scale both rates up so they are.
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear If 1 then the used FIR filter will be linearly interpolated
+                 between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+ */
+attribute_deprecated
+struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
+
+/**
+ * Resample an array of samples using a previously configured context.
+ * @param src an array of unconsumed samples
+ * @param consumed the number of samples of src which have been consumed are returned here
+ * @param src_size the number of unconsumed samples available
+ * @param dst_size the amount of space in samples available in dst
+ * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
+ * @return the number of samples written in dst or -1 if an error occurred
+ */
+attribute_deprecated
+int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
+
+
+/**
+ * Compensate samplerate/timestamp drift. The compensation is done by changing
+ * the resampler parameters, so no audible clicks or similar distortions occur
+ * @param compensation_distance distance in output samples over which the compensation should be performed
+ * @param sample_delta number of output samples which should be output less
+ *
+ * example: av_resample_compensate(c, 10, 500)
+ * here instead of 510 samples only 500 samples would be output
+ *
+ * note, due to rounding the actual compensation might be slightly different,
+ * especially if the compensation_distance is large and the in_rate used during init is small
+ */
+attribute_deprecated
+void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
+attribute_deprecated
+void av_resample_close(struct AVResampleContext *c);
+
+/**
+ * @}
+ */
+#endif
+
+/**
+ * @addtogroup lavc_picture
+ * @{
+ */
+
+/**
+ * Allocate memory for a picture.  Call avpicture_free() to free it.
+ *
+ * @see avpicture_fill()
+ *
+ * @param picture the picture to be filled in
+ * @param pix_fmt the format of the picture
+ * @param width the width of the picture
+ * @param height the height of the picture
+ * @return zero if successful, a negative value if not
+ */
+int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Free a picture previously allocated by avpicture_alloc().
+ * The data buffer used by the AVPicture is freed, but the AVPicture structure
+ * itself is not.
+ *
+ * @param picture the AVPicture to be freed
+ */
+void avpicture_free(AVPicture *picture);
+
+/**
+ * Fill in the AVPicture fields.
+ * The fields of the given AVPicture are filled in by using the 'ptr' address
+ * which points to the image data buffer. Depending on the specified picture
+ * format, one or multiple image data pointers and line sizes will be set.
+ * If a planar format is specified, several pointers will be set pointing to
+ * the different picture planes and the line sizes of the different planes
+ * will be stored in the lines_sizes array.
+ * Call with ptr == NULL to get the required size for the ptr buffer.
+ *
+ * To allocate the buffer and fill in the AVPicture fields in one call,
+ * use avpicture_alloc().
+ *
+ * @param picture AVPicture whose fields are to be filled in
+ * @param ptr Buffer which will contain or contains the actual image data
+ * @param pix_fmt The format in which the picture data is stored.
+ * @param width the width of the image in pixels
+ * @param height the height of the image in pixels
+ * @return size of the image data in bytes
+ */
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
+                   enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Copy pixel data from an AVPicture into a buffer.
+ * The data is stored compactly, without any gaps for alignment or padding
+ * which may be applied by avpicture_fill().
+ *
+ * @see avpicture_get_size()
+ *
+ * @param[in] src AVPicture containing image data
+ * @param[in] pix_fmt The format in which the picture data is stored.
+ * @param[in] width the width of the image in pixels.
+ * @param[in] height the height of the image in pixels.
+ * @param[out] dest A buffer into which picture data will be copied.
+ * @param[in] dest_size The size of 'dest'.
+ * @return The number of bytes written to dest, or a negative value (error code) on error.
+ */
+int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
+                     int width, int height,
+                     unsigned char *dest, int dest_size);
+
+/**
+ * Calculate the size in bytes that a picture of the given width and height
+ * would occupy if stored in the given picture format.
+ * Note that this returns the size of a compact representation as generated
+ * by avpicture_layout(), which can be smaller than the size required for e.g.
+ * avpicture_fill().
+ *
+ * @param pix_fmt the given picture format
+ * @param width the width of the image
+ * @param height the height of the image
+ * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
+ */
+int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ *  deinterlace - if not supported return -1
+ */
+int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
+                          enum AVPixelFormat pix_fmt, int width, int height);
+/**
+ * Copy image src to dst. Wraps av_picture_data_copy() above.
+ */
+void av_picture_copy(AVPicture *dst, const AVPicture *src,
+                     enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Crop image top and left side.
+ */
+int av_picture_crop(AVPicture *dst, const AVPicture *src,
+                    enum AVPixelFormat pix_fmt, int top_band, int left_band);
+
+/**
+ * Pad image.
+ */
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
+            int padtop, int padbottom, int padleft, int padright, int *color);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup lavc_misc Utility functions
+ * @ingroup libavc
+ *
+ * Miscellaneous utility functions related to both encoding and decoding
+ * (or neither).
+ * @{
+ */
+
+/**
+ * @defgroup lavc_misc_pixfmt Pixel formats
+ *
+ * Functions for working with pixel formats.
+ * @{
+ */
+
+void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
+
+/**
+ * Return a value representing the fourCC code associated to the
+ * pixel format pix_fmt, or 0 if no associated fourCC code can be
+ * found.
+ */
+unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
+
+#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
+#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
+#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
+#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
+#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
+#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
+
+/**
+ * Compute what kind of losses will occur when converting from one specific
+ * pixel format to another.
+ * When converting from one pixel format to another, information loss may occur.
+ * For example, when converting from RGB24 to GRAY, the color information will
+ * be lost. Similarly, other losses occur when converting from some formats to
+ * other formats. These losses can involve loss of chroma, but also loss of
+ * resolution, loss of color depth, loss due to the color space conversion, loss
+ * of the alpha bits or loss due to color quantization.
+ * avcodec_get_fix_fmt_loss() informs you about the various types of losses
+ * which will occur when converting from one pixel format to another.
+ *
+ * @param[in] dst_pix_fmt destination pixel format
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @return Combination of flags informing you what kind of losses will occur.
+ */
+int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
+                             int has_alpha);
+
+#if FF_API_FIND_BEST_PIX_FMT
+/**
+ * @deprecated use avcodec_find_best_pix_fmt2() instead.
+ *
+ * Find the best pixel format to convert to given a certain source pixel
+ * format.  When converting from one pixel format to another, information loss
+ * may occur.  For example, when converting from RGB24 to GRAY, the color
+ * information will be lost. Similarly, other losses occur when converting from
+ * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
+ * the given pixel formats should be used to suffer the least amount of loss.
+ * The pixel formats from which it chooses one, are determined by the
+ * pix_fmt_mask parameter.
+ *
+ * @code
+ * src_pix_fmt = AV_PIX_FMT_YUV420P;
+ * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) || (1 << AV_PIX_FMT_RGB24);
+ * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
+ * @endcode
+ *
+ * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
+ * @return The best pixel format to convert to or -1 if none was found.
+ */
+attribute_deprecated
+enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
+                              int has_alpha, int *loss_ptr);
+#endif /* FF_API_FIND_BEST_PIX_FMT */
+
+/**
+ * Find the best pixel format to convert to given a certain source pixel
+ * format.  When converting from one pixel format to another, information loss
+ * may occur.  For example, when converting from RGB24 to GRAY, the color
+ * information will be lost. Similarly, other losses occur when converting from
+ * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
+ * the given pixel formats should be used to suffer the least amount of loss.
+ * The pixel formats from which it chooses one, are determined by the
+ * pix_fmt_list parameter.
+ *
+ *
+ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
+ * @return The best pixel format to convert to or -1 if none was found.
+ */
+enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
+                                              enum AVPixelFormat src_pix_fmt,
+                                              int has_alpha, int *loss_ptr);
+
+enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+/**
+ * @}
+ */
+
+void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
+
+/**
+ * Put a string representing the codec tag codec_tag in buf.
+ *
+ * @param buf_size size in bytes of buf
+ * @return the length of the string that would have been generated if
+ * enough space had been available, excluding the trailing null
+ */
+size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
+
+void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
+
+/**
+ * Return a name for the specified profile, if available.
+ *
+ * @param codec the codec that is searched for the given profile
+ * @param profile the profile value for which a name is requested
+ * @return A name for the profile if found, NULL otherwise.
+ */
+const char *av_get_profile_name(const AVCodec *codec, int profile);
+
+int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
+int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
+//FIXME func typedef
+
+/**
+ * Fill audio frame data and linesize.
+ * AVFrame extended_data channel pointers are allocated if necessary for
+ * planar audio.
+ *
+ * @param frame       the AVFrame
+ *                    frame->nb_samples must be set prior to calling the
+ *                    function. This function fills in frame->data,
+ *                    frame->extended_data, frame->linesize[0].
+ * @param nb_channels channel count
+ * @param sample_fmt  sample format
+ * @param buf         buffer to use for frame data
+ * @param buf_size    size of buffer
+ * @param align       plane size sample alignment (0 = default)
+ * @return            0 on success, negative error code on failure
+ */
+int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
+                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
+                             int buf_size, int align);
+
+/**
+ * Flush buffers, should be called when seeking or when switching to a different stream.
+ */
+void avcodec_flush_buffers(AVCodecContext *avctx);
+
+void avcodec_default_free_buffers(AVCodecContext *s);
+
+/**
+ * Return codec bits per sample.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return codec bits per sample.
+ * Only return non-zero if the bits per sample is exactly correct, not an
+ * approximation.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return audio frame duration.
+ *
+ * @param avctx        codec context
+ * @param frame_bytes  size of the frame, or 0 if unknown
+ * @return             frame duration, in samples, if known. 0 if not able to
+ *                     determine.
+ */
+int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
+
+
+typedef struct AVBitStreamFilterContext {
+    void *priv_data;
+    struct AVBitStreamFilter *filter;
+    AVCodecParserContext *parser;
+    struct AVBitStreamFilterContext *next;
+} AVBitStreamFilterContext;
+
+
+typedef struct AVBitStreamFilter {
+    const char *name;
+    int priv_data_size;
+    int (*filter)(AVBitStreamFilterContext *bsfc,
+                  AVCodecContext *avctx, const char *args,
+                  uint8_t **poutbuf, int *poutbuf_size,
+                  const uint8_t *buf, int buf_size, int keyframe);
+    void (*close)(AVBitStreamFilterContext *bsfc);
+    struct AVBitStreamFilter *next;
+} AVBitStreamFilter;
+
+void av_register_bitstream_filter(AVBitStreamFilter *bsf);
+AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
+int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
+                               AVCodecContext *avctx, const char *args,
+                               uint8_t **poutbuf, int *poutbuf_size,
+                               const uint8_t *buf, int buf_size, int keyframe);
+void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
+
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
+
+/* memory */
+
+/**
+ * Reallocate the given block if it is not large enough, otherwise do nothing.
+ *
+ * @see av_realloc
+ */
+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer, reusing the given one if large enough.
+ *
+ * Contrary to av_fast_realloc the current buffer contents might not be
+ * preserved and on error the old buffer is freed, thus no special
+ * handling to avoid memleaks is necessary.
+ *
+ * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
+ * @param size size of the buffer *ptr points to
+ * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
+ *                 *size 0 if an error occurred.
+ */
+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer with padding, reusing the given one if large enough.
+ *
+ * Same behaviour av_fast_malloc but the buffer has additional
+ * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
+ *
+ */
+void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Encode extradata length to a buffer. Used by xiph codecs.
+ *
+ * @param s buffer to write to; must be at least (v/255+1) bytes long
+ * @param v size of extradata in bytes
+ * @return number of bytes written to the buffer.
+ */
+unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+
+/**
+ * Log a generic warning message about a missing feature. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] feature string containing the name of the missing feature
+ * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
+ * If want_sample is non-zero, additional verbage will be added to the log
+ * message which tells the user how to report samples to the development
+ * mailing list.
+ */
+void av_log_missing_feature(void *avc, const char *feature, int want_sample);
+
+/**
+ * Log a generic warning message asking for a sample. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] msg string containing an optional message, or NULL if no message
+ */
+void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
+
+/**
+ * Register the hardware accelerator hwaccel.
+ */
+void av_register_hwaccel(AVHWAccel *hwaccel);
+
+/**
+ * If hwaccel is NULL, returns the first registered hardware accelerator,
+ * if hwaccel is non-NULL, returns the next registered hardware accelerator
+ * after hwaccel, or NULL if hwaccel is the last one.
+ */
+AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
+
+
+/**
+ * Lock operation used by lockmgr
+ */
+enum AVLockOp {
+  AV_LOCK_CREATE,  ///< Create a mutex
+  AV_LOCK_OBTAIN,  ///< Lock the mutex
+  AV_LOCK_RELEASE, ///< Unlock the mutex
+  AV_LOCK_DESTROY, ///< Free mutex resources
+};
+
+/**
+ * Register a user provided lock manager supporting the operations
+ * specified by AVLockOp. mutex points to a (void *) where the
+ * lockmgr should store/get a pointer to a user allocated mutex. It's
+ * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
+ *
+ * @param cb User defined callback. Note: Libav may invoke calls to this
+ *           callback during the call to av_lockmgr_register().
+ *           Thus, the application must be prepared to handle that.
+ *           If cb is set to NULL the lockmgr will be unregistered.
+ *           Also note that during unregistration the previously registered
+ *           lockmgr callback may also be invoked.
+ */
+int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
+
+/**
+ * Get the type of the given codec.
+ */
+enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
+
+/**
+ * @return a positive value if s is open (i.e. avcodec_open2() was called on it
+ * with no corresponding avcodec_close()), 0 otherwise.
+ */
+int avcodec_is_open(AVCodecContext *s);
+
+/**
+ * @return a non-zero number if codec is an encoder, zero otherwise
+ */
+int av_codec_is_encoder(const AVCodec *codec);
+
+/**
+ * @return a non-zero number if codec is a decoder, zero otherwise
+ */
+int av_codec_is_decoder(const AVCodec *codec);
+
+/**
+ * @return descriptor for given codec ID or NULL if no descriptor exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
+
+/**
+ * Iterate over all codec descriptors known to libavcodec.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
+
+/**
+ * @return codec descriptor with the given name or NULL if no such descriptor
+ *         exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVCODEC_H */
diff --git a/misc/winutils/include/libavcodec/avfft.h b/misc/winutils/include/libavcodec/avfft.h
new file mode 100644
index 0000000..b896182
--- /dev/null
+++ b/misc/winutils/include/libavcodec/avfft.h
@@ -0,0 +1,116 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVFFT_H
+#define AVCODEC_AVFFT_H
+
+/**
+ * @file
+ * @ingroup lavc_fft
+ * FFT functions
+ */
+
+/**
+ * @defgroup lavc_fft FFT functions
+ * @ingroup lavc_misc
+ *
+ * @{
+ */
+
+typedef float FFTSample;
+
+typedef struct FFTComplex {
+    FFTSample re, im;
+} FFTComplex;
+
+typedef struct FFTContext FFTContext;
+
+/**
+ * Set up a complex FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
+ */
+FFTContext *av_fft_init(int nbits, int inverse);
+
+/**
+ * Do the permutation needed BEFORE calling ff_fft_calc().
+ */
+void av_fft_permute(FFTContext *s, FFTComplex *z);
+
+/**
+ * Do a complex FFT with the parameters defined in av_fft_init(). The
+ * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
+ */
+void av_fft_calc(FFTContext *s, FFTComplex *z);
+
+void av_fft_end(FFTContext *s);
+
+FFTContext *av_mdct_init(int nbits, int inverse, double scale);
+void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_end(FFTContext *s);
+
+/* Real Discrete Fourier Transform */
+
+enum RDFTransformType {
+    DFT_R2C,
+    IDFT_C2R,
+    IDFT_R2C,
+    DFT_C2R,
+};
+
+typedef struct RDFTContext RDFTContext;
+
+/**
+ * Set up a real FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param trans           the type of transform
+ */
+RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
+void av_rdft_calc(RDFTContext *s, FFTSample *data);
+void av_rdft_end(RDFTContext *s);
+
+/* Discrete Cosine Transform */
+
+typedef struct DCTContext DCTContext;
+
+enum DCTTransformType {
+    DCT_II = 0,
+    DCT_III,
+    DCT_I,
+    DST_I,
+};
+
+/**
+ * Set up DCT.
+ * @param nbits           size of the input array:
+ *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
+ *                        (1 << nbits) + 1 for DCT-I
+ *
+ * @note the first element of the input of DST-I is ignored
+ */
+DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
+void av_dct_calc(DCTContext *s, FFTSample *data);
+void av_dct_end (DCTContext *s);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVFFT_H */
diff --git a/misc/winutils/include/libavcodec/dxva2.h b/misc/winutils/include/libavcodec/dxva2.h
new file mode 100644
index 0000000..c06f1f3
--- /dev/null
+++ b/misc/winutils/include/libavcodec/dxva2.h
@@ -0,0 +1,88 @@
+/*
+ * DXVA2 HW acceleration
+ *
+ * copyright (c) 2009 Laurent Aimar
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_DXVA_H
+#define AVCODEC_DXVA_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_dxva2
+ * Public libavcodec DXVA2 header.
+ */
+
+#include <stdint.h>
+
+#include <d3d9.h>
+#include <dxva2api.h>
+
+/**
+ * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
+
+/**
+ * This structure is used to provides the necessary configurations and data
+ * to the DXVA2 Libav HWAccel implementation.
+ *
+ * The application must make it available as AVCodecContext.hwaccel_context.
+ */
+struct dxva_context {
+    /**
+     * DXVA2 decoder object
+     */
+    IDirectXVideoDecoder *decoder;
+
+    /**
+     * DXVA2 configuration used to create the decoder
+     */
+    const DXVA2_ConfigPictureDecode *cfg;
+
+    /**
+     * The number of surface in the surface array
+     */
+    unsigned surface_count;
+
+    /**
+     * The array of Direct3D surfaces used to create the decoder
+     */
+    LPDIRECT3DSURFACE9 *surface;
+
+    /**
+     * A bit field configuring the workarounds needed for using the decoder
+     */
+    uint64_t workaround;
+
+    /**
+     * Private to the Libav AVHWAccel implementation
+     */
+    unsigned report_id;
+};
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_DXVA_H */
diff --git a/misc/winutils/include/libavcodec/old_codec_ids.h b/misc/winutils/include/libavcodec/old_codec_ids.h
new file mode 100644
index 0000000..2b72e38
--- /dev/null
+++ b/misc/winutils/include/libavcodec/old_codec_ids.h
@@ -0,0 +1,366 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_OLD_CODEC_IDS_H
+#define AVCODEC_OLD_CODEC_IDS_H
+
+/*
+ * This header exists to prevent new codec IDs from being accidentally added to
+ * the deprecated list.
+ * Do not include it directly. It will be removed on next major bump
+ *
+ * Do not add new items to this list. Use the AVCodecID enum instead.
+ */
+
+    CODEC_ID_NONE = AV_CODEC_ID_NONE,
+
+    /* video codecs */
+    CODEC_ID_MPEG1VIDEO,
+    CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+    CODEC_ID_MPEG2VIDEO_XVMC,
+    CODEC_ID_H261,
+    CODEC_ID_H263,
+    CODEC_ID_RV10,
+    CODEC_ID_RV20,
+    CODEC_ID_MJPEG,
+    CODEC_ID_MJPEGB,
+    CODEC_ID_LJPEG,
+    CODEC_ID_SP5X,
+    CODEC_ID_JPEGLS,
+    CODEC_ID_MPEG4,
+    CODEC_ID_RAWVIDEO,
+    CODEC_ID_MSMPEG4V1,
+    CODEC_ID_MSMPEG4V2,
+    CODEC_ID_MSMPEG4V3,
+    CODEC_ID_WMV1,
+    CODEC_ID_WMV2,
+    CODEC_ID_H263P,
+    CODEC_ID_H263I,
+    CODEC_ID_FLV1,
+    CODEC_ID_SVQ1,
+    CODEC_ID_SVQ3,
+    CODEC_ID_DVVIDEO,
+    CODEC_ID_HUFFYUV,
+    CODEC_ID_CYUV,
+    CODEC_ID_H264,
+    CODEC_ID_INDEO3,
+    CODEC_ID_VP3,
+    CODEC_ID_THEORA,
+    CODEC_ID_ASV1,
+    CODEC_ID_ASV2,
+    CODEC_ID_FFV1,
+    CODEC_ID_4XM,
+    CODEC_ID_VCR1,
+    CODEC_ID_CLJR,
+    CODEC_ID_MDEC,
+    CODEC_ID_ROQ,
+    CODEC_ID_INTERPLAY_VIDEO,
+    CODEC_ID_XAN_WC3,
+    CODEC_ID_XAN_WC4,
+    CODEC_ID_RPZA,
+    CODEC_ID_CINEPAK,
+    CODEC_ID_WS_VQA,
+    CODEC_ID_MSRLE,
+    CODEC_ID_MSVIDEO1,
+    CODEC_ID_IDCIN,
+    CODEC_ID_8BPS,
+    CODEC_ID_SMC,
+    CODEC_ID_FLIC,
+    CODEC_ID_TRUEMOTION1,
+    CODEC_ID_VMDVIDEO,
+    CODEC_ID_MSZH,
+    CODEC_ID_ZLIB,
+    CODEC_ID_QTRLE,
+    CODEC_ID_SNOW,
+    CODEC_ID_TSCC,
+    CODEC_ID_ULTI,
+    CODEC_ID_QDRAW,
+    CODEC_ID_VIXL,
+    CODEC_ID_QPEG,
+    CODEC_ID_PNG,
+    CODEC_ID_PPM,
+    CODEC_ID_PBM,
+    CODEC_ID_PGM,
+    CODEC_ID_PGMYUV,
+    CODEC_ID_PAM,
+    CODEC_ID_FFVHUFF,
+    CODEC_ID_RV30,
+    CODEC_ID_RV40,
+    CODEC_ID_VC1,
+    CODEC_ID_WMV3,
+    CODEC_ID_LOCO,
+    CODEC_ID_WNV1,
+    CODEC_ID_AASC,
+    CODEC_ID_INDEO2,
+    CODEC_ID_FRAPS,
+    CODEC_ID_TRUEMOTION2,
+    CODEC_ID_BMP,
+    CODEC_ID_CSCD,
+    CODEC_ID_MMVIDEO,
+    CODEC_ID_ZMBV,
+    CODEC_ID_AVS,
+    CODEC_ID_SMACKVIDEO,
+    CODEC_ID_NUV,
+    CODEC_ID_KMVC,
+    CODEC_ID_FLASHSV,
+    CODEC_ID_CAVS,
+    CODEC_ID_JPEG2000,
+    CODEC_ID_VMNC,
+    CODEC_ID_VP5,
+    CODEC_ID_VP6,
+    CODEC_ID_VP6F,
+    CODEC_ID_TARGA,
+    CODEC_ID_DSICINVIDEO,
+    CODEC_ID_TIERTEXSEQVIDEO,
+    CODEC_ID_TIFF,
+    CODEC_ID_GIF,
+    CODEC_ID_DXA,
+    CODEC_ID_DNXHD,
+    CODEC_ID_THP,
+    CODEC_ID_SGI,
+    CODEC_ID_C93,
+    CODEC_ID_BETHSOFTVID,
+    CODEC_ID_PTX,
+    CODEC_ID_TXD,
+    CODEC_ID_VP6A,
+    CODEC_ID_AMV,
+    CODEC_ID_VB,
+    CODEC_ID_PCX,
+    CODEC_ID_SUNRAST,
+    CODEC_ID_INDEO4,
+    CODEC_ID_INDEO5,
+    CODEC_ID_MIMIC,
+    CODEC_ID_RL2,
+    CODEC_ID_ESCAPE124,
+    CODEC_ID_DIRAC,
+    CODEC_ID_BFI,
+    CODEC_ID_CMV,
+    CODEC_ID_MOTIONPIXELS,
+    CODEC_ID_TGV,
+    CODEC_ID_TGQ,
+    CODEC_ID_TQI,
+    CODEC_ID_AURA,
+    CODEC_ID_AURA2,
+    CODEC_ID_V210X,
+    CODEC_ID_TMV,
+    CODEC_ID_V210,
+    CODEC_ID_DPX,
+    CODEC_ID_MAD,
+    CODEC_ID_FRWU,
+    CODEC_ID_FLASHSV2,
+    CODEC_ID_CDGRAPHICS,
+    CODEC_ID_R210,
+    CODEC_ID_ANM,
+    CODEC_ID_BINKVIDEO,
+    CODEC_ID_IFF_ILBM,
+    CODEC_ID_IFF_BYTERUN1,
+    CODEC_ID_KGV1,
+    CODEC_ID_YOP,
+    CODEC_ID_VP8,
+    CODEC_ID_PICTOR,
+    CODEC_ID_ANSI,
+    CODEC_ID_A64_MULTI,
+    CODEC_ID_A64_MULTI5,
+    CODEC_ID_R10K,
+    CODEC_ID_MXPEG,
+    CODEC_ID_LAGARITH,
+    CODEC_ID_PRORES,
+    CODEC_ID_JV,
+    CODEC_ID_DFA,
+    CODEC_ID_WMV3IMAGE,
+    CODEC_ID_VC1IMAGE,
+    CODEC_ID_UTVIDEO,
+    CODEC_ID_BMV_VIDEO,
+    CODEC_ID_VBLE,
+    CODEC_ID_DXTORY,
+    CODEC_ID_V410,
+    CODEC_ID_XWD,
+    CODEC_ID_CDXL,
+    CODEC_ID_XBM,
+    CODEC_ID_ZEROCODEC,
+    CODEC_ID_MSS1,
+    CODEC_ID_MSA1,
+    CODEC_ID_TSCC2,
+    CODEC_ID_MTS2,
+    CODEC_ID_CLLC,
+
+    /* various PCM "codecs" */
+    CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
+    CODEC_ID_PCM_S16LE = 0x10000,
+    CODEC_ID_PCM_S16BE,
+    CODEC_ID_PCM_U16LE,
+    CODEC_ID_PCM_U16BE,
+    CODEC_ID_PCM_S8,
+    CODEC_ID_PCM_U8,
+    CODEC_ID_PCM_MULAW,
+    CODEC_ID_PCM_ALAW,
+    CODEC_ID_PCM_S32LE,
+    CODEC_ID_PCM_S32BE,
+    CODEC_ID_PCM_U32LE,
+    CODEC_ID_PCM_U32BE,
+    CODEC_ID_PCM_S24LE,
+    CODEC_ID_PCM_S24BE,
+    CODEC_ID_PCM_U24LE,
+    CODEC_ID_PCM_U24BE,
+    CODEC_ID_PCM_S24DAUD,
+    CODEC_ID_PCM_ZORK,
+    CODEC_ID_PCM_S16LE_PLANAR,
+    CODEC_ID_PCM_DVD,
+    CODEC_ID_PCM_F32BE,
+    CODEC_ID_PCM_F32LE,
+    CODEC_ID_PCM_F64BE,
+    CODEC_ID_PCM_F64LE,
+    CODEC_ID_PCM_BLURAY,
+    CODEC_ID_PCM_LXF,
+    CODEC_ID_S302M,
+    CODEC_ID_PCM_S8_PLANAR,
+
+    /* various ADPCM codecs */
+    CODEC_ID_ADPCM_IMA_QT = 0x11000,
+    CODEC_ID_ADPCM_IMA_WAV,
+    CODEC_ID_ADPCM_IMA_DK3,
+    CODEC_ID_ADPCM_IMA_DK4,
+    CODEC_ID_ADPCM_IMA_WS,
+    CODEC_ID_ADPCM_IMA_SMJPEG,
+    CODEC_ID_ADPCM_MS,
+    CODEC_ID_ADPCM_4XM,
+    CODEC_ID_ADPCM_XA,
+    CODEC_ID_ADPCM_ADX,
+    CODEC_ID_ADPCM_EA,
+    CODEC_ID_ADPCM_G726,
+    CODEC_ID_ADPCM_CT,
+    CODEC_ID_ADPCM_SWF,
+    CODEC_ID_ADPCM_YAMAHA,
+    CODEC_ID_ADPCM_SBPRO_4,
+    CODEC_ID_ADPCM_SBPRO_3,
+    CODEC_ID_ADPCM_SBPRO_2,
+    CODEC_ID_ADPCM_THP,
+    CODEC_ID_ADPCM_IMA_AMV,
+    CODEC_ID_ADPCM_EA_R1,
+    CODEC_ID_ADPCM_EA_R3,
+    CODEC_ID_ADPCM_EA_R2,
+    CODEC_ID_ADPCM_IMA_EA_SEAD,
+    CODEC_ID_ADPCM_IMA_EA_EACS,
+    CODEC_ID_ADPCM_EA_XAS,
+    CODEC_ID_ADPCM_EA_MAXIS_XA,
+    CODEC_ID_ADPCM_IMA_ISS,
+    CODEC_ID_ADPCM_G722,
+    CODEC_ID_ADPCM_IMA_APC,
+
+    /* AMR */
+    CODEC_ID_AMR_NB = 0x12000,
+    CODEC_ID_AMR_WB,
+
+    /* RealAudio codecs*/
+    CODEC_ID_RA_144 = 0x13000,
+    CODEC_ID_RA_288,
+
+    /* various DPCM codecs */
+    CODEC_ID_ROQ_DPCM = 0x14000,
+    CODEC_ID_INTERPLAY_DPCM,
+    CODEC_ID_XAN_DPCM,
+    CODEC_ID_SOL_DPCM,
+
+    /* audio codecs */
+    CODEC_ID_MP2 = 0x15000,
+    CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+    CODEC_ID_AAC,
+    CODEC_ID_AC3,
+    CODEC_ID_DTS,
+    CODEC_ID_VORBIS,
+    CODEC_ID_DVAUDIO,
+    CODEC_ID_WMAV1,
+    CODEC_ID_WMAV2,
+    CODEC_ID_MACE3,
+    CODEC_ID_MACE6,
+    CODEC_ID_VMDAUDIO,
+    CODEC_ID_FLAC,
+    CODEC_ID_MP3ADU,
+    CODEC_ID_MP3ON4,
+    CODEC_ID_SHORTEN,
+    CODEC_ID_ALAC,
+    CODEC_ID_WESTWOOD_SND1,
+    CODEC_ID_GSM, ///< as in Berlin toast format
+    CODEC_ID_QDM2,
+    CODEC_ID_COOK,
+    CODEC_ID_TRUESPEECH,
+    CODEC_ID_TTA,
+    CODEC_ID_SMACKAUDIO,
+    CODEC_ID_QCELP,
+    CODEC_ID_WAVPACK,
+    CODEC_ID_DSICINAUDIO,
+    CODEC_ID_IMC,
+    CODEC_ID_MUSEPACK7,
+    CODEC_ID_MLP,
+    CODEC_ID_GSM_MS, /* as found in WAV */
+    CODEC_ID_ATRAC3,
+    CODEC_ID_VOXWARE,
+    CODEC_ID_APE,
+    CODEC_ID_NELLYMOSER,
+    CODEC_ID_MUSEPACK8,
+    CODEC_ID_SPEEX,
+    CODEC_ID_WMAVOICE,
+    CODEC_ID_WMAPRO,
+    CODEC_ID_WMALOSSLESS,
+    CODEC_ID_ATRAC3P,
+    CODEC_ID_EAC3,
+    CODEC_ID_SIPR,
+    CODEC_ID_MP1,
+    CODEC_ID_TWINVQ,
+    CODEC_ID_TRUEHD,
+    CODEC_ID_MP4ALS,
+    CODEC_ID_ATRAC1,
+    CODEC_ID_BINKAUDIO_RDFT,
+    CODEC_ID_BINKAUDIO_DCT,
+    CODEC_ID_AAC_LATM,
+    CODEC_ID_QDMC,
+    CODEC_ID_CELT,
+    CODEC_ID_G723_1,
+    CODEC_ID_G729,
+    CODEC_ID_8SVX_EXP,
+    CODEC_ID_8SVX_FIB,
+    CODEC_ID_BMV_AUDIO,
+    CODEC_ID_RALF,
+    CODEC_ID_IAC,
+    CODEC_ID_ILBC,
+
+    /* subtitle codecs */
+    CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
+    CODEC_ID_DVD_SUBTITLE = 0x17000,
+    CODEC_ID_DVB_SUBTITLE,
+    CODEC_ID_TEXT,  ///< raw UTF-8 text
+    CODEC_ID_XSUB,
+    CODEC_ID_SSA,
+    CODEC_ID_MOV_TEXT,
+    CODEC_ID_HDMV_PGS_SUBTITLE,
+    CODEC_ID_DVB_TELETEXT,
+    CODEC_ID_SRT,
+
+    /* other specific kind of codecs (generally used for attachments) */
+    CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
+    CODEC_ID_TTF = 0x18000,
+
+    CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+
+    CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+                                * stream (only used by libavformat) */
+    CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+                                * stream (only used by libavformat) */
+    CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
+
+#endif /* AVCODEC_OLD_CODEC_IDS_H */
diff --git a/misc/winutils/include/libavcodec/vaapi.h b/misc/winutils/include/libavcodec/vaapi.h
new file mode 100644
index 0000000..39e8825
--- /dev/null
+++ b/misc/winutils/include/libavcodec/vaapi.h
@@ -0,0 +1,173 @@
+/*
+ * Video Acceleration API (shared data between Libav and the video player)
+ * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
+ *
+ * Copyright (C) 2008-2009 Splitted-Desktop Systems
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VAAPI_H
+#define AVCODEC_VAAPI_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vaapi
+ * Public libavcodec VA API header.
+ */
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
+ * @ingroup lavc_codec_hwaccel
+ * @{
+ */
+
+/**
+ * This structure is used to share data between the Libav library and
+ * the client video application.
+ * This shall be zero-allocated and available as
+ * AVCodecContext.hwaccel_context. All user members can be set once
+ * during initialization or through each AVCodecContext.get_buffer()
+ * function call. In any case, they must be valid prior to calling
+ * decoding functions.
+ */
+struct vaapi_context {
+    /**
+     * Window system dependent data
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *display;
+
+    /**
+     * Configuration ID
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t config_id;
+
+    /**
+     * Context ID (video decode pipeline)
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t context_id;
+
+    /**
+     * VAPictureParameterBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t pic_param_buf_id;
+
+    /**
+     * VAIQMatrixBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t iq_matrix_buf_id;
+
+    /**
+     * VABitPlaneBuffer ID (for VC-1 decoding)
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t bitplane_buf_id;
+
+    /**
+     * Slice parameter/data buffer IDs
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t *slice_buf_ids;
+
+    /**
+     * Number of effective slice buffer IDs to send to the HW
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int n_slice_buf_ids;
+
+    /**
+     * Size of pre-allocated slice_buf_ids
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_buf_ids_alloc;
+
+    /**
+     * Pointer to VASliceParameterBuffers
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    void *slice_params;
+
+    /**
+     * Size of a VASliceParameterBuffer element
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_param_size;
+
+    /**
+     * Size of pre-allocated slice_params
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_params_alloc;
+
+    /**
+     * Number of slices currently filled in
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_count;
+
+    /**
+     * Pointer to slice data buffer base
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    const uint8_t *slice_data;
+
+    /**
+     * Current size of slice data
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t slice_data_size;
+};
+
+/* @} */
+
+#endif /* AVCODEC_VAAPI_H */
diff --git a/misc/winutils/include/libavcodec/vda.h b/misc/winutils/include/libavcodec/vda.h
new file mode 100644
index 0000000..f0ec2bf
--- /dev/null
+++ b/misc/winutils/include/libavcodec/vda.h
@@ -0,0 +1,217 @@
+/*
+ * VDA HW acceleration
+ *
+ * copyright (c) 2011 Sebastien Zwickert
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDA_H
+#define AVCODEC_VDA_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vda
+ * Public libavcodec VDA header.
+ */
+
+#include "libavcodec/version.h"
+
+#if FF_API_VDA_ASYNC
+#include <pthread.h>
+#endif
+
+#include <stdint.h>
+
+// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
+// http://openradar.appspot.com/8026390
+#undef __GNUC_STDC_INLINE__
+
+#define Picture QuickdrawPicture
+#include <VideoDecodeAcceleration/VDADecoder.h>
+#undef Picture
+
+/**
+ * @defgroup lavc_codec_hwaccel_vda VDA
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#if FF_API_VDA_ASYNC
+/**
+ * This structure is used to store decoded frame information and data.
+ *
+ * @deprecated Use synchronous decoding mode.
+ */
+typedef struct vda_frame {
+    /**
+     * The PTS of the frame.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    int64_t             pts;
+
+    /**
+     * The CoreVideo buffer that contains the decoded data.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    CVPixelBufferRef    cv_buffer;
+
+    /**
+     * A pointer to the next frame.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    struct vda_frame    *next_frame;
+} vda_frame;
+#endif
+
+/**
+ * This structure is used to provide the necessary configurations and data
+ * to the VDA Libav HWAccel implementation.
+ *
+ * The application must make it available as AVCodecContext.hwaccel_context.
+ */
+struct vda_context {
+    /**
+     * VDA decoder object.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    VDADecoder          decoder;
+
+    /**
+     * The Core Video pixel buffer that contains the current image data.
+     *
+     * encoding: unused
+     * decoding: Set by libavcodec. Unset by user.
+     */
+    CVPixelBufferRef    cv_buffer;
+
+    /**
+     * Use the hardware decoder in synchronous mode.
+     *
+     * encoding: unused
+     * decoding: Set by user.
+     */
+    int                 use_sync_decoding;
+
+#if FF_API_VDA_ASYNC
+    /**
+     * VDA frames queue ordered by presentation timestamp.
+     *
+     * @deprecated Use synchronous decoding mode.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    vda_frame           *queue;
+
+    /**
+     * Mutex for locking queue operations.
+     *
+     * @deprecated Use synchronous decoding mode.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by libavcodec.
+     */
+    pthread_mutex_t     queue_mutex;
+#endif
+
+    /**
+     * The frame width.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 width;
+
+    /**
+     * The frame height.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 height;
+
+    /**
+     * The frame format.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    int                 format;
+
+    /**
+     * The pixel format for output image buffers.
+     *
+     * - encoding: unused
+     * - decoding: Set/Unset by user.
+     */
+    OSType              cv_pix_fmt_type;
+
+    /**
+     * The current bitstream buffer.
+     */
+    uint8_t             *priv_bitstream;
+
+    /**
+     * The current size of the bitstream.
+     */
+    int                 priv_bitstream_size;
+
+    /**
+     * The reference size used for fast reallocation.
+     */
+    int                 priv_allocated_size;
+};
+
+/** Create the video decoder. */
+int ff_vda_create_decoder(struct vda_context *vda_ctx,
+                          uint8_t *extradata,
+                          int extradata_size);
+
+/** Destroy the video decoder. */
+int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
+
+#if FF_API_VDA_ASYNC
+/**
+ * Return the top frame of the queue.
+ *
+ * @deprecated Use synchronous decoding mode.
+ */
+vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
+
+/**
+ * Release the given frame.
+ *
+ * @deprecated Use synchronous decoding mode.
+ */
+void ff_vda_release_vda_frame(vda_frame *frame);
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_VDA_H */
diff --git a/misc/winutils/include/libavcodec/vdpau.h b/misc/winutils/include/libavcodec/vdpau.h
new file mode 100644
index 0000000..241ff19
--- /dev/null
+++ b/misc/winutils/include/libavcodec/vdpau.h
@@ -0,0 +1,94 @@
+/*
+ * The Video Decode and Presentation API for UNIX (VDPAU) is used for
+ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
+ *
+ * Copyright (C) 2008 NVIDIA
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDPAU_H
+#define AVCODEC_VDPAU_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vdpau
+ * Public libavcodec VDPAU header.
+ */
+
+
+/**
+ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
+ * @ingroup lavc_codec_hwaccel
+ *
+ * VDPAU hardware acceleration has two modules
+ * - VDPAU decoding
+ * - VDPAU presentation
+ *
+ * The VDPAU decoding module parses all headers using Libav
+ * parsing mechanisms and uses VDPAU for the actual decoding.
+ *
+ * As per the current implementation, the actual decoding
+ * and rendering (API calls) are done as part of the VDPAU
+ * presentation (vo_vdpau.c) module.
+ *
+ * @{
+ */
+
+#include <vdpau/vdpau.h>
+#include <vdpau/vdpau_x11.h>
+
+/** @brief The videoSurface is used for rendering. */
+#define FF_VDPAU_STATE_USED_FOR_RENDER 1
+
+/**
+ * @brief The videoSurface is needed for reference/prediction.
+ * The codec manipulates this.
+ */
+#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
+
+/**
+ * @brief This structure is used as a callback between the Libav
+ * decoder (vd_) and presentation (vo_) module.
+ * This is used for defining a video frame containing surface,
+ * picture parameter, bitstream information etc which are passed
+ * between the Libav decoder and its clients.
+ */
+struct vdpau_render_state {
+    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
+
+    int state; ///< Holds FF_VDPAU_STATE_* values.
+
+    /** picture parameter information for all supported codecs */
+    union VdpPictureInfo {
+        VdpPictureInfoH264        h264;
+        VdpPictureInfoMPEG1Or2    mpeg;
+        VdpPictureInfoVC1          vc1;
+        VdpPictureInfoMPEG4Part2 mpeg4;
+    } info;
+
+    /** Describe size/location of the compressed video data.
+        Set to 0 when freeing bitstream_buffers. */
+    int bitstream_buffers_allocated;
+    int bitstream_buffers_used;
+    /** The user is responsible for freeing this buffer using av_freep(). */
+    VdpBitstreamBuffer *bitstream_buffers;
+};
+
+/* @}*/
+
+#endif /* AVCODEC_VDPAU_H */
diff --git a/misc/winutils/include/libavcodec/version.h b/misc/winutils/include/libavcodec/version.h
new file mode 100644
index 0000000..b702f4b
--- /dev/null
+++ b/misc/winutils/include/libavcodec/version.h
@@ -0,0 +1,95 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VERSION_H
+#define AVCODEC_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavc
+ * Libavcodec version macros.
+ */
+
+#define LIBAVCODEC_VERSION_MAJOR 54
+#define LIBAVCODEC_VERSION_MINOR 31
+#define LIBAVCODEC_VERSION_MICRO  0
+
+#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+                                               LIBAVCODEC_VERSION_MINOR, \
+                                               LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
+                                           LIBAVCODEC_VERSION_MINOR,    \
+                                           LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
+
+#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_REQUEST_CHANNELS
+#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_OLD_DECODE_AUDIO
+#define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_OLD_ENCODE_AUDIO
+#define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_OLD_ENCODE_VIDEO
+#define FF_API_OLD_ENCODE_VIDEO (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_MPV_GLOBAL_OPTS
+#define FF_API_MPV_GLOBAL_OPTS  (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_COLOR_TABLE_ID
+#define FF_API_COLOR_TABLE_ID   (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_INTER_THRESHOLD
+#define FF_API_INTER_THRESHOLD  (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_SUB_ID
+#define FF_API_SUB_ID           (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_DSP_MASK
+#define FF_API_DSP_MASK         (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_FIND_BEST_PIX_FMT
+#define FF_API_FIND_BEST_PIX_FMT (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_CODEC_ID
+#define FF_API_CODEC_ID          (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_VDA_ASYNC
+#define FF_API_VDA_ASYNC         (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_AVCODEC_RESAMPLE
+#define FF_API_AVCODEC_RESAMPLE  (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_LIBMPEG2
+#define FF_API_LIBMPEG2          (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_MMI
+#define FF_API_MMI               (LIBAVCODEC_VERSION_MAJOR < 55)
+#endif
+
+#endif /* AVCODEC_VERSION_H */
diff --git a/misc/winutils/include/libavcodec/xvmc.h b/misc/winutils/include/libavcodec/xvmc.h
new file mode 100644
index 0000000..1f77e4e
--- /dev/null
+++ b/misc/winutils/include/libavcodec/xvmc.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2003 Ivan Kalvachev
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_XVMC_H
+#define AVCODEC_XVMC_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_xvmc
+ * Public libavcodec XvMC header.
+ */
+
+#include <X11/extensions/XvMC.h>
+
+#include "avcodec.h"
+
+/**
+ * @defgroup lavc_codec_hwaccel_xvmc XvMC
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
+                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
+
+struct xvmc_pix_fmt {
+    /** The field contains the special constant value AV_XVMC_ID.
+        It is used as a test that the application correctly uses the API,
+        and that there is no corruption caused by pixel routines.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             xvmc_id;
+
+    /** Pointer to the block array allocated by XvMCCreateBlocks().
+        The array has to be freed by XvMCDestroyBlocks().
+        Each group of 64 values represents one data block of differential
+        pixel information (in MoCo mode) or coefficients for IDCT.
+        - application - set the pointer during initialization
+        - libavcodec  - fills coefficients/pixel data into the array
+    */
+    short*          data_blocks;
+
+    /** Pointer to the macroblock description array allocated by
+        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
+        - application - set the pointer during initialization
+        - libavcodec  - fills description data into the array
+    */
+    XvMCMacroBlock* mv_blocks;
+
+    /** Number of macroblock descriptions that can be stored in the mv_blocks
+        array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_mv_blocks;
+
+    /** Number of blocks that can be stored at once in the data_blocks array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_data_blocks;
+
+    /** Indicate that the hardware would interpret data_blocks as IDCT
+        coefficients and perform IDCT on them.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             idct;
+
+    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
+        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             unsigned_intra;
+
+    /** Pointer to the surface allocated by XvMCCreateSurface().
+        It has to be freed by XvMCDestroySurface() on application exit.
+        It identifies the frame and its state on the video hardware.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    XvMCSurface*    p_surface;
+
+/** Set by the decoder before calling ff_draw_horiz_band(),
+    needed by the XvMCRenderSurface function. */
+//@{
+    /** Pointer to the surface used as past reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_past_surface;
+
+    /** Pointer to the surface used as future reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_future_surface;
+
+    /** top/bottom field or frame
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    picture_structure;
+
+    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    flags;
+//}@
+
+    /** Number of macroblock descriptions in the mv_blocks array
+        that have already been passed to the hardware.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may increment it
+                        with filled_mb_block_num or zero both.
+        - libavcodec  - unchanged
+    */
+    int             start_mv_blocks_num;
+
+    /** Number of new macroblock descriptions in the mv_blocks array (after
+        start_mv_blocks_num) that are filled by libavcodec and have to be
+        passed to the hardware.
+        - application - zeroes it on get_buffer() or after successful
+                        ff_draw_horiz_band().
+        - libavcodec  - increment with one of each stored MB
+    */
+    int             filled_mv_blocks_num;
+
+    /** Number of the next free data block; one data block consists of
+        64 short values in the data_blocks array.
+        All blocks before this one have already been claimed by placing their
+        position into the corresponding block description structure field,
+        that are part of the mv_blocks array.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may zero it together
+                        with start_mb_blocks_num.
+        - libavcodec  - each decoded macroblock increases it by the number
+                        of coded blocks it contains.
+    */
+    int             next_free_data_block_num;
+};
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_XVMC_H */
diff --git a/misc/winutils/include/libavformat/avformat.h b/misc/winutils/include/libavformat/avformat.h
new file mode 100644
index 0000000..8af007e
--- /dev/null
+++ b/misc/winutils/include/libavformat/avformat.h
@@ -0,0 +1,1740 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_AVFORMAT_H
+#define AVFORMAT_AVFORMAT_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Main libavformat public API header
+ */
+
+/**
+ * @defgroup libavf I/O and Muxing/Demuxing Library
+ * @{
+ *
+ * Libavformat (lavf) is a library for dealing with various media container
+ * formats. Its main two purposes are demuxing - i.e. splitting a media file
+ * into component streams, and the reverse process of muxing - writing supplied
+ * data in a specified container format. It also has an @ref lavf_io
+ * "I/O module" which supports a number of protocols for accessing the data (e.g.
+ * file, tcp, http and others). Before using lavf, you need to call
+ * av_register_all() to register all compiled muxers, demuxers and protocols.
+ * Unless you are absolutely sure you won't use libavformat's network
+ * capabilities, you should also call avformat_network_init().
+ *
+ * A supported input format is described by an AVInputFormat struct, conversely
+ * an output format is described by AVOutputFormat. You can iterate over all
+ * registered input/output formats using the av_iformat_next() /
+ * av_oformat_next() functions. The protocols layer is not part of the public
+ * API, so you can only get the names of supported protocols with the
+ * avio_enum_protocols() function.
+ *
+ * Main lavf structure used for both muxing and demuxing is AVFormatContext,
+ * which exports all information about the file being read or written. As with
+ * most Libav structures, its size is not part of public ABI, so it cannot be
+ * allocated on stack or directly with av_malloc(). To create an
+ * AVFormatContext, use avformat_alloc_context() (some functions, like
+ * avformat_open_input() might do that for you).
+ *
+ * Most importantly an AVFormatContext contains:
+ * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat
+ * "output" format. It is either autodetected or set by user for input;
+ * always set by user for output.
+ * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all
+ * elementary streams stored in the file. AVStreams are typically referred to
+ * using their index in this array.
+ * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or
+ * set by user for input, always set by user for output (unless you are dealing
+ * with an AVFMT_NOFILE format).
+ *
+ * @section lavf_options Passing options to (de)muxers
+ * Lavf allows to configure muxers and demuxers using the @ref avoptions
+ * mechanism. Generic (format-independent) libavformat options are provided by
+ * AVFormatContext, they can be examined from a user program by calling
+ * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
+ * from avformat_get_class()). Private (format-specific) options are provided by
+ * AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
+ * AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
+ * Further options may be provided by the @ref AVFormatContext.pb "I/O context",
+ * if its AVClass is non-NULL, and the protocols layer. See the discussion on
+ * nesting in @ref avoptions documentation to learn how to access those.
+ *
+ * @defgroup lavf_decoding Demuxing
+ * @{
+ * Demuxers read a media file and split it into chunks of data (@em packets). A
+ * @ref AVPacket "packet" contains one or more encoded frames which belongs to a
+ * single elementary stream. In the lavf API this process is represented by the
+ * avformat_open_input() function for opening a file, av_read_frame() for
+ * reading a single packet and finally avformat_close_input(), which does the
+ * cleanup.
+ *
+ * @section lavf_decoding_open Opening a media file
+ * The minimum information required to open a file is its URL or filename, which
+ * is passed to avformat_open_input(), as in the following code:
+ * @code
+ * const char    *url = "in.mp3";
+ * AVFormatContext *s = NULL;
+ * int ret = avformat_open_input(&s, url, NULL, NULL);
+ * if (ret < 0)
+ *     abort();
+ * @endcode
+ * The above code attempts to allocate an AVFormatContext, open the
+ * specified file (autodetecting the format) and read the header, exporting the
+ * information stored there into s. Some formats do not have a header or do not
+ * store enough information there, so it is recommended that you call the
+ * avformat_find_stream_info() function which tries to read and decode a few
+ * frames to find missing information.
+ *
+ * In some cases you might want to preallocate an AVFormatContext yourself with
+ * avformat_alloc_context() and do some tweaking on it before passing it to
+ * avformat_open_input(). One such case is when you want to use custom functions
+ * for reading input data instead of lavf internal I/O layer.
+ * To do that, create your own AVIOContext with avio_alloc_context(), passing
+ * your reading callbacks to it. Then set the @em pb field of your
+ * AVFormatContext to newly created AVIOContext.
+ *
+ * Since the format of the opened file is in general not known until after
+ * avformat_open_input() has returned, it is not possible to set demuxer private
+ * options on a preallocated context. Instead, the options should be passed to
+ * avformat_open_input() wrapped in an AVDictionary:
+ * @code
+ * AVDictionary *options = NULL;
+ * av_dict_set(&options, "video_size", "640x480", 0);
+ * av_dict_set(&options, "pixel_format", "rgb24", 0);
+ *
+ * if (avformat_open_input(&s, url, NULL, &options) < 0)
+ *     abort();
+ * av_dict_free(&options);
+ * @endcode
+ * This code passes the private options 'video_size' and 'pixel_format' to the
+ * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
+ * cannot know how to interpret raw video data otherwise. If the format turns
+ * out to be something different than raw video, those options will not be
+ * recognized by the demuxer and therefore will not be applied. Such unrecognized
+ * options are then returned in the options dictionary (recognized options are
+ * consumed). The calling program can handle such unrecognized options as it
+ * wishes, e.g.
+ * @code
+ * AVDictionaryEntry *e;
+ * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
+ *     fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
+ *     abort();
+ * }
+ * @endcode
+ *
+ * After you have finished reading the file, you must close it with
+ * avformat_close_input(). It will free everything associated with the file.
+ *
+ * @section lavf_decoding_read Reading from an opened file
+ * Reading data from an opened AVFormatContext is done by repeatedly calling
+ * av_read_frame() on it. Each call, if successful, will return an AVPacket
+ * containing encoded data for one AVStream, identified by
+ * AVPacket.stream_index. This packet may be passed straight into the libavcodec
+ * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
+ * avcodec_decode_subtitle2() if the caller wishes to decode the data.
+ *
+ * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
+ * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
+ * pts/dts, 0 for duration) if the stream does not provide them. The timing
+ * information will be in AVStream.time_base units, i.e. it has to be
+ * multiplied by the timebase to convert them to seconds.
+ *
+ * The packet data belongs to the demuxer and is invalid after the next call to
+ * av_read_frame(). The user must free the packet with av_free_packet() before
+ * calling av_read_frame() again or closing the file.
+ *
+ * @section lavf_decoding_seek Seeking
+ * @}
+ *
+ * @defgroup lavf_encoding Muxing
+ * @{
+ * @}
+ *
+ * @defgroup lavf_io I/O Read/Write
+ * @{
+ * @}
+ *
+ * @defgroup lavf_codec Demuxers
+ * @{
+ * @defgroup lavf_codec_native Native Demuxers
+ * @{
+ * @}
+ * @defgroup lavf_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @}
+ * @defgroup lavf_protos I/O Protocols
+ * @{
+ * @}
+ * @defgroup lavf_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+#include <time.h>
+#include <stdio.h>  /* FILE */
+#include "libavcodec/avcodec.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "avio.h"
+#include "libavformat/version.h"
+
+#if FF_API_AV_GETTIME
+#include "libavutil/time.h"
+#endif
+
+struct AVFormatContext;
+
+
+/**
+ * @defgroup metadata_api Public Metadata API
+ * @{
+ * @ingroup libavf
+ * The metadata API allows libavformat to export metadata tags to a client
+ * application when demuxing. Conversely it allows a client application to
+ * set metadata when muxing.
+ *
+ * Metadata is exported or set as pairs of key/value strings in the 'metadata'
+ * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs
+ * using the @ref lavu_dict "AVDictionary" API. Like all strings in Libav,
+ * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata
+ * exported by demuxers isn't checked to be valid UTF-8 in most cases.
+ *
+ * Important concepts to keep in mind:
+ * -  Keys are unique; there can never be 2 tags with the same key. This is
+ *    also meant semantically, i.e., a demuxer should not knowingly produce
+ *    several keys that are literally different but semantically identical.
+ *    E.g., key=Author5, key=Author6. In this example, all authors must be
+ *    placed in the same tag.
+ * -  Metadata is flat, not hierarchical; there are no subtags. If you
+ *    want to store, e.g., the email address of the child of producer Alice
+ *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
+ * -  Several modifiers can be applied to the tag name. This is done by
+ *    appending a dash character ('-') and the modifier name in the order
+ *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
+ *    -  language -- a tag whose value is localized for a particular language
+ *       is appended with the ISO 639-2/B 3-letter language code.
+ *       For example: Author-ger=Michael, Author-eng=Mike
+ *       The original/default language is in the unqualified "Author" tag.
+ *       A demuxer should set a default if it sets any translated tag.
+ *    -  sorting  -- a modified version of a tag that should be used for
+ *       sorting will have '-sort' appended. E.g. artist="The Beatles",
+ *       artist-sort="Beatles, The".
+ *
+ * -  Demuxers attempt to export metadata in a generic format, however tags
+ *    with no generic equivalents are left as they are stored in the container.
+ *    Follows a list of generic tag names:
+ *
+ @verbatim
+ album        -- name of the set this work belongs to
+ album_artist -- main creator of the set/album, if different from artist.
+                 e.g. "Various Artists" for compilation albums.
+ artist       -- main creator of the work
+ comment      -- any additional description of the file.
+ composer     -- who composed the work, if different from artist.
+ copyright    -- name of copyright holder.
+ creation_time-- date when the file was created, preferably in ISO 8601.
+ date         -- date when the work was created, preferably in ISO 8601.
+ disc         -- number of a subset, e.g. disc in a multi-disc collection.
+ encoder      -- name/settings of the software/hardware that produced the file.
+ encoded_by   -- person/group who created the file.
+ filename     -- original name of the file.
+ genre        -- <self-evident>.
+ language     -- main language in which the work is performed, preferably
+                 in ISO 639-2 format. Multiple languages can be specified by
+                 separating them with commas.
+ performer    -- artist who performed the work, if different from artist.
+                 E.g for "Also sprach Zarathustra", artist would be "Richard
+                 Strauss" and performer "London Philharmonic Orchestra".
+ publisher    -- name of the label/publisher.
+ service_name     -- name of the service in broadcasting (channel name).
+ service_provider -- name of the service provider in broadcasting.
+ title        -- name of the work.
+ track        -- number of this work in the set, can be in form current/total.
+ variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
+ @endverbatim
+ *
+ * Look in the examples section for an application example how to use the Metadata API.
+ *
+ * @}
+ */
+
+/* packet functions */
+
+
+/**
+ * Allocate and read the payload of a packet and initialize its
+ * fields with default values.
+ *
+ * @param pkt packet
+ * @param size desired payload size
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise
+ */
+int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+
+/**
+ * Read data and append it to the current content of the AVPacket.
+ * If pkt->size is 0 this is identical to av_get_packet.
+ * Note that this uses av_grow_packet and thus involves a realloc
+ * which is inefficient. Thus this function should only be used
+ * when there is no reasonable way to know (an upper bound of)
+ * the final size.
+ *
+ * @param pkt packet
+ * @param size amount of data to read
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
+ *         will not be lost even if an error occurs.
+ */
+int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+/*************************************************/
+/* fractional numbers for exact pts handling */
+
+/**
+ * The exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be 0 <= num < den.
+ */
+typedef struct AVFrac {
+    int64_t val, num, den;
+} AVFrac;
+
+/*************************************************/
+/* input/output formats */
+
+struct AVCodecTag;
+
+/**
+ * This structure contains the data a format has to probe a file.
+ */
+typedef struct AVProbeData {
+    const char *filename;
+    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
+    int buf_size;       /**< Size of buf except extra allocated bytes */
+} AVProbeData;
+
+#define AVPROBE_SCORE_MAX 100               ///< maximum score, half of that is used for file-extension-based detection
+#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
+
+/// Demuxer will use avio_open, no opened file should be provided by the caller.
+#define AVFMT_NOFILE        0x0001
+#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
+#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
+#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
+                                      raw picture data. */
+#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
+#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
+#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
+#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
+#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
+#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
+#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
+#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */
+#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fallback to generic search */
+#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
+#define AVFMT_ALLOW_FLUSH  0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
+#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
+                                        increasing timestamps, but they must
+                                        still be monotonic */
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+typedef struct AVOutputFormat {
+    const char *name;
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+    const char *mime_type;
+    const char *extensions; /**< comma-separated filename extensions */
+    /* output support */
+    enum AVCodecID audio_codec;    /**< default audio codec */
+    enum AVCodecID video_codec;    /**< default video codec */
+    enum AVCodecID subtitle_codec; /**< default subtitle codec */
+    /**
+     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
+     * AVFMT_TS_NONSTRICT
+     */
+    int flags;
+
+    /**
+     * List of supported codec_id-codec_tag pairs, ordered by "better
+     * choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
+     */
+    const struct AVCodecTag * const *codec_tag;
+
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVOutputFormat *next;
+    /**
+     * size of private data so that it can be allocated in the wrapper
+     */
+    int priv_data_size;
+
+    int (*write_header)(struct AVFormatContext *);
+    /**
+     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+     * pkt can be NULL in order to flush data buffered in the muxer.
+     * When flushing, return 0 if there still is more data to flush,
+     * or 1 if everything was flushed and there is no more buffered
+     * data.
+     */
+    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
+    int (*write_trailer)(struct AVFormatContext *);
+    /**
+     * Currently only used to set pixel format if not YUV420P.
+     */
+    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
+                             AVPacket *in, int flush);
+    /**
+     * Test if the given codec can be stored in this container.
+     *
+     * @return 1 if the codec is supported, 0 if it is not.
+     *         A negative number if unknown.
+     */
+    int (*query_codec)(enum AVCodecID id, int std_compliance);
+} AVOutputFormat;
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+typedef struct AVInputFormat {
+    /**
+     * A comma separated list of short names for the format. New names
+     * may be appended with a minor bump.
+     */
+    const char *name;
+
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+
+    /**
+     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+     */
+    int flags;
+
+    /**
+     * If extensions are defined, then no probe is done. You should
+     * usually not use extension format guessing because it is not
+     * reliable enough
+     */
+    const char *extensions;
+
+    const struct AVCodecTag * const *codec_tag;
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVInputFormat *next;
+
+    /**
+     * Raw demuxers store their codec ID here.
+     */
+    int raw_codec_id;
+
+    /**
+     * Size of private data so that it can be allocated in the wrapper.
+     */
+    int priv_data_size;
+
+    /**
+     * Tell if a given file has a chance of being parsed as this format.
+     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
+     * big so you do not have to check for that unless you need more.
+     */
+    int (*read_probe)(AVProbeData *);
+
+    /**
+     * Read the format header and initialize the AVFormatContext
+     * structure. Return 0 if OK. Only used in raw format right
+     * now. 'avformat_new_stream' should be called to create new streams.
+     */
+    int (*read_header)(struct AVFormatContext *);
+
+    /**
+     * Read one packet and put it in 'pkt'. pts and flags are also
+     * set. 'avformat_new_stream' can be called only if the flag
+     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
+     * background thread).
+     * @return 0 on success, < 0 on error.
+     *         When returning an error, pkt must not have been allocated
+     *         or must be freed before returning
+     */
+    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
+
+    /**
+     * Close the stream. The AVFormatContext and AVStreams are not
+     * freed by this function
+     */
+    int (*read_close)(struct AVFormatContext *);
+
+    /**
+     * Seek to a given timestamp relative to the frames in
+     * stream component stream_index.
+     * @param stream_index Must not be -1.
+     * @param flags Selects which direction should be preferred if no exact
+     *              match is available.
+     * @return >= 0 on success (but not necessarily the new offset)
+     */
+    int (*read_seek)(struct AVFormatContext *,
+                     int stream_index, int64_t timestamp, int flags);
+
+    /**
+     * Get the next timestamp in stream[stream_index].time_base units.
+     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
+     */
+    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
+                              int64_t *pos, int64_t pos_limit);
+
+    /**
+     * Start/resume playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_play)(struct AVFormatContext *);
+
+    /**
+     * Pause playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_pause)(struct AVFormatContext *);
+
+    /**
+     * Seek to timestamp ts.
+     * Seeking will be done so that the point from which all active streams
+     * can be presented successfully will be closest to ts and within min/max_ts.
+     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+     */
+    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+} AVInputFormat;
+/**
+ * @}
+ */
+
+enum AVStreamParseType {
+    AVSTREAM_PARSE_NONE,
+    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
+    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
+    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
+    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
+};
+
+typedef struct AVIndexEntry {
+    int64_t pos;
+    int64_t timestamp;
+#define AVINDEX_KEYFRAME 0x0001
+    int flags:2;
+    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
+    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
+} AVIndexEntry;
+
+#define AV_DISPOSITION_DEFAULT   0x0001
+#define AV_DISPOSITION_DUB       0x0002
+#define AV_DISPOSITION_ORIGINAL  0x0004
+#define AV_DISPOSITION_COMMENT   0x0008
+#define AV_DISPOSITION_LYRICS    0x0010
+#define AV_DISPOSITION_KARAOKE   0x0020
+
+/**
+ * Track should be used during playback by default.
+ * Useful for subtitle track that should be displayed
+ * even when user did not explicitly ask for subtitles.
+ */
+#define AV_DISPOSITION_FORCED    0x0040
+#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
+#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
+#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
+/**
+ * The stream is stored in the file as an attached picture/"cover art" (e.g.
+ * APIC frame in ID3v2). The single packet associated with it will be returned
+ * among the first few packets read from the file unless seeking takes place.
+ * It can also be accessed at any time in AVStream.attached_pic.
+ */
+#define AV_DISPOSITION_ATTACHED_PIC      0x0400
+
+/**
+ * Stream structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVStream) must not be used outside libav*.
+ */
+typedef struct AVStream {
+    int index;    /**< stream index in AVFormatContext */
+    /**
+     * Format-specific stream ID.
+     * decoding: set by libavformat
+     * encoding: set by the user
+     */
+    int id;
+    /**
+     * Codec context associated with this stream. Allocated and freed by
+     * libavformat.
+     *
+     * - decoding: The demuxer exports codec information stored in the headers
+     *             here.
+     * - encoding: The user sets codec information, the muxer writes it to the
+     *             output. Mandatory fields as specified in AVCodecContext
+     *             documentation must be set even if this AVCodecContext is
+     *             not actually used for encoding.
+     */
+    AVCodecContext *codec;
+#if FF_API_R_FRAME_RATE
+    /**
+     * Real base framerate of the stream.
+     * This is the lowest framerate with which all timestamps can be
+     * represented accurately (it is the least common multiple of all
+     * framerates in the stream). Note, this value is just a guess!
+     * For example, if the time base is 1/90000 and all frames have either
+     * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
+     */
+    AVRational r_frame_rate;
+#endif
+    void *priv_data;
+
+    /**
+     * encoding: pts generation when outputting stream
+     */
+    struct AVFrac pts;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented.
+     *
+     * decoding: set by libavformat
+     * encoding: set by libavformat in avformat_write_header. The muxer may use the
+     * user-provided value of @ref AVCodecContext.time_base "codec->time_base"
+     * as a hint.
+     */
+    AVRational time_base;
+
+    /**
+     * Decoding: pts of the first frame of the stream, in stream time base.
+     * Only set this if you are absolutely 100% sure that the value you set
+     * it to really is the pts of the first frame.
+     * This may be undefined (AV_NOPTS_VALUE).
+     */
+    int64_t start_time;
+
+    /**
+     * Decoding: duration of the stream, in stream time base.
+     * If a source file does not specify a duration, but does specify
+     * a bitrate, this value will be estimated from bitrate and file size.
+     */
+    int64_t duration;
+
+    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
+
+    int disposition; /**< AV_DISPOSITION_* bit field */
+
+    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * - encoding: Set by user.
+     * - decoding: Set by libavformat.
+     */
+    AVRational sample_aspect_ratio;
+
+    AVDictionary *metadata;
+
+    /**
+     * Average framerate
+     */
+    AVRational avg_frame_rate;
+
+    /**
+     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
+     * will contain the attached picture.
+     *
+     * decoding: set by libavformat, must not be modified by the caller.
+     * encoding: unused
+     */
+    AVPacket attached_pic;
+
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * Stream information used internally by av_find_stream_info()
+     */
+#define MAX_STD_TIMEBASES (60*12+5)
+    struct {
+#if FF_API_R_FRAME_RATE
+        int64_t last_dts;
+        int64_t duration_gcd;
+        int duration_count;
+        double duration_error[MAX_STD_TIMEBASES];
+#endif
+        int nb_decoded_frames;
+        int found_decoder;
+
+        /**
+         * Those are used for average framerate estimation.
+         */
+        int64_t fps_first_dts;
+        int     fps_first_dts_idx;
+        int64_t fps_last_dts;
+        int     fps_last_dts_idx;
+
+    } *info;
+
+    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
+
+    // Timestamp generation support:
+    /**
+     * Timestamp corresponding to the last dts sync point.
+     *
+     * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
+     * a DTS is received from the underlying container. Otherwise set to
+     * AV_NOPTS_VALUE by default.
+     */
+    int64_t reference_dts;
+    int64_t first_dts;
+    int64_t cur_dts;
+    int64_t last_IP_pts;
+    int last_IP_duration;
+
+    /**
+     * Number of packets to buffer for codec probing
+     */
+#define MAX_PROBE_PACKETS 2500
+    int probe_packets;
+
+    /**
+     * Number of frames that have been demuxed during av_find_stream_info()
+     */
+    int codec_info_nb_frames;
+
+    /* av_read_frame() support */
+    enum AVStreamParseType need_parsing;
+    struct AVCodecParserContext *parser;
+
+    /**
+     * last packet in packet_buffer for this stream when muxing.
+     */
+    struct AVPacketList *last_in_packet_buffer;
+    AVProbeData probe_data;
+#define MAX_REORDER_DELAY 16
+    int64_t pts_buffer[MAX_REORDER_DELAY+1];
+
+    AVIndexEntry *index_entries; /**< Only used if the format does not
+                                    support seeking natively. */
+    int nb_index_entries;
+    unsigned int index_entries_allocated_size;
+} AVStream;
+
+#define AV_PROGRAM_RUNNING 1
+
+/**
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVProgram) must not be used outside libav*.
+ */
+typedef struct AVProgram {
+    int            id;
+    int            flags;
+    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
+    unsigned int   *stream_index;
+    unsigned int   nb_stream_indexes;
+    AVDictionary *metadata;
+} AVProgram;
+
+#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
+                                         (streams are added dynamically) */
+
+typedef struct AVChapter {
+    int id;                 ///< unique ID to identify the chapter
+    AVRational time_base;   ///< time base in which the start/end timestamps are specified
+    int64_t start, end;     ///< chapter start/end time in time_base units
+    AVDictionary *metadata;
+} AVChapter;
+
+/**
+ * Format I/O context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVFormatContext) must not be used outside libav*, use
+ * avformat_alloc_context() to create an AVFormatContext.
+ */
+typedef struct AVFormatContext {
+    /**
+     * A class for logging and AVOptions. Set by avformat_alloc_context().
+     * Exports (de)muxer private options if they exist.
+     */
+    const AVClass *av_class;
+
+    /**
+     * Can only be iformat or oformat, not both at the same time.
+     *
+     * decoding: set by avformat_open_input().
+     * encoding: set by the user.
+     */
+    struct AVInputFormat *iformat;
+    struct AVOutputFormat *oformat;
+
+    /**
+     * Format private data. This is an AVOptions-enabled struct
+     * if and only if iformat/oformat.priv_class is not NULL.
+     */
+    void *priv_data;
+
+    /**
+     * I/O context.
+     *
+     * decoding: either set by the user before avformat_open_input() (then
+     * the user must close it manually) or set by avformat_open_input().
+     * encoding: set by the user.
+     *
+     * Do NOT set this field if AVFMT_NOFILE flag is set in
+     * iformat/oformat.flags. In such a case, the (de)muxer will handle
+     * I/O in some other way and this field will be NULL.
+     */
+    AVIOContext *pb;
+
+    /* stream info */
+    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
+
+    /**
+     * A list of all streams in the file. New streams are created with
+     * avformat_new_stream().
+     *
+     * decoding: streams are created by libavformat in avformat_open_input().
+     * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+     * appear in av_read_frame().
+     * encoding: streams are created by the user before avformat_write_header().
+     */
+    unsigned int nb_streams;
+    AVStream **streams;
+
+    char filename[1024]; /**< input or output filename */
+
+    /**
+     * Decoding: position of the first frame of the component, in
+     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
+     * It is deduced from the AVStream values.
+     */
+    int64_t start_time;
+
+    /**
+     * Decoding: duration of the stream, in AV_TIME_BASE fractional
+     * seconds. Only set this value if you know none of the individual stream
+     * durations and also do not set any of them. This is deduced from the
+     * AVStream values if not set.
+     */
+    int64_t duration;
+
+    /**
+     * Decoding: total stream bitrate in bit/s, 0 if not
+     * available. Never set it directly if the file_size and the
+     * duration are known as Libav can compute it automatically.
+     */
+    int bit_rate;
+
+    unsigned int packet_size;
+    int max_delay;
+
+    int flags;
+#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
+#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
+#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
+#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
+#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
+#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
+#define AVFMT_FLAG_NOBUFFER     0x0040 ///< Do not buffer frames when possible
+#define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
+
+    /**
+     * decoding: size of data to probe; encoding: unused.
+     */
+    unsigned int probesize;
+
+    /**
+     * decoding: maximum time (in AV_TIME_BASE units) during which the input should
+     * be analyzed in avformat_find_stream_info().
+     */
+    int max_analyze_duration;
+
+    const uint8_t *key;
+    int keylen;
+
+    unsigned int nb_programs;
+    AVProgram **programs;
+
+    /**
+     * Forced video codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID video_codec_id;
+
+    /**
+     * Forced audio codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID audio_codec_id;
+
+    /**
+     * Forced subtitle codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID subtitle_codec_id;
+
+    /**
+     * Maximum amount of memory in bytes to use for the index of each stream.
+     * If the index exceeds this size, entries will be discarded as
+     * needed to maintain a smaller size. This can lead to slower or less
+     * accurate seeking (depends on demuxer).
+     * Demuxers for which a full in-memory index is mandatory will ignore
+     * this.
+     * muxing  : unused
+     * demuxing: set by user
+     */
+    unsigned int max_index_size;
+
+    /**
+     * Maximum amount of memory in bytes to use for buffering frames
+     * obtained from realtime capture devices.
+     */
+    unsigned int max_picture_buffer;
+
+    unsigned int nb_chapters;
+    AVChapter **chapters;
+
+    AVDictionary *metadata;
+
+    /**
+     * Start time of the stream in real world time, in microseconds
+     * since the unix epoch (00:00 1st January 1970). That is, pts=0
+     * in the stream was captured at this real world time.
+     * - encoding: Set by user.
+     * - decoding: Unused.
+     */
+    int64_t start_time_realtime;
+
+    /**
+     * decoding: number of frames used to probe fps
+     */
+    int fps_probe_size;
+
+    /**
+     * Error recognition; higher values will detect more errors but may
+     * misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_recognition;
+
+    /**
+     * Custom interrupt callbacks for the I/O layer.
+     *
+     * decoding: set by the user before avformat_open_input().
+     * encoding: set by the user before avformat_write_header()
+     * (mainly useful for AVFMT_NOFILE formats). The callback
+     * should also be passed to avio_open2() if it's used to
+     * open the file.
+     */
+    AVIOInterruptCB interrupt_callback;
+
+    /**
+     * Flags to enable debugging.
+     */
+    int debug;
+#define FF_FDEBUG_TS        0x0001
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * This buffer is only needed when packets were already buffered but
+     * not decoded, for example to get the codec parameters in MPEG
+     * streams.
+     */
+    struct AVPacketList *packet_buffer;
+    struct AVPacketList *packet_buffer_end;
+
+    /* av_seek_frame() support */
+    int64_t data_offset; /**< offset of the first packet */
+
+    /**
+     * Raw packets from the demuxer, prior to parsing and decoding.
+     * This buffer is used for buffering packets until the codec can
+     * be identified, as parsing cannot be done without knowing the
+     * codec.
+     */
+    struct AVPacketList *raw_packet_buffer;
+    struct AVPacketList *raw_packet_buffer_end;
+    /**
+     * Packets split by the parser get queued here.
+     */
+    struct AVPacketList *parse_queue;
+    struct AVPacketList *parse_queue_end;
+    /**
+     * Remaining size available for raw_packet_buffer, in bytes.
+     */
+#define RAW_PACKET_BUFFER_SIZE 2500000
+    int raw_packet_buffer_remaining_size;
+} AVFormatContext;
+
+typedef struct AVPacketList {
+    AVPacket pkt;
+    struct AVPacketList *next;
+} AVPacketList;
+
+
+/**
+ * @defgroup lavf_core Core functions
+ * @ingroup libavf
+ *
+ * Functions for querying libavformat capabilities, allocating core structures,
+ * etc.
+ * @{
+ */
+
+/**
+ * Return the LIBAVFORMAT_VERSION_INT constant.
+ */
+unsigned avformat_version(void);
+
+/**
+ * Return the libavformat build-time configuration.
+ */
+const char *avformat_configuration(void);
+
+/**
+ * Return the libavformat license.
+ */
+const char *avformat_license(void);
+
+/**
+ * Initialize libavformat and register all the muxers, demuxers and
+ * protocols. If you do not call this function, then you can select
+ * exactly which formats you want to support.
+ *
+ * @see av_register_input_format()
+ * @see av_register_output_format()
+ * @see av_register_protocol()
+ */
+void av_register_all(void);
+
+void av_register_input_format(AVInputFormat *format);
+void av_register_output_format(AVOutputFormat *format);
+
+/**
+ * Do global initialization of network components. This is optional,
+ * but recommended, since it avoids the overhead of implicitly
+ * doing the setup for each session.
+ *
+ * Calling this function will become mandatory if using network
+ * protocols at some major version bump.
+ */
+int avformat_network_init(void);
+
+/**
+ * Undo the initialization done by avformat_network_init.
+ */
+int avformat_network_deinit(void);
+
+/**
+ * If f is NULL, returns the first registered input format,
+ * if f is non-NULL, returns the next registered input format after f
+ * or NULL if f is the last one.
+ */
+AVInputFormat  *av_iformat_next(AVInputFormat  *f);
+
+/**
+ * If f is NULL, returns the first registered output format,
+ * if f is non-NULL, returns the next registered output format after f
+ * or NULL if f is the last one.
+ */
+AVOutputFormat *av_oformat_next(AVOutputFormat *f);
+
+/**
+ * Allocate an AVFormatContext.
+ * avformat_free_context() can be used to free the context and everything
+ * allocated by the framework within it.
+ */
+AVFormatContext *avformat_alloc_context(void);
+
+/**
+ * Free an AVFormatContext and all its streams.
+ * @param s context to free
+ */
+void avformat_free_context(AVFormatContext *s);
+
+/**
+ * Get the AVClass for AVFormatContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avformat_get_class(void);
+
+/**
+ * Add a new stream to a media file.
+ *
+ * When demuxing, it is called by the demuxer in read_header(). If the
+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ * be called in read_packet().
+ *
+ * When muxing, should be called by the user before avformat_write_header().
+ *
+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ * will be initialized to use this codec. This is needed for e.g. codec-specific
+ * defaults to be set, so codec should be provided if it is known.
+ *
+ * @return newly created stream or NULL on error.
+ */
+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
+
+AVProgram *av_new_program(AVFormatContext *s, int id);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+
+/**
+ * Find AVInputFormat based on the short name of the input format.
+ */
+AVInputFormat *av_find_input_format(const char *short_name);
+
+/**
+ * Guess the file format.
+ *
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ */
+AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
+
+/**
+ * Guess the file format.
+ *
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ * @param score_max A probe score larger that this is required to accept a
+ *                  detection, the variable is set to the actual detection
+ *                  score afterwards.
+ *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
+ *                  to retry with a larger probe buffer.
+ */
+AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
+
+/**
+ * Probe a bytestream to determine the input format. Each time a probe returns
+ * with a score that is too low, the probe buffer size is increased and another
+ * attempt is made. When the maximum probe size is reached, the input format
+ * with the highest score is returned.
+ *
+ * @param pb the bytestream to probe
+ * @param fmt the input format is put here
+ * @param filename the filename of the stream
+ * @param logctx the log context
+ * @param offset the offset within the bytestream to probe from
+ * @param max_probe_size the maximum probe buffer size (zero for default)
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
+                          const char *filename, void *logctx,
+                          unsigned int offset, unsigned int max_probe_size);
+
+/**
+ * Open an input stream and read the header. The codecs are not opened.
+ * The stream must be closed with av_close_input_file().
+ *
+ * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ *           function and written into ps.
+ *           Note that a user-supplied AVFormatContext will be freed on failure.
+ * @param filename Name of the stream to open.
+ * @param fmt If non-NULL, this parameter forces a specific input format.
+ *            Otherwise the format is autodetected.
+ * @param options  A dictionary filled with AVFormatContext and demuxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, a negative AVERROR on failure.
+ *
+ * @note If you want to use custom IO, preallocate the format context and set its pb field.
+ */
+int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
+
+/**
+ * Read packets of a media file to get stream information. This
+ * is useful for file formats with no headers such as MPEG. This
+ * function also computes the real framerate in case of MPEG-2 repeat
+ * frame mode.
+ * The logical file position is not changed by this function;
+ * examined packets may be buffered for later processing.
+ *
+ * @param ic media file handle
+ * @param options  If non-NULL, an ic.nb_streams long array of pointers to
+ *                 dictionaries, where i-th member contains options for
+ *                 codec corresponding to i-th stream.
+ *                 On return each dictionary will be filled with options that were not found.
+ * @return >=0 if OK, AVERROR_xxx on error
+ *
+ * @note this function isn't guaranteed to open all the codecs, so
+ *       options being non-empty at return is a perfectly normal behavior.
+ *
+ * @todo Let the user decide somehow what information is needed so that
+ *       we do not waste time getting stuff the user does not need.
+ */
+int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
+
+/**
+ * Find the "best" stream in the file.
+ * The best stream is determined according to various heuristics as the most
+ * likely to be what the user expects.
+ * If the decoder parameter is non-NULL, av_find_best_stream will find the
+ * default decoder for the stream's codec; streams for which no decoder can
+ * be found are ignored.
+ *
+ * @param ic                media file handle
+ * @param type              stream type: video, audio, subtitles, etc.
+ * @param wanted_stream_nb  user-requested stream number,
+ *                          or -1 for automatic selection
+ * @param related_stream    try to find a stream related (eg. in the same
+ *                          program) to this one, or -1 if none
+ * @param decoder_ret       if non-NULL, returns the decoder for the
+ *                          selected stream
+ * @param flags             flags; none are currently defined
+ * @return  the non-negative stream number in case of success,
+ *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ *          could be found,
+ *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ * @note  If av_find_best_stream returns successfully and decoder_ret is not
+ *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+ */
+int av_find_best_stream(AVFormatContext *ic,
+                        enum AVMediaType type,
+                        int wanted_stream_nb,
+                        int related_stream,
+                        AVCodec **decoder_ret,
+                        int flags);
+
+#if FF_API_READ_PACKET
+/**
+ * @deprecated use AVFMT_FLAG_NOFILLIN | AVFMT_FLAG_NOPARSE to read raw
+ * unprocessed packets
+ *
+ * Read a transport packet from a media file.
+ *
+ * This function is obsolete and should never be used.
+ * Use av_read_frame() instead.
+ *
+ * @param s media file handle
+ * @param pkt is filled
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+attribute_deprecated
+int av_read_packet(AVFormatContext *s, AVPacket *pkt);
+#endif
+
+/**
+ * Return the next frame of a stream.
+ * This function returns what is stored in the file, and does not validate
+ * that what is there are valid frames for the decoder. It will split what is
+ * stored in the file into frames and return one for each call. It will not
+ * omit invalid data between valid frames so as to give the decoder the maximum
+ * information possible for decoding.
+ *
+ * The returned packet is valid
+ * until the next av_read_frame() or until av_close_input_file() and
+ * must be freed with av_free_packet. For video, the packet contains
+ * exactly one frame. For audio, it contains an integer number of
+ * frames if each frame has a known fixed size (e.g. PCM or ADPCM
+ * data). If the audio frames have a variable size (e.g. MPEG audio),
+ * then it contains one frame.
+ *
+ * pkt->pts, pkt->dts and pkt->duration are always set to correct
+ * values in AVStream.time_base units (and guessed if the format cannot
+ * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
+ * has B-frames, so it is better to rely on pkt->dts if you do not
+ * decompress the payload.
+ *
+ * @return 0 if OK, < 0 on error or end of file
+ */
+int av_read_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Seek to the keyframe at timestamp.
+ * 'timestamp' in 'stream_index'.
+ * @param stream_index If stream_index is (-1), a default
+ * stream is selected, and timestamp is automatically converted
+ * from AV_TIME_BASE units to the stream specific time_base.
+ * @param timestamp Timestamp in AVStream.time_base units
+ *        or, if no stream is specified, in AV_TIME_BASE units.
+ * @param flags flags which select direction and seeking mode
+ * @return >= 0 on success
+ */
+int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
+                  int flags);
+
+/**
+ * Seek to timestamp ts.
+ * Seeking will be done so that the point from which all active streams
+ * can be presented successfully will be closest to ts and within min/max_ts.
+ * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+ *
+ * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
+ * are the file position (this may not be supported by all demuxers).
+ * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
+ * in the stream with stream_index (this may not be supported by all demuxers).
+ * Otherwise all timestamps are in units of the stream selected by stream_index
+ * or if stream_index is -1, in AV_TIME_BASE units.
+ * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
+ * keyframes (this may not be supported by all demuxers).
+ *
+ * @param stream_index index of the stream which is used as time base reference
+ * @param min_ts smallest acceptable timestamp
+ * @param ts target timestamp
+ * @param max_ts largest acceptable timestamp
+ * @param flags flags
+ * @return >=0 on success, error code otherwise
+ *
+ * @note This is part of the new seek API which is still under construction.
+ *       Thus do not use this yet. It may change at any time, do not expect
+ *       ABI compatibility yet!
+ */
+int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+/**
+ * Start playing a network-based stream (e.g. RTSP stream) at the
+ * current position.
+ */
+int av_read_play(AVFormatContext *s);
+
+/**
+ * Pause a network-based stream (e.g. RTSP stream).
+ *
+ * Use av_read_play() to resume it.
+ */
+int av_read_pause(AVFormatContext *s);
+
+#if FF_API_CLOSE_INPUT_FILE
+/**
+ * @deprecated use avformat_close_input()
+ * Close a media file (but not its codecs).
+ *
+ * @param s media file handle
+ */
+attribute_deprecated
+void av_close_input_file(AVFormatContext *s);
+#endif
+
+/**
+ * Close an opened input AVFormatContext. Free it and all its contents
+ * and set *s to NULL.
+ */
+void avformat_close_input(AVFormatContext **s);
+/**
+ * @}
+ */
+
+#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
+#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
+#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
+#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+/**
+ * Allocate the stream private data and write the stream header to
+ * an output media file.
+ *
+ * @param s Media file handle, must be allocated with avformat_alloc_context().
+ *          Its oformat field must be set to the desired output format;
+ *          Its pb field must be set to an already openened AVIOContext.
+ * @param options  An AVDictionary filled with AVFormatContext and muxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, negative AVERROR on failure.
+ *
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+ */
+int avformat_write_header(AVFormatContext *s, AVDictionary **options);
+
+/**
+ * Write a packet to an output media file.
+ *
+ * The packet shall contain one audio or video frame.
+ * The packet must be correctly interleaved according to the container
+ * specification, if not then av_interleaved_write_frame must be used.
+ *
+ * @param s media file handle
+ * @param pkt The packet, which contains the stream_index, buf/buf_size,
+ *            dts/pts, ...
+ *            This can be NULL (at any time, not just at the end), in
+ *            order to immediately flush data buffered within the muxer,
+ *            for muxers that buffer up data internally before writing it
+ *            to the output.
+ * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
+ */
+int av_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Write a packet to an output media file ensuring correct interleaving.
+ *
+ * The packet must contain one audio or video frame.
+ * If the packets are already correctly interleaved, the application should
+ * call av_write_frame() instead as it is slightly faster. It is also important
+ * to keep in mind that completely non-interleaved input will need huge amounts
+ * of memory to interleave with this, so it is preferable to interleave at the
+ * demuxer level.
+ *
+ * @param s media file handle
+ * @param pkt The packet containing the data to be written. Libavformat takes
+ * ownership of the data and will free it when it sees fit using the packet's
+ * This can be NULL (at any time, not just at the end), to flush the
+ * interleaving queues.
+ * @ref AVPacket.destruct "destruct" field. The caller must not access the data
+ * after this function returns, as it may already be freed.
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
+ * index of the corresponding stream in @ref AVFormatContext.streams
+ * "s.streams".
+ * It is very strongly recommended that timing information (@ref AVPacket.pts
+ * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
+ * correct values.
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+#if FF_API_INTERLEAVE_PACKET
+/**
+ * @deprecated this function was never meant to be called by the user
+ * programs.
+ */
+attribute_deprecated
+int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
+                                 AVPacket *pkt, int flush);
+#endif
+
+/**
+ * Write the stream trailer to an output media file and free the
+ * file private data.
+ *
+ * May only be called after a successful call to avformat_write_header.
+ *
+ * @param s media file handle
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_write_trailer(AVFormatContext *s);
+
+/**
+ * Return the output format in the list of registered output formats
+ * which best matches the provided parameters, or return NULL if
+ * there is no match.
+ *
+ * @param short_name if non-NULL checks if short_name matches with the
+ * names of the registered formats
+ * @param filename if non-NULL checks if filename terminates with the
+ * extensions of the registered formats
+ * @param mime_type if non-NULL checks if mime_type matches with the
+ * MIME type of the registered formats
+ */
+AVOutputFormat *av_guess_format(const char *short_name,
+                                const char *filename,
+                                const char *mime_type);
+
+/**
+ * Guess the codec ID based upon muxer and filename.
+ */
+enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+                            const char *filename, const char *mime_type,
+                            enum AVMediaType type);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @defgroup lavf_misc Utility functions
+ * @ingroup libavf
+ * @{
+ *
+ * Miscelaneous utility functions related to both muxing and demuxing
+ * (or neither).
+ */
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump(FILE *f, const uint8_t *buf, int size);
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
+
+/**
+ * Send a nice dump of a packet to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
+
+
+/**
+ * Send a nice dump of a packet to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
+                      AVStream *st);
+
+/**
+ * Get the AVCodecID for the given codec tag tag.
+ * If no codec id is found returns AV_CODEC_ID_NONE.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ */
+enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
+
+/**
+ * Get the codec tag for the given codec id id.
+ * If no codec tag is found returns 0.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ */
+unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
+
+int av_find_default_stream_index(AVFormatContext *s);
+
+/**
+ * Get the index for a specific timestamp.
+ * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
+ *                 to the timestamp which is <= the requested one, if backward
+ *                 is 0, then it will be >=
+ *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
+ * @return < 0 if no such timestamp could be found
+ */
+int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
+
+/**
+ * Add an index entry into a sorted list. Update the entry if the list
+ * already contains it.
+ *
+ * @param timestamp timestamp in the time base of the given stream
+ */
+int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
+                       int size, int distance, int flags);
+
+
+/**
+ * Split a URL string into components.
+ *
+ * The pointers to buffers for storing individual components may be null,
+ * in order to ignore that component. Buffers for components not found are
+ * set to empty strings. If the port is not found, it is set to a negative
+ * value.
+ *
+ * @param proto the buffer for the protocol
+ * @param proto_size the size of the proto buffer
+ * @param authorization the buffer for the authorization
+ * @param authorization_size the size of the authorization buffer
+ * @param hostname the buffer for the host name
+ * @param hostname_size the size of the hostname buffer
+ * @param port_ptr a pointer to store the port number in
+ * @param path the buffer for the path
+ * @param path_size the size of the path buffer
+ * @param url the URL to split
+ */
+void av_url_split(char *proto,         int proto_size,
+                  char *authorization, int authorization_size,
+                  char *hostname,      int hostname_size,
+                  int *port_ptr,
+                  char *path,          int path_size,
+                  const char *url);
+
+
+void av_dump_format(AVFormatContext *ic,
+                    int index,
+                    const char *url,
+                    int is_output);
+
+/**
+ * Return in 'buf' the path with '%d' replaced by a number.
+ *
+ * Also handles the '%0nd' format where 'n' is the total number
+ * of digits and '%%'.
+ *
+ * @param buf destination buffer
+ * @param buf_size destination buffer size
+ * @param path numbered sequence string
+ * @param number frame number
+ * @return 0 if OK, -1 on format error
+ */
+int av_get_frame_filename(char *buf, int buf_size,
+                          const char *path, int number);
+
+/**
+ * Check whether filename actually is a numbered sequence generator.
+ *
+ * @param filename possible numbered sequence string
+ * @return 1 if a valid numbered sequence string, 0 otherwise
+ */
+int av_filename_number_test(const char *filename);
+
+/**
+ * Generate an SDP for an RTP session.
+ *
+ * @param ac array of AVFormatContexts describing the RTP streams. If the
+ *           array is composed by only one context, such context can contain
+ *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
+ *           all the contexts in the array (an AVCodecContext per RTP stream)
+ *           must contain only one AVStream.
+ * @param n_files number of AVCodecContexts contained in ac
+ * @param buf buffer where the SDP will be stored (must be allocated by
+ *            the caller)
+ * @param size the size of the buffer
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
+
+/**
+ * Return a positive value if the given filename has one of the given
+ * extensions, 0 otherwise.
+ *
+ * @param extensions a comma-separated list of filename extensions
+ */
+int av_match_ext(const char *filename, const char *extensions);
+
+/**
+ * Test if the given container can store a codec.
+ *
+ * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+ *
+ * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ *         A negative number if this information is not available.
+ */
+int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance);
+
+/**
+ * @defgroup riff_fourcc RIFF FourCCs
+ * @{
+ * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
+ * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
+ * following code:
+ * @code
+ * uint32_t tag = MKTAG('H', '2', '6', '4');
+ * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
+ * enum AVCodecID id = av_codec_get_id(table, tag);
+ * @endcode
+ */
+/**
+ * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_video_tags(void);
+/**
+ * @return the table mapping RIFF FourCCs for audio to AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_audio_tags(void);
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/misc/winutils/include/libavformat/avio.h b/misc/winutils/include/libavformat/avio.h
new file mode 100644
index 0000000..b6d3cb3
--- /dev/null
+++ b/misc/winutils/include/libavformat/avio.h
@@ -0,0 +1,433 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef AVFORMAT_AVIO_H
+#define AVFORMAT_AVIO_H
+
+/**
+ * @file
+ * @ingroup lavf_io
+ * Buffered I/O operations
+ */
+
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "libavformat/version.h"
+
+
+#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+
+/**
+ * Callback for checking whether to abort blocking functions.
+ * AVERROR_EXIT is returned in this case by the interrupted
+ * function. During blocking operations, callback is called with
+ * opaque as parameter. If the callback returns 1, the
+ * blocking operation will be aborted.
+ *
+ * No members can be added to this struct without a major bump, if
+ * new elements have been added after this struct in AVFormatContext
+ * or AVIOContext.
+ */
+typedef struct AVIOInterruptCB {
+    int (*callback)(void*);
+    void *opaque;
+} AVIOInterruptCB;
+
+/**
+ * Bytestream IO Context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVIOContext) must not be used outside libav*.
+ *
+ * @note None of the function pointers in AVIOContext should be called
+ *       directly, they should only be set by the client application
+ *       when implementing custom I/O. Normally these are set to the
+ *       function pointers specified in avio_alloc_context()
+ */
+typedef struct AVIOContext {
+    /**
+     * A class for private options.
+     *
+     * If this AVIOContext is created by avio_open2(), av_class is set and
+     * passes the options down to protocols.
+     *
+     * If this AVIOContext is manually allocated, then av_class may be set by
+     * the caller.
+     *
+     * warning -- this field can be NULL, be sure to not pass this AVIOContext
+     * to any av_opt_* functions in that case.
+     */
+    const AVClass *av_class;
+    unsigned char *buffer;  /**< Start of the buffer. */
+    int buffer_size;        /**< Maximum buffer size */
+    unsigned char *buf_ptr; /**< Current position in the buffer */
+    unsigned char *buf_end; /**< End of the data, may be less than
+                                 buffer+buffer_size if the read function returned
+                                 less data than requested, e.g. for streams where
+                                 no more data has been received yet. */
+    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
+                                 functions. */
+    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int64_t (*seek)(void *opaque, int64_t offset, int whence);
+    int64_t pos;            /**< position in the file of the current buffer */
+    int must_flush;         /**< true if the next seek should flush */
+    int eof_reached;        /**< true if eof reached */
+    int write_flag;         /**< true if open for writing */
+    int max_packet_size;
+    unsigned long checksum;
+    unsigned char *checksum_ptr;
+    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
+    int error;              /**< contains the error code or 0 if no error happened */
+    /**
+     * Pause or resume playback for network streaming protocols - e.g. MMS.
+     */
+    int (*read_pause)(void *opaque, int pause);
+    /**
+     * Seek to a given timestamp in stream with the specified stream_index.
+     * Needed for some network streaming protocols which don't support seeking
+     * to byte position.
+     */
+    int64_t (*read_seek)(void *opaque, int stream_index,
+                         int64_t timestamp, int flags);
+    /**
+     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
+     */
+    int seekable;
+} AVIOContext;
+
+/* unbuffered I/O */
+
+/**
+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
+ * of the resource in url, or a negative value corresponding to an
+ * AVERROR code in case of failure. The returned access flags are
+ * masked by the value in flags.
+ *
+ * @note This function is intrinsically unsafe, in the sense that the
+ * checked resource may change its existence or permission status from
+ * one call to another. Thus you should not trust the returned value,
+ * unless you are sure that no other processes are accessing the
+ * checked resource.
+ */
+int avio_check(const char *url, int flags);
+
+/**
+ * Allocate and initialize an AVIOContext for buffered I/O. It must be later
+ * freed with av_free().
+ *
+ * @param buffer Memory block for input/output operations via AVIOContext.
+ *        The buffer must be allocated with av_malloc() and friends.
+ * @param buffer_size The buffer size is very important for performance.
+ *        For protocols with fixed blocksize it should be set to this blocksize.
+ *        For others a typical size is a cache page, e.g. 4kb.
+ * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
+ * @param opaque An opaque pointer to user-specific data.
+ * @param read_packet  A function for refilling the buffer, may be NULL.
+ * @param write_packet A function for writing the buffer contents, may be NULL.
+ * @param seek A function for seeking to specified byte position, may be NULL.
+ *
+ * @return Allocated AVIOContext or NULL on failure.
+ */
+AVIOContext *avio_alloc_context(
+                  unsigned char *buffer,
+                  int buffer_size,
+                  int write_flag,
+                  void *opaque,
+                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
+
+void avio_w8(AVIOContext *s, int b);
+void avio_write(AVIOContext *s, const unsigned char *buf, int size);
+void avio_wl64(AVIOContext *s, uint64_t val);
+void avio_wb64(AVIOContext *s, uint64_t val);
+void avio_wl32(AVIOContext *s, unsigned int val);
+void avio_wb32(AVIOContext *s, unsigned int val);
+void avio_wl24(AVIOContext *s, unsigned int val);
+void avio_wb24(AVIOContext *s, unsigned int val);
+void avio_wl16(AVIOContext *s, unsigned int val);
+void avio_wb16(AVIOContext *s, unsigned int val);
+
+/**
+ * Write a NULL-terminated string.
+ * @return number of bytes written.
+ */
+int avio_put_str(AVIOContext *s, const char *str);
+
+/**
+ * Convert an UTF-8 string to UTF-16LE and write it.
+ * @return number of bytes written.
+ */
+int avio_put_str16le(AVIOContext *s, const char *str);
+
+/**
+ * Passing this as the "whence" parameter to a seek function causes it to
+ * return the filesize without seeking anywhere. Supporting this is optional.
+ * If it is not supported then the seek function will return <0.
+ */
+#define AVSEEK_SIZE 0x10000
+
+/**
+ * Oring this flag as into the "whence" parameter to a seek function causes it to
+ * seek by any means (like reopening and linear reading) or other normally unreasonble
+ * means that can be extreemly slow.
+ * This may be ignored by the seek code.
+ */
+#define AVSEEK_FORCE 0x20000
+
+/**
+ * fseek() equivalent for AVIOContext.
+ * @return new position or AVERROR.
+ */
+int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
+
+/**
+ * Skip given number of bytes forward
+ * @return new position or AVERROR.
+ */
+static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
+{
+    return avio_seek(s, offset, SEEK_CUR);
+}
+
+/**
+ * ftell() equivalent for AVIOContext.
+ * @return position or AVERROR.
+ */
+static av_always_inline int64_t avio_tell(AVIOContext *s)
+{
+    return avio_seek(s, 0, SEEK_CUR);
+}
+
+/**
+ * Get the filesize.
+ * @return filesize or AVERROR
+ */
+int64_t avio_size(AVIOContext *s);
+
+/** @warning currently size is limited */
+int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
+
+void avio_flush(AVIOContext *s);
+
+
+/**
+ * Read size bytes from AVIOContext into buf.
+ * @return number of bytes read or AVERROR
+ */
+int avio_read(AVIOContext *s, unsigned char *buf, int size);
+
+/**
+ * @name Functions for reading from AVIOContext
+ * @{
+ *
+ * @note return 0 if EOF, so you cannot use it if EOF handling is
+ *       necessary
+ */
+int          avio_r8  (AVIOContext *s);
+unsigned int avio_rl16(AVIOContext *s);
+unsigned int avio_rl24(AVIOContext *s);
+unsigned int avio_rl32(AVIOContext *s);
+uint64_t     avio_rl64(AVIOContext *s);
+unsigned int avio_rb16(AVIOContext *s);
+unsigned int avio_rb24(AVIOContext *s);
+unsigned int avio_rb32(AVIOContext *s);
+uint64_t     avio_rb64(AVIOContext *s);
+/**
+ * @}
+ */
+
+/**
+ * Read a string from pb into buf. The reading will terminate when either
+ * a NULL character was encountered, maxlen bytes have been read, or nothing
+ * more can be read from pb. The result is guaranteed to be NULL-terminated, it
+ * will be truncated if buf is too small.
+ * Note that the string is not interpreted or validated in any way, it
+ * might get truncated in the middle of a sequence for multi-byte encodings.
+ *
+ * @return number of bytes read (is always <= maxlen).
+ * If reading ends on EOF or error, the return value will be one more than
+ * bytes actually read.
+ */
+int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+/**
+ * Read a UTF-16 string from pb and convert it to UTF-8.
+ * The reading will terminate when either a null or invalid character was
+ * encountered or maxlen bytes have been read.
+ * @return number of bytes read (is always <= maxlen)
+ */
+int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
+int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+
+/**
+ * @name URL open modes
+ * The flags argument to avio_open must be one of the following
+ * constants, optionally ORed with other flags.
+ * @{
+ */
+#define AVIO_FLAG_READ  1                                      /**< read-only */
+#define AVIO_FLAG_WRITE 2                                      /**< write-only */
+#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
+/**
+ * @}
+ */
+
+/**
+ * Use non-blocking mode.
+ * If this flag is set, operations on the context will return
+ * AVERROR(EAGAIN) if they can not be performed immediately.
+ * If this flag is not set, operations on the context will never return
+ * AVERROR(EAGAIN).
+ * Note that this flag does not affect the opening/connecting of the
+ * context. Connecting a protocol will always block if necessary (e.g. on
+ * network protocols) but never hang (e.g. on busy devices).
+ * Warning: non-blocking protocols is work-in-progress; this flag may be
+ * silently ignored.
+ */
+#define AVIO_FLAG_NONBLOCK 8
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open(AVIOContext **s, const char *url, int flags);
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @param int_cb an interrupt callback to be used at the protocols level
+ * @param options  A dictionary filled with protocol-private options. On return
+ * this parameter will be destroyed and replaced with a dict containing options
+ * that were not found. May be NULL.
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open2(AVIOContext **s, const char *url, int flags,
+               const AVIOInterruptCB *int_cb, AVDictionary **options);
+
+/**
+ * Close the resource accessed by the AVIOContext s and free it.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_closep
+ */
+int avio_close(AVIOContext *s);
+
+/**
+ * Close the resource accessed by the AVIOContext *s, free it
+ * and set the pointer pointing to it to NULL.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_close
+ */
+int avio_closep(AVIOContext **s);
+
+
+/**
+ * Open a write only memory stream.
+ *
+ * @param s new IO context
+ * @return zero if no error.
+ */
+int avio_open_dyn_buf(AVIOContext **s);
+
+/**
+ * Return the written size and a pointer to the buffer. The buffer
+ * must be freed with av_free().
+ * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+ *
+ * @param s IO context
+ * @param pbuffer pointer to a byte buffer
+ * @return the length of the byte buffer
+ */
+int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
+
+/**
+ * Iterate through names of available protocols.
+ *
+ * @param opaque A private pointer representing current protocol.
+ *        It must be a pointer to NULL on first iteration and will
+ *        be updated by successive calls to avio_enum_protocols.
+ * @param output If set to 1, iterate over output protocols,
+ *               otherwise over input protocols.
+ *
+ * @return A static string containing the name of current protocol or NULL
+ */
+const char *avio_enum_protocols(void **opaque, int output);
+
+/**
+ * Pause and resume playing - only meaningful if using a network streaming
+ * protocol (e.g. MMS).
+ * @param pause 1 for pause, 0 for resume
+ */
+int     avio_pause(AVIOContext *h, int pause);
+
+/**
+ * Seek to a given timestamp relative to some component stream.
+ * Only meaningful if using a network streaming protocol (e.g. MMS.).
+ * @param stream_index The stream index that the timestamp is relative to.
+ *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ *        units from the beginning of the presentation.
+ *        If a stream_index >= 0 is used and the protocol does not support
+ *        seeking based on component streams, the call will fail with ENOTSUP.
+ * @param timestamp timestamp in AVStream.time_base units
+ *        or if there is no stream specified then in AV_TIME_BASE units.
+ * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ *        fail with ENOTSUP if used and not supported.
+ * @return >= 0 on success
+ * @see AVInputFormat::read_seek
+ */
+int64_t avio_seek_time(AVIOContext *h, int stream_index,
+                       int64_t timestamp, int flags);
+
+#endif /* AVFORMAT_AVIO_H */
diff --git a/misc/winutils/include/libavformat/version.h b/misc/winutils/include/libavformat/version.h
new file mode 100644
index 0000000..034fa0a
--- /dev/null
+++ b/misc/winutils/include/libavformat/version.h
@@ -0,0 +1,71 @@
+/*
+ * Version macros.
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_VERSION_H
+#define AVFORMAT_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Libavformat version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBAVFORMAT_VERSION_MAJOR 54
+#define LIBAVFORMAT_VERSION_MINOR 19
+#define LIBAVFORMAT_VERSION_MICRO  0
+
+#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
+                                               LIBAVFORMAT_VERSION_MINOR, \
+                                               LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
+                                           LIBAVFORMAT_VERSION_MINOR,   \
+                                           LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
+
+#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_CLOSE_INPUT_FILE
+#define FF_API_CLOSE_INPUT_FILE        (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_APPLEHTTP_PROTO
+#define FF_API_APPLEHTTP_PROTO         (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_READ_PACKET
+#define FF_API_READ_PACKET             (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_INTERLEAVE_PACKET
+#define FF_API_INTERLEAVE_PACKET       (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_AV_GETTIME
+#define FF_API_AV_GETTIME              (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+#ifndef FF_API_R_FRAME_RATE
+#define FF_API_R_FRAME_RATE            (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
+
+#endif /* AVFORMAT_VERSION_H */
diff --git a/misc/winutils/include/libavutil/adler32.h b/misc/winutils/include/libavutil/adler32.h
new file mode 100644
index 0000000..a8ff6f9
--- /dev/null
+++ b/misc/winutils/include/libavutil/adler32.h
@@ -0,0 +1,43 @@
+/*
+ * copyright (c) 2006 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_ADLER32_H
+#define AVUTIL_ADLER32_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+/**
+ * @ingroup lavu_crypto
+ * Calculate the Adler32 checksum of a buffer.
+ *
+ * Passing the return value to a subsequent av_adler32_update() call
+ * allows the checksum of multiple buffers to be calculated as though
+ * they were concatenated.
+ *
+ * @param adler initial checksum value
+ * @param buf   pointer to input buffer
+ * @param len   size of input buffer
+ * @return      updated checksum
+ */
+unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
+                                unsigned int len) av_pure;
+
+#endif /* AVUTIL_ADLER32_H */
diff --git a/misc/winutils/include/libavutil/aes.h b/misc/winutils/include/libavutil/aes.h
new file mode 100644
index 0000000..edff275
--- /dev/null
+++ b/misc/winutils/include/libavutil/aes.h
@@ -0,0 +1,67 @@
+/*
+ * copyright (c) 2007 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AES_H
+#define AVUTIL_AES_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_aes AES
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_aes_size;
+#endif
+
+struct AVAES;
+
+/**
+ * Allocate an AVAES context.
+ */
+struct AVAES *av_aes_alloc(void);
+
+/**
+ * Initialize an AVAES context.
+ * @param key_bits 128, 192 or 256
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ * @param count number of 16 byte blocks
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AES_H */
diff --git a/misc/winutils/include/libavutil/attributes.h b/misc/winutils/include/libavutil/attributes.h
new file mode 100644
index 0000000..292a0a1
--- /dev/null
+++ b/misc/winutils/include/libavutil/attributes.h
@@ -0,0 +1,122 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Macro definitions for various function/variable attributes
+ */
+
+#ifndef AVUTIL_ATTRIBUTES_H
+#define AVUTIL_ATTRIBUTES_H
+
+#ifdef __GNUC__
+#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
+#else
+#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_always_inline __attribute__((always_inline)) inline
+#elif defined(_MSC_VER)
+#    define av_always_inline __forceinline
+#else
+#    define av_always_inline inline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_noinline __attribute__((noinline))
+#else
+#    define av_noinline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_pure __attribute__((pure))
+#else
+#    define av_pure
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,6)
+#    define av_const __attribute__((const))
+#else
+#    define av_const
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+#    define av_cold __attribute__((cold))
+#else
+#    define av_cold
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,1)
+#    define av_flatten __attribute__((flatten))
+#else
+#    define av_flatten
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define attribute_deprecated __attribute__((deprecated))
+#else
+#    define attribute_deprecated
+#endif
+
+#if defined(__GNUC__)
+#    define av_unused __attribute__((unused))
+#else
+#    define av_unused
+#endif
+
+/**
+ * Mark a variable as used and prevent the compiler from optimizing it
+ * away.  This is useful for variables accessed only from inline
+ * assembler without the compiler being aware.
+ */
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_used __attribute__((used))
+#else
+#    define av_used
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,3)
+#   define av_alias __attribute__((may_alias))
+#else
+#   define av_alias
+#endif
+
+#if defined(__GNUC__) && !defined(__ICC)
+#    define av_uninit(x) x=x
+#else
+#    define av_uninit(x) x
+#endif
+
+#ifdef __GNUC__
+#    define av_builtin_constant_p __builtin_constant_p
+#    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
+#else
+#    define av_builtin_constant_p(x) 0
+#    define av_printf_format(fmtpos, attrpos)
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,5)
+#    define av_noreturn __attribute__((noreturn))
+#else
+#    define av_noreturn
+#endif
+
+#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/misc/winutils/include/libavutil/audio_fifo.h b/misc/winutils/include/libavutil/audio_fifo.h
new file mode 100644
index 0000000..8c76388
--- /dev/null
+++ b/misc/winutils/include/libavutil/audio_fifo.h
@@ -0,0 +1,146 @@
+/*
+ * Audio FIFO
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles at gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Audio FIFO Buffer
+ */
+
+#ifndef AVUTIL_AUDIO_FIFO_H
+#define AVUTIL_AUDIO_FIFO_H
+
+#include "avutil.h"
+#include "fifo.h"
+#include "samplefmt.h"
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * Context for an Audio FIFO Buffer.
+ *
+ * - Operates at the sample level rather than the byte level.
+ * - Supports multiple channels with either planar or packed sample format.
+ * - Automatic reallocation when writing to a full buffer.
+ */
+typedef struct AVAudioFifo AVAudioFifo;
+
+/**
+ * Free an AVAudioFifo.
+ *
+ * @param af  AVAudioFifo to free
+ */
+void av_audio_fifo_free(AVAudioFifo *af);
+
+/**
+ * Allocate an AVAudioFifo.
+ *
+ * @param sample_fmt  sample format
+ * @param channels    number of channels
+ * @param nb_samples  initial allocation size, in samples
+ * @return            newly allocated AVAudioFifo, or NULL on error
+ */
+AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
+                                 int nb_samples);
+
+/**
+ * Reallocate an AVAudioFifo.
+ *
+ * @param af          AVAudioFifo to reallocate
+ * @param nb_samples  new allocation size, in samples
+ * @return            0 if OK, or negative AVERROR code on failure
+ */
+int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
+
+/**
+ * Write data to an AVAudioFifo.
+ *
+ * The AVAudioFifo will be reallocated automatically if the available space
+ * is less than nb_samples.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param af          AVAudioFifo to write to
+ * @param data        audio data plane pointers
+ * @param nb_samples  number of samples to write
+ * @return            number of samples actually written, or negative AVERROR
+ *                    code on failure.
+ */
+int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
+
+/**
+ * Read data from an AVAudioFifo.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param af          AVAudioFifo to read from
+ * @param data        audio data plane pointers
+ * @param nb_samples  number of samples to read
+ * @return            number of samples actually read, or negative AVERROR code
+ *                    on failure.
+ */
+int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
+
+/**
+ * Drain data from an AVAudioFifo.
+ *
+ * Removes the data without reading it.
+ *
+ * @param af          AVAudioFifo to drain
+ * @param nb_samples  number of samples to drain
+ * @return            0 if OK, or negative AVERROR code on failure
+ */
+int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
+
+/**
+ * Reset the AVAudioFifo buffer.
+ *
+ * This empties all data in the buffer.
+ *
+ * @param af  AVAudioFifo to reset
+ */
+void av_audio_fifo_reset(AVAudioFifo *af);
+
+/**
+ * Get the current number of samples in the AVAudioFifo available for reading.
+ *
+ * @param af  the AVAudioFifo to query
+ * @return    number of samples available for reading
+ */
+int av_audio_fifo_size(AVAudioFifo *af);
+
+/**
+ * Get the current number of samples in the AVAudioFifo available for writing.
+ *
+ * @param af  the AVAudioFifo to query
+ * @return    number of samples available for writing
+ */
+int av_audio_fifo_space(AVAudioFifo *af);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AUDIO_FIFO_H */
diff --git a/misc/winutils/include/libavutil/audioconvert.h b/misc/winutils/include/libavutil/audioconvert.h
new file mode 100644
index 0000000..73076cb
--- /dev/null
+++ b/misc/winutils/include/libavutil/audioconvert.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ * Copyright (c) 2008 Peter Ross
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AUDIOCONVERT_H
+#define AVUTIL_AUDIOCONVERT_H
+
+#include <stdint.h>
+
+/**
+ * @file
+ * audio conversion routines
+ */
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * @defgroup channel_masks Audio channel masks
+ * @{
+ */
+#define AV_CH_FRONT_LEFT             0x00000001
+#define AV_CH_FRONT_RIGHT            0x00000002
+#define AV_CH_FRONT_CENTER           0x00000004
+#define AV_CH_LOW_FREQUENCY          0x00000008
+#define AV_CH_BACK_LEFT              0x00000010
+#define AV_CH_BACK_RIGHT             0x00000020
+#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
+#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
+#define AV_CH_BACK_CENTER            0x00000100
+#define AV_CH_SIDE_LEFT              0x00000200
+#define AV_CH_SIDE_RIGHT             0x00000400
+#define AV_CH_TOP_CENTER             0x00000800
+#define AV_CH_TOP_FRONT_LEFT         0x00001000
+#define AV_CH_TOP_FRONT_CENTER       0x00002000
+#define AV_CH_TOP_FRONT_RIGHT        0x00004000
+#define AV_CH_TOP_BACK_LEFT          0x00008000
+#define AV_CH_TOP_BACK_CENTER        0x00010000
+#define AV_CH_TOP_BACK_RIGHT         0x00020000
+#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
+#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
+#define AV_CH_WIDE_LEFT              0x0000000080000000ULL
+#define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
+#define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
+#define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
+#define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL
+
+/** Channel mask value used for AVCodecContext.request_channel_layout
+    to indicate that the user requests the channel order of the decoder output
+    to be the native codec channel order. */
+#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
+
+/**
+ * @}
+ * @defgroup channel_mask_c Audio channel convenience macros
+ * @{
+ * */
+#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
+#define AV_CH_LAYOUT_2POINT1           (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_3POINT1           (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_4POINT1           (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_6POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT0_FRONT     (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_HEXAGONAL         (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_BACK      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_FRONT     (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT0_FRONT     (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
+
+enum AVMatrixEncoding {
+    AV_MATRIX_ENCODING_NONE,
+    AV_MATRIX_ENCODING_DOLBY,
+    AV_MATRIX_ENCODING_DPLII,
+    AV_MATRIX_ENCODING_NB
+};
+
+/**
+ * @}
+ */
+
+/**
+ * Return a channel layout id that matches name, or 0 if no match is found.
+ *
+ * name can be one or several of the following notations,
+ * separated by '+' or '|':
+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
+ *   5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
+ *   SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
+ * - a number of channels, in decimal, optionally followed by 'c', yielding
+ *   the default channel layout for that number of channels (@see
+ *   av_get_default_channel_layout);
+ * - a channel layout mask, in hexadecimal starting with "0x" (see the
+ *   AV_CH_* macros).
+ *
+ * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
+ */
+uint64_t av_get_channel_layout(const char *name);
+
+/**
+ * Return a description of a channel layout.
+ * If nb_channels is <= 0, it is guessed from the channel_layout.
+ *
+ * @param buf put here the string containing the channel layout
+ * @param buf_size size in bytes of the buffer
+ */
+void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
+
+/**
+ * Return the number of channels in the channel layout.
+ */
+int av_get_channel_layout_nb_channels(uint64_t channel_layout);
+
+/**
+ * Return default channel layout for a given number of channels.
+ */
+uint64_t av_get_default_channel_layout(int nb_channels);
+
+/**
+ * Get the index of a channel in channel_layout.
+ *
+ * @param channel a channel layout describing exactly one channel which must be
+ *                present in channel_layout.
+ *
+ * @return index of channel in channel_layout on success, a negative AVERROR
+ *         on error.
+ */
+int av_get_channel_layout_channel_index(uint64_t channel_layout,
+                                        uint64_t channel);
+
+/**
+ * Get the channel with the given index in channel_layout.
+ */
+uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
+
+/**
+ * Get the name of a given channel.
+ *
+ * @return channel name on success, NULL on error.
+ */
+const char *av_get_channel_name(uint64_t channel);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AUDIOCONVERT_H */
diff --git a/misc/winutils/include/libavutil/avassert.h b/misc/winutils/include/libavutil/avassert.h
new file mode 100644
index 0000000..b223d26
--- /dev/null
+++ b/misc/winutils/include/libavutil/avassert.h
@@ -0,0 +1,66 @@
+/*
+ * copyright (c) 2010 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * simple assert() macros that are a bit more flexible than ISO C assert().
+ * @author Michael Niedermayer <michaelni at gmx.at>
+ */
+
+#ifndef AVUTIL_AVASSERT_H
+#define AVUTIL_AVASSERT_H
+
+#include <stdlib.h>
+#include "avutil.h"
+#include "log.h"
+
+/**
+ * assert() equivalent, that is always enabled.
+ */
+#define av_assert0(cond) do {                                           \
+    if (!(cond)) {                                                      \
+        av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n",    \
+               AV_STRINGIFY(cond), __FILE__, __LINE__);                 \
+        abort();                                                        \
+    }                                                                   \
+} while (0)
+
+
+/**
+ * assert() equivalent, that does not lie in speed critical code.
+ * These asserts() thus can be enabled without fearing speedloss.
+ */
+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
+#define av_assert1(cond) av_assert0(cond)
+#else
+#define av_assert1(cond) ((void)0)
+#endif
+
+
+/**
+ * assert() equivalent, that does lie in speed critical code.
+ */
+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
+#define av_assert2(cond) av_assert0(cond)
+#else
+#define av_assert2(cond) ((void)0)
+#endif
+
+#endif /* AVUTIL_AVASSERT_H */
diff --git a/misc/winutils/include/libavutil/avconfig.h b/misc/winutils/include/libavutil/avconfig.h
new file mode 100644
index 0000000..f10aa61
--- /dev/null
+++ b/misc/winutils/include/libavutil/avconfig.h
@@ -0,0 +1,6 @@
+/* Generated by ffconf */
+#ifndef AVUTIL_AVCONFIG_H
+#define AVUTIL_AVCONFIG_H
+#define AV_HAVE_BIGENDIAN 0
+#define AV_HAVE_FAST_UNALIGNED 1
+#endif /* AVUTIL_AVCONFIG_H */
diff --git a/misc/winutils/include/libavutil/avstring.h b/misc/winutils/include/libavutil/avstring.h
new file mode 100644
index 0000000..ed4e465
--- /dev/null
+++ b/misc/winutils/include/libavutil/avstring.h
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2007 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AVSTRING_H
+#define AVUTIL_AVSTRING_H
+
+#include <stddef.h>
+#include "attributes.h"
+
+/**
+ * @addtogroup lavu_string
+ * @{
+ */
+
+/**
+ * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
+ * the address of the first character in str after the prefix.
+ *
+ * @param str input string
+ * @param pfx prefix to test
+ * @param ptr updated if the prefix is matched inside str
+ * @return non-zero if the prefix matches, zero otherwise
+ */
+int av_strstart(const char *str, const char *pfx, const char **ptr);
+
+/**
+ * Return non-zero if pfx is a prefix of str independent of case. If
+ * it is, *ptr is set to the address of the first character in str
+ * after the prefix.
+ *
+ * @param str input string
+ * @param pfx prefix to test
+ * @param ptr updated if the prefix is matched inside str
+ * @return non-zero if the prefix matches, zero otherwise
+ */
+int av_stristart(const char *str, const char *pfx, const char **ptr);
+
+/**
+ * Locate the first case-independent occurrence in the string haystack
+ * of the string needle.  A zero-length string needle is considered to
+ * match at the start of haystack.
+ *
+ * This function is a case-insensitive version of the standard strstr().
+ *
+ * @param haystack string to search in
+ * @param needle   string to search for
+ * @return         pointer to the located match within haystack
+ *                 or a null pointer if no match
+ */
+char *av_stristr(const char *haystack, const char *needle);
+
+/**
+ * Copy the string src to dst, but no more than size - 1 bytes, and
+ * null-terminate dst.
+ *
+ * This function is the same as BSD strlcpy().
+ *
+ * @param dst destination buffer
+ * @param src source string
+ * @param size size of destination buffer
+ * @return the length of src
+ *
+ * @warning since the return value is the length of src, src absolutely
+ * _must_ be a properly 0-terminated string, otherwise this will read beyond
+ * the end of the buffer and possibly crash.
+ */
+size_t av_strlcpy(char *dst, const char *src, size_t size);
+
+/**
+ * Append the string src to the string dst, but to a total length of
+ * no more than size - 1 bytes, and null-terminate dst.
+ *
+ * This function is similar to BSD strlcat(), but differs when
+ * size <= strlen(dst).
+ *
+ * @param dst destination buffer
+ * @param src source string
+ * @param size size of destination buffer
+ * @return the total length of src and dst
+ *
+ * @warning since the return value use the length of src and dst, these
+ * absolutely _must_ be a properly 0-terminated strings, otherwise this
+ * will read beyond the end of the buffer and possibly crash.
+ */
+size_t av_strlcat(char *dst, const char *src, size_t size);
+
+/**
+ * Append output to a string, according to a format. Never write out of
+ * the destination buffer, and always put a terminating 0 within
+ * the buffer.
+ * @param dst destination buffer (string to which the output is
+ *  appended)
+ * @param size total size of the destination buffer
+ * @param fmt printf-compatible format string, specifying how the
+ *  following parameters are used
+ * @return the length of the string that would have been generated
+ *  if enough space had been available
+ */
+size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
+
+/**
+ * Convert a number to a av_malloced string.
+ */
+char *av_d2str(double d);
+
+/**
+ * Unescape the given string until a non escaped terminating char,
+ * and return the token corresponding to the unescaped string.
+ *
+ * The normal \ and ' escaping is supported. Leading and trailing
+ * whitespaces are removed, unless they are escaped with '\' or are
+ * enclosed between ''.
+ *
+ * @param buf the buffer to parse, buf will be updated to point to the
+ * terminating char
+ * @param term a 0-terminated list of terminating chars
+ * @return the malloced unescaped string, which must be av_freed by
+ * the user, NULL in case of allocation failure
+ */
+char *av_get_token(const char **buf, const char *term);
+
+/**
+ * Locale-independent conversion of ASCII characters to uppercase.
+ */
+static inline int av_toupper(int c)
+{
+    if (c >= 'a' && c <= 'z')
+        c ^= 0x20;
+    return c;
+}
+
+/**
+ * Locale-independent conversion of ASCII characters to lowercase.
+ */
+static inline int av_tolower(int c)
+{
+    if (c >= 'A' && c <= 'Z')
+        c ^= 0x20;
+    return c;
+}
+
+/*
+ * Locale-independent case-insensitive compare.
+ * @note This means only ASCII-range characters are case-insensitive
+ */
+int av_strcasecmp(const char *a, const char *b);
+
+/**
+ * Locale-independent case-insensitive compare.
+ * @note This means only ASCII-range characters are case-insensitive
+ */
+int av_strncasecmp(const char *a, const char *b, size_t n);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_AVSTRING_H */
diff --git a/misc/winutils/include/libavutil/avutil.h b/misc/winutils/include/libavutil/avutil.h
new file mode 100644
index 0000000..a1433b4
--- /dev/null
+++ b/misc/winutils/include/libavutil/avutil.h
@@ -0,0 +1,274 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AVUTIL_H
+#define AVUTIL_AVUTIL_H
+
+/**
+ * @file
+ * external API header
+ */
+
+/**
+ * @mainpage
+ *
+ * @section libav_intro Introduction
+ *
+ * This document describes the usage of the different libraries
+ * provided by Libav.
+ *
+ * @li @ref libavc "libavcodec" encoding/decoding library
+ * @li @subpage libavfilter graph based frame editing library
+ * @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ * @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ * @li @ref lavu "libavutil" common utility library
+ * @li @subpage libswscale  color conversion and scaling library
+ */
+
+/**
+ * @defgroup lavu Common utility functions
+ *
+ * @brief
+ * libavutil contains the code shared across all the other Libav
+ * libraries
+ *
+ * @note In order to use the functions provided by avutil you must include
+ * the specific header.
+ *
+ * @{
+ *
+ * @defgroup lavu_crypto Crypto and Hashing
+ *
+ * @{
+ * @}
+ *
+ * @defgroup lavu_math Maths
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_string String Manipulation
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_mem Memory Management
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_data Data Structures
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_audio Audio related
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_error Error Codes
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_misc Other
+ *
+ * @{
+ *
+ * @defgroup lavu_internal Internal
+ *
+ * Not exported functions, for internal usage only
+ *
+ * @{
+ *
+ * @}
+ */
+
+
+/**
+ * @defgroup preproc_misc Preprocessor String Macros
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s)         AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+#define AV_PRAGMA(s) _Pragma(#s)
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup version_utils Library Version Macros
+ *
+ * Useful to check and match library version in order to maintain
+ * backward compatibility.
+ *
+ * @{
+ */
+
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavu_ver
+ * @{
+ */
+
+/**
+ * Return the LIBAVUTIL_VERSION_INT constant.
+ */
+unsigned avutil_version(void);
+
+/**
+ * Return the libavutil build-time configuration.
+ */
+const char *avutil_configuration(void);
+
+/**
+ * Return the libavutil license.
+ */
+const char *avutil_license(void);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavu_media Media Type
+ * @brief Media Type
+ */
+
+enum AVMediaType {
+    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
+    AVMEDIA_TYPE_VIDEO,
+    AVMEDIA_TYPE_AUDIO,
+    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
+    AVMEDIA_TYPE_SUBTITLE,
+    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
+    AVMEDIA_TYPE_NB
+};
+
+/**
+ * @defgroup lavu_const Constants
+ * @{
+ *
+ * @defgroup lavu_enc Encoding specific
+ *
+ * @note those definition should move to avcodec
+ * @{
+ */
+
+#define FF_LAMBDA_SHIFT 7
+#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
+#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
+#define FF_LAMBDA_MAX (256*128-1)
+
+#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
+
+/**
+ * @}
+ * @defgroup lavu_time Timestamp specific
+ *
+ * Libav internal timebase and timestamp definitions
+ *
+ * @{
+ */
+
+/**
+ * @brief Undefined timestamp value
+ *
+ * Usually reported by demuxer that work on containers that do not provide
+ * either pts or dts.
+ */
+
+#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
+
+/**
+ * Internal time base represented as integer
+ */
+
+#define AV_TIME_BASE            1000000
+
+/**
+ * Internal time base represented as fractional value
+ */
+
+#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
+
+/**
+ * @}
+ * @}
+ * @defgroup lavu_picture Image related
+ *
+ * AVPicture types, pixel formats and basic image planes manipulation.
+ *
+ * @{
+ */
+
+enum AVPictureType {
+    AV_PICTURE_TYPE_I = 1, ///< Intra
+    AV_PICTURE_TYPE_P,     ///< Predicted
+    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
+    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
+    AV_PICTURE_TYPE_SI,    ///< Switching Intra
+    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
+    AV_PICTURE_TYPE_BI,    ///< BI type
+};
+
+/**
+ * Return a single letter to describe the given picture type
+ * pict_type.
+ *
+ * @param[in] pict_type the picture type @return a single character
+ * representing the picture type, '?' if pict_type is unknown
+ */
+char av_get_picture_type_char(enum AVPictureType pict_type);
+
+/**
+ * @}
+ */
+
+#include "error.h"
+#include "version.h"
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_AVUTIL_H */
diff --git a/misc/winutils/include/libavutil/base64.h b/misc/winutils/include/libavutil/base64.h
new file mode 100644
index 0000000..4750cf5
--- /dev/null
+++ b/misc/winutils/include/libavutil/base64.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2006 Ryan Martell. (rdm4 at martellventures.com)
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_BASE64_H
+#define AVUTIL_BASE64_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_base64 Base64
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+
+/**
+ * Decode a base64-encoded string.
+ *
+ * @param out      buffer for decoded data
+ * @param in       null-terminated input string
+ * @param out_size size in bytes of the out buffer, must be at
+ *                 least 3/4 of the length of in
+ * @return         number of bytes written, or a negative value in case of
+ *                 invalid input
+ */
+int av_base64_decode(uint8_t *out, const char *in, int out_size);
+
+/**
+ * Encode data to base64 and null-terminate.
+ *
+ * @param out      buffer for encoded data
+ * @param out_size size in bytes of the output buffer, must be at
+ *                 least AV_BASE64_SIZE(in_size)
+ * @param in_size  size in bytes of the 'in' buffer
+ * @return         'out' or NULL in case of error
+ */
+char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
+
+/**
+ * Calculate the output size needed to base64-encode x bytes.
+ */
+#define AV_BASE64_SIZE(x)  (((x)+2) / 3 * 4 + 1)
+
+ /**
+  * @}
+  */
+
+#endif /* AVUTIL_BASE64_H */
diff --git a/misc/winutils/include/libavutil/blowfish.h b/misc/winutils/include/libavutil/blowfish.h
new file mode 100644
index 0000000..8c29536
--- /dev/null
+++ b/misc/winutils/include/libavutil/blowfish.h
@@ -0,0 +1,76 @@
+/*
+ * Blowfish algorithm
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_BLOWFISH_H
+#define AVUTIL_BLOWFISH_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_blowfish Blowfish
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#define AV_BF_ROUNDS 16
+
+typedef struct AVBlowfish {
+    uint32_t p[AV_BF_ROUNDS + 2];
+    uint32_t s[4][256];
+} AVBlowfish;
+
+/**
+ * Initialize an AVBlowfish context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param key a key
+ * @param key_len length of the key
+ */
+void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param xl left four bytes halves of input to be encrypted
+ * @param xr right four bytes halves of input to be encrypted
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
+                           int decrypt);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVBlowfish context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
+                       int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_BLOWFISH_H */
diff --git a/misc/winutils/include/libavutil/bswap.h b/misc/winutils/include/libavutil/bswap.h
new file mode 100644
index 0000000..8a350e1
--- /dev/null
+++ b/misc/winutils/include/libavutil/bswap.h
@@ -0,0 +1,109 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * byte swapping routines
+ */
+
+#ifndef AVUTIL_BSWAP_H
+#define AVUTIL_BSWAP_H
+
+#include <stdint.h>
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if   ARCH_ARM
+#   include "arm/bswap.h"
+#elif ARCH_AVR32
+#   include "avr32/bswap.h"
+#elif ARCH_BFIN
+#   include "bfin/bswap.h"
+#elif ARCH_SH4
+#   include "sh4/bswap.h"
+#elif ARCH_X86
+#   include "x86/bswap.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
+#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
+#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
+
+#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
+
+#ifndef av_bswap16
+static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
+{
+    x= (x>>8) | (x<<8);
+    return x;
+}
+#endif
+
+#ifndef av_bswap32
+static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
+{
+    return AV_BSWAP32C(x);
+}
+#endif
+
+#ifndef av_bswap64
+static inline uint64_t av_const av_bswap64(uint64_t x)
+{
+    return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
+}
+#endif
+
+// be2ne ... big-endian to native-endian
+// le2ne ... little-endian to native-endian
+
+#if AV_HAVE_BIGENDIAN
+#define av_be2ne16(x) (x)
+#define av_be2ne32(x) (x)
+#define av_be2ne64(x) (x)
+#define av_le2ne16(x) av_bswap16(x)
+#define av_le2ne32(x) av_bswap32(x)
+#define av_le2ne64(x) av_bswap64(x)
+#define AV_BE2NEC(s, x) (x)
+#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
+#else
+#define av_be2ne16(x) av_bswap16(x)
+#define av_be2ne32(x) av_bswap32(x)
+#define av_be2ne64(x) av_bswap64(x)
+#define av_le2ne16(x) (x)
+#define av_le2ne32(x) (x)
+#define av_le2ne64(x) (x)
+#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
+#define AV_LE2NEC(s, x) (x)
+#endif
+
+#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
+#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
+#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
+#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
+#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
+#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
+
+#endif /* AVUTIL_BSWAP_H */
diff --git a/misc/winutils/include/libavutil/common.h b/misc/winutils/include/libavutil/common.h
new file mode 100644
index 0000000..3465863
--- /dev/null
+++ b/misc/winutils/include/libavutil/common.h
@@ -0,0 +1,405 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * common internal and external API header
+ */
+
+#ifndef AVUTIL_COMMON_H
+#define AVUTIL_COMMON_H
+
+#include <ctype.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "attributes.h"
+#include "version.h"
+#include "libavutil/avconfig.h"
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_NE(be, le) (be)
+#else
+#   define AV_NE(be, le) (le)
+#endif
+
+//rounded division & shift
+#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
+/* assume b>0 */
+#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
+#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
+
+#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
+
+/* misc math functions */
+
+#if FF_API_AV_REVERSE
+extern attribute_deprecated const uint8_t av_reverse[256];
+#endif
+
+#ifdef HAVE_AV_CONFIG_H
+#   include "config.h"
+#   include "intmath.h"
+#endif
+
+/* Pull in unguarded fallback defines at the end of this file. */
+#include "common.h"
+
+#ifndef av_log2
+av_const int av_log2(unsigned v);
+#endif
+
+#ifndef av_log2_16bit
+av_const int av_log2_16bit(unsigned v);
+#endif
+
+/**
+ * Clip a signed integer value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-255 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
+{
+    if (a&(~0xFF)) return (-a)>>31;
+    else           return a;
+}
+
+/**
+ * Clip a signed integer value into the -128,127 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int8_t av_clip_int8_c(int a)
+{
+    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
+    else                  return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-65535 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
+{
+    if (a&(~0xFFFF)) return (-a)>>31;
+    else             return a;
+}
+
+/**
+ * Clip a signed integer value into the -32768,32767 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int16_t av_clip_int16_c(int a)
+{
+    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
+    else                      return a;
+}
+
+/**
+ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
+{
+    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
+    else                                         return a;
+}
+
+/**
+ * Clip a signed integer to an unsigned power of two range.
+ * @param  a value to clip
+ * @param  p bit position to clip at
+ * @return clipped value
+ */
+static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
+{
+    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
+    else                   return  a;
+}
+
+/**
+ * Add two signed 32-bit values with saturation.
+ *
+ * @param  a one value
+ * @param  b another value
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_add32_c(int a, int b)
+{
+    return av_clipl_int32((int64_t)a + b);
+}
+
+/**
+ * Add a doubled value to another value with saturation at both stages.
+ *
+ * @param  a first value
+ * @param  b value doubled and added to a
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_dadd32_c(int a, int b)
+{
+    return av_sat_add32(a, av_sat_add32(b, b));
+}
+
+/**
+ * Clip a float value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/** Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+ */
+static av_always_inline av_const int av_ceil_log2_c(int x)
+{
+    return av_log2((x - 1) << 1);
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount_c(uint32_t x)
+{
+    x -= (x >> 1) & 0x55555555;
+    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+    x = (x + (x >> 4)) & 0x0F0F0F0F;
+    x += x >> 8;
+    return (x + (x >> 16)) & 0x3F;
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount64_c(uint64_t x)
+{
+    return av_popcount(x) + av_popcount(x >> 32);
+}
+
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
+
+/**
+ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val      Output value, must be an lvalue of type uint32_t.
+ * @param GET_BYTE Expression reading one byte from the input.
+ *                 Evaluated up to 7 times (4 for the currently
+ *                 assigned Unicode range).  With a memory buffer
+ *                 input, this could be *ptr++.
+ * @param ERROR    Expression to be evaluated on invalid input,
+ *                 typically a goto statement.
+ */
+#define GET_UTF8(val, GET_BYTE, ERROR)\
+    val= GET_BYTE;\
+    {\
+        int ones= 7 - av_log2(val ^ 255);\
+        if(ones==1)\
+            ERROR\
+        val&= 127>>ones;\
+        while(--ones > 0){\
+            int tmp= GET_BYTE - 128;\
+            if(tmp>>6)\
+                ERROR\
+            val= (val<<6) + tmp;\
+        }\
+    }
+
+/**
+ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val       Output value, must be an lvalue of type uint32_t.
+ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ *                  to native byte order.  Evaluated one or two times.
+ * @param ERROR     Expression to be evaluated on invalid input,
+ *                  typically a goto statement.
+ */
+#define GET_UTF16(val, GET_16BIT, ERROR)\
+    val = GET_16BIT;\
+    {\
+        unsigned int hi = val - 0xD800;\
+        if (hi < 0x800) {\
+            val = GET_16BIT - 0xDC00;\
+            if (val > 0x3FFU || hi > 0x3FFU)\
+                ERROR\
+            val += (hi<<10) + 0x10000;\
+        }\
+    }\
+
+/**
+ * @def PUT_UTF8(val, tmp, PUT_BYTE)
+ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint8_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_BYTE.
+ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+ * It could be a function or a statement, and uses tmp as the input byte.
+ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+ * executed up to 4 times for values in the valid UTF-8 range and up to
+ * 7 times in the general case, depending on the length of the converted
+ * Unicode character.
+ */
+#define PUT_UTF8(val, tmp, PUT_BYTE)\
+    {\
+        int bytes, shift;\
+        uint32_t in = val;\
+        if (in < 0x80) {\
+            tmp = in;\
+            PUT_BYTE\
+        } else {\
+            bytes = (av_log2(in) + 4) / 5;\
+            shift = (bytes - 1) * 6;\
+            tmp = (256 - (256 >> bytes)) | (in >> shift);\
+            PUT_BYTE\
+            while (shift >= 6) {\
+                shift -= 6;\
+                tmp = 0x80 | ((in >> shift) & 0x3f);\
+                PUT_BYTE\
+            }\
+        }\
+    }
+
+/**
+ * @def PUT_UTF16(val, tmp, PUT_16BIT)
+ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint16_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_16BIT.
+ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
+ * in desired endianness. It could be a function or a statement, and uses tmp
+ * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
+ * PUT_BYTE will be executed 1 or 2 times depending on input character.
+ */
+#define PUT_UTF16(val, tmp, PUT_16BIT)\
+    {\
+        uint32_t in = val;\
+        if (in < 0x10000) {\
+            tmp = in;\
+            PUT_16BIT\
+        } else {\
+            tmp = 0xD800 | ((in - 0x10000) >> 10);\
+            PUT_16BIT\
+            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
+            PUT_16BIT\
+        }\
+    }\
+
+
+
+#include "mem.h"
+
+#ifdef HAVE_AV_CONFIG_H
+#    include "internal.h"
+#endif /* HAVE_AV_CONFIG_H */
+
+#endif /* AVUTIL_COMMON_H */
+
+/*
+ * The following definitions are outside the multiple inclusion guard
+ * to ensure they are immediately available in intmath.h.
+ */
+
+#ifndef av_ceil_log2
+#   define av_ceil_log2     av_ceil_log2_c
+#endif
+#ifndef av_clip
+#   define av_clip          av_clip_c
+#endif
+#ifndef av_clip_uint8
+#   define av_clip_uint8    av_clip_uint8_c
+#endif
+#ifndef av_clip_int8
+#   define av_clip_int8     av_clip_int8_c
+#endif
+#ifndef av_clip_uint16
+#   define av_clip_uint16   av_clip_uint16_c
+#endif
+#ifndef av_clip_int16
+#   define av_clip_int16    av_clip_int16_c
+#endif
+#ifndef av_clipl_int32
+#   define av_clipl_int32   av_clipl_int32_c
+#endif
+#ifndef av_clip_uintp2
+#   define av_clip_uintp2   av_clip_uintp2_c
+#endif
+#ifndef av_sat_add32
+#   define av_sat_add32     av_sat_add32_c
+#endif
+#ifndef av_sat_dadd32
+#   define av_sat_dadd32    av_sat_dadd32_c
+#endif
+#ifndef av_clipf
+#   define av_clipf         av_clipf_c
+#endif
+#ifndef av_popcount
+#   define av_popcount      av_popcount_c
+#endif
+#ifndef av_popcount64
+#   define av_popcount64    av_popcount64_c
+#endif
diff --git a/misc/winutils/include/libavutil/cpu.h b/misc/winutils/include/libavutil/cpu.h
new file mode 100644
index 0000000..01f7201
--- /dev/null
+++ b/misc/winutils/include/libavutil/cpu.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CPU_H
+#define AVUTIL_CPU_H
+
+#include "version.h"
+
+#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
+
+    /* lower 16 bits - CPU features */
+#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
+#define AV_CPU_FLAG_MMXEXT       0x0002 ///< SSE integer functions or AMD MMX ext
+#if LIBAVUTIL_VERSION_MAJOR < 52
+#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
+#endif
+#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
+#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
+#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
+#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
+#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
+#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
+#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
+#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
+#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
+#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
+#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
+#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
+#define AV_CPU_FLAG_XOP          0x0400 ///< Bulldozer XOP functions
+#define AV_CPU_FLAG_FMA4         0x0800 ///< Bulldozer FMA4 functions
+#define AV_CPU_FLAG_CMOV         0x1000 ///< i686 cmov
+
+#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
+
+#define AV_CPU_FLAG_ARMV5TE      (1 << 0)
+#define AV_CPU_FLAG_ARMV6        (1 << 1)
+#define AV_CPU_FLAG_ARMV6T2      (1 << 2)
+#define AV_CPU_FLAG_VFP          (1 << 3)
+#define AV_CPU_FLAG_VFPV3        (1 << 4)
+#define AV_CPU_FLAG_NEON         (1 << 5)
+
+/**
+ * Return the flags which specify extensions supported by the CPU.
+ */
+int av_get_cpu_flags(void);
+
+/**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ *
+ * @warning this function is not thread safe.
+ */
+void av_set_cpu_flags_mask(int mask);
+
+/**
+ * Parse CPU flags from a string.
+ *
+ * @return a combination of AV_CPU_* flags, negative on error.
+ */
+int av_parse_cpu_flags(const char *s);
+
+/* The following CPU-specific functions shall not be called directly. */
+int ff_get_cpu_flags_arm(void);
+int ff_get_cpu_flags_ppc(void);
+int ff_get_cpu_flags_x86(void);
+
+#endif /* AVUTIL_CPU_H */
diff --git a/misc/winutils/include/libavutil/crc.h b/misc/winutils/include/libavutil/crc.h
new file mode 100644
index 0000000..5c25607
--- /dev/null
+++ b/misc/winutils/include/libavutil/crc.h
@@ -0,0 +1,43 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CRC_H
+#define AVUTIL_CRC_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "attributes.h"
+
+typedef uint32_t AVCRC;
+
+typedef enum {
+    AV_CRC_8_ATM,
+    AV_CRC_16_ANSI,
+    AV_CRC_16_CCITT,
+    AV_CRC_32_IEEE,
+    AV_CRC_32_IEEE_LE,  /*< reversed bitorder version of AV_CRC_32_IEEE */
+    AV_CRC_MAX,         /*< Not part of public API! Do not use outside libavutil. */
+}AVCRCId;
+
+int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
+const AVCRC *av_crc_get_table(AVCRCId crc_id);
+uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
+
+#endif /* AVUTIL_CRC_H */
diff --git a/misc/winutils/include/libavutil/dict.h b/misc/winutils/include/libavutil/dict.h
new file mode 100644
index 0000000..492da9a
--- /dev/null
+++ b/misc/winutils/include/libavutil/dict.h
@@ -0,0 +1,129 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Public dictionary API.
+ */
+
+#ifndef AVUTIL_DICT_H
+#define AVUTIL_DICT_H
+
+/**
+ * @addtogroup lavu_dict AVDictionary
+ * @ingroup lavu_data
+ *
+ * @brief Simple key:value store
+ *
+ * @{
+ * Dictionaries are used for storing key:value pairs. To create
+ * an AVDictionary, simply pass an address of a NULL pointer to
+ * av_dict_set(). NULL can be used as an empty dictionary wherever
+ * a pointer to an AVDictionary is required.
+ * Use av_dict_get() to retrieve an entry or iterate over all
+ * entries and finally av_dict_free() to free the dictionary
+ * and all its contents.
+ *
+ * @code
+ * AVDictionary *d = NULL;                // "create" an empty dictionary
+ * av_dict_set(&d, "foo", "bar", 0);      // add an entry
+ *
+ * char *k = av_strdup("key");            // if your strings are already allocated,
+ * char *v = av_strdup("value");          // you can avoid copying them like this
+ * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+ *
+ * AVDictionaryEntry *t = NULL;
+ * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
+ *     <....>                             // iterate over all entries in d
+ * }
+ *
+ * av_dict_free(&d);
+ * @endcode
+ *
+ */
+
+#define AV_DICT_MATCH_CASE      1
+#define AV_DICT_IGNORE_SUFFIX   2
+#define AV_DICT_DONT_STRDUP_KEY 4   /**< Take ownership of a key that's been
+                                         allocated with av_malloc() and children. */
+#define AV_DICT_DONT_STRDUP_VAL 8   /**< Take ownership of a value that's been
+                                         allocated with av_malloc() and chilren. */
+#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
+#define AV_DICT_APPEND         32   /**< If the entry already exists, append to it.  Note that no
+                                      delimiter is added, the strings are simply concatenated. */
+
+typedef struct AVDictionaryEntry {
+    char *key;
+    char *value;
+} AVDictionaryEntry;
+
+typedef struct AVDictionary AVDictionary;
+
+/**
+ * Get a dictionary entry with matching key.
+ *
+ * @param prev Set to the previous matching element to find the next.
+ *             If set to NULL the first matching element is returned.
+ * @param flags Allows case as well as suffix-insensitive comparisons.
+ * @return Found entry or NULL, changing key or value leads to undefined behavior.
+ */
+AVDictionaryEntry *
+av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+
+/**
+ * Get number of entries in dictionary.
+ *
+ * @param m dictionary
+ * @return  number of entries in dictionary
+ */
+int av_dict_count(const AVDictionary *m);
+
+/**
+ * Set the given entry in *pm, overwriting an existing entry.
+ *
+ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
+ * a dictionary struct is allocated and put in *pm.
+ * @param key entry key to add to *pm (will be av_strduped depending on flags)
+ * @param value entry value to add to *pm (will be av_strduped depending on flags).
+ *        Passing a NULL value will cause an existing entry to be deleted.
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
+
+/**
+ * Copy entries from one AVDictionary struct into another.
+ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ *            this function will allocate a struct for you and put it in *dst
+ * @param src pointer to source AVDictionary struct
+ * @param flags flags to use when setting entries in *dst
+ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ */
+void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+
+/**
+ * Free all the memory allocated for an AVDictionary struct
+ * and all keys and values.
+ */
+void av_dict_free(AVDictionary **m);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DICT_H */
diff --git a/misc/winutils/include/libavutil/error.h b/misc/winutils/include/libavutil/error.h
new file mode 100644
index 0000000..3dfd880
--- /dev/null
+++ b/misc/winutils/include/libavutil/error.h
@@ -0,0 +1,83 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * error code definitions
+ */
+
+#ifndef AVUTIL_ERROR_H
+#define AVUTIL_ERROR_H
+
+#include <errno.h>
+#include <stddef.h>
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_error
+ *
+ * @{
+ */
+
+
+/* error handling */
+#if EDOM > 0
+#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
+#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
+#else
+/* Some platforms have E* and errno already negated. */
+#define AVERROR(e) (e)
+#define AVUNERROR(e) (e)
+#endif
+
+#define AVERROR_BSF_NOT_FOUND      (-0x39acbd08) ///< Bitstream filter not found
+#define AVERROR_DECODER_NOT_FOUND  (-0x3cbabb08) ///< Decoder not found
+#define AVERROR_DEMUXER_NOT_FOUND  (-0x32babb08) ///< Demuxer not found
+#define AVERROR_ENCODER_NOT_FOUND  (-0x3cb1ba08) ///< Encoder not found
+#define AVERROR_EOF                (-0x5fb9b0bb) ///< End of file
+#define AVERROR_EXIT               (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
+#define AVERROR_FILTER_NOT_FOUND   (-0x33b6b908) ///< Filter not found
+#define AVERROR_INVALIDDATA        (-0x3ebbb1b7) ///< Invalid data found when processing input
+#define AVERROR_MUXER_NOT_FOUND    (-0x27aab208) ///< Muxer not found
+#define AVERROR_OPTION_NOT_FOUND   (-0x2bafb008) ///< Option not found
+#define AVERROR_PATCHWELCOME       (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
+#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
+#define AVERROR_STREAM_NOT_FOUND   (-0x2dabac08) ///< Stream not found
+#define AVERROR_BUG                (-0x5fb8aabe) ///< Bug detected, please report the issue
+#define AVERROR_UNKNOWN            (-0x31b4b1ab) ///< Unknown error, typically from an external library
+#define AVERROR_EXPERIMENTAL       (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
+
+/**
+ * Put a description of the AVERROR code errnum in errbuf.
+ * In case of failure the global variable errno is set to indicate the
+ * error. Even in case of failure av_strerror() will print a generic
+ * error message indicating the errnum provided to errbuf.
+ *
+ * @param errnum      error code to describe
+ * @param errbuf      buffer to which description is written
+ * @param errbuf_size the size in bytes of errbuf
+ * @return 0 on success, a negative value if a description for errnum
+ * cannot be found
+ */
+int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_ERROR_H */
diff --git a/misc/winutils/include/libavutil/eval.h b/misc/winutils/include/libavutil/eval.h
new file mode 100644
index 0000000..ccb29e7
--- /dev/null
+++ b/misc/winutils/include/libavutil/eval.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2002 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * simple arithmetic expression evaluator
+ */
+
+#ifndef AVUTIL_EVAL_H
+#define AVUTIL_EVAL_H
+
+#include "avutil.h"
+
+typedef struct AVExpr AVExpr;
+
+/**
+ * Parse and evaluate an expression.
+ * Note, this is significantly slower than av_expr_eval().
+ *
+ * @param res a pointer to a double where is put the result value of
+ * the expression, or NAN in case of error
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param const_values a zero terminated array of values for the identifiers from const_names
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse_and_eval(double *res, const char *s,
+                           const char * const *const_names, const double *const_values,
+                           const char * const *func1_names, double (* const *funcs1)(void *, double),
+                           const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+                           void *opaque, int log_offset, void *log_ctx);
+
+/**
+ * Parse an expression.
+ *
+ * @param expr a pointer where is put an AVExpr containing the parsed
+ * value in case of successful parsing, or NULL otherwise.
+ * The pointed to AVExpr must be freed with av_expr_free() by the user
+ * when it is not needed anymore.
+ * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
+ * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
+ * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
+ * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
+ * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
+ * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
+ * @param log_ctx parent logging context
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_expr_parse(AVExpr **expr, const char *s,
+                  const char * const *const_names,
+                  const char * const *func1_names, double (* const *funcs1)(void *, double),
+                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
+                  int log_offset, void *log_ctx);
+
+/**
+ * Evaluate a previously parsed expression.
+ *
+ * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
+ * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
+ * @return the value of the expression
+ */
+double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
+
+/**
+ * Free a parsed expression previously created with av_expr_parse().
+ */
+void av_expr_free(AVExpr *e);
+
+/**
+ * Parse the string in numstr and return its value as a double. If
+ * the string is empty, contains only whitespaces, or does not contain
+ * an initial substring that has the expected syntax for a
+ * floating-point number, no conversion is performed. In this case,
+ * returns a value of zero and the value returned in tail is the value
+ * of numstr.
+ *
+ * @param numstr a string representing a number, may contain one of
+ * the International System number postfixes, for example 'K', 'M',
+ * 'G'. If 'i' is appended after the postfix, powers of 2 are used
+ * instead of powers of 10. The 'B' postfix multiplies the value for
+ * 8, and can be appended after another postfix or used alone. This
+ * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
+ * @param tail if non-NULL puts here the pointer to the char next
+ * after the last parsed character
+ */
+double av_strtod(const char *numstr, char **tail);
+
+#endif /* AVUTIL_EVAL_H */
diff --git a/misc/winutils/include/libavutil/fifo.h b/misc/winutils/include/libavutil/fifo.h
new file mode 100644
index 0000000..e670175
--- /dev/null
+++ b/misc/winutils/include/libavutil/fifo.h
@@ -0,0 +1,142 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * a very simple circular buffer FIFO implementation
+ */
+
+#ifndef AVUTIL_FIFO_H
+#define AVUTIL_FIFO_H
+
+#include <stdint.h>
+#include "avutil.h"
+#include "attributes.h"
+
+typedef struct AVFifoBuffer {
+    uint8_t *buffer;
+    uint8_t *rptr, *wptr, *end;
+    uint32_t rndx, wndx;
+} AVFifoBuffer;
+
+/**
+ * Initialize an AVFifoBuffer.
+ * @param size of FIFO
+ * @return AVFifoBuffer or NULL in case of memory allocation failure
+ */
+AVFifoBuffer *av_fifo_alloc(unsigned int size);
+
+/**
+ * Free an AVFifoBuffer.
+ * @param f AVFifoBuffer to free
+ */
+void av_fifo_free(AVFifoBuffer *f);
+
+/**
+ * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
+ * @param f AVFifoBuffer to reset
+ */
+void av_fifo_reset(AVFifoBuffer *f);
+
+/**
+ * Return the amount of data in bytes in the AVFifoBuffer, that is the
+ * amount of data you can read from it.
+ * @param f AVFifoBuffer to read from
+ * @return size
+ */
+int av_fifo_size(AVFifoBuffer *f);
+
+/**
+ * Return the amount of space in bytes in the AVFifoBuffer, that is the
+ * amount of data you can write into it.
+ * @param f AVFifoBuffer to write into
+ * @return size
+ */
+int av_fifo_space(AVFifoBuffer *f);
+
+/**
+ * Feed data from an AVFifoBuffer to a user-supplied callback.
+ * @param f AVFifoBuffer to read from
+ * @param buf_size number of bytes to read
+ * @param func generic read function
+ * @param dest data destination
+ */
+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
+
+/**
+ * Feed data from a user-supplied callback to an AVFifoBuffer.
+ * @param f AVFifoBuffer to write to
+ * @param src data source; non-const since it may be used as a
+ * modifiable context by the function defined in func
+ * @param size number of bytes to write
+ * @param func generic write function; the first parameter is src,
+ * the second is dest_buf, the third is dest_buf_size.
+ * func must return the number of bytes written to dest_buf, or <= 0 to
+ * indicate no more data available to write.
+ * If func is NULL, src is interpreted as a simple byte array for source data.
+ * @return the number of bytes written to the FIFO
+ */
+int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
+
+/**
+ * Resize an AVFifoBuffer.
+ * @param f AVFifoBuffer to resize
+ * @param size new AVFifoBuffer size in bytes
+ * @return <0 for failure, >=0 otherwise
+ */
+int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
+
+/**
+ * Read and discard the specified amount of data from an AVFifoBuffer.
+ * @param f AVFifoBuffer to read from
+ * @param size amount of data to read in bytes
+ */
+void av_fifo_drain(AVFifoBuffer *f, int size);
+
+/**
+ * Return a pointer to the data stored in a FIFO buffer at a certain offset.
+ * The FIFO buffer is not modified.
+ *
+ * @param f    AVFifoBuffer to peek at, f must be non-NULL
+ * @param offs an offset in bytes, its absolute value must be less
+ *             than the used buffer size or the returned pointer will
+ *             point outside to the buffer data.
+ *             The used buffer size can be checked with av_fifo_size().
+ */
+static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
+{
+    uint8_t *ptr = f->rptr + offs;
+    if (ptr >= f->end)
+        ptr = f->buffer + (ptr - f->end);
+    else if (ptr < f->buffer)
+        ptr = f->end - (f->buffer - ptr);
+    return ptr;
+}
+
+#if FF_API_AV_FIFO_PEEK
+/**
+ * @deprecated Use av_fifo_peek2() instead.
+ */
+attribute_deprecated
+static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
+{
+    return *av_fifo_peek2(f, offs);
+}
+#endif
+
+#endif /* AVUTIL_FIFO_H */
diff --git a/misc/winutils/include/libavutil/file.h b/misc/winutils/include/libavutil/file.h
new file mode 100644
index 0000000..e3f02a8
--- /dev/null
+++ b/misc/winutils/include/libavutil/file.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_FILE_H
+#define AVUTIL_FILE_H
+
+#include <stdint.h>
+
+#include "avutil.h"
+
+/**
+ * @file
+ * Misc file utilities.
+ */
+
+/**
+ * Read the file with name filename, and put its content in a newly
+ * allocated buffer or map it with mmap() when available.
+ * In case of success set *bufptr to the read or mmapped buffer, and
+ * *size to the size in bytes of the buffer in *bufptr.
+ * The returned buffer must be released with av_file_unmap().
+ *
+ * @param log_offset loglevel offset used for logging
+ * @param log_ctx context used for logging
+ * @return a non negative number in case of success, a negative value
+ * corresponding to an AVERROR error code in case of failure
+ */
+int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
+                int log_offset, void *log_ctx);
+
+/**
+ * Unmap or free the buffer bufptr created by av_file_map().
+ *
+ * @param size size in bytes of bufptr, must be the same as returned
+ * by av_file_map()
+ */
+void av_file_unmap(uint8_t *bufptr, size_t size);
+
+#endif /* AVUTIL_FILE_H */
diff --git a/misc/winutils/include/libavutil/imgutils.h b/misc/winutils/include/libavutil/imgutils.h
new file mode 100644
index 0000000..7151013
--- /dev/null
+++ b/misc/winutils/include/libavutil/imgutils.h
@@ -0,0 +1,138 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_IMGUTILS_H
+#define AVUTIL_IMGUTILS_H
+
+/**
+ * @file
+ * misc image utilities
+ *
+ * @addtogroup lavu_picture
+ * @{
+ */
+
+#include "avutil.h"
+#include "pixdesc.h"
+
+/**
+ * Compute the max pixel step for each plane of an image with a
+ * format described by pixdesc.
+ *
+ * The pixel step is the distance in bytes between the first byte of
+ * the group of bytes which describe a pixel component and the first
+ * byte of the successive group in the same plane for the same
+ * component.
+ *
+ * @param max_pixsteps an array which is filled with the max pixel step
+ * for each plane. Since a plane may contain different pixel
+ * components, the computed max_pixsteps[plane] is relative to the
+ * component in the plane with the max pixel step.
+ * @param max_pixstep_comps an array which is filled with the component
+ * for each plane which has the max pixel step. May be NULL.
+ */
+void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
+                                const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * Compute the size of an image line with format pix_fmt and width
+ * width for the plane plane.
+ *
+ * @return the computed size in bytes
+ */
+int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
+
+/**
+ * Fill plane linesizes for an image with pixel format pix_fmt and
+ * width width.
+ *
+ * @param linesizes array to be filled with the linesize for each plane
+ * @return >= 0 in case of success, a negative error code otherwise
+ */
+int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
+
+/**
+ * Fill plane data pointers for an image with pixel format pix_fmt and
+ * height height.
+ *
+ * @param data pointers array to be filled with the pointer for each image plane
+ * @param ptr the pointer to a buffer which will contain the image
+ * @param linesizes the array containing the linesize for each
+ * plane, should be filled by av_image_fill_linesizes()
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
+                           uint8_t *ptr, const int linesizes[4]);
+
+/**
+ * Allocate an image with size w and h and pixel format pix_fmt, and
+ * fill pointers and linesizes accordingly.
+ * The allocated image buffer has to be freed by using
+ * av_freep(&pointers[0]).
+ *
+ * @param align the value to use for buffer size alignment
+ * @return the size in bytes required for the image buffer, a negative
+ * error code in case of failure
+ */
+int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
+                   int w, int h, enum AVPixelFormat pix_fmt, int align);
+
+/**
+ * Copy image plane from src to dst.
+ * That is, copy "height" number of lines of "bytewidth" bytes each.
+ * The first byte of each successive line is separated by *_linesize
+ * bytes.
+ *
+ * @param dst_linesize linesize for the image plane in dst
+ * @param src_linesize linesize for the image plane in src
+ */
+void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
+                         const uint8_t *src, int src_linesize,
+                         int bytewidth, int height);
+
+/**
+ * Copy image in src_data to dst_data.
+ *
+ * @param dst_linesizes linesizes for the image in dst_data
+ * @param src_linesizes linesizes for the image in src_data
+ */
+void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
+                   const uint8_t *src_data[4], const int src_linesizes[4],
+                   enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Check if the given dimension of an image is valid, meaning that all
+ * bytes of the image can be addressed with a signed int.
+ *
+ * @param w the width of the picture
+ * @param h the height of the picture
+ * @param log_offset the offset to sum to the log level for logging with log_ctx
+ * @param log_ctx the parent logging context, it may be NULL
+ * @return >= 0 if valid, a negative error code otherwise
+ */
+int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
+
+int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
+
+/**
+ * @}
+ */
+
+
+#endif /* AVUTIL_IMGUTILS_H */
diff --git a/misc/winutils/include/libavutil/intfloat.h b/misc/winutils/include/libavutil/intfloat.h
new file mode 100644
index 0000000..38d26ad
--- /dev/null
+++ b/misc/winutils/include/libavutil/intfloat.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_H
+#define AVUTIL_INTFLOAT_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+union av_intfloat32 {
+    uint32_t i;
+    float    f;
+};
+
+union av_intfloat64 {
+    uint64_t i;
+    double   f;
+};
+
+/**
+ * Reinterpret a 32-bit integer as a float.
+ */
+static av_always_inline float av_int2float(uint32_t i)
+{
+    union av_intfloat32 v;
+    v.i = i;
+    return v.f;
+}
+
+/**
+ * Reinterpret a float as a 32-bit integer.
+ */
+static av_always_inline uint32_t av_float2int(float f)
+{
+    union av_intfloat32 v;
+    v.f = f;
+    return v.i;
+}
+
+/**
+ * Reinterpret a 64-bit integer as a double.
+ */
+static av_always_inline double av_int2double(uint64_t i)
+{
+    union av_intfloat64 v;
+    v.i = i;
+    return v.f;
+}
+
+/**
+ * Reinterpret a double as a 64-bit integer.
+ */
+static av_always_inline uint64_t av_double2int(double f)
+{
+    union av_intfloat64 v;
+    v.f = f;
+    return v.i;
+}
+
+#endif /* AVUTIL_INTFLOAT_H */
diff --git a/misc/winutils/include/libavutil/intfloat_readwrite.h b/misc/winutils/include/libavutil/intfloat_readwrite.h
new file mode 100644
index 0000000..f093b92
--- /dev/null
+++ b/misc/winutils/include/libavutil/intfloat_readwrite.h
@@ -0,0 +1,40 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_READWRITE_H
+#define AVUTIL_INTFLOAT_READWRITE_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+/* IEEE 80 bits extended float */
+typedef struct AVExtFloat  {
+    uint8_t exponent[2];
+    uint8_t mantissa[8];
+} AVExtFloat;
+
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
+attribute_deprecated float av_int2flt(int32_t v) av_const;
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
+attribute_deprecated int32_t av_flt2int(float d) av_const;
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
+
+#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/misc/winutils/include/libavutil/intreadwrite.h b/misc/winutils/include/libavutil/intreadwrite.h
new file mode 100644
index 0000000..01eb278
--- /dev/null
+++ b/misc/winutils/include/libavutil/intreadwrite.h
@@ -0,0 +1,522 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTREADWRITE_H
+#define AVUTIL_INTREADWRITE_H
+
+#include <stdint.h>
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+#include "bswap.h"
+
+typedef union {
+    uint64_t u64;
+    uint32_t u32[2];
+    uint16_t u16[4];
+    uint8_t  u8 [8];
+    double   f64;
+    float    f32[2];
+} av_alias av_alias64;
+
+typedef union {
+    uint32_t u32;
+    uint16_t u16[2];
+    uint8_t  u8 [4];
+    float    f32;
+} av_alias av_alias32;
+
+typedef union {
+    uint16_t u16;
+    uint8_t  u8 [2];
+} av_alias av_alias16;
+
+/*
+ * Arch-specific headers can provide any combination of
+ * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
+ * Preprocessor symbols must be defined, even if these are implemented
+ * as inline functions.
+ */
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if   ARCH_ARM
+#   include "arm/intreadwrite.h"
+#elif ARCH_AVR32
+#   include "avr32/intreadwrite.h"
+#elif ARCH_MIPS
+#   include "mips/intreadwrite.h"
+#elif ARCH_PPC
+#   include "ppc/intreadwrite.h"
+#elif ARCH_TOMI
+#   include "tomi/intreadwrite.h"
+#elif ARCH_X86
+#   include "x86/intreadwrite.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+/*
+ * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
+ */
+
+#if AV_HAVE_BIGENDIAN
+
+#   if    defined(AV_RN16) && !defined(AV_RB16)
+#       define AV_RB16(p) AV_RN16(p)
+#   elif !defined(AV_RN16) &&  defined(AV_RB16)
+#       define AV_RN16(p) AV_RB16(p)
+#   endif
+
+#   if    defined(AV_WN16) && !defined(AV_WB16)
+#       define AV_WB16(p, v) AV_WN16(p, v)
+#   elif !defined(AV_WN16) &&  defined(AV_WB16)
+#       define AV_WN16(p, v) AV_WB16(p, v)
+#   endif
+
+#   if    defined(AV_RN24) && !defined(AV_RB24)
+#       define AV_RB24(p) AV_RN24(p)
+#   elif !defined(AV_RN24) &&  defined(AV_RB24)
+#       define AV_RN24(p) AV_RB24(p)
+#   endif
+
+#   if    defined(AV_WN24) && !defined(AV_WB24)
+#       define AV_WB24(p, v) AV_WN24(p, v)
+#   elif !defined(AV_WN24) &&  defined(AV_WB24)
+#       define AV_WN24(p, v) AV_WB24(p, v)
+#   endif
+
+#   if    defined(AV_RN32) && !defined(AV_RB32)
+#       define AV_RB32(p) AV_RN32(p)
+#   elif !defined(AV_RN32) &&  defined(AV_RB32)
+#       define AV_RN32(p) AV_RB32(p)
+#   endif
+
+#   if    defined(AV_WN32) && !defined(AV_WB32)
+#       define AV_WB32(p, v) AV_WN32(p, v)
+#   elif !defined(AV_WN32) &&  defined(AV_WB32)
+#       define AV_WN32(p, v) AV_WB32(p, v)
+#   endif
+
+#   if    defined(AV_RN64) && !defined(AV_RB64)
+#       define AV_RB64(p) AV_RN64(p)
+#   elif !defined(AV_RN64) &&  defined(AV_RB64)
+#       define AV_RN64(p) AV_RB64(p)
+#   endif
+
+#   if    defined(AV_WN64) && !defined(AV_WB64)
+#       define AV_WB64(p, v) AV_WN64(p, v)
+#   elif !defined(AV_WN64) &&  defined(AV_WB64)
+#       define AV_WN64(p, v) AV_WB64(p, v)
+#   endif
+
+#else /* AV_HAVE_BIGENDIAN */
+
+#   if    defined(AV_RN16) && !defined(AV_RL16)
+#       define AV_RL16(p) AV_RN16(p)
+#   elif !defined(AV_RN16) &&  defined(AV_RL16)
+#       define AV_RN16(p) AV_RL16(p)
+#   endif
+
+#   if    defined(AV_WN16) && !defined(AV_WL16)
+#       define AV_WL16(p, v) AV_WN16(p, v)
+#   elif !defined(AV_WN16) &&  defined(AV_WL16)
+#       define AV_WN16(p, v) AV_WL16(p, v)
+#   endif
+
+#   if    defined(AV_RN24) && !defined(AV_RL24)
+#       define AV_RL24(p) AV_RN24(p)
+#   elif !defined(AV_RN24) &&  defined(AV_RL24)
+#       define AV_RN24(p) AV_RL24(p)
+#   endif
+
+#   if    defined(AV_WN24) && !defined(AV_WL24)
+#       define AV_WL24(p, v) AV_WN24(p, v)
+#   elif !defined(AV_WN24) &&  defined(AV_WL24)
+#       define AV_WN24(p, v) AV_WL24(p, v)
+#   endif
+
+#   if    defined(AV_RN32) && !defined(AV_RL32)
+#       define AV_RL32(p) AV_RN32(p)
+#   elif !defined(AV_RN32) &&  defined(AV_RL32)
+#       define AV_RN32(p) AV_RL32(p)
+#   endif
+
+#   if    defined(AV_WN32) && !defined(AV_WL32)
+#       define AV_WL32(p, v) AV_WN32(p, v)
+#   elif !defined(AV_WN32) &&  defined(AV_WL32)
+#       define AV_WN32(p, v) AV_WL32(p, v)
+#   endif
+
+#   if    defined(AV_RN64) && !defined(AV_RL64)
+#       define AV_RL64(p) AV_RN64(p)
+#   elif !defined(AV_RN64) &&  defined(AV_RL64)
+#       define AV_RN64(p) AV_RL64(p)
+#   endif
+
+#   if    defined(AV_WN64) && !defined(AV_WL64)
+#       define AV_WL64(p, v) AV_WN64(p, v)
+#   elif !defined(AV_WN64) &&  defined(AV_WL64)
+#       define AV_WN64(p, v) AV_WL64(p, v)
+#   endif
+
+#endif /* !AV_HAVE_BIGENDIAN */
+
+/*
+ * Define AV_[RW]N helper macros to simplify definitions not provided
+ * by per-arch headers.
+ */
+
+#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
+
+union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
+union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
+union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
+
+#   define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
+#   define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
+
+#elif defined(__DECC)
+
+#   define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
+#   define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
+
+#elif AV_HAVE_FAST_UNALIGNED
+
+#   define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
+#   define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#else
+
+#ifndef AV_RB16
+#   define AV_RB16(x)                           \
+    ((((const uint8_t*)(x))[0] << 8) |          \
+      ((const uint8_t*)(x))[1])
+#endif
+#ifndef AV_WB16
+#   define AV_WB16(p, d) do {                   \
+        ((uint8_t*)(p))[1] = (d);               \
+        ((uint8_t*)(p))[0] = (d)>>8;            \
+    } while(0)
+#endif
+
+#ifndef AV_RL16
+#   define AV_RL16(x)                           \
+    ((((const uint8_t*)(x))[1] << 8) |          \
+      ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL16
+#   define AV_WL16(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+    } while(0)
+#endif
+
+#ifndef AV_RB32
+#   define AV_RB32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[0] << 24) |    \
+               (((const uint8_t*)(x))[1] << 16) |    \
+               (((const uint8_t*)(x))[2] <<  8) |    \
+                ((const uint8_t*)(x))[3])
+#endif
+#ifndef AV_WB32
+#   define AV_WB32(p, d) do {                   \
+        ((uint8_t*)(p))[3] = (d);               \
+        ((uint8_t*)(p))[2] = (d)>>8;            \
+        ((uint8_t*)(p))[1] = (d)>>16;           \
+        ((uint8_t*)(p))[0] = (d)>>24;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL32
+#   define AV_RL32(x)                                \
+    (((uint32_t)((const uint8_t*)(x))[3] << 24) |    \
+               (((const uint8_t*)(x))[2] << 16) |    \
+               (((const uint8_t*)(x))[1] <<  8) |    \
+                ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL32
+#   define AV_WL32(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+        ((uint8_t*)(p))[3] = (d)>>24;           \
+    } while(0)
+#endif
+
+#ifndef AV_RB64
+#   define AV_RB64(x)                                   \
+    (((uint64_t)((const uint8_t*)(x))[0] << 56) |       \
+     ((uint64_t)((const uint8_t*)(x))[1] << 48) |       \
+     ((uint64_t)((const uint8_t*)(x))[2] << 40) |       \
+     ((uint64_t)((const uint8_t*)(x))[3] << 32) |       \
+     ((uint64_t)((const uint8_t*)(x))[4] << 24) |       \
+     ((uint64_t)((const uint8_t*)(x))[5] << 16) |       \
+     ((uint64_t)((const uint8_t*)(x))[6] <<  8) |       \
+      (uint64_t)((const uint8_t*)(x))[7])
+#endif
+#ifndef AV_WB64
+#   define AV_WB64(p, d) do {                   \
+        ((uint8_t*)(p))[7] = (d);               \
+        ((uint8_t*)(p))[6] = (d)>>8;            \
+        ((uint8_t*)(p))[5] = (d)>>16;           \
+        ((uint8_t*)(p))[4] = (d)>>24;           \
+        ((uint8_t*)(p))[3] = (d)>>32;           \
+        ((uint8_t*)(p))[2] = (d)>>40;           \
+        ((uint8_t*)(p))[1] = (d)>>48;           \
+        ((uint8_t*)(p))[0] = (d)>>56;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL64
+#   define AV_RL64(x)                                   \
+    (((uint64_t)((const uint8_t*)(x))[7] << 56) |       \
+     ((uint64_t)((const uint8_t*)(x))[6] << 48) |       \
+     ((uint64_t)((const uint8_t*)(x))[5] << 40) |       \
+     ((uint64_t)((const uint8_t*)(x))[4] << 32) |       \
+     ((uint64_t)((const uint8_t*)(x))[3] << 24) |       \
+     ((uint64_t)((const uint8_t*)(x))[2] << 16) |       \
+     ((uint64_t)((const uint8_t*)(x))[1] <<  8) |       \
+      (uint64_t)((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL64
+#   define AV_WL64(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+        ((uint8_t*)(p))[3] = (d)>>24;           \
+        ((uint8_t*)(p))[4] = (d)>>32;           \
+        ((uint8_t*)(p))[5] = (d)>>40;           \
+        ((uint8_t*)(p))[6] = (d)>>48;           \
+        ((uint8_t*)(p))[7] = (d)>>56;           \
+    } while(0)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_RN(s, p)    AV_RB##s(p)
+#   define AV_WN(s, p, v) AV_WB##s(p, v)
+#else
+#   define AV_RN(s, p)    AV_RL##s(p)
+#   define AV_WN(s, p, v) AV_WL##s(p, v)
+#endif
+
+#endif /* HAVE_FAST_UNALIGNED */
+
+#ifndef AV_RN16
+#   define AV_RN16(p) AV_RN(16, p)
+#endif
+
+#ifndef AV_RN32
+#   define AV_RN32(p) AV_RN(32, p)
+#endif
+
+#ifndef AV_RN64
+#   define AV_RN64(p) AV_RN(64, p)
+#endif
+
+#ifndef AV_WN16
+#   define AV_WN16(p, v) AV_WN(16, p, v)
+#endif
+
+#ifndef AV_WN32
+#   define AV_WN32(p, v) AV_WN(32, p, v)
+#endif
+
+#ifndef AV_WN64
+#   define AV_WN64(p, v) AV_WN(64, p, v)
+#endif
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_RB(s, p)    AV_RN##s(p)
+#   define AV_WB(s, p, v) AV_WN##s(p, v)
+#   define AV_RL(s, p)    av_bswap##s(AV_RN##s(p))
+#   define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
+#else
+#   define AV_RB(s, p)    av_bswap##s(AV_RN##s(p))
+#   define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
+#   define AV_RL(s, p)    AV_RN##s(p)
+#   define AV_WL(s, p, v) AV_WN##s(p, v)
+#endif
+
+#define AV_RB8(x)     (((const uint8_t*)(x))[0])
+#define AV_WB8(p, d)  do { ((uint8_t*)(p))[0] = (d); } while(0)
+
+#define AV_RL8(x)     AV_RB8(x)
+#define AV_WL8(p, d)  AV_WB8(p, d)
+
+#ifndef AV_RB16
+#   define AV_RB16(p)    AV_RB(16, p)
+#endif
+#ifndef AV_WB16
+#   define AV_WB16(p, v) AV_WB(16, p, v)
+#endif
+
+#ifndef AV_RL16
+#   define AV_RL16(p)    AV_RL(16, p)
+#endif
+#ifndef AV_WL16
+#   define AV_WL16(p, v) AV_WL(16, p, v)
+#endif
+
+#ifndef AV_RB32
+#   define AV_RB32(p)    AV_RB(32, p)
+#endif
+#ifndef AV_WB32
+#   define AV_WB32(p, v) AV_WB(32, p, v)
+#endif
+
+#ifndef AV_RL32
+#   define AV_RL32(p)    AV_RL(32, p)
+#endif
+#ifndef AV_WL32
+#   define AV_WL32(p, v) AV_WL(32, p, v)
+#endif
+
+#ifndef AV_RB64
+#   define AV_RB64(p)    AV_RB(64, p)
+#endif
+#ifndef AV_WB64
+#   define AV_WB64(p, v) AV_WB(64, p, v)
+#endif
+
+#ifndef AV_RL64
+#   define AV_RL64(p)    AV_RL(64, p)
+#endif
+#ifndef AV_WL64
+#   define AV_WL64(p, v) AV_WL(64, p, v)
+#endif
+
+#ifndef AV_RB24
+#   define AV_RB24(x)                           \
+    ((((const uint8_t*)(x))[0] << 16) |         \
+     (((const uint8_t*)(x))[1] <<  8) |         \
+      ((const uint8_t*)(x))[2])
+#endif
+#ifndef AV_WB24
+#   define AV_WB24(p, d) do {                   \
+        ((uint8_t*)(p))[2] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[0] = (d)>>16;           \
+    } while(0)
+#endif
+
+#ifndef AV_RL24
+#   define AV_RL24(x)                           \
+    ((((const uint8_t*)(x))[2] << 16) |         \
+     (((const uint8_t*)(x))[1] <<  8) |         \
+      ((const uint8_t*)(x))[0])
+#endif
+#ifndef AV_WL24
+#   define AV_WL24(p, d) do {                   \
+        ((uint8_t*)(p))[0] = (d);               \
+        ((uint8_t*)(p))[1] = (d)>>8;            \
+        ((uint8_t*)(p))[2] = (d)>>16;           \
+    } while(0)
+#endif
+
+/*
+ * The AV_[RW]NA macros access naturally aligned data
+ * in a type-safe way.
+ */
+
+#define AV_RNA(s, p)    (((const av_alias##s*)(p))->u##s)
+#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
+
+#ifndef AV_RN16A
+#   define AV_RN16A(p) AV_RNA(16, p)
+#endif
+
+#ifndef AV_RN32A
+#   define AV_RN32A(p) AV_RNA(32, p)
+#endif
+
+#ifndef AV_RN64A
+#   define AV_RN64A(p) AV_RNA(64, p)
+#endif
+
+#ifndef AV_WN16A
+#   define AV_WN16A(p, v) AV_WNA(16, p, v)
+#endif
+
+#ifndef AV_WN32A
+#   define AV_WN32A(p, v) AV_WNA(32, p, v)
+#endif
+
+#ifndef AV_WN64A
+#   define AV_WN64A(p, v) AV_WNA(64, p, v)
+#endif
+
+/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
+ * naturally aligned. They may be implemented using MMX,
+ * so emms_c() must be called before using any float code
+ * afterwards.
+ */
+
+#define AV_COPY(n, d, s) \
+    (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
+
+#ifndef AV_COPY16
+#   define AV_COPY16(d, s) AV_COPY(16, d, s)
+#endif
+
+#ifndef AV_COPY32
+#   define AV_COPY32(d, s) AV_COPY(32, d, s)
+#endif
+
+#ifndef AV_COPY64
+#   define AV_COPY64(d, s) AV_COPY(64, d, s)
+#endif
+
+#ifndef AV_COPY128
+#   define AV_COPY128(d, s)                    \
+    do {                                       \
+        AV_COPY64(d, s);                       \
+        AV_COPY64((char*)(d)+8, (char*)(s)+8); \
+    } while(0)
+#endif
+
+#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
+
+#ifndef AV_SWAP64
+#   define AV_SWAP64(a, b) AV_SWAP(64, a, b)
+#endif
+
+#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
+
+#ifndef AV_ZERO16
+#   define AV_ZERO16(d) AV_ZERO(16, d)
+#endif
+
+#ifndef AV_ZERO32
+#   define AV_ZERO32(d) AV_ZERO(32, d)
+#endif
+
+#ifndef AV_ZERO64
+#   define AV_ZERO64(d) AV_ZERO(64, d)
+#endif
+
+#ifndef AV_ZERO128
+#   define AV_ZERO128(d)         \
+    do {                         \
+        AV_ZERO64(d);            \
+        AV_ZERO64((char*)(d)+8); \
+    } while(0)
+#endif
+
+#endif /* AVUTIL_INTREADWRITE_H */
diff --git a/misc/winutils/include/libavutil/lfg.h b/misc/winutils/include/libavutil/lfg.h
new file mode 100644
index 0000000..5e526c1
--- /dev/null
+++ b/misc/winutils/include/libavutil/lfg.h
@@ -0,0 +1,62 @@
+/*
+ * Lagged Fibonacci PRNG
+ * Copyright (c) 2008 Michael Niedermayer
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LFG_H
+#define AVUTIL_LFG_H
+
+typedef struct AVLFG {
+    unsigned int state[64];
+    int index;
+} AVLFG;
+
+void av_lfg_init(AVLFG *c, unsigned int seed);
+
+/**
+ * Get the next random unsigned 32-bit number using an ALFG.
+ *
+ * Please also consider a simple LCG like state= state*1664525+1013904223,
+ * it may be good enough and faster for your specific use case.
+ */
+static inline unsigned int av_lfg_get(AVLFG *c){
+    c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
+    return c->state[c->index++ & 63];
+}
+
+/**
+ * Get the next random unsigned 32-bit number using a MLFG.
+ *
+ * Please also consider av_lfg_get() above, it is faster.
+ */
+static inline unsigned int av_mlfg_get(AVLFG *c){
+    unsigned int a= c->state[(c->index-55) & 63];
+    unsigned int b= c->state[(c->index-24) & 63];
+    return c->state[c->index++ & 63] = 2*a*b+a+b;
+}
+
+/**
+ * Get the next two numbers generated by a Box-Muller Gaussian
+ * generator using the random numbers issued by lfg.
+ *
+ * @param out array where the two generated numbers are placed
+ */
+void av_bmg_get(AVLFG *lfg, double out[2]);
+
+#endif /* AVUTIL_LFG_H */
diff --git a/misc/winutils/include/libavutil/log.h b/misc/winutils/include/libavutil/log.h
new file mode 100644
index 0000000..0678e1a
--- /dev/null
+++ b/misc/winutils/include/libavutil/log.h
@@ -0,0 +1,172 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LOG_H
+#define AVUTIL_LOG_H
+
+#include <stdarg.h>
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Describe the class of an AVClass context structure. That is an
+ * arbitrary struct of which the first field is a pointer to an
+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
+ */
+typedef struct AVClass {
+    /**
+     * The name of the class; usually it is the same name as the
+     * context structure type to which the AVClass is associated.
+     */
+    const char* class_name;
+
+    /**
+     * A pointer to a function which returns the name of a context
+     * instance ctx associated with the class.
+     */
+    const char* (*item_name)(void* ctx);
+
+    /**
+     * a pointer to the first option specified in the class if any or NULL
+     *
+     * @see av_set_default_options()
+     */
+    const struct AVOption *option;
+
+    /**
+     * LIBAVUTIL_VERSION with which this structure was created.
+     * This is used to allow fields to be added without requiring major
+     * version bumps everywhere.
+     */
+
+    int version;
+
+    /**
+     * Offset in the structure where log_level_offset is stored.
+     * 0 means there is no such variable
+     */
+    int log_level_offset_offset;
+
+    /**
+     * Offset in the structure where a pointer to the parent context for loging is stored.
+     * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
+     * parent context. And a av_log() implementation could then display the parent context
+     * can be NULL of course
+     */
+    int parent_log_context_offset;
+
+    /**
+     * Return next AVOptions-enabled child or NULL
+     */
+    void* (*child_next)(void *obj, void *prev);
+
+    /**
+     * Return an AVClass corresponding to next potential
+     * AVOptions-enabled child.
+     *
+     * The difference between child_next and this is that
+     * child_next iterates over _already existing_ objects, while
+     * child_class_next iterates over _all possible_ children.
+     */
+    const struct AVClass* (*child_class_next)(const struct AVClass *prev);
+} AVClass;
+
+/* av_log API */
+
+#define AV_LOG_QUIET    -8
+
+/**
+ * Something went really wrong and we will crash now.
+ */
+#define AV_LOG_PANIC     0
+
+/**
+ * Something went wrong and recovery is not possible.
+ * For example, no header was found for a format which depends
+ * on headers or an illegal combination of parameters is used.
+ */
+#define AV_LOG_FATAL     8
+
+/**
+ * Something went wrong and cannot losslessly be recovered.
+ * However, not all future data is affected.
+ */
+#define AV_LOG_ERROR    16
+
+/**
+ * Something somehow does not look correct. This may or may not
+ * lead to problems. An example would be the use of '-vstrict -2'.
+ */
+#define AV_LOG_WARNING  24
+
+#define AV_LOG_INFO     32
+#define AV_LOG_VERBOSE  40
+
+/**
+ * Stuff which is only useful for libav* developers.
+ */
+#define AV_LOG_DEBUG    48
+
+/**
+ * Send the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different av_vlog callback
+ * function.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param fmt The format string (printf-compatible) that specifies how
+ * subsequent arguments are converted to output.
+ * @see av_vlog
+ */
+void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
+
+void av_vlog(void *avcl, int level, const char *fmt, va_list);
+int av_log_get_level(void);
+void av_log_set_level(int);
+void av_log_set_callback(void (*)(void*, int, const char*, va_list));
+void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
+const char* av_default_item_name(void* ctx);
+
+/**
+ * av_dlog macros
+ * Useful to print debug messages that shouldn't get compiled in normally.
+ */
+
+#ifdef DEBUG
+#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+#    define av_dlog(pctx, ...)
+#endif
+
+/**
+ * Skip repeated messages, this requires the user app to use av_log() instead of
+ * (f)printf as the 2 would otherwise interfere and lead to
+ * "Last message repeated x times" messages below (f)printf messages with some
+ * bad luck.
+ * Also to receive the last, "last repeated" line if any, the user app must
+ * call av_log(NULL, AV_LOG_QUIET, ""); at the end
+ */
+#define AV_LOG_SKIP_REPEATED 1
+void av_log_set_flags(int arg);
+
+#endif /* AVUTIL_LOG_H */
diff --git a/misc/winutils/include/libavutil/lzo.h b/misc/winutils/include/libavutil/lzo.h
new file mode 100644
index 0000000..e3c6c01
--- /dev/null
+++ b/misc/winutils/include/libavutil/lzo.h
@@ -0,0 +1,77 @@
+/*
+ * LZO 1x decompression
+ * copyright (c) 2006 Reimar Doeffinger
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LZO_H
+#define AVUTIL_LZO_H
+
+/**
+ * @defgroup lavu_lzo LZO
+ * @ingroup lavu_crypto
+ *
+ * @{
+ */
+
+#include <stdint.h>
+
+/** @name Error flags returned by av_lzo1x_decode
+ * @{ */
+/// end of the input buffer reached before decoding finished
+#define AV_LZO_INPUT_DEPLETED  1
+/// decoded data did not fit into output buffer
+#define AV_LZO_OUTPUT_FULL     2
+/// a reference to previously decoded data was wrong
+#define AV_LZO_INVALID_BACKPTR 4
+/// a non-specific error in the compressed bitstream
+#define AV_LZO_ERROR           8
+/** @} */
+
+#define AV_LZO_INPUT_PADDING   8
+#define AV_LZO_OUTPUT_PADDING 12
+
+/**
+ * @brief Decodes LZO 1x compressed data.
+ * @param out output buffer
+ * @param outlen size of output buffer, number of bytes left are returned here
+ * @param in input buffer
+ * @param inlen size of input buffer, number of bytes left are returned here
+ * @return 0 on success, otherwise a combination of the error flags above
+ *
+ * Make sure all buffers are appropriately padded, in must provide
+ * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
+ */
+int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+
+/**
+ * @brief deliberately overlapping memcpy implementation
+ * @param dst destination buffer; must be padded with 12 additional bytes
+ * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param cnt number of bytes to copy, must be >= 0
+ *
+ * cnt > back is valid, this will copy the bytes we just copied,
+ * thus creating a repeating pattern with a period length of back.
+ */
+void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_LZO_H */
diff --git a/misc/winutils/include/libavutil/mathematics.h b/misc/winutils/include/libavutil/mathematics.h
new file mode 100644
index 0000000..043dd0f
--- /dev/null
+++ b/misc/winutils/include/libavutil/mathematics.h
@@ -0,0 +1,111 @@
+/*
+ * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MATHEMATICS_H
+#define AVUTIL_MATHEMATICS_H
+
+#include <stdint.h>
+#include <math.h>
+#include "attributes.h"
+#include "rational.h"
+#include "intfloat.h"
+
+#ifndef M_LOG2_10
+#define M_LOG2_10      3.32192809488736234787  /* log_2 10 */
+#endif
+#ifndef M_PHI
+#define M_PHI          1.61803398874989484820   /* phi / golden ratio */
+#endif
+#ifndef NAN
+#define NAN            av_int2float(0x7fc00000)
+#endif
+#ifndef INFINITY
+#define INFINITY       av_int2float(0x7f800000)
+#endif
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+
+enum AVRounding {
+    AV_ROUND_ZERO     = 0, ///< Round toward zero.
+    AV_ROUND_INF      = 1, ///< Round away from zero.
+    AV_ROUND_DOWN     = 2, ///< Round toward -infinity.
+    AV_ROUND_UP       = 3, ///< Round toward +infinity.
+    AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
+};
+
+/**
+ * Return the greatest common divisor of a and b.
+ * If both a and b are 0 or either or both are <0 then behavior is
+ * undefined.
+ */
+int64_t av_const av_gcd(int64_t a, int64_t b);
+
+/**
+ * Rescale a 64-bit integer with rounding to nearest.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
+
+/**
+ * Rescale a 64-bit integer with specified rounding.
+ * A simple a*b/c isn't possible as it can overflow.
+ */
+int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers.
+ */
+int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
+
+/**
+ * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
+ */
+int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
+                         enum AVRounding) av_const;
+
+/**
+ * Compare 2 timestamps each in its own timebases.
+ * The result of the function is undefined if one of the timestamps
+ * is outside the int64_t range when represented in the others timebase.
+ * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
+ */
+int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
+
+/**
+ * Compare 2 integers modulo mod.
+ * That is we compare integers a and b for which only the least
+ * significant log2(mod) bits are known.
+ *
+ * @param mod must be a power of 2
+ * @return a negative value if a is smaller than b
+ *         a positive value if a is greater than b
+ *         0                if a equals          b
+ */
+int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MATHEMATICS_H */
diff --git a/misc/winutils/include/libavutil/md5.h b/misc/winutils/include/libavutil/md5.h
new file mode 100644
index 0000000..29e4e7c
--- /dev/null
+++ b/misc/winutils/include/libavutil/md5.h
@@ -0,0 +1,51 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_MD5_H
+#define AVUTIL_MD5_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_md5 MD5
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_md5_size;
+#endif
+
+struct AVMD5;
+
+struct AVMD5 *av_md5_alloc(void);
+void av_md5_init(struct AVMD5 *ctx);
+void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
+void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
+void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MD5_H */
diff --git a/misc/winutils/include/libavutil/mem.h b/misc/winutils/include/libavutil/mem.h
new file mode 100644
index 0000000..4f14f27
--- /dev/null
+++ b/misc/winutils/include/libavutil/mem.h
@@ -0,0 +1,171 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * memory handling functions
+ */
+
+#ifndef AVUTIL_MEM_H
+#define AVUTIL_MEM_H
+
+#include <limits.h>
+
+#include "attributes.h"
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_mem
+ * @{
+ */
+
+
+#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__TI_COMPILER_VERSION__)
+    #define DECLARE_ALIGNED(n,t,v)                      \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        t __attribute__((aligned(n))) v
+    #define DECLARE_ASM_CONST(n,t,v)                    \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        static const t __attribute__((aligned(n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
+#elif defined(_MSC_VER)
+    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
+    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+    #define av_malloc_attrib __attribute__((__malloc__))
+#else
+    #define av_malloc_attrib
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+    #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#else
+    #define av_alloc_size(...)
+#endif
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU).
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ */
+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_malloc()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_malloc()
+ */
+av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
+{
+    if (size <= 0 || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_malloc(nmemb * size);
+}
+
+/**
+ * Allocate or reallocate a block of memory.
+ * If ptr is NULL and size > 0, allocate a new block. If
+ * size is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_malloc(z)() or av_realloc() or NULL.
+ * @param size Size in bytes for the memory block to be allocated or
+ * reallocated.
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ * @see av_fast_realloc()
+ */
+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc().
+ * @param ptr Pointer to the memory block which should be freed.
+ * @note ptr = NULL is explicitly allowed.
+ * @note It is recommended that you use av_freep() instead.
+ * @see av_freep()
+ */
+void av_free(void *ptr);
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ * @see av_malloc()
+ */
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Helper function to allocate a block of size * nmemb bytes with
+ * using av_mallocz()
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ * @see av_malloc_array()
+ */
+av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
+{
+    if (size <= 0 || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_mallocz(nmemb * size);
+}
+
+/**
+ * Duplicate the string s.
+ * @param s string to be duplicated
+ * @return Pointer to a newly allocated string containing a
+ * copy of s or NULL if the string cannot be allocated.
+ */
+char *av_strdup(const char *s) av_malloc_attrib;
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc() and set the pointer pointing to it to NULL.
+ * @param ptr Pointer to the pointer to the memory block which should
+ * be freed.
+ * @see av_free()
+ */
+void av_freep(void *ptr);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MEM_H */
diff --git a/misc/winutils/include/libavutil/old_pix_fmts.h b/misc/winutils/include/libavutil/old_pix_fmts.h
new file mode 100644
index 0000000..31765ae
--- /dev/null
+++ b/misc/winutils/include/libavutil/old_pix_fmts.h
@@ -0,0 +1,128 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OLD_PIX_FMTS_H
+#define AVUTIL_OLD_PIX_FMTS_H
+
+/*
+ * This header exists to prevent new pixel formats from being accidentally added
+ * to the deprecated list.
+ * Do not include it directly. It will be removed on next major bump
+ *
+ * Do not add new items to this list. Use the AVPixelFormat enum instead.
+ */
+    PIX_FMT_NONE = AV_PIX_FMT_NONE,
+    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    PIX_FMT_XVMC_MPEG2_IDCT,
+    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
+    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/misc/winutils/include/libavutil/opt.h b/misc/winutils/include/libavutil/opt.h
new file mode 100644
index 0000000..24fd74f
--- /dev/null
+++ b/misc/winutils/include/libavutil/opt.h
@@ -0,0 +1,592 @@
+/*
+ * AVOptions
+ * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OPT_H
+#define AVUTIL_OPT_H
+
+/**
+ * @file
+ * AVOptions
+ */
+
+#include "rational.h"
+#include "avutil.h"
+#include "dict.h"
+#include "log.h"
+
+/**
+ * @defgroup avoptions AVOptions
+ * @ingroup lavu_data
+ * @{
+ * AVOptions provide a generic system to declare options on arbitrary structs
+ * ("objects"). An option can have a help text, a type and a range of possible
+ * values. Options may then be enumerated, read and written to.
+ *
+ * @section avoptions_implement Implementing AVOptions
+ * This section describes how to add AVOptions capabilities to a struct.
+ *
+ * All AVOptions-related information is stored in an AVClass. Therefore
+ * the first member of the struct must be a pointer to an AVClass describing it.
+ * The option field of the AVClass must be set to a NULL-terminated static array
+ * of AVOptions. Each AVOption must have a non-empty name, a type, a default
+ * value and for number-type AVOptions also a range of allowed values. It must
+ * also declare an offset in bytes from the start of the struct, where the field
+ * associated with this AVOption is located. Other fields in the AVOption struct
+ * should also be set when applicable, but are not required.
+ *
+ * The following example illustrates an AVOptions-enabled struct:
+ * @code
+ * typedef struct test_struct {
+ *     AVClass *class;
+ *     int      int_opt;
+ *     char    *str_opt;
+ *     uint8_t *bin_opt;
+ *     int      bin_len;
+ * } test_struct;
+ *
+ * static const AVOption options[] = {
+ *   { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
+ *     AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX },
+ *   { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
+ *     AV_OPT_TYPE_STRING },
+ *   { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
+ *     AV_OPT_TYPE_BINARY },
+ *   { NULL },
+ * };
+ *
+ * static const AVClass test_class = {
+ *     .class_name = "test class",
+ *     .item_name  = av_default_item_name,
+ *     .option     = options,
+ *     .version    = LIBAVUTIL_VERSION_INT,
+ * };
+ * @endcode
+ *
+ * Next, when allocating your struct, you must ensure that the AVClass pointer
+ * is set to the correct value. Then, av_opt_set_defaults() must be called to
+ * initialize defaults. After that the struct is ready to be used with the
+ * AVOptions API.
+ *
+ * When cleaning up, you may use the av_opt_free() function to automatically
+ * free all the allocated string and binary options.
+ *
+ * Continuing with the above example:
+ *
+ * @code
+ * test_struct *alloc_test_struct(void)
+ * {
+ *     test_struct *ret = av_malloc(sizeof(*ret));
+ *     ret->class = &test_class;
+ *     av_opt_set_defaults(ret);
+ *     return ret;
+ * }
+ * void free_test_struct(test_struct **foo)
+ * {
+ *     av_opt_free(*foo);
+ *     av_freep(foo);
+ * }
+ * @endcode
+ *
+ * @subsection avoptions_implement_nesting Nesting
+ *      It may happen that an AVOptions-enabled struct contains another
+ *      AVOptions-enabled struct as a member (e.g. AVCodecContext in
+ *      libavcodec exports generic options, while its priv_data field exports
+ *      codec-specific options). In such a case, it is possible to set up the
+ *      parent struct to export a child's options. To do that, simply
+ *      implement AVClass.child_next() and AVClass.child_class_next() in the
+ *      parent struct's AVClass.
+ *      Assuming that the test_struct from above now also contains a
+ *      child_struct field:
+ *
+ *      @code
+ *      typedef struct child_struct {
+ *          AVClass *class;
+ *          int flags_opt;
+ *      } child_struct;
+ *      static const AVOption child_opts[] = {
+ *          { "test_flags", "This is a test option of flags type.",
+ *            offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX },
+ *          { NULL },
+ *      };
+ *      static const AVClass child_class = {
+ *          .class_name = "child class",
+ *          .item_name  = av_default_item_name,
+ *          .option     = child_opts,
+ *          .version    = LIBAVUTIL_VERSION_INT,
+ *      };
+ *
+ *      void *child_next(void *obj, void *prev)
+ *      {
+ *          test_struct *t = obj;
+ *          if (!prev && t->child_struct)
+ *              return t->child_struct;
+ *          return NULL
+ *      }
+ *      const AVClass child_class_next(const AVClass *prev)
+ *      {
+ *          return prev ? NULL : &child_class;
+ *      }
+ *      @endcode
+ *      Putting child_next() and child_class_next() as defined above into
+ *      test_class will now make child_struct's options accessible through
+ *      test_struct (again, proper setup as described above needs to be done on
+ *      child_struct right after it is created).
+ *
+ *      From the above example it might not be clear why both child_next()
+ *      and child_class_next() are needed. The distinction is that child_next()
+ *      iterates over actually existing objects, while child_class_next()
+ *      iterates over all possible child classes. E.g. if an AVCodecContext
+ *      was initialized to use a codec which has private options, then its
+ *      child_next() will return AVCodecContext.priv_data and finish
+ *      iterating. OTOH child_class_next() on AVCodecContext.av_class will
+ *      iterate over all available codecs with private options.
+ *
+ * @subsection avoptions_implement_named_constants Named constants
+ *      It is possible to create named constants for options. Simply set the unit
+ *      field of the option the constants should apply to to a string and
+ *      create the constants themselves as options of type AV_OPT_TYPE_CONST
+ *      with their unit field set to the same string.
+ *      Their default_val field should contain the value of the named
+ *      constant.
+ *      For example, to add some named constants for the test_flags option
+ *      above, put the following into the child_opts array:
+ *      @code
+ *      { "test_flags", "This is a test option of flags type.",
+ *        offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" },
+ *      { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" },
+ *      @endcode
+ *
+ * @section avoptions_use Using AVOptions
+ * This section deals with accessing options in an AVOptions-enabled struct.
+ * Such structs in Libav are e.g. AVCodecContext in libavcodec or
+ * AVFormatContext in libavformat.
+ *
+ * @subsection avoptions_use_examine Examining AVOptions
+ * The basic functions for examining options are av_opt_next(), which iterates
+ * over all options defined for one object, and av_opt_find(), which searches
+ * for an option with the given name.
+ *
+ * The situation is more complicated with nesting. An AVOptions-enabled struct
+ * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
+ * to av_opt_find() will make the function search children recursively.
+ *
+ * For enumerating there are basically two cases. The first is when you want to
+ * get all options that may potentially exist on the struct and its children
+ * (e.g.  when constructing documentation). In that case you should call
+ * av_opt_child_class_next() recursively on the parent struct's AVClass.  The
+ * second case is when you have an already initialized struct with all its
+ * children and you want to get all options that can be actually written or read
+ * from it. In that case you should call av_opt_child_next() recursively (and
+ * av_opt_next() on each result).
+ *
+ * @subsection avoptions_use_get_set Reading and writing AVOptions
+ * When setting options, you often have a string read directly from the
+ * user. In such a case, simply passing it to av_opt_set() is enough. For
+ * non-string type options, av_opt_set() will parse the string according to the
+ * option type.
+ *
+ * Similarly av_opt_get() will read any option type and convert it to a string
+ * which will be returned. Do not forget that the string is allocated, so you
+ * have to free it with av_free().
+ *
+ * In some cases it may be more convenient to put all options into an
+ * AVDictionary and call av_opt_set_dict() on it. A specific case of this
+ * are the format/codec open functions in lavf/lavc which take a dictionary
+ * filled with option as a parameter. This allows to set some options
+ * that cannot be set otherwise, since e.g. the input file format is not known
+ * before the file is actually opened.
+ */
+
+enum AVOptionType{
+    AV_OPT_TYPE_FLAGS,
+    AV_OPT_TYPE_INT,
+    AV_OPT_TYPE_INT64,
+    AV_OPT_TYPE_DOUBLE,
+    AV_OPT_TYPE_FLOAT,
+    AV_OPT_TYPE_STRING,
+    AV_OPT_TYPE_RATIONAL,
+    AV_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
+    AV_OPT_TYPE_CONST = 128,
+#if FF_API_OLD_AVOPTIONS
+    FF_OPT_TYPE_FLAGS = 0,
+    FF_OPT_TYPE_INT,
+    FF_OPT_TYPE_INT64,
+    FF_OPT_TYPE_DOUBLE,
+    FF_OPT_TYPE_FLOAT,
+    FF_OPT_TYPE_STRING,
+    FF_OPT_TYPE_RATIONAL,
+    FF_OPT_TYPE_BINARY,  ///< offset must point to a pointer immediately followed by an int for the length
+    FF_OPT_TYPE_CONST=128,
+#endif
+};
+
+/**
+ * AVOption
+ */
+typedef struct AVOption {
+    const char *name;
+
+    /**
+     * short English help text
+     * @todo What about other languages?
+     */
+    const char *help;
+
+    /**
+     * The offset relative to the context structure where the option
+     * value is stored. It should be 0 for named constants.
+     */
+    int offset;
+    enum AVOptionType type;
+
+    /**
+     * the default value for scalar options
+     */
+    union {
+        int64_t i64;
+        double dbl;
+        const char *str;
+        /* TODO those are unused now */
+        AVRational q;
+    } default_val;
+    double min;                 ///< minimum valid value for the option
+    double max;                 ///< maximum valid value for the option
+
+    int flags;
+#define AV_OPT_FLAG_ENCODING_PARAM  1   ///< a generic parameter which can be set by the user for muxing or encoding
+#define AV_OPT_FLAG_DECODING_PARAM  2   ///< a generic parameter which can be set by the user for demuxing or decoding
+#define AV_OPT_FLAG_METADATA        4   ///< some data extracted or inserted into the file like title, comment, ...
+#define AV_OPT_FLAG_AUDIO_PARAM     8
+#define AV_OPT_FLAG_VIDEO_PARAM     16
+#define AV_OPT_FLAG_SUBTITLE_PARAM  32
+//FIXME think about enc-audio, ... style flags
+
+    /**
+     * The logical unit to which the option belongs. Non-constant
+     * options and corresponding named constants share the same
+     * unit. May be NULL.
+     */
+    const char *unit;
+} AVOption;
+
+#if FF_API_FIND_OPT
+/**
+ * Look for an option in obj. Look only for the options which
+ * have the flags set as specified in mask and flags (that is,
+ * for which it is the case that opt->flags & mask == flags).
+ *
+ * @param[in] obj a pointer to a struct whose first element is a
+ * pointer to an AVClass
+ * @param[in] name the name of the option to look for
+ * @param[in] unit the unit of the option to look for, or any if NULL
+ * @return a pointer to the option found, or NULL if no option
+ * has been found
+ *
+ * @deprecated use av_opt_find.
+ */
+attribute_deprecated
+const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
+#endif
+
+#if FF_API_OLD_AVOPTIONS
+/**
+ * Set the field of obj with the given name to value.
+ *
+ * @param[in] obj A struct whose first element is a pointer to an
+ * AVClass.
+ * @param[in] name the name of the field to set
+ * @param[in] val The value to set. If the field is not of a string
+ * type, then the given string is parsed.
+ * SI postfixes and some named scalars are supported.
+ * If the field is of a numeric type, it has to be a numeric or named
+ * scalar. Behavior with more than one scalar and +- infix operators
+ * is undefined.
+ * If the field is of a flags type, it has to be a sequence of numeric
+ * scalars or named flags separated by '+' or '-'. Prefixing a flag
+ * with '+' causes it to be set without affecting the other flags;
+ * similarly, '-' unsets a flag.
+ * @param[out] o_out if non-NULL put here a pointer to the AVOption
+ * found
+ * @param alloc this parameter is currently ignored
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR_OPTION_NOT_FOUND if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
+ * @deprecated use av_opt_set()
+ */
+attribute_deprecated
+int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
+
+attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
+attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
+attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
+
+attribute_deprecated double av_get_double(void *obj, const char *name, const AVOption **o_out);
+attribute_deprecated AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
+attribute_deprecated int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
+attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
+attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
+#endif
+
+/**
+ * Show the obj options.
+ *
+ * @param req_flags requested flags for the options to show. Show only the
+ * options for which it is opt->flags & req_flags.
+ * @param rej_flags rejected flags for the options to show. Show only the
+ * options for which it is !(opt->flags & req_flags).
+ * @param av_log_obj log context to use for showing the options
+ */
+int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
+
+/**
+ * Set the values of all AVOption fields to their default values.
+ *
+ * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
+ */
+void av_opt_set_defaults(void *s);
+
+#if FF_API_OLD_AVOPTIONS
+attribute_deprecated
+void av_opt_set_defaults2(void *s, int mask, int flags);
+#endif
+
+/**
+ * Parse the key/value pairs list in opts. For each key/value pair
+ * found, stores the value in the field in ctx that is named like the
+ * key. ctx must be an AVClass context, storing is done using
+ * AVOptions.
+ *
+ * @param key_val_sep a 0-terminated list of characters used to
+ * separate key from value
+ * @param pairs_sep a 0-terminated list of characters used to separate
+ * two pairs from each other
+ * @return the number of successfully set key/value pairs, or a negative
+ * value corresponding to an AVERROR code in case of error:
+ * AVERROR(EINVAL) if opts cannot be parsed,
+ * the error code issued by av_set_string3() if a key/value pair
+ * cannot be set
+ */
+int av_set_options_string(void *ctx, const char *opts,
+                          const char *key_val_sep, const char *pairs_sep);
+
+/**
+ * Free all string and binary options in obj.
+ */
+void av_opt_free(void *obj);
+
+/**
+ * Check whether a particular flag is set in a flags field.
+ *
+ * @param field_name the name of the flag field option
+ * @param flag_name the name of the flag to check
+ * @return non-zero if the flag is set, zero if the flag isn't set,
+ *         isn't of the right type, or the flags field doesn't exist.
+ */
+int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
+
+/*
+ * Set all the options from a given dictionary on an object.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass
+ * @param options options to process. This dictionary will be freed and replaced
+ *                by a new one containing all options not found in obj.
+ *                Of course this new dictionary needs to be freed by caller
+ *                with av_dict_free().
+ *
+ * @return 0 on success, a negative AVERROR if some option was found in obj,
+ *         but could not be set.
+ *
+ * @see av_dict_copy()
+ */
+int av_opt_set_dict(void *obj, struct AVDictionary **options);
+
+/**
+ * @defgroup opt_eval_funcs Evaluating option strings
+ * @{
+ * This group of functions can be used to evaluate option strings
+ * and get numbers out of them. They do the same thing as av_opt_set(),
+ * except the result is written into the caller-supplied pointer.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass.
+ * @param o an option for which the string is to be evaluated.
+ * @param val string to be evaluated.
+ * @param *_out value of the string will be written here.
+ *
+ * @return 0 on success, a negative number on failure.
+ */
+int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int        *flags_out);
+int av_opt_eval_int   (void *obj, const AVOption *o, const char *val, int        *int_out);
+int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t    *int64_out);
+int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float      *float_out);
+int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double     *double_out);
+int av_opt_eval_q     (void *obj, const AVOption *o, const char *val, AVRational *q_out);
+/**
+ * @}
+ */
+
+#define AV_OPT_SEARCH_CHILDREN   0x0001 /**< Search in possible children of the
+                                             given object first. */
+/**
+ *  The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
+ *  instead of a required pointer to a struct containing AVClass. This is
+ *  useful for searching for options without needing to allocate the corresponding
+ *  object.
+ */
+#define AV_OPT_SEARCH_FAKE_OBJ   0x0002
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ *                pointer to an AVClass.
+ *                Alternatively a double pointer to an AVClass, if
+ *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ *                 it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ *         was found.
+ *
+ * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable
+ * directly with av_set_string3(). Use special calls which take an options
+ * AVDictionary (e.g. avformat_open_input()) to set options found with this
+ * flag.
+ */
+const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
+                            int opt_flags, int search_flags);
+
+/**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ *                pointer to an AVClass.
+ *                Alternatively a double pointer to an AVClass, if
+ *                AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ *                 it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ * @param[out] target_obj if non-NULL, an object to which the option belongs will be
+ * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
+ * in search_flags. This parameter is ignored if search_flags contain
+ * AV_OPT_SEARCH_FAKE_OBJ.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ *         was found.
+ */
+const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
+                             int opt_flags, int search_flags, void **target_obj);
+
+/**
+ * Iterate over all AVOptions belonging to obj.
+ *
+ * @param obj an AVOptions-enabled struct or a double pointer to an
+ *            AVClass describing it.
+ * @param prev result of the previous call to av_opt_next() on this object
+ *             or NULL
+ * @return next AVOption or NULL
+ */
+const AVOption *av_opt_next(void *obj, const AVOption *prev);
+
+/**
+ * Iterate over AVOptions-enabled children of obj.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return next AVOptions-enabled child or NULL
+ */
+void *av_opt_child_next(void *obj, void *prev);
+
+/**
+ * Iterate over potential AVOptions-enabled children of parent.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return AVClass corresponding to next potential child or NULL
+ */
+const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
+
+/**
+ * @defgroup opt_set_funcs Option setting functions
+ * @{
+ * Those functions set the field of obj with the given name to value.
+ *
+ * @param[in] obj A struct whose first element is a pointer to an AVClass.
+ * @param[in] name the name of the field to set
+ * @param[in] val The value to set. In case of av_opt_set() if the field is not
+ * of a string type, then the given string is parsed.
+ * SI postfixes and some named scalars are supported.
+ * If the field is of a numeric type, it has to be a numeric or named
+ * scalar. Behavior with more than one scalar and +- infix operators
+ * is undefined.
+ * If the field is of a flags type, it has to be a sequence of numeric
+ * scalars or named flags separated by '+' or '-'. Prefixing a flag
+ * with '+' causes it to be set without affecting the other flags;
+ * similarly, '-' unsets a flag.
+ * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be set on a child of obj.
+ *
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR_OPTION_NOT_FOUND if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
+ */
+int av_opt_set       (void *obj, const char *name, const char *val, int search_flags);
+int av_opt_set_int   (void *obj, const char *name, int64_t     val, int search_flags);
+int av_opt_set_double(void *obj, const char *name, double      val, int search_flags);
+int av_opt_set_q     (void *obj, const char *name, AVRational  val, int search_flags);
+int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
+/**
+ * @}
+ */
+
+/**
+ * @defgroup opt_get_funcs Option getting functions
+ * @{
+ * Those functions get a value of the option with the given name from an object.
+ *
+ * @param[in] obj a struct whose first element is a pointer to an AVClass.
+ * @param[in] name name of the option to get.
+ * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be found in a child of obj.
+ * @param[out] out_val value of the option will be written here
+ * @return 0 on success, a negative error code otherwise
+ */
+/**
+ * @note the returned string will av_malloc()ed and must be av_free()ed by the caller
+ */
+int av_opt_get       (void *obj, const char *name, int search_flags, uint8_t   **out_val);
+int av_opt_get_int   (void *obj, const char *name, int search_flags, int64_t    *out_val);
+int av_opt_get_double(void *obj, const char *name, int search_flags, double     *out_val);
+int av_opt_get_q     (void *obj, const char *name, int search_flags, AVRational *out_val);
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_OPT_H */
diff --git a/misc/winutils/include/libavutil/parseutils.h b/misc/winutils/include/libavutil/parseutils.h
new file mode 100644
index 0000000..0844abb
--- /dev/null
+++ b/misc/winutils/include/libavutil/parseutils.h
@@ -0,0 +1,124 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PARSEUTILS_H
+#define AVUTIL_PARSEUTILS_H
+
+#include <time.h>
+
+#include "rational.h"
+
+/**
+ * @file
+ * misc parsing utilities
+ */
+
+/**
+ * Parse str and put in width_ptr and height_ptr the detected values.
+ *
+ * @param[in,out] width_ptr pointer to the variable which will contain the detected
+ * width value
+ * @param[in,out] height_ptr pointer to the variable which will contain the detected
+ * height value
+ * @param[in] str the string to parse: it has to be a string in the format
+ * width x height or a valid video size abbreviation.
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
+
+/**
+ * Parse str and store the detected values in *rate.
+ *
+ * @param[in,out] rate pointer to the AVRational which will contain the detected
+ * frame rate
+ * @param[in] str the string to parse: it has to be a string in the format
+ * rate_num / rate_den, a float number or a valid video rate abbreviation
+ * @return >= 0 on success, a negative error code otherwise
+ */
+int av_parse_video_rate(AVRational *rate, const char *str);
+
+/**
+ * Put the RGBA values that correspond to color_string in rgba_color.
+ *
+ * @param color_string a string specifying a color. It can be the name of
+ * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence,
+ * possibly followed by "@" and a string representing the alpha
+ * component.
+ * The alpha component may be a string composed by "0x" followed by an
+ * hexadecimal number or a decimal number between 0.0 and 1.0, which
+ * represents the opacity value (0x00/0.0 means completely transparent,
+ * 0xff/1.0 completely opaque).
+ * If the alpha component is not specified then 0xff is assumed.
+ * The string "random" will result in a random color.
+ * @param slen length of the initial part of color_string containing the
+ * color. It can be set to -1 if color_string is a null terminated string
+ * containing nothing else than the color.
+ * @return >= 0 in case of success, a negative value in case of
+ * failure (for example if color_string cannot be parsed).
+ */
+int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
+                   void *log_ctx);
+
+/**
+ * Parse timestr and return in *time a corresponding number of
+ * microseconds.
+ *
+ * @param timeval puts here the number of microseconds corresponding
+ * to the string in timestr. If the string represents a duration, it
+ * is the number of microseconds contained in the time interval.  If
+ * the string is a date, is the number of microseconds since 1st of
+ * January, 1970 up to the time of the parsed date.  If timestr cannot
+ * be successfully parsed, set *time to INT64_MIN.
+
+ * @param timestr a string representing a date or a duration.
+ * - If a date the syntax is:
+ * @code
+ * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
+ * now
+ * @endcode
+ * If the value is "now" it takes the current time.
+ * Time is local time unless Z is appended, in which case it is
+ * interpreted as UTC.
+ * If the year-month-day part is not specified it takes the current
+ * year-month-day.
+ * - If a duration the syntax is:
+ * @code
+ * [-]HH[:MM[:SS[.m...]]]
+ * [-]S+[.m...]
+ * @endcode
+ * @param duration flag which tells how to interpret timestr, if not
+ * zero timestr is interpreted as a duration, otherwise as a date
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_parse_time(int64_t *timeval, const char *timestr, int duration);
+
+/**
+ * Attempt to find a specific tag in a URL.
+ *
+ * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done.
+ * Return 1 if found.
+ */
+int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
+
+/**
+ * Convert the decomposed UTC time in tm to a time_t value.
+ */
+time_t av_timegm(struct tm *tm);
+
+#endif /* AVUTIL_PARSEUTILS_H */
diff --git a/misc/winutils/include/libavutil/pixdesc.h b/misc/winutils/include/libavutil/pixdesc.h
new file mode 100644
index 0000000..7da17bc
--- /dev/null
+++ b/misc/winutils/include/libavutil/pixdesc.h
@@ -0,0 +1,206 @@
+/*
+ * pixel format descriptor
+ * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXDESC_H
+#define AVUTIL_PIXDESC_H
+
+#include <inttypes.h>
+#include "pixfmt.h"
+
+typedef struct AVComponentDescriptor{
+    uint16_t plane        :2;            ///< which of the 4 planes contains the component
+
+    /**
+     * Number of elements between 2 horizontally consecutive pixels minus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t step_minus1  :3;
+
+    /**
+     * Number of elements before the component of the first pixel plus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t offset_plus1 :3;
+    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
+    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
+}AVComponentDescriptor;
+
+/**
+ * Descriptor that unambiguously describes how the bits of a pixel are
+ * stored in the up to 4 data planes of an image. It also stores the
+ * subsampling factors and number of components.
+ *
+ * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
+ *       and all the YUV variants) AVPixFmtDescriptor just stores how values
+ *       are stored not what these values represent.
+ */
+typedef struct AVPixFmtDescriptor{
+    const char *name;
+    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
+
+    /**
+     * Amount to shift the luma width right to find the chroma width.
+     * For YV12 this is 1 for example.
+     * chroma_width = -((-luma_width) >> log2_chroma_w)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
+
+    /**
+     * Amount to shift the luma height right to find the chroma height.
+     * For YV12 this is 1 for example.
+     * chroma_height= -((-luma_height) >> log2_chroma_h)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_h;
+    uint8_t flags;
+
+    /**
+     * Parameters that describe how pixels are packed. If the format
+     * has chroma components, they must be stored in comp[1] and
+     * comp[2].
+     */
+    AVComponentDescriptor comp[4];
+}AVPixFmtDescriptor;
+
+#define PIX_FMT_BE        1 ///< Pixel format is big-endian.
+#define PIX_FMT_PAL       2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
+#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
+#define PIX_FMT_HWACCEL   8 ///< Pixel format is an HW accelerated format.
+#define PIX_FMT_PLANAR   16 ///< At least one pixel component is not in the first data plane
+#define PIX_FMT_RGB      32 ///< The pixel format contains RGB-like data (as opposed to YUV/grayscale)
+/**
+ * The pixel format is "pseudo-paletted". This means that Libav treats it as
+ * paletted internally, but the palette is generated by the decoder and is not
+ * stored in the file.
+ */
+#define PIX_FMT_PSEUDOPAL 64
+
+#if FF_API_PIX_FMT_DESC
+/**
+ * The array of all the pixel format descriptors.
+ */
+extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
+#endif
+
+/**
+ * Read a line from an image, and write the values of the
+ * pixel format component c to dst.
+ *
+ * @param data the array containing the pointers to the planes of the image
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to read
+ * @param y the vertical coordinate of the first pixel to read
+ * @param w the width of the line to read, that is the number of
+ * values to write to dst
+ * @param read_pal_component if not zero and the format is a paletted
+ * format writes the values corresponding to the palette
+ * component c in data[1] to dst, rather than the palette indexes in
+ * data[0]. The behavior is undefined if the format is not paletted.
+ */
+void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
+                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
+
+/**
+ * Write the values from src to the pixel format component c of an
+ * image line.
+ *
+ * @param src array containing the values to write
+ * @param data the array containing the pointers to the planes of the
+ * image to write into. It is supposed to be zeroed.
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to write
+ * @param y the vertical coordinate of the first pixel to write
+ * @param w the width of the line to write, that is the number of
+ * values to write to the image line
+ */
+void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
+                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
+
+/**
+ * Return the pixel format corresponding to name.
+ *
+ * If there is no pixel format with name name, then looks for a
+ * pixel format with the name corresponding to the native endian
+ * format of name.
+ * For example in a little-endian system, first looks for "gray16",
+ * then for "gray16le".
+ *
+ * Finally if no pixel format has been found, returns PIX_FMT_NONE.
+ */
+enum AVPixelFormat av_get_pix_fmt(const char *name);
+
+/**
+ * Return the short name for a pixel format, NULL in case pix_fmt is
+ * unknown.
+ *
+ * @see av_get_pix_fmt(), av_get_pix_fmt_string()
+ */
+const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
+
+/**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
+
+/**
+ * Return the number of bits per pixel used by the pixel format
+ * described by pixdesc.
+ *
+ * The returned number of bits refers to the number of bits actually
+ * used for storing the pixel information, that is padding bits are
+ * not counted.
+ */
+int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * @return a pixel format descriptor for provided pixel format or NULL if
+ * this pixel format is unknown.
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
+
+/**
+ * Iterate over all pixel format descriptors known to libavutil.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
+
+/**
+ * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
+ * is not a valid pointer to a pixel format descriptor.
+ */
+enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
+
+#endif /* AVUTIL_PIXDESC_H */
diff --git a/misc/winutils/include/libavutil/pixfmt.h b/misc/winutils/include/libavutil/pixfmt.h
new file mode 100644
index 0000000..b11a034
--- /dev/null
+++ b/misc/winutils/include/libavutil/pixfmt.h
@@ -0,0 +1,240 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file
+ * pixel format definitions
+ *
+ */
+
+#include "libavutil/avconfig.h"
+#include "libavutil/version.h"
+
+/**
+ * Pixel format.
+ *
+ * @note
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ *  (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * @par
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * @par
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * @note
+ * make sure that all newly added big endian formats have pix_fmt&1==1
+ * and that all newly added little endian formats have pix_fmt&1==0
+ * this allows simpler detection of big vs little endian.
+ */
+enum AVPixelFormat {
+    AV_PIX_FMT_NONE = -1,
+    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    AV_PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    AV_PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    AV_PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    AV_PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+    AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    AV_PIX_FMT_XVMC_MPEG2_IDCT,
+    AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    AV_PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    AV_PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    AV_PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    AV_PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    AV_PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    AV_PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    AV_PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    AV_PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    AV_PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    AV_PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    AV_PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    AV_PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    AV_PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    AV_PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+    AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    AV_PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    AV_PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    AV_PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    AV_PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    AV_PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    AV_PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    AV_PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    AV_PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    AV_PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    AV_PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    AV_PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    AV_PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    AV_PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    AV_PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
+    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+    AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#if FF_API_PIX_FMT
+#include "old_pix_fmts.h"
+#endif
+};
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
+#else
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
+#endif
+
+#define AV_PIX_FMT_RGB32   AV_PIX_FMT_NE(ARGB, BGRA)
+#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
+#define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
+#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
+
+#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
+#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
+#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
+#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
+#define AV_PIX_FMT_BGR48  AV_PIX_FMT_NE(BGR48BE,  BGR48LE)
+#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
+#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
+#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
+
+#define AV_PIX_FMT_YUV420P9  AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
+#define AV_PIX_FMT_YUV422P9  AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
+#define AV_PIX_FMT_YUV444P9  AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
+#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
+#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
+#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
+#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
+#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
+#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
+
+#define AV_PIX_FMT_GBRP9     AV_PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
+#define AV_PIX_FMT_GBRP10    AV_PIX_FMT_NE(GBRP10BE,    GBRP10LE)
+#define AV_PIX_FMT_GBRP16    AV_PIX_FMT_NE(GBRP16BE,    GBRP16LE)
+
+#if FF_API_PIX_FMT
+#define PixelFormat AVPixelFormat
+
+#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
+
+#define PIX_FMT_RGB32   AV_PIX_FMT_RGB32
+#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
+#define PIX_FMT_BGR32   AV_PIX_FMT_BGR32
+#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
+
+#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
+#define PIX_FMT_RGB48  AV_PIX_FMT_RGB48
+#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
+#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
+#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
+#define PIX_FMT_BGR48  AV_PIX_FMT_BGR48
+#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
+#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
+#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
+
+#define PIX_FMT_YUV420P9  AV_PIX_FMT_YUV420P9
+#define PIX_FMT_YUV422P9  AV_PIX_FMT_YUV422P9
+#define PIX_FMT_YUV444P9  AV_PIX_FMT_YUV444P9
+#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
+#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
+#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
+#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
+#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
+#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
+
+#define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
+#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
+#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
+#endif
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/misc/winutils/include/libavutil/random_seed.h b/misc/winutils/include/libavutil/random_seed.h
new file mode 100644
index 0000000..b1fad13
--- /dev/null
+++ b/misc/winutils/include/libavutil/random_seed.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier at gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_RANDOM_SEED_H
+#define AVUTIL_RANDOM_SEED_H
+
+#include <stdint.h>
+/**
+ * @addtogroup lavu_crypto
+ * @{
+ */
+
+/**
+ * Get random data.
+ *
+ * This function can be called repeatedly to generate more random bits
+ * as needed. It is generally quite slow, and usually used to seed a
+ * PRNG.  As it uses /dev/urandom and /dev/random, the quality of the
+ * returned random data depends on the platform.
+ */
+uint32_t av_get_random_seed(void);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RANDOM_SEED_H */
diff --git a/misc/winutils/include/libavutil/rational.h b/misc/winutils/include/libavutil/rational.h
new file mode 100644
index 0000000..5d7dab7
--- /dev/null
+++ b/misc/winutils/include/libavutil/rational.h
@@ -0,0 +1,155 @@
+/*
+ * rational numbers
+ * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * rational numbers
+ * @author Michael Niedermayer <michaelni at gmx.at>
+ */
+
+#ifndef AVUTIL_RATIONAL_H
+#define AVUTIL_RATIONAL_H
+
+#include <stdint.h>
+#include <limits.h>
+#include "attributes.h"
+
+/**
+ * @addtogroup lavu_math
+ * @{
+ */
+
+/**
+ * rational number numerator/denominator
+ */
+typedef struct AVRational{
+    int num; ///< numerator
+    int den; ///< denominator
+} AVRational;
+
+/**
+ * Compare two rationals.
+ * @param a first rational
+ * @param b second rational
+ * @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the
+ * values is of the form 0/0
+ */
+static inline int av_cmp_q(AVRational a, AVRational b){
+    const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
+
+    if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1;
+    else if(b.den && a.den) return 0;
+    else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
+    else                    return INT_MIN;
+}
+
+/**
+ * Convert rational to double.
+ * @param a rational to convert
+ * @return (double) a
+ */
+static inline double av_q2d(AVRational a){
+    return a.num / (double) a.den;
+}
+
+/**
+ * Reduce a fraction.
+ * This is useful for framerate calculations.
+ * @param dst_num destination numerator
+ * @param dst_den destination denominator
+ * @param num source numerator
+ * @param den source denominator
+ * @param max the maximum allowed for dst_num & dst_den
+ * @return 1 if exact, 0 otherwise
+ */
+int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
+
+/**
+ * Multiply two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b*c
+ */
+AVRational av_mul_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Divide one rational by another.
+ * @param b first rational
+ * @param c second rational
+ * @return b/c
+ */
+AVRational av_div_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Add two rationals.
+ * @param b first rational
+ * @param c second rational
+ * @return b+c
+ */
+AVRational av_add_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Subtract one rational from another.
+ * @param b first rational
+ * @param c second rational
+ * @return b-c
+ */
+AVRational av_sub_q(AVRational b, AVRational c) av_const;
+
+/**
+ * Invert a rational.
+ * @param q value
+ * @return 1 / q
+ */
+static av_always_inline AVRational av_inv_q(AVRational q)
+{
+    AVRational r = { q.den, q.num };
+    return r;
+}
+
+/**
+ * Convert a double precision floating point number to a rational.
+ * inf is expressed as {1,0} or {-1,0} depending on the sign.
+ *
+ * @param d double to convert
+ * @param max the maximum allowed numerator and denominator
+ * @return (AVRational) d
+ */
+AVRational av_d2q(double d, int max) av_const;
+
+/**
+ * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
+ * than q1, 0 if they have the same distance.
+ */
+int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
+
+/**
+ * Find the nearest value in q_list to q.
+ * @param q_list an array of rationals terminated by {0, 0}
+ * @return the index of the nearest value found in the array
+ */
+int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_RATIONAL_H */
diff --git a/misc/winutils/include/libavutil/samplefmt.h b/misc/winutils/include/libavutil/samplefmt.h
new file mode 100644
index 0000000..0641c56
--- /dev/null
+++ b/misc/winutils/include/libavutil/samplefmt.h
@@ -0,0 +1,228 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SAMPLEFMT_H
+#define AVUTIL_SAMPLEFMT_H
+
+#include <stdint.h>
+
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Audio Sample Formats
+ *
+ * @par
+ * The data described by the sample format is always in native-endian order.
+ * Sample values can be expressed by native C types, hence the lack of a signed
+ * 24-bit sample format even though it is a common raw audio data format.
+ *
+ * @par
+ * The floating-point formats are based on full volume being in the range
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
+ *
+ * @par
+ * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
+ * (such as AVFrame in libavcodec) is as follows:
+ *
+ * For planar sample formats, each audio channel is in a separate data plane,
+ * and linesize is the buffer size, in bytes, for a single plane. All data
+ * planes must be the same size. For packed sample formats, only the first data
+ * plane is used, and samples for each channel are interleaved. In this case,
+ * linesize is the buffer size, in bytes, for the 1 plane.
+ */
+enum AVSampleFormat {
+    AV_SAMPLE_FMT_NONE = -1,
+    AV_SAMPLE_FMT_U8,          ///< unsigned 8 bits
+    AV_SAMPLE_FMT_S16,         ///< signed 16 bits
+    AV_SAMPLE_FMT_S32,         ///< signed 32 bits
+    AV_SAMPLE_FMT_FLT,         ///< float
+    AV_SAMPLE_FMT_DBL,         ///< double
+
+    AV_SAMPLE_FMT_U8P,         ///< unsigned 8 bits, planar
+    AV_SAMPLE_FMT_S16P,        ///< signed 16 bits, planar
+    AV_SAMPLE_FMT_S32P,        ///< signed 32 bits, planar
+    AV_SAMPLE_FMT_FLTP,        ///< float, planar
+    AV_SAMPLE_FMT_DBLP,        ///< double, planar
+
+    AV_SAMPLE_FMT_NB           ///< Number of sample formats. DO NOT USE if linking dynamically
+};
+
+/**
+ * Return the name of sample_fmt, or NULL if sample_fmt is not
+ * recognized.
+ */
+const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
+
+/**
+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
+ * on error.
+ */
+enum AVSampleFormat av_get_sample_fmt(const char *name);
+
+/**
+ * Get the packed alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in packed format, the format returned is
+ * the same as the input.
+ *
+ * @return  the packed alternative form of the given sample format or
+            AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the planar alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in planar format, the format returned is
+ * the same as the input.
+ *
+ * @return  the planar alternative form of the given sample format or
+            AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Generate a string corresponding to the sample format with
+ * sample_fmt, or a header if sample_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param sample_fmt the number of the sample format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ * @return the pointer to the filled buffer or NULL if sample_fmt is
+ * unknown or in case of other errors
+ */
+char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
+
+#if FF_API_GET_BITS_PER_SAMPLE_FMT
+/**
+ * @deprecated Use av_get_bytes_per_sample() instead.
+ */
+attribute_deprecated
+int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
+#endif
+
+/**
+ * Return number of bytes per sample.
+ *
+ * @param sample_fmt the sample format
+ * @return number of bytes per sample or zero if unknown for the given
+ * sample format
+ */
+int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
+
+/**
+ * Check if the sample format is planar.
+ *
+ * @param sample_fmt the sample format to inspect
+ * @return 1 if the sample format is planar, 0 if it is interleaved
+ */
+int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the required buffer size for the given audio parameters.
+ *
+ * @param[out] linesize calculated linesize, may be NULL
+ * @param nb_channels   the number of channels
+ * @param nb_samples    the number of samples in a single channel
+ * @param sample_fmt    the sample format
+ * @param align         buffer size alignment (0 = default, 1 = no alignment)
+ * @return              required buffer size, or negative error code on failure
+ */
+int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
+                               enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Fill channel data pointers and linesize for samples with sample
+ * format sample_fmt.
+ *
+ * The pointers array is filled with the pointers to the samples data:
+ * for planar, set the start point of each channel's data within the buffer,
+ * for packed, set the start point of the entire buffer only.
+ *
+ * The linesize array is filled with the aligned size of each channel's data
+ * buffer for planar layout, or the aligned size of the buffer for all channels
+ * for packed layout.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data  array to be filled with the pointer for each channel
+ * @param[out] linesize    calculated linesize, may be NULL
+ * @param buf              the pointer to a buffer containing the samples
+ * @param nb_channels      the number of channels
+ * @param nb_samples       the number of samples in a single channel
+ * @param sample_fmt       the sample format
+ * @param align            buffer size alignment (0 = default, 1 = no alignment)
+ * @return                 0 on success or a negative error code on failure
+ */
+int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
+                           const uint8_t *buf,
+                           int nb_channels, int nb_samples,
+                           enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Allocate a samples buffer for nb_samples samples, and fill data pointers and
+ * linesize accordingly.
+ * The allocated samples buffer can be freed by using av_freep(&audio_data[0])
+ * Allocated data will be initialized to silence.
+ *
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
+ * @param[out] audio_data  array to be filled with the pointer for each channel
+ * @param[out] linesize    aligned size for audio buffer(s), may be NULL
+ * @param nb_channels      number of audio channels
+ * @param nb_samples       number of samples per channel
+ * @param align            buffer size alignment (0 = default, 1 = no alignment)
+ * @return                 0 on success or a negative error code on failure
+ * @see av_samples_fill_arrays()
+ */
+int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
+                     int nb_samples, enum AVSampleFormat sample_fmt, int align);
+
+/**
+ * Copy samples from src to dst.
+ *
+ * @param dst destination array of pointers to data planes
+ * @param src source array of pointers to data planes
+ * @param dst_offset offset in samples at which the data will be written to dst
+ * @param src_offset offset in samples at which the data will be read from src
+ * @param nb_samples number of samples to be copied
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ */
+int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+                    int src_offset, int nb_samples, int nb_channels,
+                    enum AVSampleFormat sample_fmt);
+
+/**
+ * Fill an audio buffer with silence.
+ *
+ * @param audio_data  array of pointers to data planes
+ * @param offset      offset in samples at which to start filling
+ * @param nb_samples  number of samples to fill
+ * @param nb_channels number of audio channels
+ * @param sample_fmt  audio sample format
+ */
+int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+                           int nb_channels, enum AVSampleFormat sample_fmt);
+
+#endif /* AVUTIL_SAMPLEFMT_H */
diff --git a/misc/winutils/include/libavutil/sha.h b/misc/winutils/include/libavutil/sha.h
new file mode 100644
index 0000000..4c9a0c9
--- /dev/null
+++ b/misc/winutils/include/libavutil/sha.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2007 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_SHA_H
+#define AVUTIL_SHA_H
+
+#include <stdint.h>
+
+#include "attributes.h"
+#include "version.h"
+
+/**
+ * @defgroup lavu_sha SHA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+#if FF_API_CONTEXT_SIZE
+extern attribute_deprecated const int av_sha_size;
+#endif
+
+struct AVSHA;
+
+/**
+ * Allocate an AVSHA context.
+ */
+struct AVSHA *av_sha_alloc(void);
+
+/**
+ * Initialize SHA-1 or SHA-2 hashing.
+ *
+ * @param context pointer to the function context (of size av_sha_size)
+ * @param bits    number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
+ * @return        zero if initialization succeeded, -1 otherwise
+ */
+int av_sha_init(struct AVSHA* context, int bits);
+
+/**
+ * Update hash value.
+ *
+ * @param context hash function context
+ * @param data    input data to update hash with
+ * @param len     input data length
+ */
+void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
+
+/**
+ * Finish hashing and output digest value.
+ *
+ * @param context hash function context
+ * @param digest  buffer where output digest value is stored
+ */
+void av_sha_final(struct AVSHA* context, uint8_t *digest);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_SHA_H */
diff --git a/misc/winutils/include/libavutil/time.h b/misc/winutils/include/libavutil/time.h
new file mode 100644
index 0000000..b01a97d
--- /dev/null
+++ b/misc/winutils/include/libavutil/time.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_TIME_H
+#define AVUTIL_TIME_H
+
+#include <stdint.h>
+
+/**
+ * Get the current time in microseconds.
+ */
+int64_t av_gettime(void);
+
+/**
+ * Sleep for a period of time.  Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param  usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
+#endif /* AVUTIL_TIME_H */
diff --git a/misc/winutils/include/libavutil/version.h b/misc/winutils/include/libavutil/version.h
new file mode 100644
index 0000000..4de2a94
--- /dev/null
+++ b/misc/winutils/include/libavutil/version.h
@@ -0,0 +1,93 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_VERSION_H
+#define AVUTIL_VERSION_H
+
+#include "avutil.h"
+
+/**
+ * @file
+ * @ingroup lavu
+ * Libavutil version macros
+ */
+
+/**
+ * @defgroup lavu_ver Version and Build diagnostics
+ *
+ * Macros and function useful to check at compiletime and at runtime
+ * which version of libavutil is in use.
+ *
+ * @{
+ */
+
+#define LIBAVUTIL_VERSION_MAJOR 51
+#define LIBAVUTIL_VERSION_MINOR 45
+#define LIBAVUTIL_VERSION_MICRO  0
+
+#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+                                               LIBAVUTIL_VERSION_MINOR, \
+                                               LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
+                                           LIBAVUTIL_VERSION_MINOR,     \
+                                           LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
+
+#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
+
+/**
+ * @}
+ *
+ * @defgroup depr_guards Deprecation guards
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ *
+ * @{
+ */
+
+#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
+#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_FIND_OPT
+#define FF_API_FIND_OPT                 (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_AV_FIFO_PEEK
+#define FF_API_AV_FIFO_PEEK             (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_OLD_AVOPTIONS
+#define FF_API_OLD_AVOPTIONS            (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_PIX_FMT
+#define FF_API_PIX_FMT                  (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_CONTEXT_SIZE
+#define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_PIX_FMT_DESC
+#define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+#ifndef FF_API_AV_REVERSE
+#define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 52)
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_VERSION_H */
diff --git a/misc/winutils/include/libavutil/xtea.h b/misc/winutils/include/libavutil/xtea.h
new file mode 100644
index 0000000..7d2b07b
--- /dev/null
+++ b/misc/winutils/include/libavutil/xtea.h
@@ -0,0 +1,61 @@
+/*
+ * A 32-bit implementation of the XTEA algorithm
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_XTEA_H
+#define AVUTIL_XTEA_H
+
+#include <stdint.h>
+
+/**
+ * @defgroup lavu_xtea XTEA
+ * @ingroup lavu_crypto
+ * @{
+ */
+
+typedef struct AVXTEA {
+    uint32_t key[16];
+} AVXTEA;
+
+/**
+ * Initialize an AVXTEA context.
+ *
+ * @param ctx an AVXTEA context
+ * @param key a key of 16 bytes used for encryption/decryption
+ */
+void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
+
+/**
+ * Encrypt or decrypt a buffer using a previously initialized context.
+ *
+ * @param ctx an AVXTEA context
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param count number of 8 byte blocks
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
+                   int count, uint8_t *iv, int decrypt);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_XTEA_H */
diff --git a/misc/winutils/include/png.h b/misc/winutils/include/png.h
new file mode 100644
index 0000000..7b74433
--- /dev/null
+++ b/misc/winutils/include/png.h
@@ -0,0 +1,2674 @@
+
+/* png.h - header file for PNG reference library
+ *
+ * libpng version 1.5.13 - September 27, 2012
+ * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ *
+ * This code is released under the libpng license (See LICENSE, below)
+ *
+ * Authors and maintainers:
+ *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
+ *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
+ *   libpng versions 0.97, January 1998, through 1.5.13 - September 27, 2012: Glenn
+ *   See also "Contributing Authors", below.
+ *
+ * Note about libpng version numbers:
+ *
+ *   Due to various miscommunications, unforeseen code incompatibilities
+ *   and occasional factors outside the authors' control, version numbering
+ *   on the library has not always been consistent and straightforward.
+ *   The following table summarizes matters since version 0.89c, which was
+ *   the first widely used release:
+ *
+ *    source                 png.h  png.h  shared-lib
+ *    version                string   int  version
+ *    -------                ------ -----  ----------
+ *    0.89c "1.0 beta 3"     0.89      89  1.0.89
+ *    0.90  "1.0 beta 4"     0.90      90  0.90  [should have been 2.0.90]
+ *    0.95  "1.0 beta 5"     0.95      95  0.95  [should have been 2.0.95]
+ *    0.96  "1.0 beta 6"     0.96      96  0.96  [should have been 2.0.96]
+ *    0.97b "1.00.97 beta 7" 1.00.97   97  1.0.1 [should have been 2.0.97]
+ *    0.97c                  0.97      97  2.0.97
+ *    0.98                   0.98      98  2.0.98
+ *    0.99                   0.99      98  2.0.99
+ *    0.99a-m                0.99      99  2.0.99
+ *    1.00                   1.00     100  2.1.0 [100 should be 10000]
+ *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]
+ *    1.0.1       png.h string is   10001  2.1.0
+ *    1.0.1a-e    identical to the  10002  from here on, the shared library
+ *    1.0.2       source version)   10002  is 2.V where V is the source code
+ *    1.0.2a-b                      10003  version, except as noted.
+ *    1.0.3                         10003
+ *    1.0.3a-d                      10004
+ *    1.0.4                         10004
+ *    1.0.4a-f                      10005
+ *    1.0.5 (+ 2 patches)           10005
+ *    1.0.5a-d                      10006
+ *    1.0.5e-r                      10100 (not source compatible)
+ *    1.0.5s-v                      10006 (not binary compatible)
+ *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)
+ *    1.0.6d-f                      10007 (still binary incompatible)
+ *    1.0.6g                        10007
+ *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)
+ *    1.0.6i                        10007  10.6i
+ *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)
+ *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)
+ *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)
+ *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)
+ *    1.0.7                    1    10007  (still compatible)
+ *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4
+ *    1.0.8rc1                 1    10008  2.1.0.8rc1
+ *    1.0.8                    1    10008  2.1.0.8
+ *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6
+ *    1.0.9rc1                 1    10009  2.1.0.9rc1
+ *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10
+ *    1.0.9rc2                 1    10009  2.1.0.9rc2
+ *    1.0.9                    1    10009  2.1.0.9
+ *    1.0.10beta1              1    10010  2.1.0.10beta1
+ *    1.0.10rc1                1    10010  2.1.0.10rc1
+ *    1.0.10                   1    10010  2.1.0.10
+ *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3
+ *    1.0.11rc1                1    10011  2.1.0.11rc1
+ *    1.0.11                   1    10011  2.1.0.11
+ *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2
+ *    1.0.12rc1                2    10012  2.1.0.12rc1
+ *    1.0.12                   2    10012  2.1.0.12
+ *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)
+ *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2
+ *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5
+ *    1.2.0rc1                 3    10200  3.1.2.0rc1
+ *    1.2.0                    3    10200  3.1.2.0
+ *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4
+ *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2
+ *    1.2.1                    3    10201  3.1.2.1
+ *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6
+ *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1
+ *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1
+ *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1
+ *    1.0.13                  10    10013  10.so.0.1.0.13
+ *    1.2.2                   12    10202  12.so.0.1.2.2
+ *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6
+ *    1.2.3                   12    10203  12.so.0.1.2.3
+ *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3
+ *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1
+ *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1
+ *    1.0.14                  10    10014  10.so.0.1.0.14
+ *    1.2.4                   13    10204  12.so.0.1.2.4
+ *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2
+ *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3
+ *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3
+ *    1.0.15                  10    10015  10.so.0.1.0.15
+ *    1.2.5                   13    10205  12.so.0.1.2.5
+ *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4
+ *    1.0.16                  10    10016  10.so.0.1.0.16
+ *    1.2.6                   13    10206  12.so.0.1.2.6
+ *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2
+ *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1
+ *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1
+ *    1.0.17                  10    10017  12.so.0.1.0.17
+ *    1.2.7                   13    10207  12.so.0.1.2.7
+ *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5
+ *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5
+ *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5
+ *    1.0.18                  10    10018  12.so.0.1.0.18
+ *    1.2.8                   13    10208  12.so.0.1.2.8
+ *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3
+ *    1.2.9beta4-11           13    10209  12.so.0.9[.0]
+ *    1.2.9rc1                13    10209  12.so.0.9[.0]
+ *    1.2.9                   13    10209  12.so.0.9[.0]
+ *    1.2.10beta1-7           13    10210  12.so.0.10[.0]
+ *    1.2.10rc1-2             13    10210  12.so.0.10[.0]
+ *    1.2.10                  13    10210  12.so.0.10[.0]
+ *    1.4.0beta1-5            14    10400  14.so.0.0[.0]
+ *    1.2.11beta1-4           13    10211  12.so.0.11[.0]
+ *    1.4.0beta7-8            14    10400  14.so.0.0[.0]
+ *    1.2.11                  13    10211  12.so.0.11[.0]
+ *    1.2.12                  13    10212  12.so.0.12[.0]
+ *    1.4.0beta9-14           14    10400  14.so.0.0[.0]
+ *    1.2.13                  13    10213  12.so.0.13[.0]
+ *    1.4.0beta15-36          14    10400  14.so.0.0[.0]
+ *    1.4.0beta37-87          14    10400  14.so.14.0[.0]
+ *    1.4.0rc01               14    10400  14.so.14.0[.0]
+ *    1.4.0beta88-109         14    10400  14.so.14.0[.0]
+ *    1.4.0rc02-08            14    10400  14.so.14.0[.0]
+ *    1.4.0                   14    10400  14.so.14.0[.0]
+ *    1.4.1beta01-03          14    10401  14.so.14.1[.0]
+ *    1.4.1rc01               14    10401  14.so.14.1[.0]
+ *    1.4.1beta04-12          14    10401  14.so.14.1[.0]
+ *    1.4.1                   14    10401  14.so.14.1[.0]
+ *    1.4.2                   14    10402  14.so.14.2[.0]
+ *    1.4.3                   14    10403  14.so.14.3[.0]
+ *    1.4.4                   14    10404  14.so.14.4[.0]
+ *    1.5.0beta01-58          15    10500  15.so.15.0[.0]
+ *    1.5.0rc01-07            15    10500  15.so.15.0[.0]
+ *    1.5.0                   15    10500  15.so.15.0[.0]
+ *    1.5.1beta01-11          15    10501  15.so.15.1[.0]
+ *    1.5.1rc01-02            15    10501  15.so.15.1[.0]
+ *    1.5.1                   15    10501  15.so.15.1[.0]
+ *    1.5.2beta01-03          15    10502  15.so.15.2[.0]
+ *    1.5.2rc01-03            15    10502  15.so.15.2[.0]
+ *    1.5.2                   15    10502  15.so.15.2[.0]
+ *    1.5.3beta01-10          15    10503  15.so.15.3[.0]
+ *    1.5.3rc01-02            15    10503  15.so.15.3[.0]
+ *    1.5.3beta11             15    10503  15.so.15.3[.0]
+ *    1.5.3 [omitted]
+ *    1.5.4beta01-08          15    10504  15.so.15.4[.0]
+ *    1.5.4rc01               15    10504  15.so.15.4[.0]
+ *    1.5.4                   15    10504  15.so.15.4[.0]
+ *    1.5.5beta01-08          15    10505  15.so.15.5[.0]
+ *    1.5.5rc01               15    10505  15.so.15.5[.0]
+ *    1.5.5                   15    10505  15.so.15.5[.0]
+ *    1.5.6beta01-07          15    10506  15.so.15.6[.0]
+ *    1.5.6rc01-03            15    10506  15.so.15.6[.0]
+ *    1.5.6                   15    10506  15.so.15.6[.0]
+ *    1.5.7beta01-05          15    10507  15.so.15.7[.0]
+ *    1.5.7rc01-03            15    10507  15.so.15.7[.0]
+ *    1.5.7                   15    10507  15.so.15.7[.0]
+ *    1.5.8beta01             15    10508  15.so.15.8[.0]
+ *    1.5.8rc01               15    10508  15.so.15.8[.0]
+ *    1.5.8                   15    10508  15.so.15.8[.0]
+ *    1.5.9beta01-02          15    10509  15.so.15.9[.0]
+ *    1.5.9rc01               15    10509  15.so.15.9[.0]
+ *    1.5.9                   15    10509  15.so.15.9[.0]
+ *    1.5.10beta01-05         15    10510  15.so.15.10[.0]
+ *    1.5.10                  15    10510  15.so.15.10[.0]
+ *    1.5.11beta01            15    10511  15.so.15.11[.0]
+ *    1.5.11rc01-05           15    10511  15.so.15.11[.0]
+ *    1.5.11                  15    10511  15.so.15.11[.0]
+ *    1.5.12                  15    10512  15.so.15.12[.0]
+ *    1.5.13beta01-02         15    10513  15.so.15.13[.0]
+ *    1.5.13rc01              15    10513  15.so.15.13[.0]
+ *    1.5.13                  15    10513  15.so.15.13[.0]
+ *
+ *   Henceforth the source version will match the shared-library major
+ *   and minor numbers; the shared-library major version number will be
+ *   used for changes in backward compatibility, as it is intended.  The
+ *   PNG_LIBPNG_VER macro, which is not used within libpng but is available
+ *   for applications, is an unsigned integer of the form xyyzz corresponding
+ *   to the source version x.y.z (leading zeros in y and z).  Beta versions
+ *   were given the previous public release number plus a letter, until
+ *   version 1.0.6j; from then on they were given the upcoming public
+ *   release number plus "betaNN" or "rcNN".
+ *
+ *   Binary incompatibility exists only when applications make direct access
+ *   to the info_ptr or png_ptr members through png.h, and the compiled
+ *   application is loaded with a different version of the library.
+ *
+ *   DLLNUM will change each time there are forward or backward changes
+ *   in binary compatibility (e.g., when a new feature is added).
+ *
+ * See libpng-manual.txt or libpng.3 for more information.  The PNG
+ * specification is available as a W3C Recommendation and as an ISO
+ * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ */
+
+/*
+ * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+ *
+ * If you modify libpng you may insert additional notices immediately following
+ * this sentence.
+ *
+ * This code is released under the libpng license.
+ *
+ * libpng versions 1.2.6, August 15, 2004, through 1.5.13, September 27, 2012, are
+ * Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-1.2.5
+ * with the following individual added to the list of Contributing Authors:
+ *
+ *    Cosmin Truta
+ *
+ * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
+ * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-1.0.6
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Simon-Pierre Cadieux
+ *    Eric S. Raymond
+ *    Gilles Vollant
+ *
+ * and with the following additions to the disclaimer:
+ *
+ *    There is no warranty against interference with your enjoyment of the
+ *    library or against infringement.  There is no warranty that our
+ *    efforts or the library will fulfill any of your particular purposes
+ *    or needs.  This library is provided with all faults, and the entire
+ *    risk of satisfactory quality, performance, accuracy, and effort is with
+ *    the user.
+ *
+ * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+ * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
+ * distributed according to the same disclaimer and license as libpng-0.96,
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    Tom Lane
+ *    Glenn Randers-Pehrson
+ *    Willem van Schaik
+ *
+ * libpng versions 0.89, June 1996, through 0.96, May 1997, are
+ * Copyright (c) 1996, 1997 Andreas Dilger
+ * Distributed according to the same disclaimer and license as libpng-0.88,
+ * with the following individuals added to the list of Contributing Authors:
+ *
+ *    John Bowler
+ *    Kevin Bracey
+ *    Sam Bushell
+ *    Magnus Holmgren
+ *    Greg Roelofs
+ *    Tom Tanner
+ *
+ * libpng versions 0.5, May 1995, through 0.88, January 1996, are
+ * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+ *
+ * For the purposes of this copyright and license, "Contributing Authors"
+ * is defined as the following set of individuals:
+ *
+ *    Andreas Dilger
+ *    Dave Martindale
+ *    Guy Eric Schalnat
+ *    Paul Schmidt
+ *    Tim Wegner
+ *
+ * The PNG Reference Library is supplied "AS IS".  The Contributing Authors
+ * and Group 42, Inc. disclaim all warranties, expressed or implied,
+ * including, without limitation, the warranties of merchantability and of
+ * fitness for any purpose.  The Contributing Authors and Group 42, Inc.
+ * assume no liability for direct, indirect, incidental, special, exemplary,
+ * or consequential damages, which may result from the use of the PNG
+ * Reference Library, even if advised of the possibility of such damage.
+ *
+ * Permission is hereby granted to use, copy, modify, and distribute this
+ * source code, or portions hereof, for any purpose, without fee, subject
+ * to the following restrictions:
+ *
+ *   1. The origin of this source code must not be misrepresented.
+ *
+ *   2. Altered versions must be plainly marked as such and must not
+ *      be misrepresented as being the original source.
+ *
+ *   3. This Copyright notice may not be removed or altered from
+ *      any source or altered source distribution.
+ *
+ * The Contributing Authors and Group 42, Inc. specifically permit, without
+ * fee, and encourage the use of this source code as a component to
+ * supporting the PNG file format in commercial products.  If you use this
+ * source code in a product, acknowledgment is not required but would be
+ * appreciated.
+ */
+
+/*
+ * A "png_get_copyright" function is available, for convenient use in "about"
+ * boxes and the like:
+ *
+ *     printf("%s", png_get_copyright(NULL));
+ *
+ * Also, the PNG logo (in PNG format, of course) is supplied in the
+ * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+ */
+
+/*
+ * Libpng is OSI Certified Open Source Software.  OSI Certified is a
+ * certification mark of the Open Source Initiative.
+ */
+
+/*
+ * The contributing authors would like to thank all those who helped
+ * with testing, bug fixes, and patience.  This wouldn't have been
+ * possible without all of you.
+ *
+ * Thanks to Frank J. T. Wojcik for helping with the documentation.
+ */
+
+/*
+ * Y2K compliance in libpng:
+ * =========================
+ *
+ *    September 27, 2012
+ *
+ *    Since the PNG Development group is an ad-hoc body, we can't make
+ *    an official declaration.
+ *
+ *    This is your unofficial assurance that libpng from version 0.71 and
+ *    upward through 1.5.13 are Y2K compliant.  It is my belief that
+ *    earlier versions were also Y2K compliant.
+ *
+ *    Libpng only has two year fields.  One is a 2-byte unsigned integer
+ *    that will hold years up to 65535.  The other holds the date in text
+ *    format, and will hold years up to 9999.
+ *
+ *    The integer is
+ *        "png_uint_16 year" in png_time_struct.
+ *
+ *    The string is
+ *        "char time_buffer[29]" in png_struct.  This will be no
+ *    longer used in libpng-1.6.0 and will be removed from libpng-1.7.0.
+ *
+ *    There are seven time-related functions:
+ *        png.c: png_convert_to_rfc_1123() in png.c
+ *          (formerly png_convert_to_rfc_1152() in error)
+ *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
+ *        png_convert_from_time_t() in pngwrite.c
+ *        png_get_tIME() in pngget.c
+ *        png_handle_tIME() in pngrutil.c, called in pngread.c
+ *        png_set_tIME() in pngset.c
+ *        png_write_tIME() in pngwutil.c, called in pngwrite.c
+ *
+ *    All handle dates properly in a Y2K environment.  The
+ *    png_convert_from_time_t() function calls gmtime() to convert from system
+ *    clock time, which returns (year - 1900), which we properly convert to
+ *    the full 4-digit year.  There is a possibility that applications using
+ *    libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
+ *    function, or that they are incorrectly passing only a 2-digit year
+ *    instead of "year - 1900" into the png_convert_from_struct_tm() function,
+ *    but this is not under our control.  The libpng documentation has always
+ *    stated that it works with 4-digit years, and the APIs have been
+ *    documented as such.
+ *
+ *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned
+ *    integer to hold the year, and can hold years as large as 65535.
+ *
+ *    zlib, upon which libpng depends, is also Y2K compliant.  It contains
+ *    no date-related code.
+ *
+ *       Glenn Randers-Pehrson
+ *       libpng maintainer
+ *       PNG Development Group
+ */
+
+#ifndef PNG_H
+#define PNG_H
+
+/* This is not the place to learn how to use libpng. The file libpng-manual.txt
+ * describes how to use libpng, and the file example.c summarizes it
+ * with some code on which to build.  This file is useful for looking
+ * at the actual function definitions and structure components.
+ *
+ * If you just need to read a PNG file and don't want to read the documentation
+ * skip to the end of this file and read the section entitled 'simplified API'.
+ */
+
+/* Version information for png.h - this should match the version in png.c */
+#define PNG_LIBPNG_VER_STRING "1.5.13"
+#define PNG_HEADER_VERSION_STRING \
+     " libpng version 1.5.13 - September 27, 2012\n"
+
+#define PNG_LIBPNG_VER_SONUM   15
+#define PNG_LIBPNG_VER_DLLNUM  15
+
+/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
+#define PNG_LIBPNG_VER_MAJOR   1
+#define PNG_LIBPNG_VER_MINOR   5
+#define PNG_LIBPNG_VER_RELEASE 13
+
+/* This should match the numeric part of the final component of
+ * PNG_LIBPNG_VER_STRING, omitting any leading zero:
+ */
+
+#define PNG_LIBPNG_VER_BUILD  0
+
+/* Release Status */
+#define PNG_LIBPNG_BUILD_ALPHA    1
+#define PNG_LIBPNG_BUILD_BETA     2
+#define PNG_LIBPNG_BUILD_RC       3
+#define PNG_LIBPNG_BUILD_STABLE   4
+#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
+
+/* Release-Specific Flags */
+#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with
+                                       PNG_LIBPNG_BUILD_STABLE only */
+#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
+                                       PNG_LIBPNG_BUILD_SPECIAL */
+#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
+                                       PNG_LIBPNG_BUILD_PRIVATE */
+
+#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
+
+/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.
+ * We must not include leading zeros.
+ * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
+ * version 1.0.0 was mis-numbered 100 instead of 10000).  From
+ * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
+ */
+#define PNG_LIBPNG_VER 10513 /* 1.5.13 */
+
+/* Library configuration: these options cannot be changed after
+ * the library has been built.
+ */
+#ifndef PNGLCONF_H
+    /* If pnglibconf.h is missing, you can
+     * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h
+     */
+#   include "pnglibconf.h"
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+#  ifndef PNG_BUILDING_SYMBOL_TABLE
+  /*
+   *   Standard header files (not needed for the version info or while
+   *   building symbol table -- see scripts/pnglibconf.dfa)
+   */
+#    ifdef PNG_SETJMP_SUPPORTED
+#      include <setjmp.h>
+#    endif
+
+    /* Need the time information for converting tIME chunks, it
+     * defines struct tm:
+     */
+#    ifdef PNG_CONVERT_tIME_SUPPORTED
+       /* "time.h" functions are not supported on all operating systems */
+#      include <time.h>
+#    endif
+#  endif
+
+/* Machine specific configuration. */
+#  include "pngconf.h"
+#endif
+
+/*
+ * Added at libpng-1.2.8
+ *
+ * Ref MSDN: Private as priority over Special
+ * VS_FF_PRIVATEBUILD File *was not* built using standard release
+ * procedures. If this value is given, the StringFileInfo block must
+ * contain a PrivateBuild string.
+ *
+ * VS_FF_SPECIALBUILD File *was* built by the original company using
+ * standard release procedures but is a variation of the standard
+ * file of the same version number. If this value is given, the
+ * StringFileInfo block must contain a SpecialBuild string.
+ */
+
+#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */
+#  define PNG_LIBPNG_BUILD_TYPE \
+       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)
+#else
+#  ifdef PNG_LIBPNG_SPECIALBUILD
+#    define PNG_LIBPNG_BUILD_TYPE \
+         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)
+#  else
+#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)
+#  endif
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+
+/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Version information for C files, stored in png.c.  This had better match
+ * the version above.
+ */
+#define png_libpng_ver png_get_header_ver(NULL)
+
+/* This file is arranged in several sections:
+ *
+ * 1. Any configuration options that can be specified by for the application
+ *    code when it is built.  (Build time configuration is in pnglibconf.h)
+ * 2. Type definitions (base types are defined in pngconf.h), structure
+ *    definitions.
+ * 3. Exported library functions.
+ *
+ * The library source code has additional files (principally pngpriv.h) that
+ * allow configuration of the library.
+ */
+/* Section 1: run time configuration
+ * See pnglibconf.h for build time configuration
+ *
+ * Run time configuration allows the application to choose between
+ * implementations of certain arithmetic APIs.  The default is set
+ * at build time and recorded in pnglibconf.h, but it is safe to
+ * override these (and only these) settings.  Note that this won't
+ * change what the library does, only application code, and the
+ * settings can (and probably should) be made on a per-file basis
+ * by setting the #defines before including png.h
+ *
+ * Use macros to read integers from PNG data or use the exported
+ * functions?
+ *   PNG_USE_READ_MACROS: use the macros (see below)  Note that
+ *     the macros evaluate their argument multiple times.
+ *   PNG_NO_USE_READ_MACROS: call the relevant library function.
+ *
+ * Use the alternative algorithm for compositing alpha samples that
+ * does not use division?
+ *   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'
+ *      algorithm.
+ *   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.
+ *
+ * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is
+ * false?
+ *   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error
+ *      APIs to png_warning.
+ * Otherwise the calls are mapped to png_error.
+ */
+
+/* Section 2: type definitions, including structures and compile time
+ * constants.
+ * See pngconf.h for base types that vary by machine/system
+ */
+
+/* This triggers a compiler error in png.c, if png.c and png.h
+ * do not agree upon the version number.
+ */
+typedef char* png_libpng_version_1_5_13;
+
+/* Three color definitions.  The order of the red, green, and blue, (and the
+ * exact size) is not important, although the size of the fields need to
+ * be png_byte or png_uint_16 (as defined below).
+ */
+typedef struct png_color_struct
+{
+   png_byte red;
+   png_byte green;
+   png_byte blue;
+} png_color;
+typedef png_color FAR * png_colorp;
+typedef PNG_CONST png_color FAR * png_const_colorp;
+typedef png_color FAR * FAR * png_colorpp;
+
+typedef struct png_color_16_struct
+{
+   png_byte index;    /* used for palette files */
+   png_uint_16 red;   /* for use in red green blue files */
+   png_uint_16 green;
+   png_uint_16 blue;
+   png_uint_16 gray;  /* for use in grayscale files */
+} png_color_16;
+typedef png_color_16 FAR * png_color_16p;
+typedef PNG_CONST png_color_16 FAR * png_const_color_16p;
+typedef png_color_16 FAR * FAR * png_color_16pp;
+
+typedef struct png_color_8_struct
+{
+   png_byte red;   /* for use in red green blue files */
+   png_byte green;
+   png_byte blue;
+   png_byte gray;  /* for use in grayscale files */
+   png_byte alpha; /* for alpha channel files */
+} png_color_8;
+typedef png_color_8 FAR * png_color_8p;
+typedef PNG_CONST png_color_8 FAR * png_const_color_8p;
+typedef png_color_8 FAR * FAR * png_color_8pp;
+
+/*
+ * The following two structures are used for the in-core representation
+ * of sPLT chunks.
+ */
+typedef struct png_sPLT_entry_struct
+{
+   png_uint_16 red;
+   png_uint_16 green;
+   png_uint_16 blue;
+   png_uint_16 alpha;
+   png_uint_16 frequency;
+} png_sPLT_entry;
+typedef png_sPLT_entry FAR * png_sPLT_entryp;
+typedef PNG_CONST png_sPLT_entry FAR * png_const_sPLT_entryp;
+typedef png_sPLT_entry FAR * FAR * png_sPLT_entrypp;
+
+/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples
+ *  occupy the LSB of their respective members, and the MSB of each member
+ *  is zero-filled.  The frequency member always occupies the full 16 bits.
+ */
+
+typedef struct png_sPLT_struct
+{
+   png_charp name;           /* palette name */
+   png_byte depth;           /* depth of palette samples */
+   png_sPLT_entryp entries;  /* palette entries */
+   png_int_32 nentries;      /* number of palette entries */
+} png_sPLT_t;
+typedef png_sPLT_t FAR * png_sPLT_tp;
+typedef PNG_CONST png_sPLT_t FAR * png_const_sPLT_tp;
+typedef png_sPLT_t FAR * FAR * png_sPLT_tpp;
+
+#ifdef PNG_TEXT_SUPPORTED
+/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,
+ * and whether that contents is compressed or not.  The "key" field
+ * points to a regular zero-terminated C string.  The "text" fields can be a
+ * regular C string, an empty string, or a NULL pointer.
+ * However, the structure returned by png_get_text() will always contain
+ * the "text" field as a regular zero-terminated C string (possibly
+ * empty), never a NULL pointer, so it can be safely used in printf() and
+ * other string-handling functions.  Note that the "itxt_length", "lang", and
+ * "lang_key" members of the structure only exist when the library is built
+ * with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by
+ * default without iTXt support. Also note that when iTXt *is* supported,
+ * the "lang" and "lang_key" fields contain NULL pointers when the
+ * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or
+ * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the
+ * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag"
+ * which is always 0 or 1, or its "compression method" which is always 0.
+ */
+typedef struct png_text_struct
+{
+   int  compression;       /* compression value:
+                             -1: tEXt, none
+                              0: zTXt, deflate
+                              1: iTXt, none
+                              2: iTXt, deflate  */
+   png_charp key;          /* keyword, 1-79 character description of "text" */
+   png_charp text;         /* comment, may be an empty string (ie "")
+                              or a NULL pointer */
+   png_size_t text_length; /* length of the text string */
+   png_size_t itxt_length; /* length of the itxt string */
+   png_charp lang;         /* language code, 0-79 characters
+                              or a NULL pointer */
+   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more
+                              chars or a NULL pointer */
+} png_text;
+typedef png_text FAR * png_textp;
+typedef PNG_CONST png_text FAR * png_const_textp;
+typedef png_text FAR * FAR * png_textpp;
+#endif
+
+/* Supported compression types for text in PNG files (tEXt, and zTXt).
+ * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */
+#define PNG_TEXT_COMPRESSION_NONE_WR -3
+#define PNG_TEXT_COMPRESSION_zTXt_WR -2
+#define PNG_TEXT_COMPRESSION_NONE    -1
+#define PNG_TEXT_COMPRESSION_zTXt     0
+#define PNG_ITXT_COMPRESSION_NONE     1
+#define PNG_ITXT_COMPRESSION_zTXt     2
+#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */
+
+/* png_time is a way to hold the time in an machine independent way.
+ * Two conversions are provided, both from time_t and struct tm.  There
+ * is no portable way to convert to either of these structures, as far
+ * as I know.  If you know of a portable way, send it to me.  As a side
+ * note - PNG has always been Year 2000 compliant!
+ */
+typedef struct png_time_struct
+{
+   png_uint_16 year; /* full year, as in, 1995 */
+   png_byte month;   /* month of year, 1 - 12 */
+   png_byte day;     /* day of month, 1 - 31 */
+   png_byte hour;    /* hour of day, 0 - 23 */
+   png_byte minute;  /* minute of hour, 0 - 59 */
+   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */
+} png_time;
+typedef png_time FAR * png_timep;
+typedef PNG_CONST png_time FAR * png_const_timep;
+typedef png_time FAR * FAR * png_timepp;
+
+#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \
+    defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
+/* png_unknown_chunk is a structure to hold queued chunks for which there is
+ * no specific support.  The idea is that we can use this to queue
+ * up private chunks for output even though the library doesn't actually
+ * know about their semantics.
+ */
+typedef struct png_unknown_chunk_t
+{
+    png_byte name[5];
+    png_byte *data;
+    png_size_t size;
+
+    /* libpng-using applications should NOT directly modify this byte. */
+    png_byte location; /* mode of operation at read time */
+}
+
+
+png_unknown_chunk;
+typedef png_unknown_chunk FAR * png_unknown_chunkp;
+typedef PNG_CONST png_unknown_chunk FAR * png_const_unknown_chunkp;
+typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
+#endif
+
+/* Values for the unknown chunk location byte */
+
+#define PNG_HAVE_IHDR  0x01
+#define PNG_HAVE_PLTE  0x02
+#define PNG_AFTER_IDAT 0x08
+
+/* The complete definition of png_info has, as of libpng-1.5.0,
+ * been moved into a separate header file that is not accessible to
+ * applications.  Read libpng-manual.txt or libpng.3 for more info.
+ */
+typedef struct png_info_def png_info;
+typedef png_info FAR * png_infop;
+typedef PNG_CONST png_info FAR * png_const_infop;
+typedef png_info FAR * FAR * png_infopp;
+
+/* Maximum positive integer used in PNG is (2^31)-1 */
+#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
+#define PNG_UINT_32_MAX ((png_uint_32)(-1))
+#define PNG_SIZE_MAX ((png_size_t)(-1))
+
+/* These are constants for fixed point values encoded in the
+ * PNG specification manner (x100000)
+ */
+#define PNG_FP_1    100000
+#define PNG_FP_HALF  50000
+#define PNG_FP_MAX  ((png_fixed_point)0x7fffffffL)
+#define PNG_FP_MIN  (-PNG_FP_MAX)
+
+/* These describe the color_type field in png_info. */
+/* color type masks */
+#define PNG_COLOR_MASK_PALETTE    1
+#define PNG_COLOR_MASK_COLOR      2
+#define PNG_COLOR_MASK_ALPHA      4
+
+/* color types.  Note that not all combinations are legal */
+#define PNG_COLOR_TYPE_GRAY 0
+#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
+#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
+#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
+#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
+/* aliases */
+#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA
+#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA
+
+/* This is for compression type. PNG 1.0-1.2 only define the single type. */
+#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */
+#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE
+
+/* This is for filter type. PNG 1.0-1.2 only define the single type. */
+#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */
+#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */
+#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE
+
+/* These are for the interlacing type.  These values should NOT be changed. */
+#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */
+#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */
+#define PNG_INTERLACE_LAST        2 /* Not a valid value */
+
+/* These are for the oFFs chunk.  These values should NOT be changed. */
+#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */
+#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */
+#define PNG_OFFSET_LAST           2 /* Not a valid value */
+
+/* These are for the pCAL chunk.  These values should NOT be changed. */
+#define PNG_EQUATION_LINEAR       0 /* Linear transformation */
+#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */
+#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */
+#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */
+#define PNG_EQUATION_LAST         4 /* Not a valid value */
+
+/* These are for the sCAL chunk.  These values should NOT be changed. */
+#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */
+#define PNG_SCALE_METER           1 /* meters per pixel */
+#define PNG_SCALE_RADIAN          2 /* radians per pixel */
+#define PNG_SCALE_LAST            3 /* Not a valid value */
+
+/* These are for the pHYs chunk.  These values should NOT be changed. */
+#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */
+#define PNG_RESOLUTION_METER      1 /* pixels/meter */
+#define PNG_RESOLUTION_LAST       2 /* Not a valid value */
+
+/* These are for the sRGB chunk.  These values should NOT be changed. */
+#define PNG_sRGB_INTENT_PERCEPTUAL 0
+#define PNG_sRGB_INTENT_RELATIVE   1
+#define PNG_sRGB_INTENT_SATURATION 2
+#define PNG_sRGB_INTENT_ABSOLUTE   3
+#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */
+
+/* This is for text chunks */
+#define PNG_KEYWORD_MAX_LENGTH     79
+
+/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
+#define PNG_MAX_PALETTE_LENGTH    256
+
+/* These determine if an ancillary chunk's data has been successfully read
+ * from the PNG header, or if the application has filled in the corresponding
+ * data in the info_struct to be written into the output file.  The values
+ * of the PNG_INFO_<chunk> defines should NOT be changed.
+ */
+#define PNG_INFO_gAMA 0x0001
+#define PNG_INFO_sBIT 0x0002
+#define PNG_INFO_cHRM 0x0004
+#define PNG_INFO_PLTE 0x0008
+#define PNG_INFO_tRNS 0x0010
+#define PNG_INFO_bKGD 0x0020
+#define PNG_INFO_hIST 0x0040
+#define PNG_INFO_pHYs 0x0080
+#define PNG_INFO_oFFs 0x0100
+#define PNG_INFO_tIME 0x0200
+#define PNG_INFO_pCAL 0x0400
+#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */
+#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */
+#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */
+#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */
+#define PNG_INFO_IDAT 0x8000   /* ESR, 1.0.6 */
+
+/* This is used for the transformation routines, as some of them
+ * change these values for the row.  It also should enable using
+ * the routines for other purposes.
+ */
+typedef struct png_row_info_struct
+{
+   png_uint_32 width;    /* width of row */
+   png_size_t rowbytes;  /* number of bytes in row */
+   png_byte color_type;  /* color type of row */
+   png_byte bit_depth;   /* bit depth of row */
+   png_byte channels;    /* number of channels (1, 2, 3, or 4) */
+   png_byte pixel_depth; /* bits per pixel (depth * channels) */
+} png_row_info;
+
+typedef png_row_info FAR * png_row_infop;
+typedef png_row_info FAR * FAR * png_row_infopp;
+
+/* The complete definition of png_struct has, as of libpng-1.5.0,
+ * been moved into a separate header file that is not accessible to
+ * applications.  Read libpng-manual.txt or libpng.3 for more info.
+ */
+typedef struct png_struct_def png_struct;
+typedef PNG_CONST png_struct FAR * png_const_structp;
+typedef png_struct FAR * png_structp;
+
+/* These are the function types for the I/O functions and for the functions
+ * that allow the user to override the default I/O functions with his or her
+ * own.  The png_error_ptr type should match that of user-supplied warning
+ * and error functions, while the png_rw_ptr type should match that of the
+ * user read/write data functions.  Note that the 'write' function must not
+ * modify the buffer it is passed. The 'read' function, on the other hand, is
+ * expected to return the read data in the buffer.
+ */
+typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));
+typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));
+typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));
+typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,
+    int));
+typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,
+    int));
+
+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
+typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));
+typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));
+
+/* The following callback receives png_uint_32 row_number, int pass for the
+ * png_bytep data of the row.  When transforming an interlaced image the
+ * row number is the row number within the sub-image of the interlace pass, so
+ * the value will increase to the height of the sub-image (not the full image)
+ * then reset to 0 for the next pass.
+ *
+ * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to
+ * find the output pixel (x,y) given an interlaced sub-image pixel
+ * (row,col,pass).  (See below for these macros.)
+ */
+typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,
+    png_uint_32, int));
+#endif
+
+#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
+    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
+typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,
+    png_bytep));
+#endif
+
+#ifdef PNG_USER_CHUNKS_SUPPORTED
+typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
+    png_unknown_chunkp));
+#endif
+#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
+typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp));
+#endif
+
+#ifdef PNG_SETJMP_SUPPORTED
+/* This must match the function definition in <setjmp.h>, and the application
+ * must include this before png.h to obtain the definition of jmp_buf.  The
+ * function is required to be PNG_NORETURN, but this is not checked.  If the
+ * function does return the application will crash via an abort() or similar
+ * system level call.
+ *
+ * If you get a warning here while building the library you may need to make
+ * changes to ensure that pnglibconf.h records the calling convention used by
+ * your compiler.  This may be very difficult - try using a different compiler
+ * to build the library!
+ */
+PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
+#endif
+
+/* Transform masks for the high-level interface */
+#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */
+#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */
+#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */
+#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */
+#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */
+#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */
+#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */
+#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */
+#define PNG_TRANSFORM_BGR            0x0080    /* read and write */
+#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */
+#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
+#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
+#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only */
+/* Added to libpng-1.2.34 */
+#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER
+#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */
+/* Added to libpng-1.4.0 */
+#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */
+/* Added to libpng-1.5.4 */
+#define PNG_TRANSFORM_EXPAND_16     0x4000      /* read only */
+#define PNG_TRANSFORM_SCALE_16      0x8000      /* read only */
+
+/* Flags for MNG supported features */
+#define PNG_FLAG_MNG_EMPTY_PLTE     0x01
+#define PNG_FLAG_MNG_FILTER_64      0x04
+#define PNG_ALL_MNG_FEATURES        0x05
+
+/* NOTE: prior to 1.5 these functions had no 'API' style declaration,
+ * this allowed the zlib default functions to be used on Windows
+ * platforms.  In 1.5 the zlib default malloc (which just calls malloc and
+ * ignores the first argument) should be completely compatible with the
+ * following.
+ */
+typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,
+    png_alloc_size_t));
+typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));
+
+typedef png_struct FAR * FAR * png_structpp;
+
+/* Section 3: exported functions
+ * Here are the function definitions most commonly used.  This is not
+ * the place to find out how to use libpng.  See libpng-manual.txt for the
+ * full explanation, see example.c for the summary.  This just provides
+ * a simple one line description of the use of each function.
+ *
+ * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in
+ * pngconf.h and in the *.dfn files in the scripts directory.
+ *
+ *   PNG_EXPORT(ordinal, type, name, (args));
+ *
+ *       ordinal:    ordinal that is used while building
+ *                   *.def files. The ordinal value is only
+ *                   relevant when preprocessing png.h with
+ *                   the *.dfn files for building symbol table
+ *                   entries, and are removed by pngconf.h.
+ *       type:       return type of the function
+ *       name:       function name
+ *       args:       function arguments, with types
+ *
+ * When we wish to append attributes to a function prototype we use
+ * the PNG_EXPORTA() macro instead.
+ *
+ *   PNG_EXPORTA(ordinal, type, name, (args), attributes);
+ *
+ *       ordinal, type, name, and args: same as in PNG_EXPORT().
+ *       attributes: function attributes
+ */
+
+/* Returns the version number of the library */
+PNG_EXPORT(1, png_uint_32, png_access_version_number, (void));
+
+/* Tell lib we have already handled the first <num_bytes> magic bytes.
+ * Handling more than 8 bytes from the beginning of the file is an error.
+ */
+PNG_EXPORT(2, void, png_set_sig_bytes, (png_structp png_ptr, int num_bytes));
+
+/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
+ * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG
+ * signature, and non-zero otherwise.  Having num_to_check == 0 or
+ * start > 7 will always fail (ie return non-zero).
+ */
+PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,
+    png_size_t num_to_check));
+
+/* Simple signature checking function.  This is the same as calling
+ * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
+ */
+#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))
+
+/* Allocate and initialize png_ptr struct for reading, and any other memory. */
+PNG_EXPORTA(4, png_structp, png_create_read_struct,
+    (png_const_charp user_png_ver, png_voidp error_ptr,
+    png_error_ptr error_fn, png_error_ptr warn_fn),
+    PNG_ALLOCATED);
+
+/* Allocate and initialize png_ptr struct for writing, and any other memory */
+PNG_EXPORTA(5, png_structp, png_create_write_struct,
+    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+    png_error_ptr warn_fn),
+    PNG_ALLOCATED);
+
+PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,
+    (png_const_structp png_ptr));
+
+PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structp png_ptr,
+    png_size_t size));
+
+/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
+ * match up.
+ */
+#ifdef PNG_SETJMP_SUPPORTED
+/* This function returns the jmp_buf built in to *png_ptr.  It must be
+ * supplied with an appropriate 'longjmp' function to use on that jmp_buf
+ * unless the default error function is overridden in which case NULL is
+ * acceptable.  The size of the jmp_buf is checked against the actual size
+ * allocated by the library - the call will return NULL on a mismatch
+ * indicating an ABI mismatch.
+ */
+PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr,
+    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));
+#  define png_jmpbuf(png_ptr) \
+      (*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf)))
+#else
+#  define png_jmpbuf(png_ptr) \
+      (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)
+#endif
+/* This function should be used by libpng applications in place of
+ * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it
+ * will use it; otherwise it will call PNG_ABORT().  This function was
+ * added in libpng-1.5.0.
+ */
+PNG_EXPORTA(9, void, png_longjmp, (png_structp png_ptr, int val),
+    PNG_NORETURN);
+
+#ifdef PNG_READ_SUPPORTED
+/* Reset the compression stream */
+PNG_EXPORT(10, int, png_reset_zstream, (png_structp png_ptr));
+#endif
+
+/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
+#ifdef PNG_USER_MEM_SUPPORTED
+PNG_EXPORTA(11, png_structp, png_create_read_struct_2,
+    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+    png_error_ptr warn_fn,
+    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
+    PNG_ALLOCATED);
+PNG_EXPORTA(12, png_structp, png_create_write_struct_2,
+    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+    png_error_ptr warn_fn,
+    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
+    PNG_ALLOCATED);
+#endif
+
+/* Write the PNG file signature. */
+PNG_EXPORT(13, void, png_write_sig, (png_structp png_ptr));
+
+/* Write a PNG chunk - size, type, (optional) data, CRC. */
+PNG_EXPORT(14, void, png_write_chunk, (png_structp png_ptr, png_const_bytep
+    chunk_name, png_const_bytep data, png_size_t length));
+
+/* Write the start of a PNG chunk - length and chunk name. */
+PNG_EXPORT(15, void, png_write_chunk_start, (png_structp png_ptr,
+    png_const_bytep chunk_name, png_uint_32 length));
+
+/* Write the data of a PNG chunk started with png_write_chunk_start(). */
+PNG_EXPORT(16, void, png_write_chunk_data, (png_structp png_ptr,
+    png_const_bytep data, png_size_t length));
+
+/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
+PNG_EXPORT(17, void, png_write_chunk_end, (png_structp png_ptr));
+
+/* Allocate and initialize the info structure */
+PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_structp png_ptr),
+    PNG_ALLOCATED);
+
+PNG_EXPORT(19, void, png_info_init_3, (png_infopp info_ptr,
+    png_size_t png_info_struct_size));
+
+/* Writes all the PNG information before the image. */
+PNG_EXPORT(20, void, png_write_info_before_PLTE,
+    (png_structp png_ptr, png_infop info_ptr));
+PNG_EXPORT(21, void, png_write_info,
+    (png_structp png_ptr, png_infop info_ptr));
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+/* Read the information before the actual image data. */
+PNG_EXPORT(22, void, png_read_info,
+    (png_structp png_ptr, png_infop info_ptr));
+#endif
+
+#ifdef PNG_TIME_RFC1123_SUPPORTED
+PNG_EXPORT(23, png_const_charp, png_convert_to_rfc1123,
+    (png_structp png_ptr,
+    png_const_timep ptime));
+#endif
+
+#ifdef PNG_CONVERT_tIME_SUPPORTED
+/* Convert from a struct tm to png_time */
+PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,
+    PNG_CONST struct tm FAR * ttime));
+
+/* Convert from time_t to png_time.  Uses gmtime() */
+PNG_EXPORT(25, void, png_convert_from_time_t,
+    (png_timep ptime, time_t ttime));
+#endif /* PNG_CONVERT_tIME_SUPPORTED */
+
+#ifdef PNG_READ_EXPAND_SUPPORTED
+/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
+PNG_EXPORT(26, void, png_set_expand, (png_structp png_ptr));
+PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structp png_ptr));
+PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structp png_ptr));
+PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_EXPAND_16_SUPPORTED
+/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion
+ * of a tRNS chunk if present.
+ */
+PNG_EXPORT(221, void, png_set_expand_16, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
+/* Use blue, green, red order for pixels. */
+PNG_EXPORT(30, void, png_set_bgr, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
+/* Expand the grayscale to 24-bit RGB if necessary. */
+PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+/* Reduce RGB to grayscale. */
+#define PNG_ERROR_ACTION_NONE  1
+#define PNG_ERROR_ACTION_WARN  2
+#define PNG_ERROR_ACTION_ERROR 3
+#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/
+
+PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structp png_ptr,
+    int error_action, double red, double green))
+PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structp png_ptr,
+    int error_action, png_fixed_point red, png_fixed_point green))
+
+PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structp
+    png_ptr));
+#endif
+
+#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
+PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
+    png_colorp palette));
+#endif
+
+#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
+/* How the alpha channel is interpreted - this affects how the color channels of
+ * a PNG file are returned when an alpha channel, or tRNS chunk in a palette
+ * file, is present.
+ *
+ * This has no effect on the way pixels are written into a PNG output
+ * datastream. The color samples in a PNG datastream are never premultiplied
+ * with the alpha samples.
+ *
+ * The default is to return data according to the PNG specification: the alpha
+ * channel is a linear measure of the contribution of the pixel to the
+ * corresponding composited pixel.  The gamma encoded color channels must be
+ * scaled according to the contribution and to do this it is necessary to undo
+ * the encoding, scale the color values, perform the composition and reencode
+ * the values.  This is the 'PNG' mode.
+ *
+ * The alternative is to 'associate' the alpha with the color information by
+ * storing color channel values that have been scaled by the alpha.  The
+ * advantage is that the color channels can be resampled (the image can be
+ * scaled) in this form.  The disadvantage is that normal practice is to store
+ * linear, not (gamma) encoded, values and this requires 16-bit channels for
+ * still images rather than the 8-bit channels that are just about sufficient if
+ * gamma encoding is used.  In addition all non-transparent pixel values,
+ * including completely opaque ones, must be gamma encoded to produce the final
+ * image.  This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the
+ * latter being the two common names for associated alpha color channels.)
+ *
+ * Since it is not necessary to perform arithmetic on opaque color values so
+ * long as they are not to be resampled and are in the final color space it is
+ * possible to optimize the handling of alpha by storing the opaque pixels in
+ * the PNG format (adjusted for the output color space) while storing partially
+ * opaque pixels in the standard, linear, format.  The accuracy required for
+ * standard alpha composition is relatively low, because the pixels are
+ * isolated, therefore typically the accuracy loss in storing 8-bit linear
+ * values is acceptable.  (This is not true if the alpha channel is used to
+ * simulate transparency over large areas - use 16 bits or the PNG mode in
+ * this case!)  This is the 'OPTIMIZED' mode.  For this mode a pixel is
+ * treated as opaque only if the alpha value is equal to the maximum value.
+ *
+ * The final choice is to gamma encode the alpha channel as well.  This is
+ * broken because, in practice, no implementation that uses this choice
+ * correctly undoes the encoding before handling alpha composition.  Use this
+ * choice only if other serious errors in the software or hardware you use
+ * mandate it; the typical serious error is for dark halos to appear around
+ * opaque areas of the composited PNG image because of arithmetic overflow.
+ *
+ * The API function png_set_alpha_mode specifies which of these choices to use
+ * with an enumerated 'mode' value and the gamma of the required output:
+ */
+#define PNG_ALPHA_PNG           0 /* according to the PNG standard */
+#define PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */
+#define PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */
+#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */
+#define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */
+#define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */
+
+PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structp png_ptr, int mode,
+    double output_gamma))
+PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structp png_ptr,
+    int mode, png_fixed_point output_gamma))
+#endif
+
+#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
+/* The output_gamma value is a screen gamma in libpng terminology: it expresses
+ * how to decode the output values, not how they are encoded.  The values used
+ * correspond to the normal numbers used to describe the overall gamma of a
+ * computer display system; for example 2.2 for an sRGB conformant system.  The
+ * values are scaled by 100000 in the _fixed version of the API (so 220000 for
+ * sRGB.)
+ *
+ * The inverse of the value is always used to provide a default for the PNG file
+ * encoding if it has no gAMA chunk and if png_set_gamma() has not been called
+ * to override the PNG gamma information.
+ *
+ * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode
+ * opaque pixels however pixels with lower alpha values are not encoded,
+ * regardless of the output gamma setting.
+ *
+ * When the standard Porter Duff handling is requested with mode 1 the output
+ * encoding is set to be linear and the output_gamma value is only relevant
+ * as a default for input data that has no gamma information.  The linear output
+ * encoding will be overridden if png_set_gamma() is called - the results may be
+ * highly unexpected!
+ *
+ * The following numbers are derived from the sRGB standard and the research
+ * behind it.  sRGB is defined to be approximated by a PNG gAMA chunk value of
+ * 0.45455 (1/2.2) for PNG.  The value implicitly includes any viewing
+ * correction required to take account of any differences in the color
+ * environment of the original scene and the intended display environment; the
+ * value expresses how to *decode* the image for display, not how the original
+ * data was *encoded*.
+ *
+ * sRGB provides a peg for the PNG standard by defining a viewing environment.
+ * sRGB itself, and earlier TV standards, actually use a more complex transform
+ * (a linear portion then a gamma 2.4 power law) than PNG can express.  (PNG is
+ * limited to simple power laws.)  By saying that an image for direct display on
+ * an sRGB conformant system should be stored with a gAMA chunk value of 45455
+ * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification
+ * makes it possible to derive values for other display systems and
+ * environments.
+ *
+ * The Mac value is deduced from the sRGB based on an assumption that the actual
+ * extra viewing correction used in early Mac display systems was implemented as
+ * a power 1.45 lookup table.
+ *
+ * Any system where a programmable lookup table is used or where the behavior of
+ * the final display device characteristics can be changed requires system
+ * specific code to obtain the current characteristic.  However this can be
+ * difficult and most PNG gamma correction only requires an approximate value.
+ *
+ * By default, if png_set_alpha_mode() is not called, libpng assumes that all
+ * values are unencoded, linear, values and that the output device also has a
+ * linear characteristic.  This is only very rarely correct - it is invariably
+ * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the
+ * default if you don't know what the right answer is!
+ *
+ * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS
+ * 10.6) which used a correction table to implement a somewhat lower gamma on an
+ * otherwise sRGB system.
+ *
+ * Both these values are reserved (not simple gamma values) in order to allow
+ * more precise correction internally in the future.
+ *
+ * NOTE: the following values can be passed to either the fixed or floating
+ * point APIs, but the floating point API will also accept floating point
+ * values.
+ */
+#define PNG_DEFAULT_sRGB -1       /* sRGB gamma and color space */
+#define PNG_GAMMA_MAC_18 -2       /* Old Mac '1.8' gamma and color space */
+#define PNG_GAMMA_sRGB   220000   /* Television standards--matches sRGB gamma */
+#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */
+#endif
+
+/* The following are examples of calls to png_set_alpha_mode to achieve the
+ * required overall gamma correction and, where necessary, alpha
+ * premultiplication.
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
+ *    This is the default libpng handling of the alpha channel - it is not
+ *    pre-multiplied into the color components.  In addition the call states
+ *    that the output is for a sRGB system and causes all PNG files without gAMA
+ *    chunks to be assumed to be encoded using sRGB.
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
+ *    In this case the output is assumed to be something like an sRGB conformant
+ *    display preceeded by a power-law lookup table of power 1.45.  This is how
+ *    early Mac systems behaved.
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);
+ *    This is the classic Jim Blinn approach and will work in academic
+ *    environments where everything is done by the book.  It has the shortcoming
+ *    of assuming that input PNG data with no gamma information is linear - this
+ *    is unlikely to be correct unless the PNG files where generated locally.
+ *    Most of the time the output precision will be so low as to show
+ *    significant banding in dark areas of the image.
+ *
+ * png_set_expand_16(pp);
+ * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);
+ *    This is a somewhat more realistic Jim Blinn inspired approach.  PNG files
+ *    are assumed to have the sRGB encoding if not marked with a gamma value and
+ *    the output is always 16 bits per component.  This permits accurate scaling
+ *    and processing of the data.  If you know that your input PNG files were
+ *    generated locally you might need to replace PNG_DEFAULT_sRGB with the
+ *    correct value for your system.
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);
+ *    If you just need to composite the PNG image onto an existing background
+ *    and if you control the code that does this you can use the optimization
+ *    setting.  In this case you just copy completely opaque pixels to the
+ *    output.  For pixels that are not completely transparent (you just skip
+ *    those) you do the composition math using png_composite or png_composite_16
+ *    below then encode the resultant 8-bit or 16-bit values to match the output
+ *    encoding.
+ *
+ * Other cases
+ *    If neither the PNG nor the standard linear encoding work for you because
+ *    of the software or hardware you use then you have a big problem.  The PNG
+ *    case will probably result in halos around the image.  The linear encoding
+ *    will probably result in a washed out, too bright, image (it's actually too
+ *    contrasty.)  Try the ALPHA_OPTIMIZED mode above - this will probably
+ *    substantially reduce the halos.  Alternatively try:
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);
+ *    This option will also reduce the halos, but there will be slight dark
+ *    halos round the opaque parts of the image where the background is light.
+ *    In the OPTIMIZED mode the halos will be light halos where the background
+ *    is dark.  Take your pick - the halos are unavoidable unless you can get
+ *    your hardware/software fixed!  (The OPTIMIZED approach is slightly
+ *    faster.)
+ *
+ * When the default gamma of PNG files doesn't match the output gamma.
+ *    If you have PNG files with no gamma information png_set_alpha_mode allows
+ *    you to provide a default gamma, but it also sets the ouput gamma to the
+ *    matching value.  If you know your PNG files have a gamma that doesn't
+ *    match the output you can take advantage of the fact that
+ *    png_set_alpha_mode always sets the output gamma but only sets the PNG
+ *    default if it is not already set:
+ *
+ * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
+ * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);
+ *    The first call sets both the default and the output gamma values, the
+ *    second call overrides the output gamma without changing the default.  This
+ *    is easier than achieving the same effect with png_set_gamma.  You must use
+ *    PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will
+ *    fire if more than one call to png_set_alpha_mode and png_set_background is
+ *    made in the same read operation, however multiple calls with PNG_ALPHA_PNG
+ *    are ignored.
+ */
+
+#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
+PNG_EXPORT(36, void, png_set_strip_alpha, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
+    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
+PNG_EXPORT(37, void, png_set_swap_alpha, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
+    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
+PNG_EXPORT(38, void, png_set_invert_alpha, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
+/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
+PNG_EXPORT(39, void, png_set_filler, (png_structp png_ptr, png_uint_32 filler,
+    int flags));
+/* The values of the PNG_FILLER_ defines should NOT be changed */
+#  define PNG_FILLER_BEFORE 0
+#  define PNG_FILLER_AFTER 1
+/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
+PNG_EXPORT(40, void, png_set_add_alpha,
+    (png_structp png_ptr, png_uint_32 filler,
+    int flags));
+#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
+
+#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
+/* Swap bytes in 16-bit depth files. */
+PNG_EXPORT(41, void, png_set_swap, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
+/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
+PNG_EXPORT(42, void, png_set_packing, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
+    defined(PNG_WRITE_PACKSWAP_SUPPORTED)
+/* Swap packing order of pixels in bytes. */
+PNG_EXPORT(43, void, png_set_packswap, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
+/* Converts files to legal bit depths. */
+PNG_EXPORT(44, void, png_set_shift, (png_structp png_ptr, png_const_color_8p
+    true_bits));
+#endif
+
+#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
+    defined(PNG_WRITE_INTERLACING_SUPPORTED)
+/* Have the code handle the interlacing.  Returns the number of passes.
+ * MUST be called before png_read_update_info or png_start_read_image,
+ * otherwise it will not have the desired effect.  Note that it is still
+ * necessary to call png_read_row or png_read_rows png_get_image_height
+ * times for each pass.
+*/
+PNG_EXPORT(45, int, png_set_interlace_handling, (png_structp png_ptr));
+#endif
+
+#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
+/* Invert monochrome files */
+PNG_EXPORT(46, void, png_set_invert_mono, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_BACKGROUND_SUPPORTED
+/* Handle alpha and tRNS by replacing with a background color.  Prior to
+ * libpng-1.5.4 this API must not be called before the PNG file header has been
+ * read.  Doing so will result in unexpected behavior and possible warnings or
+ * errors if the PNG file contains a bKGD chunk.
+ */
+PNG_FP_EXPORT(47, void, png_set_background, (png_structp png_ptr,
+    png_const_color_16p background_color, int background_gamma_code,
+    int need_expand, double background_gamma))
+PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structp png_ptr,
+    png_const_color_16p background_color, int background_gamma_code,
+    int need_expand, png_fixed_point background_gamma))
+#endif
+#ifdef PNG_READ_BACKGROUND_SUPPORTED
+#  define PNG_BACKGROUND_GAMMA_UNKNOWN 0
+#  define PNG_BACKGROUND_GAMMA_SCREEN  1
+#  define PNG_BACKGROUND_GAMMA_FILE    2
+#  define PNG_BACKGROUND_GAMMA_UNIQUE  3
+#endif
+
+#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
+/* Scale a 16-bit depth file down to 8-bit, accurately. */
+PNG_EXPORT(229, void, png_set_scale_16, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
+#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */
+/* Strip the second byte of information from a 16-bit depth file. */
+PNG_EXPORT(48, void, png_set_strip_16, (png_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_QUANTIZE_SUPPORTED
+/* Turn on quantizing, and reduce the palette to the number of colors
+ * available.
+ */
+PNG_EXPORT(49, void, png_set_quantize,
+    (png_structp png_ptr, png_colorp palette,
+    int num_palette, int maximum_colors, png_const_uint_16p histogram,
+    int full_quantize));
+#endif
+
+#ifdef PNG_READ_GAMMA_SUPPORTED
+/* The threshold on gamma processing is configurable but hard-wired into the
+ * library.  The following is the floating point variant.
+ */
+#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)
+
+/* Handle gamma correction. Screen_gamma=(display_exponent).
+ * NOTE: this API simply sets the screen and file gamma values. It will
+ * therefore override the value for gamma in a PNG file if it is called after
+ * the file header has been read - use with care  - call before reading the PNG
+ * file for best results!
+ *
+ * These routines accept the same gamma values as png_set_alpha_mode (described
+ * above).  The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either
+ * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value
+ * is the inverse of a 'screen gamma' value.
+ */
+PNG_FP_EXPORT(50, void, png_set_gamma,
+    (png_structp png_ptr, double screen_gamma,
+    double override_file_gamma))
+PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structp png_ptr,
+    png_fixed_point screen_gamma, png_fixed_point override_file_gamma))
+#endif
+
+#ifdef PNG_WRITE_FLUSH_SUPPORTED
+/* Set how many lines between output flushes - 0 for no flushing */
+PNG_EXPORT(51, void, png_set_flush, (png_structp png_ptr, int nrows));
+/* Flush the current PNG output buffer */
+PNG_EXPORT(52, void, png_write_flush, (png_structp png_ptr));
+#endif
+
+/* Optional update palette with requested transformations */
+PNG_EXPORT(53, void, png_start_read_image, (png_structp png_ptr));
+
+/* Optional call to update the users info structure */
+PNG_EXPORT(54, void, png_read_update_info,
+    (png_structp png_ptr, png_infop info_ptr));
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+/* Read one or more rows of image data. */
+PNG_EXPORT(55, void, png_read_rows, (png_structp png_ptr, png_bytepp row,
+    png_bytepp display_row, png_uint_32 num_rows));
+#endif
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+/* Read a row of data. */
+PNG_EXPORT(56, void, png_read_row, (png_structp png_ptr, png_bytep row,
+    png_bytep display_row));
+#endif
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+/* Read the whole image into memory at once. */
+PNG_EXPORT(57, void, png_read_image, (png_structp png_ptr, png_bytepp image));
+#endif
+
+/* Write a row of image data */
+PNG_EXPORT(58, void, png_write_row,
+    (png_structp png_ptr, png_const_bytep row));
+
+/* Write a few rows of image data: (*row) is not written; however, the type
+ * is declared as writeable to maintain compatibility with previous versions
+ * of libpng and to allow the 'display_row' array from read_rows to be passed
+ * unchanged to write_rows.
+ */
+PNG_EXPORT(59, void, png_write_rows, (png_structp png_ptr, png_bytepp row,
+    png_uint_32 num_rows));
+
+/* Write the image data */
+PNG_EXPORT(60, void, png_write_image,
+    (png_structp png_ptr, png_bytepp image));
+
+/* Write the end of the PNG file. */
+PNG_EXPORT(61, void, png_write_end,
+    (png_structp png_ptr, png_infop info_ptr));
+
+#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
+/* Read the end of the PNG file. */
+PNG_EXPORT(62, void, png_read_end, (png_structp png_ptr, png_infop info_ptr));
+#endif
+
+/* Free any memory associated with the png_info_struct */
+PNG_EXPORT(63, void, png_destroy_info_struct, (png_structp png_ptr,
+    png_infopp info_ptr_ptr));
+
+/* Free any memory associated with the png_struct and the png_info_structs */
+PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,
+    png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
+
+/* Free any memory associated with the png_struct and the png_info_structs */
+PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,
+    png_infopp info_ptr_ptr));
+
+/* Set the libpng method of handling chunk CRC errors */
+PNG_EXPORT(66, void, png_set_crc_action,
+    (png_structp png_ptr, int crit_action, int ancil_action));
+
+/* Values for png_set_crc_action() say how to handle CRC errors in
+ * ancillary and critical chunks, and whether to use the data contained
+ * therein.  Note that it is impossible to "discard" data in a critical
+ * chunk.  For versions prior to 0.90, the action was always error/quit,
+ * whereas in version 0.90 and later, the action for CRC errors in ancillary
+ * chunks is warn/discard.  These values should NOT be changed.
+ *
+ *      value                       action:critical     action:ancillary
+ */
+#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */
+#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */
+#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */
+#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */
+#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */
+#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */
+
+/* These functions give the user control over the scan-line filtering in
+ * libpng and the compression methods used by zlib.  These functions are
+ * mainly useful for testing, as the defaults should work with most users.
+ * Those users who are tight on memory or want faster performance at the
+ * expense of compression can modify them.  See the compression library
+ * header file (zlib.h) for an explination of the compression functions.
+ */
+
+/* Set the filtering method(s) used by libpng.  Currently, the only valid
+ * value for "method" is 0.
+ */
+PNG_EXPORT(67, void, png_set_filter,
+    (png_structp png_ptr, int method, int filters));
+
+/* Flags for png_set_filter() to say which filters to use.  The flags
+ * are chosen so that they don't conflict with real filter types
+ * below, in case they are supplied instead of the #defined constants.
+ * These values should NOT be changed.
+ */
+#define PNG_NO_FILTERS     0x00
+#define PNG_FILTER_NONE    0x08
+#define PNG_FILTER_SUB     0x10
+#define PNG_FILTER_UP      0x20
+#define PNG_FILTER_AVG     0x40
+#define PNG_FILTER_PAETH   0x80
+#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
+                         PNG_FILTER_AVG | PNG_FILTER_PAETH)
+
+/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
+ * These defines should NOT be changed.
+ */
+#define PNG_FILTER_VALUE_NONE  0
+#define PNG_FILTER_VALUE_SUB   1
+#define PNG_FILTER_VALUE_UP    2
+#define PNG_FILTER_VALUE_AVG   3
+#define PNG_FILTER_VALUE_PAETH 4
+#define PNG_FILTER_VALUE_LAST  5
+
+#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */
+/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_
+ * defines, either the default (minimum-sum-of-absolute-differences), or
+ * the experimental method (weighted-minimum-sum-of-absolute-differences).
+ *
+ * Weights are factors >= 1.0, indicating how important it is to keep the
+ * filter type consistent between rows.  Larger numbers mean the current
+ * filter is that many times as likely to be the same as the "num_weights"
+ * previous filters.  This is cumulative for each previous row with a weight.
+ * There needs to be "num_weights" values in "filter_weights", or it can be
+ * NULL if the weights aren't being specified.  Weights have no influence on
+ * the selection of the first row filter.  Well chosen weights can (in theory)
+ * improve the compression for a given image.
+ *
+ * Costs are factors >= 1.0 indicating the relative decoding costs of a
+ * filter type.  Higher costs indicate more decoding expense, and are
+ * therefore less likely to be selected over a filter with lower computational
+ * costs.  There needs to be a value in "filter_costs" for each valid filter
+ * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't
+ * setting the costs.  Costs try to improve the speed of decompression without
+ * unduly increasing the compressed image size.
+ *
+ * A negative weight or cost indicates the default value is to be used, and
+ * values in the range [0.0, 1.0) indicate the value is to remain unchanged.
+ * The default values for both weights and costs are currently 1.0, but may
+ * change if good general weighting/cost heuristics can be found.  If both
+ * the weights and costs are set to 1.0, this degenerates the WEIGHTED method
+ * to the UNWEIGHTED method, but with added encoding time/computation.
+ */
+PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structp png_ptr,
+    int heuristic_method, int num_weights, png_const_doublep filter_weights,
+    png_const_doublep filter_costs))
+PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
+    (png_structp png_ptr,
+    int heuristic_method, int num_weights, png_const_fixed_point_p
+    filter_weights, png_const_fixed_point_p filter_costs))
+#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
+
+/* Heuristic used for row filter selection.  These defines should NOT be
+ * changed.
+ */
+#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently "UNWEIGHTED" */
+#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */
+#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */
+#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */
+
+#ifdef PNG_WRITE_SUPPORTED
+/* Set the library compression level.  Currently, valid values range from
+ * 0 - 9, corresponding directly to the zlib compression levels 0 - 9
+ * (0 - no compression, 9 - "maximal" compression).  Note that tests have
+ * shown that zlib compression levels 3-6 usually perform as well as level 9
+ * for PNG images, and do considerably fewer caclulations.  In the future,
+ * these values may not correspond directly to the zlib compression levels.
+ */
+PNG_EXPORT(69, void, png_set_compression_level,
+    (png_structp png_ptr, int level));
+
+PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structp png_ptr,
+    int mem_level));
+
+PNG_EXPORT(71, void, png_set_compression_strategy, (png_structp png_ptr,
+    int strategy));
+
+/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
+ * smaller value of window_bits if it can do so safely.
+ */
+PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
+    int window_bits));
+
+PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
+    int method));
+#endif
+
+#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
+/* Also set zlib parameters for compressing non-IDAT chunks */
+PNG_EXPORT(222, void, png_set_text_compression_level,
+    (png_structp png_ptr, int level));
+
+PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structp png_ptr,
+    int mem_level));
+
+PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structp png_ptr,
+    int strategy));
+
+/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
+ * smaller value of window_bits if it can do so safely.
+ */
+PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structp
+    png_ptr, int window_bits));
+
+PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
+    int method));
+#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
+
+/* These next functions are called for input/output, memory, and error
+ * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,
+ * and call standard C I/O routines such as fread(), fwrite(), and
+ * fprintf().  These functions can be made to use other I/O routines
+ * at run time for those applications that need to handle I/O in a
+ * different manner by calling png_set_???_fn().  See libpng-manual.txt for
+ * more information.
+ */
+
+#ifdef PNG_STDIO_SUPPORTED
+/* Initialize the input/output for the PNG file to the default functions. */
+PNG_EXPORT(74, void, png_init_io, (png_structp png_ptr, png_FILE_p fp));
+#endif
+
+/* Replace the (error and abort), and warning functions with user
+ * supplied functions.  If no messages are to be printed you must still
+ * write and use replacement functions. The replacement error_fn should
+ * still do a longjmp to the last setjmp location if you are using this
+ * method of error handling.  If error_fn or warning_fn is NULL, the
+ * default function will be used.
+ */
+
+PNG_EXPORT(75, void, png_set_error_fn,
+    (png_structp png_ptr, png_voidp error_ptr,
+    png_error_ptr error_fn, png_error_ptr warning_fn));
+
+/* Return the user pointer associated with the error functions */
+PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structp png_ptr));
+
+/* Replace the default data output functions with a user supplied one(s).
+ * If buffered output is not used, then output_flush_fn can be set to NULL.
+ * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
+ * output_flush_fn will be ignored (and thus can be NULL).
+ * It is probably a mistake to use NULL for output_flush_fn if
+ * write_data_fn is not also NULL unless you have built libpng with
+ * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's
+ * default flush function, which uses the standard *FILE structure, will
+ * be used.
+ */
+PNG_EXPORT(77, void, png_set_write_fn, (png_structp png_ptr, png_voidp io_ptr,
+    png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
+
+/* Replace the default data input function with a user supplied one. */
+PNG_EXPORT(78, void, png_set_read_fn, (png_structp png_ptr, png_voidp io_ptr,
+    png_rw_ptr read_data_fn));
+
+/* Return the user pointer associated with the I/O functions */
+PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_structp png_ptr));
+
+PNG_EXPORT(80, void, png_set_read_status_fn, (png_structp png_ptr,
+    png_read_status_ptr read_row_fn));
+
+PNG_EXPORT(81, void, png_set_write_status_fn, (png_structp png_ptr,
+    png_write_status_ptr write_row_fn));
+
+#ifdef PNG_USER_MEM_SUPPORTED
+/* Replace the default memory allocation functions with user supplied one(s). */
+PNG_EXPORT(82, void, png_set_mem_fn, (png_structp png_ptr, png_voidp mem_ptr,
+    png_malloc_ptr malloc_fn, png_free_ptr free_fn));
+/* Return the user pointer associated with the memory functions */
+PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structp png_ptr));
+#endif
+
+#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
+PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structp png_ptr,
+    png_user_transform_ptr read_user_transform_fn));
+#endif
+
+#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
+PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structp png_ptr,
+    png_user_transform_ptr write_user_transform_fn));
+#endif
+
+#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
+PNG_EXPORT(86, void, png_set_user_transform_info, (png_structp png_ptr,
+    png_voidp user_transform_ptr, int user_transform_depth,
+    int user_transform_channels));
+/* Return the user pointer associated with the user transform functions */
+PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
+    (png_const_structp png_ptr));
+#endif
+
+#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
+/* Return information about the row currently being processed.  Note that these
+ * APIs do not fail but will return unexpected results if called outside a user
+ * transform callback.  Also note that when transforming an interlaced image the
+ * row number is the row number within the sub-image of the interlace pass, so
+ * the value will increase to the height of the sub-image (not the full image)
+ * then reset to 0 for the next pass.
+ *
+ * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to
+ * find the output pixel (x,y) given an interlaced sub-image pixel
+ * (row,col,pass).  (See below for these macros.)
+ */
+PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structp));
+PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structp));
+#endif
+
+#ifdef PNG_USER_CHUNKS_SUPPORTED
+PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structp png_ptr,
+    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
+PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structp png_ptr));
+#endif
+
+#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
+/* Sets the function callbacks for the push reader, and a pointer to a
+ * user-defined structure available to the callback functions.
+ */
+PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structp png_ptr,
+    png_voidp progressive_ptr, png_progressive_info_ptr info_fn,
+    png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));
+
+/* Returns the user pointer associated with the push read functions */
+PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structp png_ptr));
+
+/* Function to be called when data becomes available */
+PNG_EXPORT(92, void, png_process_data,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_bytep buffer, png_size_t buffer_size));
+
+/* A function which may be called *only* within png_process_data to stop the
+ * processing of any more data.  The function returns the number of bytes
+ * remaining, excluding any that libpng has cached internally.  A subsequent
+ * call to png_process_data must supply these bytes again.  If the argument
+ * 'save' is set to true the routine will first save all the pending data and
+ * will always return 0.
+ */
+PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structp, int save));
+
+/* A function which may be called *only* outside (after) a call to
+ * png_process_data.  It returns the number of bytes of data to skip in the
+ * input.  Normally it will return 0, but if it returns a non-zero value the
+ * application must skip than number of bytes of input data and pass the
+ * following data to the next call to png_process_data.
+ */
+PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structp));
+
+#ifdef PNG_READ_INTERLACING_SUPPORTED
+/* Function that combines rows.  'new_row' is a flag that should come from
+ * the callback and be non-NULL if anything needs to be done; the library
+ * stores its own version of the new data internally and ignores the passed
+ * in value.
+ */
+PNG_EXPORT(93, void, png_progressive_combine_row, (png_structp png_ptr,
+    png_bytep old_row, png_const_bytep new_row));
+#endif /* PNG_READ_INTERLACING_SUPPORTED */
+#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
+
+PNG_EXPORTA(94, png_voidp, png_malloc,
+    (png_structp png_ptr, png_alloc_size_t size),
+    PNG_ALLOCATED);
+/* Added at libpng version 1.4.0 */
+PNG_EXPORTA(95, png_voidp, png_calloc,
+    (png_structp png_ptr, png_alloc_size_t size),
+    PNG_ALLOCATED);
+
+/* Added at libpng version 1.2.4 */
+PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_structp png_ptr,
+    png_alloc_size_t size), PNG_ALLOCATED);
+
+/* Frees a pointer allocated by png_malloc() */
+PNG_EXPORT(97, void, png_free, (png_structp png_ptr, png_voidp ptr));
+
+/* Free data that was allocated internally */
+PNG_EXPORT(98, void, png_free_data,
+    (png_structp png_ptr, png_infop info_ptr, png_uint_32 free_me, int num));
+
+/* Reassign responsibility for freeing existing data, whether allocated
+ * by libpng or by the application */
+PNG_EXPORT(99, void, png_data_freer,
+    (png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask));
+
+/* Assignments for png_data_freer */
+#define PNG_DESTROY_WILL_FREE_DATA 1
+#define PNG_SET_WILL_FREE_DATA 1
+#define PNG_USER_WILL_FREE_DATA 2
+/* Flags for png_ptr->free_me and info_ptr->free_me */
+#define PNG_FREE_HIST 0x0008
+#define PNG_FREE_ICCP 0x0010
+#define PNG_FREE_SPLT 0x0020
+#define PNG_FREE_ROWS 0x0040
+#define PNG_FREE_PCAL 0x0080
+#define PNG_FREE_SCAL 0x0100
+#define PNG_FREE_UNKN 0x0200
+#define PNG_FREE_LIST 0x0400
+#define PNG_FREE_PLTE 0x1000
+#define PNG_FREE_TRNS 0x2000
+#define PNG_FREE_TEXT 0x4000
+#define PNG_FREE_ALL  0x7fff
+#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
+
+#ifdef PNG_USER_MEM_SUPPORTED
+PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_structp png_ptr,
+    png_alloc_size_t size), PNG_ALLOCATED);
+PNG_EXPORT(101, void, png_free_default, (png_structp png_ptr, png_voidp ptr));
+#endif
+
+#ifdef PNG_ERROR_TEXT_SUPPORTED
+/* Fatal error in PNG image of libpng - can't continue */
+PNG_EXPORTA(102, void, png_error,
+    (png_structp png_ptr, png_const_charp error_message),
+    PNG_NORETURN);
+
+/* The same, but the chunk name is prepended to the error string. */
+PNG_EXPORTA(103, void, png_chunk_error, (png_structp png_ptr,
+    png_const_charp error_message), PNG_NORETURN);
+
+#else
+/* Fatal error in PNG image of libpng - can't continue */
+PNG_EXPORTA(104, void, png_err, (png_structp png_ptr), PNG_NORETURN);
+#endif
+
+#ifdef PNG_WARNINGS_SUPPORTED
+/* Non-fatal error in libpng.  Can continue, but may have a problem. */
+PNG_EXPORT(105, void, png_warning, (png_structp png_ptr,
+    png_const_charp warning_message));
+
+/* Non-fatal error in libpng, chunk name is prepended to message. */
+PNG_EXPORT(106, void, png_chunk_warning, (png_structp png_ptr,
+    png_const_charp warning_message));
+#endif
+
+#ifdef PNG_BENIGN_ERRORS_SUPPORTED
+/* Benign error in libpng.  Can continue, but may have a problem.
+ * User can choose whether to handle as a fatal error or as a warning. */
+#  undef png_benign_error
+PNG_EXPORT(107, void, png_benign_error, (png_structp png_ptr,
+    png_const_charp warning_message));
+
+/* Same, chunk name is prepended to message. */
+#  undef png_chunk_benign_error
+PNG_EXPORT(108, void, png_chunk_benign_error, (png_structp png_ptr,
+    png_const_charp warning_message));
+
+PNG_EXPORT(109, void, png_set_benign_errors,
+    (png_structp png_ptr, int allowed));
+#else
+#  ifdef PNG_ALLOW_BENIGN_ERRORS
+#    define png_benign_error png_warning
+#    define png_chunk_benign_error png_chunk_warning
+#  else
+#    define png_benign_error png_error
+#    define png_chunk_benign_error png_chunk_error
+#  endif
+#endif
+
+/* The png_set_<chunk> functions are for storing values in the png_info_struct.
+ * Similarly, the png_get_<chunk> calls are used to read values from the
+ * png_info_struct, either storing the parameters in the passed variables, or
+ * setting pointers into the png_info_struct where the data is stored.  The
+ * png_get_<chunk> functions return a non-zero value if the data was available
+ * in info_ptr, or return zero and do not change any of the parameters if the
+ * data was not available.
+ *
+ * These functions should be used instead of directly accessing png_info
+ * to avoid problems with future changes in the size and internal layout of
+ * png_info_struct.
+ */
+/* Returns "flag" if chunk data is valid in info_ptr. */
+PNG_EXPORT(110, png_uint_32, png_get_valid,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_uint_32 flag));
+
+/* Returns number of bytes needed to hold a transformed row. */
+PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+#ifdef PNG_INFO_IMAGE_SUPPORTED
+/* Returns row_pointers, which is an array of pointers to scanlines that was
+ * returned from png_read_png().
+ */
+PNG_EXPORT(112, png_bytepp, png_get_rows,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+/* Set row_pointers, which is an array of pointers to scanlines for use
+ * by png_write_png().
+ */
+PNG_EXPORT(113, void, png_set_rows, (png_structp png_ptr,
+    png_infop info_ptr, png_bytepp row_pointers));
+#endif
+
+/* Returns number of color channels in image. */
+PNG_EXPORT(114, png_byte, png_get_channels,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+#ifdef PNG_EASY_ACCESS_SUPPORTED
+/* Returns image width in pixels. */
+PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image height in pixels. */
+PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image bit_depth. */
+PNG_EXPORT(117, png_byte, png_get_bit_depth,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+/* Returns image color_type. */
+PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image filter_type. */
+PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image interlace_type. */
+PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image compression_type. */
+PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structp png_ptr,
+    png_const_infop info_ptr));
+
+/* Returns image resolution in pixels per meter, from pHYs chunk data. */
+PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+/* Returns pixel aspect ratio, computed from pHYs chunk data.  */
+PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,
+    (png_const_structp png_ptr, png_const_infop info_ptr))
+PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,
+    (png_const_structp png_ptr, png_const_infop info_ptr))
+
+/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
+PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(128, png_int_32, png_get_x_offset_microns,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(129, png_int_32, png_get_y_offset_microns,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+#endif /* PNG_EASY_ACCESS_SUPPORTED */
+
+/* Returns pointer to signature string read from PNG header */
+PNG_EXPORT(130, png_const_bytep, png_get_signature,
+    (png_const_structp png_ptr, png_infop info_ptr));
+
+#ifdef PNG_bKGD_SUPPORTED
+PNG_EXPORT(131, png_uint_32, png_get_bKGD,
+    (png_const_structp png_ptr, png_infop info_ptr,
+    png_color_16p *background));
+#endif
+
+#ifdef PNG_bKGD_SUPPORTED
+PNG_EXPORT(132, void, png_set_bKGD, (png_structp png_ptr, png_infop info_ptr,
+    png_const_color_16p background));
+#endif
+
+#ifdef PNG_cHRM_SUPPORTED
+PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr,
+   png_const_infop info_ptr, double *white_x, double *white_y, double *red_x,
+    double *red_y, double *green_x, double *green_y, double *blue_x,
+    double *blue_y))
+PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_structp png_ptr,
+    png_const_infop info_ptr, double *red_X, double *red_Y, double *red_Z,
+    double *green_X, double *green_Y, double *green_Z, double *blue_X,
+    double *blue_Y, double *blue_Z))
+#ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */
+PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
+    (png_const_structp png_ptr,
+    png_const_infop info_ptr, png_fixed_point *int_white_x,
+    png_fixed_point *int_white_y, png_fixed_point *int_red_x,
+    png_fixed_point *int_red_y, png_fixed_point *int_green_x,
+    png_fixed_point *int_green_y, png_fixed_point *int_blue_x,
+    png_fixed_point *int_blue_y))
+#endif
+PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
+    (png_structp png_ptr, png_const_infop info_ptr,
+    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
+    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
+    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
+    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
+    png_fixed_point *int_blue_Z))
+#endif
+
+#ifdef PNG_cHRM_SUPPORTED
+PNG_FP_EXPORT(135, void, png_set_cHRM,
+    (png_structp png_ptr, png_infop info_ptr,
+    double white_x, double white_y, double red_x, double red_y, double green_x,
+    double green_y, double blue_x, double blue_y))
+PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_structp png_ptr,
+    png_infop info_ptr, double red_X, double red_Y, double red_Z,
+    double green_X, double green_Y, double green_Z, double blue_X,
+    double blue_Y, double blue_Z))
+PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr,
+    png_infop info_ptr, png_fixed_point int_white_x,
+    png_fixed_point int_white_y, png_fixed_point int_red_x,
+    png_fixed_point int_red_y, png_fixed_point int_green_x,
+    png_fixed_point int_green_y, png_fixed_point int_blue_x,
+    png_fixed_point int_blue_y))
+PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr,
+    png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
+    png_fixed_point int_red_Z, png_fixed_point int_green_X,
+    png_fixed_point int_green_Y, png_fixed_point int_green_Z,
+    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
+    png_fixed_point int_blue_Z))
+#endif
+
+#ifdef PNG_gAMA_SUPPORTED
+PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    double *file_gamma))
+PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_fixed_point *int_file_gamma))
+#endif
+
+#ifdef PNG_gAMA_SUPPORTED
+PNG_FP_EXPORT(139, void, png_set_gAMA, (png_structp png_ptr,
+    png_infop info_ptr, double file_gamma))
+PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_structp png_ptr,
+    png_infop info_ptr, png_fixed_point int_file_gamma))
+#endif
+
+#ifdef PNG_hIST_SUPPORTED
+PNG_EXPORT(141, png_uint_32, png_get_hIST,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_uint_16p *hist));
+#endif
+
+#ifdef PNG_hIST_SUPPORTED
+PNG_EXPORT(142, void, png_set_hIST, (png_structp png_ptr,
+    png_infop info_ptr, png_const_uint_16p hist));
+#endif
+
+PNG_EXPORT(143, png_uint_32, png_get_IHDR,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type,
+    int *interlace_method, int *compression_method, int *filter_method));
+
+PNG_EXPORT(144, void, png_set_IHDR,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
+    int interlace_method, int compression_method, int filter_method));
+
+#ifdef PNG_oFFs_SUPPORTED
+PNG_EXPORT(145, png_uint_32, png_get_oFFs,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type));
+#endif
+
+#ifdef PNG_oFFs_SUPPORTED
+PNG_EXPORT(146, void, png_set_oFFs,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_int_32 offset_x, png_int_32 offset_y, int unit_type));
+#endif
+
+#ifdef PNG_pCAL_SUPPORTED
+PNG_EXPORT(147, png_uint_32, png_get_pCAL,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type,
+    int *nparams,
+    png_charp *units, png_charpp *params));
+#endif
+
+#ifdef PNG_pCAL_SUPPORTED
+PNG_EXPORT(148, void, png_set_pCAL, (png_structp png_ptr,
+    png_infop info_ptr,
+    png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type,
+    int nparams, png_const_charp units, png_charpp params));
+#endif
+
+#ifdef PNG_pHYs_SUPPORTED
+PNG_EXPORT(149, png_uint_32, png_get_pHYs,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+#endif
+
+#ifdef PNG_pHYs_SUPPORTED
+PNG_EXPORT(150, void, png_set_pHYs,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_uint_32 res_x, png_uint_32 res_y, int unit_type));
+#endif
+
+PNG_EXPORT(151, png_uint_32, png_get_PLTE,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_colorp *palette, int *num_palette));
+
+PNG_EXPORT(152, void, png_set_PLTE,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_const_colorp palette, int num_palette));
+
+#ifdef PNG_sBIT_SUPPORTED
+PNG_EXPORT(153, png_uint_32, png_get_sBIT,
+    (png_const_structp png_ptr, png_infop info_ptr,
+    png_color_8p *sig_bit));
+#endif
+
+#ifdef PNG_sBIT_SUPPORTED
+PNG_EXPORT(154, void, png_set_sBIT,
+    (png_structp png_ptr, png_infop info_ptr, png_const_color_8p sig_bit));
+#endif
+
+#ifdef PNG_sRGB_SUPPORTED
+PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structp png_ptr,
+    png_const_infop info_ptr, int *file_srgb_intent));
+#endif
+
+#ifdef PNG_sRGB_SUPPORTED
+PNG_EXPORT(156, void, png_set_sRGB,
+    (png_structp png_ptr, png_infop info_ptr, int srgb_intent));
+PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_structp png_ptr,
+    png_infop info_ptr, int srgb_intent));
+#endif
+
+#ifdef PNG_iCCP_SUPPORTED
+PNG_EXPORT(158, png_uint_32, png_get_iCCP,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_charpp name, int *compression_type, png_bytepp profile,
+    png_uint_32 *proflen));
+#endif
+
+#ifdef PNG_iCCP_SUPPORTED
+PNG_EXPORT(159, void, png_set_iCCP,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_const_charp name, int compression_type, png_const_bytep profile,
+    png_uint_32 proflen));
+#endif
+
+#ifdef PNG_sPLT_SUPPORTED
+PNG_EXPORT(160, png_uint_32, png_get_sPLT,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_sPLT_tpp entries));
+#endif
+
+#ifdef PNG_sPLT_SUPPORTED
+PNG_EXPORT(161, void, png_set_sPLT,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_const_sPLT_tp entries, int nentries));
+#endif
+
+#ifdef PNG_TEXT_SUPPORTED
+/* png_get_text also returns the number of text chunks in *num_text */
+PNG_EXPORT(162, png_uint_32, png_get_text,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    png_textp *text_ptr, int *num_text));
+#endif
+
+/* Note while png_set_text() will accept a structure whose text,
+ * language, and  translated keywords are NULL pointers, the structure
+ * returned by png_get_text will always contain regular
+ * zero-terminated C strings.  They might be empty strings but
+ * they will never be NULL pointers.
+ */
+
+#ifdef PNG_TEXT_SUPPORTED
+PNG_EXPORT(163, void, png_set_text,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_const_textp text_ptr, int num_text));
+#endif
+
+#ifdef PNG_tIME_SUPPORTED
+PNG_EXPORT(164, png_uint_32, png_get_tIME,
+    (png_const_structp png_ptr, png_infop info_ptr, png_timep *mod_time));
+#endif
+
+#ifdef PNG_tIME_SUPPORTED
+PNG_EXPORT(165, void, png_set_tIME,
+    (png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time));
+#endif
+
+#ifdef PNG_tRNS_SUPPORTED
+PNG_EXPORT(166, png_uint_32, png_get_tRNS,
+    (png_const_structp png_ptr, png_infop info_ptr,
+    png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color));
+#endif
+
+#ifdef PNG_tRNS_SUPPORTED
+PNG_EXPORT(167, void, png_set_tRNS,
+    (png_structp png_ptr, png_infop info_ptr,
+    png_const_bytep trans_alpha, int num_trans,
+    png_const_color_16p trans_color));
+#endif
+
+#ifdef PNG_sCAL_SUPPORTED
+PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    int *unit, double *width, double *height))
+#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
+/* NOTE: this API is currently implemented using floating point arithmetic,
+ * consequently it can only be used on systems with floating point support.
+ * In any case the range of values supported by png_fixed_point is small and it
+ * is highly recommended that png_get_sCAL_s be used instead.
+ */
+PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,
+    (png_structp png_ptr, png_const_infop info_ptr, int *unit,
+    png_fixed_point *width,
+    png_fixed_point *height))
+#endif
+PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
+    (png_const_structp png_ptr, png_const_infop info_ptr,
+    int *unit, png_charpp swidth, png_charpp sheight));
+
+PNG_FP_EXPORT(170, void, png_set_sCAL,
+    (png_structp png_ptr, png_infop info_ptr,
+    int unit, double width, double height))
+PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_structp png_ptr,
+   png_infop info_ptr, int unit, png_fixed_point width,
+   png_fixed_point height))
+PNG_EXPORT(171, void, png_set_sCAL_s,
+    (png_structp png_ptr, png_infop info_ptr,
+    int unit, png_const_charp swidth, png_const_charp sheight));
+#endif /* PNG_sCAL_SUPPORTED */
+
+#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
+/* Provide a list of chunks and how they are to be handled, if the built-in
+   handling or default unknown chunk handling is not desired.  Any chunks not
+   listed will be handled in the default manner.  The IHDR and IEND chunks
+   must not be listed.  Because this turns off the default handling for chunks
+   that would otherwise be recognized the behavior of libpng transformations may
+   well become incorrect!
+      keep = 0: PNG_HANDLE_CHUNK_AS_DEFAULT: follow default behavior
+           = 1: PNG_HANDLE_CHUNK_NEVER:      do not keep
+           = 2: PNG_HANDLE_CHUNK_IF_SAFE:    keep only if safe-to-copy
+           = 3: PNG_HANDLE_CHUNK_ALWAYS:     keep even if unsafe-to-copy
+*/
+PNG_EXPORT(172, void, png_set_keep_unknown_chunks,
+    (png_structp png_ptr, int keep,
+    png_const_bytep chunk_list, int num_chunks));
+
+/* The handling code is returned; the result is therefore true (non-zero) if
+ * special handling is required, false for the default handling.
+ */
+PNG_EXPORT(173, int, png_handle_as_unknown, (png_structp png_ptr,
+    png_const_bytep chunk_name));
+#endif
+#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
+PNG_EXPORT(174, void, png_set_unknown_chunks, (png_structp png_ptr,
+    png_infop info_ptr, png_const_unknown_chunkp unknowns,
+    int num_unknowns));
+PNG_EXPORT(175, void, png_set_unknown_chunk_location,
+    (png_structp png_ptr, png_infop info_ptr, int chunk, int location));
+PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structp png_ptr,
+    png_const_infop info_ptr, png_unknown_chunkpp entries));
+#endif
+
+/* Png_free_data() will turn off the "valid" flag for anything it frees.
+ * If you need to turn it off for a chunk that your application has freed,
+ * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
+ */
+PNG_EXPORT(177, void, png_set_invalid,
+    (png_structp png_ptr, png_infop info_ptr, int mask));
+
+#ifdef PNG_INFO_IMAGE_SUPPORTED
+/* The "params" pointer is currently not used and is for future expansion. */
+PNG_EXPORT(178, void, png_read_png, (png_structp png_ptr, png_infop info_ptr,
+    int transforms, png_voidp params));
+PNG_EXPORT(179, void, png_write_png, (png_structp png_ptr, png_infop info_ptr,
+    int transforms, png_voidp params));
+#endif
+
+PNG_EXPORT(180, png_const_charp, png_get_copyright,
+    (png_const_structp png_ptr));
+PNG_EXPORT(181, png_const_charp, png_get_header_ver,
+    (png_const_structp png_ptr));
+PNG_EXPORT(182, png_const_charp, png_get_header_version,
+    (png_const_structp png_ptr));
+PNG_EXPORT(183, png_const_charp, png_get_libpng_ver,
+    (png_const_structp png_ptr));
+
+#ifdef PNG_MNG_FEATURES_SUPPORTED
+PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structp png_ptr,
+    png_uint_32 mng_features_permitted));
+#endif
+
+/* For use in png_set_keep_unknown, added to version 1.2.6 */
+#define PNG_HANDLE_CHUNK_AS_DEFAULT   0
+#define PNG_HANDLE_CHUNK_NEVER        1
+#define PNG_HANDLE_CHUNK_IF_SAFE      2
+#define PNG_HANDLE_CHUNK_ALWAYS       3
+
+/* Strip the prepended error numbers ("#nnn ") from error and warning
+ * messages before passing them to the error or warning handler.
+ */
+#ifdef PNG_ERROR_NUMBERS_SUPPORTED
+PNG_EXPORT(185, void, png_set_strip_error_numbers,
+    (png_structp png_ptr,
+    png_uint_32 strip_mode));
+#endif
+
+/* Added in libpng-1.2.6 */
+#ifdef PNG_SET_USER_LIMITS_SUPPORTED
+PNG_EXPORT(186, void, png_set_user_limits, (png_structp png_ptr,
+    png_uint_32 user_width_max, png_uint_32 user_height_max));
+PNG_EXPORT(187, png_uint_32, png_get_user_width_max,
+    (png_const_structp png_ptr));
+PNG_EXPORT(188, png_uint_32, png_get_user_height_max,
+    (png_const_structp png_ptr));
+/* Added in libpng-1.4.0 */
+PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structp png_ptr,
+    png_uint_32 user_chunk_cache_max));
+PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,
+    (png_const_structp png_ptr));
+/* Added in libpng-1.4.1 */
+PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structp png_ptr,
+    png_alloc_size_t user_chunk_cache_max));
+PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,
+    (png_const_structp png_ptr));
+#endif
+
+#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)
+PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,
+    (png_const_structp png_ptr, png_const_infop info_ptr));
+
+PNG_FP_EXPORT(196, float, png_get_x_offset_inches,
+    (png_const_structp png_ptr, png_const_infop info_ptr))
+#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
+PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,
+    (png_structp png_ptr, png_const_infop info_ptr))
+#endif
+
+PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structp png_ptr,
+    png_const_infop info_ptr))
+#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
+PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
+    (png_structp png_ptr, png_const_infop info_ptr))
+#endif
+
+#  ifdef PNG_pHYs_SUPPORTED
+PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structp png_ptr,
+    png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+    int *unit_type));
+#  endif /* PNG_pHYs_SUPPORTED */
+#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */
+
+/* Added in libpng-1.4.0 */
+#ifdef PNG_IO_STATE_SUPPORTED
+PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_structp png_ptr));
+
+PNG_EXPORTA(200, png_const_bytep, png_get_io_chunk_name,
+    (png_structp png_ptr), PNG_DEPRECATED);
+PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
+    (png_const_structp png_ptr));
+
+/* The flags returned by png_get_io_state() are the following: */
+#  define PNG_IO_NONE        0x0000   /* no I/O at this moment */
+#  define PNG_IO_READING     0x0001   /* currently reading */
+#  define PNG_IO_WRITING     0x0002   /* currently writing */
+#  define PNG_IO_SIGNATURE   0x0010   /* currently at the file signature */
+#  define PNG_IO_CHUNK_HDR   0x0020   /* currently at the chunk header */
+#  define PNG_IO_CHUNK_DATA  0x0040   /* currently at the chunk data */
+#  define PNG_IO_CHUNK_CRC   0x0080   /* currently at the chunk crc */
+#  define PNG_IO_MASK_OP     0x000f   /* current operation: reading/writing */
+#  define PNG_IO_MASK_LOC    0x00f0   /* current location: sig/hdr/data/crc */
+#endif /* ?PNG_IO_STATE_SUPPORTED */
+
+/* Interlace support.  The following macros are always defined so that if
+ * libpng interlace handling is turned off the macros may be used to handle
+ * interlaced images within the application.
+ */
+#define PNG_INTERLACE_ADAM7_PASSES 7
+
+/* Two macros to return the first row and first column of the original,
+ * full, image which appears in a given pass.  'pass' is in the range 0
+ * to 6 and the result is in the range 0 to 7.
+ */
+#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7)
+#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7)
+
+/* A macro to return the offset between pixels in the output row for a pair of
+ * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that
+ * follows.  Note that ROW_OFFSET is the offset from one row to the next whereas
+ * COL_OFFSET is from one column to the next, within a row.
+ */
+#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8)
+#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))
+
+/* Two macros to help evaluate the number of rows or columns in each
+ * pass.  This is expressed as a shift - effectively log2 of the number or
+ * rows or columns in each 8x8 tile of the original image.
+ */
+#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)
+#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)
+
+/* Hence two macros to determine the number of rows or columns in a given
+ * pass of an image given its height or width.  In fact these macros may
+ * return non-zero even though the sub-image is empty, because the other
+ * dimension may be empty for a small image.
+ */
+#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\
+   -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))
+#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\
+   -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))
+
+/* For the reader row callbacks (both progressive and sequential) it is
+ * necessary to find the row in the output image given a row in an interlaced
+ * image, so two more macros:
+ */
+#define PNG_ROW_FROM_PASS_ROW(yIn, pass) \
+   (((yIn)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))
+#define PNG_COL_FROM_PASS_COL(xIn, pass) \
+   (((xIn)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))
+
+/* Two macros which return a boolean (0 or 1) saying whether the given row
+ * or column is in a particular pass.  These use a common utility macro that
+ * returns a mask for a given pass - the offset 'off' selects the row or
+ * column version.  The mask has the appropriate bit set for each column in
+ * the tile.
+ */
+#define PNG_PASS_MASK(pass,off) ( \
+   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \
+   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))
+
+#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \
+   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)
+#define PNG_COL_IN_INTERLACE_PASS(x, pass) \
+   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)
+
+#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
+/* With these routines we avoid an integer divide, which will be slower on
+ * most machines.  However, it does take more operations than the corresponding
+ * divide method, so it may be slower on a few RISC systems.  There are two
+ * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.
+ *
+ * Note that the rounding factors are NOT supposed to be the same!  128 and
+ * 32768 are correct for the NODIV code; 127 and 32767 are correct for the
+ * standard method.
+ *
+ * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]
+ */
+
+ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */
+
+#  define png_composite(composite, fg, alpha, bg)         \
+     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \
+           * (png_uint_16)(alpha)                         \
+           + (png_uint_16)(bg)*(png_uint_16)(255          \
+           - (png_uint_16)(alpha)) + 128);                \
+       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }
+
+#  define png_composite_16(composite, fg, alpha, bg)       \
+     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg)  \
+           * (png_uint_32)(alpha)                          \
+           + (png_uint_32)(bg)*(65535                      \
+           - (png_uint_32)(alpha)) + 32768);               \
+       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
+
+#else  /* Standard method using integer division */
+
+#  define png_composite(composite, fg, alpha, bg)                          \
+     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +  \
+     (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \
+     127) / 255)
+
+#  define png_composite_16(composite, fg, alpha, bg)                         \
+     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
+     (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) +         \
+     32767) / 65535)
+#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
+
+#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
+PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));
+PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));
+PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));
+#endif
+
+PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_structp png_ptr,
+    png_const_bytep buf));
+/* No png_get_int_16 -- may be added if there's a real need for it. */
+
+/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */
+#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
+PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));
+#endif
+#ifdef PNG_SAVE_INT_32_SUPPORTED
+PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));
+#endif
+
+/* Place a 16-bit number into a buffer in PNG byte order.
+ * The parameter is declared unsigned int, not png_uint_16,
+ * just to avoid potential problems on pre-ANSI C compilers.
+ */
+#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
+PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
+/* No png_save_int_16 -- may be added if there's a real need for it. */
+#endif
+
+#ifdef PNG_USE_READ_MACROS
+/* Inline macros to do direct reads of bytes from the input buffer.
+ * The png_get_int_32() routine assumes we are using two's complement
+ * format for negative values, which is almost certainly true.
+ */
+#  define png_get_uint_32(buf) \
+     (((png_uint_32)(*(buf)) << 24) + \
+      ((png_uint_32)(*((buf) + 1)) << 16) + \
+      ((png_uint_32)(*((buf) + 2)) << 8) + \
+      ((png_uint_32)(*((buf) + 3))))
+
+   /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
+    * function) incorrectly returned a value of type png_uint_32.
+    */
+#  define png_get_uint_16(buf) \
+     ((png_uint_16) \
+      (((unsigned int)(*(buf)) << 8) + \
+       ((unsigned int)(*((buf) + 1)))))
+
+#  define png_get_int_32(buf) \
+     ((png_int_32)((*(buf) & 0x80) \
+      ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
+      : (png_int_32)png_get_uint_32(buf)))
+#endif
+
+#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
+    defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
+PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr,
+    int allowed));
+#endif
+
+/* Maintainer: Put new public prototypes here ^, in libpng.3, and project
+ * defs
+ */
+
+/* The last ordinal number (this is the *last* one already used; the next
+ * one to use is one more than this.)  Maintainer, remember to add an entry to
+ * scripts/symbols.def as well.
+ */
+#ifdef PNG_EXPORT_LAST_ORDINAL
+  PNG_EXPORT_LAST_ORDINAL(234);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PNG_VERSION_INFO_ONLY */
+/* Do not put anything past this line */
+#endif /* PNG_H */
diff --git a/misc/winutils/include/pngconf.h b/misc/winutils/include/pngconf.h
new file mode 100644
index 0000000..a364928
--- /dev/null
+++ b/misc/winutils/include/pngconf.h
@@ -0,0 +1,598 @@
+
+/* pngconf.h - machine configurable file for libpng
+ *
+ * libpng version 1.5.13 - September 27, 2012
+ *
+ * Copyright (c) 1998-2012 Glenn Randers-Pehrson
+ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
+ * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
+ *
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ *
+ */
+
+/* Any machine specific code is near the front of this file, so if you
+ * are configuring libpng for a machine, you may want to read the section
+ * starting here down to where it starts to typedef png_color, png_text,
+ * and png_info.
+ */
+
+#ifndef PNGCONF_H
+#define PNGCONF_H
+
+#ifndef PNG_BUILDING_SYMBOL_TABLE
+/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
+ * definition file for  machine specific limits, this may impact the
+ * correctness of the definitions below (see uses of INT_MAX).
+ */
+#  ifndef PNG_NO_LIMITS_H
+#    include <limits.h>
+#  endif
+
+/* For the memory copy APIs (i.e. the standard definitions of these),
+ * because this file defines png_memcpy and so on the base APIs must
+ * be defined here.
+ */
+#  ifdef BSD
+#    include <strings.h>
+#  else
+#    include <string.h>
+#  endif
+
+/* For png_FILE_p - this provides the standard definition of a
+ * FILE
+ */
+#  ifdef PNG_STDIO_SUPPORTED
+#    include <stdio.h>
+#  endif
+#endif
+
+/* This controls optimization of the reading of 16 and 32 bit values
+ * from PNG files.  It can be set on a per-app-file basis - it
+ * just changes whether a macro is used when the function is called.
+ * The library builder sets the default; if read functions are not
+ * built into the library the macro implementation is forced on.
+ */
+#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
+#  define PNG_USE_READ_MACROS
+#endif
+#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
+#  if PNG_DEFAULT_READ_MACROS
+#    define PNG_USE_READ_MACROS
+#  endif
+#endif
+
+/* COMPILER SPECIFIC OPTIONS.
+ *
+ * These options are provided so that a variety of difficult compilers
+ * can be used.  Some are fixed at build time (e.g. PNG_API_RULE
+ * below) but still have compiler specific implementations, others
+ * may be changed on a per-file basis when compiling against libpng.
+ */
+
+/* The PNGARG macro protects us against machines that don't have function
+ * prototypes (ie K&R style headers).  If your compiler does not handle
+ * function prototypes, define this macro and use the included ansi2knr.
+ * I've always been able to use _NO_PROTO as the indicator, but you may
+ * need to drag the empty declaration out in front of here, or change the
+ * ifdef to suit your own needs.
+ */
+#ifndef PNGARG
+
+#  ifdef OF /* zlib prototype munger */
+#    define PNGARG(arglist) OF(arglist)
+#  else
+
+#    ifdef _NO_PROTO
+#      define PNGARG(arglist) ()
+#    else
+#      define PNGARG(arglist) arglist
+#    endif /* _NO_PROTO */
+
+#  endif /* OF */
+
+#endif /* PNGARG */
+
+/* Function calling conventions.
+ * =============================
+ * Normally it is not necessary to specify to the compiler how to call
+ * a function - it just does it - however on x86 systems derived from
+ * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
+ * and some others) there are multiple ways to call a function and the
+ * default can be changed on the compiler command line.  For this reason
+ * libpng specifies the calling convention of every exported function and
+ * every function called via a user supplied function pointer.  This is
+ * done in this file by defining the following macros:
+ *
+ * PNGAPI    Calling convention for exported functions.
+ * PNGCBAPI  Calling convention for user provided (callback) functions.
+ * PNGCAPI   Calling convention used by the ANSI-C library (required
+ *           for longjmp callbacks and sometimes used internally to
+ *           specify the calling convention for zlib).
+ *
+ * These macros should never be overridden.  If it is necessary to
+ * change calling convention in a private build this can be done
+ * by setting PNG_API_RULE (which defaults to 0) to one of the values
+ * below to select the correct 'API' variants.
+ *
+ * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
+ *                This is correct in every known environment.
+ * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
+ *                the 'C' calling convention (from PNGCAPI) for
+ *                callbacks (PNGCBAPI).  This is no longer required
+ *                in any known environment - if it has to be used
+ *                please post an explanation of the problem to the
+ *                libpng mailing list.
+ *
+ * These cases only differ if the operating system does not use the C
+ * calling convention, at present this just means the above cases
+ * (x86 DOS/Windows sytems) and, even then, this does not apply to
+ * Cygwin running on those systems.
+ *
+ * Note that the value must be defined in pnglibconf.h so that what
+ * the application uses to call the library matches the conventions
+ * set when building the library.
+ */
+
+/* Symbol export
+ * =============
+ * When building a shared library it is almost always necessary to tell
+ * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'
+ * is used to mark the symbols.  On some systems these symbols can be
+ * extracted at link time and need no special processing by the compiler,
+ * on other systems the symbols are flagged by the compiler and just
+ * the declaration requires a special tag applied (unfortunately) in a
+ * compiler dependent way.  Some systems can do either.
+ *
+ * A small number of older systems also require a symbol from a DLL to
+ * be flagged to the program that calls it.  This is a problem because
+ * we do not know in the header file included by application code that
+ * the symbol will come from a shared library, as opposed to a statically
+ * linked one.  For this reason the application must tell us by setting
+ * the magic flag PNG_USE_DLL to turn on the special processing before
+ * it includes png.h.
+ *
+ * Four additional macros are used to make this happen:
+ *
+ * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
+ *            the build or imported if PNG_USE_DLL is set - compiler
+ *            and system specific.
+ *
+ * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
+ *                       'type', compiler specific.
+ *
+ * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
+ *                make a symbol exported from the DLL.  Not used in the
+ *                public header files; see pngpriv.h for how it is used
+ *                in the libpng build.
+ *
+ * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
+ *                from a DLL - used to define PNG_IMPEXP when
+ *                PNG_USE_DLL is set.
+ */
+
+/* System specific discovery.
+ * ==========================
+ * This code is used at build time to find PNG_IMPEXP, the API settings
+ * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
+ * import processing is possible.  On Windows/x86 systems it also sets
+ * compiler-specific macros to the values required to change the calling
+ * conventions of the various functions.
+ */
+#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
+      defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
+    ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
+      defined(_M_X64) || defined(_M_IA64) )
+  /* Windows system (DOS doesn't support DLLs) running on x86/x64.  Includes
+   * builds under Cygwin or MinGW.  Also includes Watcom builds but these need
+   * special treatment because they are not compatible with GCC or Visual C
+   * because of different calling conventions.
+   */
+#  if PNG_API_RULE == 2
+    /* If this line results in an error, either because __watcall is not
+     * understood or because of a redefine just below you cannot use *this*
+     * build of the library with the compiler you are using.  *This* build was
+     * build using Watcom and applications must also be built using Watcom!
+     */
+#    define PNGCAPI __watcall
+#  endif
+
+#  if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
+#    define PNGCAPI __cdecl
+#    if PNG_API_RULE == 1
+#      define PNGAPI __stdcall
+#    endif
+#  else
+    /* An older compiler, or one not detected (erroneously) above,
+     * if necessary override on the command line to get the correct
+     * variants for the compiler.
+     */
+#    ifndef PNGCAPI
+#      define PNGCAPI _cdecl
+#    endif
+#    if PNG_API_RULE == 1 && !defined(PNGAPI)
+#      define PNGAPI _stdcall
+#    endif
+#  endif /* compiler/api */
+  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
+
+#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
+   ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
+#  endif
+
+#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\
+      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
+    /* older Borland and MSC
+     * compilers used '__export' and required this to be after
+     * the type.
+     */
+#    ifndef PNG_EXPORT_TYPE
+#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
+#    endif
+#    define PNG_DLL_EXPORT __export
+#  else /* newer compiler */
+#    define PNG_DLL_EXPORT __declspec(dllexport)
+#    ifndef PNG_DLL_IMPORT
+#      define PNG_DLL_IMPORT __declspec(dllimport)
+#    endif
+#  endif /* compiler */
+
+#else /* !Windows/x86 */
+#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
+#    define PNGAPI _System
+#  else /* !Windows/x86 && !OS/2 */
+    /* Use the defaults, or define PNG*API on the command line (but
+     * this will have to be done for every compile!)
+     */
+#  endif /* other system, !OS/2 */
+#endif /* !Windows/x86 */
+
+/* Now do all the defaulting . */
+#ifndef PNGCAPI
+#  define PNGCAPI
+#endif
+#ifndef PNGCBAPI
+#  define PNGCBAPI PNGCAPI
+#endif
+#ifndef PNGAPI
+#  define PNGAPI PNGCAPI
+#endif
+
+/* PNG_IMPEXP may be set on the compilation system command line or (if not set)
+ * then in an internal header file when building the library, otherwise (when
+ * using the library) it is set here.
+ */
+#ifndef PNG_IMPEXP
+#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
+     /* This forces use of a DLL, disallowing static linking */
+#    define PNG_IMPEXP PNG_DLL_IMPORT
+#  endif
+
+#  ifndef PNG_IMPEXP
+#    define PNG_IMPEXP
+#  endif
+#endif
+
+/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
+ * 'attributes' as a storage class - the attributes go at the start of the
+ * function definition, and attributes are always appended regardless of the
+ * compiler.  This considerably simplifies these macros but may cause problems
+ * if any compilers both need function attributes and fail to handle them as
+ * a storage class (this is unlikely.)
+ */
+#ifndef PNG_FUNCTION
+#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args
+#endif
+
+#ifndef PNG_EXPORT_TYPE
+#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
+#endif
+
+   /* The ordinal value is only relevant when preprocessing png.h for symbol
+    * table entries, so we discard it here.  See the .dfn files in the
+    * scripts directory.
+    */
+#ifndef PNG_EXPORTA
+
+#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\
+      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
+        extern attributes)
+#endif
+
+/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
+ * so make something non-empty to satisfy the requirement:
+ */
+#define PNG_EMPTY /*empty list*/
+
+#define PNG_EXPORT(ordinal, type, name, args)\
+   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
+
+/* Use PNG_REMOVED to comment out a removed interface. */
+#ifndef PNG_REMOVED
+#  define PNG_REMOVED(ordinal, type, name, args, attributes)
+#endif
+
+#ifndef PNG_CALLBACK
+#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
+#endif
+
+/* Support for compiler specific function attributes.  These are used
+ * so that where compiler support is available incorrect use of API
+ * functions in png.h will generate compiler warnings.
+ *
+ * Added at libpng-1.2.41.
+ */
+
+#ifndef PNG_NO_PEDANTIC_WARNINGS
+#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
+#    define PNG_PEDANTIC_WARNINGS_SUPPORTED
+#  endif
+#endif
+
+#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
+  /* Support for compiler specific function attributes.  These are used
+   * so that where compiler support is available incorrect use of API
+   * functions in png.h will generate compiler warnings.  Added at libpng
+   * version 1.2.41.
+   */
+#  if defined(__GNUC__)
+#    ifndef PNG_USE_RESULT
+#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))
+#    endif
+#    ifndef PNG_NORETURN
+#      define PNG_NORETURN   __attribute__((__noreturn__))
+#    endif
+#    if __GNUC__ >= 3
+#      ifndef PNG_ALLOCATED
+#        define PNG_ALLOCATED  __attribute__((__malloc__))
+#      endif
+#      ifndef PNG_DEPRECATED
+#        define PNG_DEPRECATED __attribute__((__deprecated__))
+#      endif
+#      ifndef PNG_PRIVATE
+#        if 0 /* Doesn't work so we use deprecated instead*/
+#          define PNG_PRIVATE \
+            __attribute__((warning("This function is not exported by libpng.")))
+#        else
+#          define PNG_PRIVATE \
+            __attribute__((__deprecated__))
+#        endif
+#      endif
+#    endif /*  __GNUC__ >= 3 */
+#  endif /* __GNUC__ */
+
+#  if defined(_MSC_VER)  && (_MSC_VER >= 1300)
+#    ifndef PNG_USE_RESULT
+#      define PNG_USE_RESULT /* not supported */
+#    endif
+#    ifndef PNG_NORETURN
+#      define PNG_NORETURN __declspec(noreturn)
+#    endif
+#    ifndef PNG_ALLOCATED
+#      if (_MSC_VER >= 1400)
+#        define PNG_ALLOCATED __declspec(restrict)
+#      endif
+#    endif
+#    ifndef PNG_DEPRECATED
+#      define PNG_DEPRECATED __declspec(deprecated)
+#    endif
+#    ifndef PNG_PRIVATE
+#      define PNG_PRIVATE __declspec(deprecated)
+#    endif
+#  endif /* _MSC_VER */
+#endif /* PNG_PEDANTIC_WARNINGS */
+
+#ifndef PNG_DEPRECATED
+#  define PNG_DEPRECATED  /* Use of this function is deprecated */
+#endif
+#ifndef PNG_USE_RESULT
+#  define PNG_USE_RESULT  /* The result of this function must be checked */
+#endif
+#ifndef PNG_NORETURN
+#  define PNG_NORETURN    /* This function does not return */
+#endif
+#ifndef PNG_ALLOCATED
+#  define PNG_ALLOCATED   /* The result of the function is new memory */
+#endif
+#ifndef PNG_PRIVATE
+#  define PNG_PRIVATE     /* This is a private libpng function */
+#endif
+#ifndef PNG_FP_EXPORT     /* A floating point API. */
+#  ifdef PNG_FLOATING_POINT_SUPPORTED
+#     define PNG_FP_EXPORT(ordinal, type, name, args)\
+         PNG_EXPORT(ordinal, type, name, args);
+#  else                   /* No floating point APIs */
+#     define PNG_FP_EXPORT(ordinal, type, name, args)
+#  endif
+#endif
+#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */
+#  ifdef PNG_FIXED_POINT_SUPPORTED
+#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\
+         PNG_EXPORT(ordinal, type, name, args);
+#  else                   /* No fixed point APIs */
+#     define PNG_FIXED_EXPORT(ordinal, type, name, args)
+#  endif
+#endif
+
+/* The following uses const char * instead of char * for error
+ * and warning message functions, so some compilers won't complain.
+ * If you do not want to use const, define PNG_NO_CONST here.
+ *
+ * This should not change how the APIs are called, so it can be done
+ * on a per-file basis in the application.
+ */
+#ifndef PNG_CONST
+#  ifndef PNG_NO_CONST
+#    define PNG_CONST const
+#  else
+#    define PNG_CONST
+#  endif
+#endif
+
+/* Some typedefs to get us started.  These should be safe on most of the
+ * common platforms.  The typedefs should be at least as large as the
+ * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
+ * don't have to be exactly that size.  Some compilers dislike passing
+ * unsigned shorts as function parameters, so you may be better off using
+ * unsigned int for png_uint_16.
+ */
+
+#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
+typedef unsigned int png_uint_32;
+typedef int png_int_32;
+#else
+typedef unsigned long png_uint_32;
+typedef long png_int_32;
+#endif
+typedef unsigned short png_uint_16;
+typedef short png_int_16;
+typedef unsigned char png_byte;
+
+#ifdef PNG_NO_SIZE_T
+typedef unsigned int png_size_t;
+#else
+typedef size_t png_size_t;
+#endif
+#define png_sizeof(x) (sizeof (x))
+
+/* The following is needed for medium model support.  It cannot be in the
+ * pngpriv.h header.  Needs modification for other compilers besides
+ * MSC.  Model independent support declares all arrays and pointers to be
+ * large using the far keyword.  The zlib version used must also support
+ * model independent data.  As of version zlib 1.0.4, the necessary changes
+ * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
+ * changes that are needed. (Tim Wegner)
+ */
+
+/* Separate compiler dependencies (problem here is that zlib.h always
+ * defines FAR. (SJT)
+ */
+#ifdef __BORLANDC__
+#  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
+#    define LDATA 1
+#  else
+#    define LDATA 0
+#  endif
+  /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
+#  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
+#    define PNG_MAX_MALLOC_64K /* only used in build */
+#    if (LDATA != 1)
+#      ifndef FAR
+#        define FAR __far
+#      endif
+#      define USE_FAR_KEYWORD
+#    endif   /* LDATA != 1 */
+         /* Possibly useful for moving data out of default segment.
+          * Uncomment it if you want. Could also define FARDATA as
+          * const if your compiler supports it. (SJT)
+#        define FARDATA FAR
+          */
+#  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
+#endif   /* __BORLANDC__ */
+
+
+/* Suggest testing for specific compiler first before testing for
+ * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
+ * making reliance oncertain keywords suspect. (SJT)
+ */
+
+/* MSC Medium model */
+#ifdef FAR
+#  ifdef M_I86MM
+#    define USE_FAR_KEYWORD
+#    define FARDATA FAR
+#    include <dos.h>
+#  endif
+#endif
+
+/* SJT: default case */
+#ifndef FAR
+#  define FAR
+#endif
+
+/* At this point FAR is always defined */
+#ifndef FARDATA
+#  define FARDATA
+#endif
+
+/* Typedef for floating-point numbers that are converted
+ * to fixed-point with a multiple of 100,000, e.g., gamma
+ */
+typedef png_int_32 png_fixed_point;
+
+/* Add typedefs for pointers */
+typedef void                      FAR * png_voidp;
+typedef PNG_CONST void            FAR * png_const_voidp;
+typedef png_byte                  FAR * png_bytep;
+typedef PNG_CONST png_byte        FAR * png_const_bytep;
+typedef png_uint_32               FAR * png_uint_32p;
+typedef PNG_CONST png_uint_32     FAR * png_const_uint_32p;
+typedef png_int_32                FAR * png_int_32p;
+typedef PNG_CONST png_int_32      FAR * png_const_int_32p;
+typedef png_uint_16               FAR * png_uint_16p;
+typedef PNG_CONST png_uint_16     FAR * png_const_uint_16p;
+typedef png_int_16                FAR * png_int_16p;
+typedef PNG_CONST png_int_16      FAR * png_const_int_16p;
+typedef char                      FAR * png_charp;
+typedef PNG_CONST char            FAR * png_const_charp;
+typedef png_fixed_point           FAR * png_fixed_point_p;
+typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
+typedef png_size_t                FAR * png_size_tp;
+typedef PNG_CONST png_size_t      FAR * png_const_size_tp;
+
+#ifdef PNG_STDIO_SUPPORTED
+typedef FILE            * png_FILE_p;
+#endif
+
+#ifdef PNG_FLOATING_POINT_SUPPORTED
+typedef double           FAR * png_doublep;
+typedef PNG_CONST double FAR * png_const_doublep;
+#endif
+
+/* Pointers to pointers; i.e. arrays */
+typedef png_byte        FAR * FAR * png_bytepp;
+typedef png_uint_32     FAR * FAR * png_uint_32pp;
+typedef png_int_32      FAR * FAR * png_int_32pp;
+typedef png_uint_16     FAR * FAR * png_uint_16pp;
+typedef png_int_16      FAR * FAR * png_int_16pp;
+typedef PNG_CONST char  FAR * FAR * png_const_charpp;
+typedef char            FAR * FAR * png_charpp;
+typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
+#ifdef PNG_FLOATING_POINT_SUPPORTED
+typedef double          FAR * FAR * png_doublepp;
+#endif
+
+/* Pointers to pointers to pointers; i.e., pointer to array */
+typedef char            FAR * FAR * FAR * png_charppp;
+
+/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
+ * and no smaller than png_uint_32.  Casts from png_size_t or png_uint_32
+ * to png_alloc_size_t are not necessary; in fact, it is recommended
+ * not to use them at all so that the compiler can complain when something
+ * turns out to be problematic.
+ * Casts in the other direction (from png_alloc_size_t to png_size_t or
+ * png_uint_32) should be explicitly applied; however, we do not expect
+ * to encounter practical situations that require such conversions.
+ */
+#if defined(__TURBOC__) && !defined(__FLAT__)
+   typedef unsigned long png_alloc_size_t;
+#else
+#  if defined(_MSC_VER) && defined(MAXSEG_64K)
+     typedef unsigned long    png_alloc_size_t;
+#  else
+     /* This is an attempt to detect an old Windows system where (int) is
+      * actually 16 bits, in that case png_malloc must have an argument with a
+      * bigger size to accomodate the requirements of the library.
+      */
+#    if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
+        (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
+       typedef DWORD         png_alloc_size_t;
+#    else
+       typedef png_size_t    png_alloc_size_t;
+#    endif
+#  endif
+#endif
+
+#endif /* PNGCONF_H */
diff --git a/misc/winutils/include/zconf.h b/misc/winutils/include/zconf.h
new file mode 100644
index 0000000..02ce56c
--- /dev/null
+++ b/misc/winutils/include/zconf.h
@@ -0,0 +1,428 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2010 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+#  define _dist_code            z__dist_code
+#  define _length_code          z__length_code
+#  define _tr_align             z__tr_align
+#  define _tr_flush_block       z__tr_flush_block
+#  define _tr_init              z__tr_init
+#  define _tr_stored_block      z__tr_stored_block
+#  define _tr_tally             z__tr_tally
+#  define adler32               z_adler32
+#  define adler32_combine       z_adler32_combine
+#  define adler32_combine64     z_adler32_combine64
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define crc32                 z_crc32
+#  define crc32_combine         z_crc32_combine
+#  define crc32_combine64       z_crc32_combine64
+#  define deflate               z_deflate
+#  define deflateBound          z_deflateBound
+#  define deflateCopy           z_deflateCopy
+#  define deflateEnd            z_deflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateInit_          z_deflateInit_
+#  define deflateParams         z_deflateParams
+#  define deflatePrime          z_deflatePrime
+#  define deflateReset          z_deflateReset
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateSetHeader      z_deflateSetHeader
+#  define deflateTune           z_deflateTune
+#  define deflate_copyright     z_deflate_copyright
+#  define get_crc_table         z_get_crc_table
+#  define gz_error              z_gz_error
+#  define gz_intmax             z_gz_intmax
+#  define gz_strwinerror        z_gz_strwinerror
+#  define gzbuffer              z_gzbuffer
+#  define gzclearerr            z_gzclearerr
+#  define gzclose               z_gzclose
+#  define gzclose_r             z_gzclose_r
+#  define gzclose_w             z_gzclose_w
+#  define gzdirect              z_gzdirect
+#  define gzdopen               z_gzdopen
+#  define gzeof                 z_gzeof
+#  define gzerror               z_gzerror
+#  define gzflush               z_gzflush
+#  define gzgetc                z_gzgetc
+#  define gzgets                z_gzgets
+#  define gzoffset              z_gzoffset
+#  define gzoffset64            z_gzoffset64
+#  define gzopen                z_gzopen
+#  define gzopen64              z_gzopen64
+#  define gzprintf              z_gzprintf
+#  define gzputc                z_gzputc
+#  define gzputs                z_gzputs
+#  define gzread                z_gzread
+#  define gzrewind              z_gzrewind
+#  define gzseek                z_gzseek
+#  define gzseek64              z_gzseek64
+#  define gzsetparams           z_gzsetparams
+#  define gztell                z_gztell
+#  define gztell64              z_gztell64
+#  define gzungetc              z_gzungetc
+#  define gzwrite               z_gzwrite
+#  define inflate               z_inflate
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define inflateBackInit_      z_inflateBackInit_
+#  define inflateCopy           z_inflateCopy
+#  define inflateEnd            z_inflateEnd
+#  define inflateGetHeader      z_inflateGetHeader
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateInit_          z_inflateInit_
+#  define inflateMark           z_inflateMark
+#  define inflatePrime          z_inflatePrime
+#  define inflateReset          z_inflateReset
+#  define inflateReset2         z_inflateReset2
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateUndermine      z_inflateUndermine
+#  define inflate_copyright     z_inflate_copyright
+#  define inflate_fast          z_inflate_fast
+#  define inflate_table         z_inflate_table
+#  define uncompress            z_uncompress
+#  define zError                z_zError
+#  define zcalloc               z_zcalloc
+#  define zcfree                z_zcfree
+#  define zlibCompileFlags      z_zlibCompileFlags
+#  define zlibVersion           z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#  define Byte                  z_Byte
+#  define Bytef                 z_Bytef
+#  define alloc_func            z_alloc_func
+#  define charf                 z_charf
+#  define free_func             z_free_func
+#  define gzFile                z_gzFile
+#  define gz_header             z_gz_header
+#  define gz_headerp            z_gz_headerp
+#  define in_func               z_in_func
+#  define intf                  z_intf
+#  define out_func              z_out_func
+#  define uInt                  z_uInt
+#  define uIntf                 z_uIntf
+#  define uLong                 z_uLong
+#  define uLongf                z_uLongf
+#  define voidp                 z_voidp
+#  define voidpc                z_voidpc
+#  define voidpf                z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#  define gz_header_s           z_gz_header_s
+#  define internal_state        z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
+#  define Z_HAVE_UNISTD_H
+#endif
+
+#ifdef STDC
+#  include <sys/types.h>    /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#  include <unistd.h>       /* for SEEK_* and off_t */
+#  ifdef VMS
+#    include <unixio.h>     /* for off_t */
+#  endif
+#  ifndef z_off_t
+#    define z_off_t off_t
+#  endif
+#endif
+
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#  define z_off64_t off64_t
+#else
+#  define z_off64_t z_off_t
+#endif
+
+#if defined(__OS400__)
+#  define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+#  define NO_vsnprintf
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+  #pragma map(deflateInit_,"DEIN")
+  #pragma map(deflateInit2_,"DEIN2")
+  #pragma map(deflateEnd,"DEEND")
+  #pragma map(deflateBound,"DEBND")
+  #pragma map(inflateInit_,"ININ")
+  #pragma map(inflateInit2_,"ININ2")
+  #pragma map(inflateEnd,"INEND")
+  #pragma map(inflateSync,"INSY")
+  #pragma map(inflateSetDictionary,"INSEDI")
+  #pragma map(compressBound,"CMBND")
+  #pragma map(inflate_table,"INTABL")
+  #pragma map(inflate_fast,"INFA")
+  #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/misc/winutils/include/zlib.h b/misc/winutils/include/zlib.h
new file mode 100644
index 0000000..bfbba83
--- /dev/null
+++ b/misc/winutils/include/zlib.h
@@ -0,0 +1,1613 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.5, April 19th, 2010
+
+  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+
+  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.
+
+  Jean-loup Gailly        Mark Adler
+  jloup at gzip.org          madler at alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.5"
+#define ZLIB_VERNUM 0x1250
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 5
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+    The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed data.
+  This version of the library supports only one compression method (deflation)
+  but other algorithms will be added later and will have the same stream
+  interface.
+
+    Compression can be done in a single step if the buffers are large enough,
+  or can be done by repeated calls of the compression function.  In the latter
+  case, the application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+    The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+    The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+    This library can optionally read and write gzip streams in memory as well.
+
+    The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+    The library does not install any signal handler.  The decoder checks
+  the consistency of the compressed data, so the library should never crash
+  even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    Bytef    *next_in;  /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total nb of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total nb of bytes output so far */
+
+    char     *msg;      /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+     The application must update next_in and avail_in when avail_in has dropped
+   to zero.  It must update next_out and avail_out when avail_out has dropped
+   to zero.  The application must initialize zalloc, zfree and opaque before
+   calling the init function.  All other fields are set by the compression
+   library and must not be updated by the application.
+
+     The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree.  This can be useful for custom
+   memory management.  The compression library attaches no meaning to the
+   opaque value.
+
+     zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+     On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this if
+   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
+   returned by zalloc for objects of exactly 65536 bytes *must* have their
+   offset normalized to zero.  The default allocation function provided by this
+   library ensures this (see zutil.c).  To reduce memory requirements and avoid
+   any allocation of 64K objects, at the expense of compression ratio, compile
+   the library with -DMAX_WBITS=14 (see zconf.h).
+
+     The fields total_in and total_out can be used for statistics or progress
+   reports.  After compression, total_in holds the total size of the
+   uncompressed data and may be saved for use in the decompressor (particularly
+   if the decompressor wants to decompress everything in a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+#define Z_TREES         6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is not
+   compatible with the zlib.h header file used by the application.  This check
+   is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression.  The fields
+   zalloc, zfree and opaque must be initialized before by the caller.  If
+   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+   allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at all
+   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
+   requests a default compromise between speed and compression (currently
+   equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if level is not a valid compression level, or
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
+   if there is no error message.  deflateInit does not perform any compression:
+   this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows.  deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).  Some
+    output may be provided even if flush is not set.
+
+    Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating avail_in or avail_out accordingly; avail_out should
+  never be zero before the call.  The application can consume the compressed
+  output when it wants, for example when the output buffer is full (avail_out
+  == 0), or after each call of deflate().  If deflate returns Z_OK and with
+  zero avail_out, it must be called again after making room in the output
+  buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumulate before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far.  (In
+  particular avail_in is zero after the call if enough output space has been
+  provided before the call.) Flushing may degrade compression for some
+  compression algorithms and so it should be used only when necessary.  This
+  completes the current deflate block and follows it with an empty stored block
+  that is three bits plus filler bits to the next byte, followed by four bytes
+  (00 00 ff ff).
+
+    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+  output buffer, but the output is not aligned to a byte boundary.  All of the
+  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+  This completes the current deflate block and follows it with an empty fixed
+  codes block that is 10 bits long.  This assures that enough bytes are output
+  in order for the decompressor to finish the block before the empty fixed code
+  block.
+
+    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+  seven bits of the current block are held to be written as the next byte after
+  the next deflate block is completed.  In this case, the decompressor may not
+  be provided enough bits at this point in order to complete decompression of
+  the data provided so far to the compressor.  It may need to wait for the next
+  block to be emitted.  This is for advanced applications that need to control
+  the emission of deflate blocks.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there was
+  enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error.  After
+  deflate has returned Z_STREAM_END, the only possible operations on the stream
+  are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step.  In this case, avail_out must be at least the
+  value returned by deflateBound (see below).  If deflate does not return
+  Z_STREAM_END, then it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
+  binary.  This field is only for information purposes and does not affect the
+  compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded).  In the error case, msg
+   may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression.  The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
+   exact value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit() does not process any header information -- that is deferred
+   until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows.  inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing will
+    resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there is
+    no more input data or no more space in the output buffer (see below about
+    the flush parameter).
+
+    Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating the next_* and avail_* values accordingly.  The
+  application can consume the uncompressed output when it wants, for example
+  when the output buffer is full (avail_out == 0), or after each call of
+  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
+  called again after making room in the output buffer because there might be
+  more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer.  Z_BLOCK requests that inflate()
+  stop if and when it gets to the next deflate block boundary.  When decoding
+  the zlib or gzip format, this will cause inflate() to return immediately
+  after the header and before the first block.  When doing a raw inflate,
+  inflate() will go ahead and process the first block, and will return when it
+  gets to the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  inflate() is currently decoding the last block in the deflate stream, plus
+  128 if inflate() returned immediately after decoding an end-of-block code or
+  decoding the complete header up to just before the first byte of the deflate
+  stream.  The end-of-block will not be indicated until all of the uncompressed
+  data from that block has been written to strm->next_out.  The number of
+  unused bits may in general be greater than seven, except when bit 7 of
+  data_type is set, in which case the number of unused bits will be less than
+  eight.  data_type is set as noted here every time inflate() returns for all
+  flush options, and so can be used to determine the amount of currently
+  consumed input in bits.
+
+    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+  end of each deflate block header is reached, before any actual data in that
+  block is decoded.  This allows the caller to determine the length of the
+  deflate block header for later use in random access within a deflate block.
+  256 is added to the value of strm->data_type when inflate() returns
+  immediately after reaching the end of the deflate block header.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error.  However if all decompression is to be performed in a single step (a
+  single call of inflate), the parameter flush should be set to Z_FINISH.  In
+  this case all pending input is processed and all pending output is flushed;
+  avail_out must be large enough to hold all the uncompressed data.  (The size
+  of the uncompressed data may have been saved by the compressor for this
+  purpose.) The next operation on this stream must be inflateEnd to deallocate
+  the decompression state.  The use of Z_FINISH is never required, but can be
+  used to inform inflate that a faster approach may be used for the single
+  inflate() call.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call.  So the only effect of the flush parameter in this implementation
+  is on the return value of inflate(), as noted below, or when it returns early
+  because Z_BLOCK or Z_TREES is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the adler32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below.  At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically, if requested when
+  initializing with inflateInit2().  Any information contained in the gzip
+  header is not retained, so applications that need that information should
+  instead use raw inflate, see inflateInit2() below, or inflateBack() and
+  perform their own processing of the gzip header and trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing.  If Z_DATA_ERROR is returned, the application may
+  then call inflateSync() to look for a good compression block if a partial
+  recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent.  In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options.  The
+   fields next_in, zalloc, zfree and opaque must be initialized before by the
+   caller.
+
+     The method parameter is the compression method.  It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer).  It should be in the range 8..15 for this
+   version of the library.  Larger values of this parameter result in better
+   compression at the expense of memory usage.  The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
+   determines the window size.  deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding.  Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper.  The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero), no
+   header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state.  memLevel=1 uses minimum memory but is
+   slow and reduces compression ratio; memLevel=9 uses maximum memory for
+   optimal speed.  The default value is 8.  See zconf.h for total memory usage
+   as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm.  Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding).  Filtered data consists mostly of small values with a somewhat
+   random distribution.  In this case, the compression algorithm is tuned to
+   compress them better.  The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
+   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
+   strategy parameter only affects the compression ratio but not the
+   correctness of the compressed output even if it is not set appropriately.
+   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+   decoder for special applications.
+
+     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
+   set to null if there is no error message.  deflateInit2 does not perform any
+   compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output.  This function must be called
+   immediately after deflateInit, deflateInit2 or deflateReset, before any call
+   of deflate.  The compressor and decompressor must use exactly the same
+   dictionary (see inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary.  Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size
+   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
+   useful should be put at the end of the dictionary, not at the front.  In
+   addition, the current implementation of deflate will use at most the window
+   size minus 262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor.  (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if the compression method is bsort).  deflateSetDictionary does not
+   perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter.  The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and can
+   consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.  The
+   stream will keep the same compression level and any other attributes that
+   may have been set by deflateInit2.
+
+     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different strategy.
+   If the compression level is changed, the input available so far is
+   compressed with the old level (and may be flushed); the new level will take
+   effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to be
+   compressed and flushed.  In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+   strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+   is that this function is used to start off the deflate output with the bits
+   leftover from a previous deflate stream when appending to it.  As such, this
+   function can only be used for raw deflate, and must be used before the first
+   deflate() call after a deflateInit2() or deflateReset().  bits must be less
+   than or equal to 16, and that many of the least significant bits of value
+   will be inserted in the output.
+
+     deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+     If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter.  The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library.  The default value is 15 if inflateInit is used
+   instead.  windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used.  If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be zero to request that inflate use the window size in
+   the zlib header of the compressed stream.
+
+     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
+   determines the window size.  inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream.  This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values.  If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is.  Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding.  Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
+   crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit2() does not process any header information -- that is
+   deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence.  This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called
+   immediately after inflateInit2() or inflateReset() and before any call of
+   inflate() to set the dictionary.  The application must insure that the
+   dictionary that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value).  inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+     Skips invalid compressed data until a full flush point (see above the
+   description of deflate with Z_FULL_FLUSH) can be found, or until all
+   available input is skipped.  No output is provided.
+
+     inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+   if no more input was provided, Z_DATA_ERROR if no flush point has been
+   found, or Z_STREAM_ERROR if the stream structure was inconsistent.  In the
+   success case, the application may save the current current value of total_in
+   which indicates where valid compressed data was found.  In the error case,
+   the application may repeatedly call inflateSync, providing more input each
+   time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.  The
+   stream will keep attributes that may have been set by inflateInit2.
+
+     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+                                      int windowBits));
+/*
+     This function is the same as inflateReset, but it also permits changing
+   the wrap and window size requests.  The windowBits parameter is interpreted
+   the same as it is for inflateInit2.
+
+     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+   the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+   that this function is used to start inflating at a bit position in the
+   middle of a byte.  The provided bits will be used before any bytes are used
+   from next_in.  This function should only be used with raw inflate, and
+   should be used before the first inflate() call after inflateInit2() or
+   inflateReset().  bits must be less than or equal to 16, and that many of the
+   least significant bits of value will be inserted in the input.
+
+     If bits is negative, then the input stream bit buffer is emptied.  Then
+   inflatePrime() can be called again to put bits in the buffer.  This is used
+   to clear out bits leftover after feeding inflate a block description prior
+   to feeding inflate codes.
+
+     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+     This function returns two values, one in the lower 16 bits of the return
+   value, and the other in the remaining upper bits, obtained by shifting the
+   return value down 16 bits.  If the upper value is -1 and the lower value is
+   zero, then inflate() is currently decoding information outside of a block.
+   If the upper value is -1 and the lower value is non-zero, then inflate is in
+   the middle of a stored block, with the lower value equaling the number of
+   bytes from the input remaining to copy.  If the upper value is not -1, then
+   it is the number of bits back from the current bit position in the input of
+   the code (literal or length/distance pair) currently being processed.  In
+   that case the lower value is the number of bytes already emitted for that
+   code.
+
+     A code is being processed if inflate is waiting for more input to complete
+   decoding of the code, or if it has completed decoding but is waiting for
+   more output space to write the literal or match data.
+
+     inflateMark() is used to mark locations in the input data for random
+   access, which may be at bit positions, and to note those cases where the
+   output of a code may span boundaries of random access blocks.  The current
+   location in the input stream can be determined from avail_in and data_type
+   as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+     inflateMark returns the value noted above or -1 << 16 if the provided
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
+   used to force inflate() to return immediately after header processing is
+   complete and before any actual data is decompressed.
+
+     The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When any
+   of extra, name, or comment are not Z_NULL and the respective field is not
+   present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+     If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
+   allocated, or Z_VERSION_ERROR if the version of the library does not match
+   the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free the
+   allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects only
+   the raw deflate stream to decompress.  This is different from the normal
+   behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+   in the deflate stream (in which case strm->msg is set to indicate the nature
+   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+   In the case of Z_BUF_ERROR, an input or output error can be distinguished
+   using strm->next_in which will be Z_NULL only if in() returned an error.  If
+   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+   non-zero.  (in() will always be called before out(), so strm->next_in is
+   assured to be defined if out() returns non-zero.) Note that inflateBack()
+   cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the basic
+   stream-oriented functions.  To simplify the interface, some default options
+   are assumed (compression level and memory usage, standard memory allocation
+   functions).  The source code of these utility functions can be modified if
+   you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer.  The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer.  Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before a
+   compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data.  (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit, destLen
+   is the actual size of the uncompressed buffer.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+                        /* gzip file access functions */
+
+/*
+     This library supports reading and writing files in gzip (.gz) format with
+   an interface similar to that of stdio, using the functions that start with
+   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
+   wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef voidp gzFile;       /* opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
+   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+   for fixed code compression as in "wb9F".  (See the description of
+   deflateInit2 for more information about the strategy parameter.) Also "a"
+   can be used instead of "w" to request that the gzip stream that will be
+   written be appended to the file.  "+" will result in an error, since reading
+   and writing to the same gzip file is not supported.
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.
+
+     gzopen returns NULL if the file could not be opened, if there was
+   insufficient memory to allocate the gzFile state, or if an invalid mode was
+   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+   errno can be checked to determine if the reason gzopen failed was that the
+   file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
+   are obtained from calls like open, dup, creat, pipe or fileno (if the file
+   has been previously opened with fopen).  The mode parameter is as in gzopen.
+
+     The next call of gzclose on the returned gzFile will also close the file
+   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+   mode);.  The duplicated descriptor should be saved to avoid a leak, since
+   gzdopen does not close fd if it fails.
+
+     gzdopen returns NULL if there was insufficient memory to allocate the
+   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
+   used until the next gz* read, write, seek, or close operation, so gzdopen
+   will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+     Set the internal buffer size used by this library's functions.  The
+   default buffer size is 8192 bytes.  This function must be called after
+   gzopen() or gzdopen(), and before any other calls that read or write the
+   file.  The buffer memory allocation is always deferred to the first read or
+   write.  Two buffers are allocated, either both of the specified size when
+   writing, or one of the specified size and the other twice that size when
+   reading.  A larger buffer size of, for example, 64K or 128K bytes will
+   noticeably increase the speed of decompression (reading).
+
+     The new buffer size also affects the maximum length for gzprintf().
+
+     gzbuffer() returns 0 on success, or -1 on failure, such as being called
+   too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy.  See the description
+   of deflateInit2 for the meaning of these parameters.
+
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.  If
+   the input file was not in gzip format, gzread copies the given number of
+   bytes into the buffer.
+
+     After reaching the end of a gzip stream in the input, gzread will continue
+   to read, looking for another gzip stream, or failing that, reading the rest
+   of the input file directly without decompression.  The entire input file
+   will be read if gzread is called until it returns less than the requested
+   len.
+
+     gzread returns the number of uncompressed bytes actually read, less than
+   len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+                                voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes written or 0 in case of
+   error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the arguments to the compressed file under
+   control of the format string, as in fprintf.  gzprintf returns the number of
+   uncompressed bytes actually written, or 0 in case of error.  The number of
+   uncompressed bytes written is limited to 8191, or one less than the buffer
+   size given to gzbuffer().  The caller should assure that this limit is not
+   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
+   nothing written.  In this case, there may also be a buffer overflow with
+   unpredictable consequences, which is possible only if zlib was compiled with
+   the insecure functions sprintf() or vsprintf() because the secure snprintf()
+   or vsnprintf() functions were not available.  This can be determined using
+   zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+     Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+
+     gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+     Reads bytes from the compressed file until len-1 characters are read, or a
+   newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  If any characters are read or if len == 1, the
+   string is terminated with a null character.  If no characters are read due
+   to an end-of-file or len < 1, then the buffer is left untouched.
+
+     gzgets returns buf which is a null-terminated string, or it returns NULL
+   for end-of-file or in case of error.  If there was an error, the contents at
+   buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+     Writes c, converted to an unsigned char, into the compressed file.  gzputc
+   returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+     Reads one byte from the compressed file.  gzgetc returns this byte or -1
+   in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+     Push one character back onto the stream to be read as the first character
+   on the next read.  At least one character of push-back is allowed.
+   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
+   fail if c is -1, and may fail if a character has been pushed but not read
+   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
+   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
+   The pushed character will be discarded if the stream is repositioned with
+   gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file.  The parameter flush
+   is as in the deflate() function.  The return value is the zlib error number
+   (see function gzerror below).  gzflush is only permitted when writing.
+
+     If the flush parameter is Z_FINISH, the remaining data is written and the
+   gzip stream is completed in the output.  If gzwrite() is called again, a new
+   gzip stream will be started in the output.  gzread() is able to read such
+   concatented gzip streams.
+
+     gzflush should be called only when strictly necessary because it will
+   degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+                                   z_off_t offset, int whence));
+
+     Sets the starting position for the next gzread or gzwrite on the given
+   compressed file.  The offset represents a number of bytes in the
+   uncompressed data stream.  The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow.  If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+     gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
+     Returns the starting position for the next gzread or gzwrite on the given
+   compressed file.  This position represents a number of bytes in the
+   uncompressed data stream, and is zero when starting, even if appending or
+   reading a gzip stream from the middle of a file using gzdopen().
+
+     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+     Returns the current offset in the file being read or written.  This offset
+   includes the count of bytes that precede the gzip stream, for example when
+   appending or when using gzdopen() for reading.  When reading, the offset
+   does not include as yet unused buffered input.  This information can be used
+   for a progress indicator.  On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns true (1) if the end-of-file indicator has been set while reading,
+   false (0) otherwise.  Note that the end-of-file indicator is set only if the
+   read tried to go past the end of the input, but came up short.  Therefore,
+   just like feof(), gzeof() may return false even if there is no more data to
+   read, in the event that the last read request was for the exact number of
+   bytes remaining in the input file.  This will happen if the input file size
+   is an exact multiple of the buffer size.
+
+     If gzeof() returns true, then the read functions will return no more data,
+   unless the end-of-file indicator is reset by gzclearerr() and the input file
+   has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns true (1) if file is being copied directly while reading, or false
+   (0) if file is a gzip stream being decompressed.  This state can change from
+   false to true while reading the input file if the end of a gzip stream is
+   reached, but is followed by data that is not another gzip stream.
+
+     If the input file is empty, gzdirect() will return true, since the input
+   does not contain a gzip stream.
+
+     If gzdirect() is used immediately after gzopen() or gzdopen() it will
+   cause buffers to be allocated to allow reading the file to determine if it
+   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
+   gzdirect().
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file and
+   deallocates the (de)compression state.  Note that once file is closed, you
+   cannot call gzerror with file, since its structures have been deallocated.
+   gzclose must not be called more than once on the same file, just as free
+   must not be called more than once on the same allocation.
+
+     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+   file operation error, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+     Same as gzclose(), but gzclose_r() is only for use when reading, and
+   gzclose_w() is only for use when writing or appending.  The advantage to
+   using these instead of gzclose() is that they avoid linking in zlib
+   compression or decompression code that is not used when only reading or only
+   writing respectively.  If gzclose() is used, then both compression and
+   decompression code will be included the application when linking to a static
+   zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the given
+   compressed file.  errnum is set to zlib error number.  If an error occurred
+   in the file system and not in the compression library, errnum is set to
+   Z_ERRNO and the application may consult errno to get the exact error code.
+
+     The application must not modify the returned string.  Future calls to
+   this function may invalidate the previously returned string.  If file is
+   closed, then the string previously returned by gzerror will no longer be
+   available.
+
+     gzerror() should be used to distinguish errors from end-of-file for those
+   functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file.  This is analogous to the
+   clearerr() function in stdio.  This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the compression
+   library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum.  If buf is Z_NULL, this function returns the
+   required initial value for the checksum.
+
+     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster.
+
+   Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32.  If buf is Z_NULL, this function returns the required
+   initial value for the for the crc.  Pre- and post-conditioning (one's
+   complement) is performed within this function so it shouldn't be done by the
+   application.
+
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+                                            ZLIB_VERSION, sizeof(z_stream))
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
+#  define gzopen gzopen64
+#  define gzseek gzseek64
+#  define gztell gztell64
+#  define gzoffset gzoffset64
+#  define adler32_combine adler32_combine64
+#  define crc32_combine crc32_combine64
+#  ifdef _LARGEFILE64_SOURCE
+     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#  endif
+#else
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/misc/winutils/lib/libSDL.la b/misc/winutils/lib/libSDL.la
new file mode 100644
index 0000000..4f0519f
--- /dev/null
+++ b/misc/winutils/lib/libSDL.la
@@ -0,0 +1,41 @@
+# libSDL.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='../bin/SDL.dll'
+
+# Names of this library.
+library_names='libSDL.dll.a'
+
+# The name of the static archive.
+old_library='libSDL.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -luser32 -lgdi32 -lwinmm -ldxguid'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libSDL.
+current=11
+age=11
+revision=3
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/local/lib'
diff --git a/project_files/Android-build/CMakeLists.txt b/project_files/Android-build/CMakeLists.txt
new file mode 100644
index 0000000..778ec20
--- /dev/null
+++ b/project_files/Android-build/CMakeLists.txt
@@ -0,0 +1,117 @@
+###################################################################################
+# Hedgewars, a free turn based strategy game
+# Copyright (c) 2011 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+#
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+###################################################################################
+
+find_program(ANT ant DOC "Path to the java package creator: ant")
+if(NOT EXISTS ${ANT})
+    MESSAGE(FATAL_ERROR "Couldn't detect the Ant build tool")
+endif()
+
+if(NOT ANDROID_NDK)
+    find_path(ANDROID_NDK ndk-build)
+endif()
+
+if(IS_DIRECTORY "${ANDROID_NDK}")
+    MESSAGE(STATUS "Detected the android NDK directory at: " ${ANDROID_NDK}) 
+else ()
+    MESSAGE(FATAL_ERROR "Couldn't detect the Android NDK directory")
+endif()
+
+if(NOT ANDROID_NDK_TOOLCHAINDIR)
+    set(toolchainbase "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt")
+    find_path(ANDROID_NDK_TOOLCHAINDIR arm-linux-androideabi
+                "${toolchainbase}/linux-x86"
+                "${toolchainbase}/windows")
+endif()
+
+if(IS_DIRECTORY "${ANDROID_NDK_TOOLCHAINDIR}")
+    MESSAGE(STATUS "Detected the Android NDK toolchain at: ${ANDROID_NDK_TOOLCHAINDIR}") 
+else ()
+    MESSAGE(FATAL_ERROR "Couldn't detect the Android NDK toolchain directory: ${ANDROID_NDK_TOOLCHAINDIR}")
+endif()
+
+if(NOT ANDROID_SDK)#Check if its defined at the cmdline
+    find_program(ANDROID_SDK adb) #assume they've added platform-tools to their path
+    get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
+    get_filename_component(ANDROID_SDK "${ANDROID_SDK}" PATH)
+    set(ANDROID_SDK "${ANDROID_SDK}" CACHE PATH "Path to the android sdk" FORCE)
+endif()
+
+if( IS_DIRECTORY "${ANDROID_SDK}")
+    MESSAGE(STATUS "Detected the android SDK directory at: " ${ANDROID_SDK}) 
+else ()
+    MESSAGE(FATAL_ERROR "Couldn't detect the Android SDK directory")
+endif()
+
+if( NOT FPC_DIR)
+    find_program(FPC_DIR ppcrossarm)
+    get_filename_component(FPC_DIR "${FPC_DIR}" PATH)
+    if(IS_DIRECTORY "${FPC_DIR}") 
+    	set(FPC_DIR "${FPC_DIR}" CACHE PATH "Path to fpc dir used in the android port" FORCE)
+    endif()
+endif()
+
+if( IS_DIRECTORY "${FPC_DIR}")
+    MESSAGE(STATUS "Detected the FreePascal directory at: " "${FPC_DIR}") 
+else ()
+    MESSAGE(FATAL_ERROR "Couldn't detect the FreePascal directory")
+endif()
+
+set(SDL_DIR /home/richard/Downloads/android-project)
+
+
+set(ANDROID_SDK_API_LVL 14)
+set(ANDROID_NDK_API_LVL 5)
+
+MESSAGE(STATUS "Creating Makefile.android...")
+
+configure_file(Templates/Makefile.android .)
+
+find_program(ANDROID_EXEC NAMES android android.bat PATHS "${ANDROID_SDK}/platform-tools" "${ANDROID_SDK}/tools")
+if(ANDROID_EXEC)
+    exec_program(${ANDROID_EXEC}
+                 ARGS "update project"
+                 "--path ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project"
+                 "--target android-${ANDROID_SDK_API_LVL}"
+                 OUTPUT_VARIABLE androidoutput
+                )
+    MESSAGE(STATUS "Updating android project config...\n" ${androidoutput})
+else()
+    MESSAGE(FATAL_ERROR "Couldn't find the android executable in ${ANDROID_SDK}/platform-tools or ${ANDROID_SDK}/tools.")
+endif()
+
+exec_program(${HGCOMMAND}
+    ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
+    OUTPUT_VARIABLE dontcare
+)
+exec_program(${HGCOMMAND}
+    ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
+    OUTPUT_VARIABLE dontcare
+)
+exec_program(${HGCOMMAND}
+    ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL/src/file/SDL_rwops.c
+    OUTPUT_VARIABLE dontcare
+)
+exec_program(${HGCOMMAND}
+    ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL_mixer/Android.mk
+    OUTPUT_VARIABLE dontcare
+)
+exec_program(${HGCOMMAND}
+    ARGS revert ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project/jni/SDL_ttf/Android.mk
+    OUTPUT_VARIABLE dontcare
+)
+
diff --git a/project_files/Android-build/SDL-android-project/AndroidManifest.xml b/project_files/Android-build/SDL-android-project/AndroidManifest.xml
new file mode 100644
index 0000000..3c62ac5
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="org.hedgewars.hedgeroid"
+      android:versionCode="8"
+      android:installLocation="preferExternal" android:versionName="0.2">
+    <uses-sdk android:targetSdkVersion="14" android:minSdkVersion="7"></uses-sdk>
+    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+    <application android:label="@string/app_name" android:icon="@drawable/icon">
+        <activity android:name=".MainActivity"
+                  android:label="@string/app_name"
+ 		  		  android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".SDLActivity"
+                  android:label="@string/app_name"
+ 		  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+		  android:screenOrientation='landscape'>
+        </activity>
+        
+        <activity android:name=".Downloader.DownloadFragment"
+                  android:label="@string/app_name"
+				  android:theme="@android:style/Theme.Dialog">
+        </activity>
+        
+        <activity android:name=".Downloader.DownloadListActivity"
+                  android:label="@string/app_name"
+				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+				  android:screenOrientation='landscape'
+				  android:launchMode="singleTop"/>
+        
+        <service android:name=".Downloader.DownloadService"/>
+        
+        <activity android:name="StartGameActivity"
+                  android:label="@string/app_name"
+				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+				  android:screenOrientation='landscape'>
+        </activity>
+        <activity android:name="TeamSelectionActivity"
+                  android:label="@string/app_name"
+				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+				  android:screenOrientation='landscape'>
+        </activity>
+        <activity android:name="TeamCreatorActivity"
+                  android:label="@string/app_name"
+				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+				  android:screenOrientation='landscape'
+				  android:windowSoftInputMode="stateUnchanged">
+        </activity>
+    </application>
+</manifest> 
diff --git a/project_files/Android-build/SDL-android-project/ant.properties b/project_files/Android-build/SDL-android-project/ant.properties
new file mode 100644
index 0000000..ee52d86
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/ant.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
diff --git a/share/hedgewars/Data/Fonts/DejaVuSans-Bold.ttf b/project_files/Android-build/SDL-android-project/assets/Data/Fonts/DejaVuSans-Bold.ttf
similarity index 100%
copy from share/hedgewars/Data/Fonts/DejaVuSans-Bold.ttf
copy to project_files/Android-build/SDL-android-project/assets/Data/Fonts/DejaVuSans-Bold.ttf
diff --git a/share/hedgewars/Data/Forts/LegoL.png b/project_files/Android-build/SDL-android-project/assets/Data/Forts/LegoL.png
similarity index 100%
copy from share/hedgewars/Data/Forts/LegoL.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Forts/LegoL.png
diff --git a/share/hedgewars/Data/Forts/LegoR.png b/project_files/Android-build/SDL-android-project/assets/Data/Forts/LegoR.png
similarity index 100%
copy from share/hedgewars/Data/Forts/LegoR.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Forts/LegoR.png
diff --git a/share/hedgewars/Data/Graphics/AirBomb.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AirBomb.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AirBomb.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AirBomb.png
diff --git a/share/hedgewars/Data/Graphics/AirDrill.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AirDrill.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AirDrill.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AirDrill.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Airplane.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Airplane.png
new file mode 100644
index 0000000..b574bf2
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Airplane.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos.png
new file mode 100644
index 0000000..b3042c0
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos_bw.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos_bw.png
new file mode 100644
index 0000000..49f099c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Ammos_bw.png differ
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/BorderHorizontal.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/BorderHorizontal.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/BorderHorizontal.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/BorderHorizontal.png
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/BorderVertical.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/BorderVertical.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/BorderVertical.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/BorderVertical.png
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/Corners.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Corners.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/Corners.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Corners.png
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/Slot.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Slot.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/Slot.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/Slot.png
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/SlotKeys.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/SlotKeys.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/SlotKeys.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/SlotKeys.png
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/TurnsLeft.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/TurnsLeft.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/AmmoMenu/TurnsLeft.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/AmmoMenu/TurnsLeft.png
diff --git a/share/hedgewars/Data/Graphics/Arrow.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Arrow.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Arrow.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Arrow.png
diff --git a/share/hedgewars/Data/Graphics/Balls.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Balls.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Balls.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Balls.png
diff --git a/share/hedgewars/Data/Graphics/BazookaShell.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BazookaShell.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BazookaShell.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BazookaShell.png
diff --git a/share/hedgewars/Data/Graphics/Bee.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bee.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Bee.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bee.png
diff --git a/share/hedgewars/Data/Graphics/BeeTrace.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BeeTrace.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BeeTrace.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BeeTrace.png
diff --git a/share/hedgewars/Data/Graphics/BigDigits.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BigDigits.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BigDigits.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BigDigits.png
diff --git a/share/hedgewars/Data/Graphics/BigExplosion.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BigExplosion.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BigExplosion.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BigExplosion.png
diff --git a/share/hedgewars/Data/Graphics/Birdy.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Birdy.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Birdy.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Birdy.png
diff --git a/share/hedgewars/Data/Graphics/BlueWater.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BlueWater.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BlueWater.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BlueWater.png
diff --git a/share/hedgewars/Data/Graphics/Bomb.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bomb.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Bomb.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bomb.png
diff --git a/share/hedgewars/Data/Graphics/Bubbles.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bubbles.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Bubbles.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Bubbles.png
diff --git a/share/hedgewars/Data/Graphics/BulletHit.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/BulletHit.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/BulletHit.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/BulletHit.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowdown.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowdown.png
new file mode 100644
index 0000000..802c58c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowdown.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowleft.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowleft.png
new file mode 100644
index 0000000..854259e
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowleft.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowright.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowright.png
new file mode 100644
index 0000000..a199c0c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowright.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowup.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowup.png
new file mode 100644
index 0000000..5dddc34
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/arrowup.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/backjump.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/backjump.png
new file mode 100644
index 0000000..5e72fb9
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/backjump.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/firebutton.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/firebutton.png
new file mode 100644
index 0000000..e22dec4
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/firebutton.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/forwardjump.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/forwardjump.png
new file mode 100644
index 0000000..0c0b722
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/forwardjump.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/pause.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/pause.png
new file mode 100644
index 0000000..7baa28c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Buttons/pause.png differ
diff --git a/share/hedgewars/Data/Graphics/Cake_down.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cake_down.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Cake_down.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cake_down.png
diff --git a/share/hedgewars/Data/Graphics/Cake_walk.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cake_walk.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Cake_walk.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cake_walk.png
diff --git a/share/hedgewars/Data/Graphics/Case.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Case.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Case.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Case.png
diff --git a/share/hedgewars/Data/Graphics/Censored.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Censored.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Censored.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Censored.png
diff --git a/share/hedgewars/Data/Graphics/ClBomb.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/ClBomb.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/ClBomb.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/ClBomb.png
diff --git a/share/hedgewars/Data/Graphics/ClParticle.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/ClParticle.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/ClParticle.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/ClParticle.png
diff --git a/share/hedgewars/Data/Graphics/Clouds.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Clouds.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Clouds.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Clouds.png
diff --git a/share/hedgewars/Data/Graphics/Cross.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cross.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Cross.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Cross.png
diff --git a/share/hedgewars/Data/Graphics/Crosshair.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Crosshair.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Crosshair.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Crosshair.png
diff --git a/share/hedgewars/Data/Graphics/Drill.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Drill.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Drill.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Drill.png
diff --git a/share/hedgewars/Data/Graphics/Droplet.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Droplet.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Droplet.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Droplet.png
diff --git a/share/hedgewars/Data/Graphics/Dust.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Dust.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Dust.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Dust.png
diff --git a/share/hedgewars/Data/Graphics/Egg.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Egg.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Egg.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Egg.png
diff --git a/share/hedgewars/Data/Graphics/EvilTrace.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/EvilTrace.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/EvilTrace.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/EvilTrace.png
diff --git a/share/hedgewars/Data/Graphics/Expl50.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Expl50.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Expl50.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Expl50.png
diff --git a/share/hedgewars/Data/Graphics/ExplPart.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplPart.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/ExplPart.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplPart.png
diff --git a/share/hedgewars/Data/Graphics/ExplPart2.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplPart2.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/ExplPart2.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplPart2.png
diff --git a/share/hedgewars/Data/Graphics/Explosives.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Explosives.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Explosives.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Explosives.png
diff --git a/share/hedgewars/Data/Graphics/ExplosivesRoll.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplosivesRoll.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/ExplosivesRoll.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/ExplosivesRoll.png
diff --git a/share/hedgewars/Data/Graphics/Feather.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Feather.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Feather.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Feather.png
diff --git a/share/hedgewars/Data/Graphics/Finger.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Finger.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Finger.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Finger.png
diff --git a/share/hedgewars/Data/Graphics/FirstAid.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/FirstAid.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/FirstAid.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/FirstAid.png
diff --git a/share/hedgewars/Data/Graphics/Flags/cm_binary.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flags/cm_binary.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Flags/cm_binary.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flags/cm_binary.png
diff --git a/share/hedgewars/Data/Graphics/Flags/hedgewars.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flags/hedgewars.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Flags/hedgewars.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flags/hedgewars.png
diff --git a/share/hedgewars/Data/Graphics/Flame.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flame.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Flame.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Flame.png
diff --git a/share/hedgewars/Data/Graphics/Frame.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Frame.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Frame.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Frame.png
diff --git a/share/hedgewars/Data/Graphics/Girder.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Girder.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Girder.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Girder.png
diff --git a/share/hedgewars/Data/Graphics/Graves/Bone.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Graves/Bone.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Graves/Bone.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Graves/Bone.png
diff --git a/share/hedgewars/Data/Graphics/HHDeath.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/HHDeath.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/HHDeath.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/HHDeath.png
diff --git a/share/hedgewars/Data/Graphics/HHDress.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/HHDress.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/HHDress.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/HHDress.png
diff --git a/share/hedgewars/Data/Graphics/Hammer.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hammer.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hammer.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hammer.png
diff --git a/share/hedgewars/Data/Graphics/Hats/NoHat.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hats/NoHat.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hats/NoHat.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hats/NoHat.png
diff --git a/share/hedgewars/Data/Graphics/Health.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Health.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Health.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Health.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Hurrah.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Hurrah.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Hurrah.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Hurrah.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ILoveLemonade.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ILoveLemonade.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ILoveLemonade.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ILoveLemonade.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Idle.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Idle.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Idle.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Idle.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Invulnerable.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Invulnerable.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Invulnerable.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Invulnerable.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Juggle.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Juggle.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Juggle.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Juggle.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Kowtow.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Kowtow.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Kowtow.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Kowtow.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Sad.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Sad.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Sad.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Sad.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ShoutCorner.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutCorner.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ShoutCorner.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutCorner.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ShoutEdge.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutEdge.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ShoutEdge.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutEdge.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ShoutTail.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutTail.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ShoutTail.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ShoutTail.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Shrug.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Shrug.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Shrug.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Shrug.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/SpeechCorner.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechCorner.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/SpeechCorner.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechCorner.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/SpeechEdge.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechEdge.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/SpeechEdge.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechEdge.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/SpeechTail.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechTail.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/SpeechTail.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/SpeechTail.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ThoughtCorner.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtCorner.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ThoughtCorner.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtCorner.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ThoughtEdge.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtEdge.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ThoughtEdge.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtEdge.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/ThoughtTail.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtTail.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/ThoughtTail.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/ThoughtTail.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Vampiric.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Vampiric.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Vampiric.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Vampiric.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/Wave.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Wave.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/Wave.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/Wave.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amAirAttack.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amAirAttack.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amAirAttack.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amAirAttack.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBTorch_i.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBTorch_i.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBTorch_i.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBTorch_i.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBTorch_w.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBTorch_w.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBTorch_w.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBTorch_w.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBallgun.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBallgun.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBallgun.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBallgun.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBaseball.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBaseball.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBaseball.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBaseball.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBazooka.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBazooka.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBazooka.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBazooka.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amBee.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBee.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amBee.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amBee.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amCake.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCake.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amCake.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCake.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amCheese.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCheese.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amCheese.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCheese.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amCluster.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCluster.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amCluster.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amCluster.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amConstruction.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amConstruction.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amConstruction.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amConstruction.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amDEagle.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDEagle.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amDEagle.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDEagle.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amDEagle_w.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDEagle_w.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amDEagle_w.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDEagle_w.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amDrill.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDrill.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amDrill.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDrill.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amDynamite.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDynamite.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amDynamite.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amDynamite.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amFlamethrower.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amFlamethrower.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amFlamethrower.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amFlamethrower.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amGirder.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amGirder.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amGirder.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amGirder.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amGrenade.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amGrenade.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amGrenade.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amGrenade.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amHammer.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amHammer.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amHammer.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amHammer.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amHellish.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amHellish.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amHellish.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amHellish.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amJetpack.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amJetpack.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amJetpack.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amJetpack.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amKamikaze.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amKamikaze.png
new file mode 100644
index 0000000..80dc737
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amKamikaze.png differ
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amMelon.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMelon.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amMelon.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMelon.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amMine.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMine.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amMine.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMine.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amMolotov.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMolotov.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amMolotov.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMolotov.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amMortar.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMortar.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amMortar.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amMortar.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amPortalGun.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amPortalGun.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amPortalGun.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amPortalGun.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amRCPlane.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amRCPlane.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amRCPlane.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amRCPlane.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amResurrector.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amResurrector.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amResurrector.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amResurrector.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amRope.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amRope.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amRope.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amRope.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSMine.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSMine.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSMine.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSMine.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSeduction.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSeduction.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSeduction.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSeduction.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amShotgun.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amShotgun.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amShotgun.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amShotgun.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amShotgun_w.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amShotgun_w.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amShotgun_w.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amShotgun_w.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSineGun.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSineGun.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSkip.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSkip.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSkip.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSkip.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSniperRifle.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSniperRifle.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSniperRifle.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSniperRifle.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSnowball.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSnowball.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amSnowball.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amSnowball.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amVamp.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amVamp.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amVamp.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amVamp.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amWhip.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amWhip.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/amWhip.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/amWhip.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/hh_small.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/hh_small.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hedgehog/hh_small.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Hedgehog/hh_small.png
diff --git a/share/hedgewars/Data/Graphics/HellishBomb.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/HellishBomb.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/HellishBomb.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/HellishBomb.png
diff --git a/share/hedgewars/Data/Graphics/Lag.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Lag.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Lag.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Lag.png
diff --git a/share/hedgewars/Data/Graphics/MineDead.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineDead.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/MineDead.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineDead.png
diff --git a/share/hedgewars/Data/Graphics/MineOff.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineOff.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/MineOff.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineOff.png
diff --git a/share/hedgewars/Data/Graphics/MineOn.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineOn.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/MineOn.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/MineOn.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Molotov.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Molotov.png
new file mode 100644
index 0000000..3abaa1f
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Molotov.png differ
diff --git a/share/hedgewars/Data/Graphics/Mortar.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Mortar.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Mortar.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Mortar.png
diff --git a/share/hedgewars/Data/Graphics/NapalmBomb.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/NapalmBomb.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/NapalmBomb.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/NapalmBomb.png
diff --git a/share/hedgewars/Data/Graphics/Note.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Note.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Note.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Note.png
diff --git a/share/hedgewars/Data/Graphics/Parachute.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Parachute.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Parachute.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Parachute.png
diff --git a/share/hedgewars/Data/Graphics/Piano.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Piano.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Piano.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Piano.png
diff --git a/share/hedgewars/Data/Graphics/Portal.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Portal.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Portal.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Portal.png
diff --git a/share/hedgewars/Data/Graphics/Power.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Power.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Power.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Power.png
diff --git a/share/hedgewars/Data/Graphics/PowerBar.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/PowerBar.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/PowerBar.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/PowerBar.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Progress.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Progress.png
new file mode 100644
index 0000000..b24e1bc
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Progress.png differ
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/RCPlane.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/RCPlane.png
new file mode 100644
index 0000000..80622d5
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/RCPlane.png differ
diff --git a/share/hedgewars/Data/Graphics/RopeHook.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/RopeHook.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/RopeHook.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/RopeHook.png
diff --git a/share/hedgewars/Data/Graphics/RopeNode.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/RopeNode.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/RopeNode.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/RopeNode.png
diff --git a/share/hedgewars/Data/Graphics/SMineOff.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SMineOff.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SMineOff.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SMineOff.png
diff --git a/share/hedgewars/Data/Graphics/SMineOn.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SMineOn.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SMineOn.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SMineOn.png
diff --git a/share/hedgewars/Data/Graphics/Seduction.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Seduction.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Seduction.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Seduction.png
diff --git a/share/hedgewars/Data/Graphics/Shells.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Shells.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Shells.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Shells.png
diff --git a/share/hedgewars/Data/Graphics/Smoke.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Smoke.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Smoke.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Smoke.png
diff --git a/share/hedgewars/Data/Graphics/SmokeRing.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeRing.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SmokeRing.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeRing.png
diff --git a/share/hedgewars/Data/Graphics/SmokeTrace.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeTrace.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SmokeTrace.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeTrace.png
diff --git a/share/hedgewars/Data/Graphics/SmokeWhite.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeWhite.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SmokeWhite.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SmokeWhite.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Snow.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Snow.png
new file mode 100644
index 0000000..80c4ede
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Snow.png differ
diff --git a/share/hedgewars/Data/Graphics/SnowDust.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SnowDust.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SnowDust.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SnowDust.png
diff --git a/share/hedgewars/Data/Graphics/Snowball.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Snowball.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Snowball.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Snowball.png
diff --git a/share/hedgewars/Data/Graphics/Splash.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Splash.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Splash.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Splash.png
diff --git a/share/hedgewars/Data/Graphics/SuddenDeath/SDClouds.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDClouds.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SuddenDeath/SDClouds.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDClouds.png
diff --git a/share/hedgewars/Data/Graphics/SuddenDeath/SDDroplet.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDDroplet.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SuddenDeath/SDDroplet.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDDroplet.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDFlake.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDFlake.png
new file mode 100644
index 0000000..fecf14e
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDFlake.png differ
diff --git a/share/hedgewars/Data/Graphics/SuddenDeath/SDSplash.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDSplash.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SuddenDeath/SDSplash.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDSplash.png
diff --git a/share/hedgewars/Data/Graphics/SuddenDeath/SDWater.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDWater.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/SuddenDeath/SDWater.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/SuddenDeath/SDWater.png
diff --git a/share/hedgewars/Data/Graphics/Switch.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Switch.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Switch.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Switch.png
diff --git a/share/hedgewars/Data/Graphics/TARDIS.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/TARDIS.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/TARDIS.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/TARDIS.png
diff --git a/share/hedgewars/Data/Graphics/Target.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Target.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Target.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Target.png
diff --git a/share/hedgewars/Data/Graphics/TargetBee.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/TargetBee.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/TargetBee.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/TargetBee.png
diff --git a/share/hedgewars/Data/Graphics/Targetp.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Targetp.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Targetp.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Targetp.png
diff --git a/share/hedgewars/Data/Graphics/Teleport.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Teleport.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Teleport.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Teleport.png
diff --git a/share/hedgewars/Data/Graphics/Utility.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Utility.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Utility.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Utility.png
diff --git a/share/hedgewars/Data/Graphics/Watermelon.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/Watermelon.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Watermelon.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/Watermelon.png
diff --git a/share/hedgewars/Data/Graphics/WindBar.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindBar.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/WindBar.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindBar.png
diff --git a/share/hedgewars/Data/Graphics/WindL.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindL.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/WindL.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindL.png
diff --git a/share/hedgewars/Data/Graphics/WindR.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindR.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/WindR.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/WindR.png
diff --git a/share/hedgewars/Data/Graphics/amAirplane.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/amAirplane.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/amAirplane.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/amAirplane.png
diff --git a/share/hedgewars/Data/Graphics/amGirder.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/amGirder.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/amGirder.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/amGirder.png
diff --git a/share/hedgewars/Data/Graphics/amTeleport.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/amTeleport.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/amTeleport.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/amTeleport.png
diff --git a/share/hedgewars/Data/Graphics/cheese.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/cheese.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/cheese.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/cheese.png
diff --git a/share/hedgewars/Data/Graphics/dynamite.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/dynamite.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/dynamite.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/dynamite.png
diff --git a/share/hedgewars/Data/Graphics/hhMask.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/hhMask.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/hhMask.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/hhMask.png
diff --git a/share/hedgewars/Data/Graphics/hwengine.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/hwengine.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/hwengine.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/hwengine.png
diff --git a/share/hedgewars/Data/Graphics/missions.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/missions.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/missions.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/missions.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Graphics/slider.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/slider.png
new file mode 100644
index 0000000..2d15899
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/slider.png differ
diff --git a/share/hedgewars/Data/Graphics/thinking.png b/project_files/Android-build/SDL-android-project/assets/Data/Graphics/thinking.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/thinking.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Graphics/thinking.png
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt b/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt
new file mode 100644
index 0000000..efc37a2
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/assets/Data/Locale/en.txt
@@ -0,0 +1,534 @@
+; English locale
+
+00:00=Grenade
+00:01=ClusterBomb
+00:02=Bazooka
+00:03=Homing Bee
+00:04=Shotgun
+00:05=PickHammer
+00:06=Skip
+00:07=Rope
+00:08=Mine
+00:09=Desert Eagle
+00:10=Dynamite
+00:11=Baseball Bat
+00:12=Shoryuken
+00:13=sec
+00:14=Parachute
+00:15=Air Attack
+00:16=Mine Strike
+00:17=Blow Torch
+00:18=Construction
+00:19=Teleportation
+00:20=Switch Hedgehog
+00:21=Mortar
+00:22=Whip
+00:23=Kamikaze
+00:24=Cake
+00:25=Seduction
+00:26=Watermelon Bomb
+00:27=Hellish hand-grenade
+00:28=Drill Rocket
+00:29=Ballgun
+00:30=Napalm
+00:31=RC Plane
+00:32=Low Gravity
+00:33=Extra Damage
+00:34=Invulnerable
+00:35=Extra Time
+00:36=Laser Sight
+00:37=Vampirism
+00:38=Sniper Rifle
+00:39=Flying Saucer
+00:40=Molotov Cocktail
+00:41=Birdy
+00:42=Portable Portal Device
+00:43=Piano Strike
+00:44=Old Limburger
+00:45=Sine Gun (beta)
+00:46=Flamethrower
+00:47=Sticky Mine
+00:48=Hammer
+00:49=Resurrector
+00:50=Drill Strike
+00:51=Mudball
+00:52=No weapon selected
+00:53=TimeBox
+00:54=Structure
+00:55=Land Spray
+00:56=Freezer
+
+01:00=Let's fight!
+01:01=Round draw
+01:02=%1 wins!
+01:03=Volume %1%
+01:04=Paused
+01:05=Really quit (Y/Esc)?
+01:06=Sudden Death!
+01:07=%1 remaining
+01:08=Fuel
+01:09=Synchronizing...
+01:10=Using this utility won't end your turn!
+01:11=This weapon or utility is not yet available!
+01:12=Last round till Sudden Death!
+01:13=%1 rounds till Sudden Death!
+01:14=Get ready, %1!
+01:15=Slight
+01:16=Low
+01:17=Normal
+01:18=High
+01:19=Extreme
+01:20=%1 Bounce
+
+; Event messages
+; Hog (%1) died
+02:00=%1 has kicked the bucket!
+02:00=%1 has seen the light!
+02:00=%1 never saw that coming!
+02:00=%1 waves goodbye!
+02:00=%1 has gone to a better place!
+02:00=%1 meets his maker!
+02:00=%1 can hang on no longer!
+02:00=%1 has done his duty!
+02:00=%1 makes the ultimate sacrifice!
+02:00=%1 departs this mortal coil!
+02:00=%1 makes like a tree and leaves!
+02:00=%1 has timed out!
+02:00=%1 says peace out!
+02:00=%1 will be fondly remembered!
+02:00=%1 has an aneurysm!
+02:00=%1 leaves behind a wife and child
+02:00=%1 has launched his last bazooka
+02:00=%1 has tossed his last grenade
+02:00=%1 has baked his last cake
+02:00=%1 has swung on his last rope
+02:00=%1 has called his last airstrike
+02:00=%1 has pumped his last shotgun
+02:00=%1 has thrown his last melon
+02:00=%1 has drawn his last deagle
+02:00=%1 took one shot too many
+02:00=%1 could really have used a health crate
+02:00=%1 has gone to play a better game
+02:00=%1 has ragequit life
+02:00=%1 fails
+02:00=Poor poor %1...
+02:00=%1 prefers wormux
+02:00=%1 has been blocking shots with his face
+02:00=%1 is a hero amongst me...err...hogs
+02:00=%1 finds his place in Valhalla
+02:00=%1 has left the building
+02:00=%1 goes the way of the dinosaurs
+02:00=%1 brings hedgehogs one step closer to extinction
+02:00=%1 brings a tear to my eye
+02:00=%1 is an ex-hog
+02:00=%1 is pushing up the daisies
+02:00=%1 has ceased to be
+02:00=Say goodbye to %1
+02:00=No hope left for %1
+02:00=%1 faces the final curtain
+02:00=Smoke 'em if you got 'em, %1
+02:00=%1 suffers a Spontaneous Massive Existence Failure
+02:00=%1 has passed on
+02:00=%1 is stone dead
+02:00=%1 is no more
+02:00=%1 has expired
+02:00=Bereft of life, %1 rests in peace
+02:00=%1 joins the choir invisible
+02:00=Farewell %1, we hardly knew ye!
+02:00=%1 had a low tolerance for being shot
+02:00=%1 could have used an extra life
+02:00=Is there a doctor in the house?
+
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimics the Titanic!
+02:01=%1 swims like a stone!
+02:01=%1 floats like a brick!
+02:01=%1 checks out the deep end
+02:01=%1 goes glug glug glug
+02:01=%1 goes splash
+02:01=%1 forgot his armbands
+02:01=%1 really should have taken swimming lessons
+02:01=%1 left his surfboard at home
+02:01=%1 is washed up
+02:01=%1 is one soggy hog
+02:01=%1 forgot to bring his life jacket
+02:01=%1 goes splish splash splish
+02:01=%1 is sleeping with the fishes
+02:01=%1 thinks the water physics suck in this game
+02:01=%1 looks thirsty
+02:01=The sea claims %1
+02:01=%1 is lost at sea
+02:01=%1 should have brought his scuba gear
+02:01=%1 gets a burial at sea
+02:01=%1 has that sinking feeling
+02:01=%1 is practicing his backstroke
+02:01=%1 goes in search of the Titanic
+02:01=%1 is not Jesus
+02:01=%1 is finding Nemo
+02:01=%1 springs a leak
+02:01=You've gotta wonder how many hogs are down there
+02:01=%1 makes the ocean slightly higher
+02:01=%1 didn't enlist in the Navy
+02:01=%1 is doing his impersonation of a dead fish
+02:01=At least you didn't go down the toilet, %1
+02:01=Sonic couldn't swim and neither can %1
+02:01=%1 wants to play Ecco the dolphin
+02:01=%1 has gone to visit Aquaria
+02:01=%1 has found the lost city of Atlantis
+02:01=%1 aims for the lead role in Bioshock 3
+02:01=Your doggy paddle could use a little work, %1
+02:01=%1 should have brought a jet ski
+02:01=%1 doesn't like watersports
+02:01=%1 is forever blowing bubbles
+02:01=%1 is short of a raft
+02:01=%1 thinks salt water is good for the skin
+02:01=%1 gets salt water in his wounds
+02:01=%1 has walked the plank
+02:01=%1 has a bath
+02:01=%1 is wet wet wet
+02:01=%1 gets his quills wet
+02:01=It's Davy Jones' locker for %1
+
+; Round starts
+02:02=Let's fight!
+02:02=Armed and ready!
+02:02=Let's get ready to rumble!
+02:02=Let's get it on!
+02:02=Let's get this party started
+02:02=Last hog standing wins
+02:02=Let's go!
+02:02=Let's rock!
+02:02=Let's jam!
+02:02=It's beginning...
+02:02=This is the start of something big
+02:02=Welcome to Hedgewars
+02:02=Welcome to the front lines
+02:02=Crush your enemies!
+02:02=May the best hog win
+02:02=Victory or death
+02:02=To the victor goes the spoils
+02:02=Losing is not an option
+02:02=Cry havoc! Let loose the hogs of war!
+02:02=Hedgewars, brought to you by Hedgewars.org
+02:02=GL HF
+02:02=Just count yourself lucky you're not up against Tiyuri
+02:02=Just count yourself lucky you're not up against unC0Rr
+02:02=Just count yourself lucky you're not up against Nemo
+02:02=Just count yourself lucky you're not up against Smaxx
+02:02=Just count yourself lucky you're not up against Jessor
+02:02=Give it your all!
+02:02=The losers do the cleaning up!
+02:02=Let the fight of the millenium begin
+02:02=Let the fight of the century begin
+02:02=Let the fight of the decade begin
+02:02=Let the fight of the year begin
+02:02=Let the fight of the month begin
+02:02=Let the fight of the week begin
+02:02=Let the fight of the day begin
+02:02=Let the fight of the hour begin
+02:02=Do your best!
+02:02=Destroy the enemy!
+02:02=Good luck
+02:02=Have fun
+02:02=Fight the good fight
+02:02=Fight dirty
+02:02=Fight with honour
+02:02=Don't give up
+02:02=Never surrender
+02:02=Rock 'em and sock 'em!
+02:02=Let the fragfest begin!
+02:02=I hope you're ready for a tussle!
+02:02=Go Go Go!
+02:02=Hedgehogs advance!
+02:02=Bring it to them!
+02:02=Have no fear!
+02:02=Be brave and conquer
+
+; Round ends (win; unused atm)
+02:03=...
+
+; Round ends (draw; unused atm)
+02:04=...
+
+; New health crate
+02:05=Incoming aid!
+02:05=Medic!
+02:05=First aid from the skies!
+02:05=A health pack for you
+02:05=Good health... in box form!
+02:05=The doctor calls
+02:05=Fresh band-aids!
+02:05=This will make you feel better
+02:05=A Hi-Potion! Whoops wrong game
+02:05=A pick-me-up!
+02:05=Grab it
+02:05=A healthy snack
+02:05=A remedy to pain
+02:05=Correct Dosage: as many as you can find!
+02:05=Urgent delivery
+02:05=Supplies!
+
+; New ammo crate
+02:06=More weapons!
+02:06=Reinforcements!
+02:06=Lock and load!
+02:06=I wonder what weapon is in there?
+02:06=Supplies!
+02:06=What could be inside?
+02:06=Christmas comes early in Hedgewars
+02:06=A present!
+02:06=Special delivery!
+02:06=It was a nightmare getting this through customs
+02:06=Destructive toys from the heavens
+02:06=Warning! Contents Volatile
+02:06=Pick it up or blow it up, choice is yours
+02:06=Goodies!
+02:06=Mmmmm Ammo
+02:06=A box of destructive power
+02:06=Airmail!
+02:06=Whatever's in that box, it ain't pizza
+02:06=Get it!
+02:06=Weapon drop incoming
+02:06=Don't let the enemy grab that!
+02:06=Shiny new toys!
+02:06=A mysterious box!
+
+; New utility crate
+02:07=Tooltime!
+02:07=This could come in handy...
+02:07=Utilities!
+02:07=Utilise this box
+02:07=Watch out below
+02:07=More utilities!
+02:07=Tools for you!
+02:07=This should be good!
+02:07=Use this wisely
+02:07=Ooo this box is heavy
+02:07=You might need this
+
+; Hog (%1) skips his turn
+02:08=%1 is sooo boring...
+02:08=%1 couldn't be bothered
+02:08=%1 is one lazy hog
+02:08=%1 is thoughtless
+02:08=%1 gave up
+02:08=You snooze you lose, %1
+02:08=%1 shamelessly skips
+02:08=%1 is really lazy
+02:08=%1 needs a little more motivation
+02:08=%1 is a pacifist
+02:08=%1 has a breather
+02:08=%1 has a rest
+02:08=%1 chills out
+02:08=%1 has no faith in his own abilities
+02:08=%1 decides to do nothing at all
+02:08=%1 lets the enemy destroy itself
+02:08=%1 would be terrible at parties
+02:08=%1 hides out
+02:08=%1 has decided to pass on this opportunity
+02:08=%1 decides the best thing he can do is...nothing
+02:08=%1 is a big wuss
+02:08=Buck Buck Buck, %1 is a chicken
+02:08=%1 is looking a little yellow
+02:08=%1 is a coward!
+02:08=%1 is waiting for sudden death
+02:08=%1 is not the fighting type
+02:08=%1 is reconsidering his purpose in life
+02:08=%1 was never much of a good shot anyway
+02:08=%1 didn't want to join the army in the first place
+02:08=Stop wasting our time, %1
+02:08=I'm dissapointed in you, %1
+02:08=Come on, you can do better than that %1
+02:08=%1's will has broken
+02:08=%1 apparently has better things to do
+02:08=%1 is scared stiff
+02:08=%1 has fallen asleep
+
+; Hog (%1) hurts himself only
+02:09=%1 should practice aiming!
+02:09=%1 seems to hate himself
+02:09=%1 is standing on the wrong side!
+02:09=%1 makes like an emo
+02:09=%1 was holding his weapon the wrong way around
+02:09=%1 is a little sadistic
+02:09=%1 is a masochist
+02:09=%1 has no instinct of self-preservation
+02:09=%1 messed up
+02:09=%1 screwed up
+02:09=That was a poor shot, %1
+02:09=%1 is a little too careless with dangerous weapons
+02:09=%1 should consider a change of career
+02:09=Worst. Shot. Ever!
+02:09=No no no %1, you shoot at the ENEMY!
+02:09=%1 should only be destroying the enemy
+02:09=%1 moves one step closer to suicide
+02:09=%1 aids the enemy
+02:09=That was stupid %1
+02:09=%1 lives by the mantra of "no pain, no gain"
+02:09=%1 is confused
+02:09=%1 hurt itself in its confusion
+02:09=%1 has a knack for embarrassing himself
+02:09=%1 is a klutz!
+02:09=%1 is clumsy
+02:09=%1 shows the enemy what he's capable of
+02:09=%1 can't be expected to be perfect all the time
+02:09=Don't worry %1, pobody's nerfect
+02:09=%1 totally did that on purpose
+02:09=I won't tell anyone if you don't, %1
+02:09=How embarrassing!
+02:09=I'm sure nobody saw that %1
+02:09=%1 needs to review his field manual
+02:09=%1's weapon clearly malfunctioned
+
+; Hog shot an home run (using the bat and another hog)
+02:10=Home Run!
+02:10=A bird, a plane, ...
+02:10=That one is out!
+
+; Hog (%1) has to leave (team is gone)
+02:11=%1 has to go to bed!
+02:11=%1 seems too busy to play
+02:11=Beam him up, Scotty!
+02:11=%1 has to go
+
+; Weapon Categories
+03:00=Timed Grenade
+03:01=Timed Grenade
+03:02=Ballistic Weapon
+03:03=Guided Weapon
+03:04=Gun (multiple shots)
+03:05=Digging Tool
+03:06=Action
+03:07=Transport Utility
+03:08=Proximity Bomb
+03:09=Gun (multiple shots)
+03:10=BOOM!
+03:11=Bonk!
+03:12=Martial Arts
+03:13=UNUSED
+03:14=Transport Utility
+03:15=Airborne Attack
+03:16=Airborne Attack
+03:17=Digging Tool
+03:18=Utility
+03:19=Transport Utility
+03:20=Action
+03:21=Ballistic Weapon
+03:22=Call me Indiana!
+03:23=(Really) Martial Arts
+03:24=The cake is NOT a lie!
+03:25=Costume Kit
+03:26=Juicy Grenade
+03:27=Fiery Grenade
+03:28=Ballistic Weapon
+03:29=Ballistic Weapon
+03:30=Airborne Attack
+03:31=Remote Controlled Bomb
+03:32=Temporary Effect
+03:33=Temporary Effect
+03:34=Temporary Effect
+03:35=Temporary Effect
+03:36=Temporary Effect
+03:37=Temporary Effect
+03:38=Gun (multiple shots)
+03:39=Transport Utility
+03:40=Incinerating Grenade
+03:41=Huge fan of Squawks
+03:42=I'm making a note here...
+; the misspelled "Beethoven" is intentional (-> to beat)
+03:43=Performing Beathoven's deadly sonata
+03:44=Best before: 1923
+03:45=The power of science
+03:46=Hot Hot Hot!
+03:47=Stick these somewhere useful!
+03:48=It's Hammer time!
+03:49=Does what you guess
+03:50=Moles fan
+03:51=Found on the ground
+03:52=UNUSED
+03:53=Type 40
+03:54=Build something
+03:55=Utility
+
+; Weapon Descriptions (use | as line breaks)
+04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:01=Attack your enemies using a cluster bomb.|It will split into smaller bombs once its timer|reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:02=Attack your enemies using a ballistic projectile|that might be influenced by wind.|Attack: Hold to shoot with more power
+04:03=Launch an explosive bee that will lock on|the selected target. Don't shoot with full power|to improve its precision.|Cursor: Pick target|Attack: Hold to shoot with more power
+04:04=Attack your enemy using a shotgun with two shots.|Thanks to its spread you don't need direct hits|to harm your opponents.|Attack: Shoot (multiple times)
+04:05=Move underground! Use the pickhammer to drill|a hole into the ground and reach other areas.|Attack: Start or stop digging
+04:06=Bored? No way to attack? Save your ammo?|No problem! Just skip your turn, coward!|Attack: Skip your turn without fighting
+04:07=Bridge huge distances using timed shots with the|rope. Use your momentum to slide into other hogs|or drop grenades and other weapons on them.|Attack: Shoot or release the rope|Long Jump: Drop grenades or similar weapons
+04:08=Keep your enemies away by dropping a mine in|narrow passages or right below their feet. Be|sure to retreat before you trigger it yourself!|Attack: Drop mine next to your feet
+04:09=Not sure about your aiming? Use the Desert|Eagle to attack using up to four shots.|Attack: Shoot (multiple times)
+04:10=Brute force is always an option. Drop this classic|explosive next to your enemies and retreat.|Attack: Drop dynamite next to your feet
+04:11=Get rid of enemy hogs by batting them over|the map borders or into water. Or how about|knocking some mines to your friends?|Attack: Bat everything in front of you
+04:12=Get close and personal to unleash the power of|this almost deadly martial arts technique.|Attack: Perform the amazing Shoryuken.
+04:13=UNUSED
+04:14=Fear of heights? Better grab a parachute.|It will unfold once|you fall too far and|save your hog from taking fall damage.|Attack: Unfold the parachute|Long Jump: Drop grenades or similar weapons
+04:15=Call in an airplane to attack your enemies|using a bombing run.|Left/Right: Determine attack direction|Cursor: Select target region
+04:16=Call in an airplane to drop several mines|in the target area.|Left/Right: Determine attack direction|Cursor: Select target region
+04:17=Need shelter? Use the blow torch to dig|a tunnel into solid ground granting you|cover.|Attack: Start or stop digging
+04:18=Need additional protection or want to pass|unpassable ground? Place some girders as you|like.|Left/Right: Select girder to place|Cursor: Place girder in a valid position
+04:19=Used at the right moment teleportation can|be more powerful than almost all weapons as|it allows you to save hogs from dangerous|situations within seconds.|Cursor: Select target region
+04:20=Allows you to play the current turn with|a different hog.|Attack: Enable switching hogs
+04:21=Shoot a grenade-like projectile that will|release multiple bombs upon impact.|Attack: Shoot at full power
+04:22=Not just for Indiana Jones! The whip is a|useful weapon in many situations. Especially|when you'd like to shove someone off a cliff.|Attack: Strike everything in front of you
+04:23=If you have nothing to lose, this might be|quite handy. Sacrifice your hog by launching|him into a specific direction hurting everything|on his way and exploding at the end.|Attack: Launch the devastating and deadly attack
+04:24=Happy Birthday! Launch this cake, let it walk right|next to your enemies and let them have an explosive|party. The cake is able to pass almost all terrain|but he might detonate earlier this way.|Attack: Start the cake or let it stop and explode
+04:25=Use this disguise kit to get your enemies to jump|towards your hog (and into some gap or hole).|Attack: Use the kit and try to seduce another hog
+04:26=Throw this juicy watermelon at your enemies. Once|the timer expires, it will split into several|explosive pieces.|1-5: Set watermelon's timer|Attack: Hold to shoot with more power
+04:27=Let hellfire rain onto your opponents by using|this fiendish explosive. Don't get too close to|the explosion as smaller fires might last longer.|Attack: Hold to shoot with more power
+04:28=Short time after launching this rocket, it will|start drilling through solid ground and explode|once its fuse is triggered or it resurfaces again.|Attack: Hold to shoot with more power
+04:29=This is nothing for small kids! The ball gun fires|tons of small colored balls filled with explosives.|Attack: Shoot at full power|Up/Down: Continue aiming
+04:30=Call in an airplane to launch a powerful napalm|strike. With proper aiming this attack can eradicate|huge parts of landscape including unlucky hogs|sitting there.|Left/Right: Determine attack direction|Cursor: Select target region
+04:31=The RC plane is the ideal weapon to collect crates or|attack far away hogs. Either steer it into enemies or|drop some bombs first.|Attack: Launch the plane or drop bombs|Long Jump: Let the valkyries ride into battle|Left/Right: Steer the plane
+04:32=Low gravity is more effective than any diet! Jump|higher and over greater distances or let your enemies|fly even further.|Attack: Activate
+04:33=Sometimes you just need that little extra boost to|deal some more damage.|Attack: Activate
+04:34=Can't touch me!|Attack: Activate
+04:35=Sometimes time's running too fast. Grab some extra|seconds to finish your attack.|Attack: Activate
+04:36=Well, sometimes you're just too bad in aiming. Get|some assistance using modern day technology.|Attack: Activate
+04:37=Don't fear the daylight. It will just last one turn|but will enable you to absorb the damage you do to|other hogs.|Attack: Activate
+04:38=The sniper rifle can be the most devastating weapon|in your whole arsenal, however it's very ineffective|at close quarters. The damage dealt increases with|the distance to its target.|Attack: Shoot (twice)
+04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility is able to|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force in one direction|Long Jump: Drop grenades or similar weapons
+04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Attack: Hold to shoot with more power
+04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Be quick, as using Birdy eats into your turn|time!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction
+04:42=This portable portal device is capable|of instantly transporting you, your enemies,|or your weaponry between two points on the|terrain.|Use it wisely and your campaign will be a...|HUGE SUCCESS!|Attack: Shoot a portal|Switch: Cycle portal colours
+04:43=Make your musical debut an explosive success!|Drop a piano from the heavens, but beware...|someone needs to play it, and that may cost you|your life!|Cursor: Select target region|F1-F9: Play the piano
+04:44=This isn't just cheese, it's biological warfare!|It won't cause an huge amount of damage once|the timer reaches zero but it will definitely|poison anyone unlucky to touch the smell!|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:45=All those physics classes have finally|paid off, launch a devastating Sine|wave at your foes.|Watch out, this weapon packs quite a kick. (This weapon is incomplete)|Attack: Shoot
+04:46=Cover your foes with sizzling liquid flame.|Heartwarming!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power
+04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice)
+04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate
+04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection
+04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig.
+04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back.
+04:52=UNUSED
+04:53=Go on an adventure through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.
+04:54=INCOMPLETE                                                                                                                                     
+04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you!
+
+; Game goal strings
+05:00=Game Modes
+05:01=The following rules apply
+05:02=Forts: Defend your fortress; vanquish your enemies!
+05:03=Low Gravity: Watch your step
+05:04=Invulnerability: Hogs are (almost) invulnerable
+05:05=Vampirism: Hogs will be healed for the damage dealt
+05:06=Karma: Hogs will be damaged for the damage dealt
+05:07=Protect the King: Don't let your king die!|Place the King: Pick a protected starting point for your King
+05:08=Place Hedgehogs: Place your hogs before the game starts
+05:09=Artillery: Hogs can't walk to change position
+05:10=Indestructible Terrain: Most weapons won't destroy terrain
+05:11=Shared Ammo: All teams of the same color share their ammunition
+05:12=Mine Timers: Mines will detonate after %1 second(s)
+05:13=Mine Timers: Mines will detonate instantly
+05:14=Mine Timers: Mines will detonate after 0 - 5 seconds
+05:15=Damage Modifier: All weapons will do %1% damage
+05:16=Health of all hogs is reset on end of turn
+05:17=AI hogs respawn on death
+05:18=Unlimited Attacks
+05:19=Weapons are reset on end of turn
+05:20=Weapons are not shared between hogs
+05:21=Tag Team: Teams in a clan takes successive turns|Shared Time: Teams within a clan share turn time
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Locale/hedgewars_en.qm b/project_files/Android-build/SDL-android-project/assets/Data/Locale/hedgewars_en.qm
new file mode 100644
index 0000000..e364859
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Locale/hedgewars_en.qm differ
diff --git a/share/hedgewars/Data/Maps/Cogs/map.cfg b/project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/map.cfg
similarity index 100%
copy from share/hedgewars/Data/Maps/Cogs/map.cfg
copy to project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/map.cfg
diff --git a/share/hedgewars/Data/Maps/EarthRise/map.png b/project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/map.png
similarity index 100%
copy from share/hedgewars/Data/Maps/EarthRise/map.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/map.png
diff --git a/share/hedgewars/Data/Maps/EarthRise/preview.png b/project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/preview.png
similarity index 100%
copy from share/hedgewars/Data/Maps/EarthRise/preview.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Maps/EarthRise/preview.png
diff --git a/share/hedgewars/Data/Music/EarthRise.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Music/EarthRise.ogg
similarity index 100%
copy from share/hedgewars/Data/Music/EarthRise.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Music/EarthRise.ogg
diff --git a/share/hedgewars/Data/Sounds/1C.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/1C.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/1C.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/1C.ogg
diff --git a/share/hedgewars/Data/Sounds/2D.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/2D.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/2D.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/2D.ogg
diff --git a/share/hedgewars/Data/Sounds/3E.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/3E.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/3E.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/3E.ogg
diff --git a/share/hedgewars/Data/Sounds/4F.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/4F.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/4F.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/4F.ogg
diff --git a/share/hedgewars/Data/Sounds/5G.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/5G.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/5G.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/5G.ogg
diff --git a/share/hedgewars/Data/Sounds/6A.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/6A.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/6A.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/6A.ogg
diff --git a/share/hedgewars/Data/Sounds/7B.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/7B.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/7B.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/7B.ogg
diff --git a/share/hedgewars/Data/Sounds/8C.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/8C.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/8C.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/8C.ogg
diff --git a/share/hedgewars/Data/Sounds/9D.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/9D.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/9D.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/9D.ogg
diff --git a/share/hedgewars/Data/Sounds/BirdyLay.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/BirdyLay.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/BirdyLay.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/BirdyLay.ogg
diff --git a/share/hedgewars/Data/Sounds/CollectCrate.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/CollectCrate.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/CollectCrate.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/CollectCrate.ogg
diff --git a/share/hedgewars/Data/Sounds/Droplet1.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet1.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Droplet1.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet1.ogg
diff --git a/share/hedgewars/Data/Sounds/Droplet2.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet2.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Droplet2.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet2.ogg
diff --git a/share/hedgewars/Data/Sounds/Droplet3.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet3.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Droplet3.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Droplet3.ogg
diff --git a/share/hedgewars/Data/Sounds/Hellish.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Hellish.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Hellish.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Hellish.ogg
diff --git a/share/hedgewars/Data/Sounds/Whistle.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Whistle.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Whistle.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Whistle.ogg
diff --git a/share/hedgewars/Data/Sounds/Yoohoo.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/Yoohoo.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/Yoohoo.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/Yoohoo.ogg
diff --git a/share/hedgewars/Data/Sounds/baseballbat.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/baseballbat.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/baseballbat.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/baseballbat.ogg
diff --git a/share/hedgewars/Data/Sounds/bee.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/bee.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/bee.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/bee.ogg
diff --git a/project_files/Android-build/SDL-android-project/assets/Data/Sounds/beewater.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/beewater.ogg
new file mode 100644
index 0000000..0661862
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/beewater.ogg differ
diff --git a/share/hedgewars/Data/Sounds/bump.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/bump.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/bump.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/bump.ogg
diff --git a/share/hedgewars/Data/Sounds/cake2.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/cake2.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/cake2.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/cake2.ogg
diff --git a/share/hedgewars/Data/Sounds/denied.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/denied.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/denied.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/denied.ogg
diff --git a/share/hedgewars/Data/Sounds/drillgun.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/drillgun.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/drillgun.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/drillgun.ogg
diff --git a/share/hedgewars/Data/Sounds/egg.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/egg.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/egg.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/egg.ogg
diff --git a/share/hedgewars/Data/Sounds/explosion.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/explosion.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/explosion.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/explosion.ogg
diff --git a/share/hedgewars/Data/Sounds/graveimpact.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/graveimpact.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/graveimpact.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/graveimpact.ogg
diff --git a/share/hedgewars/Data/Sounds/grenadeimpact.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/grenadeimpact.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/grenadeimpact.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/grenadeimpact.ogg
diff --git a/share/hedgewars/Data/Sounds/gun.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/gun.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/gun.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/gun.ogg
diff --git a/share/hedgewars/Data/Sounds/hammer.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hammer.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hammer.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hammer.ogg
diff --git a/share/hedgewars/Data/Sounds/hell_growl.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_growl.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hell_growl.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_growl.ogg
diff --git a/share/hedgewars/Data/Sounds/hell_ooff.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ooff.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hell_ooff.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ooff.ogg
diff --git a/share/hedgewars/Data/Sounds/hell_ow.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ow.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hell_ow.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ow.ogg
diff --git a/share/hedgewars/Data/Sounds/hell_ugh.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ugh.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hell_ugh.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hell_ugh.ogg
diff --git a/share/hedgewars/Data/Sounds/hogchant3.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/hogchant3.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/hogchant3.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/hogchant3.ogg
diff --git a/share/hedgewars/Data/Sounds/homerun.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/homerun.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/homerun.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/homerun.ogg
diff --git a/share/hedgewars/Data/Sounds/lowgravity.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/lowgravity.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/lowgravity.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/lowgravity.ogg
diff --git a/share/hedgewars/Data/Sounds/melonimpact.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/melonimpact.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/melonimpact.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/melonimpact.ogg
diff --git a/share/hedgewars/Data/Sounds/mineimpact.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/mineimpact.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/mineimpact.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/mineimpact.ogg
diff --git a/share/hedgewars/Data/Sounds/minetick.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/minetick.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/minetick.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/minetick.ogg
diff --git a/share/hedgewars/Data/Sounds/molotov.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/molotov.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/molotov.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/molotov.ogg
diff --git a/share/hedgewars/Data/Sounds/mortar.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/mortar.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/mortar.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/mortar.ogg
diff --git a/share/hedgewars/Data/Sounds/parachute.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/parachute.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/parachute.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/parachute.ogg
diff --git a/share/hedgewars/Data/Sounds/pickhammer.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/pickhammer.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/pickhammer.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/pickhammer.ogg
diff --git a/share/hedgewars/Data/Sounds/placed.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/placed.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/placed.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/placed.ogg
diff --git a/share/hedgewars/Data/Sounds/plane.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/plane.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/plane.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/plane.ogg
diff --git a/share/hedgewars/Data/Sounds/rcplane.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/rcplane.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/rcplane.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/rcplane.ogg
diff --git a/share/hedgewars/Data/Sounds/ride_of_the_valkyries.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/ride_of_the_valkyries.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/ride_of_the_valkyries.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/ride_of_the_valkyries.ogg
diff --git a/share/hedgewars/Data/Sounds/ropeattach.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/ropeattach.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/ropeattach.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/ropeattach.ogg
diff --git a/share/hedgewars/Data/Sounds/roperelease.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/roperelease.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/roperelease.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/roperelease.ogg
diff --git a/share/hedgewars/Data/Sounds/ropeshot.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/ropeshot.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/ropeshot.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/ropeshot.ogg
diff --git a/share/hedgewars/Data/Sounds/shotgunfire.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/shotgunfire.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/shotgunfire.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/shotgunfire.ogg
diff --git a/share/hedgewars/Data/Sounds/shotgunreload.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/shotgunreload.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/shotgunreload.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/shotgunreload.ogg
diff --git a/share/hedgewars/Data/Sounds/shutterclick.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/shutterclick.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/shutterclick.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/shutterclick.ogg
diff --git a/share/hedgewars/Data/Sounds/sinegun.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/sinegun.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/sinegun.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/sinegun.ogg
diff --git a/share/hedgewars/Data/Sounds/skip.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/skip.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/skip.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/skip.ogg
diff --git a/share/hedgewars/Data/Sounds/sniperreload.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/sniperreload.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/sniperreload.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/sniperreload.ogg
diff --git a/share/hedgewars/Data/Sounds/splash.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/splash.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/splash.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/splash.ogg
diff --git a/share/hedgewars/Data/Sounds/steam.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/steam.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/steam.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/steam.ogg
diff --git a/share/hedgewars/Data/Sounds/steps.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/steps.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/steps.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/steps.ogg
diff --git a/share/hedgewars/Data/Sounds/suddendeath.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/suddendeath.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/suddendeath.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/suddendeath.ogg
diff --git a/share/hedgewars/Data/Sounds/switchhog.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/switchhog.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/switchhog.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/switchhog.ogg
diff --git a/share/hedgewars/Data/Sounds/throwpowerup.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/throwpowerup.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/throwpowerup.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/throwpowerup.ogg
diff --git a/share/hedgewars/Data/Sounds/throwrelease.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/throwrelease.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/throwrelease.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/throwrelease.ogg
diff --git a/share/hedgewars/Data/Sounds/ufo.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/ufo.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/ufo.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/ufo.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Boring.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Boring.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Boring.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Boring.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Byebye.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Byebye.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Byebye.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Byebye.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Comeonthen.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Comeonthen.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Comeonthen.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Comeonthen.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Coward.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Coward.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Coward.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Coward.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Enemydown.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Enemydown.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Enemydown.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Enemydown.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Firstblood.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Firstblood.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Firstblood.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Firstblood.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Flawless.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Flawless.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Flawless.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Flawless.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Hello.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Hello.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Hello.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Hello.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Hurry.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Hurry.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Hurry.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Hurry.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Illgetyou.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Illgetyou.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Illgetyou.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Illgetyou.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Incoming.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Incoming.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Incoming.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Incoming.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Jump1.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump1.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Jump1.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump1.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Jump2.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump2.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Jump2.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump2.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Jump3.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump3.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Jump3.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Jump3.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Kamikaze.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Kamikaze.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Kamikaze.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Kamikaze.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Laugh.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Laugh.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Laugh.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Laugh.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Missed.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Missed.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Missed.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Missed.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Nooo.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Nooo.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Nooo.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Nooo.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Nutter.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Nutter.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Nutter.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Nutter.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ooff1.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff1.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ooff1.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff1.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ooff2.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff2.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ooff2.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff2.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ooff3.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff3.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ooff3.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ooff3.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Oops.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Oops.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Oops.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Oops.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ow1.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow1.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ow1.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow1.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ow2.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow2.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ow2.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow2.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ow3.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow3.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ow3.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow3.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Ow4.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow4.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Ow4.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Ow4.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/British/PoisonCough.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/PoisonCough.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/British/PoisonCough.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/PoisonCough.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/British/PoisonMoan.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/PoisonMoan.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/British/PoisonMoan.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/PoisonMoan.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Reinforcements.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Reinforcements.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Reinforcements.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Reinforcements.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Sameteam.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Sameteam.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Sameteam.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Sameteam.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Stupid.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Stupid.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Stupid.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Stupid.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Takecover.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Takecover.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Takecover.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Takecover.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Traitor.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Traitor.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Traitor.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Traitor.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Uh-oh.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Uh-oh.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Uh-oh.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Uh-oh.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Victory.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Victory.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Victory.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Victory.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Watchit.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Watchit.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Watchit.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Watchit.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Yessir.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Yessir.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Yessir.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Yessir.ogg
diff --git a/share/hedgewars/Data/Sounds/voices/Classic/Youllregretthat.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Youllregretthat.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/voices/Classic/Youllregretthat.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/voices/Classic/Youllregretthat.ogg
diff --git a/share/hedgewars/Data/Sounds/warp.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/warp.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/warp.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/warp.ogg
diff --git a/share/hedgewars/Data/Sounds/whipcrack.ogg b/project_files/Android-build/SDL-android-project/assets/Data/Sounds/whipcrack.ogg
similarity index 100%
copy from share/hedgewars/Data/Sounds/whipcrack.ogg
copy to project_files/Android-build/SDL-android-project/assets/Data/Sounds/whipcrack.ogg
diff --git a/share/hedgewars/Data/Themes/EarthRise/Border.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Border.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/Border.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Border.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/Chunk.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Chunk.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/Chunk.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Chunk.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/Flake.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Flake.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/Flake.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Flake.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/LandBackTex.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/LandBackTex.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/LandBackTex.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/LandBackTex.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/LandTex.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/LandTex.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/LandTex.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/LandTex.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/Rock.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Rock.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/Rock.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Rock.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/RockShort.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/RockShort.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/RockShort.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/RockShort.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/Sky.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Sky.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/Sky.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/Sky.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/SkyL.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/SkyL.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/SkyL.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/SkyL.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/SkyL.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/SkyR.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/SkyL.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/SkyR.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/horizont.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/horizont.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/horizont.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/horizont.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/horizontR.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/horizontR.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/horizontR.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/horizontR.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/icon.png b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/icon.png
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/icon.png
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/icon.png
diff --git a/share/hedgewars/Data/Themes/EarthRise/theme.cfg b/project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/theme.cfg
similarity index 100%
copy from share/hedgewars/Data/Themes/EarthRise/theme.cfg
copy to project_files/Android-build/SDL-android-project/assets/Data/Themes/EarthRise/theme.cfg
diff --git a/project_files/Android-build/SDL-android-project/build.properties b/project_files/Android-build/SDL-android-project/build.properties
new file mode 100644
index 0000000..edc7f23
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/build.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+# 
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
diff --git a/project_files/Android-build/SDL-android-project/build.xml b/project_files/Android-build/SDL-android-project/build.xml
new file mode 100644
index 0000000..4073e11
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/build.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="MainActivity" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <loadproperties srcFile="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
+            unless="sdk.dir"
+    />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+     in between standard targets -->
+<!--
+    <target name="-pre-build">
+    </target>
+    <target name="-pre-compile">
+    </target>
+
+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
+    <target name="-post-compile">
+    </target>
+-->
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>
diff --git a/project_files/Android-build/SDL-android-project/jni/Android.mk b/project_files/Android-build/SDL-android-project/jni/Android.mk
new file mode 100644
index 0000000..ff2c49c
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/Android.mk
@@ -0,0 +1,10 @@
+#Set the current path must be set like this because call all-subdir-makefiles changes LOCAL_PATH
+JNI_DIR  := $(call my-dir)
+LOCAL_PATH := $(JNI_DIR)
+
+include $(call all-subdir-makefiles)
+
+include $(CLEAR_VARS)
+include $(JNI_DIR)/../../../../misc/Android.mk
+
+
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
new file mode 100644
index 0000000..bd5ee98
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/core/android/SDL_android.cpp
@@ -0,0 +1,654 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken at libsdl.org>
+
+  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.
+*/
+#include "SDL_config.h"
+#include "SDL_stdinc.h"
+
+#ifdef __ANDROID__
+
+#include "SDL_android.h"
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+#include "../../video/android/SDL_androidkeyboard.h"
+#include "../../video/android/SDL_androidtouch.h"
+#include "../../video/android/SDL_androidvideo.h"
+
+#include <android/log.h>
+#define LOG_TAG "SDL_android"
+//#define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+//#define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+#define LOGI(...) do {} while (false)
+#define LOGE(...) do {} while (false)
+
+
+/* Implemented in audio/android/SDL_androidaudio.c */
+extern void Android_RunAudioThread();
+} // C
+
+/*******************************************************************************
+ This file links the Java side of Android with libsdl
+*******************************************************************************/
+#include <jni.h>
+#include <android/log.h>
+
+
+/*******************************************************************************
+                               Globals
+*******************************************************************************/
+static JNIEnv* mEnv = NULL;
+static JNIEnv* mAudioEnv = NULL;
+static JavaVM* mJavaVM;
+
+// Main activity
+static jclass mActivityClass;
+
+// method signatures
+static jmethodID midCreateGLContext;
+static jmethodID midFlipBuffers;
+static jmethodID midAudioInit;
+static jmethodID midAudioWriteShortBuffer;
+static jmethodID midAudioWriteByteBuffer;
+static jmethodID midAudioQuit;
+
+// Accelerometer data storage
+static float fLastAccelerometer[3];
+static bool bHasNewData;
+
+/*******************************************************************************
+                 Functions called by JNI
+*******************************************************************************/
+
+// Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    JNIEnv *env;
+    mJavaVM = vm;
+    LOGI("JNI_OnLoad called");
+    if (mJavaVM->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
+        LOGE("Failed to get the environment using GetEnv()");
+        return -1;
+    }
+
+    return JNI_VERSION_1_4;
+}
+
+// Called before SDL_main() to initialize JNI bindings
+extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls)
+{
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
+
+    mEnv = env;
+    mActivityClass = (jclass)env->NewGlobalRef(cls);
+
+    midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
+                                "createGLContext","(II)Z");
+    midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass,
+                                "flipBuffers","()V");
+    midAudioInit = mEnv->GetStaticMethodID(mActivityClass, 
+                                "audioInit", "(IZZI)Ljava/lang/Object;");
+    midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioWriteShortBuffer", "([S)V");
+    midAudioWriteByteBuffer = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioWriteByteBuffer", "([B)V");
+    midAudioQuit = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioQuit", "()V");
+
+    bHasNewData = false;
+
+    if(!midCreateGLContext || !midFlipBuffers || !midAudioInit ||
+       !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
+        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
+    }
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!");
+}
+
+// Resize
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeResize(
+                                    JNIEnv* env, jclass jcls,
+                                    jint width, jint height, jint format)
+{
+    Android_SetScreenResolution(width, height, format);
+}
+
+// Keydown
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeKeyDown(
+                                    JNIEnv* env, jclass jcls, jint keycode)
+{
+    Android_OnKeyDown(keycode);
+}
+
+// Keyup
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeKeyUp(
+                                    JNIEnv* env, jclass jcls, jint keycode)
+{
+    Android_OnKeyUp(keycode);
+}
+
+// Touch
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeTouch(
+                                    JNIEnv* env, jclass jcls,
+                                    jint touch_device_id_in, jint pointer_finger_id_in,
+                                    jint action, jfloat x, jfloat y, jfloat p)
+{
+    Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p);
+}
+
+// Accelerometer
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_onNativeAccel(
+                                    JNIEnv* env, jclass jcls,
+                                    jfloat x, jfloat y, jfloat z)
+{
+    fLastAccelerometer[0] = x;
+    fLastAccelerometer[1] = y;
+    fLastAccelerometer[2] = z;
+    bHasNewData = true;
+}
+
+// Quit
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativeQuit(
+                                    JNIEnv* env, jclass cls)
+{    
+    // Inject a SDL_QUIT event
+    SDL_SendQuit();
+}
+
+// Pause
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativePause(
+                                    JNIEnv* env, jclass cls)
+{
+    if (Android_Window) {
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0);
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_MINIMIZED, 0, 0);
+    }
+}
+
+// Resume
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativeResume(
+                                    JNIEnv* env, jclass cls)
+{
+    if (Android_Window) {
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0);
+        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0);
+    }
+}
+
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativeRunAudioThread(
+                                    JNIEnv* env, jclass cls)
+{
+    /* This is the audio thread, with a different environment */
+    mAudioEnv = env;
+
+    Android_RunAudioThread();
+}
+
+
+/*******************************************************************************
+             Functions called by SDL into Java
+*******************************************************************************/
+extern "C" SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion)
+{
+    if (mEnv->CallStaticBooleanMethod(mActivityClass, midCreateGLContext, majorVersion, minorVersion)) {
+        return SDL_TRUE;
+    } else {
+        return SDL_FALSE;
+    }
+}
+
+extern "C" void Android_JNI_SwapWindow()
+{
+    mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers); 
+}
+
+extern "C" void Android_JNI_SetActivityTitle(const char *title)
+{
+    jmethodID mid;
+
+    mid = mEnv->GetStaticMethodID(mActivityClass,"setActivityTitle","(Ljava/lang/String;)V");
+    if (mid) {
+        mEnv->CallStaticVoidMethod(mActivityClass, mid, mEnv->NewStringUTF(title));
+    }
+}
+
+extern "C" SDL_bool Android_JNI_GetAccelerometerValues(float values[3])
+{
+    int i;
+    SDL_bool retval = SDL_FALSE;
+
+    if (bHasNewData) {
+        for (i = 0; i < 3; ++i) {
+            values[i] = fLastAccelerometer[i];
+        }
+        bHasNewData = false;
+        retval = SDL_TRUE;
+    }
+
+    return retval;
+}
+
+//
+// Audio support
+//
+static jboolean audioBuffer16Bit = JNI_FALSE;
+static jboolean audioBufferStereo = JNI_FALSE;
+static jobject audioBuffer = NULL;
+static void* audioBufferPinned = NULL;
+
+extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
+{
+    int audioBufferFrames;
+
+    int status;
+    JNIEnv *env;
+    static bool isAttached = false;    
+    status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
+    if(status < 0) {
+        LOGE("callback_handler: failed to get JNI environment, assuming native thread");
+        status = mJavaVM->AttachCurrentThread(&env, NULL);
+        if(status < 0) {
+            LOGE("callback_handler: failed to attach current thread");
+            return 0;
+        }
+        isAttached = true;
+    }
+
+    
+    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
+    audioBuffer16Bit = is16Bit;
+    audioBufferStereo = channelCount > 1;
+
+    audioBuffer = env->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
+
+    if (audioBuffer == NULL) {
+        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!");
+        return 0;
+    }
+    audioBuffer = env->NewGlobalRef(audioBuffer);
+
+    jboolean isCopy = JNI_FALSE;
+    if (audioBuffer16Bit) {
+        audioBufferPinned = env->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
+        audioBufferFrames = env->GetArrayLength((jshortArray)audioBuffer);
+    } else {
+        audioBufferPinned = env->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
+        audioBufferFrames = env->GetArrayLength((jbyteArray)audioBuffer);
+    }
+    if (audioBufferStereo) {
+        audioBufferFrames /= 2;
+    }
+ 
+    if (isAttached) {
+        mJavaVM->DetachCurrentThread();
+    }
+
+    return audioBufferFrames;
+}
+
+extern "C" void * Android_JNI_GetAudioBuffer()
+{
+    return audioBufferPinned;
+}
+
+extern "C" void Android_JNI_WriteAudioBuffer()
+{
+    if (audioBuffer16Bit) {
+        mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
+        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
+    } else {
+        mAudioEnv->ReleaseByteArrayElements((jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT);
+        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer);
+    }
+
+    /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
+}
+
+extern "C" void Android_JNI_CloseAudioDevice()
+{
+    int status;
+    JNIEnv *env;
+    static bool isAttached = false;    
+    status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
+    if(status < 0) {
+        LOGE("callback_handler: failed to get JNI environment, assuming native thread");
+        status = mJavaVM->AttachCurrentThread(&env, NULL);
+        if(status < 0) {
+            LOGE("callback_handler: failed to attach current thread");
+            return;
+        }
+        isAttached = true;
+    }
+
+    env->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
+
+    if (audioBuffer) {
+        env->DeleteGlobalRef(audioBuffer);
+        audioBuffer = NULL;
+        audioBufferPinned = NULL;
+    }
+
+    if (isAttached) {
+        mJavaVM->DetachCurrentThread();
+    }
+}
+
+// Test for an exception and call SDL_SetError with its detail if one occurs
+static bool Android_JNI_ExceptionOccurred()
+{
+    jthrowable exception = mEnv->ExceptionOccurred();
+    if (exception != NULL) {
+        jmethodID mid;
+
+        // Until this happens most JNI operations have undefined behaviour
+        mEnv->ExceptionClear();
+
+        jclass exceptionClass = mEnv->GetObjectClass(exception);
+        jclass classClass = mEnv->FindClass("java/lang/Class");
+
+        mid = mEnv->GetMethodID(classClass, "getName", "()Ljava/lang/String;");
+        jstring exceptionName = (jstring)mEnv->CallObjectMethod(exceptionClass, mid);
+        const char* exceptionNameUTF8 = mEnv->GetStringUTFChars(exceptionName, 0);
+
+        mid = mEnv->GetMethodID(exceptionClass, "getMessage", "()Ljava/lang/String;");
+        jstring exceptionMessage = (jstring)mEnv->CallObjectMethod(exception, mid);
+
+        if (exceptionMessage != NULL) {
+            const char* exceptionMessageUTF8 = mEnv->GetStringUTFChars(
+                    exceptionMessage, 0);
+            SDL_SetError("%s: %s", exceptionNameUTF8, exceptionMessageUTF8);
+            mEnv->ReleaseStringUTFChars(exceptionMessage, exceptionMessageUTF8);
+            mEnv->DeleteLocalRef(exceptionMessage);
+        } else {
+            SDL_SetError("%s", exceptionNameUTF8);
+        }
+
+        mEnv->ReleaseStringUTFChars(exceptionName, exceptionNameUTF8);
+        mEnv->DeleteLocalRef(exceptionName);
+        mEnv->DeleteLocalRef(classClass);
+        mEnv->DeleteLocalRef(exceptionClass);
+        mEnv->DeleteLocalRef(exception);
+
+        return true;
+    }
+
+    return false;
+}
+
+static int Android_JNI_FileOpen(SDL_RWops* ctx)
+{
+    int result = 0;
+
+    jmethodID mid;
+    jobject context;
+    jobject assetManager;
+    jobject inputStream;
+    jclass channels;
+    jobject readableByteChannel;
+    jstring fileNameJString;
+
+    bool allocatedLocalFrame = false;
+
+    if (mEnv->PushLocalFrame(16) < 0) {
+        SDL_SetError("Failed to allocate enough JVM local references");
+        goto failure;
+    } else {
+        allocatedLocalFrame = true;
+    }
+
+    fileNameJString = (jstring)ctx->hidden.androidio.fileName;
+
+    // context = SDLActivity.getContext();
+    mid = mEnv->GetStaticMethodID(mActivityClass,
+            "getContext","()Landroid/content/Context;");
+    context = mEnv->CallStaticObjectMethod(mActivityClass, mid);
+
+    // assetManager = context.getAssets();
+    mid = mEnv->GetMethodID(mEnv->GetObjectClass(context),
+            "getAssets", "()Landroid/content/res/AssetManager;");
+    assetManager = mEnv->CallObjectMethod(context, mid);
+
+    // inputStream = assetManager.open(<filename>);
+    mid = mEnv->GetMethodID(mEnv->GetObjectClass(assetManager),
+            "open", "(Ljava/lang/String;)Ljava/io/InputStream;");
+    inputStream = mEnv->CallObjectMethod(assetManager, mid, fileNameJString);
+    if (Android_JNI_ExceptionOccurred()) {
+        goto failure;
+    }
+
+    ctx->hidden.androidio.inputStream = inputStream;
+    ctx->hidden.androidio.inputStreamRef = mEnv->NewGlobalRef(inputStream);
+
+    // Despite all the visible documentation on [Asset]InputStream claiming
+    // that the .available() method is not guaranteed to return the entire file
+    // size, comments in <sdk>/samples/<ver>/ApiDemos/src/com/example/ ...
+    // android/apis/content/ReadAsset.java imply that Android's
+    // AssetInputStream.available() /will/ always return the total file size
+
+    // size = inputStream.available();
+    mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream),
+            "available", "()I");
+    ctx->hidden.androidio.size = mEnv->CallIntMethod(inputStream, mid);
+    if (Android_JNI_ExceptionOccurred()) {
+        goto failure;
+    }
+
+    // readableByteChannel = Channels.newChannel(inputStream);
+    channels = mEnv->FindClass("java/nio/channels/Channels");
+    mid = mEnv->GetStaticMethodID(channels,
+            "newChannel",
+            "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;");
+    readableByteChannel = mEnv->CallStaticObjectMethod(
+            channels, mid, inputStream);
+    if (Android_JNI_ExceptionOccurred()) {
+        goto failure;
+    }
+
+    ctx->hidden.androidio.readableByteChannel = readableByteChannel;
+    ctx->hidden.androidio.readableByteChannelRef =
+        mEnv->NewGlobalRef(readableByteChannel);
+
+    // Store .read id for reading purposes
+    mid = mEnv->GetMethodID(mEnv->GetObjectClass(readableByteChannel),
+            "read", "(Ljava/nio/ByteBuffer;)I");
+    ctx->hidden.androidio.readMethod = mid;
+
+    ctx->hidden.androidio.position = 0;
+
+    if (false) {
+failure:
+        result = -1;
+
+        mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.fileNameRef);
+
+        if(ctx->hidden.androidio.inputStreamRef != NULL) {
+            mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.inputStreamRef);
+        }
+    }
+
+    if (allocatedLocalFrame) {
+        mEnv->PopLocalFrame(NULL);
+    }
+
+    return result;
+}
+
+extern "C" int Android_JNI_FileOpen(SDL_RWops* ctx,
+        const char* fileName, const char*)
+{
+    if (!ctx) {
+        return -1;
+    }
+
+    jstring fileNameJString = mEnv->NewStringUTF(fileName);
+    ctx->hidden.androidio.fileName = fileNameJString;
+    ctx->hidden.androidio.fileNameRef = mEnv->NewGlobalRef(fileNameJString);
+    ctx->hidden.androidio.inputStreamRef = NULL;
+    mEnv->DeleteLocalRef(fileNameJString);
+
+    return Android_JNI_FileOpen(ctx);
+}
+
+extern "C" size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer,
+        size_t size, size_t maxnum)
+{
+    int bytesRemaining = size * maxnum;
+    int bytesRead = 0;
+
+    jobject readableByteChannel = (jobject)ctx->hidden.androidio.readableByteChannel;
+    jmethodID readMethod = (jmethodID)ctx->hidden.androidio.readMethod;
+    jobject byteBuffer = mEnv->NewDirectByteBuffer(buffer, bytesRemaining);
+
+    while (bytesRemaining > 0) {
+        // result = readableByteChannel.read(...);
+        int result = mEnv->CallIntMethod(readableByteChannel, readMethod, byteBuffer);
+
+        if (Android_JNI_ExceptionOccurred()) {
+            mEnv->DeleteLocalRef(byteBuffer);
+            return 0;
+        }
+
+        if (result < 0) {
+            break;
+        }
+
+        bytesRemaining -= result;
+        bytesRead += result;
+        ctx->hidden.androidio.position += result;
+    }
+
+    mEnv->DeleteLocalRef(byteBuffer);
+
+    return bytesRead / size;
+}
+
+extern "C" size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer,
+        size_t size, size_t num)
+{
+    SDL_SetError("Cannot write to Android package filesystem");
+    return 0;
+}
+
+static int Android_JNI_FileClose(SDL_RWops* ctx, bool release)
+{
+    int result = 0;
+
+    if (ctx) {
+        if (release) {
+            mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.fileNameRef);
+        }
+
+        jobject inputStream = (jobject)ctx->hidden.androidio.inputStream;
+
+        // inputStream.close();
+        jmethodID mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream),
+                "close", "()V");
+        mEnv->CallVoidMethod(inputStream, mid);
+        mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.inputStreamRef);
+        mEnv->DeleteGlobalRef((jobject)ctx->hidden.androidio.readableByteChannelRef);
+        if (Android_JNI_ExceptionOccurred()) {
+            result = -1;
+        }
+
+        if (release) {
+            SDL_FreeRW(ctx);
+        }
+    }
+
+    return result;
+}
+
+
+extern "C" long Android_JNI_FileSeek(SDL_RWops* ctx, long offset, int whence)
+{
+    long newPosition;
+
+    switch (whence) {
+        case RW_SEEK_SET:
+            newPosition = offset;
+            break;
+        case RW_SEEK_CUR:
+            newPosition = ctx->hidden.androidio.position + offset;
+            break;
+        case RW_SEEK_END:
+            newPosition = ctx->hidden.androidio.size + offset;
+            break;
+        default:
+            SDL_SetError("Unknown value for 'whence'");
+            return -1;
+    }
+    if (newPosition < 0) {
+        newPosition = 0;
+    }
+    if (newPosition > ctx->hidden.androidio.size) {
+        newPosition = ctx->hidden.androidio.size;
+    }
+
+    long movement = newPosition - ctx->hidden.androidio.position;
+    jobject inputStream = (jobject)ctx->hidden.androidio.inputStream;
+
+    if (movement > 0) {
+        unsigned char buffer[1024];
+
+        // The easy case where we're seeking forwards
+        while (movement > 0) {
+            long amount = (long) sizeof (buffer);
+            if (amount > movement) {
+                amount = movement;
+            }
+            size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
+
+            if (result <= 0) {
+                // Failed to read/skip the required amount, so fail
+                return -1;
+            }
+
+            movement -= result;
+        }
+    } else if (movement < 0) {
+        // We can't seek backwards so we have to reopen the file and seek
+        // forwards which obviously isn't very efficient
+        Android_JNI_FileClose(ctx, false);
+        Android_JNI_FileOpen(ctx);
+        Android_JNI_FileSeek(ctx, newPosition, RW_SEEK_SET);
+    }
+
+    ctx->hidden.androidio.position = newPosition;
+
+    return ctx->hidden.androidio.position;
+}
+
+extern "C" int Android_JNI_FileClose(SDL_RWops* ctx)
+{
+    return Android_JNI_FileClose(ctx, true);
+}
+
+extern "C" int Android_JNI_getDensity(){
+    jmethodID mid;
+    jint density;
+    //SDLActivity.getDensity()
+    mid = mEnv->GetStaticMethodID(mActivityClass, "getDensity", "()I");
+        if(!mid) return 160;
+    density = mEnv->CallStaticFloatMethod(mActivityClass, mid);
+    return density;
+
+}
+
+#endif /* __ANDROID__ */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c b/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c
new file mode 100755
index 0000000..5e15298
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/file/SDL_rwops.c
@@ -0,0 +1,678 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken at libsdl.org>
+
+  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.
+*/
+#include "SDL_config.h"
+
+/* This file provides a general interface for SDL to read and write
+   data sources.  It can easily be extended to files, memory, etc.
+*/
+
+#include "SDL_endian.h"
+#include "SDL_rwops.h"
+
+#ifdef __APPLE__
+#include "cocoa/SDL_rwopsbundlesupport.h"
+#endif /* __APPLE__ */
+
+#ifdef ANDROID
+#include "../core/android/SDL_android.h"
+#include <android/log.h>
+#endif
+
+#ifdef __NDS__
+/* include libfat headers for fatInitDefault(). */
+#include <fat.h>
+#endif /* __NDS__ */
+
+#ifdef __WIN32__
+
+/* Functions to read/write Win32 API file pointers */
+/* Will not use it on WinCE because stdio is buffered, it means
+   faster, and all stdio functions anyway are embedded in coredll.dll - 
+   the main wince dll*/
+
+#include "../core/windows/SDL_windows.h"
+
+#ifndef INVALID_SET_FILE_POINTER
+#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
+#endif
+
+#define READAHEAD_BUFFER_SIZE	1024
+
+static int SDLCALL
+windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
+{
+#ifndef _WIN32_WCE
+    UINT old_error_mode;
+#endif
+    HANDLE h;
+    DWORD r_right, w_right;
+    DWORD must_exist, truncate;
+    int a_mode;
+
+    if (!context)
+        return -1;              /* failed (invalid call) */
+
+    context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* mark this as unusable */
+    context->hidden.windowsio.buffer.data = NULL;
+    context->hidden.windowsio.buffer.size = 0;
+    context->hidden.windowsio.buffer.left = 0;
+
+    /* "r" = reading, file must exist */
+    /* "w" = writing, truncate existing, file may not exist */
+    /* "r+"= reading or writing, file must exist            */
+    /* "a" = writing, append file may not exist             */
+    /* "a+"= append + read, file may not exist              */
+    /* "w+" = read, write, truncate. file may not exist    */
+
+    must_exist = (SDL_strchr(mode, 'r') != NULL) ? OPEN_EXISTING : 0;
+    truncate = (SDL_strchr(mode, 'w') != NULL) ? CREATE_ALWAYS : 0;
+    r_right = (SDL_strchr(mode, '+') != NULL
+               || must_exist) ? GENERIC_READ : 0;
+    a_mode = (SDL_strchr(mode, 'a') != NULL) ? OPEN_ALWAYS : 0;
+    w_right = (a_mode || SDL_strchr(mode, '+')
+               || truncate) ? GENERIC_WRITE : 0;
+
+    if (!r_right && !w_right)   /* inconsistent mode */
+        return -1;              /* failed (invalid call) */
+
+    context->hidden.windowsio.buffer.data =
+        (char *) SDL_malloc(READAHEAD_BUFFER_SIZE);
+    if (!context->hidden.windowsio.buffer.data) {
+        SDL_OutOfMemory();
+        return -1;
+    }
+#ifdef _WIN32_WCE
+    {
+        LPTSTR tstr = WIN_UTF8ToString(filename);
+        h = CreateFile(tstr, (w_right | r_right),
+                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
+                       (must_exist | truncate | a_mode),
+                       FILE_ATTRIBUTE_NORMAL, NULL);
+        SDL_free(tstr);
+    }
+#else
+    /* Do not open a dialog box if failure */
+    old_error_mode =
+        SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+
+    {
+        LPTSTR tstr = WIN_UTF8ToString(filename);
+        h = CreateFile(tstr, (w_right | r_right),
+                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
+                       (must_exist | truncate | a_mode),
+                       FILE_ATTRIBUTE_NORMAL, NULL);
+        SDL_free(tstr);
+    }
+
+    /* restore old behavior */
+    SetErrorMode(old_error_mode);
+#endif /* _WIN32_WCE */
+
+    if (h == INVALID_HANDLE_VALUE) {
+        SDL_free(context->hidden.windowsio.buffer.data);
+        context->hidden.windowsio.buffer.data = NULL;
+        SDL_SetError("Couldn't open %s", filename);
+        return -2;              /* failed (CreateFile) */
+    }
+    context->hidden.windowsio.h = h;
+    context->hidden.windowsio.append = a_mode ? SDL_TRUE : SDL_FALSE;
+
+    return 0;                   /* ok */
+}
+
+static long SDLCALL
+windows_file_seek(SDL_RWops * context, long offset, int whence)
+{
+    DWORD windowswhence;
+    long file_pos;
+
+    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
+        SDL_SetError("windows_file_seek: invalid context/file not opened");
+        return -1;
+    }
+
+    /* FIXME: We may be able to satisfy the seek within buffered data */
+    if (whence == RW_SEEK_CUR && context->hidden.windowsio.buffer.left) {
+        offset -= (long)context->hidden.windowsio.buffer.left;
+    }
+    context->hidden.windowsio.buffer.left = 0;
+
+    switch (whence) {
+    case RW_SEEK_SET:
+        windowswhence = FILE_BEGIN;
+        break;
+    case RW_SEEK_CUR:
+        windowswhence = FILE_CURRENT;
+        break;
+    case RW_SEEK_END:
+        windowswhence = FILE_END;
+        break;
+    default:
+        SDL_SetError("windows_file_seek: Unknown value for 'whence'");
+        return -1;
+    }
+
+    file_pos =
+        SetFilePointer(context->hidden.windowsio.h, offset, NULL, windowswhence);
+
+    if (file_pos != INVALID_SET_FILE_POINTER)
+        return file_pos;        /* success */
+
+    SDL_Error(SDL_EFSEEK);
+    return -1;                  /* error */
+}
+
+static size_t SDLCALL
+windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
+{
+    size_t total_need;
+    size_t total_read = 0;
+    size_t read_ahead;
+    DWORD byte_read;
+
+    total_need = size * maxnum;
+
+    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
+        || !total_need)
+        return 0;
+
+    if (context->hidden.windowsio.buffer.left > 0) {
+        void *data = (char *) context->hidden.windowsio.buffer.data +
+            context->hidden.windowsio.buffer.size -
+            context->hidden.windowsio.buffer.left;
+        read_ahead =
+            SDL_min(total_need, context->hidden.windowsio.buffer.left);
+        SDL_memcpy(ptr, data, read_ahead);
+        context->hidden.windowsio.buffer.left -= read_ahead;
+
+        if (read_ahead == total_need) {
+            return maxnum;
+        }
+        ptr = (char *) ptr + read_ahead;
+        total_need -= read_ahead;
+        total_read += read_ahead;
+    }
+
+    if (total_need < READAHEAD_BUFFER_SIZE) {
+        if (!ReadFile
+            (context->hidden.windowsio.h, context->hidden.windowsio.buffer.data,
+             READAHEAD_BUFFER_SIZE, &byte_read, NULL)) {
+            SDL_Error(SDL_EFREAD);
+            return 0;
+        }
+        read_ahead = SDL_min(total_need, (int) byte_read);
+        SDL_memcpy(ptr, context->hidden.windowsio.buffer.data, read_ahead);
+        context->hidden.windowsio.buffer.size = byte_read;
+        context->hidden.windowsio.buffer.left = byte_read - read_ahead;
+        total_read += read_ahead;
+    } else {
+        if (!ReadFile
+            (context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) {
+            SDL_Error(SDL_EFREAD);
+            return 0;
+        }
+        total_read += byte_read;
+    }
+    return (total_read / size);
+}
+
+static size_t SDLCALL
+windows_file_write(SDL_RWops * context, const void *ptr, size_t size,
+                 size_t num)
+{
+
+    size_t total_bytes;
+    DWORD byte_written;
+    size_t nwritten;
+
+    total_bytes = size * num;
+
+    if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE
+        || total_bytes <= 0 || !size)
+        return 0;
+
+    if (context->hidden.windowsio.buffer.left) {
+        SetFilePointer(context->hidden.windowsio.h,
+                       -(LONG)context->hidden.windowsio.buffer.left, NULL,
+                       FILE_CURRENT);
+        context->hidden.windowsio.buffer.left = 0;
+    }
+
+    /* if in append mode, we must go to the EOF before write */
+    if (context->hidden.windowsio.append) {
+        if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) ==
+            INVALID_SET_FILE_POINTER) {
+            SDL_Error(SDL_EFWRITE);
+            return 0;
+        }
+    }
+
+    if (!WriteFile
+        (context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) {
+        SDL_Error(SDL_EFWRITE);
+        return 0;
+    }
+
+    nwritten = byte_written / size;
+    return nwritten;
+}
+
+static int SDLCALL
+windows_file_close(SDL_RWops * context)
+{
+
+    if (context) {
+        if (context->hidden.windowsio.h != INVALID_HANDLE_VALUE) {
+            CloseHandle(context->hidden.windowsio.h);
+            context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* to be sure */
+        }
+        if (context->hidden.windowsio.buffer.data) {
+            SDL_free(context->hidden.windowsio.buffer.data);
+            context->hidden.windowsio.buffer.data = NULL;
+        }
+        SDL_FreeRW(context);
+    }
+    return (0);
+}
+#endif /* __WIN32__ */
+
+#ifdef HAVE_STDIO_H
+
+/* Functions to read/write stdio file pointers */
+
+static long SDLCALL
+stdio_seek(SDL_RWops * context, long offset, int whence)
+{
+    if (fseek(context->hidden.stdio.fp, offset, whence) == 0) {
+        return (ftell(context->hidden.stdio.fp));
+    } else {
+        SDL_Error(SDL_EFSEEK);
+        return (-1);
+    }
+}
+
+static size_t SDLCALL
+stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
+{
+    size_t nread;
+
+    nread = fread(ptr, size, maxnum, context->hidden.stdio.fp);
+    if (nread == 0 && ferror(context->hidden.stdio.fp)) {
+        SDL_Error(SDL_EFREAD);
+    }
+    return (nread);
+}
+
+static size_t SDLCALL
+stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
+{
+    size_t nwrote;
+
+    nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp);
+    if (nwrote == 0 && ferror(context->hidden.stdio.fp)) {
+        SDL_Error(SDL_EFWRITE);
+    }
+    return (nwrote);
+}
+
+static int SDLCALL
+stdio_close(SDL_RWops * context)
+{
+    int status = 0;
+    if (context) {
+        if (context->hidden.stdio.autoclose) {
+            /* WARNING:  Check the return value here! */
+            if (fclose(context->hidden.stdio.fp) != 0) {
+                SDL_Error(SDL_EFWRITE);
+                status = -1;
+            }
+        }
+        SDL_FreeRW(context);
+    }
+    return status;
+}
+#endif /* !HAVE_STDIO_H */
+
+/* Functions to read/write memory pointers */
+
+static long SDLCALL
+mem_seek(SDL_RWops * context, long offset, int whence)
+{
+    Uint8 *newpos;
+
+    switch (whence) {
+    case RW_SEEK_SET:
+        newpos = context->hidden.mem.base + offset;
+        break;
+    case RW_SEEK_CUR:
+        newpos = context->hidden.mem.here + offset;
+        break;
+    case RW_SEEK_END:
+        newpos = context->hidden.mem.stop + offset;
+        break;
+    default:
+        SDL_SetError("Unknown value for 'whence'");
+        return (-1);
+    }
+    if (newpos < context->hidden.mem.base) {
+        newpos = context->hidden.mem.base;
+    }
+    if (newpos > context->hidden.mem.stop) {
+        newpos = context->hidden.mem.stop;
+    }
+    context->hidden.mem.here = newpos;
+    return (long)(context->hidden.mem.here - context->hidden.mem.base);
+}
+
+static size_t SDLCALL
+mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum)
+{
+    size_t total_bytes;
+    size_t mem_available;
+
+    total_bytes = (maxnum * size);
+    if ((maxnum <= 0) || (size <= 0)
+        || ((total_bytes / maxnum) != (size_t) size)) {
+        return 0;
+    }
+
+    mem_available = (context->hidden.mem.stop - context->hidden.mem.here);
+    if (total_bytes > mem_available) {
+        total_bytes = mem_available;
+    }
+
+    SDL_memcpy(ptr, context->hidden.mem.here, total_bytes);
+    context->hidden.mem.here += total_bytes;
+
+    return (total_bytes / size);
+}
+
+static size_t SDLCALL
+mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num)
+{
+    if ((context->hidden.mem.here + (num * size)) > context->hidden.mem.stop) {
+        num = (context->hidden.mem.stop - context->hidden.mem.here) / size;
+    }
+    SDL_memcpy(context->hidden.mem.here, ptr, num * size);
+    context->hidden.mem.here += num * size;
+    return (num);
+}
+
+static size_t SDLCALL
+mem_writeconst(SDL_RWops * context, const void *ptr, size_t size, size_t num)
+{
+    SDL_SetError("Can't write to read-only memory");
+    return (-1);
+}
+
+static int SDLCALL
+mem_close(SDL_RWops * context)
+{
+    if (context) {
+        SDL_FreeRW(context);
+    }
+    return (0);
+}
+
+
+/* Functions to create SDL_RWops structures from various data sources */
+
+SDL_RWops *
+SDL_RWFromFile(const char *file, const char *mode)
+{
+    SDL_RWops *rwops = NULL;
+#ifdef HAVE_STDIO_H
+    FILE *fp = NULL;
+#endif
+    if (!file || !*file || !mode || !*mode) {
+        SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
+        return NULL;
+    }
+#if defined(ANDROIDXELI) //Xeli: dont use the android assets, TODO create fallback system
+    rwops = SDL_AllocRW();
+    if (!rwops)
+        return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
+    if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
+        SDL_FreeRW(rwops);
+        return NULL;
+    }
+    rwops->seek = Android_JNI_FileSeek;
+    rwops->read = Android_JNI_FileRead;
+    rwops->write = Android_JNI_FileWrite;
+    rwops->close = Android_JNI_FileClose;
+
+#elif defined(__WIN32__)
+    rwops = SDL_AllocRW();
+    if (!rwops)
+        return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
+    if (windows_file_open(rwops, file, mode) < 0) {
+        SDL_FreeRW(rwops);
+        return NULL;
+    }
+    rwops->seek = windows_file_seek;
+    rwops->read = windows_file_read;
+    rwops->write = windows_file_write;
+    rwops->close = windows_file_close;
+
+#elif HAVE_STDIO_H
+	#ifdef __APPLE__
+	fp = SDL_OpenFPFromBundleOrFallback(file, mode);
+    #else
+	fp = fopen(file, mode);
+	#endif
+	if (fp == NULL) {
+        SDL_SetError("Couldn't open %s", file);
+    } else {
+        rwops = SDL_RWFromFP(fp, 1);
+    }
+#else
+    SDL_SetError("SDL not compiled with stdio support");
+#endif /* !HAVE_STDIO_H */
+
+    return (rwops);
+}
+
+#ifdef HAVE_STDIO_H
+SDL_RWops *
+SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
+{
+    SDL_RWops *rwops = NULL;
+
+#if 0
+/*#ifdef __NDS__*/
+    /* set it up so we can use stdio file function */
+    fatInitDefault();
+    printf("called fatInitDefault()");
+#endif /* __NDS__ */
+
+    rwops = SDL_AllocRW();
+    if (rwops != NULL) {
+        rwops->seek = stdio_seek;
+        rwops->read = stdio_read;
+        rwops->write = stdio_write;
+        rwops->close = stdio_close;
+        rwops->hidden.stdio.fp = fp;
+        rwops->hidden.stdio.autoclose = autoclose;
+    }
+    return (rwops);
+}
+#else
+SDL_RWops *
+SDL_RWFromFP(void * fp, SDL_bool autoclose)
+{
+    SDL_SetError("SDL not compiled with stdio support");
+    return NULL;
+}
+#endif /* HAVE_STDIO_H */
+
+SDL_RWops *
+SDL_RWFromMem(void *mem, int size)
+{
+    SDL_RWops *rwops;
+
+    rwops = SDL_AllocRW();
+    if (rwops != NULL) {
+        rwops->seek = mem_seek;
+        rwops->read = mem_read;
+        rwops->write = mem_write;
+        rwops->close = mem_close;
+        rwops->hidden.mem.base = (Uint8 *) mem;
+        rwops->hidden.mem.here = rwops->hidden.mem.base;
+        rwops->hidden.mem.stop = rwops->hidden.mem.base + size;
+    }
+    return (rwops);
+}
+
+SDL_RWops *
+SDL_RWFromConstMem(const void *mem, int size)
+{
+    SDL_RWops *rwops;
+
+    rwops = SDL_AllocRW();
+    if (rwops != NULL) {
+        rwops->seek = mem_seek;
+        rwops->read = mem_read;
+        rwops->write = mem_writeconst;
+        rwops->close = mem_close;
+        rwops->hidden.mem.base = (Uint8 *) mem;
+        rwops->hidden.mem.here = rwops->hidden.mem.base;
+        rwops->hidden.mem.stop = rwops->hidden.mem.base + size;
+    }
+    return (rwops);
+}
+
+SDL_RWops *
+SDL_AllocRW(void)
+{
+    SDL_RWops *area;
+
+    area = (SDL_RWops *) SDL_malloc(sizeof *area);
+    if (area == NULL) {
+        SDL_OutOfMemory();
+    }
+    return (area);
+}
+
+void
+SDL_FreeRW(SDL_RWops * area)
+{
+    SDL_free(area);
+}
+
+/* Functions for dynamically reading and writing endian-specific values */
+
+Uint16
+SDL_ReadLE16(SDL_RWops * src)
+{
+    Uint16 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapLE16(value));
+}
+
+Uint16
+SDL_ReadBE16(SDL_RWops * src)
+{
+    Uint16 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapBE16(value));
+}
+
+Uint32
+SDL_ReadLE32(SDL_RWops * src)
+{
+    Uint32 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapLE32(value));
+}
+
+Uint32
+SDL_ReadBE32(SDL_RWops * src)
+{
+    Uint32 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapBE32(value));
+}
+
+Uint64
+SDL_ReadLE64(SDL_RWops * src)
+{
+    Uint64 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapLE64(value));
+}
+
+Uint64
+SDL_ReadBE64(SDL_RWops * src)
+{
+    Uint64 value;
+
+    SDL_RWread(src, &value, (sizeof value), 1);
+    return (SDL_SwapBE64(value));
+}
+
+size_t
+SDL_WriteLE16(SDL_RWops * dst, Uint16 value)
+{
+    value = SDL_SwapLE16(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+size_t
+SDL_WriteBE16(SDL_RWops * dst, Uint16 value)
+{
+    value = SDL_SwapBE16(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+size_t
+SDL_WriteLE32(SDL_RWops * dst, Uint32 value)
+{
+    value = SDL_SwapLE32(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+size_t
+SDL_WriteBE32(SDL_RWops * dst, Uint32 value)
+{
+    value = SDL_SwapBE32(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+size_t
+SDL_WriteLE64(SDL_RWops * dst, Uint64 value)
+{
+    value = SDL_SwapLE64(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+size_t
+SDL_WriteBE64(SDL_RWops * dst, Uint64 value)
+{
+    value = SDL_SwapBE64(value);
+    return (SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
new file mode 100644
index 0000000..abc5662
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp
@@ -0,0 +1,49 @@
+
+/* Include the SDL main definition header */
+#include "SDL_main.h"
+
+/*******************************************************************************
+                 Functions called by JNI
+*******************************************************************************/
+#include <jni.h>
+
+// Called before SDL_main() to initialize JNI bindings in SDL library
+extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls);
+
+// Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    return JNI_VERSION_1_4;
+}
+
+// Start up the SDL app
+extern "C" void Java_org_hedgewars_hedgeroid_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobjectArray strArray)
+{
+    /* This interface could expand with ABI negotiation, calbacks, etc. */
+    SDL_Android_Init(env, cls);
+
+    //Get the String array from java
+    int argc = env->GetArrayLength(strArray);
+    char *argv[argc];
+    jstring jstringArgv[argc];
+    for(int i = 0; i < argc; i++){
+        jstringArgv[i] = (jstring)env->GetObjectArrayElement(strArray, i);  //get the element
+	argv[i] = (char*)malloc(sizeof(char) * env->GetStringLength(jstringArgv[i]));
+	strcpy(argv[i], env->GetStringUTFChars(jstringArgv[i], JNI_FALSE)); //copy it to a mutable location
+	//Don't release memory the JAVA GC will take care of it
+        //env->ReleaseStringChars(jstringArgv[i], (jchar*)argv[i]);           
+    }
+    
+    /* Run the application code! */
+    int status;
+    status = SDL_main(argc, argv);
+
+    //Clean up argv
+    for(int i = 0; i < argc; i++){
+    }
+
+    /* We exit here for consistency with other platforms. */
+    //exit(status); Xeli: Or lets not crash the entire app.....
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidkeyboard.c b/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidkeyboard.c
new file mode 100755
index 0000000..255b798
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/video/android/SDL_androidkeyboard.c
@@ -0,0 +1,185 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2012 Sam Lantinga <slouken at libsdl.org>
+
+  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.
+*/
+#include "SDL_config.h"
+
+#if SDL_VIDEO_DRIVER_ANDROID
+
+#include <android/log.h>
+
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_androidkeyboard.h"
+#include "SDL_keycode.h"
+
+
+void Android_InitKeyboard()
+{
+    SDL_Keycode keymap[SDL_NUM_SCANCODES];
+
+    /* Add default scancode to key mapping */
+    SDL_GetDefaultKeymap(keymap);
+    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
+}
+
+static SDL_Scancode Android_Keycodes[] = {
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_LEFT */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_RIGHT */
+    SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */
+    SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALL */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENDCALL */
+    SDL_SCANCODE_0, /* AKEYCODE_0 */
+    SDL_SCANCODE_1, /* AKEYCODE_1 */
+    SDL_SCANCODE_2, /* AKEYCODE_2 */
+    SDL_SCANCODE_3, /* AKEYCODE_3 */
+    SDL_SCANCODE_4, /* AKEYCODE_4 */
+    SDL_SCANCODE_5, /* AKEYCODE_5 */
+    SDL_SCANCODE_6, /* AKEYCODE_6 */
+    SDL_SCANCODE_7, /* AKEYCODE_7 */
+    SDL_SCANCODE_8, /* AKEYCODE_8 */
+    SDL_SCANCODE_9, /* AKEYCODE_9 */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */
+    SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */
+    SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */
+    SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */
+    SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */
+    SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */
+    SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */
+    SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */
+    SDL_SCANCODE_POWER, /* AKEYCODE_POWER */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */
+    SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */
+    SDL_SCANCODE_A, /* AKEYCODE_A */
+    SDL_SCANCODE_B, /* AKEYCODE_B */
+    SDL_SCANCODE_C, /* AKEYCODE_C */
+    SDL_SCANCODE_D, /* AKEYCODE_D */
+    SDL_SCANCODE_E, /* AKEYCODE_E */
+    SDL_SCANCODE_F, /* AKEYCODE_F */
+    SDL_SCANCODE_G, /* AKEYCODE_G */
+    SDL_SCANCODE_H, /* AKEYCODE_H */
+    SDL_SCANCODE_I, /* AKEYCODE_I */
+    SDL_SCANCODE_J, /* AKEYCODE_J */
+    SDL_SCANCODE_K, /* AKEYCODE_K */
+    SDL_SCANCODE_L, /* AKEYCODE_L */
+    SDL_SCANCODE_M, /* AKEYCODE_M */
+    SDL_SCANCODE_N, /* AKEYCODE_N */
+    SDL_SCANCODE_O, /* AKEYCODE_O */
+    SDL_SCANCODE_P, /* AKEYCODE_P */
+    SDL_SCANCODE_Q, /* AKEYCODE_Q */
+    SDL_SCANCODE_R, /* AKEYCODE_R */
+    SDL_SCANCODE_S, /* AKEYCODE_S */
+    SDL_SCANCODE_T, /* AKEYCODE_T */
+    SDL_SCANCODE_U, /* AKEYCODE_U */
+    SDL_SCANCODE_V, /* AKEYCODE_V */
+    SDL_SCANCODE_W, /* AKEYCODE_W */
+    SDL_SCANCODE_X, /* AKEYCODE_X */
+    SDL_SCANCODE_Y, /* AKEYCODE_Y */
+    SDL_SCANCODE_Z, /* AKEYCODE_Z */
+    SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */
+    SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */
+    SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */
+    SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */
+    SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */
+    SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */
+    SDL_SCANCODE_TAB, /* AKEYCODE_TAB */
+    SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EXPLORER */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENVELOPE */
+    SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */
+    SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */
+    SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */
+    SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */
+    SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */
+    SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */
+    SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */
+    SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */
+    SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */
+    SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SLASH */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */
+    SDL_SCANCODE_MENU, /* AKEYCODE_MENU */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */
+    SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */
+    SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */
+    SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */
+    SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */
+    SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_REWIND */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_FAST_FORWARD */
+    SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */
+    SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */
+    SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */
+    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */
+};
+
+static SDL_Scancode
+TranslateKeycode(int keycode)
+{
+    SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
+
+    if (keycode < SDL_arraysize(Android_Keycodes)) {
+        scancode = Android_Keycodes[keycode];
+    }
+    if (scancode == SDL_SCANCODE_UNKNOWN) {
+        __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode);
+    }
+    __android_log_print(ANDROID_LOG_INFO, "SDLXELI", "keycode %d scancode %d", keycode, scancode);
+    return scancode;
+}
+
+int
+Android_OnKeyDown(int keycode)
+{
+    return SDL_SendKeyboardKey(SDL_PRESSED, TranslateKeycode(keycode));
+}
+
+int
+Android_OnKeyUp(int keycode)
+{
+    return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode));
+}
+
+#endif /* SDL_VIDEO_DRIVER_ANDROID */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk b/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk
new file mode 100644
index 0000000..a5e138c
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL_mixer/Android.mk
@@ -0,0 +1,20 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SDL_mixer
+
+LOCAL_C_INCLUDES := \
+        $(LOCAL_PATH)/../../../../../misc/libtremor \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../SDL/include \
+	$(LOCAL_PATH)/../mikmod/include \
+
+LOCAL_CFLAGS := -DWAV_MUSIC -DOGG_MUSIC -DOGG_USE_TREMOR -DMOD_MUSIC
+
+LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c)))
+
+LOCAL_SHARED_LIBRARIES := SDL mikmod
+LOCAL_STATIC_LIBRARIES := tremor
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/project_files/Android-build/SDL-android-project/jni/SDL_ttf/Android.mk b/project_files/Android-build/SDL-android-project/jni/SDL_ttf/Android.mk
new file mode 100644
index 0000000..b507456
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/SDL_ttf/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := SDL_ttf
+
+LOCAL_CFLAGS := -I$(LOCAL_PATH)/../SDL/include -I$(LOCAL_PATH)/../../../../../misc/libfreetype/include
+
+LOCAL_SRC_FILES := SDL_ttf.c
+
+LOCAL_SHARED_LIBRARIES := SDL
+
+LOCAL_STATIC_LIBRARIES := freetype
+
+LOCAL_LDLIBS := -lz
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/project_files/Android-build/SDL-android-project/jni/src/Android.mk b/project_files/Android-build/SDL-android-project/jni/src/Android.mk
new file mode 100644
index 0000000..d1d3749
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/src/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := main
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/../SDL/include
+
+# Add your application source files here...
+LOCAL_SRC_FILES := ../SDL/src/main/android/SDL_android_main.cpp hedgewars_main.c 
+
+LOCAL_SHARED_LIBRARIES := SDL
+
+LOCAL_LDLIBS := -llog -lGLESv1_CM
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c b/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c
new file mode 100644
index 0000000..976184b
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c
@@ -0,0 +1,40 @@
+
+#include "android/log.h"
+#include "SDL.h"
+#include "dlfcn.h"
+#include "GLES/gl.h"
+
+#define TAG "HWEngine Loader"
+
+typedef  (*HWEngine_Game)(char**);
+
+main(int argc, char *argv[]){
+	void *handle;
+	char *error;
+	HWEngine_Game Game;
+	
+
+        __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded");
+	handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL);
+	if(!handle){
+		__android_log_print(ANDROID_LOG_INFO, TAG, dlerror());
+		__android_log_print(ANDROID_LOG_INFO, TAG, "error dlopen");
+		exit(EXIT_FAILURE);
+	}
+	dlerror();
+
+        __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine successfully loaded..");
+
+
+	Game = (HWEngine_Game) dlsym(handle,"Game");
+	if((error = dlerror()) != NULL){
+		__android_log_print(ANDROID_LOG_INFO, TAG, error);
+		__android_log_print(ANDROID_LOG_INFO, TAG, "error dlsym");
+		exit(EXIT_FAILURE);
+	}
+	__android_log_print(ANDROID_LOG_INFO, TAG, "dlsym succeeded");
+	Game(argv);
+	__android_log_print(ANDROID_LOG_INFO, TAG, "Game() ended");
+
+	dlclose(handle);
+}
diff --git a/project_files/Android-build/SDL-android-project/libs/android-support-v13.jar b/project_files/Android-build/SDL-android-project/libs/android-support-v13.jar
new file mode 100644
index 0000000..3d7f841
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/libs/android-support-v13.jar differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/background.png b/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/background.png
new file mode 100644
index 0000000..7d4843a
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/background.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/icon.png b/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/icon.png
new file mode 100644
index 0000000..ad60b38
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-large-mdpi/icon.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/arrow.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/arrow.png
new file mode 100644
index 0000000..8fe988a
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/arrow.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/backbutton.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/backbutton.png
new file mode 100644
index 0000000..1aa3a3d
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/backbutton.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/background.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/background.png
new file mode 100644
index 0000000..2824579
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/background.png differ
diff --git a/QTfrontend/res/botlevels/5.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot1.png
similarity index 100%
copy from QTfrontend/res/botlevels/5.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot1.png
diff --git a/QTfrontend/res/botlevels/4.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot2.png
similarity index 100%
copy from QTfrontend/res/botlevels/4.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot2.png
diff --git a/QTfrontend/res/botlevels/3.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot3.png
similarity index 100%
copy from QTfrontend/res/botlevels/3.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot3.png
diff --git a/QTfrontend/res/botlevels/2.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot4.png
similarity index 100%
copy from QTfrontend/res/botlevels/2.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot4.png
diff --git a/QTfrontend/res/botlevels/1.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot5.png
similarity index 100%
copy from QTfrontend/res/botlevels/1.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/bot5.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box.9.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box.9.png
new file mode 100644
index 0000000..2da3d56
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box.9.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box_dark.9.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box_dark.9.png
new file mode 100644
index 0000000..f27ce74
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/box_dark.9.png differ
diff --git a/QTfrontend/res/dice.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/dice.png
similarity index 100%
copy from QTfrontend/res/dice.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/dice.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/dropdown.9.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/dropdown.9.png
new file mode 100644
index 0000000..18bcc29
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/dropdown.9.png differ
diff --git a/QTfrontend/res/edit.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/edit.png
similarity index 100%
copy from QTfrontend/res/edit.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/edit.png
diff --git a/share/hedgewars/Data/Forts/Castle-preview.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/fort.png
similarity index 100%
copy from share/hedgewars/Data/Forts/Castle-preview.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/fort.png
diff --git a/QTfrontend/res/botlevels/0.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/human.png
similarity index 100%
copy from QTfrontend/res/botlevels/0.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/human.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/icon.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..9d948fb
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/icon.png differ
diff --git a/QTfrontend/res/PlaySound.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/playsound.png
similarity index 100%
copy from QTfrontend/res/PlaySound.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/playsound.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/savebutton.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/savebutton.png
new file mode 100644
index 0000000..8d5f871
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/savebutton.png differ
diff --git a/QTfrontend/res/Settings.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/settings.png
similarity index 100%
copy from QTfrontend/res/Settings.png
copy to project_files/Android-build/SDL-android-project/res/drawable-mdpi/settings.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/startgamebutton.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/startgamebutton.png
new file mode 100644
index 0000000..56b3a5c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/startgamebutton.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/statusbar.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/statusbar.png
new file mode 100644
index 0000000..83ed034
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/statusbar.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount.xml b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount.xml
new file mode 100644
index 0000000..925d261
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount.xml
@@ -0,0 +1,12 @@
+ <level-list xmlns:android="http://schemas.android.com/apk/res/android">
+  <item android:maxLevel="0" android:drawable="@drawable/teams_number0" />
+  <item android:maxLevel="1" android:drawable="@drawable/teams_number1" />
+  <item android:maxLevel="2" android:drawable="@drawable/teams_number2" />
+  <item android:maxLevel="3" android:drawable="@drawable/teams_number3" />
+  <item android:maxLevel="4" android:drawable="@drawable/teams_number4" />
+  <item android:maxLevel="5" android:drawable="@drawable/teams_number5" />
+  <item android:maxLevel="6" android:drawable="@drawable/teams_number6" />
+  <item android:maxLevel="7" android:drawable="@drawable/teams_number7" />
+  <item android:maxLevel="8" android:drawable="@drawable/teams_number8" />
+  <item android:maxLevel="9" android:drawable="@drawable/teams_number9" />
+ </level-list>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount0.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount0.png
new file mode 100644
index 0000000..f71d34a
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount0.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount1.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount1.png
new file mode 100644
index 0000000..01c21b4
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount1.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount2.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount2.png
new file mode 100644
index 0000000..f602c6b
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount2.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount3.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount3.png
new file mode 100644
index 0000000..18afb92
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount3.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount4.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount4.png
new file mode 100644
index 0000000..66bf316
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount4.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount5.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount5.png
new file mode 100644
index 0000000..fcb8e14
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount5.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount6.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount6.png
new file mode 100644
index 0000000..c41def4
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount6.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount7.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount7.png
new file mode 100644
index 0000000..220c4dd
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount7.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount8.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount8.png
new file mode 100644
index 0000000..59d7523
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount8.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount9.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount9.png
new file mode 100644
index 0000000..49ef836
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teamcount9.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams.png
new file mode 100644
index 0000000..34453ac
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number0.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number0.png
new file mode 100644
index 0000000..8622b3f
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number0.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number1.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number1.png
new file mode 100644
index 0000000..3b1d5c8
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number1.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number2.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number2.png
new file mode 100644
index 0000000..0eed688
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number2.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number3.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number3.png
new file mode 100644
index 0000000..442200c
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number3.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number4.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number4.png
new file mode 100644
index 0000000..803e16a
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number4.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number5.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number5.png
new file mode 100644
index 0000000..15bc444
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number5.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number6.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number6.png
new file mode 100644
index 0000000..c1fc43e
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number6.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number7.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number7.png
new file mode 100644
index 0000000..162f49f
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number7.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number8.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number8.png
new file mode 100644
index 0000000..3f2482b
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number8.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number9.png b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number9.png
new file mode 100644
index 0000000..5151e31
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-mdpi/teams_number9.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/background.png b/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/background.png
new file mode 100644
index 0000000..7d4843a
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/background.png differ
diff --git a/share/hedgewars/Data/Forts/Castle-preview at 2x.png b/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/fort.png
similarity index 100%
copy from share/hedgewars/Data/Forts/Castle-preview at 2x.png
copy to project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/fort.png
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/icon.png b/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/icon.png
new file mode 100644
index 0000000..ad60b38
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-normal-hdpi/icon.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-normal-ldpi/icon.png b/project_files/Android-build/SDL-android-project/res/drawable-normal-ldpi/icon.png
new file mode 100644
index 0000000..a90bd5b
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-normal-ldpi/icon.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/drawable-xlarge-mdpi/background.png b/project_files/Android-build/SDL-android-project/res/drawable-xlarge-mdpi/background.png
new file mode 100644
index 0000000..9dbd0bf
Binary files /dev/null and b/project_files/Android-build/SDL-android-project/res/drawable-xlarge-mdpi/background.png differ
diff --git a/project_files/Android-build/SDL-android-project/res/layout/backbutton.xml b/project_files/Android-build/SDL-android-project/res/layout/backbutton.xml
new file mode 100644
index 0000000..bca25f5
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/backbutton.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+    <ImageButton
+    	android:id="@+id/btnBack"
+    	android:layout_width="120dip"
+    	android:layout_height="40dip"
+    	android:layout_alignParentBottom="true"
+    	android:layout_alignParentLeft="true"
+    	android:adjustViewBounds="true"
+    	android:scaleType="centerInside"
+    	android:background="@android:color/transparent"
+    	android:src="@drawable/backbutton"/>
+</merge>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/background.xml b/project_files/Android-build/SDL-android-project/res/layout/background.xml
new file mode 100644
index 0000000..b859bd1
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/background.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+<ImageView
+	android:layout_width="fill_parent"
+	android:layout_height="fill_parent"
+	android:scaleType="centerCrop"
+	android:src="@drawable/background"/>
+</merge>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/config.xml b/project_files/Android-build/SDL-android-project/res/layout/config.xml
new file mode 100644
index 0000000..0dcb864
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/config.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    	
+    <ListView
+    	android:id="@+id/listView"
+    	android:layout_width="wrap_content"
+    	android:layout_height="fill_parent"/>
+    	
+</RelativeLayout>
+
diff --git a/project_files/Android-build/SDL-android-project/res/layout/download_confirmdialog.xml b/project_files/Android-build/SDL-android-project/res/layout/download_confirmdialog.xml
new file mode 100644
index 0000000..d5056a5
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_confirmdialog.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="fill_parent"
+    android:padding="5dip">
+  	<TextView 
+      	android:id="@+id/text"
+       	android:layout_width="200dip"
+       	android:layout_height="wrap_content"
+       	android:padding="5dip"
+       	android:gravity="center"
+       	android:maxWidth="200dip"/>
+
+	<LinearLayout
+	    android:layout_width="fill_parent"
+	    android:layout_height="wrap_content"
+	    android:layout_below="@+id/text"
+	    android:layout_alignLeft="@id/text"
+	    android:layout_alignRight="@id/text"
+	    android:orientation="horizontal"
+	    android:gravity="center">
+
+	    <Button
+	        android:id="@+id/yes"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
+	        android:layout_weight="1"
+	        android:text="@android:string/yes" />
+
+	    <Button
+	        android:id="@+id/no"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
+	        android:layout_weight="1"
+	        android:text="@android:string/no" />
+	</LinearLayout>
+   	
+</RelativeLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/download_info.xml b/project_files/Android-build/SDL-android-project/res/layout/download_info.xml
new file mode 100644
index 0000000..2296637
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_info.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="horizontal"
+    android:gravity="center_vertical">
+    <ImageView
+        android:id="@+id/arrow"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="8"
+        android:src="@drawable/arrow"
+        android:adjustViewBounds="true"/>
+    
+    <RelativeLayout
+        android:id="@+id/container"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:background="@drawable/box_dark">        
+        <TextView
+            android:id="@+id/text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="This package will higher quality sounds better sounds"/>
+        
+        <Button 
+            android:id="@+id/download"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignLeft="@id/text"
+            android:layout_below="@id/text"
+            android:text="@string/download_downloadnow"/>        
+        <Button 
+            android:id="@+id/cancel"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignRight="@id/text"
+            android:layout_below="@id/text"
+            android:text="@android:string/no"/>
+            
+    </RelativeLayout>
+    
+
+</LinearLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/download_listactivity.xml b/project_files/Android-build/SDL-android-project/res/layout/download_listactivity.xml
new file mode 100644
index 0000000..e9aa5c3
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_listactivity.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    
+   <include layout="@layout/background"/>
+    
+	<LinearLayout 
+	    android:layout_width="fill_parent"
+	    android:layout_height="fill_parent"
+	    android:orientation="horizontal"
+	    android:background="@android:color/transparent">	    
+	    <fragment class="org.hedgewars.hedgeroid.Downloader.DownloadListFragment"
+	        android:id="@+id/downloadList"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
+	        android:layout_weight="1"/>
+	    
+	    <FrameLayout 
+	        android:id="@+id/downloadFrameLayout"
+	        android:layout_width="fill_parent"
+	        android:layout_height="fill_parent"
+	        android:layout_weight="1"
+	        android:background="@android:color/transparent">
+	        
+	        <ScrollView
+	            android:layout_width="fill_parent"
+	        	android:layout_height="fill_parent">
+	            
+	            <LinearLayout
+	                android:id="@+id/downloadQueueContainer"
+	                android:layout_width="fill_parent"
+	        		android:layout_height="fill_parent"
+	        		android:orientation="vertical"/>	        		
+	        </ScrollView>
+	    </FrameLayout>
+	
+	</LinearLayout>
+</FrameLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/download_progress.xml b/project_files/Android-build/SDL-android-project/res/layout/download_progress.xml
new file mode 100644
index 0000000..b574aca
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/download_progress.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:id="@+id/container"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:minWidth="250dip"
+    android:padding="5dp"
+    android:background="@drawable/box">
+    <ProgressBar
+    	android:id="@+id/progressbar"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_alignParentLeft="true"
+    	android:layout_alignParentRight="true"
+    	android:progressDrawable="@android:drawable/progress_horizontal"
+		android:indeterminate="false" 
+		android:indeterminateOnly="false"/>
+	<TextView
+    	android:id="@+id/progressbar_sub"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_below="@id/progressbar"
+    	android:layout_alignParentLeft="true"
+    	android:layout_alignParentRight="true"
+    	android:text="@string/download_queued"
+    	android:textColor="#FFF"
+    	android:textSize="14dp"
+    	android:gravity="center"/> 	
+    <!--  <Button
+    	android:id="@id/background"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_below="@id/progressbar_sub"
+    	android:text="@string/download_background"/>-->
+    <Button
+    	android:id="@+id/cancelDownload"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_below="@id/progressbar_sub"
+    	
+    	android:layout_centerHorizontal="true"
+    	android:text="@string/download_cancel"/>
+    <!-- android:layout_toRightOf="@id/background"-->
+    	
+</RelativeLayout>
+
diff --git a/project_files/Android-build/SDL-android-project/res/layout/listview_item.xml b/project_files/Android-build/SDL-android-project/res/layout/listview_item.xml
new file mode 100644
index 0000000..5950cec
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/listview_item.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent"
+	android:layout_height="wrap_content"
+	android:textSize="10dip"
+	android:textColor="#FFF"
+	android:gravity="center"/>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/main.xml b/project_files/Android-build/SDL-android-project/res/layout/main.xml
new file mode 100644
index 0000000..0a0bb32
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/main.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+  	android:layout_width="fill_parent"
+	android:layout_height="fill_parent">
+	<include layout="@layout/background"/>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >    
+    <Button
+    	android:id="@+id/downloader"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:text="downloader"/>
+    	
+    <Button
+    	android:id="@+id/startGame"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:text="startgame"/>
+    	
+</LinearLayout>
+</FrameLayout>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/notification.xml b/project_files/Android-build/SDL-android-project/res/layout/notification.xml
new file mode 100644
index 0000000..3b4ef08
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/notification.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:padding="3dp">
+	<ImageView
+		android:id="@+id/icon"
+    	android:layout_width="wrap_content" 
+    	android:layout_height="fill_parent"
+    	android:scaleType="centerInside"
+    	android:src="@drawable/icon"/>
+    
+    <TextView
+    	android:id="@+id/title"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_toRightOf="@id/icon"
+    	android:text="@string/notification_title"
+    	android:textColor="#000"
+    	android:textSize="17dp"
+    	android:textStyle="bold"/>
+    			
+	<TextView
+    	android:id="@+id/progressbar_sub"
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_toRightOf="@id/icon"
+    	android:layout_alignParentBottom="true"
+    	android:text="@string/notification_title"
+    	android:textColor="#000"
+    	android:textSize="10dp"/> 	
+	<ProgressBar
+		android:id="@+id/notification_progress"
+		android:layout_width="fill_parent"
+		android:layout_height="wrap_content"
+		android:layout_toRightOf="@id/icon"
+		android:layout_below="@id/title"
+		android:layout_above="@id/progressbar_sub"
+		android:progressDrawable="@android:drawable/progress_horizontal"
+		android:indeterminate="false" android:indeterminateOnly="false"
+		android:paddingRight="5dp"
+		android:paddingTop="5dp"/>   
+
+</RelativeLayout>
+
diff --git a/project_files/Android-build/SDL-android-project/res/layout/savebutton.xml b/project_files/Android-build/SDL-android-project/res/layout/savebutton.xml
new file mode 100644
index 0000000..3a6ea60
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/savebutton.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+    <ImageButton
+    	android:id="@+id/btnSave"
+    	android:layout_width="120dip"
+    	android:layout_height="40dip"
+    	android:layout_alignParentBottom="true"
+    	android:layout_alignParentRight="true"
+    	android:adjustViewBounds="true"
+    	android:scaleType="centerInside"
+    	android:background="@android:color/transparent"
+    	android:src="@drawable/savebutton"/>
+</merge>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_dropdown_entry.xml b/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_dropdown_entry.xml
new file mode 100644
index 0000000..cba29eb
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_dropdown_entry.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="wrap_content"
+	android:layout_height="wrap_content"
+	android:gravity="center">
+	<ImageView
+		android:id="@+id/spinner_img"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:layout_gravity="center"
+		android:adjustViewBounds="true"
+		android:scaleType="centerInside"
+		android:layout_marginRight="5dip"
+		/>
+	<TextView
+		android:id="@+id/spinner_txt"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:textSize="14dip"
+		android:textColor="#000"
+		android:gravity="center"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_entry.xml b/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_entry.xml
new file mode 100644
index 0000000..fb7e6fc
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/spinner_textimg_entry.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="wrap_content"
+	android:layout_height="wrap_content"
+	android:gravity="center">
+	<ImageView
+		android:id="@+id/spinner_img"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:layout_gravity="center"
+		android:adjustViewBounds="true"
+		android:scaleType="centerInside"
+		android:layout_marginRight="5dip"
+		/>
+	<TextView
+		android:id="@+id/spinner_txt"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:textSize="14dip"
+		android:textColor="#FFF"
+		android:gravity="center"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/starting_game.xml b/project_files/Android-build/SDL-android-project/res/layout/starting_game.xml
new file mode 100644
index 0000000..393508b
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/starting_game.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    <include
+    	layout="@layout/background"/>
+     
+    <ImageView
+    	android:id="@+id/mapPreview"
+    	android:layout_width="256dip"
+    	android:layout_height="128dip"
+    	android:layout_margin="5dip"
+    	android:scaleType="fitXY"
+    	android:background="@drawable/box"
+    	android:src="@drawable/backbutton"/>
+    
+    <Spinner 
+       	android:id="@+id/spinMaps"
+       	android:layout_height="wrap_content"
+       	android:layout_width="wrap_content"    
+       	android:layout_below="@id/mapPreview"
+       	android:layout_alignRight="@id/mapPreview"
+       	android:layout_toRightOf="@+id/txtMap"
+       	android:background="@drawable/dropdown"/>
+    <TextView
+		android:id="@id/txtMap"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:text="@string/start_map"
+		android:layout_alignTop="@id/spinMaps"
+		android:layout_alignBottom="@id/spinMaps"
+		android:layout_alignLeft="@id/mapPreview"
+		android:gravity="center"/>	
+   	
+    <TableLayout 
+       	android:id="@+id/gameOptions" 
+       	android:layout_height="wrap_content" 
+       	android:layout_width="wrap_content"
+       	android:layout_centerHorizontal="true"
+       	android:layout_toRightOf="@id/mapPreview" 
+       	android:layout_alignParentRight="true"
+       	android:padding="3dip"
+       	android:layout_margin="5dip"
+       	android:background="@drawable/box"
+       	android:stretchColumns="0,2"
+       	android:shrinkColumns="1">
+	       	
+       	<TableRow>
+        	 <TextView 
+		        android:id="@+id/txtGameplay"
+		        android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:text="@string/start_gameplay"/>
+        	<Spinner
+	        	android:id="@+id/spinGameplay"
+	        	android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:background="@drawable/dropdown"
+		        />
+		</TableRow>  
+		<TableRow>
+		    <TextView 
+		        android:id="@+id/txtGamescheme"
+		        android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:text="@string/start_gamescheme"/>
+		    <Spinner
+		       	android:id="@+id/spinGamescheme"
+		       	android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:background="@drawable/dropdown"/>
+		    <ImageButton
+		    	android:id="@+id/btnGamescheme"
+		    	android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:background="@drawable/edit"
+		        android:adjustViewBounds="true"
+		        android:scaleType="centerInside"
+		        android:layout_gravity="center"
+		        android:padding="3dip"/>
+		 </TableRow>
+		 <TableRow>    
+		     <TextView 
+		        android:id="@+id/txtweapons"
+		        android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:layout_below="@id/txtGamescheme"
+		        android:layout_marginTop="5dip"
+		        android:text="@string/start_weapons"/>
+	        
+	        <Spinner
+	        	android:id="@+id/spinweapons"
+	        	android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:background="@drawable/dropdown"/>
+		    
+		    <ImageButton
+		    	android:id="@+id/btnweapons"
+		    	android:layout_height="wrap_content"
+		        android:layout_width="wrap_content"
+		        android:background="@drawable/edit"
+		        android:adjustViewBounds="true"
+		        android:scaleType="centerInside"
+		        android:layout_gravity="center"
+		        android:padding="3dip"/>
+        </TableRow>	
+    </TableLayout>
+        
+    <ImageView 
+       	android:id="@+id/imgTheme"
+       	android:layout_height="wrap_content" 
+       	android:layout_width="wrap_content"
+       	android:layout_alignTop="@+id/spinTheme"
+       	android:layout_alignBottom="@id/spinTheme"
+       	android:layout_alignLeft="@id/gameOptions"
+       	android:adjustViewBounds="true"/>
+       
+    <Spinner
+        android:id="@id/spinTheme"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content" 
+        android:layout_toRightOf="@+id/imgTheme"
+        android:layout_alignParentRight="true"
+       	android:layout_below="@id/gameOptions"
+       	android:background="@drawable/dropdown"/>
+        
+	<include layout="@layout/backbutton"/>
+    
+    <LinearLayout
+    	android:layout_width="wrap_content"
+    	android:layout_height="wrap_content"
+    	android:layout_alignParentBottom="true"
+    	android:layout_centerHorizontal="true"
+    	android:orientation="horizontal">
+    <ImageButton
+    	android:id="@+id/btnTeams"
+    	android:layout_width="120dip"
+    	android:layout_height="40dip"
+    	android:adjustViewBounds="true"
+    	android:scaleType="centerInside"
+    	android:background="@android:color/transparent"
+    	android:src="@drawable/teams"/>
+    <ImageView
+    	android:id="@+id/imgTeamsCount"
+    	android:layout_width="40dip"
+    	android:layout_height="40dip"
+    	android:adjustViewBounds="true"
+    	android:scaleType="centerInside"
+    	android:background="@android:color/transparent"
+    	android:src="@drawable/teamcount"/>
+        
+    </LinearLayout>
+
+    <ImageButton
+    	android:id="@+id/btnStart"
+    	android:layout_width="120dip"
+    	android:layout_height="40dip"
+    	android:layout_alignParentBottom="true"
+    	android:layout_alignParentRight="true"
+    	android:adjustViewBounds="true"
+    	android:scaleType="centerInside"
+    	android:background="@android:color/transparent"
+    	android:src="@drawable/startgamebutton"/>
+
+</RelativeLayout>
+
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_creation.xml b/project_files/Android-build/SDL-android-project/res/layout/team_creation.xml
new file mode 100644
index 0000000..495570b
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_creation.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+  	android:layout_width="fill_parent"
+	android:layout_height="fill_parent">
+	<include layout="@layout/background"/>
+	<LinearLayout
+	  xmlns:android="http://schemas.android.com/apk/res/android"
+	  android:orientation="horizontal"
+	  android:layout_width="fill_parent"
+	  android:layout_height="fill_parent"
+	  android:padding="3dp">
+	  
+	  <RelativeLayout
+	  	android:layout_width="fill_parent"
+	  	android:layout_height="fill_parent"
+	  	android:layout_weight="1">
+	  	<include layout="@layout/backbutton"/>
+	  	<include layout="@layout/savebutton"/>
+	  	<ScrollView
+		  	android:layout_width="fill_parent"
+		  	android:layout_height="fill_parent"
+		  	android:layout_above="@+id/btnBack"
+		  	android:background="@drawable/box"
+		  	android:scrollbarFadeDuration="0">
+		  	<TableLayout
+		  		android:layout_width="fill_parent"
+		  		android:layout_height="fill_parent"
+		  		android:stretchColumns="1"
+		  		android:layout_marginRight="4dip">
+		  		<TableRow android:padding="2dip">
+			  		<TextView
+			  			android:id="@+id/nameTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="wrap_content"
+			  			android:text="@string/name"/>
+			  		<EditText
+			  			android:id="@+id/txtName"
+			  			android:layout_width="fill_parent"
+			  			android:layout_height="wrap_content"
+			  			android:layout_margin="3dip"
+			  			android:background="@drawable/box"
+			  			android:text="@string/name_default"
+			  			android:textColor="#FFF"/>
+		  		</TableRow>
+		  		<TableRow android:padding="2dip">
+			  		<TextView
+			  			android:id="@+id/typeTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="fill_parent"
+			  			android:layout_alignTop="@+id/spinType"
+			  			android:layout_alignBottom="@id/spinType"
+			  			android:gravity="center"
+			  			android:text="@string/type"/>
+			  		<Spinner
+			  			android:id="@id/spinType"
+			  			android:layout_width="fill_parent"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginLeft="3dip"
+			  			android:background="@drawable/dropdown"/>
+		  		</TableRow>
+		  		<TableRow android:padding="2dip">
+		  			<TextView
+			  			android:id="@+id/graveTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="fill_parent"
+			  			android:layout_alignTop="@+id/spinGrave"
+			  			android:layout_alignBottom="@id/spinGrave"
+			  			android:gravity="center"
+			  			android:text="@string/grave"/>
+			  		<Spinner
+			  			android:id="@id/spinGrave"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginLeft="3dip"
+			  			android:background="@drawable/dropdown"/>
+		  		</TableRow>
+		  		<TableRow android:padding="2dip">
+		   			<TextView
+			  			android:id="@+id/FlagTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="fill_parent"
+			  			android:layout_alignTop="@+id/spinFlag"
+			  			android:layout_alignBottom="@id/spinFlag"
+			  			android:gravity="center"
+			  			android:text="@string/flag"/>
+			  		<Spinner
+			  			android:id="@id/spinFlag"
+			  			android:layout_width="fill_parent"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginLeft="3dip"
+			  			android:background="@drawable/dropdown"/>
+		  		</TableRow>
+		  		<TableRow android:padding="2dip">
+		  		  	<TextView
+			  			android:id="@+id/voiceTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="fill_parent"
+			  			android:layout_alignTop="@+id/spinVoice"
+			  			android:layout_alignBottom="@id/spinVoice"
+			  			android:gravity="center"
+			  			android:text="@string/voice"/>
+			  		<RelativeLayout
+			  			android:layout_width="fill_parent"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginLeft="3dip">
+			  			<ImageButton
+			  				android:id="@+id/btnPlay"
+			  				android:layout_width="wrap_content"
+			  				android:layout_height="wrap_content"
+			  				android:layout_alignParentRight="true"
+			  				android:adjustViewBounds="true"
+			  				android:scaleType="centerInside"
+			  				android:src="@drawable/playsound"
+			  				android:background="@android:color/transparent"/>
+			  			<Spinner
+			  				android:id="@+id/spinVoice"
+			  				android:layout_width="fill_parent"
+			  				android:layout_height="fill_parent"
+			  				android:layout_centerVertical="true"
+			  				android:layout_alignParentLeft="true"
+			  				android:layout_toLeftOf="@id/btnPlay"
+			  				android:background="@drawable/dropdown"/>
+			  		</RelativeLayout>
+		  		</TableRow>
+		  		<TableRow android:padding="2dip">
+		  			<TextView
+			  			android:id="@+id/fortTag"
+			  			android:layout_width="wrap_content"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginTop="2dip"
+			  			android:gravity="top"
+			  			android:text="@string/fort"/>
+		  			<RelativeLayout
+			  			android:layout_width="fill_parent"
+			  			android:layout_height="wrap_content"
+			  			android:layout_marginLeft="3dip">
+			  			<Spinner
+			  				android:id="@+id/spinFort"
+			  				android:layout_width="fill_parent"
+			  				android:layout_height="wrap_content"
+			  				android:layout_centerHorizontal="true"
+			  				android:background="@drawable/dropdown"/>
+			  			<ImageView
+			  				android:id="@+id/imgFort"
+			  				android:layout_width="128dip"
+			  				android:layout_height="128dip"
+			  				android:layout_centerHorizontal="true"
+			  				android:layout_below="@id/spinFort"
+			  				android:adjustViewBounds="true"
+			  				android:scaleType="centerInside"
+			  				android:background="@android:color/transparent"
+			  				android:src="@drawable/fort"/>
+			  			
+			  		</RelativeLayout>
+		  		</TableRow>
+		  	</TableLayout>
+		  </ScrollView>
+	  </RelativeLayout>
+	  
+	  <ScrollView
+	  	android:id="@+id/scroller"
+	  	android:layout_width="fill_parent"
+	  	android:layout_height="fill_parent"
+	  	android:layout_weight="1"
+	  	android:background="@drawable/box"
+	  	android:scrollbarFadeDuration="0">
+	  	<LinearLayout
+	  		android:id="@+id/HogsContainer"
+	  		android:orientation="vertical"
+	  		android:layout_width="fill_parent"
+	  		android:layout_height="fill_parent">
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  		<include layout="@layout/team_creation_entry"/>
+	  	</LinearLayout>
+	  </ScrollView>
+	</LinearLayout>
+</FrameLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_creation_entry.xml b/project_files/Android-build/SDL-android-project/res/layout/team_creation_entry.xml
new file mode 100644
index 0000000..f0104ab
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_creation_entry.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+  <RelativeLayout
+  		android:layout_width="fill_parent"
+  		android:layout_height="wrap_content"
+  		android:background="@drawable/box"
+  		android:layout_margin="3dp">
+  		<Spinner
+  			android:id="@+id/spinTeam1"
+  			android:layout_width="wrap_content"
+  			android:layout_height="wrap_content"
+  			android:layout_alignParentRight="true"
+  			android:layout_toRightOf="@+id/btnTeam1"
+  			android:background="@drawable/dropdown"/>
+  		<EditText
+  			android:id="@+id/txtTeam1"
+  			android:layout_width="fill_parent"
+  			android:layout_height="wrap_content"
+  			android:layout_below="@id/spinTeam1"
+  			android:background="@drawable/box"
+  			android:gravity="center"
+  			android:textColor="#FFF"
+  			android:text="Arnold"/>
+  		<ImageButton
+  			android:id="@id/btnTeam1"
+  			android:layout_height="wrap_content"
+  			android:layout_width="wrap_content"
+  			android:layout_alignLeft="@id/txtTeam1"
+  			android:layout_above="@id/txtTeam1"
+  			android:layout_alignTop="@id/spinTeam1"
+  			android:adjustViewBounds="true"
+  			android:scaleType="centerInside"
+  			android:background="@android:color/transparent"
+  			android:src="@drawable/dice"/>
+  </RelativeLayout>
+</merge>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_selection_dialog.xml b/project_files/Android-build/SDL-android-project/res/layout/team_selection_dialog.xml
new file mode 100644
index 0000000..fe98717
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selection_dialog.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:orientation="vertical"
+  android:layout_width="wrap_content"
+  android:layout_height="wrap_content">
+  <TextView
+  	android:id="@+id/team_selection_dialog_select"
+  	android:layout_width="wrap_content"
+  	android:layout_height="wrap_content"
+  	android:text="@string/select"/>
+  <TextView
+  	android:id="@+id/team_selection_dialog_edit"
+  	android:layout_width="wrap_content"
+  	android:layout_height="wrap_content"
+  	android:text="@string/edit"/>
+  <TextView
+  	android:id="@+id/team_selection_dialog_delete"
+  	android:layout_width="wrap_content"
+  	android:layout_height="wrap_content"
+  	android:text="@string/delete"/>
+</LinearLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry.xml b/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry.xml
new file mode 100644
index 0000000..b86263a
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:id="@+id/teamColor"
+  android:layout_width="fill_parent"
+  android:layout_height="fill_parent"
+  android:background="#8FFF"
+  android:padding="3dip">
+  
+  <ImageView
+  	android:id="@+id/imgDifficulty"
+  	android:layout_height="fill_parent"
+  	android:layout_width="wrap_content"
+  	android:adjustViewBounds="true"
+  	android:scaleType="centerInside"/>
+  <ImageView
+  	
+  	android:layout_height="wrap_content"
+  	android:layout_width="wrap_content"
+  	android:layout_alignParentRight="true"
+  	android:layout_centerVertical="true"
+  	android:adjustViewBounds="true"
+  	android:scaleType="centerInside"
+  	android:background="#FDA"/>
+  <ImageView
+  	android:id="@+id/teamCount"
+  	android:layout_height="fill_parent"
+  	android:layout_width="wrap_content"
+  	android:layout_alignParentRight="true"
+  	android:layout_alignTop="@id/imgDifficulty"
+  	android:layout_alignBottom="@id/imgDifficulty"
+  	android:adjustViewBounds="true"
+  	android:scaleType="centerInside"
+  	android:src="@drawable/teamcount7"/>
+  <TextView
+  	android:id="@+id/txtName"
+  	android:layout_height="fill_parent"
+  	android:layout_width="wrap_content"
+  	android:layout_toRightOf="@id/imgDifficulty"
+  	android:layout_toLeftOf="@id/teamCount"
+  	android:layout_alignTop="@id/imgDifficulty"
+  	android:layout_alignBottom="@id/imgDifficulty"
+  	android:gravity="center"
+  	android:textColor="#FFF"/>
+</RelativeLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry_simple.xml b/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry_simple.xml
new file mode 100644
index 0000000..f6694f7
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selection_entry_simple.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="fill_parent"
+  android:layout_height="fill_parent"
+  android:background="#8FFF"
+  android:padding="3dip">
+  
+  <ImageView
+  	android:id="@+id/imgDifficulty"
+  	android:layout_height="fill_parent"
+  	android:layout_width="wrap_content"
+  	android:adjustViewBounds="true"
+  	android:scaleType="centerInside"/>
+ 
+  <TextView
+  	android:id="@+id/txtName"
+  	android:layout_height="fill_parent"
+  	android:layout_width="wrap_content"
+  	android:layout_toRightOf="@id/imgDifficulty"
+  	android:layout_toLeftOf="@id/teamCount"
+  	android:layout_alignTop="@id/imgDifficulty"
+  	android:layout_alignBottom="@id/imgDifficulty"
+  	android:gravity="center"
+  	android:textColor="#FFF"/>
+</RelativeLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml b/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml
new file mode 100644
index 0000000..3c7ea3e
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/layout/team_selector.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="fill_parent"
+  android:layout_height="fill_parent">
+  
+  <include layout="@layout/background"/>
+ 
+  <include layout="@layout/backbutton"/>
+
+  <ImageButton
+   	android:id="@+id/btnAdd"
+   	android:layout_width="wrap_content"
+   	android:layout_height="50dip"
+   	android:layout_alignParentBottom="true"
+   	android:layout_alignParentRight="true"
+   	android:adjustViewBounds="true"
+   	android:scaleType="centerInside"
+   	android:background="@android:color/transparent"
+   	android:src="@drawable/settings"/>
+ <TextView
+  	android:id="@+id/txtInfo"
+  	android:layout_height="wrap_content"
+  	android:layout_width="fill_parent"
+  	android:layout_alignParentBottom="true"
+  	android:layout_toRightOf="@id/btnBack"
+  	android:layout_toLeftOf="@id/btnAdd"
+  	android:layout_alignTop="@id/btnBack"
+  	android:layout_margin="3dp"
+  	android:gravity="center"
+  	android:background="@drawable/box"/>
+  	
+  
+
+  <LinearLayout
+  	android:orientation="horizontal"
+  	android:layout_width="fill_parent"
+  	android:layout_height="fill_parent"
+  	android:layout_above="@id/txtInfo"
+  	android:layout_margin="3dp">
+  	
+	  <ListView
+	  	android:id="@+id/selectedTeams"
+	  	android:layout_height="fill_parent"
+	  	android:layout_width="wrap_content"
+	  	android:layout_margin="3dp"
+	  	android:background="@drawable/box"
+	  	android:layout_weight="1"/>
+	  	
+	  <ListView
+	  	android:id="@+id/availableTeams"
+	  	android:layout_height="fill_parent"
+	  	android:layout_width="wrap_content"
+	  	android:layout_margin="3dp"
+	  	android:background="@drawable/box"
+	  	android:layout_weight="1"/>
+  </LinearLayout>
+</RelativeLayout>
diff --git a/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml b/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml
new file mode 100644
index 0000000..9ce626e
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/basicflags.xml
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<basicflags>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$damagepct</string>
+        </command>
+        <default>
+            <integer>100</integer>
+        </default>
+        <image>
+            <string>Damage</string>
+        </image>
+        <max>
+            <integer>300</integer>
+        </max>
+        <min>
+            <integer>10</integer>
+        </min>
+        <title>
+            <string>Damage Modifier</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>true</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>true</boolean>
+        </times1000>
+        <command>
+            <string>e$turntime</string>
+        </command>
+        <default>
+            <integer>45</integer>
+        </default>
+        <image>
+            <string>Time</string>
+        </image>
+        <max>
+            <integer>100</integer>
+        </max>
+        <min>
+            <integer>1</integer>
+        </min>
+        <title>
+            <string>Turn Time</string>
+        </title>
+    </flag>
+    <flag>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>inithealth</string>
+        </command>
+        <default>
+            <integer>200</integer>
+        </default>
+        <image>
+            <string>Health</string>
+        </image>
+        <max>
+            <integer>200</integer>
+        </max>
+        <min>
+            <integer>50</integer>
+        </min>
+        <title>
+            <string>Initial Health</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>true</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$sd_turns</string>
+        </command>
+        <default>
+            <integer>15</integer>
+        </default>
+        <image>
+            <string>SuddenDeath</string>
+        </image>
+        <max>
+            <integer>50</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Sudden Death Timeout</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$casefreq</string>
+        </command>
+        <default>
+            <integer>5</integer>
+        </default>
+        <image>
+            <string>Box</string>
+        </image>
+        <max>
+            <integer>9</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Crate Drop Turns</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>true</boolean>
+        </times1000>
+        <command>
+            <string>e$minestime</string>
+        </command>
+        <default>
+            <integer>3</integer>
+        </default>
+        <image>
+            <string>Time</string>
+        </image>
+        <max>
+            <integer>5</integer>
+        </max>
+        <min>
+            <integer>-1</integer>
+        </min>
+        <title>
+            <string>Mines Time</string>
+        </title>
+    </flag>
+   <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$minesnum</string>
+        </command>
+        <default>
+            <integer>4</integer>
+        </default>
+        <image>
+            <string>Mine</string>
+        </image>
+        <max>
+            <integer>80</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Mines Number</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$minedudpct</string>
+        </command>
+        <default>
+            <integer>0</integer>
+        </default>
+        <image>
+            <string>Dud</string>
+        </image>
+        <max>
+            <integer>100</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Dud Mines Probability (%)</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$explosives</string>
+        </command>
+        <default>
+            <integer>2</integer>
+        </default>
+        <image>
+            <string>Damage</string>
+        </image>
+        <max>
+            <integer>40</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Explosives</string>
+        </title>
+    </flag>
+        <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$healthprob</string>
+        </command>
+        <default>
+            <integer>35</integer>
+        </default>
+        <image>
+            <string>Health</string>
+        </image>
+        <max>
+            <integer>100</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Health Kit Probability (%)</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$hcaseamount</string>
+        </command>
+        <default>
+            <integer>25</integer>
+        </default>
+        <image>
+            <string>Health</string>
+        </image>
+        <max>
+            <integer>200</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Health Amount in Kit</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$waterrise</string>
+        </command>
+        <default>
+            <integer>47</integer>
+        </default>
+        <image>
+            <string>SuddenDeath</string>
+        </image>
+        <max>
+            <integer>100</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Water Rise Amount</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$healthdec</string>
+        </command>
+        <default>
+            <integer>5</integer>
+        </default>
+        <image>
+            <string>SuddenDeath</string>
+        </image>
+        <max>
+            <integer>100</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Health Decrease</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$ropepct</string>
+        </command>
+        <default>
+            <integer>100</integer>
+        </default>
+        <image>
+            <string>Rope</string>
+        </image>
+        <max>
+            <integer>999</integer>
+        </max>
+        <min>
+            <integer>25</integer>
+        </min>
+        <title>
+            <string>Rope Length (%)</string>
+        </title>
+    </flag>
+    <flag>
+        <checkOverMax>
+            <boolean>false</boolean>
+        </checkOverMax>
+        <times1000>
+            <boolean>false</boolean>
+        </times1000>
+        <command>
+            <string>e$getawaytime</string>
+        </command>
+        <default>
+            <integer>100</integer>
+        </default>
+        <image>
+            <string>Time</string>
+        </image>
+        <max>
+            <integer>999</integer>
+        </max>
+        <min>
+            <integer>0</integer>
+        </min>
+        <title>
+            <string>Get Away Time (%)</string>
+        </title>
+    </flag>
+</basicflags>
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml
new file mode 100644
index 0000000..fc7e822
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_barrelmayhem.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Barrel Mayhem</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>30</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>80</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml
new file mode 100644
index 0000000..0fac1f3
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_cleanslate.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Clean Slate</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>45</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>4</integer>
+		<integer>0</integer>
+		<integer>2</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml
new file mode 100644
index 0000000..d91bc38
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_default_scheme.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Default</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>45</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>4</integer>
+		<integer>0</integer>
+		<integer>2</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml
new file mode 100644
index 0000000..0172b73
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_fortmode.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Fort Mode</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>45</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml
new file mode 100644
index 0000000..cb28cca
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_kingmode.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>King Mode</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>45</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>4</integer>
+		<integer>0</integer>
+		<integer>2</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml
new file mode 100644
index 0000000..f18ca60
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_minefield.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Minefield</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>30</integer>
+		<integer>50</integer>
+		<integer>15</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>80</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+        <integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml
new file mode 100644
index 0000000..fe1431f
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_promode.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Pro Mode</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>0</integer>
+		<integer>3</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>2</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml
new file mode 100644
index 0000000..0396f4a
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_shoppa.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Shoppa</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>30</integer>
+		<integer>100</integer>
+		<integer>50</integer>
+		<integer>1</integer>
+		<integer>3</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml
new file mode 100644
index 0000000..471f5f2
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_thinkingwithportals.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Thinking with Portals</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>45</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>2</integer>
+		<integer>3</integer>
+		<integer>5</integer>
+		<integer>0</integer>
+		<integer>5</integer>
+		<integer>25</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml
new file mode 100644
index 0000000..5db47b7
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_timeless.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Timeless</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>9999</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>5</integer>
+		<integer>10</integer>
+		<integer>2</integer>
+		<integer>35</integer>
+		<integer>30</integer>
+		<integer>0</integer>
+		<integer>0</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml b/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml
new file mode 100644
index 0000000..de7d986
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/scheme_tunnelhogs.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scheme>
+	<name>Tunnelhogs</name>
+	<basicflags>
+		<integer>100</integer>
+		<integer>30</integer>
+		<integer>100</integer>
+		<integer>15</integer>
+		<integer>5</integer>
+		<integer>3</integer>
+		<integer>10</integer>
+		<integer>10</integer>
+		<integer>10</integer>
+		<integer>35</integer>
+		<integer>25</integer>
+		<integer>47</integer>
+		<integer>5</integer>
+		<integer>100</integer>
+		<integer>100</integer>
+	</basicflags>
+	<gamemod>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<true/>
+		<false/>
+		<false/>
+		<true/>
+		<true/>
+		<true/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+		<false/>
+	</gamemod>
+</scheme>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/team_one.xml b/project_files/Android-build/SDL-android-project/res/raw/team_one.xml
new file mode 100644
index 0000000..a8caa08
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_one.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
+<team>
+  <name>Team 1</name>
+  <flag>hedgewars</flag>
+  <fort>Lego</fort>
+  <grave>Bone</grave>
+  <voice>Classic</voice>
+  <hash>0</hash>
+  <hog>
+    <name>Leonidas</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Pipo</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Sonic</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Xin</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Arnold</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Jack</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Tom</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+  <hog>
+    <name>Goldie</name>
+    <hat>NoHat</hat>
+    <level>0</level>
+  </hog>
+</team>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/team_two.xml b/project_files/Android-build/SDL-android-project/res/raw/team_two.xml
new file mode 100644
index 0000000..6d187b3
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/team_two.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
+<team>
+  <name>Team 2</name>
+  <flag>cm_binary</flag>
+  <fort>Lego</fort>
+  <grave>Bone</grave>
+  <voice>Classic</voice>
+  <hash>0</hash>
+  <hog>
+    <name>Paris</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Knut</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Ash</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Woad</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Bob</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Corky</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Bea</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+  <hog>
+    <name>Silvia</name>
+    <hat>NoHat</hat>
+    <level>2</level>
+  </hog>
+</team>
\ No newline at end of file
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_clean b/project_files/Android-build/SDL-android-project/res/raw/weapon_clean
new file mode 100644
index 0000000..ad08faf
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_clean
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Clean</name>
+    <QT>
+    101000900001000001100000000000000000000000000000100000
+    </QT>
+    <probability>
+    040504054160065554655446477657666666615551010111541111
+    </probability>
+    <delay>
+    000000000000000000000000000000000000000000000000000000
+    </delay>
+    <crate>
+    131111031211111112311411111111111111121111110111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_crazy b/project_files/Android-build/SDL-android-project/res/raw/weapon_crazy
new file mode 100644
index 0000000..64197be
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_crazy
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Crazy</name>
+    <QT>
+    999999999999999999299999999999999929999999990999999229
+    </QT>
+    <probability>
+    111111011111111111111111111111111111111111110111111111
+    </probability>
+    <delay>
+    000000000000000000000000000000000000000000000000000000
+    </delay>
+    <crate>
+    131111031211111112311411111111111111121111010111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_default b/project_files/Android-build/SDL-android-project/res/raw/weapon_default
new file mode 100644
index 0000000..bd40785
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_default
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Default</name>
+    <QT>
+    939192942219912103223511100120100000021111010101111991
+    </QT>
+    <probability>
+    040504054160065554655446477657666666615551010111541111
+    </probability>
+    <delay>
+    000000000000020550000004000700400000000022000000060000
+    </delay>
+    <crate>
+    131111031211111112311411111111111111121111110111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_mines b/project_files/Android-build/SDL-android-project/res/raw/weapon_mines
new file mode 100644
index 0000000..ca43d99
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_mines
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Mines</name>
+    <QT>
+    000000990009000000030000000000000000000000000000000000
+    </QT>
+    <probability>
+    000000000000000000000000000000000000000000000000000000
+    </probability>
+    <delay>
+    000000000000020550000004000700400000000020000000060000
+    </delay>
+    <crate>
+    111111111111111111111111111111111111111111110111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_portals b/project_files/Android-build/SDL-android-project/res/raw/weapon_portals
new file mode 100644
index 0000000..f291588
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_portals
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Portals</name>
+    <QT>
+    900000900200000000210000000000000011000009000000000000
+    </QT>
+    <probability>
+    040504054160065554655446477657666666615551010111541111
+    </probability>
+    <delay>
+    000000000000020550000004000700400000000020000000060000
+    </delay>
+    <crate>
+    131111031211111112311411111111111111121111110111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_promode b/project_files/Android-build/SDL-android-project/res/raw/weapon_promode
new file mode 100644
index 0000000..b427f7d
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_promode
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Pro Mode</name>
+    <QT>
+    909000900000000000000900000000000000000000000000000000
+    </QT>
+    <probability>
+    000000000000000000000000000000000000000000000000000000
+    </probability>
+    <delay>
+    000000000000020550000004000700400000000020000000000000
+    </delay>
+    <crate>
+    111111111111111111111111111111111111111110010111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/raw/weapon_shoppa b/project_files/Android-build/SDL-android-project/res/raw/weapon_shoppa
new file mode 100644
index 0000000..737feb3
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/raw/weapon_shoppa
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<weapon>
+    <name>Shoppa</name>
+    <QT>
+    000000990000000000000000000000000000000000000000000000
+    </QT>
+    <probability>
+    444441004424440221011212122242200000000200040001001111
+    </probability>
+    <delay>
+    000000000000000000000000000000000000000000000000000000
+    </delay>
+    <crate>
+    111111111111111111111111111111111111111110110111111111
+    </crate>
+</weapon>
+
diff --git a/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml b/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml
new file mode 100644
index 0000000..1328335
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/values/frontend_data_pointers.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+<array name="schemes">
+	<item>@raw/basicflags</item>
+	<item>@raw/scheme_default_scheme</item>
+	<item>@raw/scheme_barrelmayhem</item>
+	<item>@raw/scheme_cleanslate</item>
+	<item>@raw/scheme_fortmode</item>
+	<item>@raw/scheme_kingmode</item>
+	<item>@raw/scheme_minefield</item>
+	<item>@raw/scheme_promode</item>
+	<item>@raw/scheme_shoppa</item>
+	<item>@raw/scheme_thinkingwithportals</item>
+	<item>@raw/scheme_timeless</item>
+	<item>@raw/scheme_tunnelhogs</item>
+</array>
+
+<array name="weapons">
+    <item>@raw/weapon_default</item>
+    <item>@raw/weapon_clean</item>
+    <item>@raw/weapon_crazy</item>
+    <item>@raw/weapon_mines</item>
+    <item>@raw/weapon_portals</item>
+    <item>@raw/weapon_promode</item>
+    <item>@raw/weapon_shoppa</item>
+</array>
+
+<array name="teams">
+	<item>@raw/team_one</item>
+	<item>@raw/team_two</item>
+
+</array>
+</resources>
diff --git a/project_files/Android-build/SDL-android-project/res/values/strings.xml b/project_files/Android-build/SDL-android-project/res/values/strings.xml
new file mode 100644
index 0000000..34a8f06
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/res/values/strings.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">Hedgewars</string>
+    
+    <string name="select">Select</string>
+    <string name="edit">Edit</string>
+    <string name="delete">Delete</string>
+    <string name="saved">Saved succesfully</string>
+    
+    <!-- SDCARD -->
+    <string name="sdcard_not_mounted_title">Sorry! Could not find the SDCard</string>
+    <string name="sdcard_not_mounted">There\'s been an error when accessing the SDcard. Please check if there is an SDcard present in the device (internal or external) and if the SDcard is not mounted (via usb to your computer for example). Hedgewars for Android will now quit</string>
+        
+    <!-- Notification -->
+    <string name="notification_title">Downloading hedgewars files...</string>
+    <string name="notification_done">Successfully downloaded: </string>
+    
+    <!-- Download Activity -->
+    <string name="download_background">Continue in background</string>
+    <string name="download_cancel">Cancel</string>
+    <string name="download_done">Done</string>
+    <string name="download_back">Back to main menu</string>
+    <string name="download_tryagain">Try again</string>
+    <string name="download_failed">The download has failed because of: </string>
+    <string name="download_userexplain">Before starting the game we must download some extra files...</string>
+    
+    <string name="download_areyousure">Are you sure you want to download this package?</string>
+    <string name="download_alreadydownloaded">You\'ve already downloaded this package, are you sure you want to download it again?</string>
+    <string name="download_downloadnow">Download now!</string>
+    
+    <string name="download_queued">This download has been queued</string>
+    
+    <!-- start game -->
+    
+    <string name="start_gameplay">Style</string>
+    <string name="start_gamescheme">Game scheme</string>
+    <string name="start_weapons">Weapons</string>
+    <string name="start_map">Map</string>
+    <string name="start_filter">Filter</string>
+    <string name="start_themes">Themes</string>
+    
+    
+    
+    <!-- Teams -->
+    <string name="not_enough_teams">Not enough teams</string>
+    <string name="teams_info_template">Selected teams = %d</string>
+    <!-- Settings -->
+    <string name="name">Name</string>
+    <string name="name_default">Unnamed</string>
+    <string name="type">Type</string>
+    <string name="grave">Grave</string>
+    <string name="flag">Flag</string>
+    <string name="voice">Voice</string>
+    <string name="fort">Fort</string>
+    
+    <!-- Difficulty levels -->
+    <string name="human">Human</string>
+    <string name="bot5">Level 5</string>
+    <string name="bot4">Level 4</string>
+    <string name="bot3">Level 3</string>
+    <string name="bot2">Level 2</string>
+    <string name="bot1">Level 1</string>
+    
+</resources>
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
new file mode 100644
index 0000000..ab0a3a0
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
@@ -0,0 +1,220 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.hedgewars.hedgeroid.R;
+import org.hedgewars.hedgeroid.Utils;
+import org.hedgewars.hedgeroid.Datastructures.Map.MapType;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import java.nio.ByteBuffer;
+
+public class FrontendDataUtils {
+
+
+	public static ArrayList<Map> getMaps(Context c){
+		File[] files = Utils.getFilesFromRelativeDir(c,"Maps");
+		ArrayList<Map> ret = new ArrayList<Map>();
+
+		for(File f : files){
+			if(Utils.hasFileWithSuffix(f, ".lua")){
+				ret.add(new Map(f,MapType.TYPE_MISSION, c));
+			}else{
+				ret.add(new Map(f, MapType.TYPE_DEFAULT,c));
+			}
+		}
+		Collections.sort(ret);
+
+		return ret;
+	}
+
+	public static List<String> getGameplay(Context c){
+		String[] files = Utils.getFileNamesFromRelativeDir(c, "Scripts/Multiplayer");
+		ArrayList<String> ret = new ArrayList<String>();
+		
+		for(int i = 0; i < files.length; i++){
+			if(files[i].endsWith(".lua")){
+				ret.add(files[i].replace('_', ' ').substring(0, files[i].length()-4)); //replace _ by a space and removed the last four characters (.lua)
+			}
+		}
+		ret.add(0,"None");
+		Collections.sort(ret);
+		return ret;	
+	}
+
+	public static List<String> getThemes(Context c){
+		List<String> list = Utils.getDirsWithFileSuffix(c, "Themes", "icon.png");
+		Collections.sort(list);
+		return list;
+	}
+
+	public static List<Scheme> getSchemes(Context c){
+		List<Scheme> list = Scheme.getSchemes(c);
+		Collections.sort(list);
+		return list;
+	}
+
+	public static List<Weapon> getWeapons(Context c){
+		List<Weapon> list = Weapon.getWeapons(c);
+		Collections.sort(list);
+		return list;
+	}
+
+	public static ArrayList<HashMap<String, ?>> getGraves(Context c){
+		String pathPrefix = Utils.getDataPath(c) + "Graphics/Graves/";
+		ArrayList<String> names = Utils.getFilesFromDirWithSuffix(c,"Graphics/Graves", ".png", true);
+		ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(names.size());
+
+		for(String s : names){
+			HashMap<String, Object> map = new HashMap<String, Object>();
+			map.put("txt", s);
+			Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+			int width = b.getWidth();
+			if(b.getHeight() > width){//some pictures contain more 'frames' underneath each other, if so we only use the first frame
+                                Bitmap tmp = Bitmap.createBitmap(width, width, b.getConfig());
+                                int[] pixels = new int[width * width];
+                                b.getPixels(pixels, 0,width,0,0,width,width);
+				tmp.setPixels(pixels,0,width,0,0,width,width);
+                                b.recycle();
+				b = tmp;
+			}
+			map.put("img", b);
+			data.add(map);
+		}
+		return data;
+	}
+
+	public static ArrayList<HashMap<String, ?>> getFlags(Context c){
+		String pathPrefix = Utils.getDataPath(c) + "Graphics/Flags/";
+		ArrayList<String> names = Utils.getFilesFromDirWithSuffix(c, "Graphics/Flags", ".png", true);
+		ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(names.size());
+
+		for(String s : names){
+			HashMap<String, Object> map = new HashMap<String, Object>();
+			map.put("txt", s);
+			Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+			map.put("img", b);
+			data.add(map);
+		}
+		return data;
+	}
+
+	public static ArrayList<String> getVoices(Context c){
+		File[] files = Utils.getFilesFromRelativeDir(c, "Sounds/voices");
+		ArrayList<String> ret = new ArrayList<String>();
+
+		for(File f : files){
+			if(f.isDirectory()) ret.add(f.getName());
+		}
+		return ret;
+	}
+
+	public static ArrayList<String> getForts(Context c){
+		return Utils.getFilesFromDirWithSuffix(c,"Forts", "L.png", true);
+	}
+	public static ArrayList<HashMap<String, ?>> getTypes(Context c){
+		ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(6);
+		String[] levels = {c.getString(R.string.human), c.getString(R.string.bot5), c.getString(R.string.bot4), c.getString(R.string.bot3), c.getString(R.string.bot2), c.getString(R.string.bot1)};
+		int[] images = {R.drawable.human, R.drawable.bot5, R.drawable.bot4, R.drawable.bot3, R.drawable.bot2, R.drawable.bot1};
+
+		for(int i = 0; i < levels.length; i++){
+			HashMap<String, Object> map = new HashMap<String, Object>();
+			map.put("txt", levels[i]);
+			map.put("img", images[i]);
+			data.add(map);
+		}
+
+		return data;
+	}
+
+	public static ArrayList<HashMap<String, ?>> getHats(Context c){
+		ArrayList<String> files = Utils.getFilesFromDirWithSuffix(c,"Graphics/Hats", ".png", true);
+		String pathPrefix = Utils.getDataPath(c) + "Graphics/Hats/";
+		int size = files.size();
+		ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>(size);
+
+		HashMap<String, Object> hashmap; 
+		for(String s : files){
+			hashmap = new HashMap<String, Object>();
+			hashmap.put("txt", s);
+			Bitmap b = BitmapFactory.decodeFile(pathPrefix + s + ".png");//create a full path - decode to to a bitmap
+			b = Bitmap.createBitmap(b, 0,0,b.getWidth()/2, b.getWidth()/2);
+			hashmap.put("img", b);
+			data.add(hashmap);
+		}
+
+		return data;
+	}
+
+	public static List<HashMap<String, Object>> getTeams(Context c){
+		List<HashMap<String, Object>> ret = new ArrayList<HashMap<String, Object>>();
+
+		File teamsDir = new File(c.getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
+		File[] teamFileNames = teamsDir.listFiles();
+		if(teamFileNames != null){
+			for(File s : teamFileNames){
+				Team t = Team.getTeamFromXml(s.getAbsolutePath());
+				if(t != null){
+					t.file = s.getName();
+					ret.add(teamToMap(t));
+				}
+			}
+		}
+		return ret;
+	}
+
+	public static HashMap<String, Object> teamToMap(Team t){
+		HashMap<String, Object> hashmap = new HashMap<String, Object>();
+		hashmap.put("team", t);
+		hashmap.put("txt", t.name);
+		hashmap.put("color", t.color);
+		hashmap.put("count", t.hogCount);
+		switch(t.levels[0]){
+		case 0:
+			hashmap.put("img", R.drawable.human);
+			break;
+		case 1:
+			hashmap.put("img", R.drawable.bot5);
+			break;
+		case 2:
+			hashmap.put("img", R.drawable.bot4);
+			break;
+		case 3:
+			hashmap.put("img", R.drawable.bot3);
+			break;
+		case 4:
+			hashmap.put("img", R.drawable.bot2);
+			break;
+		default:
+		case 5:
+			hashmap.put("img", R.drawable.bot1);
+			break;
+		}
+		return hashmap;
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
new file mode 100644
index 0000000..733090f
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
@@ -0,0 +1,24 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+public enum GameMode {
+		MODE_LOCAL, MODE_DEMO, MODE_NET, MODE_SAVE
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
new file mode 100644
index 0000000..d8ed13b
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
@@ -0,0 +1,36 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+public class Grave{
+
+	public final String name;
+	public final String path;
+	
+	public Grave(String _name, String _path) {
+		name = _name;
+		path = _path;
+	}
+
+	public String toString(){
+		return name;
+	}
+	
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
new file mode 100644
index 0000000..ec14441
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
@@ -0,0 +1,163 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
+
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Map implements Comparable<Map>, Parcelable{
+
+	private static final String MISSION_PREFIX = "Mission: ";
+
+	private String name;
+	private String path;
+	private String previewPath;
+	private MapType type;
+
+	public Map(File mapDir, MapType _type, Context c){
+		type = _type;
+
+		name = mapDir.getName();
+		path = mapDir.getAbsolutePath();
+		previewPath = path + "/preview.png";
+		
+		/*switch(type){
+		case TYPE_DEFAULT:
+			
+			break;
+		case TYPE_GENERATED:
+			//TODO
+			break;
+		case TYPE_MISSION:
+			name = MISSION_PREFIX + mapDir.getName();
+			path = mapDir.getAbsolutePath();
+			break;
+		}*/
+
+		
+	}
+	
+	public Map(Parcel in){
+		readFromParcel(in);
+	}
+
+	public String toString(){
+		switch(type){
+		default:
+		case TYPE_DEFAULT:
+			return name;
+		case TYPE_GENERATED:
+			return "bla";
+		case TYPE_MISSION:
+			return MISSION_PREFIX + name;
+		}
+	}
+	
+	public void sendToEngine(EngineProtocolNetwork epn) throws IOException{
+		epn.sendToEngine(String.format("emap %s",name));
+	}
+	
+	public MapType getType(){
+		return type;
+	}
+
+	public Drawable getDrawable(){
+		switch(type){
+		case TYPE_MISSION:
+		case TYPE_DEFAULT:
+			return Drawable.createFromPath(previewPath);
+		case TYPE_GENERATED:
+
+		default:
+			return null;
+		}
+	}
+
+	public int compareTo(Map another) {
+		switch(type){
+		case TYPE_GENERATED:
+			switch(another.getType()){
+			case TYPE_GENERATED:
+				return name.compareTo(another.name);
+			case TYPE_MISSION:
+				return -1;
+			case TYPE_DEFAULT:
+				return -1;
+			}
+		case TYPE_MISSION:
+			switch(another.getType()){
+			case TYPE_GENERATED:
+				return 1;
+			case TYPE_MISSION:
+				return name.compareTo(another.name);
+			case TYPE_DEFAULT:
+				return -1;
+			}
+		case TYPE_DEFAULT:
+			switch(another.getType()){
+			case TYPE_GENERATED:
+				return 1;
+			case TYPE_MISSION:
+				return 1;
+			case TYPE_DEFAULT:
+				return name.compareTo(another.name);
+			}
+		}
+		return 0;//default case this should never happen
+	}
+
+	public enum MapType{
+		TYPE_DEFAULT, TYPE_MISSION, TYPE_GENERATED
+	}
+
+	public int describeContents() {
+		return 0;
+	}
+	
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(name);
+		dest.writeString(path);
+		dest.writeString(previewPath);
+		dest.writeString(type.name());
+	}
+	
+	private void readFromParcel(Parcel src){
+		name = src.readString();
+		path = src.readString();
+		previewPath = src.readString();
+		type = MapType.valueOf(src.readString());
+	}
+	public static final Parcelable.Creator<Map> CREATOR = new Parcelable.Creator<Map>() {
+		public Map createFromParcel(Parcel source) {
+			return new Map(source);
+		}
+		public Map[] newArray(int size) {
+			return new Map[size];
+		}
+		
+	};
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
new file mode 100644
index 0000000..3f2c729
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
@@ -0,0 +1,368 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+
+import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Scheme implements Parcelable, Comparable<Scheme>{
+
+	public static final String DIRECTORY_SCHEME = "schemes";
+
+	private String name;
+	//private ArrayList<Integer> basic;
+	private Integer gamemod;
+	private ArrayList<Integer> basic;;
+	private static ArrayList<LinkedHashMap<String, ?>> basicflags = new ArrayList<LinkedHashMap<String, ?>>();//TODO why is it static?
+	public int health;
+	
+	public Scheme(String _name, ArrayList<Integer> _basic, int _gamemod){
+		name = _name;
+		gamemod = _gamemod;
+		basic = _basic;
+	}
+	
+	public Scheme(Parcel in){
+		readFromParcel(in);
+	}
+
+	public void sendToEngine(EngineProtocolNetwork epn)throws IOException{ 
+		epn.sendToEngine(String.format("e$gmflags %d", gamemod));
+
+		for(int pos = 0; pos < basic.size(); pos++){
+			LinkedHashMap<String, ?> basicflag = basicflags.get(pos);
+			
+			String command = (String)basicflag.get("command");
+			Integer value = basic.get(pos);
+			
+			if(command.equals("inithealth")){//Health is a special case, it doesn't need to be send 				                             
+				health = value;              //to the engine yet, we'll do that with the other HH info
+				continue;
+			}
+			
+			Boolean checkOverMax = (Boolean) basicflag.get("checkOverMax");
+			Boolean times1000 = (Boolean) basicflag.get("times1000");
+			Integer max = (Integer) basicflag.get("max");
+			
+			if(checkOverMax && value >= max) value = max;
+			if(times1000) value *= 1000;
+			
+			epn.sendToEngine(String.format("%s %d", command, value));
+		}
+	}
+	public String toString(){
+		return name;
+	}
+
+
+	public static final int STATE_START = 0;
+	public static final int STATE_ROOT = 1;
+	public static final int STATE_NAME = 2;
+	public static final int STATE_BASICFLAGS = 3;
+	public static final int STATE_GAMEMOD = 4;
+	public static final int STATE_BASICFLAG_INTEGER = 5;
+	public static final int STATE_GAMEMOD_TRUE = 6;
+	public static final int STATE_GAMEMOD_FALSE = 7;
+
+	public static ArrayList<Scheme> getSchemes(Context c) throws IllegalArgumentException{
+		String dir = c.getFilesDir().getAbsolutePath() + '/' + DIRECTORY_SCHEME + '/';
+		String[] files = new File(dir).list(fnf);
+		if(files == null) files = new String[]{};
+		Arrays.sort(files);
+		ArrayList<Scheme> schemes = new ArrayList<Scheme>();
+
+		try {
+			XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+			XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+			for(String file : files){
+				BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
+				xmlPuller.setInput(br);
+				String name = null;
+				ArrayList<Integer> basic = new ArrayList<Integer>();
+				Integer gamemod = 0;
+				int health = 0;
+				int mask = 0x000000004;
+
+				int eventType = xmlPuller.getEventType();
+				int state = STATE_START;
+				while(eventType != XmlPullParser.END_DOCUMENT){
+					switch(state){
+					case STATE_START:
+						if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("scheme")) state = STATE_ROOT;
+						else if(eventType != XmlPullParser.START_DOCUMENT) throwException(file, eventType);
+						break;
+					case STATE_ROOT:
+						if(eventType == XmlPullParser.START_TAG){
+							if(xmlPuller.getName().equals("basicflags")) state = STATE_BASICFLAGS;
+							else if(xmlPuller.getName().toLowerCase().equals("gamemod")) state = STATE_GAMEMOD;
+							else if(xmlPuller.getName().toLowerCase().equals("name")) state = STATE_NAME;
+							else throwException(file, eventType);
+						}else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+						else throwException(xmlPuller.getText(), eventType);
+						break;
+					case STATE_BASICFLAGS:
+						if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().toLowerCase().equals("integer")) state = STATE_BASICFLAG_INTEGER;
+						else if(eventType == XmlPullParser.END_TAG)	state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_GAMEMOD:
+						if(eventType == XmlPullParser.START_TAG){
+							if(xmlPuller.getName().toLowerCase().equals("true")) state = STATE_GAMEMOD_TRUE;
+							else if(xmlPuller.getName().toLowerCase().equals("false")) state = STATE_GAMEMOD_FALSE;
+							else throwException(file, eventType);
+						}else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_NAME:
+						if(eventType == XmlPullParser.TEXT) name = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_BASICFLAG_INTEGER:
+						if(eventType == XmlPullParser.TEXT) basic.add(Integer.parseInt(xmlPuller.getText().trim()));
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_BASICFLAGS;
+						else throwException(file, eventType);
+						break;
+					case STATE_GAMEMOD_FALSE:
+						if(eventType == XmlPullParser.TEXT) gamemod <<= 1;
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_GAMEMOD;
+						else throwException(file, eventType);
+						break;
+					case STATE_GAMEMOD_TRUE:
+						if(eventType == XmlPullParser.TEXT){
+							gamemod |= mask;
+							gamemod <<= 1;
+						}else if(eventType == XmlPullParser.END_TAG) state = STATE_GAMEMOD;
+						else throwException(file, eventType);
+						break;
+					}
+					eventType = getEventType(xmlPuller);
+				}//end while(eventtype != END_DOCUMENT
+				schemes.add(new Scheme(name, basic, gamemod));
+			}//end for(string file : files
+			return schemes;
+		} catch (XmlPullParserException e) {
+			e.printStackTrace();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return new ArrayList<Scheme>();//TODO handle correctly
+	}
+	
+	private static FilenameFilter fnf = new FilenameFilter(){
+		public boolean accept(File dir, String filename) {
+			return filename.toLowerCase().startsWith("scheme_");
+		}
+	};
+
+	/**
+	 * This method will parse the basic flags from a prespecified xml file.
+	 * I use a raw xml file rather than one parsed by aatp at compile time
+	 * to keep it generic with other frontends, ie in the future we could 
+	 * use one provided by the Data folder.
+	 */
+	public static void parseBasicFlags(Context c){
+		String filename = String.format("%s/%s/basicflags", c.getFilesDir().getAbsolutePath(), DIRECTORY_SCHEME);
+
+		XmlPullParser xmlPuller = null;
+		BufferedReader br = null;
+		try {
+			XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+			xmlPuller = xmlPullFactory.newPullParser();
+			br = new BufferedReader(new FileReader(filename), 1024);
+			xmlPuller.setInput(br);
+
+			int eventType = getEventType(xmlPuller);
+			boolean continueParsing = true;
+			do{
+				switch(eventType){
+				
+				case XmlPullParser.START_TAG:
+					if(xmlPuller.getName().toLowerCase().equals("flag")){
+						basicflags.add(parseFlag(xmlPuller));
+					}else if(xmlPuller.getName().toLowerCase().equals("basicflags")){
+						eventType = getEventType(xmlPuller);
+					}else{
+						skipCurrentTag(xmlPuller);
+						eventType = getEventType(xmlPuller);
+					}
+					break;
+				case XmlPullParser.START_DOCUMENT://ignore all tags not being "flag"
+				case XmlPullParser.END_TAG:
+				case XmlPullParser.TEXT:
+				default:
+					continueParsing = true;
+				case XmlPullParser.END_DOCUMENT:
+					continueParsing = false;
+				}
+			}while(continueParsing);
+
+		}catch(IOException e){
+			e.printStackTrace();
+		}catch (XmlPullParserException e) {
+			e.printStackTrace();
+		}finally{
+			if(br != null)
+				try {
+					br.close();
+				} catch (IOException e) {}
+		}
+
+	}
+
+	/*
+	 * * Parses a Tag structure from xml as example we use
+	 *<flag>
+	 *   <checkOverMax>
+	 *       <boolean>false</boolean>
+	 *   </checkOverMax>
+	 *</flag>
+	 *
+	 * It returns a LinkedHashMap with key/value pairs
+	 */
+	private static LinkedHashMap<String, Object> parseFlag(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+		LinkedHashMap<String, Object> hash = new LinkedHashMap<String, Object>();
+
+		int eventType = xmlPuller.getEventType();//Get the event type which triggered this method
+		if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().toLowerCase().equals("flag")){//valid start of flag tag
+			String lcKey = null;
+			String lcType = null;
+			String value = null;
+
+			eventType = getEventType(xmlPuller);//<checkOverMax>
+			while(eventType == XmlPullParser.START_TAG){
+				lcKey = xmlPuller.getName();//checkOverMax
+				if(getEventType(xmlPuller) == XmlPullParser.START_TAG){//<boolean>
+					lcType = xmlPuller.getName().toLowerCase();
+					if(getEventType(xmlPuller) == XmlPullParser.TEXT){
+						value = xmlPuller.getText();
+						if(getEventType(xmlPuller) == XmlPullParser.END_TAG && //</boolean> 
+								getEventType(xmlPuller) == XmlPullParser.END_TAG){//</checkOverMax>
+							if(lcType.equals("boolean")) hash.put(lcKey, new Boolean(value));
+							else if(lcType.equals("string"))hash.put(lcKey, value);							
+							else if(lcType.equals("integer")){
+								try{
+									hash.put(lcKey, new Integer(value));
+								}catch (NumberFormatException e){
+									throw new XmlPullParserException("Wrong integer value in xml file");
+								}
+							}else{
+								throwException("basicflags", eventType);
+							}
+						}//</boolean> / </checkOverMax>
+					}//if TEXT
+				}//if boolean
+				eventType = getEventType(xmlPuller);//start new loop
+			}
+			eventType = getEventType(xmlPuller);//</flag>
+		}
+
+		return hash;
+	}
+
+	private static void skipCurrentTag(XmlPullParser xmlPuller) throws XmlPullParserException, IOException{
+		int eventType = xmlPuller.getEventType();
+		if(eventType != XmlPullParser.START_TAG)return;
+		String tag = xmlPuller.getName().toLowerCase();
+
+		while(true){
+			eventType = getEventType(xmlPuller);//getNext()
+			switch(eventType){
+			case XmlPullParser.START_DOCUMENT://we're inside of a start tag so START_ or END_DOCUMENT is just wrong
+			case XmlPullParser.END_DOCUMENT:
+				throw new XmlPullParserException("invalid xml file");
+			case XmlPullParser.START_TAG://if we get a new tag recursively handle it
+				skipCurrentTag(xmlPuller);
+				break;
+			case XmlPullParser.TEXT:
+				break;
+			case XmlPullParser.END_TAG:
+				if(!xmlPuller.getName().toLowerCase().equals(tag)){//if the end tag doesn't match the start tag
+					throw new XmlPullParserException("invalid xml file");
+				}else{
+					return;//skip completed	
+				}
+
+			}
+		}
+	}
+
+	/**
+	 * Skips whitespaces..
+	 */
+	private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+		int eventType = xmlPuller.next();
+		while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+			eventType = xmlPuller.next();
+		}
+		return eventType;
+	}
+	private static void throwException(String file, int eventType){
+		throw new IllegalArgumentException(String.format("Xml file: %s malformed with error: %d.", file, eventType));
+	}
+
+	public int describeContents() {
+		return 0;
+	}
+
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(name);
+		dest.writeInt(gamemod);
+		dest.writeList(basic);
+	}
+	
+	public void readFromParcel(Parcel src){
+		name = src.readString();
+		gamemod = src.readInt();
+		basic = src.readArrayList(ArrayList.class.getClassLoader());
+	}
+
+	public static final Parcelable.Creator<Scheme> CREATOR = new Parcelable.Creator<Scheme>() {
+		public Scheme createFromParcel(Parcel source) {
+			return new Scheme(source);
+		}
+		public Scheme[] newArray(int size) {
+			return new Scheme[size];
+		}
+		
+	};
+
+	public int compareTo(Scheme another) {
+		return name.compareTo(another.name);
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
new file mode 100644
index 0000000..ec835ce
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
@@ -0,0 +1,368 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
+import org.hedgewars.hedgeroid.EngineProtocol.PascalExports;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+import org.xmlpull.v1.XmlSerializer;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Xml;
+
+public class Team implements Parcelable{
+
+	public static final String DIRECTORY_TEAMS = "teams";
+	private static final Integer[] TEAM_COLORS = {
+		0xd12b42, /* red    */ 
+		0x4980c1, /* blue   */ 
+		0x6ab530, /* green  */ 
+		0xbc64c4, /* purple */ 
+		0xe76d14, /* orange */ 
+		0x3fb6e6, /* cyan   */ 
+		0xe3e90c, /* yellow */ 
+		0x61d4ac, /* mint   */ 
+		0xf1c3e1, /* pink   */ 
+		/* add new colors here */
+	};
+
+//	private static final Integer[] TEAM_COLORS = {
+//		0xff0000, /* red    */ 
+//		0x00ff00, /* blue   */ 
+//		0x0000ff, /* green  */ 
+//	};
+
+	private static final int STATE_START = 0;
+	private static final int STATE_ROOT = 1;
+	private static final int STATE_HOG_ROOT = 2;
+
+	public String name, grave, flag, voice, fort, hash;
+	public String file = null;
+
+	public static int maxNumberOfHogs = 0;
+	public static int maxNumberOfTeams = 0;
+
+	static{
+		maxNumberOfHogs = PascalExports.HWgetMaxNumberOfHogs();
+		maxNumberOfTeams = PascalExports.HWgetMaxNumberOfTeams();
+	}
+	public String[] hats = new String[maxNumberOfHogs];
+	public String[] hogNames = new String[maxNumberOfHogs];
+	public int[] levels = new int[maxNumberOfHogs];
+
+	public int hogCount = 4;
+	public int color = TEAM_COLORS[0];
+
+	public Team(){
+	}
+
+	public Team(Parcel in){
+		readFromParcel(in);
+	}
+
+	public boolean equals(Object o){
+		if(super.equals(o)) return true;
+		else if(o instanceof Team){
+			Team t = (Team)o;
+			boolean ret = name.equals(t.name);
+			ret &= grave.equals(t.grave);
+			ret &= flag.equals(t.flag);
+			ret &= voice.equals(t.voice);
+			ret &= fort.equals(t.fort);
+			ret &= hash.equals(t.hash);
+			return ret;
+		}else{
+			return false;
+		}
+	}
+
+	public void setRandomColor(int[] illegalcolors){
+		Integer[] colorsToPickFrom = TEAM_COLORS;
+		if(illegalcolors != null){
+			ArrayList<Integer> colors = new ArrayList<Integer>();
+			for(int color : TEAM_COLORS){
+				boolean validColor = true;
+				for(int illegal : illegalcolors){
+					if(color == illegal) validColor = false;
+				}
+				if(validColor) colors.add(color);
+			}
+			if(colors.size() != 0) colorsToPickFrom = colors.toArray(new Integer[1]);
+		}
+		int index = (int)Math.round(Math.random()*(colorsToPickFrom.length-1));
+		color = colorsToPickFrom[index];
+	}
+
+
+	public void sendToEngine(EngineProtocolNetwork epn, int hogCount, int health) throws IOException{
+		epn.sendToEngine(String.format("eaddteam %s %d %s", hash, color, name));
+		epn.sendToEngine(String.format("egrave %s", grave));
+		epn.sendToEngine(String.format("efort %s", fort));
+		epn.sendToEngine(String.format("evoicepack %s", voice));
+		epn.sendToEngine(String.format("eflag %s", flag));
+
+		for(int i = 0; i < hogCount; i++){
+			epn.sendToEngine(String.format("eaddhh %d %d %s", levels[i], health, hogNames[i]));
+			epn.sendToEngine(String.format("ehat %s", hats[i]));
+		}
+	}
+
+	public void setFileName(Context c){
+		if(file == null){
+		  	file = validFileName(c, name);
+		}
+	}
+	private String validFileName(Context c, String fileName){
+		String absolutePath = String.format("%s/%s", c.getFilesDir(), fileName);
+		File f = new File(absolutePath);
+		if(f.exists()){
+			String newFileName = fileName + (int)(Math.random()*10);
+			return validFileName(c, newFileName);
+		}else{
+			return fileName;
+		}
+	}
+	
+	/*
+	 * XML METHODS
+	 */
+
+	/**
+	 * Read the xml file path and convert it to a Team object
+	 * @param path absolute path to the xml file
+	 * @return
+	 */
+	public static Team getTeamFromXml(String path){
+		try {
+			XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+			XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+			BufferedReader br = new BufferedReader(new FileReader(path), 1024);
+			xmlPuller.setInput(br);
+			Team team = new Team();
+			int hogCounter = 0;
+
+			int eventType = xmlPuller.getEventType();
+			int state = STATE_START;
+			while(eventType != XmlPullParser.END_DOCUMENT){
+				switch(state){
+				case STATE_START:
+					if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("team")) state = STATE_ROOT;
+					else if(eventType != XmlPullParser.START_DOCUMENT) throwException(path, eventType);
+					break;
+				case STATE_ROOT:
+					if(eventType == XmlPullParser.START_TAG){
+						if(xmlPuller.getName().toLowerCase().equals("name")){
+							team.name = getXmlText(xmlPuller, "name");
+						}else if(xmlPuller.getName().toLowerCase().equals("flag")){
+							team.flag= getXmlText(xmlPuller, "flag");
+						}else if(xmlPuller.getName().toLowerCase().equals("voice")){
+							team.voice = getXmlText(xmlPuller, "voice");
+						}else if(xmlPuller.getName().toLowerCase().equals("grave")){
+							team.grave = getXmlText(xmlPuller, "grave");
+						}else if(xmlPuller.getName().toLowerCase().equals("fort")){
+							team.fort = getXmlText(xmlPuller, "fort");
+						}else if(xmlPuller.getName().toLowerCase().equals("hash")){
+							team.hash = getXmlText(xmlPuller, "hash");
+						}else if(xmlPuller.getName().toLowerCase().equals("hog")){
+							state = STATE_HOG_ROOT;
+						}else throwException(xmlPuller.getName(), eventType);
+					}else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+					else throwException(xmlPuller.getText(), eventType);
+					break;
+				case STATE_HOG_ROOT:
+					if(eventType == XmlPullParser.START_TAG){
+						if(xmlPuller.getName().toLowerCase().equals("name")){
+							team.hogNames[hogCounter] = getXmlText(xmlPuller, "name");
+						}else if(xmlPuller.getName().toLowerCase().equals("hat")){
+							team.hats[hogCounter] = getXmlText(xmlPuller, "hat");
+						}else if(xmlPuller.getName().toLowerCase().equals("level")){
+							team.levels[hogCounter] = Integer.parseInt(getXmlText(xmlPuller, "level"));
+						}else throwException(xmlPuller.getText(), eventType);
+					}else if(eventType == XmlPullParser.END_TAG){
+						hogCounter++;
+						state = STATE_ROOT;
+					}else throwException(xmlPuller.getText(), eventType);
+					break;
+				}
+				eventType = getEventType(xmlPuller);
+			}//end while(eventtype != END_DOCUMENT
+			return team;
+		} catch (NumberFormatException e){
+			e.printStackTrace();
+		} catch (XmlPullParserException e) {
+			e.printStackTrace();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	private static String getXmlText(XmlPullParser xmlPuller, String parentTag)throws XmlPullParserException, IOException{
+		if(getEventType(xmlPuller) == XmlPullParser.TEXT){
+			String txt = xmlPuller.getText();
+			if(getEventType(xmlPuller) == XmlPullParser.END_TAG && xmlPuller.getName().toLowerCase().equals(parentTag)){
+				return txt;
+			}
+		}
+		throw new XmlPullParserException("malformed xml file on string read from tag: " + parentTag);
+	}
+
+	/**
+	 * Skips whitespaces..
+	 */
+	private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+		int eventType = xmlPuller.next();
+		while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+			eventType = xmlPuller.next();
+		}
+		return eventType;
+	}
+
+	private static void throwException(String file, int eventType){
+		throw new IllegalArgumentException(String.format("Xml file: %s malformed with error: %d.", file, eventType));
+	}
+
+	public void writeToXml(OutputStream os){
+		XmlSerializer serializer = Xml.newSerializer();
+		try{
+			serializer.setOutput(os, "UTF-8");	
+			serializer.startDocument("UTF-8", true);
+			serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
+
+			serializer.startTag(null, "team");
+			serializer.startTag(null, "name");
+			serializer.text(name);
+			serializer.endTag(null, "name");
+			serializer.startTag(null, "flag");
+			serializer.text(flag);
+			serializer.endTag(null, "flag");
+			serializer.startTag(null, "fort");
+			serializer.text(fort);
+			serializer.endTag(null, "fort");
+			serializer.startTag(null, "grave");
+			serializer.text(grave);
+			serializer.endTag(null, "grave");
+			serializer.startTag(null, "voice");
+			serializer.text(voice);
+			serializer.endTag(null, "voice");
+			serializer.startTag(null, "hash");
+			serializer.text(hash);
+			serializer.endTag(null, "hash");
+
+			for(int i = 0; i < maxNumberOfHogs; i++){
+				serializer.startTag(null, "hog");
+				serializer.startTag(null, "name");
+				serializer.text(hogNames[i]);
+				serializer.endTag(null, "name");
+				serializer.startTag(null, "hat");
+				serializer.text(hats[i]);
+				serializer.endTag(null, "hat");
+				serializer.startTag(null, "level");
+				serializer.text(String.valueOf(levels[i]));
+				serializer.endTag(null, "level");
+
+				serializer.endTag(null, "hog");
+			}
+			serializer.endTag(null, "team");
+			serializer.endDocument();
+			serializer.flush();
+
+		} catch (IOException e) {
+			e.printStackTrace();
+		}finally{
+			try {
+				os.close();
+			} catch (IOException e) {}
+		}
+	}
+	/*
+	 * END XML METHODS
+	 */
+
+
+
+	/*
+	 * PARCABLE METHODS
+	 */
+
+	public int describeContents() {
+		return 0;
+	}
+
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(name);
+		dest.writeString(grave);
+		dest.writeString(flag);
+		dest.writeString(voice);
+		dest.writeString(fort);
+		dest.writeString(hash);
+		dest.writeStringArray(hats);
+		dest.writeStringArray(hogNames);
+		dest.writeIntArray(levels);
+		dest.writeInt(color);
+		dest.writeInt(hogCount);
+		dest.writeString(file);
+	}
+
+
+	public void readFromParcel(Parcel src){
+		name = src.readString();
+		grave = src.readString();
+		flag = src.readString();
+		voice = src.readString();
+		fort = src.readString();
+		hash = src.readString();
+		src.readStringArray(hats);
+		src.readStringArray(hogNames);
+		src.readIntArray(levels);
+		color = src.readInt();
+		hogCount = src.readInt();
+		file = src.readString();
+	}
+
+	public static final Parcelable.Creator<Team> CREATOR = new Parcelable.Creator<Team>() {
+		public Team createFromParcel(Parcel source) {
+			return new Team(source);
+		}
+		public Team[] newArray(int size) {
+			return new Team[size];
+		}
+
+	};
+
+	/*
+	 * END PARCABLE METHODS
+	 */
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
new file mode 100644
index 0000000..0f0a06e
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
@@ -0,0 +1,218 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.Datastructures;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
+import org.hedgewars.hedgeroid.EngineProtocol.PascalExports;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import android.content.Context;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Weapon implements Parcelable, Comparable<Weapon>{
+
+	public static final String DIRECTORY_WEAPON = "weapons";
+	
+	private String name;
+	private String QT;
+	private String prob;
+	private String delay;
+	private String crate;
+	private static int maxWeapons;
+	
+	static{
+		maxWeapons = PascalExports.HWgetNumberOfWeapons();
+	}
+	
+	public Weapon(String _name, String _QT, String _prob, String _delay, String _crate){
+		name = _name;
+		
+		//Incase there's a newer ammoStore which is bigger we append with zeros
+		StringBuffer sb = new StringBuffer();
+		while(_QT.length() + sb.length() < maxWeapons){
+			sb.append('0');
+		}
+		
+		QT = String.format("e%s %s%s", "ammloadt", _QT, sb);
+		prob = String.format("e%s %s%s", "ammprob", _prob, sb);
+		delay = String.format("e%s %s%s", "ammdelay", _delay, sb);
+		crate = String.format("e%s %s%s", "ammreinf", _crate, sb);
+	}
+	
+	public Weapon(Parcel in){
+		readFromParcel(in);
+	}
+	
+	public String toString(){
+		return name;
+	}
+	
+	public void sendToEngine(EngineProtocolNetwork epn, int teamsCount) throws IOException{
+		epn.sendToEngine(QT);//command prefix is already in string 
+		epn.sendToEngine(prob);
+		epn.sendToEngine(delay);
+		epn.sendToEngine(crate);
+		
+		for(int i = 0; i < teamsCount; i++){
+			epn.sendToEngine("eammstore");
+		}
+	}
+	
+	public static final int STATE_START = 0;
+	public static final int STATE_ROOT = 1;
+	public static final int STATE_NAME = 2;
+	public static final int STATE_QT = 3;
+	public static final int STATE_PROBABILITY = 4;
+	public static final int STATE_DELAY = 5;
+	public static final int STATE_CRATE = 6;
+	
+	public static ArrayList<Weapon> getWeapons(Context c) throws IllegalArgumentException{
+		String dir = c.getFilesDir().getAbsolutePath() + '/' + DIRECTORY_WEAPON + '/';
+		String[] files = new File(dir).list();
+		if(files == null) files = new String[]{};
+		
+		ArrayList<Weapon> weapons = new ArrayList<Weapon>();
+
+		try {
+			XmlPullParserFactory xmlPullFactory = XmlPullParserFactory.newInstance();
+			XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+			
+			for(String file : files){
+				BufferedReader br = new BufferedReader(new FileReader(dir + file), 1024);
+				xmlPuller.setInput(br);
+				String name = null;
+				String qt = null;
+				String prob = null;
+				String delay = null;
+				String crate = null;
+				
+				int eventType = xmlPuller.getEventType();
+				int state = STATE_START;
+				while(eventType != XmlPullParser.END_DOCUMENT){
+					switch(state){
+					case STATE_START:
+						if(eventType == XmlPullParser.START_TAG && xmlPuller.getName().equals("weapon")) state = STATE_ROOT;
+						else if(eventType != XmlPullParser.START_DOCUMENT) throwException(file, eventType);
+						break;
+					case STATE_ROOT:
+						if(eventType == XmlPullParser.START_TAG){
+							if(xmlPuller.getName().toLowerCase().equals("qt")) state = STATE_QT;
+							else if(xmlPuller.getName().toLowerCase().equals("name")) state = STATE_NAME;
+							else if(xmlPuller.getName().toLowerCase().equals("probability")) state = STATE_PROBABILITY;
+							else if(xmlPuller.getName().toLowerCase().equals("delay")) state = STATE_DELAY;
+							else if(xmlPuller.getName().toLowerCase().equals("crate")) state = STATE_CRATE;
+							else throwException(file, eventType);
+						}else if(eventType == XmlPullParser.END_TAG) state = STATE_START;
+						else throwException(xmlPuller.getText(), eventType);
+						break;
+					case STATE_NAME:
+						if(eventType == XmlPullParser.TEXT) name = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_QT:
+						if(eventType == XmlPullParser.TEXT) qt = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_PROBABILITY:
+						if(eventType == XmlPullParser.TEXT) prob = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_DELAY:
+						if(eventType == XmlPullParser.TEXT) delay = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					case STATE_CRATE:
+						if(eventType == XmlPullParser.TEXT) crate = xmlPuller.getText().trim();
+						else if(eventType == XmlPullParser.END_TAG) state = STATE_ROOT;
+						else throwException(file, eventType);
+						break;
+					}
+					eventType = xmlPuller.next();
+					while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){//Skip whitespaces
+						eventType = xmlPuller.next();
+					}
+				}//end while(eventtype != END_DOCUMENT
+				weapons.add(new Weapon(name, qt, prob, delay, crate));
+			}//end for(string file : files
+			return weapons;
+			
+		} catch (XmlPullParserException e) {
+			e.printStackTrace();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return new ArrayList<Weapon>();//TODO handle correctly
+	}
+	
+	private static void throwException(String file, int eventType){
+		throw new IllegalArgumentException(String.format("Xml file: %s malformed with eventType: %d.", file, eventType));
+	}
+
+	public int describeContents() {
+		return 0;
+	}
+
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(name);
+		dest.writeString(QT);
+		dest.writeString(prob);
+		dest.writeString(delay);
+		dest.writeString(crate);
+	}
+	
+	private void readFromParcel(Parcel src){
+		name = src.readString();
+		QT = src.readString();
+		prob = src.readString();
+		delay = src.readString();
+		crate = src.readString();
+	}
+	
+	public static final Parcelable.Creator<Weapon> CREATOR = new Parcelable.Creator<Weapon>() {
+		public Weapon createFromParcel(Parcel source) {
+			return new Weapon(source);
+		}
+		public Weapon[] newArray(int size) {
+			return new Weapon[size];
+		}
+		
+	};
+
+	public int compareTo(Weapon another) {
+		return name.compareTo(another.name);
+	}
+	
+	
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java
new file mode 100644
index 0000000..31f9329
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAssets.java
@@ -0,0 +1,100 @@
+package org.hedgewars.hedgeroid.Downloader;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.hedgewars.hedgeroid.MainActivity;
+import org.hedgewars.hedgeroid.R;
+import org.hedgewars.hedgeroid.Utils;
+import org.hedgewars.hedgeroid.Datastructures.Scheme;
+import org.hedgewars.hedgeroid.Datastructures.Team;
+import org.hedgewars.hedgeroid.Datastructures.Weapon;
+
+import android.content.Context;
+import android.content.res.AssetManager;
+import android.os.AsyncTask;
+import android.util.Log;
+
+public class DownloadAssets extends AsyncTask<Object, Long, Long>{
+	
+	private MainActivity act;
+	private static byte[] buffer = null;
+	
+	public DownloadAssets(MainActivity _act){
+		act = _act;
+	}
+	
+	public static Long copyFileOrDir(Context c, String path) {
+	    AssetManager assetManager = c.getAssets();
+	    String assets[] = null;
+	    try {
+	        assets = assetManager.list(path);
+	        if (assets.length == 0) {
+	            return DownloadAssets.copyFile(c, path);
+	        } else {
+	            String fullPath = Utils.getCachePath(c) + path;
+	            File dir = new File(fullPath);
+	            if (!dir.exists())
+	                dir.mkdir();
+	            for (int i = 0; i < assets.length; ++i) {
+	                Long result = DownloadAssets.copyFileOrDir(c, path + "/" + assets[i]);
+	                if(result > 0) return 1l;
+	            }
+	        }
+	    } catch (IOException ex) {
+	    	ex.printStackTrace();
+	        Log.e("tag", "I/O Exception", ex);
+	        return 1l;
+	    }
+	    return 0l;
+	}
+	
+	private static Long copyFile(Context c, String filename) {
+	    AssetManager assetManager = c.getAssets();
+
+	    InputStream in = null;
+	    OutputStream out = null;
+	    try {
+	        in = assetManager.open(filename);
+	        in = new BufferedInputStream(in, 8192);
+	        
+	        String newFileName = Utils.getCachePath(c) + filename;
+	        out = new FileOutputStream(newFileName);
+	        out = new BufferedOutputStream(out, 8192);
+
+	        int read;
+	        while ((read = in.read(buffer)) != -1) {
+	            out.write(buffer, 0, read);
+	        }
+	        in.close();
+	        in = null;
+	        out.flush();
+	        out.close();
+	        out = null;
+	    } catch (Exception e) {
+	    	e.printStackTrace();
+	        Log.e("tag", e.getMessage());
+	        return 1l;
+	    }
+	    return 0l;
+
+	}
+
+	protected Long doInBackground(Object... params) {
+		Utils.resRawToFilesDir(act,R.array.schemes, Scheme.DIRECTORY_SCHEME);
+		Utils.resRawToFilesDir(act, R.array.weapons, Weapon.DIRECTORY_WEAPON);
+		Utils.resRawToFilesDir(act, R.array.teams, Team.DIRECTORY_TEAMS);
+		buffer = new byte[8192];//allocate the buffer
+		return DownloadAssets.copyFileOrDir(act, "Data");
+	}
+	
+	protected void onPostExecute(Long result){
+		act.onAssetsDownloaded(result == 0);
+		buffer = null;
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAsyncTask.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAsyncTask.java
new file mode 100644
index 0000000..4ca5b86
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadAsyncTask.java
@@ -0,0 +1,223 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Downloader;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.hedgewars.hedgeroid.Downloader.DownloadService.DownloadTask;
+
+import android.os.AsyncTask;
+/**
+ * This is an AsyncTask which will download a zip from an URL and unzip it to a specified path
+ * 
+ *  a typical call to start the task would be new DownloadAsyncTask().execute(getExternalStorage(), "www.hedgewars.org/data.zip");
+ * @author Xeli
+ *
+ */
+public class DownloadAsyncTask extends AsyncTask<DownloadPackage, Object, Integer> {
+
+	//private final static String URL_WITHOUT_SUFFIX = "http://www.xelification.com/tmp/firebutton.";
+	private final static String URL_ZIP_SUFFIX = ".zip";
+	private final static String URL_HASH_SUFFIX = ".hash";
+
+	public static final int EXIT_SUCCESS = 0;
+	public static final int EXIT_URLFAIL = 1;
+	public static final int EXIT_CONNERROR = 2;
+	public static final int EXIT_FNF = 3;
+	public static final int EXIT_MD5 = 4;
+	public static final int EXIT_CANCELLED = 5;
+
+	private DownloadTask task;
+	private long lastUpdateMillis = 0;
+
+	public DownloadAsyncTask(DownloadTask _task){
+		task = _task;
+	}
+
+	/**
+	 * 
+	 * @param params - A {@link}DownloadTask which gives information about where to download from and store the files to 
+	 */
+	protected Integer doInBackground(DownloadPackage...packages) {
+		DownloadPackage pack = packages[0];//just use one task per execute call for now
+
+		HttpURLConnection conn = null;
+		MessageDigest digester = null;
+		String rootZipDest = pack.getPathToStore();
+
+		File rootDest = new File(rootZipDest);//TODO check for nullpointer, it hints to the absence of an sdcard
+		rootDest.mkdirs();
+
+		try {
+			URL url = new URL(pack.getURL() + URL_ZIP_SUFFIX);
+			conn = (HttpURLConnection)url.openConnection();
+		} catch (IOException e) {
+			e.printStackTrace();
+			return EXIT_URLFAIL;
+		}
+
+		String contentType = conn.getContentType();
+
+		if(contentType == null || contentType.contains("zip")){ //Seeing as we provide the url if the contentType is unknown lets assume zips
+			int bytesDecompressed = 0;
+			ZipEntry entry = null;
+			ZipInputStream input = null;
+			FileOutputStream output = null;
+			int kbytesToProcess = conn.getContentLength()/1024;
+
+			byte[] buffer = new byte[1024];
+			task.start(kbytesToProcess);
+
+			try {
+				digester = MessageDigest.getInstance("MD5");
+
+			} catch (NoSuchAlgorithmException e1) {
+				e1.printStackTrace();
+			}
+
+			try{
+				input = new ZipInputStream(conn.getInputStream());
+				entry = input.getNextEntry();	
+			}catch(IOException e){
+				e.printStackTrace();
+				if(conn != null) conn.disconnect();
+				return EXIT_CONNERROR;
+			}
+
+
+
+			while(entry != null){
+
+				if(isCancelled()) break;
+
+				try {
+					String fileName = entry.getName();
+					File f = new File(rootZipDest + fileName);
+					bytesDecompressed += entry.getCompressedSize();
+
+					if(entry.isDirectory()){
+						f.mkdir();
+					}else{
+						if(f.exists()){
+							f.delete();
+						}
+						f.createNewFile();
+						output = new FileOutputStream(f);
+
+						int count = 0;
+						while((count = input.read(buffer)) != -1){
+							output.write(buffer, 0, count);
+							digester.update(buffer, 0, count);
+							if(System.currentTimeMillis() - lastUpdateMillis > 1000){
+								lastUpdateMillis = System.currentTimeMillis();
+								publishProgress(bytesDecompressed, kbytesToProcess, fileName);
+							}
+						}
+						output.flush();
+						input.closeEntry();
+					}//if isDir 
+					entry = input.getNextEntry();
+				} catch (FileNotFoundException e) {
+					e.printStackTrace();
+					if(conn != null) conn.disconnect();
+					return EXIT_FNF;
+				} catch (IOException e) {
+					e.printStackTrace();
+					if(conn != null) conn.disconnect();
+					return EXIT_CONNERROR;
+				}finally{
+					try {
+						if( output != null) output.close();
+
+					} catch (IOException e) {}
+				}
+			}//end while(entry != null)
+			if( input != null)
+				try {
+					input.close();
+				} catch (IOException e) {}
+		}else{//end if contentType == "zip"
+			return EXIT_URLFAIL;
+		}
+		if(conn != null) conn.disconnect();
+
+		if(checkMD5(digester, pack))return EXIT_SUCCESS;
+		else return EXIT_MD5;
+	}
+
+	//TODO proper result handling
+	protected void onPostExecute(Integer result){
+		task.done(result);
+	}
+
+	protected void onProgressUpdate(Object...objects){
+		task.update((Integer)objects[0], (Integer)objects[1], (String)objects[2]);
+	}
+
+	protected void onCancelled(){
+		onPostExecute(EXIT_CANCELLED);
+	}
+
+	private boolean checkMD5(MessageDigest digester, DownloadPackage task){
+		if(digester != null) {
+			byte[] messageDigest = digester.digest();
+
+			try {
+				URL url = new URL(task.getURL() + URL_HASH_SUFFIX);
+				HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+
+				byte[] buffer = new byte[1024];//size is large enough to hold the entire hash
+				BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());
+				int bytesRead = bis.read(buffer);
+				String hash = null;
+				if(bytesRead > -1){
+					hash = new String(buffer, 0, bytesRead);
+				}
+				StringBuffer sb = new StringBuffer();
+				Integer tmp = 0;
+				for(int i = 0; i < messageDigest.length; i++){
+					tmp = 0xFF & messageDigest[i];
+					if(tmp < 0xF) sb.append('0');
+					sb.append(Integer.toHexString(tmp));
+				}
+				sb.append('\n');//add newline to become identical with the hash file
+
+				return hash.equals(sb.toString());
+			} catch (IOException e) {
+				e.printStackTrace();
+				return true;
+			}
+		}else{
+			return true;	
+		}
+
+	}
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java
new file mode 100644
index 0000000..c14a450
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java
@@ -0,0 +1,69 @@
+package org.hedgewars.hedgeroid.Downloader;
+
+import org.hedgewars.hedgeroid.R;
+
+import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnClickListener;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.DialogFragment;
+
+public class DownloadDialogFragment extends DialogFragment {
+
+	public static final int NUM_ALREADYDOWNLOADED = 0;
+	public static final int NUM_AREYOUSURE = 1;
+
+	private final static String BUNDLE_TASK = "task";
+
+	static DownloadDialogFragment newInstance(DownloadPackage task){
+		DownloadDialogFragment dialog = new DownloadDialogFragment();
+
+		Bundle args = new Bundle();
+		args.putParcelable(DownloadDialogFragment.BUNDLE_TASK, task);
+		dialog.setArguments(args);
+
+		return dialog;
+	}
+
+	public Dialog onCreateDialog(Bundle savedInstanceState){
+		DownloadPackage task = (DownloadPackage)getArguments().getParcelable(DownloadDialogFragment.BUNDLE_TASK);
+
+		Builder builder = new AlertDialog.Builder(getActivity());
+
+		switch(task.getStatus()){
+		case CURRENTVERSION:
+		case NEWERVERSION:
+			builder.setMessage(R.string.download_areyousure);
+			break;
+		case OLDERVERSION:
+			builder.setMessage(R.string.download_alreadydownloaded);
+			break;
+		}
+
+		DownloadClicker clicker = new DownloadClicker(task);
+		builder.setPositiveButton(android.R.string.yes, clicker);
+		builder.setNegativeButton(android.R.string.no, clicker);
+
+		return builder.create();
+	}
+
+	class DownloadClicker implements OnClickListener{
+
+		DownloadPackage task = null;
+
+		public DownloadClicker(DownloadPackage _task){
+			task = _task;
+		}
+
+		public void onClick(DialogInterface dialog, int which) {
+			if(which == Dialog.BUTTON_POSITIVE){
+				Intent i = new Intent(getActivity(), DownloadListActivity.class);
+				i.putExtra(DownloadFragment.EXTRA_TASK, task);
+				getActivity().startActivity(i);
+			}
+		}
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java
new file mode 100644
index 0000000..a870c92
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java
@@ -0,0 +1,217 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Downloader;
+
+import org.hedgewars.hedgeroid.R;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+public class DownloadFragment extends Fragment{
+	public static final String EXTRA_TASK = "task";
+
+	public static final int MSG_START = 0;
+	public static final int MSG_UPDATE = 1;
+	public static final int MSG_DONE = 2;
+	public static final int MSG_FAILED = 3;
+
+	private boolean boundToService = false;
+
+	private TextView progress_sub;
+	private ProgressBar progress;
+	private Button /*positive,*/ negative;
+
+	private DownloadPackage pack;
+
+	private Handler messageHandler;
+	private Messenger messenger, messengerService;
+
+	public static DownloadFragment getInstance(DownloadPackage task){
+		DownloadFragment df = new DownloadFragment();
+		Bundle args = new Bundle();
+		args.putParcelable(DownloadFragment.EXTRA_TASK, task);
+
+		df.setArguments(args);
+
+		return df;
+	}
+
+	public void onActivityCreated(Bundle savedInstanceState){
+		super.onActivityCreated(savedInstanceState);
+
+		messageHandler = new Handler(messageCallback);
+		messenger = new Messenger(messageHandler);
+		Intent i = new Intent(getActivity().getApplicationContext(), DownloadService.class);
+		getActivity().startService(i);
+		getActivity().bindService(new Intent(getActivity().getApplicationContext(), DownloadService.class), connection, Context.BIND_AUTO_CREATE);
+	}
+
+	public View onCreateView(LayoutInflater inflater, ViewGroup viewgroup, Bundle savedInstanceState){
+		View v = inflater.inflate(R.layout.download_progress, viewgroup, false);
+		progress_sub = (TextView)v.findViewById(R.id.progressbar_sub);
+		progress = (ProgressBar)v.findViewById(R.id.progressbar);
+
+		//positive = (Button) v.findViewById(R.id.background);
+		negative = (Button) v.findViewById(R.id.cancelDownload);
+		//positive.setOnClickListener(backgroundClicker);
+		negative.setOnClickListener(cancelClicker);
+
+		pack = getArguments().getParcelable(DownloadFragment.EXTRA_TASK);
+
+		return v;
+	}
+
+	private OnClickListener backgroundClicker = new OnClickListener(){
+		public void onClick(View v){
+			getActivity().finish();
+		}
+	};
+	private OnClickListener cancelClicker = new OnClickListener(){
+		public void onClick(View v){
+			if(messengerService != null){
+				Message message = Message.obtain(messageHandler, DownloadService.MSG_CANCEL, pack);
+				try {
+					messengerService.send(message);
+				} catch (RemoteException e) {}
+			}
+			//getActivity().finish();
+		}
+	};
+	private OnClickListener doneClicker = new OnClickListener(){
+		public void onClick(View v){
+			getActivity().finish();
+		}
+	};
+
+	private OnClickListener tryAgainClicker = new OnClickListener(){
+		public void onClick(View v){
+			if(messengerService != null){
+				Message message = Message.obtain(messageHandler, DownloadService.MSG_ADDTASK, pack);
+				message.replyTo = messenger;
+				try {
+					messengerService.send(message);
+				} catch (RemoteException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	};
+
+	public void onDestroy(){
+		unBindFromService();
+		super.onDestroy();
+	}
+
+	private ServiceConnection connection = new ServiceConnection(){
+
+		public void onServiceConnected(ComponentName name, IBinder service) {
+			messengerService = new Messenger(service);
+
+			try{
+				//give the service a task
+				if(messengerService != null){
+					Message message = Message.obtain(messageHandler, DownloadService.MSG_ADDTASK, pack);
+					message.replyTo = messenger;
+					messengerService.send(message);
+				}
+
+			}catch (RemoteException e){}
+		}
+
+		public void onServiceDisconnected(ComponentName name) {
+			messengerService = null;
+		}
+
+	};
+
+	public void unBindFromService(){
+		if(messengerService != null){
+			try {
+				Message message = Message.obtain(messageHandler, DownloadService.MSG_UNREGISTER_CLIENT, pack);
+				message.replyTo = messenger;
+				messengerService.send(message);
+			} catch (RemoteException e) {
+				e.printStackTrace();
+			}
+		}
+
+		getActivity().unbindService(connection);
+	}
+
+	private Handler.Callback messageCallback = new Handler.Callback() {
+
+		public boolean handleMessage(Message msg) {
+			switch(msg.what){
+			case MSG_START:
+				progress.setMax(msg.arg1);
+				progress_sub.setText(String.format("%dkb/%dkb\n%s", 0, msg.arg1, ""));
+				//positive.setText(R.string.download_background);
+				//positive.setOnClickListener(backgroundClicker);
+				negative.setText(R.string.download_cancel);
+				negative.setOnClickListener(cancelClicker);
+				break;
+			case MSG_UPDATE:
+				progress_sub.setText(String.format("%d%% - %dkb/%dkb\n%s",(msg.arg1*100)/msg.arg2, msg.arg1, msg.arg2, msg.obj));
+				progress.setProgress(msg.arg1);
+				break;
+			case MSG_DONE:
+				progress.setProgress(progress.getMax());
+				progress_sub.setText(R.string.download_done);
+
+				//	positive.setText(R.string.download_back);
+				//	positive.setOnClickListener(doneClicker);
+
+				negative.setVisibility(View.INVISIBLE);
+				break;
+			case MSG_FAILED:
+				progress.setProgress(progress.getMax());
+				
+				String errorMsg = getString(R.string.download_failed);
+				switch(msg.arg1){
+				case DownloadAsyncTask.EXIT_CONNERROR: progress_sub.setText(errorMsg + " " + "Connection error"); break;
+				case DownloadAsyncTask.EXIT_FNF: progress_sub.setText(errorMsg + " " + "File not found"); break;
+				case DownloadAsyncTask.EXIT_MD5: progress_sub.setText(errorMsg + " " + "MD5 check failed"); break;
+				case DownloadAsyncTask.EXIT_URLFAIL: progress_sub.setText(errorMsg + " " + "Invalid url"); break;
+				}
+				negative.setText(R.string.download_tryagain);
+				negative.setOnClickListener(tryAgainClicker);
+				break;
+			}
+			return false;
+		}
+	};
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListActivity.java
new file mode 100644
index 0000000..1c81565
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListActivity.java
@@ -0,0 +1,115 @@
+package org.hedgewars.hedgeroid.Downloader;
+
+import org.hedgewars.hedgeroid.R;
+
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+public class DownloadListActivity extends FragmentActivity implements OnItemMovementListener{
+
+	private FrameLayout layout = null;
+	private LinearLayout downloadQueueContainer = null;
+	private View infoView = null;
+	private ImageView arrow = null;
+	private int halfSize = 0;
+	private DownloadPackage task = null;
+
+	public void onCreate(Bundle savedInstanceState){
+		super.onCreate(savedInstanceState);
+
+		setContentView(R.layout.download_listactivity);
+		//FragmentManager fm = this.getSupportFragmentManager();
+		//if(fm.findFragmentById(android.R.id.content) == null){
+		//	DownloadListFragment listfrag = new DownloadListFragment();
+		//	fm.beginTransaction().add(android.R.id.content, listfrag).commit();
+		//}
+
+		layout = (FrameLayout)findViewById(R.id.downloadFrameLayout);
+		downloadQueueContainer = (LinearLayout) findViewById(R.id.downloadQueueContainer);
+	}
+	
+	public void onNewItemSelected(DownloadPackage _task, int x, int minX, int maxX, int size) {
+		if(layout != null){
+			if(!_task.equals(task)){//if it's a new task refresh the whole thing
+				task = _task;
+				layout.removeView(infoView);
+				infoView = null;
+			}
+			
+			if(infoView == null){//build iv if it hasn't been created yet
+				infoView = this.getLayoutInflater().inflate(R.layout.download_info, layout, false);
+				FrameLayout.LayoutParams params = (android.widget.FrameLayout.LayoutParams) infoView.getLayoutParams();
+				params.gravity = Gravity.NO_GRAVITY;
+				params.height = size;
+				arrow = (ImageView)infoView.findViewById(R.id.arrow);
+				arrow.setVisibility(View.INVISIBLE);
+				halfSize = size/2;
+				
+				Button yes = (Button)infoView.findViewById(R.id.download);
+				Button no = (Button)infoView.findViewById(R.id.cancel);
+				yes.setOnClickListener(yesClicker);
+				no.setOnClickListener(noClicker);
+				
+				layout.addView(infoView, params);
+			}
+		}
+	}
+
+	public void onViewMoved(int x, int minX, int maxX) {
+		if(halfSize == -1){
+			if(infoView.getHeight() != 0){
+				halfSize = infoView.getHeight()/2;
+			}
+		}
+		if(layout != null && infoView != null){
+			FrameLayout.LayoutParams params = ((FrameLayout.LayoutParams)infoView.getLayoutParams());
+			if(x - halfSize < minX){
+				params.topMargin = 0;
+				arrow.setVisibility(View.INVISIBLE);
+				params.gravity = Gravity.TOP;
+			}else if (x + halfSize >= maxX){
+				params.topMargin = 0;
+				arrow.setVisibility(View.INVISIBLE);
+				params.gravity = Gravity.BOTTOM;
+			}else{
+				params.topMargin = x - halfSize;
+				params.gravity = Gravity.NO_GRAVITY;
+				arrow.setVisibility(View.VISIBLE);
+			}
+			
+			infoView.requestLayout();
+			
+		}
+	}
+	
+	private OnClickListener yesClicker = new OnClickListener(){
+		public void onClick(View v){
+			FragmentManager fm = getSupportFragmentManager();
+			FragmentTransaction ft= fm.beginTransaction();
+			DownloadFragment df = DownloadFragment.getInstance(task);
+			
+			ft.add(R.id.downloadQueueContainer, df).commit();
+			//ft.show(new DownloadFragment());
+			
+			task = null;
+			layout.removeView(infoView);
+		}
+	};
+	
+	private OnClickListener noClicker = new OnClickListener(){
+		public void onClick(View v){
+			task = null;
+			layout.removeView(infoView);
+		}
+	};
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListFragment.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListFragment.java
new file mode 100644
index 0000000..3ea85a9
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadListFragment.java
@@ -0,0 +1,195 @@
+package org.hedgewars.hedgeroid.Downloader;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import android.graphics.Color;
+import android.os.Bundle;
+import android.support.v4.app.ListFragment;
+import android.util.Log;
+import android.view.View;
+import android.widget.AbsListView;
+import android.widget.AbsListView.OnScrollListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+
+public class DownloadListFragment extends ListFragment implements OnItemClickListener, OnScrollListener, Runnable{
+
+	private View targetView = null;
+	private ArrayList<OnItemMovementListener> listeners = new ArrayList<OnItemMovementListener>(); 
+
+	public void onActivityCreated(Bundle savedInstanceState){
+		super.onActivityCreated(savedInstanceState);
+
+		ArrayList<DownloadPackage> tasks = new ArrayList<DownloadPackage>();
+
+		ArrayAdapter<DownloadPackage> adapter = new ArrayAdapter<DownloadPackage>(getActivity().getApplicationContext(), android.R.layout.simple_list_item_1, tasks);
+		setListAdapter(adapter);
+		getListView().setOnItemClickListener(this);
+		getListView().setOnScrollListener(this);
+
+		if(getActivity() instanceof OnItemMovementListener){
+			listeners.add((OnItemMovementListener)getActivity());
+		}
+
+		getListView().setCacheColorHint(Color.TRANSPARENT);//To prevent a blackish background while scrolling
+		
+		
+		Thread t = new Thread(this, "DownloadListParser");
+		t.start();
+	}
+
+	public void run(){
+		XmlPullParserFactory xmlPullFactory;
+		try {
+			xmlPullFactory = XmlPullParserFactory.newInstance();
+			XmlPullParser xmlPuller = xmlPullFactory.newPullParser();
+
+			URL url = new URL("http://www.xelification.com/tmp/downloads.xml");
+			HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+
+			BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()), 1024);
+			xmlPuller.setInput(br);
+
+			final ArrayAdapter<DownloadPackage> adapter = (ArrayAdapter<DownloadPackage>) getListAdapter();
+			
+			int eventType = xmlPuller.getEventType();
+			while(eventType != XmlPullParser.END_DOCUMENT){
+			
+				if(eventType == XmlPullParser.START_TAG){
+					if(xmlPuller.getName().toLowerCase().equals("task")){
+						final DownloadPackage task = DownloadPackage.getTaskFromXML(getActivity(), xmlPuller);
+						
+						getActivity().runOnUiThread(new Runnable(){
+							public void run() {
+								adapter.add(task);								
+							}
+						});
+					}
+				}
+				eventType = getEventType(xmlPuller);
+			}
+			
+			
+		} catch (XmlPullParserException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+
+	/**
+	 * Skips whitespaces..
+	 */
+	private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+		int eventType = xmlPuller.next();
+		while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+			eventType = xmlPuller.next();
+		}
+		return eventType;
+	}
+
+	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
+		DownloadPackage task = (DownloadPackage)arg0.getAdapter().getItem(position);
+		/*
+		FragmentTransaction ft = getFragmentManager().beginTransaction();
+		Fragment prev = getFragmentManager().findFragmentByTag("dialog");
+
+		//remove any old dialogs
+		if(prev != null) ft.remove(prev);
+		ft.addToBackStack(null);
+
+		//create a new dialog based on this task
+		
+		DialogFragment newFragment = DownloadDialogFragment.newInstance(task);
+
+		//show it
+		newFragment.show(ft, "dialog");
+		 */
+		targetView = arg1;
+
+		//determine state
+		int min = arg0.getTop();
+		int max = arg0.getBottom();
+		int top = targetView.getTop();
+
+		previousXCoord = top;
+		for(OnItemMovementListener listener : listeners){
+			listener.onNewItemSelected(task, top, min, max, targetView.getHeight()*2);
+		}
+	}
+
+	private int previousXCoord = 0;
+
+	/*
+	 * (non-Javadoc)
+	 * @see android.widget.AbsListView.OnScrollListener#onScroll(android.widget.AbsListView, int, int, int)
+	 * 
+	 * Android renews the Items used in the view, so when a user scroll down the list, 
+	 * as soon as the item has dissapeard from the list it gets reused at the bottom.
+	 * 
+	 * For this reason we cannot just keep sending the targetView.getTop() but we must
+	 *  remember if the view is supposed to be at the top or bottom of the list. We 
+	 *  remember this with int state, 
+	 *     - 0 means we've got accurate reading from getTop()
+	 *     - -1 means it's somewhere at the top of the list
+	 *     - 1 means it's at the bottom somewhere
+	 */
+	public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
+		if(targetView != null){
+			int top = targetView.getTop() + (targetView.getHeight()/2);
+			int min = view.getTop();
+			int max = view.getBottom();
+
+			if(Math.abs(previousXCoord - top) > targetView.getHeight()*2 ){
+				top = previousXCoord;
+			}
+
+			for(OnItemMovementListener listener : listeners){
+				listener.onViewMoved(top, min, max);
+			}
+
+			previousXCoord = top;
+		}
+	}
+
+	public void onScrollStateChanged(AbsListView view, int scrollState) {
+		switch(scrollState){
+		case OnScrollListener.SCROLL_STATE_FLING: Log.d("tag", "fling"); break;
+		case OnScrollListener.SCROLL_STATE_IDLE:Log.d("tag", "idle"); break;
+		case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:Log.d("tag", "scroll"); break;
+
+		}
+
+	}
+}
+
+interface OnItemMovementListener{
+	/**
+	 * When I new item has been selected this method will be called
+	 * @param task The task which goes with this item
+	 * @param x The middle of this item
+	 * @param minX The top of the parent of this item
+	 * @param maxX The bottom of the parent of this item
+	 */
+	void onNewItemSelected(DownloadPackage task, int x, int minX, int maxX, int size);
+
+	/**
+	 * When the item has been moved this method is called
+	 * @param x The middle of this item
+	 * @param minX The top of the parent of this item
+	 * @param maxX The bottom of the parent of this item
+	 */
+	void onViewMoved(int x, int minX, int maxX);
+}
+
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java
new file mode 100644
index 0000000..b193dc0
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadPackage.java
@@ -0,0 +1,186 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.Downloader;
+
+import java.io.IOException;
+
+import org.hedgewars.hedgeroid.Utils;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.preference.PreferenceManager;
+import android.util.Log;
+
+public class DownloadPackage implements Parcelable{
+	private String url_without_suffix;
+	private String pathToStore;
+	private String representation;
+	private String description;
+	private int versionNumber;
+	private final Status status;
+	private int uniqueId;
+
+
+	public DownloadPackage(Parcel src){
+		url_without_suffix = src.readString();
+		pathToStore = src.readString();
+		representation = src.readString();
+		versionNumber = src.readInt();
+		status = Status.values()[src.readInt()];
+		description = src.readString();
+		uniqueId = src.readInt();
+	}
+
+	public DownloadPackage(Context c, String _url_without_suffix, String path, int version, String _representation, String _description, int _uniqueId){
+		url_without_suffix = _url_without_suffix;
+		pathToStore = path;
+		representation = _representation;
+		versionNumber = version;
+		description = _description;
+		uniqueId = _uniqueId;
+
+
+		//determine if the user has already downloaded this version
+		SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(c);
+		int currentVersion = sharedPref.getInt(representation, -1);
+		if(currentVersion == versionNumber) status = Status.CURRENTVERSION;
+		else if (currentVersion < versionNumber) status = Status.NEWERVERSION;
+		else status = Status.OLDERVERSION;
+	}
+
+	public Status getStatus(){
+		return status;
+	}
+
+	public String getURL(){
+		return url_without_suffix;
+	}
+
+	public String getPathToStore(){
+		return pathToStore;
+	}
+
+	public String toString(){
+		return representation;
+	}
+
+	public int describeContents() {
+		return 0;
+	}
+	public int getId(){
+		return uniqueId;
+	}
+
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(url_without_suffix);
+		dest.writeString(pathToStore);
+		dest.writeString(representation);
+		dest.writeInt(versionNumber);
+		dest.writeInt(status.ordinal());
+		dest.writeString(description);
+	}
+
+	public static final Parcelable.Creator<DownloadPackage> CREATOR = new Parcelable.Creator<DownloadPackage>() {
+		public DownloadPackage createFromParcel(Parcel source) {
+			return new DownloadPackage(source);
+		}
+		public DownloadPackage[] newArray(int size) {
+			return new DownloadPackage[size];
+		}
+	};
+
+	/*
+	 * We enter with a XmlPullParser.Start_tag with name "task"
+	 */
+	public static DownloadPackage getTaskFromXML(Context c, XmlPullParser xmlPuller) throws XmlPullParserException, IOException{
+		String url = null;
+		String path = null;
+		String representation = null;
+		String description = null;
+		int uniqueId = -1;
+		int version = -1;
+
+		int eventType = DownloadPackage.getEventType(xmlPuller);//get the next token, should be a start tag
+		while(eventType != XmlPullParser.END_DOCUMENT){
+			switch(eventType){
+			case XmlPullParser.START_TAG:
+				String name = xmlPuller.getName().toLowerCase();
+				if(DownloadPackage.getEventType(xmlPuller) == XmlPullParser.TEXT){
+					String text = xmlPuller.getText().trim();
+					if(name.equals("url")){
+						url = text;
+					}else if(name.equals("version")){
+						try{
+						version = Integer.parseInt(text);
+						}catch (NumberFormatException e){
+							e.printStackTrace();
+							version = -1;
+						}
+					}else if(name.equals("path")){
+						path = Utils.getDataPath(c) + text;
+					}else if(name.equals("representation")){
+						representation = text;
+					}else if(name.equals("description")){
+						description = text;
+					}else if(name.equals("uniqueid")){
+						try{
+							uniqueId = Integer.parseInt(text);
+							}catch (NumberFormatException e){
+								e.printStackTrace();
+								version = -1;
+							}
+					}
+				}				
+				DownloadPackage.getEventType(xmlPuller);//endtag
+				break;
+			case XmlPullParser.END_TAG:
+				if(xmlPuller.getName().toLowerCase().equals("task") && url != null && path != null && version != -1 && representation != null){
+					return new DownloadPackage(c, url, path, version, representation, description, uniqueId);
+				}else{
+					throw new XmlPullParserException("XML download parsing: missing tags");
+				}
+			case XmlPullParser.TEXT:
+				throw new XmlPullParserException("Wrong tag recieved got TEXT : " + xmlPuller.getText());
+			default:
+				throw new XmlPullParserException("Wrong tag recieved got: " + eventType);
+			}
+			eventType = DownloadPackage.getEventType(xmlPuller);
+		}
+		throw new XmlPullParserException("Xml: unexpected endofdocument tag");
+	}
+
+	/**
+	 * Skips whitespaces..
+	 */
+	private static int getEventType(XmlPullParser xmlPuller)throws XmlPullParserException, IOException{
+		int eventType = xmlPuller.next();
+		while(eventType == XmlPullParser.TEXT && xmlPuller.isWhitespace()){
+			eventType = xmlPuller.next();
+		}
+		return eventType;
+	}
+}
+
+enum Status{
+	CURRENTVERSION, NEWERVERSION, OLDERVERSION;
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java
new file mode 100644
index 0000000..1d18c9c
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java
@@ -0,0 +1,230 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.Downloader;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.hedgewars.hedgeroid.R;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.widget.RemoteViews;
+
+public class DownloadService extends Service {
+	public final static String INTENT_TASKID = "taskId";
+	public final static String INTENT_TASK = "task";
+
+	public static final String PREF_DOWNLOADED = "downloaded";
+	public static final int MSG_CANCEL = 0;
+	public static final int MSG_UNREGISTER_CLIENT = 2;
+	public final static int MSG_ADDTASK = 4;
+
+	public static final int NOTIFICATION_PROCESSING = 0;
+	public static final int NOTIFICATION_DONE = 1;
+
+	private DownloadAsyncTask asyncExecutor;
+
+	private DownloadHandler handler = new DownloadHandler();
+	private final Messenger messenger = new Messenger(handler);
+
+	private NotificationManager nM;
+	private RemoteViews contentView;
+
+	private LinkedList<DownloadTask> downloadTasks = new LinkedList<DownloadTask>();
+	private DownloadTask currentTask = null;
+
+	public class DownloadHandler extends Handler{
+
+		public void handleMessage(Message msg){
+			if(msg.obj != null){
+				DownloadPackage pack = (DownloadPackage) msg.obj;
+				DownloadTask task = null;
+				Messenger replyToMessenger = msg.replyTo;
+				for(DownloadTask _task : downloadTasks){
+					if(_task.getPackage().equals(pack)){
+						task = _task;
+						break;
+					}
+				}
+
+				switch(msg.what){
+				case MSG_ADDTASK:
+					if(task == null){
+						task = new DownloadTask(pack);
+						downloadTasks.add(task);
+					}
+
+					task.addClient(replyToMessenger);
+					runNextTask();
+					return;
+				case MSG_CANCEL:
+					if(task != null && task.getPackage().equals(pack) && task.getStatus() == TASK_STATE.PENDING){
+						downloadTasks.remove(task);
+					}
+					if(currentTask != null && currentTask.getPackage().equals(pack)){//TODO synchronization problem?
+						asyncExecutor.cancel(false);
+					}
+					return;
+				case MSG_UNREGISTER_CLIENT:
+					if(task != null){
+						task.removeClient(replyToMessenger);
+					}
+					return;
+				}
+			}
+		}
+	}
+
+	public void onCreate(){
+		super.onCreate();
+		nM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+	}
+	public IBinder onBind(Intent intent) {
+		return messenger.getBinder();
+	}
+
+	private void runNextTask(){
+		if(asyncExecutor == null){//if (task isnt running right now) ...
+			currentTask = downloadTasks.poll();
+			if(currentTask != null){
+				asyncExecutor = new DownloadAsyncTask(currentTask);
+				asyncExecutor.execute(currentTask.getPackage());
+			}
+		}
+	}
+
+	public void onDestroy(){
+		super.onDestroy();
+		asyncExecutor.cancel(false);	
+	}
+
+	class DownloadTask {
+		private final DownloadPackage pack;
+		private TASK_STATE status = TASK_STATE.PENDING;
+		private Notification progressNotification, doneNotification;
+
+		//I expect little to no removeClient calls that's why we go for a list rather than a map
+		private final List<Messenger> clients;
+
+		public DownloadTask(DownloadPackage _pack){
+			pack = _pack;
+			clients = new LinkedList<Messenger>();
+		}
+
+		public void addClient(Messenger messenger){
+			clients.add(messenger);
+		}
+		public void removeClient(Messenger messenger){
+			clients.remove(messenger);
+		}
+
+		public DownloadPackage getPackage(){
+			return pack;
+		}
+
+		public TASK_STATE getStatus(){
+			return status;
+		}
+
+		public void sendMessageToClients(Message msg){
+			for(Messenger messenger : clients){
+				try {
+					messenger.send(msg);		
+				} catch (RemoteException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+
+		/*
+		 * Callbacks called from the async tasks
+		 */
+
+		//Thread safe method to let clients know the processing is starting and will process int max kbytes
+		public void start(int max){
+			progressNotification = new Notification(R.drawable.statusbar, getString(R.string.notification_title), System.currentTimeMillis());
+			progressNotification.flags |= Notification.FLAG_ONGOING_EVENT;
+
+			contentView = new RemoteViews(getPackageName(), R.layout.notification);
+			contentView.setProgressBar(R.id.notification_progress, 100, 34, false);
+			progressNotification.contentView = contentView;
+
+			PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, new Intent(DownloadService.this, DownloadListActivity.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+			progressNotification.contentIntent = contentIntent;
+
+			startForeground(NOTIFICATION_PROCESSING, progressNotification);
+
+			Message msg = Message.obtain(null, DownloadFragment.MSG_START, max, 0);
+			sendMessageToClients(msg);
+		}
+
+		//periodically gets called by the ASyncTask, we can't tell for sure when it's called
+		public void update(int progress, int max, String fileName){
+			progress = (progress/1024);
+
+			contentView.setProgressBar(R.id.notification_progress, max, progress, false);
+			contentView.setTextViewText(R.id.progressbar_sub, String.format("%dkb/%dkb (Compressed sizes)", progress, max));
+			nM.notify(NOTIFICATION_PROCESSING, progressNotification);
+
+			sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_UPDATE, progress, max, fileName));
+		}
+
+		//Call back from the ASync task when the task has either run into an error or finished otherwise
+		public void done(int result){
+			switch(result){
+			case DownloadAsyncTask.EXIT_SUCCESS: 	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_DONE)); break;
+			case DownloadAsyncTask.EXIT_CONNERROR:  sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_CONNERROR, 0)); break;
+			case DownloadAsyncTask.EXIT_FNF:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_FNF, 0)); break;
+			case DownloadAsyncTask.EXIT_MD5:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_MD5, 0)); break;
+			case DownloadAsyncTask.EXIT_URLFAIL:	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_URLFAIL, 0)); break;
+			case DownloadAsyncTask.EXIT_CANCELLED:	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_DONE)); break;
+			}
+			
+			stopForeground(true);
+			nM.cancel(NOTIFICATION_PROCESSING);
+
+			String title = getString(R.string.notification_title);
+
+			doneNotification = new Notification(R.drawable.icon, title, System.currentTimeMillis());
+			doneNotification.flags |= Notification.FLAG_AUTO_CANCEL;
+			PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, new Intent(DownloadService.this, DownloadListActivity.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+			doneNotification.setLatestEventInfo(DownloadService.this, title, getString(R.string.notification_done) + pack, contentIntent);
+			nM.notify(pack.getId(), doneNotification);
+
+			asyncExecutor = null;
+			runNextTask();//see if there are more tasks
+		}
+
+	}
+
+	enum TASK_STATE{
+		RUNNING, FINISHED, PENDING;
+	}
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/EngineProtocolNetwork.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/EngineProtocolNetwork.java
new file mode 100644
index 0000000..f90fb11
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/EngineProtocolNetwork.java
@@ -0,0 +1,159 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid.EngineProtocol;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+public class EngineProtocolNetwork extends Thread{
+
+	public static final String GAMEMODE_LOCAL = "TL";
+	public static final String GAMEMODE_DEMO = "TD";
+	public static final String GAMEMODE_NET = "TN";
+	public static final String GAMEMODE_SAVE = "TS";
+	
+	public static final int BUFFER_SIZE = 255; //From iOS code which got it from the origional frontend
+	
+	public static final int MODE_GENLANDPREVIEW = 0;
+	public static final int MODE_GAME = 1;
+
+	private ServerSocket serverSocket;
+	private InputStream input;
+	private OutputStream output;
+	public int port;
+	private final GameConfig config;
+	private boolean clientQuit = false;
+
+	public EngineProtocolNetwork(GameConfig _config){
+		config = _config;
+		try {
+			serverSocket = new ServerSocket(0);
+			port = serverSocket.getLocalPort();
+			Thread ipcThread = new Thread(this, "IPC - Thread");			
+			ipcThread.start();
+		} catch (UnknownHostException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void run(){
+		//if(mode == MODE_GENLANDPREVIEW) genLandPreviewIPC();
+		/*else if (mode == MODE_GAME)*/ gameIPC();
+	}
+	
+	private void gameIPC(){
+		Socket sock = null;
+		try{
+			sock = serverSocket.accept();
+			input = sock.getInputStream();
+			output = sock.getOutputStream();
+			
+			int msgSize = 0;
+			byte[] buffer = new byte[BUFFER_SIZE];
+
+			while(!clientQuit){
+				msgSize = 0;
+
+				input.read(buffer, 0, 1);
+				msgSize = buffer[0];
+
+				input.read(buffer, 0, msgSize);
+				System.out.println("IPC" + (char)buffer[0] + " : " + new String(buffer, 1,msgSize-1, "US_ASCII"));
+				switch(buffer[0]){
+				case 'C'://game init
+					config.sendToEngine(this);
+					break;
+				case '?'://ping - pong
+					sendToEngine("!");
+					break;
+				case 'e'://Send protocol version
+					System.out.println(new String(buffer));
+					break;
+				case 'i'://game statistics
+					switch(buffer[1]){
+					case 'r'://winning team
+						break;
+					case 'D'://best shot
+						break;
+					case 'k'://best hedgehog
+						break;
+					case 'K'://# hogs killed
+						break;
+					case 'H'://team health graph
+						break;
+					case 'T':// local team stats
+						break;
+					case 'P'://teams ranking
+						break;
+					case 's'://self damage
+						break;
+					case 'S'://friendly fire
+						break;
+					case 'B'://turn skipped
+						break;
+					default:
+					}
+					break;
+				case 'E'://error - quits game
+					System.out.println(new String(buffer));
+					return;
+				case 'q'://game ended remove save file
+
+				    return;
+				case 'Q'://game ended but not finished
+
+					return;
+				}
+
+			}
+		}catch(IOException e){
+			e.printStackTrace();
+		}finally{
+			try {
+				if(sock != null) sock.close();
+			} catch (IOException e) {}
+			try{
+				if(serverSocket != null) serverSocket.close();
+			} catch (IOException e) {}
+		}
+	}
+
+	public void sendToEngine(String s){
+		int length = s.length();
+		
+		try {
+			output.write(length);
+			output.write(s.getBytes(), 0, length);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void quitIPC(){
+		clientQuit = true;
+	}
+	
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameConfig.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameConfig.java
new file mode 100644
index 0000000..52a91ef
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/GameConfig.java
@@ -0,0 +1,127 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.EngineProtocol;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.UUID;
+
+import org.hedgewars.hedgeroid.Datastructures.GameMode;
+import org.hedgewars.hedgeroid.Datastructures.Map;
+import org.hedgewars.hedgeroid.Datastructures.Scheme;
+import org.hedgewars.hedgeroid.Datastructures.Team;
+import org.hedgewars.hedgeroid.Datastructures.Weapon;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+public class GameConfig implements Parcelable{
+	
+	public GameMode mode = GameMode.MODE_LOCAL;
+	public Map map = null;
+	public String theme = null;
+	public Scheme scheme = null;
+	public Weapon weapon = null;
+	
+	public String style = null;
+	public String training = null;
+	public String seed = null;
+	
+	public ArrayList<Team> teams = new ArrayList<Team>();
+	
+	public GameConfig(){
+		
+	}
+	
+	public GameConfig(Parcel in){
+		readFromParcel(in);	
+	}
+	
+
+	
+	public void sendToEngine(EngineProtocolNetwork epn) throws IOException{
+		Log.d("HW_Frontend", "Sending Gameconfig...");
+		int teamCount = 4;
+		epn.sendToEngine("TL"); //Write game mode
+		if(training != null) epn.sendToEngine(String.format("escript Scripts/Training/%s.lua", training));
+		else if(style != null) epn.sendToEngine(String.format("escript Scripts/Multiplayer/%s.lua", style));
+		
+		//seed info
+		epn.sendToEngine(String.format("eseed {%s}", UUID.randomUUID().toString()));
+		
+		map.sendToEngine(epn);
+		//dimensions of the map
+		//templatefilter_command
+		//mapgen_command
+		//mazesize_command
+		
+		epn.sendToEngine(String.format("etheme %s", theme));
+		
+		scheme.sendToEngine(epn);
+		
+		weapon.sendToEngine(epn, teamCount);
+		
+		for(Team t : teams){
+			if(t != null)t.sendToEngine(epn, teamCount, scheme.health);
+		}
+	}
+	
+	public int describeContents() {
+		return 0;
+	}
+
+	public void writeToParcel(Parcel dest, int flags) {
+		dest.writeString(mode.name());
+		dest.writeParcelable(map, flags);
+		dest.writeString(theme);
+		dest.writeParcelable(scheme, flags);
+		dest.writeParcelable(weapon, flags);
+		dest.writeString(style);
+		dest.writeString(training);
+		dest.writeString(seed);
+		dest.writeParcelableArray((Team[])teams.toArray(new Team[1]), 0);
+	}
+	
+	private void readFromParcel(Parcel src){
+		mode = GameMode.valueOf(src.readString());
+		map = src.readParcelable(Map.class.getClassLoader());
+		theme = src.readString();
+		scheme = src.readParcelable(Scheme.class.getClassLoader());
+		weapon = src.readParcelable(Weapon.class.getClassLoader());
+		style = src.readString();
+		training = src.readString();
+		seed = src.readString();
+		Parcelable[] parcelables = src.readParcelableArray(Team[].class.getClassLoader());
+		for(Parcelable team : parcelables){
+			teams.add((Team)team);
+		}
+		
+	}
+	
+	public static final Parcelable.Creator<GameConfig> CREATOR = new Parcelable.Creator<GameConfig>() {
+		public GameConfig createFromParcel(Parcel source) {
+			return new GameConfig(source);
+		}
+		public GameConfig[] newArray(int size) {
+			return new GameConfig[size];
+		}
+	};
+	
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java
new file mode 100644
index 0000000..01bd1c4
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/EngineProtocol/PascalExports.java
@@ -0,0 +1,40 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.EngineProtocol;
+
+public class PascalExports {
+
+	static{
+		System.loadLibrary("SDL");
+		System.loadLibrary("SDL_image");
+		System.loadLibrary("mikmod");
+		System.loadLibrary("SDL_net");
+		System.loadLibrary("SDL_mixer");
+		System.loadLibrary("SDL_ttf");
+		System.loadLibrary("lua5.1");
+		System.loadLibrary("hwengine");
+	}
+	
+	public static native int HWversionInfoNetProto();
+	public static native String HWversionInfoVersion();
+	public static native int HWgetNumberOfWeapons();
+	public static native int HWgetMaxNumberOfTeams();
+	public static native int HWgetMaxNumberOfHogs();
+        public static native int HWterminate(boolean b);	
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java
new file mode 100644
index 0000000..2ad1c6f
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MainActivity.java
@@ -0,0 +1,113 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid;
+
+import org.hedgewars.hedgeroid.Downloader.DownloadAssets;
+import org.hedgewars.hedgeroid.Downloader.DownloadListActivity;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.support.v4.app.FragmentActivity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.Toast;
+
+public class MainActivity extends FragmentActivity {
+
+	private Button downloader, startGame;
+	private ProgressDialog assetsDialog;
+
+	public void onCreate(Bundle sis){
+		super.onCreate(sis);
+		setContentView(R.layout.main);
+
+		downloader = (Button)findViewById(R.id.downloader);
+		startGame = (Button)findViewById(R.id.startGame);
+
+		downloader.setOnClickListener(downloadClicker);
+		startGame.setOnClickListener(startGameClicker);
+
+
+		String cacheDir = Utils.getCachePath(this);
+		if(cacheDir == null){
+			showDialog(0);
+		}else{
+			int versionCode = 0;
+			try {
+				versionCode = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionCode;
+			} catch (NameNotFoundException e) {
+
+			}
+			boolean assetsCopied = PreferenceManager.getDefaultSharedPreferences(this).getInt("latestAssets", 0) >= versionCode;
+
+			if(!assetsCopied){
+				DownloadAssets assetsAsyncTask = new DownloadAssets(this);
+				assetsDialog = ProgressDialog.show(this, "Please wait a moment", "Moving assets...");
+				assetsAsyncTask.execute((Object[])null);
+			}
+		}
+	}
+
+	public Dialog onCreateDialog(int id, Bundle args){
+		AlertDialog.Builder builder = new AlertDialog.Builder(this);
+		builder.setTitle(R.string.sdcard_not_mounted_title);
+		builder.setMessage(R.string.sdcard_not_mounted);
+		builder.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener(){
+			public void onClick(DialogInterface dialog, int which) {
+				finish();				
+			}
+		});
+
+		return builder.create();
+	}
+
+	public void onAssetsDownloaded(boolean result){
+		if(result){
+			try {
+				int versionCode = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionCode;
+				PreferenceManager.getDefaultSharedPreferences(this).edit().putInt("latestAssets", versionCode).commit();
+			} catch (NameNotFoundException e) {}
+			
+		}else{
+			Toast.makeText(this, R.string.download_failed, Toast.LENGTH_LONG);
+		}
+		assetsDialog.dismiss();
+	}
+
+	private OnClickListener downloadClicker = new OnClickListener(){
+		public void onClick(View v){
+			//startActivityForResult(new Intent(getApplicationContext(), DownloadActivity.class), 0);
+			startActivityForResult(new Intent(getApplicationContext(), DownloadListActivity.class), 0);
+		}
+	};
+
+	private OnClickListener startGameClicker = new OnClickListener(){
+		public void onClick(View v){
+			startActivity(new Intent(getApplicationContext(), StartGameActivity.class));
+		}
+	};
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java
new file mode 100644
index 0000000..1b6a340
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/SDLActivity.java
@@ -0,0 +1,638 @@
+package org.hedgewars.hedgeroid;
+
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
+
+import org.hedgewars.hedgeroid.EngineProtocol.EngineProtocolNetwork;
+import org.hedgewars.hedgeroid.EngineProtocol.GameConfig;
+import org.hedgewars.hedgeroid.EngineProtocol.PascalExports;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.PixelFormat;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.media.AudioFormat;
+import android.media.AudioManager;
+import android.media.AudioTrack;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+
+
+/**
+    SDL Activity
+ */
+public class SDLActivity extends Activity {
+
+	// Main components
+	public static SDLActivity mSingleton;
+	private static SDLSurface mSurface;
+
+	// This is what SDL runs in. It invokes SDL_main(), eventually
+	private static Thread mSDLThread;
+
+	// Audio
+	private static Thread mAudioThread;
+	private static AudioTrack mAudioTrack;
+
+	// EGL private objects
+	private static EGLContext  mEGLContext;
+	private static EGLSurface  mEGLSurface;
+	private static EGLDisplay  mEGLDisplay;
+	private static EGLConfig   mEGLConfig;
+	private static int mGLMajor, mGLMinor;
+
+	// Load the .so
+	static {
+		System.loadLibrary("SDL");
+		//System.loadLibrary("SDL_image");
+		//System.loadLibrary("SDL_mixer");
+		//System.loadLibrary("SDL_ttf");
+		System.loadLibrary("main");
+	}
+
+	// Setup
+	protected void onCreate(Bundle savedInstanceState) {
+		//Log.v("SDL", "onCreate()");
+		super.onCreate(savedInstanceState);
+
+		// So we can call stuff from static callbacks
+		mSingleton = this;
+
+		// Set up the surface
+		GameConfig config = getIntent().getParcelableExtra("config");
+
+		mSurface = new SDLSurface(getApplication(), config);
+		setContentView(mSurface);
+		SurfaceHolder holder = mSurface.getHolder();
+	}
+
+	// Events
+	protected void onPause() {
+		Log.v("SDL", "onPause()");
+		super.onPause();
+
+		if(mEGLDisplay != null && mEGLContext != null){
+			EGL10 egl = (EGL10)EGLContext.getEGL();
+			egl.eglDestroyContext(mEGLDisplay, mEGLContext);
+			mEGLDisplay = null;
+			mEGLContext = null;
+		}
+
+		SDLActivity.nativePause();
+	}
+
+	protected void onResume() {
+		Log.v("SDL", "onResume()");
+		super.onResume();
+	}
+
+	protected void onDestroy() {
+		super.onDestroy();
+		Log.v("SDL", "onDestroy()");
+		// Send a quit message to the application
+		SDLActivity.nativeQuit();
+
+		// Now wait for the SDL thread to quit
+		if (mSDLThread != null) {
+			try {
+				mSDLThread.join();
+			} catch(Exception e) {
+				Log.v("SDL", "Problem stopping thread: " + e);
+			}
+			mSDLThread = null;
+
+			//Log.v("SDL", "Finished waiting for SDL thread");
+		}
+	}
+
+	// Messages from the SDLMain thread
+	static int COMMAND_CHANGE_TITLE = 1;
+
+	// Handler for the messages
+	Handler commandHandler = new Handler() {
+		public void handleMessage(Message msg) {
+			if (msg.arg1 == COMMAND_CHANGE_TITLE) {
+				setTitle((String)msg.obj);
+			}
+		}
+	};
+
+	// Send a message from the SDLMain thread
+	void sendCommand(int command, Object data) {
+		Message msg = commandHandler.obtainMessage();
+		msg.arg1 = command;
+		msg.obj = data;
+		commandHandler.sendMessage(msg);
+	}
+
+	// C functions we call
+	public static native void nativeInit(String...args);
+	public static native void nativeQuit();
+	public static native void nativePause();
+	public static native void nativeResume();
+	public static native void onNativeResize(int x, int y, int format);
+	public static native void onNativeKeyDown(int keycode);
+	public static native void onNativeKeyUp(int keycode);
+	public static native void onNativeTouch(int touchDevId, int pointerFingerId,
+			int action, float x, 
+			float y, float p);
+	public static native void onNativeAccel(float x, float y, float z);
+	public static native void nativeRunAudioThread();
+
+
+	// Java functions called from C
+
+	public static boolean createGLContext(int majorVersion, int minorVersion) {
+		return initEGL(majorVersion, minorVersion);
+	}
+
+	public static void flipBuffers() {
+		flipEGL();
+	}
+
+	public static void setActivityTitle(String title) {
+		// Called from SDLMain() thread and can't directly affect the view
+		mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
+	}
+
+	public static Context getContext() {
+		return mSingleton;
+	}
+
+	public static void startApp(int width, int height, GameConfig config) {
+		// Start up the C app thread
+		if (mSDLThread == null) {
+			mSDLThread = new Thread(new SDLMain(width, height, config), "SDLThread");
+			mSDLThread.start();
+		}
+		else {
+			SDLActivity.nativeResume();
+		}
+	}
+
+	// EGL functions
+	public static boolean initEGL(int majorVersion, int minorVersion) {
+		if (SDLActivity.mEGLDisplay == null) {
+			//Log.v("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
+
+			try {
+				EGL10 egl = (EGL10)EGLContext.getEGL();
+
+				EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
+
+				int[] version = new int[2];
+				egl.eglInitialize(dpy, version);
+
+				int EGL_OPENGL_ES_BIT = 1;
+				int EGL_OPENGL_ES2_BIT = 4;
+				int renderableType = 0;
+				if (majorVersion == 2) {
+					renderableType = EGL_OPENGL_ES2_BIT;
+				} else if (majorVersion == 1) {
+					renderableType = EGL_OPENGL_ES_BIT;
+				}
+				int[] configSpec = {
+						//EGL10.EGL_DEPTH_SIZE,   16,
+						EGL10.EGL_RENDERABLE_TYPE, renderableType,
+						EGL10.EGL_NONE
+				};
+				EGLConfig[] configs = new EGLConfig[1];
+				int[] num_config = new int[1];
+				if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0) {
+					Log.e("SDL", "No EGL config available");
+					return false;
+				}
+				EGLConfig config = configs[0];
+
+				/*int EGL_CONTEXT_CLIENT_VERSION=0x3098;
+                int contextAttrs[] = new int[] { EGL_CONTEXT_CLIENT_VERSION, majorVersion, EGL10.EGL_NONE };
+                EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, contextAttrs);
+
+                if (ctx == EGL10.EGL_NO_CONTEXT) {
+                    Log.e("SDL", "Couldn't create context");
+                    return false;
+                }
+                SDLActivity.mEGLContext = ctx;*/
+				SDLActivity.mEGLDisplay = dpy;
+				SDLActivity.mEGLConfig = config;
+				SDLActivity.mGLMajor = majorVersion;
+				SDLActivity.mGLMinor = minorVersion;
+
+				SDLActivity.createEGLSurface();
+			} catch(Exception e) {
+				Log.v("SDL", e + "");
+				for (StackTraceElement s : e.getStackTrace()) {
+					Log.v("SDL", s.toString());
+				}
+			}
+		}
+		else SDLActivity.createEGLSurface();
+
+		return true;
+	}
+
+	public static boolean createEGLContext() {
+		EGL10 egl = (EGL10)EGLContext.getEGL();
+		int EGL_CONTEXT_CLIENT_VERSION=0x3098;
+		int contextAttrs[] = new int[] { EGL_CONTEXT_CLIENT_VERSION, SDLActivity.mGLMajor, EGL10.EGL_NONE };
+		SDLActivity.mEGLContext = egl.eglCreateContext(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, EGL10.EGL_NO_CONTEXT, contextAttrs);
+		if (SDLActivity.mEGLContext == EGL10.EGL_NO_CONTEXT) {
+			Log.e("SDL", "Couldn't create context");
+			return false;
+		}
+		return true;
+	}
+
+	public static boolean createEGLSurface() {
+		if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLConfig != null) {
+			EGL10 egl = (EGL10)EGLContext.getEGL();
+			if (SDLActivity.mEGLContext == null) createEGLContext();
+
+			Log.v("SDL", "Creating new EGL Surface");
+			EGLSurface surface = egl.eglCreateWindowSurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, SDLActivity.mSurface, null);
+			if (surface == EGL10.EGL_NO_SURFACE) {
+				Log.e("SDL", "Couldn't create surface");
+				return false;
+			}
+
+			if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) {
+				Log.e("SDL", "Old EGL Context doesnt work, trying with a new one");
+				createEGLContext();
+				if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) {
+					Log.e("SDL", "Failed making EGL Context current");
+					return false;
+				}
+			}
+			SDLActivity.mEGLSurface = surface;
+			return true;
+		}
+		return false;
+	}
+
+	// EGL buffer flip
+	public static void flipEGL() {
+		try {
+			EGL10 egl = (EGL10)EGLContext.getEGL();
+
+			egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);
+
+			// drawing here
+
+			egl.eglWaitGL();
+
+			egl.eglSwapBuffers(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface);
+
+
+		} catch(Exception e) {
+			Log.v("SDL", "flipEGL(): " + e);
+			for (StackTraceElement s : e.getStackTrace()) {
+				Log.v("SDL", s.toString());
+			}
+		}
+	}
+
+	// Audio
+	private static Object buf;
+
+	public static Object audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
+		int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
+		int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
+		int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
+
+		Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
+
+		// Let the user pick a larger buffer if they really want -- but ye
+		// gods they probably shouldn't, the minimums are horrifyingly high
+		// latency already
+		desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
+
+		mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
+				channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
+
+		audioStartThread();
+
+		Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
+
+		if (is16Bit) {
+			buf = new short[desiredFrames * (isStereo ? 2 : 1)];
+		} else {
+			buf = new byte[desiredFrames * (isStereo ? 2 : 1)]; 
+		}
+		return buf;
+	}
+
+	public static void audioStartThread() {
+		mAudioThread = new Thread(new Runnable() {
+			public void run() {
+				mAudioTrack.play();
+				nativeRunAudioThread();
+			}
+		});
+
+		// I'd take REALTIME if I could get it!
+		mAudioThread.setPriority(Thread.MAX_PRIORITY);
+		mAudioThread.start();
+	}
+
+	public static void audioWriteShortBuffer(short[] buffer) {
+		for (int i = 0; i < buffer.length; ) {
+			int result = mAudioTrack.write(buffer, i, buffer.length - i);
+			if (result > 0) {
+				i += result;
+			} else if (result == 0) {
+				try {
+					Thread.sleep(1);
+				} catch(InterruptedException e) {
+					// Nom nom
+				}
+			} else {
+				Log.w("SDL", "SDL audio: error return from write(short)");
+				return;
+			}
+		}
+	}
+
+	public static void audioWriteByteBuffer(byte[] buffer) {
+		for (int i = 0; i < buffer.length; ) {
+			int result = mAudioTrack.write(buffer, i, buffer.length - i);
+			if (result > 0) {
+				i += result;
+			} else if (result == 0) {
+				try {
+					Thread.sleep(1);
+				} catch(InterruptedException e) {
+					// Nom nom
+				}
+			} else {
+				Log.w("SDL", "SDL audio: error return from write(short)");
+				return;
+			}
+		}
+	}
+
+	public static void audioQuit() {
+		if (mAudioThread != null) {
+			try {
+				mAudioThread.join();
+			} catch(Exception e) {
+				Log.v("SDL", "Problem stopping audio thread: " + e);
+			}
+			mAudioThread = null;
+
+			//Log.v("SDL", "Finished waiting for audio thread");
+		}
+
+		if (mAudioTrack != null) {
+			mAudioTrack.stop();
+			mAudioTrack = null;
+		}
+	}
+	
+	public static int getDensity(){
+		DisplayMetrics dm = SDLActivity.getContext().getResources().getDisplayMetrics();
+		return dm.densityDpi;
+	}
+}
+
+/**
+    Simple nativeInit() runnable
+ */
+class SDLMain implements Runnable {
+
+	private int surfaceWidth, surfaceHeight;
+	private GameConfig config;
+
+	public SDLMain(int width, int height, GameConfig _config) {
+		config = _config;
+		surfaceWidth = width;
+		surfaceHeight = height;
+	}
+
+	public void run() {
+		//Set up the IPC socket server to communicate with the engine
+		EngineProtocolNetwork ipc = new EngineProtocolNetwork(config);
+
+		String path = Utils.getDataPath(SDLActivity.mSingleton);//This represents the data directory
+		path = path.substring(0, path.length()-1);//remove the trailing '/'
+
+
+		// Runs SDL_main() with added parameters
+		SDLActivity.nativeInit(new String[] { String.valueOf(ipc.port),
+				String.valueOf(surfaceWidth), String.valueOf(surfaceHeight),
+				"0", "en.txt", "xeli", "1", "1", "1", path, ""  });
+
+		try {
+			ipc.quitIPC();
+			ipc.join();
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+		Log.v("SDL", "SDL thread terminated");
+		//Log.v("SDL", "SDL thread terminated");
+	}
+}
+
+
+/**
+    SDLSurface. This is what we draw on, so we need to know when it's created
+    in order to do anything useful. 
+
+    Because of this, that's where we set up the SDL thread
+ */
+class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, 
+View.OnKeyListener, View.OnTouchListener, SensorEventListener  {
+
+	private GameConfig config;
+
+	// Sensors
+	private static SensorManager mSensorManager;
+
+	// Startup    
+	public SDLSurface(Context context, GameConfig _config) {
+		super(context);
+		getHolder().addCallback(this); 
+
+		setFocusable(true);
+		setFocusableInTouchMode(true);
+		requestFocus();
+		setOnKeyListener(this); 
+		setOnTouchListener(this);   
+
+		mSensorManager = (SensorManager)context.getSystemService("sensor");
+		config = _config;
+	}
+
+	// Called when we have a valid drawing surface
+	public void surfaceCreated(SurfaceHolder holder) {
+		Log.v("SDL", "surfaceCreated()");
+		holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
+		SDLActivity.createEGLSurface();
+		//		enableSensor(Sensor.TYPE_ACCELEROMETER, true);
+	}
+
+	// Called when we lose the surface
+	public void surfaceDestroyed(SurfaceHolder holder) {
+		Log.v("SDL", "surfaceDestroyed()");
+		SDLActivity.nativePause();
+		//		enableSensor(Sensor.TYPE_ACCELEROMETER, false);
+	}
+
+	// Called when the surface is resized
+	public void surfaceChanged(SurfaceHolder holder,
+			int format, int width, int height) {
+		Log.v("SDL", "surfaceChanged()");
+
+		int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
+		switch (format) {
+		case PixelFormat.A_8:
+			Log.v("SDL", "pixel format A_8");
+			break;
+		case PixelFormat.LA_88:
+			Log.v("SDL", "pixel format LA_88");
+			break;
+		case PixelFormat.L_8:
+			Log.v("SDL", "pixel format L_8");
+			break;
+		case PixelFormat.RGBA_4444:
+			Log.v("SDL", "pixel format RGBA_4444");
+			sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
+			break;
+		case PixelFormat.RGBA_5551:
+			Log.v("SDL", "pixel format RGBA_5551");
+			sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
+			break;
+		case PixelFormat.RGBA_8888:
+			Log.v("SDL", "pixel format RGBA_8888");
+			sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
+			break;
+		case PixelFormat.RGBX_8888:
+			Log.v("SDL", "pixel format RGBX_8888");
+			sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
+			break;
+		case PixelFormat.RGB_332:
+			Log.v("SDL", "pixel format RGB_332");
+			sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
+			break;
+		case PixelFormat.RGB_565:
+			Log.v("SDL", "pixel format RGB_565");
+			sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
+			break;
+		case PixelFormat.RGB_888:
+			Log.v("SDL", "pixel format RGB_888");
+			// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
+			sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
+			break;
+		default:
+			Log.v("SDL", "pixel format unknown " + format);
+			break;
+		}
+		SDLActivity.onNativeResize(width, height, sdlFormat);
+		Log.v("SDL", "Window size:" + width + "x"+height);
+
+		SDLActivity.startApp(width, height, config);
+	}
+
+	// unused
+	public void onDraw(Canvas canvas) {}
+
+
+
+
+	// Key events
+	public boolean onKey(View  v, int keyCode, KeyEvent event) {
+		switch(keyCode){
+		case KeyEvent.KEYCODE_BACK:
+		        PascalExports.HWterminate(true);
+                        return true;
+		case KeyEvent.KEYCODE_VOLUME_DOWN:
+		case KeyEvent.KEYCODE_VOLUME_UP:
+		case KeyEvent.KEYCODE_VOLUME_MUTE:
+			return false;
+		}
+		if (event.getAction() == KeyEvent.ACTION_DOWN) {
+			//Log.v("SDL", "key down: " + keyCode);
+			SDLActivity.onNativeKeyDown(keyCode);
+			return true;
+		}
+		else if (event.getAction() == KeyEvent.ACTION_UP) {
+			//Log.v("SDL", "key up: " + keyCode);
+			SDLActivity.onNativeKeyUp(keyCode);
+			return true;
+		}
+
+		return false;
+	}
+
+	// Touch events
+	public boolean onTouch(View v, MotionEvent event) {
+		{
+			final int touchDevId = event.getDeviceId();
+			final int pointerCount = event.getPointerCount();
+			// touchId, pointerId, action, x, y, pressure
+			int actionPointerIndex = event.getActionIndex();
+			int pointerFingerId = event.getPointerId(actionPointerIndex);
+			int action = event.getActionMasked();
+
+			float x = event.getX(actionPointerIndex);
+			float y = event.getY(actionPointerIndex);
+			float p = event.getPressure(actionPointerIndex);
+
+			if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) {
+				// TODO send motion to every pointer if its position has
+				// changed since prev event.
+				for (int i = 0; i < pointerCount; i++) {
+					pointerFingerId = event.getPointerId(i);
+					x = event.getX(i);
+					y = event.getY(i);
+					p = event.getPressure(i);
+					SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
+				}
+			} else {
+				SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
+			}
+		}
+		return true;
+	} 
+
+	// Sensor events
+	public void enableSensor(int sensortype, boolean enabled) {
+		// TODO: This uses getDefaultSensor - what if we have >1 accels?
+		if (enabled) {
+			mSensorManager.registerListener(this, 
+					mSensorManager.getDefaultSensor(sensortype), 
+					SensorManager.SENSOR_DELAY_GAME, null);
+		} else {
+			mSensorManager.unregisterListener(this, 
+					mSensorManager.getDefaultSensor(sensortype));
+		}
+	}
+
+	public void onAccuracyChanged(Sensor sensor, int accuracy) {
+		// TODO
+	}
+
+	public void onSensorChanged(SensorEvent event) {
+		if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
+			SDLActivity.onNativeAccel(event.values[0] / SensorManager.GRAVITY_EARTH,
+					event.values[1] / SensorManager.GRAVITY_EARTH,
+					event.values[2] / SensorManager.GRAVITY_EARTH);
+		}
+	}
+
+}
+
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java
new file mode 100644
index 0000000..4c96d9e
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/StartGameActivity.java
@@ -0,0 +1,234 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid;
+
+import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils;
+import org.hedgewars.hedgeroid.Datastructures.Map;
+import org.hedgewars.hedgeroid.Datastructures.Map.MapType;
+import org.hedgewars.hedgeroid.Datastructures.Scheme;
+import org.hedgewars.hedgeroid.Datastructures.Team;
+import org.hedgewars.hedgeroid.Datastructures.Weapon;
+import org.hedgewars.hedgeroid.EngineProtocol.GameConfig;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.preference.PreferenceManager;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.ArrayAdapter;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+public class StartGameActivity extends Activity {
+
+	public static final int ACTIVITY_TEAM_SELECTOR = 0;
+
+	private GameConfig config = null;
+	private ImageButton start, back, team;
+	private Spinner maps, gameplay, gamescheme, weapons, themes;
+	private ImageView themeIcon, mapPreview, teamCount;
+
+	public void onCreate(Bundle savedInstanceState){
+		super.onCreate(savedInstanceState);
+
+		Scheme.parseBasicFlags(this);
+		config = new GameConfig();
+
+		setContentView(R.layout.starting_game);
+
+		back = (ImageButton) findViewById(R.id.btnBack);
+		team = (ImageButton) findViewById(R.id.btnTeams);
+		start = (ImageButton) findViewById(R.id.btnStart);
+
+		maps = (Spinner) findViewById(R.id.spinMaps);
+		gameplay = (Spinner) findViewById(R.id.spinGameplay);
+		gamescheme = (Spinner) findViewById(R.id.spinGamescheme);
+		weapons = (Spinner) findViewById(R.id.spinweapons);
+		themes = (Spinner) findViewById(R.id.spinTheme);
+
+		themeIcon = (ImageView) findViewById(R.id.imgTheme);
+		mapPreview = (ImageView) findViewById(R.id.mapPreview);
+		teamCount = (ImageView) findViewById(R.id.imgTeamsCount);
+
+		start.setOnClickListener(startClicker);
+		back.setOnClickListener(backClicker);
+		team.setOnClickListener(teamClicker);
+
+		ArrayAdapter<?> adapter = new ArrayAdapter<Map>(this, R.layout.listview_item, FrontendDataUtils.getMaps(this));
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		maps.setAdapter(adapter);
+		maps.setOnItemSelectedListener(mapsClicker);
+		//set to first nonmap
+		for(int i = 0; i < adapter.getCount(); i++){
+			if(((Map)adapter.getItem(i)).getType() == MapType.TYPE_DEFAULT){
+				maps.setSelection(i, false);
+				break;
+			}
+		}
+
+		adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getGameplay(this));
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		gameplay.setAdapter(adapter);
+		gameplay.setOnItemSelectedListener(gameplayClicker);
+		//set to first nonmap
+		for(int i = 0; i < adapter.getCount(); i++){
+			if(((String)adapter.getItem(i)).equals("None")){
+				gameplay.setSelection(i, false);
+				break;
+			}
+		}
+
+		adapter = new ArrayAdapter<Scheme>(this, R.layout.listview_item, FrontendDataUtils.getSchemes(this));
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		gamescheme.setAdapter(adapter);
+		gamescheme.setOnItemSelectedListener(schemeClicker);
+		//set to first nonmap
+		for(int i = 0; i < adapter.getCount(); i++){
+			if(((Scheme)adapter.getItem(i)).toString().equals("Default")){
+				gamescheme.setSelection(i, false);
+				break;
+			}
+		}
+		
+		
+		adapter = new ArrayAdapter<Weapon>(this, R.layout.listview_item, FrontendDataUtils.getWeapons(this));
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		weapons.setAdapter(adapter);
+		weapons.setOnItemSelectedListener(weaponClicker);
+		for(int i = 0; i < adapter.getCount(); i++){
+			if(((Weapon)adapter.getItem(i)).toString().equals("Crazy")){
+				weapons.setSelection(i, false);
+				break;
+			}
+		}
+		adapter = new ArrayAdapter<String>(this, R.layout.listview_item, FrontendDataUtils.getThemes(this));
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		themes.setAdapter(adapter);
+		themes.setOnItemSelectedListener(themesClicker);
+	}
+
+	private void startTeamsActivity(){
+		Intent i = new Intent(StartGameActivity.this, TeamSelectionActivity.class);
+		i.putParcelableArrayListExtra("teams", config.teams);
+		startActivityForResult(i, ACTIVITY_TEAM_SELECTOR);
+	}
+
+	public void onActivityResult(int requestCode, int resultCode, Intent data){
+		switch(requestCode){
+		case ACTIVITY_TEAM_SELECTOR:
+			if(resultCode == Activity.RESULT_OK){
+				Parcelable[] parcelables = (Parcelable[])data.getParcelableArrayExtra("teams");
+				config.teams.clear();
+				for(Parcelable t : parcelables){
+					config.teams.add((Team)t);
+				}
+				teamCount.getDrawable().setLevel(config.teams.size());
+			}
+			break;
+		}
+	}
+
+
+	private OnItemSelectedListener themesClicker = new OnItemSelectedListener(){
+
+		public void onItemSelected(AdapterView<?> arg0, View view, int position, long rowId) {
+			String themeName = (String) arg0.getAdapter().getItem(position);
+			Drawable themeIconDrawable = Drawable.createFromPath(Utils.getDataPath(StartGameActivity.this) + "Themes/" + themeName + "/icon at 2X.png");
+			themeIcon.setImageDrawable(themeIconDrawable);
+			config.theme = themeName;
+		}
+
+		public void onNothingSelected(AdapterView<?> arg0) {
+		}
+
+	};
+
+	private OnItemSelectedListener mapsClicker = new OnItemSelectedListener(){
+
+		public void onItemSelected(AdapterView<?> arg0, View view, int position,long rowId) {
+			Map map = (Map)arg0.getAdapter().getItem(position);
+			mapPreview.setImageDrawable(map.getDrawable());
+			config.map = map;
+		}
+
+		public void onNothingSelected(AdapterView<?> arg0) {
+		}
+
+	};
+
+	private OnItemSelectedListener weaponClicker = new OnItemSelectedListener(){
+		public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+			config.weapon = (Weapon)arg0.getAdapter().getItem(arg2);
+		}
+		public void onNothingSelected(AdapterView<?> arg0) {
+
+		}
+	};
+	private OnItemSelectedListener schemeClicker = new OnItemSelectedListener(){
+		public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+			config.scheme = (Scheme)arg0.getAdapter().getItem(arg2);
+		}
+		public void onNothingSelected(AdapterView<?> arg0) {
+
+		}
+	};
+	private OnItemSelectedListener gameplayClicker = new OnItemSelectedListener(){
+		public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+			//config = ()arg0.getAdapter().getItem(arg2);
+		}
+		public void onNothingSelected(AdapterView<?> arg0) {
+
+		}
+	};
+
+	private OnClickListener startClicker = new OnClickListener(){
+		public void onClick(View v) {
+			if(config.teams.size() < 2){
+				Toast.makeText(StartGameActivity.this, R.string.not_enough_teams, Toast.LENGTH_LONG).show();
+				startTeamsActivity();
+			}
+			else{
+				Intent i = new Intent(StartGameActivity.this, SDLActivity.class);
+				i.putExtra("config", config);
+				startActivity(i);}
+		}
+	};
+
+	private OnClickListener backClicker = new OnClickListener(){
+		public void onClick(View v) {
+			finish();
+		}
+	};
+
+	private OnClickListener teamClicker = new OnClickListener(){
+		public void onClick(View v) {
+			startTeamsActivity();
+		}
+	};
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java
new file mode 100644
index 0000000..bd0e8cb
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java
@@ -0,0 +1,416 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils;
+import org.hedgewars.hedgeroid.Datastructures.Team;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnFocusChangeListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.ArrayAdapter;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.ScrollView;
+import android.widget.SimpleAdapter;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class TeamCreatorActivity extends Activity implements Runnable{
+
+	private TextView name;
+	private Spinner difficulty, grave, flag, voice, fort;
+	private ImageView imgFort;
+	private ArrayList<ImageButton> hogDice = new ArrayList<ImageButton>();
+	private ArrayList<Spinner> hogHat = new ArrayList<Spinner>();
+	private ArrayList<EditText> hogName = new ArrayList<EditText>();
+	private ImageButton back, save, voiceButton;
+	private ScrollView scroller;
+	private MediaPlayer mp = null;
+	private boolean settingsChanged = false;
+	private boolean saved = false;
+	private String fileName = null;
+
+	private final List<HashMap<String, ?>> flagsData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> typesData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> gravesData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> hatsData = new ArrayList<HashMap<String, ?>>();
+	private final List<String> voicesData = new ArrayList<String>();
+	private final List<String> fortsData = new ArrayList<String>();
+
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.team_creation);
+
+		name = (TextView) findViewById(R.id.txtName);
+		difficulty = (Spinner) findViewById(R.id.spinType);
+		grave = (Spinner) findViewById(R.id.spinGrave);
+		flag = (Spinner) findViewById(R.id.spinFlag);
+		voice = (Spinner) findViewById(R.id.spinVoice);
+		fort = (Spinner) findViewById(R.id.spinFort);
+
+		imgFort = (ImageView) findViewById(R.id.imgFort);
+
+		back = (ImageButton) findViewById(R.id.btnBack);
+		save = (ImageButton) findViewById(R.id.btnSave);
+		voiceButton = (ImageButton) findViewById(R.id.btnPlay);
+
+		scroller = (ScrollView) findViewById(R.id.scroller);
+
+		save.setOnClickListener(saveClicker);
+		back.setOnClickListener(backClicker);
+
+		LinearLayout ll = (LinearLayout) findViewById(R.id.HogsContainer);
+		for (int i = 0; i < ll.getChildCount(); i++) {
+			RelativeLayout team_creation_entry = (RelativeLayout) ll.getChildAt(i);
+
+			hogHat.add((Spinner) team_creation_entry
+					.findViewById(R.id.spinTeam1));
+			hogDice.add((ImageButton) team_creation_entry
+					.findViewById(R.id.btnTeam1));
+			hogName.add((EditText) team_creation_entry
+					.findViewById(R.id.txtTeam1));
+		}
+
+		SimpleAdapter sa = new SimpleAdapter(this, gravesData,
+				R.layout.spinner_textimg_entry, new String[] { "txt", "img" },
+				new int[] { R.id.spinner_txt, R.id.spinner_img });
+		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
+		sa.setViewBinder(viewBinder);
+		grave.setAdapter(sa);
+		grave.setOnFocusChangeListener(focusser);
+
+		sa = new SimpleAdapter(this, flagsData, R.layout.spinner_textimg_entry,
+				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
+				R.id.spinner_img });
+		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
+		sa.setViewBinder(viewBinder);
+		flag.setAdapter(sa);
+		flag.setOnFocusChangeListener(focusser);
+
+		sa = new SimpleAdapter(this, typesData, R.layout.spinner_textimg_entry,
+				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
+				R.id.spinner_img });
+		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
+		difficulty.setAdapter(sa);
+		difficulty.setOnFocusChangeListener(focusser);
+
+		sa = new SimpleAdapter(this, hatsData, R.layout.spinner_textimg_entry,
+				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
+				R.id.spinner_img });
+		sa.setDropDownViewResource(R.layout.spinner_textimg_dropdown_entry);
+		sa.setViewBinder(viewBinder);
+		for (Spinner spin : hogHat) {
+			spin.setAdapter(sa);
+		}
+
+		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listview_item, voicesData);
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		voice.setAdapter(adapter);
+		voice.setOnFocusChangeListener(focusser);
+		voiceButton.setOnClickListener(voiceClicker);
+
+		adapter = new ArrayAdapter<String>(this, R.layout.listview_item, fortsData);
+		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+		fort.setAdapter(adapter);
+		fort.setOnItemSelectedListener(fortSelector);
+		fort.setOnFocusChangeListener(focusser);
+
+		new Thread(this).start();
+	}
+
+	public void run(){
+		final ArrayList<HashMap<String, ?>> gravesDataNew = FrontendDataUtils.getGraves(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(gravesData, gravesDataNew);
+				((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged();
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> flagsDataNew = FrontendDataUtils.getFlags(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(flagsData, flagsDataNew);
+				((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged();
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> typesDataNew = FrontendDataUtils.getTypes(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(typesData, typesDataNew);
+				((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged();
+			}
+		});
+		
+		final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(hatsData, hatsDataNew);
+				((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged();
+			}
+		});
+		
+		final ArrayList<String> voicesDataNew = FrontendDataUtils.getVoices(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(voicesData, voicesDataNew);
+				((ArrayAdapter<String>)voice.getAdapter()).notifyDataSetChanged();
+			}
+		});
+		
+		final ArrayList<String> fortsDataNew = FrontendDataUtils.getForts(this);
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				copy(fortsData, fortsDataNew);
+				((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged();
+			}
+		});
+	}
+	
+	private static <T> void copy(List<T> dest, List<T> src){
+		for(T t: src) dest.add(t);
+	}
+
+	public void onDestroy() {
+		super.onDestroy();
+		if (mp != null) {
+			mp.release();
+			mp = null;
+		}
+	}
+
+	private OnFocusChangeListener focusser = new OnFocusChangeListener() {
+		public void onFocusChange(View v, boolean hasFocus) {
+			settingsChanged = true;
+		}
+
+	};
+
+	public void onBackPressed() {
+		onFinishing();
+		super.onBackPressed();
+
+	}
+
+	private OnClickListener backClicker = new OnClickListener() {
+		public void onClick(View v) {
+			onFinishing();
+			finish();
+		}
+	};
+
+	private void onFinishing() {
+		if (settingsChanged) {
+			setResult(RESULT_OK);
+		} else {
+			setResult(RESULT_CANCELED);
+		}
+	}
+
+	private OnClickListener saveClicker = new OnClickListener() {
+		public void onClick(View v) {
+			Toast.makeText(TeamCreatorActivity.this, R.string.saved, Toast.LENGTH_SHORT).show();
+			saved = true;
+			Team team = new Team();
+			team.name = name.getText().toString();
+			HashMap<String, Object> hashmap = (HashMap<String, Object>) flag.getSelectedItem();
+
+			team.flag = (String) hashmap.get("txt");
+			team.fort = fort.getSelectedItem().toString();
+			hashmap = (HashMap<String, Object>) grave.getSelectedItem();
+			team.grave = hashmap.get("txt").toString();
+			team.hash = "0";
+			team.voice = voice.getSelectedItem().toString();
+			team.file = fileName;
+
+			hashmap = ((HashMap<String, Object>) difficulty.getSelectedItem());
+			String levelString = hashmap.get("txt").toString();
+			int levelInt;
+			if (levelString.equals(getString(R.string.human))) {
+				levelInt = 0;
+			} else if (levelString.equals(getString(R.string.bot5))) {
+				levelInt = 1;
+			} else if (levelString.equals(getString(R.string.bot4))) {
+				levelInt = 2;
+			} else if (levelString.equals(getString(R.string.bot3))) {
+				levelInt = 3;
+			} else if (levelString.equals(getString(R.string.bot2))) {
+				levelInt = 4;
+			} else {
+				levelInt = 5;
+			}
+
+			for (int i = 0; i < hogName.size(); i++) {
+				team.hogNames[i] = hogName.get(i).getText().toString();
+				hashmap = (HashMap<String, Object>) hogHat.get(i).getSelectedItem();
+				team.hats[i] = hashmap.get("txt").toString();
+				team.levels[i] = levelInt;
+			}
+			try {
+				File teamsDir = new File(getFilesDir().getAbsolutePath() + '/' + Team.DIRECTORY_TEAMS);
+				if (!teamsDir.exists()) teamsDir.mkdir();
+				if(team.file == null){
+					team.setFileName(TeamCreatorActivity.this);
+				}
+				FileOutputStream fos = new FileOutputStream(String.format("%s/%s", teamsDir.getAbsolutePath(), team.file));
+				team.writeToXml(fos);
+			} catch (FileNotFoundException e) {
+				e.printStackTrace();
+			}
+		}
+
+	};
+
+	private OnItemSelectedListener fortSelector = new OnItemSelectedListener() {
+		public void onItemSelected(AdapterView<?> arg0, View arg1,
+				int position, long arg3) {
+			settingsChanged = true;
+			String fortName = (String) arg0.getAdapter().getItem(position);
+			Drawable fortIconDrawable = Drawable.createFromPath(Utils
+					.getDataPath(TeamCreatorActivity.this)
+					+ "Forts/"
+					+ fortName + "L.png");
+			imgFort.setImageDrawable(fortIconDrawable);
+			scroller.fullScroll(ScrollView.FOCUS_DOWN);// Scroll the scrollview
+			// to the bottom, work
+			// around for scollview
+			// invalidation (scrolls
+			// back to top)
+		}
+
+		public void onNothingSelected(AdapterView<?> arg0) {
+		}
+
+	};
+
+	private OnClickListener voiceClicker = new OnClickListener() {
+		public void onClick(View v) {
+			try {
+				File dir = new File(String.format("%sSounds/voices/%s",
+						Utils.getDataPath(TeamCreatorActivity.this),
+						voice.getSelectedItem()));
+				String file = "";
+				File[] dirs = dir.listFiles();
+				File f = dirs[(int) Math.round(Math.random() * dirs.length)];
+				if (f.getName().endsWith(".ogg"))
+					file = f.getAbsolutePath();
+
+				if (mp == null)
+					mp = new MediaPlayer();
+				else
+					mp.reset();
+				mp.setDataSource(file);
+				mp.prepare();
+				mp.start();
+			} catch (IllegalArgumentException e) {
+				e.printStackTrace();
+			} catch (IllegalStateException e) {
+				e.printStackTrace();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	};
+
+	private void setTeamValues(Team t){
+
+		if (t != null) {
+			name.setText(t.name);
+			int position = ((ArrayAdapter<String>) voice.getAdapter()).getPosition(t.voice);
+			voice.setSelection(position);
+
+			position = ((ArrayAdapter<String>) fort.getAdapter()).getPosition(t.fort);
+			fort.setSelection(position);
+
+			position = 0;
+			for (HashMap<String, ?> hashmap : typesData) {
+				if (hashmap.get("txt").equals(t.levels[0])) {
+					difficulty.setSelection(position);
+					break;
+				}
+			}
+
+			position = 0;
+			for (HashMap<String, ?> hashmap : gravesData) {
+				if (hashmap.get("txt").equals(t.grave)) {
+					grave.setSelection(position);
+					break;
+				}
+			}
+
+			position = 0;
+			for (HashMap<String, ?> hashmap : typesData) {
+				if (hashmap.get("txt").equals(t.flag)) {
+					flag.setSelection(position);
+					break;
+				}
+			}
+
+			for (int i = 0; i < Team.maxNumberOfHogs; i++) {
+				position = 0;
+				for (HashMap<String, ?> hashmap : hatsData) {
+					if (hashmap.get("txt").equals(t.hats[i])) {
+						hogHat.get(i).setSelection(position);
+					}
+				}
+
+				hogName.get(i).setText(t.hogNames[i]);
+			}
+			this.fileName = t.file;
+		}
+	}
+
+
+	private SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
+
+		public boolean setViewValue(View view, Object data,
+				String textRepresentation) {
+			if (view instanceof ImageView && data instanceof Bitmap) {
+				ImageView v = (ImageView) view;
+				v.setImageBitmap((Bitmap) data);
+				return true;
+			} else {
+				return false;
+			}
+		}
+	};
+
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamSelectionActivity.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamSelectionActivity.java
new file mode 100644
index 0000000..628aa7b
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamSelectionActivity.java
@@ -0,0 +1,307 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.hedgewars.hedgeroid.Datastructures.FrontendDataUtils;
+import org.hedgewars.hedgeroid.Datastructures.Team;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.view.ContextMenu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.SimpleAdapter;
+import android.widget.SimpleAdapter.ViewBinder;
+import android.widget.TextView;
+
+public class TeamSelectionActivity extends Activity implements Runnable{
+
+	private static final int ACTIVITY_TEAMCREATION = 0;
+
+	private ImageButton addTeam, back;
+	private ListView availableTeams, selectedTeams;
+	private List<HashMap<String, Object>> availableTeamsList, selectedTeamsList;
+	private TextView txtInfo;
+
+	public void onCreate(Bundle savedInstanceState){
+		super.onCreate(savedInstanceState);
+
+		setContentView(R.layout.team_selector);
+
+		addTeam = (ImageButton) findViewById(R.id.btnAdd);
+		back = (ImageButton) findViewById(R.id.btnBack);
+		txtInfo = (TextView) findViewById(R.id.txtInfo);
+		selectedTeams = (ListView) findViewById(R.id.selectedTeams);
+		availableTeams = (ListView) findViewById(R.id.availableTeams);
+		addTeam.setOnClickListener(addTeamClicker);
+		back.setOnClickListener(backClicker);
+
+		availableTeamsList = new ArrayList<HashMap<String, Object>>();
+		SimpleAdapter adapter = new SimpleAdapter(this, availableTeamsList, R.layout.team_selection_entry_simple, new String[]{"txt", "img"}, new int[]{R.id.txtName, R.id.imgDifficulty});
+		availableTeams.setAdapter(adapter);
+		availableTeams.setOnItemClickListener(availableClicker);
+		registerForContextMenu(availableTeams);
+
+		selectedTeamsList = new ArrayList<HashMap<String, Object>>();
+		adapter = new SimpleAdapter(this, selectedTeamsList, R.layout.team_selection_entry, new String[]{"txt", "img", "color", "count"}, new int[]{R.id.txtName, R.id.imgDifficulty, R.id.teamColor, R.id.teamCount});
+		adapter.setViewBinder(viewBinder);
+		selectedTeams.setAdapter(adapter);
+		selectedTeams.setOnItemClickListener(selectedClicker);
+
+		txtInfo.setText(String.format(getResources().getString(R.string.teams_info_template), selectedTeams.getChildCount()));
+
+		new Thread(this).start();//load the teams from xml async
+	}
+
+	public void run(){
+		List<HashMap<String, Object>> teamsList = FrontendDataUtils.getTeams(this);//teams from xml
+		ArrayList<Team> teamsStartGame = getIntent().getParcelableArrayListExtra("teams");//possible selected teams
+
+		for(HashMap<String, Object> hashmap : teamsList){
+			boolean added = false;
+			for(Team t : teamsStartGame){
+				if(((Team)hashmap.get("team")).equals(t)){//add to available or add to selected
+					selectedTeamsList.add(FrontendDataUtils.teamToMap(t));//create a new hashmap to ensure all variables are entered into the map
+					added = true;
+					break;
+				}
+			}
+			if(!added) availableTeamsList.add(hashmap);
+		}
+
+		this.runOnUiThread(new Runnable(){
+			public void run() {
+				((SimpleAdapter)selectedTeams.getAdapter()).notifyDataSetChanged();
+				((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();		
+			}
+		});
+	}
+
+	private ViewBinder viewBinder = new ViewBinder(){
+		public boolean setViewValue(View view, Object data,	String textRepresentation) {
+			switch(view.getId()){
+			case R.id.teamColor:
+				setTeamColor(view, (Integer)data);
+				return true;
+			case R.id.teamCount:
+				setTeamHogCount((ImageView)view, (Integer)data);
+				return true;
+			default:
+				return false;
+			}
+		}
+	};
+
+	public void onActivityResult(int requestCode, int resultCode, Intent data){
+		if(requestCode == ACTIVITY_TEAMCREATION){
+			if(resultCode == Activity.RESULT_OK){
+				updateListViews();
+			}
+		}else{
+			super.onActivityResult(requestCode, resultCode, data);
+		}
+	}
+
+	/*
+	 * Updates the list view when TeamCreationActivity is shutdown and the user returns to this point
+	 */
+	private void updateListViews(){
+		unregisterForContextMenu(availableTeams);
+		availableTeamsList = FrontendDataUtils.getTeams(this);
+		ArrayList<HashMap<String, Object>> toBeRemoved = new ArrayList<HashMap<String, Object>>();
+		for(HashMap<String, Object> hashmap : selectedTeamsList){
+			String name = (String)hashmap.get("txt");
+
+			for(HashMap<String, Object> hash : availableTeamsList){
+				if(name.equals((String)hash.get("txt"))){
+					toBeRemoved.add(hash);
+				}
+			}
+		}
+		for(HashMap<String, Object> hash: toBeRemoved) availableTeamsList.remove(hash);
+
+		SimpleAdapter adapter = new SimpleAdapter(this, availableTeamsList, R.layout.team_selection_entry, new String[]{"txt", "img"}, new int[]{R.id.txtName, R.id.imgDifficulty});
+		availableTeams.setAdapter(adapter);
+		registerForContextMenu(availableTeams);
+		availableTeams.setOnItemClickListener(availableClicker);
+
+
+	}
+
+	private void setTeamColor(int position, int color){
+		View iv = ((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount);
+		setTeamColor(iv, color);
+	}
+	private void setTeamColor(View iv, int color){
+		iv.setBackgroundColor(0xFF000000 + color);
+	}
+
+	private void setTeamHogCount(int position, int count){
+		ImageView iv = (ImageView)((RelativeLayout)selectedTeams.getChildAt(position)).findViewById(R.id.teamCount);
+		setTeamHogCount(iv, count);
+	}
+
+	private void setTeamHogCount(ImageView iv, int count){
+
+		switch(count){
+		case 0:
+			iv.setImageResource(R.drawable.teamcount0);
+			break;
+		case 1:
+			iv.setImageResource(R.drawable.teamcount1);
+			break;
+		case 2:
+			iv.setImageResource(R.drawable.teamcount2);
+			break;
+		case 3:
+			iv.setImageResource(R.drawable.teamcount3);
+			break;
+		case 4:
+			iv.setImageResource(R.drawable.teamcount4);
+			break;
+		case 5:
+			iv.setImageResource(R.drawable.teamcount5);
+			break;
+		case 6:
+			iv.setImageResource(R.drawable.teamcount6);
+			break;
+		case 7:
+			iv.setImageResource(R.drawable.teamcount7);
+			break;
+		case 8:
+			iv.setImageResource(R.drawable.teamcount8);
+			break;
+		case 9:
+			iv.setImageResource(R.drawable.teamcount9);
+			break;
+		}
+	}
+
+	public void onBackPressed(){
+		returnTeams();
+		super.onBackPressed();
+	}
+
+	private OnClickListener addTeamClicker = new OnClickListener(){
+		public void onClick(View v) {
+			startActivityForResult(new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class), ACTIVITY_TEAMCREATION);
+		}
+	};
+
+	private OnClickListener backClicker = new OnClickListener(){
+		public void onClick(View v){
+			returnTeams();
+			finish();
+		}
+	};
+
+	private OnItemClickListener availableClicker = new OnItemClickListener(){
+		public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
+			selectAvailableTeamsItem(position);
+		}
+	};
+	private OnItemClickListener selectedClicker = new OnItemClickListener(){
+		public void onItemClick(AdapterView<?> arg0, View arg1, int position,long arg3) {
+			availableTeamsList.add((HashMap<String, Object>) selectedTeamsList.get(position));
+			selectedTeamsList.remove(position);
+			((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+			((SimpleAdapter)selectedTeams.getAdapter()).notifyDataSetChanged();
+
+			txtInfo.setText(String.format(getResources().getString(R.string.teams_info_template), selectedTeamsList.size()));
+		}
+
+	};
+
+	public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuinfo){
+		menu.add(ContextMenu.NONE, 0, ContextMenu.NONE, R.string.select);
+		menu.add(ContextMenu.NONE, 2, ContextMenu.NONE, R.string.edit);
+		menu.add(ContextMenu.NONE, 1, ContextMenu.NONE, R.string.delete);
+
+	}
+	public boolean onContextItemSelected(MenuItem item){
+		AdapterView.AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
+		int position = menuInfo.position;
+		switch(item.getItemId()){
+		case 0://select
+			selectAvailableTeamsItem(position);
+			return true;
+		case 1://delete
+			Team team = (Team)availableTeamsList.get(position).get("team");
+			File f = new File(String.format("%s/%s/%s", TeamSelectionActivity.this.getFilesDir(), Team.DIRECTORY_TEAMS, team.file));
+			f.delete();
+			availableTeamsList.remove(position);
+			((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+			return true;
+		case 2://edit
+			Intent i = new Intent(TeamSelectionActivity.this, TeamCreatorActivity.class);
+			Team t = (Team)availableTeamsList.get(position).get("team");
+			i.putExtra("team", t);
+			startActivityForResult(i, ACTIVITY_TEAMCREATION);
+			return true;
+		}
+		return false;
+	}
+
+	private void selectAvailableTeamsItem(int position){
+		HashMap<String, Object> hash = (HashMap<String, Object>) availableTeamsList.get(position);
+		Team t = (Team)hash.get("team");
+		int[] illegalcolors = new int[selectedTeamsList.size()];
+		for(int i = 0; i < selectedTeamsList.size(); i++){
+			illegalcolors[i] = ((Team)selectedTeamsList.get(i).get("team")).color;
+		}
+		t.setRandomColor(illegalcolors);
+		hash.put("color", t.color);
+		hash.put("count", t.hogCount);
+
+		selectedTeamsList.add(hash);
+		availableTeamsList.remove(position);
+		((SimpleAdapter)availableTeams.getAdapter()).notifyDataSetChanged();
+		((SimpleAdapter)selectedTeams.getAdapter()).notifyDataSetChanged();
+
+		txtInfo.setText(String.format(getResources().getString(R.string.teams_info_template), selectedTeamsList.size()));
+	}
+
+	private void returnTeams(){
+		int teamsCount = selectedTeamsList.size();
+		Intent i = new Intent();
+		Parcelable[] teams = new Parcelable[teamsCount];
+		for(int x = 0 ; x < teamsCount; x++){
+			teams[x] = (Team)selectedTeamsList.get(x).get("team");
+		}
+		i.putExtra("teams", teams);
+		setResult(Activity.RESULT_OK, i);
+
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TextImageAdapter.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TextImageAdapter.java
new file mode 100644
index 0000000..6082e44
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TextImageAdapter.java
@@ -0,0 +1,74 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+
+
+public class TextImageAdapter extends SimpleAdapter {
+
+	private Context context;
+	private ArrayList<Map<String, ?>> data;
+	
+	public TextImageAdapter(Context _context, ArrayList<Map<String, ?>> _data, int resource, String[] from, int[] to) {
+		super(_context, _data, resource, from, to);
+		context = _context;
+		data = _data;
+	}
+	
+	public static TextImageAdapter createAdapter(Context c, String[] txt, String[] img, String[] from, int[] to){
+		if(txt.length != img.length) throw new IllegalArgumentException("txt and img parameters not equal");
+		
+		ArrayList<Map<String, ?>> data = new ArrayList<Map<String, ?>>(txt.length);
+		
+		for(int i = 0; i < txt.length; i++){
+			HashMap<String, Object> map = new HashMap<String, Object>();
+			map.put("txt", txt[i]);
+			map.put("img", BitmapFactory.decodeFile(img[i]));
+			data.add(map);
+		}
+		return new TextImageAdapter(c, data, R.layout.spinner_textimg_entry, from, to);
+	}
+
+	public View getView(int position, View convertView, ViewGroup parent){
+		if(convertView == null){
+			LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+			convertView = inflater.inflate(R.layout.spinner_textimg_entry, parent);
+		}
+		TextView tv = (TextView) convertView.findViewById(R.id.spinner_txt);
+		ImageView img = (ImageView) convertView.findViewById(R.id.spinner_img);
+		
+		tv.setText((String)data.get(position).get("txt"));
+		img.setImageBitmap((Bitmap)data.get(position).get("img"));
+		
+		return convertView;
+	}
+}
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
new file mode 100644
index 0000000..6d7567f
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
@@ -0,0 +1,103 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+package org.hedgewars.hedgeroid.UserInput;
+
+import org.hedgewars.hedgeroid.SDLActivity;
+
+import android.os.Build;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnTouchListener;
+
+public class TouchInterface{
+
+	public static OnTouchListener getTouchInterface(){
+		OnTouchListener toucher;
+		if(Build.VERSION.SDK_INT < 5){//8 == Build.VERSION_CODES.FROYO
+			toucher = new TouchInterfaceST();
+		}else{
+			toucher = new TouchInterfaceMT();
+		}
+
+		return toucher;
+	}
+}
+/**
+ * Touch interface with multitouch
+ */
+class TouchInterfaceMT implements OnTouchListener {
+	
+	private boolean firstEvent = true;
+	
+	public boolean onTouch(View v, MotionEvent event) {
+		//dumpEvent(event);
+		
+		int action = event.getAction();
+		int actionCode = action & MotionEvent.ACTION_MASK;
+		
+		for (int i = 0; i < event.getPointerCount(); i++) {
+			SDLActivity.onNativeTouch(event.getDeviceId(),  event.getPointerId(i), actionCode, (int)event.getX(i), (int)event.getY(i), event.getPressure(i));
+//			Log.d("Android", String.format("x=%f, y=%f, pntr=%d", event.getX(i), event.getY(i), event.getPointerId(i)));
+		   }
+		return true;
+	}
+
+	/** Show an event in the LogCat view, for debugging */
+	private void dumpEvent(MotionEvent event) {
+	   String names[] = { "DOWN" , "UP" , "MOVE" , "CANCEL" , "OUTSIDE" ,
+	      "POINTER_DOWN" , "POINTER_UP" , "7?" , "8?" , "9?" };
+	   StringBuilder sb = new StringBuilder();
+	   int action = event.getAction();
+	   int actionCode = action & MotionEvent.ACTION_MASK;
+	   sb.append("event ACTION_" ).append(names[actionCode]);
+	   if (actionCode == MotionEvent.ACTION_POINTER_DOWN
+	         || actionCode == MotionEvent.ACTION_POINTER_UP) {
+	      sb.append("(pid " ).append(
+	      action >> MotionEvent.ACTION_POINTER_ID_SHIFT);
+	      sb.append(")" );
+	   }
+	   sb.append("[" );
+	   for (int i = 0; i < event.getPointerCount(); i++) {
+	      sb.append("#" ).append(i);
+	      sb.append("(pid " ).append(event.getPointerId(i));
+	      sb.append(")=" ).append((int) event.getX(i));
+	      sb.append("," ).append((int) event.getY(i));
+	      if (i + 1 < event.getPointerCount())
+	         sb.append(";" );
+	   }
+	   sb.append("]" );
+	   Log.d("HW_APP_TOUCH", sb.toString());
+	}
+
+}
+
+/**
+ * Touch interface without multitouch
+ */
+class TouchInterfaceST implements OnTouchListener {
+
+	public boolean onTouch(View v, MotionEvent event) {
+		return false;
+	}
+
+
+
+}
+
diff --git a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Utils.java b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Utils.java
new file mode 100644
index 0000000..5ccff91
--- /dev/null
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Utils.java
@@ -0,0 +1,221 @@
+/*
+ * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011-2012 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+package org.hedgewars.hedgeroid;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.os.Build;
+import android.os.Environment;
+import android.util.Log;
+
+public class Utils {
+
+	private static final String ROOT_DIR = "Data/";
+
+	/**
+	 * get the path to which we should download all the data files
+	 * @param c context 
+	 * @return absolute path
+	 */
+	public static String getCachePath(Context c){
+		if(Build.VERSION.SDK_INT < 8){//8 == Build.VERSION_CODES.FROYO
+			return PreFroyoSDCardDir.getDownloadPath(c) + '/';
+		}else{
+			return FroyoSDCardDir.getDownloadPath(c) + '/';
+		}
+	}
+
+	public static String getDataPath(Context c){
+		return getCachePath(c) + ROOT_DIR;
+	}
+
+	static class FroyoSDCardDir{
+		public static String getDownloadPath(Context c){
+			File f =  c.getExternalCacheDir();
+			if(f != null){
+				return f.getAbsolutePath();
+			}else{
+				return null;
+			}	
+		}
+	}
+
+	static class PreFroyoSDCardDir{
+		public static String getDownloadPath(Context c){
+			if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
+				if(Environment.getExternalStorageDirectory() != null)
+					return Environment.getExternalStorageDirectory().getAbsolutePath() + "/Hedgewars/";				
+			}
+			return null;
+		}
+	}
+
+	/**
+	 * Get files from dirName, dir name is relative to {@link getDownloadPath}
+	 * @param dirName
+	 * @param c context
+	 * @return string of files
+	 */
+	public static String[] getFileNamesFromRelativeDir(Context c, String dirName){
+		String prefix = getDataPath(c);
+		File f = new File(prefix + dirName);
+
+		if(f.exists() && f.isDirectory()) return f.list();
+		else{
+
+			Log.e("Utils::", "Couldn't find dir: " + dirName);
+			return new String[0];
+		}
+	}
+
+	/**
+	 * Return a File array with all the files from dirName
+	 * @param c
+	 * @param dirName
+	 * @return
+	 */
+	public static File[] getFilesFromRelativeDir(Context c, String dirName){
+		String prefix = getDataPath(c);
+		File f = new File(prefix + dirName);
+
+		if(f.exists() && f.isDirectory()) return f.listFiles();
+		else {
+			Log.e("Utils::", "Dir not found: " + dirName);
+			return new File[0];
+		}
+	}
+
+	/**
+	 * Checks if this directory has a file with suffix suffix
+	 * @param f - directory
+	 * @return
+	 */
+	public static boolean hasFileWithSuffix(File f, String suffix){
+		if(f.isDirectory()){
+			for(String s : f.list()){
+				if(s.endsWith(suffix)) return true;
+			}
+			return false;
+		}else{
+			return false;
+		}
+	}
+
+	/**
+	 * Gives back all dirs which contain a file with suffix fileSuffix
+	 * @param c
+	 * @param path
+	 * @param fileSuffix
+	 * @return
+	 */
+	public static List<String> getDirsWithFileSuffix(Context c, String path, String fileSuffix){
+		File[] files = getFilesFromRelativeDir(c,path);
+		ArrayList<String> ret = new ArrayList<String>();
+
+		for(File f : files){
+			if(hasFileWithSuffix(f, fileSuffix)) ret.add(f.getName());
+		}
+		return ret;
+	}
+
+	/**
+	 * Get all files from directory dir which have the given suffix
+	 * @param c
+	 * @param dir
+	 * @param suffix
+	 * @param removeSuffix
+	 * @return
+	 */
+	public static ArrayList<String> getFilesFromDirWithSuffix(Context c, String dir, String suffix, boolean removeSuffix){
+		String[] files = Utils.getFileNamesFromRelativeDir(c, dir);
+		ArrayList<String> ret = new ArrayList<String>();
+		for(String s : files){
+			if(s.endsWith(suffix)){
+				if(removeSuffix) ret.add(s.substring(0, s.length()-suffix.length()));
+				else ret.add(s);
+			}
+		}
+		return ret;
+	}
+
+	/**
+	 * Moves resources pointed to by sourceResId (from @res/raw/) to the app's private data directory
+	 * @param c
+	 * @param sourceResId
+	 * @param directory
+	 */
+	public static void resRawToFilesDir(Context c, int sourceResId, String directory){
+		byte[] buffer = new byte[1024];
+		InputStream bis = null;
+		BufferedOutputStream bos = null;
+		File schemesDirFile = new File(c.getFilesDir().getAbsolutePath() + '/' + directory);
+		schemesDirFile.mkdirs();
+		String schemesDirPath = schemesDirFile.getAbsolutePath() + '/';
+
+		//Get an array with the resource files ID
+		TypedArray ta = c.getResources().obtainTypedArray(sourceResId);
+		int[] resIds = new int[ta.length()];
+		for(int i = 0; i < ta.length(); i++){
+			resIds[i] = ta.getResourceId(i, 0);
+		}
+
+		for(int id : resIds){
+			String fileName = c.getResources().getResourceEntryName(id);
+			File f = new File(schemesDirPath + fileName);
+			try {
+				if(!f.createNewFile()){
+					f.delete();
+					f.createNewFile();
+				}
+
+				bis = c.getResources().openRawResource(id);
+				bos = new BufferedOutputStream(new FileOutputStream(f), 1024);
+				int read = 0;
+				while((read = bis.read(buffer)) != -1){
+					bos.write(buffer, 0, read);
+				}
+
+			} catch (IOException e) {
+				e.printStackTrace();
+			}finally{
+				if(bis != null)
+					try { 
+						bis.close();
+					} catch (IOException e) {
+						e.printStackTrace();
+					}
+					if(bos != null)
+						try {
+							bos.close();
+						} catch (IOException e) {
+							e.printStackTrace();
+						}
+			}
+		}
+	}
+}
diff --git a/project_files/Android-build/gles11.pp b/project_files/Android-build/gles11.pp
new file mode 100644
index 0000000..7306a16
--- /dev/null
+++ b/project_files/Android-build/gles11.pp
@@ -0,0 +1,1120 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2011 Richard Deurwaarder <xeli at xelification.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; version 2 of the License
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$mode objfpc}
+unit gles11;
+interface
+
+{
+  Automatically converted by H2Pas 1.0.0 from gl.hh
+  The following command line parameters were used:
+    -P
+    -l
+    GLESv1_CM
+    -o
+    gles11.pp
+    -D
+    gl.hh
+}
+
+  procedure initModule;
+  procedure freeModule;
+
+  const
+    External_library='GLESv1_CM'; {Setup as you need}
+
+  Type
+ 
+//     khronos_int32_t = int32_t;
+//     khronos_uint32_t = uint32_t;
+//     khronos_int64_t = int64_t;
+//     khronos_uint64_t = uint64_t;
+
+  khronos_int32_t = longint;
+  khronos_uint32_t = longword;
+  khronos_int64_t = Int64;
+  khronos_uint64_t = QWord;
+  khronos_int8_t = char;
+  khronos_uint8_t = byte;
+  khronos_int16_t = smallint;
+  khronos_uint16_t = word;
+  khronos_intptr_t = longint;
+  khronos_uintptr_t = dword;
+  khronos_ssize_t = longint;
+  khronos_usize_t = dword;
+  khronos_float_t = single;
+
+  GLvoid = pointer;
+  GLenum = dword;
+  GLboolean = byte;
+  GLbitfield = dword;
+  GLshort = smallint;
+  GLint = longint;
+  GLsizei = longint;
+  GLushort = word;
+  GLuint = dword;
+
+  GLbyte = khronos_int8_t;
+  GLubyte = khronos_uint8_t;
+  GLfloat = khronos_float_t;
+  GLclampf = khronos_float_t;
+  GLfixed = khronos_int32_t;
+  GLclampx = khronos_int32_t;
+  GLintptr = khronos_intptr_t;
+  GLsizeiptr = khronos_ssize_t;
+
+  PGLboolean  = ^GLboolean;
+  PGLfixed  = ^GLfixed;
+  PGLfloat  = ^GLfloat;
+  PGLint  = ^GLint;
+  PGLuint  = ^GLuint;
+  PGLvoid  = ^GLvoid;
+  PGLubyte = ^GLubyte;
+{$IFDEF FPC}
+{$PACKRECORDS C}
+{$ENDIF}
+
+  const
+//    GL_API = KHRONOS_APICALL;     
+{$define KHRONOS_APIENTRY}  
+     GL_DIRECT_TEXTURE_2D_QUALCOMM = $7E80;     
+
+  {*********************************************************** }
+  { OpenGL ES core versions  }
+
+  const
+     GL_VERSION_ES_CM_1_0 = 1;     
+     GL_VERSION_ES_CL_1_0 = 1;     
+     GL_VERSION_ES_CM_1_1 = 1;     
+     GL_VERSION_ES_CL_1_1 = 1;     
+  { ClearBufferMask  }
+     GL_DEPTH_BUFFER_BIT = $00000100;     
+     GL_STENCIL_BUFFER_BIT = $00000400;     
+     GL_COLOR_BUFFER_BIT = $00004000;     
+  { Boolean  }
+     GL_FALSE = 0;     
+     GL_TRUE = 1;     
+  { BeginMode  }
+     GL_POINTS = $0000;     
+     GL_LINES = $0001;     
+     GL_LINE_LOOP = $0002;     
+     GL_LINE_STRIP = $0003;     
+     GL_TRIANGLES = $0004;     
+     GL_TRIANGLE_STRIP = $0005;     
+     GL_TRIANGLE_FAN = $0006;     
+  { AlphaFunction  }
+     GL_NEVER = $0200;     
+     GL_LESS = $0201;     
+     GL_EQUAL = $0202;     
+     GL_LEQUAL = $0203;     
+     GL_GREATER = $0204;     
+     GL_NOTEQUAL = $0205;     
+     GL_GEQUAL = $0206;     
+     GL_ALWAYS = $0207;     
+  { BlendingFactorDest  }
+     GL_ZERO = 0;     
+     GL_ONE = 1;     
+     GL_SRC_COLOR = $0300;     
+     GL_ONE_MINUS_SRC_COLOR = $0301;     
+     GL_SRC_ALPHA = $0302;     
+     GL_ONE_MINUS_SRC_ALPHA = $0303;     
+     GL_DST_ALPHA = $0304;     
+     GL_ONE_MINUS_DST_ALPHA = $0305;     
+  { BlendingFactorSrc  }
+  {      GL_ZERO  }
+  {      GL_ONE  }
+     GL_DST_COLOR = $0306;     
+     GL_ONE_MINUS_DST_COLOR = $0307;     
+     GL_SRC_ALPHA_SATURATE = $0308;     
+  {      GL_SRC_ALPHA  }
+  {      GL_ONE_MINUS_SRC_ALPHA  }
+  {      GL_DST_ALPHA  }
+  {      GL_ONE_MINUS_DST_ALPHA  }
+  { ClipPlaneName  }
+     GL_CLIP_PLANE0 = $3000;     
+     GL_CLIP_PLANE1 = $3001;     
+     GL_CLIP_PLANE2 = $3002;     
+     GL_CLIP_PLANE3 = $3003;     
+     GL_CLIP_PLANE4 = $3004;     
+     GL_CLIP_PLANE5 = $3005;     
+  { ColorMaterialFace  }
+  {      GL_FRONT_AND_BACK  }
+  { ColorMaterialParameter  }
+  {      GL_AMBIENT_AND_DIFFUSE  }
+  { ColorPointerType  }
+  {      GL_UNSIGNED_BYTE  }
+  {      GL_FLOAT  }
+  {      GL_FIXED  }
+  { CullFaceMode  }
+     GL_FRONT = $0404;     
+     GL_BACK = $0405;     
+     GL_FRONT_AND_BACK = $0408;     
+  { DepthFunction  }
+  {      GL_NEVER  }
+  {      GL_LESS  }
+  {      GL_EQUAL  }
+  {      GL_LEQUAL  }
+  {      GL_GREATER  }
+  {      GL_NOTEQUAL  }
+  {      GL_GEQUAL  }
+  {      GL_ALWAYS  }
+  { EnableCap  }
+     GL_FOG = $0B60;     
+     GL_LIGHTING = $0B50;     
+     GL_TEXTURE_2D = $0DE1;     
+     GL_CULL_FACE = $0B44;     
+     GL_ALPHA_TEST = $0BC0;     
+     GL_BLEND = $0BE2;     
+     GL_COLOR_LOGIC_OP = $0BF2;     
+     GL_DITHER = $0BD0;     
+     GL_STENCIL_TEST = $0B90;     
+     GL_DEPTH_TEST = $0B71;     
+  {      GL_LIGHT0  }
+  {      GL_LIGHT1  }
+  {      GL_LIGHT2  }
+  {      GL_LIGHT3  }
+  {      GL_LIGHT4  }
+  {      GL_LIGHT5  }
+  {      GL_LIGHT6  }
+  {      GL_LIGHT7  }
+     GL_POINT_SMOOTH = $0B10;     
+     GL_LINE_SMOOTH = $0B20;     
+     GL_SCISSOR_TEST = $0C11;     
+     GL_COLOR_MATERIAL = $0B57;     
+     GL_NORMALIZE = $0BA1;     
+     GL_RESCALE_NORMAL = $803A;     
+     GL_POLYGON_OFFSET_FILL = $8037;     
+     GL_VERTEX_ARRAY = $8074;     
+     GL_NORMAL_ARRAY = $8075;     
+     GL_COLOR_ARRAY = $8076;     
+     GL_TEXTURE_COORD_ARRAY = $8078;     
+     GL_MULTISAMPLE = $809D;     
+     GL_SAMPLE_ALPHA_TO_COVERAGE = $809E;     
+     GL_SAMPLE_ALPHA_TO_ONE = $809F;     
+     GL_SAMPLE_COVERAGE = $80A0;     
+  { ErrorCode  }
+     GL_NO_ERROR = 0;     
+     GL_INVALID_ENUM = $0500;     
+     GL_INVALID_VALUE = $0501;     
+     GL_INVALID_OPERATION = $0502;     
+     GL_STACK_OVERFLOW = $0503;     
+     GL_STACK_UNDERFLOW = $0504;     
+     GL_OUT_OF_MEMORY = $0505;     
+  { FogMode  }
+  {      GL_LINEAR  }
+     GL_EXP = $0800;     
+     GL_EXP2 = $0801;     
+  { FogParameter  }
+     GL_FOG_DENSITY = $0B62;     
+     GL_FOG_START = $0B63;     
+     GL_FOG_END = $0B64;     
+     GL_FOG_MODE = $0B65;     
+     GL_FOG_COLOR = $0B66;     
+  { FrontFaceDirection  }
+     GL_CW = $0900;     
+     GL_CCW = $0901;     
+  { GetPName  }
+     GL_CURRENT_COLOR = $0B00;     
+     GL_CURRENT_NORMAL = $0B02;     
+     GL_CURRENT_TEXTURE_COORDS = $0B03;     
+     GL_POINT_SIZE = $0B11;     
+     GL_POINT_SIZE_MIN = $8126;     
+     GL_POINT_SIZE_MAX = $8127;     
+     GL_POINT_FADE_THRESHOLD_SIZE = $8128;     
+     GL_POINT_DISTANCE_ATTENUATION = $8129;     
+     GL_SMOOTH_POINT_SIZE_RANGE = $0B12;     
+     GL_LINE_WIDTH = $0B21;     
+     GL_SMOOTH_LINE_WIDTH_RANGE = $0B22;     
+     GL_ALIASED_POINT_SIZE_RANGE = $846D;     
+     GL_ALIASED_LINE_WIDTH_RANGE = $846E;     
+     GL_CULL_FACE_MODE = $0B45;     
+     GL_FRONT_FACE = $0B46;     
+     GL_SHADE_MODEL = $0B54;     
+     GL_DEPTH_RANGE = $0B70;     
+     GL_DEPTH_WRITEMASK = $0B72;     
+     GL_DEPTH_CLEAR_VALUE = $0B73;     
+     GL_DEPTH_FUNC = $0B74;     
+     GL_STENCIL_CLEAR_VALUE = $0B91;     
+     GL_STENCIL_FUNC = $0B92;     
+     GL_STENCIL_VALUE_MASK = $0B93;     
+     GL_STENCIL_FAIL = $0B94;     
+     GL_STENCIL_PASS_DEPTH_FAIL = $0B95;     
+     GL_STENCIL_PASS_DEPTH_PASS = $0B96;     
+     GL_STENCIL_REF = $0B97;     
+     GL_STENCIL_WRITEMASK = $0B98;     
+     GL_MATRIX_MODE = $0BA0;     
+     GL_VIEWPORT = $0BA2;     
+     GL_MODELVIEW_STACK_DEPTH = $0BA3;     
+     GL_PROJECTION_STACK_DEPTH = $0BA4;     
+     GL_TEXTURE_STACK_DEPTH = $0BA5;     
+     GL_MODELVIEW_MATRIX = $0BA6;     
+     GL_PROJECTION_MATRIX = $0BA7;     
+     GL_TEXTURE_MATRIX = $0BA8;     
+     GL_ALPHA_TEST_FUNC = $0BC1;     
+     GL_ALPHA_TEST_REF = $0BC2;     
+     GL_BLEND_DST = $0BE0;     
+     GL_BLEND_SRC = $0BE1;     
+     GL_LOGIC_OP_MODE = $0BF0;     
+     GL_SCISSOR_BOX = $0C10;     
+//     GL_SCISSOR_TEST = $0C11;     
+     GL_COLOR_CLEAR_VALUE = $0C22;     
+     GL_COLOR_WRITEMASK = $0C23;     
+     GL_UNPACK_ALIGNMENT = $0CF5;     
+     GL_PACK_ALIGNMENT = $0D05;     
+     GL_MAX_LIGHTS = $0D31;     
+     GL_MAX_CLIP_PLANES = $0D32;     
+     GL_MAX_TEXTURE_SIZE = $0D33;     
+     GL_MAX_MODELVIEW_STACK_DEPTH = $0D36;     
+     GL_MAX_PROJECTION_STACK_DEPTH = $0D38;     
+     GL_MAX_TEXTURE_STACK_DEPTH = $0D39;     
+     GL_MAX_VIEWPORT_DIMS = $0D3A;     
+     GL_MAX_TEXTURE_UNITS = $84E2;     
+     GL_SUBPIXEL_BITS = $0D50;     
+     GL_RED_BITS = $0D52;     
+     GL_GREEN_BITS = $0D53;     
+     GL_BLUE_BITS = $0D54;     
+     GL_ALPHA_BITS = $0D55;     
+     GL_DEPTH_BITS = $0D56;     
+     GL_STENCIL_BITS = $0D57;     
+     GL_POLYGON_OFFSET_UNITS = $2A00;     
+//     GL_POLYGON_OFFSET_FILL = $8037;     
+     GL_POLYGON_OFFSET_FACTOR = $8038;     
+     GL_TEXTURE_BINDING_2D = $8069;     
+     GL_VERTEX_ARRAY_SIZE = $807A;     
+     GL_VERTEX_ARRAY_TYPE = $807B;     
+     GL_VERTEX_ARRAY_STRIDE = $807C;     
+     GL_NORMAL_ARRAY_TYPE = $807E;     
+     GL_NORMAL_ARRAY_STRIDE = $807F;     
+     GL_COLOR_ARRAY_SIZE = $8081;     
+     GL_COLOR_ARRAY_TYPE = $8082;     
+     GL_COLOR_ARRAY_STRIDE = $8083;     
+     GL_TEXTURE_COORD_ARRAY_SIZE = $8088;     
+     GL_TEXTURE_COORD_ARRAY_TYPE = $8089;     
+     GL_TEXTURE_COORD_ARRAY_STRIDE = $808A;     
+     GL_VERTEX_ARRAY_POINTER = $808E;     
+     GL_NORMAL_ARRAY_POINTER = $808F;     
+     GL_COLOR_ARRAY_POINTER = $8090;     
+     GL_TEXTURE_COORD_ARRAY_POINTER = $8092;     
+     GL_SAMPLE_BUFFERS = $80A8;     
+     GL_SAMPLES = $80A9;     
+     GL_SAMPLE_COVERAGE_VALUE = $80AA;     
+     GL_SAMPLE_COVERAGE_INVERT = $80AB;     
+  { GetTextureParameter  }
+  {      GL_TEXTURE_MAG_FILTER  }
+  {      GL_TEXTURE_MIN_FILTER  }
+  {      GL_TEXTURE_WRAP_S  }
+  {      GL_TEXTURE_WRAP_T  }
+     GL_NUM_COMPRESSED_TEXTURE_FORMATS = $86A2;     
+     GL_COMPRESSED_TEXTURE_FORMATS = $86A3;     
+  { HintMode  }
+     GL_DONT_CARE = $1100;     
+     GL_FASTEST = $1101;     
+     GL_NICEST = $1102;     
+  { HintTarget  }
+     GL_PERSPECTIVE_CORRECTION_HINT = $0C50;     
+     GL_POINT_SMOOTH_HINT = $0C51;     
+     GL_LINE_SMOOTH_HINT = $0C52;     
+     GL_FOG_HINT = $0C54;     
+     GL_GENERATE_MIPMAP_HINT = $8192;     
+  { LightModelParameter  }
+     GL_LIGHT_MODEL_AMBIENT = $0B53;     
+     GL_LIGHT_MODEL_TWO_SIDE = $0B52;     
+  { LightParameter  }
+     GL_AMBIENT = $1200;     
+     GL_DIFFUSE = $1201;     
+     GL_SPECULAR = $1202;     
+     GL_POSITION = $1203;     
+     GL_SPOT_DIRECTION = $1204;     
+     GL_SPOT_EXPONENT = $1205;     
+     GL_SPOT_CUTOFF = $1206;     
+     GL_CONSTANT_ATTENUATION = $1207;     
+     GL_LINEAR_ATTENUATION = $1208;     
+     GL_QUADRATIC_ATTENUATION = $1209;     
+  { DataType  }
+     GL_BYTE = $1400;     
+     GL_UNSIGNED_BYTE = $1401;     
+     GL_SHORT = $1402;     
+     GL_UNSIGNED_SHORT = $1403;     
+     GL_FLOAT = $1406;     
+     GL_FIXED = $140C;     
+  { LogicOp  }
+     GL_CLEAR = $1500;     
+     GL_AND = $1501;     
+     GL_AND_REVERSE = $1502;     
+     GL_COPY = $1503;     
+     GL_AND_INVERTED = $1504;     
+     GL_NOOP = $1505;     
+     GL_XOR = $1506;     
+     GL_OR = $1507;     
+     GL_NOR = $1508;     
+     GL_EQUIV = $1509;     
+     GL_INVERT = $150A;     
+     GL_OR_REVERSE = $150B;     
+     GL_COPY_INVERTED = $150C;     
+     GL_OR_INVERTED = $150D;     
+     GL_NAND = $150E;     
+     GL_SET = $150F;     
+  { MaterialFace  }
+  {      GL_FRONT_AND_BACK  }
+  { MaterialParameter  }
+     GL_EMISSION = $1600;     
+     GL_SHININESS = $1601;     
+     GL_AMBIENT_AND_DIFFUSE = $1602;     
+  {      GL_AMBIENT  }
+  {      GL_DIFFUSE  }
+  {      GL_SPECULAR  }
+  { MatrixMode  }
+     GL_MODELVIEW = $1700;     
+     GL_PROJECTION = $1701;     
+     GL_TEXTURE = $1702;     
+  { NormalPointerType  }
+  {      GL_BYTE  }
+  {      GL_SHORT  }
+  {      GL_FLOAT  }
+  {      GL_FIXED  }
+  { PixelFormat  }
+     GL_ALPHA = $1906;     
+     GL_RGB = $1907;     
+     GL_RGBA = $1908;     
+     GL_LUMINANCE = $1909;     
+     GL_LUMINANCE_ALPHA = $190A;     
+  { PixelStoreParameter  }
+//     GL_UNPACK_ALIGNMENT = $0CF5;     
+//     GL_PACK_ALIGNMENT = $0D05;     
+  { PixelType  }
+  {      GL_UNSIGNED_BYTE  }
+     GL_UNSIGNED_SHORT_4_4_4_4 = $8033;     
+     GL_UNSIGNED_SHORT_5_5_5_1 = $8034;     
+     GL_UNSIGNED_SHORT_5_6_5 = $8363;     
+  { ShadingModel  }
+     GL_FLAT = $1D00;     
+     GL_SMOOTH = $1D01;     
+  { StencilFunction  }
+  {      GL_NEVER  }
+  {      GL_LESS  }
+  {      GL_EQUAL  }
+  {      GL_LEQUAL  }
+  {      GL_GREATER  }
+  {      GL_NOTEQUAL  }
+  {      GL_GEQUAL  }
+  {      GL_ALWAYS  }
+  { StencilOp  }
+  {      GL_ZERO  }
+     GL_KEEP = $1E00;     
+     GL_REPLACE = $1E01;     
+     GL_INCR = $1E02;     
+     GL_DECR = $1E03;     
+  {      GL_INVERT  }
+  { StringName  }
+     GL_VENDOR = $1F00;     
+     GL_RENDERER = $1F01;     
+     GL_VERSION = $1F02;     
+     GL_EXTENSIONS = $1F03;     
+  { TexCoordPointerType  }
+  {      GL_SHORT  }
+  {      GL_FLOAT  }
+  {      GL_FIXED  }
+  {      GL_BYTE  }
+  { TextureEnvMode  }
+     GL_MODULATE = $2100;     
+     GL_DECAL = $2101;     
+  {      GL_BLEND  }
+     GL_ADD = $0104;     
+  {      GL_REPLACE  }
+  { TextureEnvParameter  }
+     GL_TEXTURE_ENV_MODE = $2200;     
+     GL_TEXTURE_ENV_COLOR = $2201;     
+  { TextureEnvTarget  }
+     GL_TEXTURE_ENV = $2300;     
+  { TextureMagFilter  }
+     GL_NEAREST = $2600;     
+     GL_LINEAR = $2601;     
+  { TextureMinFilter  }
+  {      GL_NEAREST  }
+  {      GL_LINEAR  }
+     GL_NEAREST_MIPMAP_NEAREST = $2700;     
+     GL_LINEAR_MIPMAP_NEAREST = $2701;     
+     GL_NEAREST_MIPMAP_LINEAR = $2702;     
+     GL_LINEAR_MIPMAP_LINEAR = $2703;     
+  { TextureParameterName  }
+     GL_TEXTURE_MAG_FILTER = $2800;     
+     GL_TEXTURE_MIN_FILTER = $2801;     
+     GL_TEXTURE_WRAP_S = $2802;     
+     GL_TEXTURE_WRAP_T = $2803;     
+     GL_GENERATE_MIPMAP = $8191;     
+  { TextureTarget  }
+  {      GL_TEXTURE_2D  }
+  { TextureUnit  }
+     GL_TEXTURE0 = $84C0;     
+     GL_TEXTURE1 = $84C1;     
+     GL_TEXTURE2 = $84C2;     
+     GL_TEXTURE3 = $84C3;     
+     GL_TEXTURE4 = $84C4;     
+     GL_TEXTURE5 = $84C5;     
+     GL_TEXTURE6 = $84C6;     
+     GL_TEXTURE7 = $84C7;     
+     GL_TEXTURE8 = $84C8;     
+     GL_TEXTURE9 = $84C9;     
+     GL_TEXTURE10 = $84CA;     
+     GL_TEXTURE11 = $84CB;     
+     GL_TEXTURE12 = $84CC;     
+     GL_TEXTURE13 = $84CD;     
+     GL_TEXTURE14 = $84CE;     
+     GL_TEXTURE15 = $84CF;     
+     GL_TEXTURE16 = $84D0;     
+     GL_TEXTURE17 = $84D1;     
+     GL_TEXTURE18 = $84D2;     
+     GL_TEXTURE19 = $84D3;     
+     GL_TEXTURE20 = $84D4;     
+     GL_TEXTURE21 = $84D5;     
+     GL_TEXTURE22 = $84D6;     
+     GL_TEXTURE23 = $84D7;     
+     GL_TEXTURE24 = $84D8;     
+     GL_TEXTURE25 = $84D9;     
+     GL_TEXTURE26 = $84DA;     
+     GL_TEXTURE27 = $84DB;     
+     GL_TEXTURE28 = $84DC;     
+     GL_TEXTURE29 = $84DD;     
+     GL_TEXTURE30 = $84DE;     
+     GL_TEXTURE31 = $84DF;     
+     GL_ACTIVE_TEXTURE = $84E0;     
+     GL_CLIENT_ACTIVE_TEXTURE = $84E1;     
+  { TextureWrapMode  }
+     GL_REPEAT = $2901;     
+     GL_CLAMP_TO_EDGE = $812F;     
+  { VertexPointerType  }
+  {      GL_SHORT  }
+  {      GL_FLOAT  }
+  {      GL_FIXED  }
+  {      GL_BYTE  }
+  { LightName  }
+     GL_LIGHT0 = $4000;     
+     GL_LIGHT1 = $4001;     
+     GL_LIGHT2 = $4002;     
+     GL_LIGHT3 = $4003;     
+     GL_LIGHT4 = $4004;     
+     GL_LIGHT5 = $4005;     
+     GL_LIGHT6 = $4006;     
+     GL_LIGHT7 = $4007;     
+  { Buffer Objects  }
+     GL_ARRAY_BUFFER = $8892;     
+     GL_ELEMENT_ARRAY_BUFFER = $8893;     
+     GL_ARRAY_BUFFER_BINDING = $8894;     
+     GL_ELEMENT_ARRAY_BUFFER_BINDING = $8895;     
+     GL_VERTEX_ARRAY_BUFFER_BINDING = $8896;     
+     GL_NORMAL_ARRAY_BUFFER_BINDING = $8897;     
+     GL_COLOR_ARRAY_BUFFER_BINDING = $8898;     
+     GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = $889A;     
+     GL_STATIC_DRAW = $88E4;     
+     GL_DYNAMIC_DRAW = $88E8;     
+     GL_BUFFER_SIZE = $8764;     
+     GL_BUFFER_USAGE = $8765;     
+  { Texture combine + dot3  }
+     GL_SUBTRACT = $84E7;     
+     GL_COMBINE = $8570;     
+     GL_COMBINE_RGB = $8571;     
+     GL_COMBINE_ALPHA = $8572;     
+     GL_RGB_SCALE = $8573;     
+     GL_ADD_SIGNED = $8574;     
+     GL_INTERPOLATE = $8575;     
+     GL_CONSTANT = $8576;     
+     GL_PRIMARY_COLOR = $8577;     
+     GL_PREVIOUS = $8578;     
+     GL_OPERAND0_RGB = $8590;     
+     GL_OPERAND1_RGB = $8591;     
+     GL_OPERAND2_RGB = $8592;     
+     GL_OPERAND0_ALPHA = $8598;     
+     GL_OPERAND1_ALPHA = $8599;     
+     GL_OPERAND2_ALPHA = $859A;     
+     GL_ALPHA_SCALE = $0D1C;     
+     GL_SRC0_RGB = $8580;     
+     GL_SRC1_RGB = $8581;     
+     GL_SRC2_RGB = $8582;     
+     GL_SRC0_ALPHA = $8588;     
+     GL_SRC1_ALPHA = $8589;     
+     GL_SRC2_ALPHA = $858A;     
+     GL_DOT3_RGB = $86AE;     
+     GL_DOT3_RGBA = $86AF;     
+  {------------------------------------------------------------------------*
+   * required OES extension tokens
+   *------------------------------------------------------------------------ }
+  { OES_read_format  }
+     GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = $8B9A;     
+     GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = $8B9B;     
+  { GL_OES_compressed_paletted_texture  }
+     GL_PALETTE4_RGB8_OES = $8B90;     
+     GL_PALETTE4_RGBA8_OES = $8B91;     
+     GL_PALETTE4_R5_G6_B5_OES = $8B92;     
+     GL_PALETTE4_RGBA4_OES = $8B93;     
+     GL_PALETTE4_RGB5_A1_OES = $8B94;     
+     GL_PALETTE8_RGB8_OES = $8B95;     
+     GL_PALETTE8_RGBA8_OES = $8B96;     
+     GL_PALETTE8_R5_G6_B5_OES = $8B97;     
+     GL_PALETTE8_RGBA4_OES = $8B98;     
+     GL_PALETTE8_RGB5_A1_OES = $8B99;     
+  { OES_point_size_array  }
+     GL_POINT_SIZE_ARRAY_OES = $8B9C;     
+     GL_POINT_SIZE_ARRAY_TYPE_OES = $898A;     
+     GL_POINT_SIZE_ARRAY_STRIDE_OES = $898B;     
+     GL_POINT_SIZE_ARRAY_POINTER_OES = $898C;     
+     GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES = $8B9F;     
+  { GL_OES_point_sprite  }
+     GL_POINT_SPRITE_OES = $8861;     
+     GL_COORD_REPLACE_OES = $8862;     
+  {*********************************************************** }
+  { Available only in Common profile  }
+
+  var
+    glAlphaFunc : procedure(func:GLenum; ref:GLclampf);cdecl;
+    glClearColor : procedure(red:GLclampf; green:GLclampf; blue:GLclampf; alpha:GLclampf);cdecl;
+    glClearDepthf : procedure(depth:GLclampf);cdecl;
+(* Const before type ignored *)
+    glClipPlanef : procedure(plane:GLenum; equation:pGLfloat);cdecl;
+    glColor4f : procedure(red:GLfloat; green:GLfloat; blue:GLfloat; alpha:GLfloat);cdecl;
+    glDepthRangef : procedure(zNear:GLclampf; zFar:GLclampf);cdecl;
+    glFogf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glFogfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+    glFrustumf : procedure(left:GLfloat; right:GLfloat; bottom:GLfloat; top:GLfloat; zNear:GLfloat; 
+      zFar:GLfloat);cdecl;
+    glGetClipPlanef : procedure(pname:GLenum; eqn:array of GLfloat);cdecl;
+    glGetFloatv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+    glGetLightfv : procedure(light:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glGetMaterialfv : procedure(face:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glGetTexEnvfv : procedure(env:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glGetTexParameterfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glLightModelf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glLightModelfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+    glLightf : procedure(light:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glLightfv : procedure(light:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glLineWidth : procedure(width:GLfloat);cdecl;
+(* Const before type ignored *)
+    glLoadMatrixf : procedure(m:pGLfloat);cdecl;
+    glMaterialf : procedure(face:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glMaterialfv : procedure(face:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+(* Const before type ignored *)
+    glMultMatrixf : procedure(m:pGLfloat);cdecl;
+    glMultiTexCoord4f : procedure(target:GLenum; s:GLfloat; t:GLfloat; r:GLfloat; q:GLfloat);cdecl;
+    glNormal3f : procedure(nx:GLfloat; ny:GLfloat; nz:GLfloat);cdecl;
+    glOrthof : procedure(left:GLfloat; right:GLfloat; bottom:GLfloat; top:GLfloat; zNear:GLfloat; 
+      zFar:GLfloat);cdecl;
+    glPointParameterf : procedure(pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glPointParameterfv : procedure(pname:GLenum; params:pGLfloat);cdecl;
+    glPointSize : procedure(size:GLfloat);cdecl;
+    glPolygonOffset : procedure(factor:GLfloat; units:GLfloat);cdecl;
+    glRotatef : procedure(angle:GLfloat; x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+    glScalef : procedure(x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+    glTexEnvf : procedure(target:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glTexEnvfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glTexParameterf : procedure(target:GLenum; pname:GLenum; param:GLfloat);cdecl;
+(* Const before type ignored *)
+    glTexParameterfv : procedure(target:GLenum; pname:GLenum; params:pGLfloat);cdecl;
+    glTranslatef : procedure(x:GLfloat; y:GLfloat; z:GLfloat);cdecl;
+  { Available in both Common and Common-Lite profiles  }
+    glActiveTexture : procedure(texture:GLenum);cdecl;
+    glAlphaFuncx : procedure(func:GLenum; ref:GLclampx);cdecl;
+    glBindBuffer : procedure(target:GLenum; buffer:GLuint);cdecl;
+    glBindTexture : procedure(target:GLenum; texture:GLuint);cdecl;
+    glBlendFunc : procedure(sfactor:GLenum; dfactor:GLenum);cdecl;
+(* Const before type ignored *)
+    glBufferData : procedure(target:GLenum; size:GLsizeiptr; data:pGLvoid; usage:GLenum);cdecl;
+(* Const before type ignored *)
+    glBufferSubData : procedure(target:GLenum; offset:GLintptr; size:GLsizeiptr; data:pGLvoid);cdecl;
+    glClear : procedure(mask:GLbitfield);cdecl;
+    glClearColorx : procedure(red:GLclampx; green:GLclampx; blue:GLclampx; alpha:GLclampx);cdecl;
+    glClearDepthx : procedure(depth:GLclampx);cdecl;
+    glClearStencil : procedure(s:GLint);cdecl;
+    glClientActiveTexture : procedure(texture:GLenum);cdecl;
+(* Const before type ignored *)
+    glClipPlanex : procedure(plane:GLenum; equation:pGLfixed);cdecl;
+    glColor4ub : procedure(red:GLubyte; green:GLubyte; blue:GLubyte; alpha:GLubyte);cdecl;
+    glColor4x : procedure(red:GLfixed; green:GLfixed; blue:GLfixed; alpha:GLfixed);cdecl;
+    glColorMask : procedure(red:GLboolean; green:GLboolean; blue:GLboolean; alpha:GLboolean);cdecl;
+(* Const before type ignored *)
+    glColorPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+(* Const before type ignored *)
+    glCompressedTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLenum; width:GLsizei; height:GLsizei; 
+      border:GLint; imageSize:GLsizei; data:pGLvoid);cdecl;
+(* Const before type ignored *)
+    glCompressedTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; width:GLsizei; 
+      height:GLsizei; format:GLenum; imageSize:GLsizei; data:pGLvoid);cdecl;
+    glCopyTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLenum; x:GLint; y:GLint; 
+      width:GLsizei; height:GLsizei; border:GLint);cdecl;
+    glCopyTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; x:GLint; 
+      y:GLint; width:GLsizei; height:GLsizei);cdecl;
+    glCullFace : procedure(mode:GLenum);cdecl;
+(* Const before type ignored *)
+    glDeleteBuffers : procedure(n:GLsizei; buffers:pGLuint);cdecl;
+(* Const before type ignored *)
+    glDeleteTextures : procedure(n:GLsizei; textures:pGLuint);cdecl;
+    glDepthFunc : procedure(func:GLenum);cdecl;
+    glDepthMask : procedure(flag:GLboolean);cdecl;
+    glDepthRangex : procedure(zNear:GLclampx; zFar:GLclampx);cdecl;
+    glDisable : procedure(cap:GLenum);cdecl;
+    glDisableClientState : procedure(arry:GLenum);cdecl;
+    glDrawArrays : procedure(mode:GLenum; first:GLint; count:GLsizei);cdecl;
+(* Const before type ignored *)
+    glDrawElements : procedure(mode:GLenum; count:GLsizei; _type:GLenum; indices:pGLvoid);cdecl;
+    glEnable : procedure(cap:GLenum);cdecl;
+    glEnableClientState : procedure(arry:GLenum);cdecl;
+    glFinish : procedure;cdecl;
+    glFlush : procedure;cdecl;
+    glFogx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glFogxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+    glFrontFace : procedure(mode:GLenum);cdecl;
+    glFrustumx : procedure(left:GLfixed; right:GLfixed; bottom:GLfixed; top:GLfixed; zNear:GLfixed; 
+      zFar:GLfixed);cdecl;
+    glGetBooleanv : procedure(pname:GLenum; params:pGLboolean);cdecl;
+    glGetBufferParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+    glGetClipPlanex : procedure(pname:GLenum; eqn:array of GLfixed);cdecl;
+    glGenBuffers : procedure(n:GLsizei; buffers:pGLuint);cdecl;
+    glGenTextures : procedure(n:GLsizei; textures:pGLuint);cdecl;
+    glGetError : function:GLenum;cdecl;
+    glGetFixedv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+    glGetIntegerv : procedure(pname:GLenum; params:pGLint);cdecl;
+    glGetLightxv : procedure(light:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glGetMaterialxv : procedure(face:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glGetPointerv : procedure(pname:GLenum; params:Ppointer);cdecl;
+(* Const before type ignored *)
+    glGetString : function(name:GLenum):PGLubyte;cdecl;
+    glGetTexEnviv : procedure(env:GLenum; pname:GLenum; params:pGLint);cdecl;
+    glGetTexEnvxv : procedure(env:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glGetTexParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+    glGetTexParameterxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glHint : procedure(target:GLenum; mode:GLenum);cdecl;
+    glIsBuffer : function(buffer:GLuint):GLboolean;cdecl;
+    glIsEnabled : function(cap:GLenum):GLboolean;cdecl;
+    glIsTexture : function(texture:GLuint):GLboolean;cdecl;
+    glLightModelx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glLightModelxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+    glLightx : procedure(light:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glLightxv : procedure(light:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glLineWidthx : procedure(width:GLfixed);cdecl;
+    glLoadIdentity : procedure;cdecl;
+(* Const before type ignored *)
+    glLoadMatrixx : procedure(m:pGLfixed);cdecl;
+    glLogicOp : procedure(opcode:GLenum);cdecl;
+    glMaterialx : procedure(face:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glMaterialxv : procedure(face:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+    glMatrixMode : procedure(mode:GLenum);cdecl;
+(* Const before type ignored *)
+    glMultMatrixx : procedure(m:pGLfixed);cdecl;
+    glMultiTexCoord4x : procedure(target:GLenum; s:GLfixed; t:GLfixed; r:GLfixed; q:GLfixed);cdecl;
+    glNormal3x : procedure(nx:GLfixed; ny:GLfixed; nz:GLfixed);cdecl;
+(* Const before type ignored *)
+    glNormalPointer : procedure(_type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+    glOrthox : procedure(left:GLfixed; right:GLfixed; bottom:GLfixed; top:GLfixed; zNear:GLfixed; 
+      zFar:GLfixed);cdecl;
+    glPixelStorei : procedure(pname:GLenum; param:GLint);cdecl;
+    glPointParameterx : procedure(pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glPointParameterxv : procedure(pname:GLenum; params:pGLfixed);cdecl;
+    glPointSizex : procedure(size:GLfixed);cdecl;
+    glPolygonOffsetx : procedure(factor:GLfixed; units:GLfixed);cdecl;
+    glPopMatrix : procedure;cdecl;
+    glPushMatrix : procedure;cdecl;
+    glReadPixels : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei; format:GLenum; 
+      _type:GLenum; pixels:pGLvoid);cdecl;
+    glRotatex : procedure(angle:GLfixed; x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+    glSampleCoverage : procedure(value:GLclampf; invert:GLboolean);cdecl;
+    glSampleCoveragex : procedure(value:GLclampx; invert:GLboolean);cdecl;
+    glScalex : procedure(x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+    glScissor : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei);cdecl;
+    glShadeModel : procedure(mode:GLenum);cdecl;
+    glStencilFunc : procedure(func:GLenum; ref:GLint; mask:GLuint);cdecl;
+    glStencilMask : procedure(mask:GLuint);cdecl;
+    glStencilOp : procedure(fail:GLenum; zfail:GLenum; zpass:GLenum);cdecl;
+(* Const before type ignored *)
+    glTexCoordPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+    glTexEnvi : procedure(target:GLenum; pname:GLenum; param:GLint);cdecl;
+    glTexEnvx : procedure(target:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glTexEnviv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+(* Const before type ignored *)
+    glTexEnvxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+(* Const before type ignored *)
+    glTexImage2D : procedure(target:GLenum; level:GLint; internalformat:GLint; width:GLsizei; height:GLsizei; 
+      border:GLint; format:GLenum; _type:GLenum; pixels:pGLvoid);cdecl;
+    glTexParameteri : procedure(target:GLenum; pname:GLenum; param:GLint);cdecl;
+    glTexParameterx : procedure(target:GLenum; pname:GLenum; param:GLfixed);cdecl;
+(* Const before type ignored *)
+    glTexParameteriv : procedure(target:GLenum; pname:GLenum; params:pGLint);cdecl;
+(* Const before type ignored *)
+    glTexParameterxv : procedure(target:GLenum; pname:GLenum; params:pGLfixed);cdecl;
+(* Const before type ignored *)
+    glTexSubImage2D : procedure(target:GLenum; level:GLint; xoffset:GLint; yoffset:GLint; width:GLsizei; 
+      height:GLsizei; format:GLenum; _type:GLenum; pixels:pGLvoid);cdecl;
+    glTranslatex : procedure(x:GLfixed; y:GLfixed; z:GLfixed);cdecl;
+(* Const before type ignored *)
+    glVertexPointer : procedure(size:GLint; _type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+    glViewport : procedure(x:GLint; y:GLint; width:GLsizei; height:GLsizei);cdecl;
+  {------------------------------------------------------------------------*
+   * Required OES extension functions
+   *------------------------------------------------------------------------ }
+  { GL_OES_read_format  }
+
+  const
+     GL_OES_read_format = 1;     
+  { GL_OES_compressed_paletted_texture  }
+     GL_OES_compressed_paletted_texture = 1;     
+  { GL_OES_point_size_array  }
+     GL_OES_point_size_array = 1;     
+(* Const before type ignored *)
+
+  var
+    glPointSizePointerOES : procedure(_type:GLenum; stride:GLsizei; pointer:pGLvoid);cdecl;
+  { GL_OES_point_sprite  }
+
+  const
+     GL_OES_point_sprite = 1;     
+
+implementation
+
+  uses
+    SysUtils, dynlibs;
+
+  var
+    hlib : tlibhandle;
+
+
+  procedure Freegles11;
+    begin
+//      FreeLibrary(hlib);
+      glAlphaFunc:=nil;
+      glClearColor:=nil;
+      glClearDepthf:=nil;
+      glClipPlanef:=nil;
+      glColor4f:=nil;
+      glDepthRangef:=nil;
+      glFogf:=nil;
+      glFogfv:=nil;
+      glFrustumf:=nil;
+      glGetClipPlanef:=nil;
+      glGetFloatv:=nil;
+      glGetLightfv:=nil;
+      glGetMaterialfv:=nil;
+      glGetTexEnvfv:=nil;
+      glGetTexParameterfv:=nil;
+      glLightModelf:=nil;
+      glLightModelfv:=nil;
+      glLightf:=nil;
+      glLightfv:=nil;
+      glLineWidth:=nil;
+      glLoadMatrixf:=nil;
+      glMaterialf:=nil;
+      glMaterialfv:=nil;
+      glMultMatrixf:=nil;
+      glMultiTexCoord4f:=nil;
+      glNormal3f:=nil;
+      glOrthof:=nil;
+      glPointParameterf:=nil;
+      glPointParameterfv:=nil;
+      glPointSize:=nil;
+      glPolygonOffset:=nil;
+      glRotatef:=nil;
+      glScalef:=nil;
+      glTexEnvf:=nil;
+      glTexEnvfv:=nil;
+      glTexParameterf:=nil;
+      glTexParameterfv:=nil;
+      glTranslatef:=nil;
+      glActiveTexture:=nil;
+      glAlphaFuncx:=nil;
+      glBindBuffer:=nil;
+      glBindTexture:=nil;
+      glBlendFunc:=nil;
+      glBufferData:=nil;
+      glBufferSubData:=nil;
+      glClear:=nil;
+      glClearColorx:=nil;
+      glClearDepthx:=nil;
+      glClearStencil:=nil;
+      glClientActiveTexture:=nil;
+      glClipPlanex:=nil;
+      glColor4ub:=nil;
+      glColor4x:=nil;
+      glColorMask:=nil;
+      glColorPointer:=nil;
+      glCompressedTexImage2D:=nil;
+      glCompressedTexSubImage2D:=nil;
+      glCopyTexImage2D:=nil;
+      glCopyTexSubImage2D:=nil;
+      glCullFace:=nil;
+      glDeleteBuffers:=nil;
+      glDeleteTextures:=nil;
+      glDepthFunc:=nil;
+      glDepthMask:=nil;
+      glDepthRangex:=nil;
+      glDisable:=nil;
+      glDisableClientState:=nil;
+      glDrawArrays:=nil;
+      glDrawElements:=nil;
+      glEnable:=nil;
+      glEnableClientState:=nil;
+      glFinish:=nil;
+      glFlush:=nil;
+      glFogx:=nil;
+      glFogxv:=nil;
+      glFrontFace:=nil;
+      glFrustumx:=nil;
+      glGetBooleanv:=nil;
+      glGetBufferParameteriv:=nil;
+      glGetClipPlanex:=nil;
+      glGenBuffers:=nil;
+      glGenTextures:=nil;
+      glGetError:=nil;
+      glGetFixedv:=nil;
+      glGetIntegerv:=nil;
+      glGetLightxv:=nil;
+      glGetMaterialxv:=nil;
+      glGetPointerv:=nil;
+      glGetString:=nil;
+      glGetTexEnviv:=nil;
+      glGetTexEnvxv:=nil;
+      glGetTexParameteriv:=nil;
+      glGetTexParameterxv:=nil;
+      glHint:=nil;
+      glIsBuffer:=nil;
+      glIsEnabled:=nil;
+      glIsTexture:=nil;
+      glLightModelx:=nil;
+      glLightModelxv:=nil;
+      glLightx:=nil;
+      glLightxv:=nil;
+      glLineWidthx:=nil;
+      glLoadIdentity:=nil;
+      glLoadMatrixx:=nil;
+      glLogicOp:=nil;
+      glMaterialx:=nil;
+      glMaterialxv:=nil;
+      glMatrixMode:=nil;
+      glMultMatrixx:=nil;
+      glMultiTexCoord4x:=nil;
+      glNormal3x:=nil;
+      glNormalPointer:=nil;
+      glOrthox:=nil;
+      glPixelStorei:=nil;
+      glPointParameterx:=nil;
+      glPointParameterxv:=nil;
+      glPointSizex:=nil;
+      glPolygonOffsetx:=nil;
+      glPopMatrix:=nil;
+      glPushMatrix:=nil;
+      glReadPixels:=nil;
+      glRotatex:=nil;
+      glSampleCoverage:=nil;
+      glSampleCoveragex:=nil;
+      glScalex:=nil;
+      glScissor:=nil;
+      glShadeModel:=nil;
+      glStencilFunc:=nil;
+      glStencilMask:=nil;
+      glStencilOp:=nil;
+      glTexCoordPointer:=nil;
+      glTexEnvi:=nil;
+      glTexEnvx:=nil;
+      glTexEnviv:=nil;
+      glTexEnvxv:=nil;
+      glTexImage2D:=nil;
+      glTexParameteri:=nil;
+      glTexParameterx:=nil;
+      glTexParameteriv:=nil;
+      glTexParameterxv:=nil;
+      glTexSubImage2D:=nil;
+      glTranslatex:=nil;
+      glVertexPointer:=nil;
+      glViewport:=nil;
+      glPointSizePointerOES:=nil;
+    end;
+
+
+  procedure Loadgles11(lib : pchar);
+    begin
+      Freegles11;
+      hlib:=LoadLibrary(lib);
+      if hlib=0 then
+	begin
+         raise Exception.Create(format('Could not load library: %s',[lib]));
+	end;
+      pointer(glAlphaFunc):=GetProcAddress(hlib,'glAlphaFunc');
+      pointer(glClearColor):=GetProcAddress(hlib,'glClearColor');
+      pointer(glClearDepthf):=GetProcAddress(hlib,'glClearDepthf');
+      pointer(glClipPlanef):=GetProcAddress(hlib,'glClipPlanef');
+      pointer(glColor4f):=GetProcAddress(hlib,'glColor4f');
+      pointer(glDepthRangef):=GetProcAddress(hlib,'glDepthRangef');
+      pointer(glFogf):=GetProcAddress(hlib,'glFogf');
+      pointer(glFogfv):=GetProcAddress(hlib,'glFogfv');
+      pointer(glFrustumf):=GetProcAddress(hlib,'glFrustumf');
+      pointer(glGetClipPlanef):=GetProcAddress(hlib,'glGetClipPlanef');
+      pointer(glGetFloatv):=GetProcAddress(hlib,'glGetFloatv');
+      pointer(glGetLightfv):=GetProcAddress(hlib,'glGetLightfv');
+      pointer(glGetMaterialfv):=GetProcAddress(hlib,'glGetMaterialfv');
+      pointer(glGetTexEnvfv):=GetProcAddress(hlib,'glGetTexEnvfv');
+      pointer(glGetTexParameterfv):=GetProcAddress(hlib,'glGetTexParameterfv');
+      pointer(glLightModelf):=GetProcAddress(hlib,'glLightModelf');
+      pointer(glLightModelfv):=GetProcAddress(hlib,'glLightModelfv');
+      pointer(glLightf):=GetProcAddress(hlib,'glLightf');
+      pointer(glLightfv):=GetProcAddress(hlib,'glLightfv');
+      pointer(glLineWidth):=GetProcAddress(hlib,'glLineWidth');
+      pointer(glLoadMatrixf):=GetProcAddress(hlib,'glLoadMatrixf');
+      pointer(glMaterialf):=GetProcAddress(hlib,'glMaterialf');
+      pointer(glMaterialfv):=GetProcAddress(hlib,'glMaterialfv');
+      pointer(glMultMatrixf):=GetProcAddress(hlib,'glMultMatrixf');
+      pointer(glMultiTexCoord4f):=GetProcAddress(hlib,'glMultiTexCoord4f');
+      pointer(glNormal3f):=GetProcAddress(hlib,'glNormal3f');
+      pointer(glOrthof):=GetProcAddress(hlib,'glOrthof');
+      pointer(glPointParameterf):=GetProcAddress(hlib,'glPointParameterf');
+      pointer(glPointParameterfv):=GetProcAddress(hlib,'glPointParameterfv');
+      pointer(glPointSize):=GetProcAddress(hlib,'glPointSize');
+      pointer(glPolygonOffset):=GetProcAddress(hlib,'glPolygonOffset');
+      pointer(glRotatef):=GetProcAddress(hlib,'glRotatef');
+      pointer(glScalef):=GetProcAddress(hlib,'glScalef');
+      pointer(glTexEnvf):=GetProcAddress(hlib,'glTexEnvf');
+      pointer(glTexEnvfv):=GetProcAddress(hlib,'glTexEnvfv');
+      pointer(glTexParameterf):=GetProcAddress(hlib,'glTexParameterf');
+      pointer(glTexParameterfv):=GetProcAddress(hlib,'glTexParameterfv');
+      pointer(glTranslatef):=GetProcAddress(hlib,'glTranslatef');
+      pointer(glActiveTexture):=GetProcAddress(hlib,'glActiveTexture');
+      pointer(glAlphaFuncx):=GetProcAddress(hlib,'glAlphaFuncx');
+      pointer(glBindBuffer):=GetProcAddress(hlib,'glBindBuffer');
+      pointer(glBindTexture):=GetProcAddress(hlib,'glBindTexture');
+      pointer(glBlendFunc):=GetProcAddress(hlib,'glBlendFunc');
+      pointer(glBufferData):=GetProcAddress(hlib,'glBufferData');
+      pointer(glBufferSubData):=GetProcAddress(hlib,'glBufferSubData');
+      pointer(glClear):=GetProcAddress(hlib,'glClear');
+      pointer(glClearColorx):=GetProcAddress(hlib,'glClearColorx');
+      pointer(glClearDepthx):=GetProcAddress(hlib,'glClearDepthx');
+      pointer(glClearStencil):=GetProcAddress(hlib,'glClearStencil');
+      pointer(glClientActiveTexture):=GetProcAddress(hlib,'glClientActiveTexture');
+      pointer(glClipPlanex):=GetProcAddress(hlib,'glClipPlanex');
+      pointer(glColor4ub):=GetProcAddress(hlib,'glColor4ub');
+      pointer(glColor4x):=GetProcAddress(hlib,'glColor4x');
+      pointer(glColorMask):=GetProcAddress(hlib,'glColorMask');
+      pointer(glColorPointer):=GetProcAddress(hlib,'glColorPointer');
+      pointer(glCompressedTexImage2D):=GetProcAddress(hlib,'glCompressedTexImage2D');
+      pointer(glCompressedTexSubImage2D):=GetProcAddress(hlib,'glCompressedTexSubImage2D');
+      pointer(glCopyTexImage2D):=GetProcAddress(hlib,'glCopyTexImage2D');
+      pointer(glCopyTexSubImage2D):=GetProcAddress(hlib,'glCopyTexSubImage2D');
+      pointer(glCullFace):=GetProcAddress(hlib,'glCullFace');
+      pointer(glDeleteBuffers):=GetProcAddress(hlib,'glDeleteBuffers');
+      pointer(glDeleteTextures):=GetProcAddress(hlib,'glDeleteTextures');
+      pointer(glDepthFunc):=GetProcAddress(hlib,'glDepthFunc');
+      pointer(glDepthMask):=GetProcAddress(hlib,'glDepthMask');
+      pointer(glDepthRangex):=GetProcAddress(hlib,'glDepthRangex');
+      pointer(glDisable):=GetProcAddress(hlib,'glDisable');
+      pointer(glDisableClientState):=GetProcAddress(hlib,'glDisableClientState');
+      pointer(glDrawArrays):=GetProcAddress(hlib,'glDrawArrays');
+      pointer(glDrawElements):=GetProcAddress(hlib,'glDrawElements');
+      pointer(glEnable):=GetProcAddress(hlib,'glEnable');
+      pointer(glEnableClientState):=GetProcAddress(hlib,'glEnableClientState');
+      pointer(glFinish):=GetProcAddress(hlib,'glFinish');
+      pointer(glFlush):=GetProcAddress(hlib,'glFlush');
+      pointer(glFogx):=GetProcAddress(hlib,'glFogx');
+      pointer(glFogxv):=GetProcAddress(hlib,'glFogxv');
+      pointer(glFrontFace):=GetProcAddress(hlib,'glFrontFace');
+      pointer(glFrustumx):=GetProcAddress(hlib,'glFrustumx');
+      pointer(glGetBooleanv):=GetProcAddress(hlib,'glGetBooleanv');
+      pointer(glGetBufferParameteriv):=GetProcAddress(hlib,'glGetBufferParameteriv');
+      pointer(glGetClipPlanex):=GetProcAddress(hlib,'glGetClipPlanex');
+      pointer(glGenBuffers):=GetProcAddress(hlib,'glGenBuffers');
+      pointer(glGenTextures):=GetProcAddress(hlib,'glGenTextures');
+      pointer(glGetError):=GetProcAddress(hlib,'glGetError');
+      pointer(glGetFixedv):=GetProcAddress(hlib,'glGetFixedv');
+      pointer(glGetIntegerv):=GetProcAddress(hlib,'glGetIntegerv');
+      pointer(glGetLightxv):=GetProcAddress(hlib,'glGetLightxv');
+      pointer(glGetMaterialxv):=GetProcAddress(hlib,'glGetMaterialxv');
+      pointer(glGetPointerv):=GetProcAddress(hlib,'glGetPointerv');
+      pointer(glGetString):=GetProcAddress(hlib,'glGetString');
+      pointer(glGetTexEnviv):=GetProcAddress(hlib,'glGetTexEnviv');
+      pointer(glGetTexEnvxv):=GetProcAddress(hlib,'glGetTexEnvxv');
+      pointer(glGetTexParameteriv):=GetProcAddress(hlib,'glGetTexParameteriv');
+      pointer(glGetTexParameterxv):=GetProcAddress(hlib,'glGetTexParameterxv');
+      pointer(glHint):=GetProcAddress(hlib,'glHint');
+      pointer(glIsBuffer):=GetProcAddress(hlib,'glIsBuffer');
+      pointer(glIsEnabled):=GetProcAddress(hlib,'glIsEnabled');
+      pointer(glIsTexture):=GetProcAddress(hlib,'glIsTexture');
+      pointer(glLightModelx):=GetProcAddress(hlib,'glLightModelx');
+      pointer(glLightModelxv):=GetProcAddress(hlib,'glLightModelxv');
+      pointer(glLightx):=GetProcAddress(hlib,'glLightx');
+      pointer(glLightxv):=GetProcAddress(hlib,'glLightxv');
+      pointer(glLineWidthx):=GetProcAddress(hlib,'glLineWidthx');
+      pointer(glLoadIdentity):=GetProcAddress(hlib,'glLoadIdentity');
+      pointer(glLoadMatrixx):=GetProcAddress(hlib,'glLoadMatrixx');
+      pointer(glLogicOp):=GetProcAddress(hlib,'glLogicOp');
+      pointer(glMaterialx):=GetProcAddress(hlib,'glMaterialx');
+      pointer(glMaterialxv):=GetProcAddress(hlib,'glMaterialxv');
+      pointer(glMatrixMode):=GetProcAddress(hlib,'glMatrixMode');
+      pointer(glMultMatrixx):=GetProcAddress(hlib,'glMultMatrixx');
+      pointer(glMultiTexCoord4x):=GetProcAddress(hlib,'glMultiTexCoord4x');
+      pointer(glNormal3x):=GetProcAddress(hlib,'glNormal3x');
+      pointer(glNormalPointer):=GetProcAddress(hlib,'glNormalPointer');
+      pointer(glOrthox):=GetProcAddress(hlib,'glOrthox');
+      pointer(glPixelStorei):=GetProcAddress(hlib,'glPixelStorei');
+      pointer(glPointParameterx):=GetProcAddress(hlib,'glPointParameterx');
+      pointer(glPointParameterxv):=GetProcAddress(hlib,'glPointParameterxv');
+      pointer(glPointSizex):=GetProcAddress(hlib,'glPointSizex');
+      pointer(glPolygonOffsetx):=GetProcAddress(hlib,'glPolygonOffsetx');
+      pointer(glPopMatrix):=GetProcAddress(hlib,'glPopMatrix');
+      pointer(glPushMatrix):=GetProcAddress(hlib,'glPushMatrix');
+      pointer(glReadPixels):=GetProcAddress(hlib,'glReadPixels');
+      pointer(glRotatex):=GetProcAddress(hlib,'glRotatex');
+      pointer(glSampleCoverage):=GetProcAddress(hlib,'glSampleCoverage');
+      pointer(glSampleCoveragex):=GetProcAddress(hlib,'glSampleCoveragex');
+      pointer(glScalex):=GetProcAddress(hlib,'glScalex');
+      pointer(glScissor):=GetProcAddress(hlib,'glScissor');
+      pointer(glShadeModel):=GetProcAddress(hlib,'glShadeModel');
+      pointer(glStencilFunc):=GetProcAddress(hlib,'glStencilFunc');
+      pointer(glStencilMask):=GetProcAddress(hlib,'glStencilMask');
+      pointer(glStencilOp):=GetProcAddress(hlib,'glStencilOp');
+      pointer(glTexCoordPointer):=GetProcAddress(hlib,'glTexCoordPointer');
+      pointer(glTexEnvi):=GetProcAddress(hlib,'glTexEnvi');
+      pointer(glTexEnvx):=GetProcAddress(hlib,'glTexEnvx');
+      pointer(glTexEnviv):=GetProcAddress(hlib,'glTexEnviv');
+      pointer(glTexEnvxv):=GetProcAddress(hlib,'glTexEnvxv');
+      pointer(glTexImage2D):=GetProcAddress(hlib,'glTexImage2D');
+      pointer(glTexParameteri):=GetProcAddress(hlib,'glTexParameteri');
+      pointer(glTexParameterx):=GetProcAddress(hlib,'glTexParameterx');
+      pointer(glTexParameteriv):=GetProcAddress(hlib,'glTexParameteriv');
+      pointer(glTexParameterxv):=GetProcAddress(hlib,'glTexParameterxv');
+      pointer(glTexSubImage2D):=GetProcAddress(hlib,'glTexSubImage2D');
+      pointer(glTranslatex):=GetProcAddress(hlib,'glTranslatex');
+      pointer(glVertexPointer):=GetProcAddress(hlib,'glVertexPointer');
+      pointer(glViewport):=GetProcAddress(hlib,'glViewport');
+      pointer(glPointSizePointerOES):=GetProcAddress(hlib,'glPointSizePointerOES');
+    end;
+
+procedure initModule;
+begin
+    Loadgles11('libGLESv1_CM.so');
+end;
+
+procedure freeModule;
+begin
+  Freegles11;
+end;
+
+end.
diff --git a/project_files/Android-build/jni.pas b/project_files/Android-build/jni.pas
new file mode 100644
index 0000000..6eb105b
--- /dev/null
+++ b/project_files/Android-build/jni.pas
@@ -0,0 +1,538 @@
+unit jni;
+{$ifdef fpc}
+ {$packrecords c}
+{$endif}
+
+interface
+
+(*
+ * Manifest constants.
+ *)
+const JNI_FALSE=0;
+      JNI_TRUE=1;
+
+      JNI_VERSION_1_1=$00010001;
+      JNI_VERSION_1_2=$00010002;
+      JNI_VERSION_1_4=$00010004;
+      JNI_VERSION_1_6=$00010006;
+
+      JNI_OK=0;         // no error
+      JNI_ERR=-1;       // generic error
+      JNI_EDETACHED=-2; // thread detached from the VM
+      JNI_EVERSION=-3;  // JNI version error
+
+      JNI_COMMIT=1;     // copy content, do not free buffer
+      JNI_ABORT=2;      // free buffer w/o copying back
+
+(*
+ * Type definitions.
+ *)
+type va_list=pointer;
+
+     jboolean=byte;        // unsigned 8 bits
+     jbyte=shortint;       // signed 8 bits
+     jchar=word;           // unsigned 16 bits
+     jshort=smallint;      // signed 16 bits
+     jint=longint;         // signed 32 bits
+     jlong=int64;          // signed 64 bits
+     jfloat=single;        // 32-bit IEEE 754
+     jdouble=double;       // 64-bit IEEE 754
+
+     jsize=jint;            // "cardinal indices and sizes"
+
+     Pjboolean=^jboolean;
+     Pjbyte=^jbyte;
+     Pjchar=^jchar;
+     Pjshort=^jshort;
+     Pjint=^jint;
+     Pjlong=^jlong;
+     Pjfloat=^jfloat;
+     Pjdouble=^jdouble;
+
+     Pjsize=^jsize;
+
+     // Reference type
+     jobject=pointer;
+     jclass=jobject;
+     jstring=jobject;
+     jarray=jobject;
+     jobjectArray=jarray;
+     jbooleanArray=jarray;
+     jbyteArray=jarray;
+     jcharArray=jarray;
+     jshortArray=jarray;
+     jintArray=jarray;
+     jlongArray=jarray;
+     jfloatArray=jarray;
+     jdoubleArray=jarray;
+     jthrowable=jobject;
+     jweak=jobject;
+     jref=jobject;
+
+     //PPointer=^pointer;
+     Pjobject=^jobject;
+     Pjclass=^jclass;
+     Pjstring=^jstring;
+     Pjarray=^jarray;
+     PjobjectArray=^jobjectArray;
+     PjbooleanArray=^jbooleanArray;
+     PjbyteArray=^jbyteArray;
+     PjcharArray=^jcharArray;
+     PjshortArray=^jshortArray;
+     PjintArray=^jintArray;
+     PjlongArray=^jlongArray;
+     PjfloatArray=^jfloatArray;
+     PjdoubleArray=^jdoubleArray;
+     Pjthrowable=^jthrowable;
+     Pjweak=^jweak;
+     Pjref=^jref;
+
+     _jfieldID=record // opaque structure
+     end;
+     jfieldID=^_jfieldID;// field IDs
+     PjfieldID=^jfieldID;
+
+     _jmethodID=record // opaque structure
+     end;
+     jmethodID=^_jmethodID;// method IDs
+     PjmethodID=^jmethodID;
+
+     PJNIInvokeInterface=^JNIInvokeInterface;
+
+     Pjvalue=^jvalue;
+     jvalue={$ifdef packedrecords}packed{$endif} record
+      case integer of
+       0:(z:jboolean);
+       1:(b:jbyte);
+       2:(c:jchar);
+       3:(s:jshort);
+       4:(i:jint);
+       5:(j:jlong);
+       6:(f:jfloat);
+       7:(d:jdouble);
+       8:(l:jobject);
+     end;
+
+     jobjectRefType=(
+      JNIInvalidRefType=0,
+      JNILocalRefType=1,
+      JNIGlobalRefType=2,
+      JNIWeakGlobalRefType=3);
+
+     PJNINativeMethod=^JNINativeMethod;
+     JNINativeMethod={$ifdef packedrecords}packed{$endif} record
+      name:pchar;
+      signature:pchar;
+      fnPtr:pointer;
+     end;
+
+     PJNINativeInterface=^JNINativeInterface;
+
+     _JNIEnv={$ifdef packedrecords}packed{$endif} record
+      functions:PJNINativeInterface;
+     end;
+
+     _JavaVM={$ifdef packedrecords}packed{$endif} record
+      functions:PJNIInvokeInterface;
+     end;
+
+     C_JNIEnv=^JNINativeInterface;
+     JNIEnv=^JNINativeInterface;
+     JavaVM=^JNIInvokeInterface;
+
+     PPJNIEnv=^PJNIEnv;
+     PJNIEnv=^JNIEnv;
+
+     PPJavaVM=^PJavaVM;
+     PJavaVM=^JavaVM;
+
+     JNINativeInterface={$ifdef packedrecords}packed{$endif} record
+      reserved0:pointer;
+      reserved1:pointer;
+      reserved2:pointer;
+      reserved3:pointer;
+
+      GetVersion:function(Env:PJNIEnv):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      DefineClass:function(Env:PJNIEnv;const Name:pchar;Loader:JObject;const Buf:PJByte;Len:JSize):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      FindClass:function(Env:PJNIEnv;const Name:pchar):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Reflection Support
+      FromReflectedMethod:function(Env:PJNIEnv;Method:JObject):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      FromReflectedField:function(Env:PJNIEnv;Field:JObject):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ToReflectedMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;IsStatic:JBoolean):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetSuperclass:function(Env:PJNIEnv;Sub:JClass):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      IsAssignableFrom:function(Env:PJNIEnv;Sub:JClass;Sup:JClass):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Reflection Support
+      ToReflectedField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;IsStatic:JBoolean):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      Throw:function(Env:PJNIEnv;Obj:JThrowable):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ThrowNew:function(Env:PJNIEnv;AClass:JClass;const Msg:pchar):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ExceptionOccurred:function(Env:PJNIEnv):JThrowable;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ExceptionDescribe:procedure(Env:PJNIEnv);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ExceptionClear:procedure(Env:PJNIEnv);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      FatalError:procedure(Env:PJNIEnv;const Msg:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Local Reference Management
+      PushLocalFrame:function(Env:PJNIEnv;Capacity:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      PopLocalFrame:function(Env:PJNIEnv;Result:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      NewGlobalRef:function(Env:PJNIEnv;LObj:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      DeleteGlobalRef:procedure(Env:PJNIEnv;GRef:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      DeleteLocalRef:procedure(Env:PJNIEnv;Obj:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      IsSameObject:function(Env:PJNIEnv;Obj1:JObject;Obj2:JObject):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Local Reference Management
+      NewLocalRef:function(Env:PJNIEnv;Ref:JObject):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      EnsureLocalCapacity:function(Env:PJNIEnv;Capacity:JInt):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      AllocObject:function(Env:PJNIEnv;AClass:JClass):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewObject:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewObjectV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewObjectA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetObjectClass:function(Env:PJNIEnv;Obj:JObject):JClass;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      IsInstanceOf:function(Env:PJNIEnv;Obj:JObject;AClass:JClass):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetMethodID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallObjectMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallObjectMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallObjectMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallBooleanMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallBooleanMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallBooleanMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallByteMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallByteMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallByteMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallCharMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallCharMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallCharMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallShortMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallShortMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallShortMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallIntMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallIntMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallIntMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallLongMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallLongMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallLongMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallFloatMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallFloatMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallFloatMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallDoubleMethod:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallDoubleMethodV:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallDoubleMethodA:function(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallVoidMethod:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallVoidMethodV:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallVoidMethodA:procedure(Env:PJNIEnv;Obj:JObject;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualObjectMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualObjectMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualObjectMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualBooleanMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualBooleanMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualBooleanMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualByteMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualByteMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualByteMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualCharMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualCharMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualCharMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualShortMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualShortMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualShortMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualIntMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualIntMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualIntMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualLongMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualLongMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualLongMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualFloatMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualFloatMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualFloatMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualDoubleMethod:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualDoubleMethodV:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualDoubleMethodA:function(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallNonvirtualVoidMethod:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualVoidMethodV:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallNonvirtualVoidMethodA:procedure(Env:PJNIEnv;Obj:JObject;AClass:JClass;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetFieldID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetObjectField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetBooleanField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetByteField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetCharField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetShortField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetIntField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetLongField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetFloatField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetDoubleField:function(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      SetObjectField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetBooleanField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetByteField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetCharField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetShortField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetIntField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetLongField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetFloatField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetDoubleField:procedure(Env:PJNIEnv;Obj:JObject;FieldID:JFieldID;Val:JDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetStaticMethodID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JMethodID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticObjectMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticObjectMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticObjectMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticBooleanMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticBooleanMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticBooleanMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticByteMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticByteMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticByteMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticCharMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticCharMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticCharMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticShortMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticShortMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticShortMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticIntMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticIntMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticIntMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticLongMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticLongMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticLongMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticFloatMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticFloatMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticFloatMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticDoubleMethod:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticDoubleMethodV:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticDoubleMethodA:function(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      CallStaticVoidMethod:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticVoidMethodV:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:va_list);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      CallStaticVoidMethodA:procedure(Env:PJNIEnv;AClass:JClass;MethodID:JMethodID;Args:PJValue);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetStaticFieldID:function(Env:PJNIEnv;AClass:JClass;const Name:pchar;const Sig:pchar):JFieldID;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticObjectField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticBooleanField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticByteField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticCharField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticShortField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticIntField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticLongField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticFloatField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStaticDoubleField:function(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID):JDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      SetStaticObjectField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticBooleanField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticByteField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticCharField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticShortField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticIntField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticLongField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticFloatField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetStaticDoubleField:procedure(Env:PJNIEnv;AClass:JClass;FieldID:JFieldID;Val:JDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      NewString:function(Env:PJNIEnv;const Unicode:PJChar;Len:JSize):JString;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStringLength:function(Env:PJNIEnv;Str:JString):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStringChars:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseStringChars:procedure(Env:PJNIEnv;Str:JString;const Chars:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      NewStringUTF:function(Env:PJNIEnv;const UTF:pchar):JString;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStringUTFLength:function(Env:PJNIEnv;Str:JString):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStringUTFChars:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):pchar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseStringUTFChars:procedure(Env:PJNIEnv;Str:JString;const Chars:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetArrayLength:function(Env:PJNIEnv;AArray:JArray):JSize;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      NewObjectArray:function(Env:PJNIEnv;Len:JSize;AClass:JClass;Init:JObject):JObjectArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetObjectArrayElement:function(Env:PJNIEnv;AArray:JObjectArray;Index:JSize):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetObjectArrayElement:procedure(Env:PJNIEnv;AArray:JObjectArray;Index:JSize;Val:JObject);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      NewBooleanArray:function(Env:PJNIEnv;Len:JSize):JBooleanArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewByteArray:function(Env:PJNIEnv;Len:JSize):JByteArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewCharArray:function(Env:PJNIEnv;Len:JSize):JCharArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewShortArray:function(Env:PJNIEnv;Len:JSize):JShortArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewIntArray:function(Env:PJNIEnv;Len:JSize):JIntArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewLongArray:function(Env:PJNIEnv;Len:JSize):JLongArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewFloatArray:function(Env:PJNIEnv;Len:JSize):JFloatArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      NewDoubleArray:function(Env:PJNIEnv;Len:JSize):JDoubleArray;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetBooleanArrayElements:function(Env:PJNIEnv;AArray:JBooleanArray;IsCopy:PJBoolean):PJBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetByteArrayElements:function(Env:PJNIEnv;AArray:JByteArray;IsCopy:PJBoolean):PJByte;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetCharArrayElements:function(Env:PJNIEnv;AArray:JCharArray;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetShortArrayElements:function(Env:PJNIEnv;AArray:JShortArray;IsCopy:PJBoolean):PJShort;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetIntArrayElements:function(Env:PJNIEnv;AArray:JIntArray;IsCopy:PJBoolean):PJInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetLongArrayElements:function(Env:PJNIEnv;AArray:JLongArray;IsCopy:PJBoolean):PJLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetFloatArrayElements:function(Env:PJNIEnv;AArray:JFloatArray;IsCopy:PJBoolean):PJFloat;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetDoubleArrayElements:function(Env:PJNIEnv;AArray:JDoubleArray;IsCopy:PJBoolean):PJDouble;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      ReleaseBooleanArrayElements:procedure(Env:PJNIEnv;AArray:JBooleanArray;Elems:PJBoolean;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseByteArrayElements:procedure(Env:PJNIEnv;AArray:JByteArray;Elems:PJByte;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseCharArrayElements:procedure(Env:PJNIEnv;AArray:JCharArray;Elems:PJChar;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseShortArrayElements:procedure(Env:PJNIEnv;AArray:JShortArray;Elems:PJShort;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseIntArrayElements:procedure(Env:PJNIEnv;AArray:JIntArray;Elems:PJInt;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseLongArrayElements:procedure(Env:PJNIEnv;AArray:JLongArray;Elems:PJLong;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseFloatArrayElements:procedure(Env:PJNIEnv;AArray:JFloatArray;Elems:PJFloat;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseDoubleArrayElements:procedure(Env:PJNIEnv;AArray:JDoubleArray;Elems:PJDouble;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetBooleanArrayRegion:procedure(Env:PJNIEnv;AArray:JBooleanArray;Start:JSize;Len:JSize;Buf:PJBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetByteArrayRegion:procedure(Env:PJNIEnv;AArray:JByteArray;Start:JSize;Len:JSize;Buf:PJByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetCharArrayRegion:procedure(Env:PJNIEnv;AArray:JCharArray;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetShortArrayRegion:procedure(Env:PJNIEnv;AArray:JShortArray;Start:JSize;Len:JSize;Buf:PJShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetIntArrayRegion:procedure(Env:PJNIEnv;AArray:JIntArray;Start:JSize;Len:JSize;Buf:PJInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetLongArrayRegion:procedure(Env:PJNIEnv;AArray:JLongArray;Start:JSize;Len:JSize;Buf:PJLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetFloatArrayRegion:procedure(Env:PJNIEnv;AArray:JFloatArray;Start:JSize;Len:JSize;Buf:PJFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetDoubleArrayRegion:procedure(Env:PJNIEnv;AArray:JDoubleArray;Start:JSize;Len:JSize;Buf:PJDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      SetBooleanArrayRegion:procedure(Env:PJNIEnv;AArray:JBooleanArray;Start:JSize;Len:JSize;Buf:PJBoolean);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetByteArrayRegion:procedure(Env:PJNIEnv;AArray:JByteArray;Start:JSize;Len:JSize;Buf:PJByte);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetCharArrayRegion:procedure(Env:PJNIEnv;AArray:JCharArray;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetShortArrayRegion:procedure(Env:PJNIEnv;AArray:JShortArray;Start:JSize;Len:JSize;Buf:PJShort);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetIntArrayRegion:procedure(Env:PJNIEnv;AArray:JIntArray;Start:JSize;Len:JSize;Buf:PJInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetLongArrayRegion:procedure(Env:PJNIEnv;AArray:JLongArray;Start:JSize;Len:JSize;Buf:PJLong);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetFloatArrayRegion:procedure(Env:PJNIEnv;AArray:JFloatArray;Start:JSize;Len:JSize;Buf:PJFloat);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      SetDoubleArrayRegion:procedure(Env:PJNIEnv;AArray:JDoubleArray;Start:JSize;Len:JSize;Buf:PJDouble);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      RegisterNatives:function(Env:PJNIEnv;AClass:JClass;const Methods:PJNINativeMethod;NMethods:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      UnregisterNatives:function(Env:PJNIEnv;AClass:JClass):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      MonitorEnter:function(Env:PJNIEnv;Obj:JObject):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      MonitorExit:function(Env:PJNIEnv;Obj:JObject):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      GetJavaVM:function(Env:PJNIEnv;VM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // String Operations
+      GetStringRegion:procedure(Env:PJNIEnv;Str:JString;Start:JSize;Len:JSize;Buf:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetStringUTFRegion:procedure(Env:PJNIEnv;Str:JString;Start:JSize;Len:JSize;Buf:pchar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Array Operations
+      GetPrimitiveArrayCritical:function(Env:PJNIEnv;AArray:JArray;IsCopy:PJBoolean):pointer;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleasePrimitiveArrayCritical:procedure(Env:PJNIEnv;AArray:JArray;CArray:pointer;Mode:JInt);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // String Operations
+      GetStringCritical:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):PJChar;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      ReleaseStringCritical:procedure(Env:PJNIEnv;Str:JString;CString:PJChar);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Weak Global References
+      NewWeakGlobalRef:function(Env:PJNIEnv;Obj:JObject):JWeak;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      DeleteWeakGlobalRef:procedure(Env:PJNIEnv;Ref:JWeak);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // Exceptions
+      ExceptionCheck:function(Env:PJNIEnv):JBoolean;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // J2SDK1_4
+      NewDirectByteBuffer:function(Env:PJNIEnv;Address:pointer;Capacity:JLong):JObject;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetDirectBufferAddress:function(Env:PJNIEnv;Buf:JObject):pointer;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetDirectBufferCapacity:function(Env:PJNIEnv;Buf:JObject):JLong;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+
+      // added in JNI 1.6
+      GetObjectRefType:function(Env:PJNIEnv;AObject:JObject):jobjectRefType;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+     end;
+
+     JNIInvokeInterface={$ifdef packedrecords}packed{$endif} record
+      reserved0:pointer;
+      reserved1:pointer;
+      reserved2:pointer;
+
+      DestroyJavaVM:function(PVM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      AttachCurrentThread:function(PVM:PJavaVM;PEnv:PPJNIEnv;Args:pointer):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      DetachCurrentThread:function(PVM:PJavaVM):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      GetEnv:function(PVM:PJavaVM;PEnv:Ppointer;Version:JInt):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+      AttachCurrentThreadAsDaemon:function(PVM:PJavaVM;PEnv:PPJNIEnv;Args:pointer):JInt;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+     end;
+
+     JavaVMAttachArgs={$ifdef packedrecords}packed{$endif} record
+      version:jint;  // must be >= JNI_VERSION_1_2
+      name:pchar;    // NULL or name of thread as modified UTF-8 str
+      group:jobject; // global ref of a ThreadGroup object, or NULL
+     end;
+
+(**
+ * JNI 1.2+ initialization.  (As of 1.6, the pre-1.2 structures are no
+ * longer supported.)
+ *)
+
+     PJavaVMOption=^JavaVMOption;
+     JavaVMOption={$ifdef packedrecords}packed{$endif} record
+      optionString:pchar;
+      extraInfo:pointer;
+     end;
+
+     JavaVMInitArgs={$ifdef packedrecords}packed{$endif} record
+      version:jint; // use JNI_VERSION_1_2 or later
+      nOptions:jint;
+      options:PJavaVMOption;
+      ignoreUnrecognized:Pjboolean;
+     end;
+
+(*
+ * VM initialization functions.
+ *
+ * Note these are the only symbols exported for JNI by the VM.
+ *)
+{$ifdef jniexternals}
+function JNI_GetDefaultJavaVMInitArgs(p:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_GetDefaultJavaVMInitArgs';
+function JNI_CreateJavaVM(vm:PPJavaVM;AEnv:PPJNIEnv;p:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_CreateJavaVM';
+function JNI_GetCreatedJavaVMs(vm:PPJavaVM;ASize:jsize;p:Pjsize):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}external 'jni' name 'JNI_GetCreatedJavaVMs';
+{$endif}
+
+(*
+ * Prototypes for functions exported by loadable shared libs.  These are
+ * called by JNI, not provided by JNI.
+ *)
+
+const curVM:PJavaVM=nil;
+      curEnv:PJNIEnv=nil;
+      
+(*
+function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+procedure JNI_OnUnload(vm:PJavaVM;reserved:pointer);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+*)
+implementation
+
+function JNI_OnLoad(vm:PJavaVM;reserved:pointer):jint;{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+begin
+ reserved:=reserved;
+ curVM:=vm;
+ exit(JNI_VERSION_1_6);
+end;
+
+procedure JNI_OnUnload(vm:PJavaVM;reserved:pointer);{$ifdef mswindows}stdcall;{$else}cdecl;{$endif}
+begin
+ vm:=vm;
+ reserved:=reserved;
+end;
+
+end.
+
+
diff --git a/project_files/Android-build/log.pas b/project_files/Android-build/log.pas
new file mode 100644
index 0000000..69a79e5
--- /dev/null
+++ b/project_files/Android-build/log.pas
@@ -0,0 +1,28 @@
+unit log;
+{$ifdef fpc}
+ {$mode delphi}
+{$endif}
+
+interface
+
+const libname='liblog.so';
+
+      ANDROID_LOG_UNKNOWN=0;
+      ANDROID_LOG_DEFAULT=1;
+      ANDROID_LOG_VERBOSE=2;
+      ANDROID_LOG_DEBUG=3;
+      ANDROID_LOG_INFO=4;
+      ANDROID_LOG_WARN=5;
+      ANDROID_LOG_ERROR=6;
+      ANDROID_LOG_FATAL=7;
+      ANDROID_LOG_SILENT=8;
+
+type android_LogPriority=integer;
+
+function __android_log_write(prio:longint;tag,text:pchar):longint; cdecl; external libname name '__android_log_write';
+
+//function __android_log_print(prio:longint;tag,print:pchar;params:array of pchar):longint; cdecl; external libname name '__android_log_print';
+  
+implementation
+
+end.
diff --git a/project_files/AudioMono/Music/Art.ogg b/project_files/AudioMono/Music/Art.ogg
new file mode 100755
index 0000000..8dda75e
Binary files /dev/null and b/project_files/AudioMono/Music/Art.ogg differ
diff --git a/project_files/AudioMono/Music/Brick.ogg b/project_files/AudioMono/Music/Brick.ogg
new file mode 100755
index 0000000..8adf080
Binary files /dev/null and b/project_files/AudioMono/Music/Brick.ogg differ
diff --git a/project_files/AudioMono/Music/Castle.ogg b/project_files/AudioMono/Music/Castle.ogg
new file mode 100755
index 0000000..4128140
Binary files /dev/null and b/project_files/AudioMono/Music/Castle.ogg differ
diff --git a/project_files/AudioMono/Music/City.ogg b/project_files/AudioMono/Music/City.ogg
new file mode 100755
index 0000000..dc8923f
Binary files /dev/null and b/project_files/AudioMono/Music/City.ogg differ
diff --git a/project_files/AudioMono/Music/Compost.ogg b/project_files/AudioMono/Music/Compost.ogg
new file mode 100755
index 0000000..ed22594
Binary files /dev/null and b/project_files/AudioMono/Music/Compost.ogg differ
diff --git a/project_files/AudioMono/Music/Desert.ogg b/project_files/AudioMono/Music/Desert.ogg
new file mode 100755
index 0000000..4724300
Binary files /dev/null and b/project_files/AudioMono/Music/Desert.ogg differ
diff --git a/project_files/AudioMono/Music/EarthRise.ogg b/project_files/AudioMono/Music/EarthRise.ogg
new file mode 100755
index 0000000..728dc2e
Binary files /dev/null and b/project_files/AudioMono/Music/EarthRise.ogg differ
diff --git a/project_files/AudioMono/Music/Freeway.ogg b/project_files/AudioMono/Music/Freeway.ogg
new file mode 100755
index 0000000..7354fd5
Binary files /dev/null and b/project_files/AudioMono/Music/Freeway.ogg differ
diff --git a/project_files/AudioMono/Music/Golf.ogg b/project_files/AudioMono/Music/Golf.ogg
new file mode 100755
index 0000000..3b0d2f9
Binary files /dev/null and b/project_files/AudioMono/Music/Golf.ogg differ
diff --git a/project_files/AudioMono/Music/Halloween.ogg b/project_files/AudioMono/Music/Halloween.ogg
new file mode 100755
index 0000000..081214a
Binary files /dev/null and b/project_files/AudioMono/Music/Halloween.ogg differ
diff --git a/project_files/AudioMono/Music/Nature.ogg b/project_files/AudioMono/Music/Nature.ogg
new file mode 100755
index 0000000..e0178b1
Binary files /dev/null and b/project_files/AudioMono/Music/Nature.ogg differ
diff --git a/project_files/AudioMono/Music/Olympics.ogg b/project_files/AudioMono/Music/Olympics.ogg
new file mode 100755
index 0000000..bbb21b5
Binary files /dev/null and b/project_files/AudioMono/Music/Olympics.ogg differ
diff --git a/project_files/AudioMono/Music/Rock.ogg b/project_files/AudioMono/Music/Rock.ogg
new file mode 100755
index 0000000..af70c56
Binary files /dev/null and b/project_files/AudioMono/Music/Rock.ogg differ
diff --git a/project_files/AudioMono/Music/Sheep.ogg b/project_files/AudioMono/Music/Sheep.ogg
new file mode 100755
index 0000000..4ccdd32
Binary files /dev/null and b/project_files/AudioMono/Music/Sheep.ogg differ
diff --git a/project_files/AudioMono/Music/bath.ogg b/project_files/AudioMono/Music/bath.ogg
new file mode 100755
index 0000000..2335654
Binary files /dev/null and b/project_files/AudioMono/Music/bath.ogg differ
diff --git a/project_files/AudioMono/Music/hell.ogg b/project_files/AudioMono/Music/hell.ogg
new file mode 100755
index 0000000..d2d7e25
Binary files /dev/null and b/project_files/AudioMono/Music/hell.ogg differ
diff --git a/project_files/AudioMono/Music/main_theme.ogg b/project_files/AudioMono/Music/main_theme.ogg
new file mode 100755
index 0000000..371db21
Binary files /dev/null and b/project_files/AudioMono/Music/main_theme.ogg differ
diff --git a/project_files/AudioMono/Music/oriental.ogg b/project_files/AudioMono/Music/oriental.ogg
new file mode 100755
index 0000000..96a9665
Binary files /dev/null and b/project_files/AudioMono/Music/oriental.ogg differ
diff --git a/project_files/AudioMono/Music/pirate.ogg b/project_files/AudioMono/Music/pirate.ogg
new file mode 100755
index 0000000..5d7745d
Binary files /dev/null and b/project_files/AudioMono/Music/pirate.ogg differ
diff --git a/project_files/AudioMono/Music/snow.ogg b/project_files/AudioMono/Music/snow.ogg
new file mode 100755
index 0000000..13876dd
Binary files /dev/null and b/project_files/AudioMono/Music/snow.ogg differ
diff --git a/project_files/AudioMono/Music/underwater.ogg b/project_files/AudioMono/Music/underwater.ogg
new file mode 100755
index 0000000..cd7c514
Binary files /dev/null and b/project_files/AudioMono/Music/underwater.ogg differ
diff --git a/project_files/AudioMono/Sounds/1C.ogg b/project_files/AudioMono/Sounds/1C.ogg
new file mode 100755
index 0000000..b0fe7e6
Binary files /dev/null and b/project_files/AudioMono/Sounds/1C.ogg differ
diff --git a/project_files/AudioMono/Sounds/2D.ogg b/project_files/AudioMono/Sounds/2D.ogg
new file mode 100755
index 0000000..cd97fde
Binary files /dev/null and b/project_files/AudioMono/Sounds/2D.ogg differ
diff --git a/project_files/AudioMono/Sounds/3E.ogg b/project_files/AudioMono/Sounds/3E.ogg
new file mode 100755
index 0000000..9f4f280
Binary files /dev/null and b/project_files/AudioMono/Sounds/3E.ogg differ
diff --git a/project_files/AudioMono/Sounds/4F.ogg b/project_files/AudioMono/Sounds/4F.ogg
new file mode 100755
index 0000000..808ca83
Binary files /dev/null and b/project_files/AudioMono/Sounds/4F.ogg differ
diff --git a/project_files/AudioMono/Sounds/5G.ogg b/project_files/AudioMono/Sounds/5G.ogg
new file mode 100755
index 0000000..a416a62
Binary files /dev/null and b/project_files/AudioMono/Sounds/5G.ogg differ
diff --git a/project_files/AudioMono/Sounds/6A.ogg b/project_files/AudioMono/Sounds/6A.ogg
new file mode 100755
index 0000000..e1732b0
Binary files /dev/null and b/project_files/AudioMono/Sounds/6A.ogg differ
diff --git a/project_files/AudioMono/Sounds/7B.ogg b/project_files/AudioMono/Sounds/7B.ogg
new file mode 100755
index 0000000..1377c0d
Binary files /dev/null and b/project_files/AudioMono/Sounds/7B.ogg differ
diff --git a/project_files/AudioMono/Sounds/8C.ogg b/project_files/AudioMono/Sounds/8C.ogg
new file mode 100755
index 0000000..4d2b554
Binary files /dev/null and b/project_files/AudioMono/Sounds/8C.ogg differ
diff --git a/project_files/AudioMono/Sounds/9D.ogg b/project_files/AudioMono/Sounds/9D.ogg
new file mode 100755
index 0000000..b4eb46d
Binary files /dev/null and b/project_files/AudioMono/Sounds/9D.ogg differ
diff --git a/project_files/AudioMono/Sounds/BirdyLay.ogg b/project_files/AudioMono/Sounds/BirdyLay.ogg
new file mode 100755
index 0000000..be121e3
Binary files /dev/null and b/project_files/AudioMono/Sounds/BirdyLay.ogg differ
diff --git a/project_files/AudioMono/Sounds/CollectCrate.ogg b/project_files/AudioMono/Sounds/CollectCrate.ogg
new file mode 100755
index 0000000..a94be84
Binary files /dev/null and b/project_files/AudioMono/Sounds/CollectCrate.ogg differ
diff --git a/project_files/AudioMono/Sounds/Droplet1.ogg b/project_files/AudioMono/Sounds/Droplet1.ogg
new file mode 100755
index 0000000..4528557
Binary files /dev/null and b/project_files/AudioMono/Sounds/Droplet1.ogg differ
diff --git a/project_files/AudioMono/Sounds/Droplet2.ogg b/project_files/AudioMono/Sounds/Droplet2.ogg
new file mode 100755
index 0000000..83aaa74
Binary files /dev/null and b/project_files/AudioMono/Sounds/Droplet2.ogg differ
diff --git a/project_files/AudioMono/Sounds/Droplet3.ogg b/project_files/AudioMono/Sounds/Droplet3.ogg
new file mode 100755
index 0000000..5a2a19d
Binary files /dev/null and b/project_files/AudioMono/Sounds/Droplet3.ogg differ
diff --git a/project_files/AudioMono/Sounds/Hellish.ogg b/project_files/AudioMono/Sounds/Hellish.ogg
new file mode 100755
index 0000000..25639f8
Binary files /dev/null and b/project_files/AudioMono/Sounds/Hellish.ogg differ
diff --git a/project_files/AudioMono/Sounds/Whistle.ogg b/project_files/AudioMono/Sounds/Whistle.ogg
new file mode 100755
index 0000000..e8ca1f3
Binary files /dev/null and b/project_files/AudioMono/Sounds/Whistle.ogg differ
diff --git a/project_files/AudioMono/Sounds/Yoohoo.ogg b/project_files/AudioMono/Sounds/Yoohoo.ogg
new file mode 100755
index 0000000..ec362d2
Binary files /dev/null and b/project_files/AudioMono/Sounds/Yoohoo.ogg differ
diff --git a/project_files/AudioMono/Sounds/baseballbat.ogg b/project_files/AudioMono/Sounds/baseballbat.ogg
new file mode 100755
index 0000000..4f42872
Binary files /dev/null and b/project_files/AudioMono/Sounds/baseballbat.ogg differ
diff --git a/project_files/AudioMono/Sounds/bee.ogg b/project_files/AudioMono/Sounds/bee.ogg
new file mode 100755
index 0000000..b98febb
Binary files /dev/null and b/project_files/AudioMono/Sounds/bee.ogg differ
diff --git a/project_files/AudioMono/Sounds/beewater.ogg b/project_files/AudioMono/Sounds/beewater.ogg
new file mode 100755
index 0000000..1561a1a
Binary files /dev/null and b/project_files/AudioMono/Sounds/beewater.ogg differ
diff --git a/project_files/AudioMono/Sounds/bump.ogg b/project_files/AudioMono/Sounds/bump.ogg
new file mode 100755
index 0000000..69086a0
Binary files /dev/null and b/project_files/AudioMono/Sounds/bump.ogg differ
diff --git a/project_files/AudioMono/Sounds/cake2.ogg b/project_files/AudioMono/Sounds/cake2.ogg
new file mode 100755
index 0000000..3c4dba8
Binary files /dev/null and b/project_files/AudioMono/Sounds/cake2.ogg differ
diff --git a/project_files/AudioMono/Sounds/denied.ogg b/project_files/AudioMono/Sounds/denied.ogg
new file mode 100755
index 0000000..22c0dda
Binary files /dev/null and b/project_files/AudioMono/Sounds/denied.ogg differ
diff --git a/project_files/AudioMono/Sounds/drillgun.ogg b/project_files/AudioMono/Sounds/drillgun.ogg
new file mode 100755
index 0000000..373a088
Binary files /dev/null and b/project_files/AudioMono/Sounds/drillgun.ogg differ
diff --git a/project_files/AudioMono/Sounds/egg.ogg b/project_files/AudioMono/Sounds/egg.ogg
new file mode 100755
index 0000000..1e01c07
Binary files /dev/null and b/project_files/AudioMono/Sounds/egg.ogg differ
diff --git a/project_files/AudioMono/Sounds/explosion.ogg b/project_files/AudioMono/Sounds/explosion.ogg
new file mode 100755
index 0000000..381dfd2
Binary files /dev/null and b/project_files/AudioMono/Sounds/explosion.ogg differ
diff --git a/project_files/AudioMono/Sounds/graveimpact.ogg b/project_files/AudioMono/Sounds/graveimpact.ogg
new file mode 100755
index 0000000..3555f98
Binary files /dev/null and b/project_files/AudioMono/Sounds/graveimpact.ogg differ
diff --git a/project_files/AudioMono/Sounds/grenadeimpact.ogg b/project_files/AudioMono/Sounds/grenadeimpact.ogg
new file mode 100755
index 0000000..06df0ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/grenadeimpact.ogg differ
diff --git a/project_files/AudioMono/Sounds/gun.ogg b/project_files/AudioMono/Sounds/gun.ogg
new file mode 100755
index 0000000..ddacd71
Binary files /dev/null and b/project_files/AudioMono/Sounds/gun.ogg differ
diff --git a/project_files/AudioMono/Sounds/hammer.ogg b/project_files/AudioMono/Sounds/hammer.ogg
new file mode 100755
index 0000000..89eb4d1
Binary files /dev/null and b/project_files/AudioMono/Sounds/hammer.ogg differ
diff --git a/project_files/AudioMono/Sounds/hell_growl.ogg b/project_files/AudioMono/Sounds/hell_growl.ogg
new file mode 100755
index 0000000..9003dbe
Binary files /dev/null and b/project_files/AudioMono/Sounds/hell_growl.ogg differ
diff --git a/project_files/AudioMono/Sounds/hell_ooff.ogg b/project_files/AudioMono/Sounds/hell_ooff.ogg
new file mode 100755
index 0000000..83706c6
Binary files /dev/null and b/project_files/AudioMono/Sounds/hell_ooff.ogg differ
diff --git a/project_files/AudioMono/Sounds/hell_ow.ogg b/project_files/AudioMono/Sounds/hell_ow.ogg
new file mode 100755
index 0000000..9ecc8d3
Binary files /dev/null and b/project_files/AudioMono/Sounds/hell_ow.ogg differ
diff --git a/project_files/AudioMono/Sounds/hell_ugh.ogg b/project_files/AudioMono/Sounds/hell_ugh.ogg
new file mode 100755
index 0000000..481d18e
Binary files /dev/null and b/project_files/AudioMono/Sounds/hell_ugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/hogchant3.ogg b/project_files/AudioMono/Sounds/hogchant3.ogg
new file mode 100755
index 0000000..0ee232b
Binary files /dev/null and b/project_files/AudioMono/Sounds/hogchant3.ogg differ
diff --git a/project_files/AudioMono/Sounds/homerun.ogg b/project_files/AudioMono/Sounds/homerun.ogg
new file mode 100755
index 0000000..1efb1ec
Binary files /dev/null and b/project_files/AudioMono/Sounds/homerun.ogg differ
diff --git a/project_files/AudioMono/Sounds/lowgravity.ogg b/project_files/AudioMono/Sounds/lowgravity.ogg
new file mode 100755
index 0000000..85ec60d
Binary files /dev/null and b/project_files/AudioMono/Sounds/lowgravity.ogg differ
diff --git a/project_files/AudioMono/Sounds/melonimpact.ogg b/project_files/AudioMono/Sounds/melonimpact.ogg
new file mode 100755
index 0000000..01ae3df
Binary files /dev/null and b/project_files/AudioMono/Sounds/melonimpact.ogg differ
diff --git a/project_files/AudioMono/Sounds/mineimpact.ogg b/project_files/AudioMono/Sounds/mineimpact.ogg
new file mode 100755
index 0000000..24f28f8
Binary files /dev/null and b/project_files/AudioMono/Sounds/mineimpact.ogg differ
diff --git a/project_files/AudioMono/Sounds/minetick.ogg b/project_files/AudioMono/Sounds/minetick.ogg
new file mode 100755
index 0000000..2a83542
Binary files /dev/null and b/project_files/AudioMono/Sounds/minetick.ogg differ
diff --git a/project_files/AudioMono/Sounds/molotov.ogg b/project_files/AudioMono/Sounds/molotov.ogg
new file mode 100755
index 0000000..360a0c4
Binary files /dev/null and b/project_files/AudioMono/Sounds/molotov.ogg differ
diff --git a/project_files/AudioMono/Sounds/mortar.ogg b/project_files/AudioMono/Sounds/mortar.ogg
new file mode 100755
index 0000000..9d5ee20
Binary files /dev/null and b/project_files/AudioMono/Sounds/mortar.ogg differ
diff --git a/project_files/AudioMono/Sounds/parachute.ogg b/project_files/AudioMono/Sounds/parachute.ogg
new file mode 100755
index 0000000..3cff1ca
Binary files /dev/null and b/project_files/AudioMono/Sounds/parachute.ogg differ
diff --git a/project_files/AudioMono/Sounds/pickhammer.ogg b/project_files/AudioMono/Sounds/pickhammer.ogg
new file mode 100755
index 0000000..401567c
Binary files /dev/null and b/project_files/AudioMono/Sounds/pickhammer.ogg differ
diff --git a/project_files/AudioMono/Sounds/placed.ogg b/project_files/AudioMono/Sounds/placed.ogg
new file mode 100755
index 0000000..32565ac
Binary files /dev/null and b/project_files/AudioMono/Sounds/placed.ogg differ
diff --git a/project_files/AudioMono/Sounds/plane.ogg b/project_files/AudioMono/Sounds/plane.ogg
new file mode 100755
index 0000000..4288d96
Binary files /dev/null and b/project_files/AudioMono/Sounds/plane.ogg differ
diff --git a/project_files/AudioMono/Sounds/rcplane.ogg b/project_files/AudioMono/Sounds/rcplane.ogg
new file mode 100755
index 0000000..1a169c5
Binary files /dev/null and b/project_files/AudioMono/Sounds/rcplane.ogg differ
diff --git a/project_files/AudioMono/Sounds/ride_of_the_valkyries.ogg b/project_files/AudioMono/Sounds/ride_of_the_valkyries.ogg
new file mode 100755
index 0000000..790d327
Binary files /dev/null and b/project_files/AudioMono/Sounds/ride_of_the_valkyries.ogg differ
diff --git a/project_files/AudioMono/Sounds/ropeattach.ogg b/project_files/AudioMono/Sounds/ropeattach.ogg
new file mode 100755
index 0000000..3e34758
Binary files /dev/null and b/project_files/AudioMono/Sounds/ropeattach.ogg differ
diff --git a/project_files/AudioMono/Sounds/roperelease.ogg b/project_files/AudioMono/Sounds/roperelease.ogg
new file mode 100755
index 0000000..7a7b478
Binary files /dev/null and b/project_files/AudioMono/Sounds/roperelease.ogg differ
diff --git a/project_files/AudioMono/Sounds/ropeshot.ogg b/project_files/AudioMono/Sounds/ropeshot.ogg
new file mode 100755
index 0000000..5d8e5cf
Binary files /dev/null and b/project_files/AudioMono/Sounds/ropeshot.ogg differ
diff --git a/project_files/AudioMono/Sounds/shotgunfire.ogg b/project_files/AudioMono/Sounds/shotgunfire.ogg
new file mode 100755
index 0000000..560b190
Binary files /dev/null and b/project_files/AudioMono/Sounds/shotgunfire.ogg differ
diff --git a/project_files/AudioMono/Sounds/shotgunreload.ogg b/project_files/AudioMono/Sounds/shotgunreload.ogg
new file mode 100755
index 0000000..a9930fb
Binary files /dev/null and b/project_files/AudioMono/Sounds/shotgunreload.ogg differ
diff --git a/project_files/AudioMono/Sounds/shutterclick.ogg b/project_files/AudioMono/Sounds/shutterclick.ogg
new file mode 100755
index 0000000..78c3ddb
Binary files /dev/null and b/project_files/AudioMono/Sounds/shutterclick.ogg differ
diff --git a/project_files/AudioMono/Sounds/sinegun.ogg b/project_files/AudioMono/Sounds/sinegun.ogg
new file mode 100755
index 0000000..a28c840
Binary files /dev/null and b/project_files/AudioMono/Sounds/sinegun.ogg differ
diff --git a/project_files/AudioMono/Sounds/skip.ogg b/project_files/AudioMono/Sounds/skip.ogg
new file mode 100755
index 0000000..11c8ea3
Binary files /dev/null and b/project_files/AudioMono/Sounds/skip.ogg differ
diff --git a/project_files/AudioMono/Sounds/sniperreload.ogg b/project_files/AudioMono/Sounds/sniperreload.ogg
new file mode 100755
index 0000000..238dd15
Binary files /dev/null and b/project_files/AudioMono/Sounds/sniperreload.ogg differ
diff --git a/project_files/AudioMono/Sounds/splash.ogg b/project_files/AudioMono/Sounds/splash.ogg
new file mode 100755
index 0000000..723d41c
Binary files /dev/null and b/project_files/AudioMono/Sounds/splash.ogg differ
diff --git a/project_files/AudioMono/Sounds/steam.ogg b/project_files/AudioMono/Sounds/steam.ogg
new file mode 100755
index 0000000..80aa100
Binary files /dev/null and b/project_files/AudioMono/Sounds/steam.ogg differ
diff --git a/project_files/AudioMono/Sounds/steps.ogg b/project_files/AudioMono/Sounds/steps.ogg
new file mode 100755
index 0000000..a676413
Binary files /dev/null and b/project_files/AudioMono/Sounds/steps.ogg differ
diff --git a/project_files/AudioMono/Sounds/suddendeath.ogg b/project_files/AudioMono/Sounds/suddendeath.ogg
new file mode 100755
index 0000000..9028471
Binary files /dev/null and b/project_files/AudioMono/Sounds/suddendeath.ogg differ
diff --git a/project_files/AudioMono/Sounds/switchhog.ogg b/project_files/AudioMono/Sounds/switchhog.ogg
new file mode 100755
index 0000000..204dd5f
Binary files /dev/null and b/project_files/AudioMono/Sounds/switchhog.ogg differ
diff --git a/project_files/AudioMono/Sounds/throwpowerup.ogg b/project_files/AudioMono/Sounds/throwpowerup.ogg
new file mode 100755
index 0000000..4fd2c5c
Binary files /dev/null and b/project_files/AudioMono/Sounds/throwpowerup.ogg differ
diff --git a/project_files/AudioMono/Sounds/throwrelease.ogg b/project_files/AudioMono/Sounds/throwrelease.ogg
new file mode 100755
index 0000000..2110733
Binary files /dev/null and b/project_files/AudioMono/Sounds/throwrelease.ogg differ
diff --git a/project_files/AudioMono/Sounds/ufo.ogg b/project_files/AudioMono/Sounds/ufo.ogg
new file mode 100755
index 0000000..d7a67c9
Binary files /dev/null and b/project_files/AudioMono/Sounds/ufo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Amazing.ogg b/project_files/AudioMono/Sounds/voices/British/Amazing.ogg
new file mode 100755
index 0000000..4c40bdc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Boring.ogg b/project_files/AudioMono/Sounds/voices/British/Boring.ogg
new file mode 100755
index 0000000..57bfc0c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/British/Brilliant.ogg
new file mode 100755
index 0000000..65c69fc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Bugger.ogg b/project_files/AudioMono/Sounds/voices/British/Bugger.ogg
new file mode 100755
index 0000000..3cb9b99
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Bungee.ogg b/project_files/AudioMono/Sounds/voices/British/Bungee.ogg
new file mode 100755
index 0000000..77ac200
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Byebye.ogg b/project_files/AudioMono/Sounds/voices/British/Byebye.ogg
new file mode 100755
index 0000000..6433e12
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/British/Comeonthen.ogg
new file mode 100755
index 0000000..88fd7c8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Coward.ogg b/project_files/AudioMono/Sounds/voices/British/Coward.ogg
new file mode 100755
index 0000000..1d050ee
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/British/Cutitout.ogg
new file mode 100755
index 0000000..be3c6fe
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Drat.ogg b/project_files/AudioMono/Sounds/voices/British/Drat.ogg
new file mode 100755
index 0000000..0b59823
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/British/Enemydown.ogg
new file mode 100755
index 0000000..5dbb2ba
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Excellent.ogg b/project_files/AudioMono/Sounds/voices/British/Excellent.ogg
new file mode 100755
index 0000000..86688df
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Fire.ogg b/project_files/AudioMono/Sounds/voices/British/Fire.ogg
new file mode 100755
index 0000000..cec220e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/British/Firepunch1.ogg
new file mode 100755
index 0000000..c51e25b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/British/Firstblood.ogg
new file mode 100755
index 0000000..aa92348
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Flawless.ogg b/project_files/AudioMono/Sounds/voices/British/Flawless.ogg
new file mode 100755
index 0000000..68ff8c1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/British/Gonnagetyou.ogg
new file mode 100755
index 0000000..1649dd3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Grenade.ogg b/project_files/AudioMono/Sounds/voices/British/Grenade.ogg
new file mode 100755
index 0000000..9992645
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Hello.ogg b/project_files/AudioMono/Sounds/voices/British/Hello.ogg
new file mode 100755
index 0000000..ef3b331
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Hmm.ogg b/project_files/AudioMono/Sounds/voices/British/Hmm.ogg
new file mode 100755
index 0000000..c55c63d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Hurry.ogg b/project_files/AudioMono/Sounds/voices/British/Hurry.ogg
new file mode 100755
index 0000000..96493ee
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/British/Illgetyou.ogg
new file mode 100755
index 0000000..a349ccf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Incoming.ogg b/project_files/AudioMono/Sounds/voices/British/Incoming.ogg
new file mode 100755
index 0000000..7c2a80b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Jump1.ogg b/project_files/AudioMono/Sounds/voices/British/Jump1.ogg
new file mode 100755
index 0000000..26910d7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Jump2.ogg b/project_files/AudioMono/Sounds/voices/British/Jump2.ogg
new file mode 100755
index 0000000..92f21bd
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Jump3.ogg b/project_files/AudioMono/Sounds/voices/British/Jump3.ogg
new file mode 100755
index 0000000..2ca1b55
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/British/Justyouwait.ogg
new file mode 100755
index 0000000..720ae31
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/British/Kamikaze.ogg
new file mode 100755
index 0000000..02e0cb4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Laugh.ogg b/project_files/AudioMono/Sounds/voices/British/Laugh.ogg
new file mode 100755
index 0000000..c4e8a02
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/British/Leavemealone.ogg
new file mode 100755
index 0000000..a091aea
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Melon.ogg b/project_files/AudioMono/Sounds/voices/British/Melon.ogg
new file mode 100755
index 0000000..347fb28
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Missed.ogg b/project_files/AudioMono/Sounds/voices/British/Missed.ogg
new file mode 100755
index 0000000..73cb19b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Nooo.ogg b/project_files/AudioMono/Sounds/voices/British/Nooo.ogg
new file mode 100755
index 0000000..de90cb2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Nutter.ogg b/project_files/AudioMono/Sounds/voices/British/Nutter.ogg
new file mode 100755
index 0000000..7595f89
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/British/Ohdear.ogg
new file mode 100755
index 0000000..202720b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/British/Ooff1.ogg
new file mode 100755
index 0000000..2c02f50
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/British/Ooff2.ogg
new file mode 100755
index 0000000..b10b40e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/British/Ooff3.ogg
new file mode 100755
index 0000000..6e7a3eb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Oops.ogg b/project_files/AudioMono/Sounds/voices/British/Oops.ogg
new file mode 100755
index 0000000..877e589
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ouch.ogg b/project_files/AudioMono/Sounds/voices/British/Ouch.ogg
new file mode 100755
index 0000000..1f363ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ow1.ogg b/project_files/AudioMono/Sounds/voices/British/Ow1.ogg
new file mode 100755
index 0000000..9fe7e43
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ow2.ogg b/project_files/AudioMono/Sounds/voices/British/Ow2.ogg
new file mode 100755
index 0000000..fcf1a9e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ow3.ogg b/project_files/AudioMono/Sounds/voices/British/Ow3.ogg
new file mode 100755
index 0000000..6c71897
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Ow4.ogg b/project_files/AudioMono/Sounds/voices/British/Ow4.ogg
new file mode 100755
index 0000000..102d964
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Perfect.ogg b/project_files/AudioMono/Sounds/voices/British/Perfect.ogg
new file mode 100755
index 0000000..574c873
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/British/PoisonCough.ogg
new file mode 100755
index 0000000..7371c53
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/British/PoisonMoan.ogg
new file mode 100755
index 0000000..3fd94d1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/British/Reinforcements.ogg
new file mode 100755
index 0000000..edf3198
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Revenge.ogg b/project_files/AudioMono/Sounds/voices/British/Revenge.ogg
new file mode 100755
index 0000000..52b4f44
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Runaway.ogg b/project_files/AudioMono/Sounds/voices/British/Runaway.ogg
new file mode 100755
index 0000000..0d77ff9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/British/Sameteam.ogg
new file mode 100755
index 0000000..173cb08
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Solong.ogg b/project_files/AudioMono/Sounds/voices/British/Solong.ogg
new file mode 100755
index 0000000..bd2e146
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Stupid.ogg b/project_files/AudioMono/Sounds/voices/British/Stupid.ogg
new file mode 100755
index 0000000..84d7c32
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Takecover.ogg b/project_files/AudioMono/Sounds/voices/British/Takecover.ogg
new file mode 100755
index 0000000..819a15b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/British/Thisoneismine.ogg
new file mode 100755
index 0000000..c0713a3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Traitor.ogg b/project_files/AudioMono/Sounds/voices/British/Traitor.ogg
new file mode 100755
index 0000000..a2adec3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/British/Uh-oh.ogg
new file mode 100755
index 0000000..fe5a052
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Victory.ogg b/project_files/AudioMono/Sounds/voices/British/Victory.ogg
new file mode 100755
index 0000000..81c2cae
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Watchit.ogg b/project_files/AudioMono/Sounds/voices/British/Watchit.ogg
new file mode 100755
index 0000000..3694aaa
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/British/Watchthis.ogg
new file mode 100755
index 0000000..029bdf4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/British/Whatthe.ogg
new file mode 100755
index 0000000..50a9f87
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/British/Whoopsee.ogg
new file mode 100755
index 0000000..14ef0bf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Yessir.ogg b/project_files/AudioMono/Sounds/voices/British/Yessir.ogg
new file mode 100755
index 0000000..47c3a82
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/British/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/British/Youllregretthat.ogg
new file mode 100755
index 0000000..b7f061b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/British/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Boring.ogg b/project_files/AudioMono/Sounds/voices/Classic/Boring.ogg
new file mode 100755
index 0000000..e57ca54
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Classic/Byebye.ogg
new file mode 100755
index 0000000..004df22
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Classic/Comeonthen.ogg
new file mode 100755
index 0000000..455a4ca
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Coward.ogg b/project_files/AudioMono/Sounds/voices/Classic/Coward.ogg
new file mode 100755
index 0000000..0cc14ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Classic/Enemydown.ogg
new file mode 100755
index 0000000..526de68
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Classic/Firstblood.ogg
new file mode 100755
index 0000000..285758b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Classic/Flawless.ogg
new file mode 100755
index 0000000..5564fb9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Hello.ogg b/project_files/AudioMono/Sounds/voices/Classic/Hello.ogg
new file mode 100755
index 0000000..e94419b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Classic/Hurry.ogg
new file mode 100755
index 0000000..632cec4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Classic/Illgetyou.ogg
new file mode 100755
index 0000000..ae3592c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Classic/Incoming.ogg
new file mode 100755
index 0000000..d447057
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Classic/Jump1.ogg
new file mode 100755
index 0000000..70de92b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Classic/Jump2.ogg
new file mode 100755
index 0000000..cc1ba0b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Classic/Jump3.ogg
new file mode 100755
index 0000000..c232b7f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Classic/Kamikaze.ogg
new file mode 100755
index 0000000..03f6782
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Classic/Laugh.ogg
new file mode 100755
index 0000000..8f22c4e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Missed.ogg b/project_files/AudioMono/Sounds/voices/Classic/Missed.ogg
new file mode 100755
index 0000000..8070a68
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Classic/Nooo.ogg
new file mode 100755
index 0000000..8bb6aba
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Classic/Nutter.ogg
new file mode 100755
index 0000000..7217f18
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ooff1.ogg
new file mode 100755
index 0000000..93d7a56
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ooff2.ogg
new file mode 100755
index 0000000..1fc92e9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ooff3.ogg
new file mode 100755
index 0000000..55952ce
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Oops.ogg b/project_files/AudioMono/Sounds/voices/Classic/Oops.ogg
new file mode 100755
index 0000000..eee7bdf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ow1.ogg
new file mode 100755
index 0000000..d7e208b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ow2.ogg
new file mode 100755
index 0000000..9f8f4c2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ow3.ogg
new file mode 100755
index 0000000..68d9426
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Classic/Ow4.ogg
new file mode 100755
index 0000000..82dc46c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Classic/PoisonCough.ogg
new file mode 100755
index 0000000..3605266
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Classic/PoisonMoan.ogg
new file mode 100755
index 0000000..ce8d20b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Classic/Reinforcements.ogg
new file mode 100755
index 0000000..71986a4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Classic/Sameteam.ogg
new file mode 100755
index 0000000..eb17305
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Classic/Stupid.ogg
new file mode 100755
index 0000000..9af7bae
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Classic/Takecover.ogg
new file mode 100755
index 0000000..e9a1452
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Classic/Traitor.ogg
new file mode 100755
index 0000000..6e29d02
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Classic/Uh-oh.ogg
new file mode 100755
index 0000000..e3c608c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Victory.ogg b/project_files/AudioMono/Sounds/voices/Classic/Victory.ogg
new file mode 100755
index 0000000..cfb46fd
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Classic/Watchit.ogg
new file mode 100755
index 0000000..ec0a1c9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Classic/Yessir.ogg
new file mode 100755
index 0000000..fbff3ed
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Classic/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Classic/Youllregretthat.ogg
new file mode 100755
index 0000000..715ea49
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Classic/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Default/Amazing.ogg
new file mode 100755
index 0000000..f22efbe
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Boring.ogg b/project_files/AudioMono/Sounds/voices/Default/Boring.ogg
new file mode 100755
index 0000000..cd73a74
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Default/Brilliant.ogg
new file mode 100755
index 0000000..997dcba
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Default/Bugger.ogg
new file mode 100755
index 0000000..2a0d2cf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Default/Bungee.ogg
new file mode 100755
index 0000000..18b9d35
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Default/Byebye.ogg
new file mode 100755
index 0000000..7ee66f9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Default/Comeonthen.ogg
new file mode 100755
index 0000000..e677cc7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Coward.ogg b/project_files/AudioMono/Sounds/voices/Default/Coward.ogg
new file mode 100755
index 0000000..d82b9fb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Default/Cutitout.ogg
new file mode 100755
index 0000000..c916d0f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Drat.ogg b/project_files/AudioMono/Sounds/voices/Default/Drat.ogg
new file mode 100755
index 0000000..dd87bf3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Default/Enemydown.ogg
new file mode 100755
index 0000000..57c50c0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Default/Excellent.ogg
new file mode 100755
index 0000000..8a6708e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Fire.ogg b/project_files/AudioMono/Sounds/voices/Default/Fire.ogg
new file mode 100755
index 0000000..80ac9d3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch1.ogg
new file mode 100755
index 0000000..2b409b8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch2.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch2.ogg
new file mode 100755
index 0000000..efad245
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch3.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch3.ogg
new file mode 100755
index 0000000..3d29c2d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch4.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch4.ogg
new file mode 100755
index 0000000..6a87a05
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch5.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch5.ogg
new file mode 100755
index 0000000..60174e3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch5.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firepunch6.ogg b/project_files/AudioMono/Sounds/voices/Default/Firepunch6.ogg
new file mode 100755
index 0000000..bb78019
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firepunch6.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Default/Firstblood.ogg
new file mode 100755
index 0000000..6c08d24
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Default/Flawless.ogg
new file mode 100755
index 0000000..75e9465
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Default/Gonnagetyou.ogg
new file mode 100755
index 0000000..5874526
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Default/Grenade.ogg
new file mode 100755
index 0000000..7e06459
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Hello.ogg b/project_files/AudioMono/Sounds/voices/Default/Hello.ogg
new file mode 100755
index 0000000..5e619f2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Default/Hmm.ogg
new file mode 100755
index 0000000..3df40a1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Default/Hurry.ogg
new file mode 100755
index 0000000..9a384e2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Default/Illgetyou.ogg
new file mode 100755
index 0000000..386408c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Default/Incoming.ogg
new file mode 100755
index 0000000..4e52944
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Default/Jump1.ogg
new file mode 100755
index 0000000..83ca58d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Default/Jump2.ogg
new file mode 100755
index 0000000..62c51b8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Default/Jump3.ogg
new file mode 100755
index 0000000..010a340
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Default/Justyouwait.ogg
new file mode 100755
index 0000000..20fdfe8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Default/Kamikaze.ogg
new file mode 100755
index 0000000..4283a6f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Default/Laugh.ogg
new file mode 100755
index 0000000..f475c56
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Default/Leavemealone.ogg
new file mode 100755
index 0000000..6a12643
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Melon.ogg b/project_files/AudioMono/Sounds/voices/Default/Melon.ogg
new file mode 100755
index 0000000..c71eebf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Missed.ogg b/project_files/AudioMono/Sounds/voices/Default/Missed.ogg
new file mode 100755
index 0000000..5265f69
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Default/Nooo.ogg
new file mode 100755
index 0000000..aae5aba
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Default/Nutter.ogg
new file mode 100755
index 0000000..6214d87
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Default/Ohdear.ogg
new file mode 100755
index 0000000..b270dc2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Default/Ooff1.ogg
new file mode 100755
index 0000000..ec41e4b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Default/Ooff2.ogg
new file mode 100755
index 0000000..f9754b8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Default/Ooff3.ogg
new file mode 100755
index 0000000..90c7405
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Oops.ogg b/project_files/AudioMono/Sounds/voices/Default/Oops.ogg
new file mode 100755
index 0000000..a24aa43
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Default/Ouch.ogg
new file mode 100755
index 0000000..6f17197
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Default/Ow1.ogg
new file mode 100755
index 0000000..ae6c166
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Default/Ow2.ogg
new file mode 100755
index 0000000..5afc3d1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Default/Ow3.ogg
new file mode 100755
index 0000000..459b42a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Default/Ow4.ogg
new file mode 100755
index 0000000..7481654
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Default/Perfect.ogg
new file mode 100755
index 0000000..9effb28
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Default/PoisonCough.ogg
new file mode 100755
index 0000000..44bb00a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Default/PoisonMoan.ogg
new file mode 100755
index 0000000..d1993da
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Default/Reinforcements.ogg
new file mode 100755
index 0000000..7c53814
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Default/Revenge.ogg
new file mode 100755
index 0000000..46f318c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Default/Runaway.ogg
new file mode 100755
index 0000000..95ac0cb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Default/Sameteam.ogg
new file mode 100755
index 0000000..adaa3d9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Solong.ogg b/project_files/AudioMono/Sounds/voices/Default/Solong.ogg
new file mode 100755
index 0000000..6ccd63f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Default/Stupid.ogg
new file mode 100755
index 0000000..5c20084
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Default/Takecover.ogg
new file mode 100755
index 0000000..0a61c91
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Default/Thisoneismine.ogg
new file mode 100755
index 0000000..39ac2d7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Default/Traitor.ogg
new file mode 100755
index 0000000..49446cd
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Default/Uh-oh.ogg
new file mode 100755
index 0000000..2168068
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Victory.ogg b/project_files/AudioMono/Sounds/voices/Default/Victory.ogg
new file mode 100755
index 0000000..f2fadbd
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Default/Watchit.ogg
new file mode 100755
index 0000000..aa7e7a1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Default/Watchthis.ogg
new file mode 100755
index 0000000..3e4a21f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Default/Whatthe.ogg
new file mode 100755
index 0000000..1bb7a68
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Default/Whoopsee.ogg
new file mode 100755
index 0000000..788ac13
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Default/Yessir.ogg
new file mode 100755
index 0000000..56567c8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Default/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Default/Youllregretthat.ogg
new file mode 100755
index 0000000..f656b3b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Default/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Amazing.ogg
new file mode 100755
index 0000000..e243756
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Boring.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Boring.ogg
new file mode 100755
index 0000000..8c15e9e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Brilliant.ogg
new file mode 100755
index 0000000..b001cca
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Bugger.ogg
new file mode 100755
index 0000000..0d0f096
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Bungee.ogg
new file mode 100755
index 0000000..b7a60e5
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Byebye.ogg
new file mode 100755
index 0000000..61bcfa1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Comeonthen.ogg
new file mode 100755
index 0000000..7d526f2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Coward.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Coward.ogg
new file mode 100755
index 0000000..186721a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Cutitout.ogg
new file mode 100755
index 0000000..69481cc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Drat.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Drat.ogg
new file mode 100755
index 0000000..3a36412
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Enemydown.ogg
new file mode 100755
index 0000000..0af1413
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Excellent.ogg
new file mode 100755
index 0000000..5c94774
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Fire.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Fire.ogg
new file mode 100755
index 0000000..bb1d3f8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Firepunch1.ogg
new file mode 100755
index 0000000..2816ab6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Firstblood.ogg
new file mode 100755
index 0000000..2014f3c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Flawless.ogg
new file mode 100755
index 0000000..0f095c9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Gonnagetyou.ogg
new file mode 100755
index 0000000..3bc8c84
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Grenade.ogg
new file mode 100755
index 0000000..d44a93d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Hello.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Hello.ogg
new file mode 100755
index 0000000..ef7e2ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Hmm.ogg
new file mode 100755
index 0000000..58d4134
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Hurry.ogg
new file mode 100755
index 0000000..442156b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Illgetyou.ogg
new file mode 100755
index 0000000..8de4869
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Incoming.ogg
new file mode 100755
index 0000000..a2d8f6e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Jump1.ogg
new file mode 100755
index 0000000..85af097
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Jump2.ogg
new file mode 100755
index 0000000..f43af5a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Jump3.ogg
new file mode 100755
index 0000000..5437575
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Justyouwait.ogg
new file mode 100755
index 0000000..8171e10
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Kamikaze.ogg
new file mode 100755
index 0000000..696b5bb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Laugh.ogg
new file mode 100755
index 0000000..ccffc77
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Leavemealone.ogg
new file mode 100755
index 0000000..38f0ffa
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Melon.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Melon.ogg
new file mode 100755
index 0000000..3fea110
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Missed.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Missed.ogg
new file mode 100755
index 0000000..1d64da0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Nooo.ogg
new file mode 100755
index 0000000..3bcc099
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Nutter.ogg
new file mode 100755
index 0000000..bbef9ad
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ohdear.ogg
new file mode 100755
index 0000000..82686cf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ooff1.ogg
new file mode 100755
index 0000000..f1fedb0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ooff2.ogg
new file mode 100755
index 0000000..7b5a98b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ooff3.ogg
new file mode 100755
index 0000000..ea76e67
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Oops.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Oops.ogg
new file mode 100755
index 0000000..efc9f57
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ouch.ogg
new file mode 100755
index 0000000..fe5f358
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ow1.ogg
new file mode 100755
index 0000000..b52b697
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ow2.ogg
new file mode 100755
index 0000000..d3e7224
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ow3.ogg
new file mode 100755
index 0000000..de8b3b8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Ow4.ogg
new file mode 100755
index 0000000..762465a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Perfect.ogg
new file mode 100755
index 0000000..75c1cd3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Mobster/PoisonCough.ogg
new file mode 100755
index 0000000..43af6e0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Mobster/PoisonMoan.ogg
new file mode 100755
index 0000000..a838f82
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Reinforcements.ogg
new file mode 100755
index 0000000..2d3c08e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Revenge.ogg
new file mode 100755
index 0000000..646662b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Runaway.ogg
new file mode 100755
index 0000000..76a610c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Sameteam.ogg
new file mode 100755
index 0000000..1fd165a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Solong.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Solong.ogg
new file mode 100755
index 0000000..427b535
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Stupid.ogg
new file mode 100755
index 0000000..6486aa9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Takecover.ogg
new file mode 100755
index 0000000..ccac950
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Thisoneismine.ogg
new file mode 100755
index 0000000..787d96e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Traitor.ogg
new file mode 100755
index 0000000..5f8472d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Uh-oh.ogg
new file mode 100755
index 0000000..ff5f3a0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Victory.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Victory.ogg
new file mode 100755
index 0000000..4edbc38
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Watchit.ogg
new file mode 100755
index 0000000..c58e3ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Watchthis.ogg
new file mode 100755
index 0000000..6f67ee1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Whatthe.ogg
new file mode 100755
index 0000000..d927d7f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Whoopsee.ogg
new file mode 100755
index 0000000..9c583b8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Yessir.ogg
new file mode 100755
index 0000000..4abe0fd
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Mobster/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Mobster/Youllregretthat.ogg
new file mode 100755
index 0000000..112160c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Mobster/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Amazing.ogg
new file mode 100755
index 0000000..22de986
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Boring.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Boring.ogg
new file mode 100755
index 0000000..03ef1ac
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Brilliant.ogg
new file mode 100755
index 0000000..ad77311
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Bugger.ogg
new file mode 100755
index 0000000..fe20d30
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Bungee.ogg
new file mode 100755
index 0000000..4ea21e1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Byebye.ogg
new file mode 100755
index 0000000..0d16aa8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Comeonthen.ogg
new file mode 100755
index 0000000..4be9a11
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Coward.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Coward.ogg
new file mode 100755
index 0000000..8321e4e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Cutitout.ogg
new file mode 100755
index 0000000..fd72774
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Drat.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Drat.ogg
new file mode 100755
index 0000000..ab9b831
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Enemydown.ogg
new file mode 100755
index 0000000..a74ba92
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Excellent.ogg
new file mode 100755
index 0000000..8b21a3e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Fire.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Fire.ogg
new file mode 100755
index 0000000..fbcbf14
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch1.ogg
new file mode 100755
index 0000000..99170fb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch2.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch2.ogg
new file mode 100755
index 0000000..93c3d18
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch3.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch3.ogg
new file mode 100755
index 0000000..a4e715e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch4.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch4.ogg
new file mode 100755
index 0000000..410b4ff
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch5.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch5.ogg
new file mode 100755
index 0000000..d2a149e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch5.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firepunch6.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch6.ogg
new file mode 100755
index 0000000..52c77bf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firepunch6.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Firstblood.ogg
new file mode 100755
index 0000000..5fe263b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Flawless.ogg
new file mode 100755
index 0000000..a140038
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Gonnagetyou.ogg
new file mode 100755
index 0000000..3d8ee9f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Grenade.ogg
new file mode 100755
index 0000000..5fd17f7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Hello.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Hello.ogg
new file mode 100755
index 0000000..20e8b2f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Hmm.ogg
new file mode 100755
index 0000000..0ce2483
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Hurry.ogg
new file mode 100755
index 0000000..64189dc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Illgetyou.ogg
new file mode 100755
index 0000000..60ce659
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Incoming.ogg
new file mode 100755
index 0000000..1d1e955
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Jump1.ogg
new file mode 100755
index 0000000..052a484
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Jump2.ogg
new file mode 100755
index 0000000..900fb61
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Jump3.ogg
new file mode 100755
index 0000000..b0ecc36
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Justyouwait.ogg
new file mode 100755
index 0000000..d3c52f0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Kamikaze.ogg
new file mode 100755
index 0000000..3293707
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Laugh.ogg
new file mode 100755
index 0000000..ef2ca36
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Leavemealone.ogg
new file mode 100755
index 0000000..c365357
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Melon.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Melon.ogg
new file mode 100755
index 0000000..97a6d51
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Missed.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Missed.ogg
new file mode 100755
index 0000000..d52006d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Nooo.ogg
new file mode 100755
index 0000000..5f302fb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Nutter.ogg
new file mode 100755
index 0000000..91ba6ef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ohdear.ogg
new file mode 100755
index 0000000..2f588f6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ooff1.ogg
new file mode 100755
index 0000000..6c22773
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ooff2.ogg
new file mode 100755
index 0000000..0e2e03c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ooff3.ogg
new file mode 100755
index 0000000..60ea04a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Oops.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Oops.ogg
new file mode 100755
index 0000000..746b81e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ouch.ogg
new file mode 100755
index 0000000..f647738
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ow1.ogg
new file mode 100755
index 0000000..0478828
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ow2.ogg
new file mode 100755
index 0000000..5644451
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ow3.ogg
new file mode 100755
index 0000000..84b4320
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Ow4.ogg
new file mode 100755
index 0000000..d92975c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Perfect.ogg
new file mode 100755
index 0000000..de51e4f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Pirate/PoisonCough.ogg
new file mode 100755
index 0000000..cea40d2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Pirate/PoisonMoan.ogg
new file mode 100755
index 0000000..9f8cf0d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Reinforcements.ogg
new file mode 100755
index 0000000..e142c57
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Revenge.ogg
new file mode 100755
index 0000000..13434b7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Runaway.ogg
new file mode 100755
index 0000000..24fc5db
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Sameteam.ogg
new file mode 100755
index 0000000..c350c5b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Solong.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Solong.ogg
new file mode 100755
index 0000000..3642028
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Stupid.ogg
new file mode 100755
index 0000000..d54b228
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Takecover.ogg
new file mode 100755
index 0000000..2bba475
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Thisoneismine.ogg
new file mode 100755
index 0000000..cfd5cde
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Traitor.ogg
new file mode 100755
index 0000000..1f8eab4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Uh-oh.ogg
new file mode 100755
index 0000000..30633a0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Victory.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Victory.ogg
new file mode 100755
index 0000000..d75edde
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Watchit.ogg
new file mode 100755
index 0000000..b08a646
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Watchthis.ogg
new file mode 100755
index 0000000..9c6953b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Whatthe.ogg
new file mode 100755
index 0000000..f756424
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Whoopsee.ogg
new file mode 100755
index 0000000..8fa3b8b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Yessir.ogg
new file mode 100755
index 0000000..6f0a337
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Pirate/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Pirate/Youllregretthat.ogg
new file mode 100755
index 0000000..30bc429
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Pirate/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Robot/Amazing.ogg
new file mode 100755
index 0000000..c6972ad
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Boring.ogg b/project_files/AudioMono/Sounds/voices/Robot/Boring.ogg
new file mode 100755
index 0000000..a50da72
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Robot/Brilliant.ogg
new file mode 100755
index 0000000..ed2ceff
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Robot/Bugger.ogg
new file mode 100755
index 0000000..241c218
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Robot/Bungee.ogg
new file mode 100755
index 0000000..9a8b845
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Robot/Byebye.ogg
new file mode 100755
index 0000000..4c8d95d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Robot/Comeonthen.ogg
new file mode 100755
index 0000000..6343249
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Coward.ogg b/project_files/AudioMono/Sounds/voices/Robot/Coward.ogg
new file mode 100755
index 0000000..09cb9b6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Robot/Cutitout.ogg
new file mode 100755
index 0000000..73602a8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Drat.ogg b/project_files/AudioMono/Sounds/voices/Robot/Drat.ogg
new file mode 100755
index 0000000..af56cc7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Robot/Enemydown.ogg
new file mode 100755
index 0000000..13853e4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Robot/Excellent.ogg
new file mode 100755
index 0000000..7f31b27
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Fire.ogg b/project_files/AudioMono/Sounds/voices/Robot/Fire.ogg
new file mode 100755
index 0000000..e93a9c8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch1.ogg
new file mode 100755
index 0000000..43ad335
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch2.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch2.ogg
new file mode 100755
index 0000000..0a02b8d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch3.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch3.ogg
new file mode 100755
index 0000000..742ae5c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch4.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch4.ogg
new file mode 100755
index 0000000..961b779
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch5.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch5.ogg
new file mode 100755
index 0000000..b2c9b70
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch5.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firepunch6.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firepunch6.ogg
new file mode 100755
index 0000000..c91eddb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firepunch6.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Robot/Firstblood.ogg
new file mode 100755
index 0000000..99bc528
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Robot/Flawless.ogg
new file mode 100755
index 0000000..99a12c2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Robot/Gonnagetyou.ogg
new file mode 100755
index 0000000..d78ccff
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Robot/Grenade.ogg
new file mode 100755
index 0000000..7e8670a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Hello.ogg b/project_files/AudioMono/Sounds/voices/Robot/Hello.ogg
new file mode 100755
index 0000000..2a2d6de
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Robot/Hmm.ogg
new file mode 100755
index 0000000..36b89da
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Robot/Hurry.ogg
new file mode 100755
index 0000000..3f24807
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Robot/Illgetyou.ogg
new file mode 100755
index 0000000..d3f4e47
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Robot/Incoming.ogg
new file mode 100755
index 0000000..d23d027
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Robot/Jump1.ogg
new file mode 100755
index 0000000..f151c0f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Robot/Jump2.ogg
new file mode 100755
index 0000000..ae68bbb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Robot/Jump3.ogg
new file mode 100755
index 0000000..3e53251
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Robot/Justyouwait.ogg
new file mode 100755
index 0000000..b814813
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Robot/Kamikaze.ogg
new file mode 100755
index 0000000..40c7802
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Robot/Laugh.ogg
new file mode 100755
index 0000000..57e2f38
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Robot/Leavemealone.ogg
new file mode 100755
index 0000000..060bfcc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Melon.ogg b/project_files/AudioMono/Sounds/voices/Robot/Melon.ogg
new file mode 100755
index 0000000..499fa33
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Missed.ogg b/project_files/AudioMono/Sounds/voices/Robot/Missed.ogg
new file mode 100755
index 0000000..21a0777
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Robot/Nooo.ogg
new file mode 100755
index 0000000..d8e4efc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Robot/Nutter.ogg
new file mode 100755
index 0000000..4b9329e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ohdear.ogg
new file mode 100755
index 0000000..57e95cb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ooff1.ogg
new file mode 100755
index 0000000..4aec5e5
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ooff2.ogg
new file mode 100755
index 0000000..ecd1168
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ooff3.ogg
new file mode 100755
index 0000000..c97dc82
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Oops.ogg b/project_files/AudioMono/Sounds/voices/Robot/Oops.ogg
new file mode 100755
index 0000000..a1b160a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ouch.ogg
new file mode 100755
index 0000000..9062c60
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ow1.ogg
new file mode 100755
index 0000000..2c8f758
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ow2.ogg
new file mode 100755
index 0000000..47ace04
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ow3.ogg
new file mode 100755
index 0000000..70bbb4d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Robot/Ow4.ogg
new file mode 100755
index 0000000..fc4fb17
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Robot/Perfect.ogg
new file mode 100755
index 0000000..bc18b4e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Robot/PoisonCough.ogg
new file mode 100755
index 0000000..5beb7cc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Robot/PoisonMoan.ogg
new file mode 100755
index 0000000..9eac742
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Robot/Reinforcements.ogg
new file mode 100755
index 0000000..3ae06c8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Robot/Revenge.ogg
new file mode 100755
index 0000000..df5634c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Robot/Runaway.ogg
new file mode 100755
index 0000000..ea0e6f7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Robot/Sameteam.ogg
new file mode 100755
index 0000000..dd11d38
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Solong.ogg b/project_files/AudioMono/Sounds/voices/Robot/Solong.ogg
new file mode 100755
index 0000000..46f8c33
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Robot/Stupid.ogg
new file mode 100755
index 0000000..22456e7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Robot/Takecover.ogg
new file mode 100755
index 0000000..4e3ba42
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Robot/Thisoneismine.ogg
new file mode 100755
index 0000000..5b496ea
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Robot/Traitor.ogg
new file mode 100755
index 0000000..8def197
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Robot/Uh-oh.ogg
new file mode 100755
index 0000000..453bd92
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Victory.ogg b/project_files/AudioMono/Sounds/voices/Robot/Victory.ogg
new file mode 100755
index 0000000..5609fbc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Robot/Watchit.ogg
new file mode 100755
index 0000000..196fb4c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Robot/Watchthis.ogg
new file mode 100755
index 0000000..ac04249
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Robot/Whatthe.ogg
new file mode 100755
index 0000000..f3de487
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Robot/Whoopsee.ogg
new file mode 100755
index 0000000..7d03396
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Robot/Yessir.ogg
new file mode 100755
index 0000000..5bea3ee
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Robot/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Robot/Youllregretthat.ogg
new file mode 100755
index 0000000..f84a2db
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Robot/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Russian/Amazing.ogg
new file mode 100755
index 0000000..c6d3102
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Boring.ogg b/project_files/AudioMono/Sounds/voices/Russian/Boring.ogg
new file mode 100755
index 0000000..010259e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Russian/Brilliant.ogg
new file mode 100755
index 0000000..3c671c3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Russian/Bugger.ogg
new file mode 100755
index 0000000..63d54f8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Russian/Bungee.ogg
new file mode 100755
index 0000000..9fe764f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Russian/Byebye.ogg
new file mode 100755
index 0000000..e56812e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Russian/Comeonthen.ogg
new file mode 100755
index 0000000..3fa06fe
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Coward.ogg b/project_files/AudioMono/Sounds/voices/Russian/Coward.ogg
new file mode 100755
index 0000000..17e0e96
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Russian/Cutitout.ogg
new file mode 100755
index 0000000..d4093b2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Drat.ogg b/project_files/AudioMono/Sounds/voices/Russian/Drat.ogg
new file mode 100755
index 0000000..6b90e1d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Russian/Enemydown.ogg
new file mode 100755
index 0000000..92b9076
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Russian/Excellent.ogg
new file mode 100755
index 0000000..16afbf9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Fire.ogg b/project_files/AudioMono/Sounds/voices/Russian/Fire.ogg
new file mode 100755
index 0000000..6a41ec6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Russian/Firepunch1.ogg
new file mode 100755
index 0000000..5bfe06e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Russian/Firstblood.ogg
new file mode 100755
index 0000000..96a86c2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Russian/Flawless.ogg
new file mode 100755
index 0000000..6541c8f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Russian/Gonnagetyou.ogg
new file mode 100755
index 0000000..c0cc097
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Russian/Grenade.ogg
new file mode 100755
index 0000000..fa1168a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Hello.ogg b/project_files/AudioMono/Sounds/voices/Russian/Hello.ogg
new file mode 100755
index 0000000..b57997e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Russian/Hmm.ogg
new file mode 100755
index 0000000..4f84ecf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Russian/Hurry.ogg
new file mode 100755
index 0000000..e55c048
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Russian/Illgetyou.ogg
new file mode 100755
index 0000000..eacebdc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Russian/Incoming.ogg
new file mode 100755
index 0000000..377c951
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Russian/Jump1.ogg
new file mode 100755
index 0000000..240b6f6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Russian/Jump2.ogg
new file mode 100755
index 0000000..dd6db0d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Russian/Jump3.ogg
new file mode 100755
index 0000000..79dae66
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Russian/Justyouwait.ogg
new file mode 100755
index 0000000..60c6ef2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Russian/Kamikaze.ogg
new file mode 100755
index 0000000..9bbfc52
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Russian/Laugh.ogg
new file mode 100755
index 0000000..2cdbfe6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Russian/Leavemealone.ogg
new file mode 100755
index 0000000..967e5b4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Melon.ogg b/project_files/AudioMono/Sounds/voices/Russian/Melon.ogg
new file mode 100755
index 0000000..ea79aa8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Missed.ogg b/project_files/AudioMono/Sounds/voices/Russian/Missed.ogg
new file mode 100755
index 0000000..f3243d5
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Russian/Nooo.ogg
new file mode 100755
index 0000000..4f1cf39
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Russian/Nutter.ogg
new file mode 100755
index 0000000..646337a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ohdear.ogg
new file mode 100755
index 0000000..6b64389
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ooff1.ogg
new file mode 100755
index 0000000..9115fd4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ooff2.ogg
new file mode 100755
index 0000000..3b880a3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ooff3.ogg
new file mode 100755
index 0000000..16bb909
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Oops.ogg b/project_files/AudioMono/Sounds/voices/Russian/Oops.ogg
new file mode 100755
index 0000000..e124715
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ouch.ogg
new file mode 100755
index 0000000..3ff6b2e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ow1.ogg
new file mode 100755
index 0000000..d2c6eee
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ow2.ogg
new file mode 100755
index 0000000..a73e079
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ow3.ogg
new file mode 100755
index 0000000..e3d4f89
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Russian/Ow4.ogg
new file mode 100755
index 0000000..1763aac
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Russian/Perfect.ogg
new file mode 100755
index 0000000..2e40aa0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Russian/PoisonCough.ogg
new file mode 100755
index 0000000..4e6b685
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Russian/PoisonMoan.ogg
new file mode 100755
index 0000000..a83ebe6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Russian/Reinforcements.ogg
new file mode 100755
index 0000000..0e13c98
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Russian/Revenge.ogg
new file mode 100755
index 0000000..2be25ab
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Russian/Runaway.ogg
new file mode 100755
index 0000000..f053fef
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Russian/Sameteam.ogg
new file mode 100755
index 0000000..67b6b98
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Solong.ogg b/project_files/AudioMono/Sounds/voices/Russian/Solong.ogg
new file mode 100755
index 0000000..c1f5894
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Russian/Stupid.ogg
new file mode 100755
index 0000000..93d8f9c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Russian/Takecover.ogg
new file mode 100755
index 0000000..d34dc5b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Russian/Thisoneismine.ogg
new file mode 100755
index 0000000..6eb6828
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Russian/Traitor.ogg
new file mode 100755
index 0000000..a4ab4b3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Russian/Uh-oh.ogg
new file mode 100755
index 0000000..732208e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Victory.ogg b/project_files/AudioMono/Sounds/voices/Russian/Victory.ogg
new file mode 100755
index 0000000..da809c9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Russian/Watchit.ogg
new file mode 100755
index 0000000..04a3b18
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Russian/Watchthis.ogg
new file mode 100755
index 0000000..2bfa2e4
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Russian/Whatthe.ogg
new file mode 100755
index 0000000..f7cde04
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Russian/Whoopsee.ogg
new file mode 100755
index 0000000..7bcc834
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Russian/Yessir.ogg
new file mode 100755
index 0000000..7e9aeb6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Russian/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Russian/Youllregretthat.ogg
new file mode 100755
index 0000000..3cc4f6e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Russian/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Singer/Amazing.ogg
new file mode 100755
index 0000000..f22968a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Boring.ogg b/project_files/AudioMono/Sounds/voices/Singer/Boring.ogg
new file mode 100755
index 0000000..90b00a1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Singer/Brilliant.ogg
new file mode 100755
index 0000000..e0353d3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Singer/Bugger.ogg
new file mode 100755
index 0000000..749d5ad
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Singer/Bungee.ogg
new file mode 100755
index 0000000..08b673c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Singer/Byebye.ogg
new file mode 100755
index 0000000..e6a1d1b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Singer/Comeonthen.ogg
new file mode 100755
index 0000000..4327c2e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Coward.ogg b/project_files/AudioMono/Sounds/voices/Singer/Coward.ogg
new file mode 100755
index 0000000..b89934f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Singer/Cutitout.ogg
new file mode 100755
index 0000000..4edf110
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Drat.ogg b/project_files/AudioMono/Sounds/voices/Singer/Drat.ogg
new file mode 100755
index 0000000..c191c8d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Singer/Enemydown.ogg
new file mode 100755
index 0000000..03ed39e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Singer/Excellent.ogg
new file mode 100755
index 0000000..4773d34
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Fire.ogg b/project_files/AudioMono/Sounds/voices/Singer/Fire.ogg
new file mode 100755
index 0000000..1f2906c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch1.ogg
new file mode 100755
index 0000000..5db292e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch2.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch2.ogg
new file mode 100755
index 0000000..29ec1e9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch3.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch3.ogg
new file mode 100755
index 0000000..68a3064
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch4.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch4.ogg
new file mode 100755
index 0000000..b547a86
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch5.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch5.ogg
new file mode 100755
index 0000000..8ce370d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch5.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firepunch6.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firepunch6.ogg
new file mode 100755
index 0000000..5c7b6e6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firepunch6.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Singer/Firstblood.ogg
new file mode 100755
index 0000000..5d4ab3f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Singer/Flawless.ogg
new file mode 100755
index 0000000..53fdd29
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/FlawlessPossibility.ogg b/project_files/AudioMono/Sounds/voices/Singer/FlawlessPossibility.ogg
new file mode 100755
index 0000000..456f9bf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/FlawlessPossibility.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Singer/Gonnagetyou.ogg
new file mode 100755
index 0000000..a50fb99
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Singer/Grenade.ogg
new file mode 100755
index 0000000..423eee2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Hello.ogg b/project_files/AudioMono/Sounds/voices/Singer/Hello.ogg
new file mode 100755
index 0000000..212ee52
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Singer/Hmm.ogg
new file mode 100755
index 0000000..e26b055
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Singer/Hurry.ogg
new file mode 100755
index 0000000..ff8f727
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Singer/Illgetyou.ogg
new file mode 100755
index 0000000..b650d7d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Singer/Incoming.ogg
new file mode 100755
index 0000000..8cee60c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Singer/Jump1.ogg
new file mode 100755
index 0000000..e477718
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Singer/Jump2.ogg
new file mode 100755
index 0000000..5c5b778
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Singer/Jump3.ogg
new file mode 100755
index 0000000..a4b55a2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Singer/Justyouwait.ogg
new file mode 100755
index 0000000..07fc5b9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Singer/Kamikaze.ogg
new file mode 100755
index 0000000..176853d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Singer/Laugh.ogg
new file mode 100755
index 0000000..a266aa8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Singer/Leavemealone.ogg
new file mode 100755
index 0000000..26a7726
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Melon.ogg b/project_files/AudioMono/Sounds/voices/Singer/Melon.ogg
new file mode 100755
index 0000000..6878796
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Missed.ogg b/project_files/AudioMono/Sounds/voices/Singer/Missed.ogg
new file mode 100755
index 0000000..c39bd12
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Singer/Nooo.ogg
new file mode 100755
index 0000000..de764bc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Singer/Nutter.ogg
new file mode 100755
index 0000000..294376f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ohdear.ogg
new file mode 100755
index 0000000..7a50cdc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ooff1.ogg
new file mode 100755
index 0000000..e95d218
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ooff2.ogg
new file mode 100755
index 0000000..27dad8d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ooff3.ogg
new file mode 100755
index 0000000..2162083
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Oops.ogg b/project_files/AudioMono/Sounds/voices/Singer/Oops.ogg
new file mode 100755
index 0000000..da40288
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ouch.ogg
new file mode 100755
index 0000000..f06a4e9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ow1.ogg
new file mode 100755
index 0000000..28b4580
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ow2.ogg
new file mode 100755
index 0000000..e0284f1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ow3.ogg
new file mode 100755
index 0000000..07e90d7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Singer/Ow4.ogg
new file mode 100755
index 0000000..bab241d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Singer/Perfect.ogg
new file mode 100755
index 0000000..47b7fe3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Singer/PoisonCough.ogg
new file mode 100755
index 0000000..07e4e6a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Singer/PoisonMoan.ogg
new file mode 100755
index 0000000..313ea70
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Singer/Reinforcements.ogg
new file mode 100755
index 0000000..cc96433
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Singer/Revenge.ogg
new file mode 100755
index 0000000..cec76df
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Singer/Runaway.ogg
new file mode 100755
index 0000000..c93deab
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Singer/Sameteam.ogg
new file mode 100755
index 0000000..92b1990
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Solong.ogg b/project_files/AudioMono/Sounds/voices/Singer/Solong.ogg
new file mode 100755
index 0000000..8b26f89
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Singer/Stupid.ogg
new file mode 100755
index 0000000..ff3c9a0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Singer/Takecover.ogg
new file mode 100755
index 0000000..8338985
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Singer/Thisoneismine.ogg
new file mode 100755
index 0000000..b6e7dd7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Singer/Traitor.ogg
new file mode 100755
index 0000000..1e38e0f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Singer/Uh-oh.ogg
new file mode 100755
index 0000000..77bdfd2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Victory.ogg b/project_files/AudioMono/Sounds/voices/Singer/Victory.ogg
new file mode 100755
index 0000000..81be426
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/VictoryPossibility.ogg b/project_files/AudioMono/Sounds/voices/Singer/VictoryPossibility.ogg
new file mode 100755
index 0000000..b7d91d3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/VictoryPossibility.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Singer/Watchit.ogg
new file mode 100755
index 0000000..cee5314
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Singer/Watchthis.ogg
new file mode 100755
index 0000000..815bb2e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Singer/Whatthe.ogg
new file mode 100755
index 0000000..9d68ac3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Singer/Whoopsee.ogg
new file mode 100755
index 0000000..3f53478
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Singer/Yessir.ogg
new file mode 100755
index 0000000..5e04a70
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Singer/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Singer/Youllregretthat.ogg
new file mode 100755
index 0000000..92663a9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Singer/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Amazing.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Amazing.ogg
new file mode 100755
index 0000000..4472111
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Amazing.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Boring.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Boring.ogg
new file mode 100755
index 0000000..ba02e3f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Boring.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Brilliant.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Brilliant.ogg
new file mode 100755
index 0000000..d1808f7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Brilliant.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Bugger.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Bugger.ogg
new file mode 100755
index 0000000..3d55a19
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Bugger.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Bungee.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Bungee.ogg
new file mode 100755
index 0000000..d784a99
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Bungee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Byebye.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Byebye.ogg
new file mode 100755
index 0000000..84c4fa2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Byebye.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Comeonthen.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Comeonthen.ogg
new file mode 100755
index 0000000..7f66e60
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Comeonthen.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Coward.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Coward.ogg
new file mode 100755
index 0000000..a51843d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Coward.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Cutitout.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Cutitout.ogg
new file mode 100755
index 0000000..c3d7c09
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Cutitout.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Drat.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Drat.ogg
new file mode 100755
index 0000000..0be2b97
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Drat.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Enemydown.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Enemydown.ogg
new file mode 100755
index 0000000..0c71450
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Enemydown.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Excellent.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Excellent.ogg
new file mode 100755
index 0000000..c75374e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Excellent.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Fire.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Fire.ogg
new file mode 100755
index 0000000..68e6d2e
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Fire.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch1.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch1.ogg
new file mode 100755
index 0000000..aabfba1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch2.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch2.ogg
new file mode 100755
index 0000000..5f061f0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch3.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch3.ogg
new file mode 100755
index 0000000..82a917f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch4.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch4.ogg
new file mode 100755
index 0000000..2755b24
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch5.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch5.ogg
new file mode 100755
index 0000000..ff84b95
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch5.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firepunch6.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch6.ogg
new file mode 100755
index 0000000..9eba55f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firepunch6.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Firstblood.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Firstblood.ogg
new file mode 100755
index 0000000..e0ddbbf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Firstblood.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Flawless.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Flawless.ogg
new file mode 100755
index 0000000..88916b3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Flawless.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Gonnagetyou.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Gonnagetyou.ogg
new file mode 100755
index 0000000..5368fb2
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Gonnagetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Grenade.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Grenade.ogg
new file mode 100755
index 0000000..ab79adc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Grenade.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Hello.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Hello.ogg
new file mode 100755
index 0000000..21b5322
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Hello.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Hmm.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Hmm.ogg
new file mode 100755
index 0000000..1ac4042
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Hmm.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Hurry.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Hurry.ogg
new file mode 100755
index 0000000..081f6fc
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Hurry.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Illgetyou.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Illgetyou.ogg
new file mode 100755
index 0000000..cfbf822
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Illgetyou.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Incoming.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Incoming.ogg
new file mode 100755
index 0000000..439ee88
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Incoming.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Jump1.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Jump1.ogg
new file mode 100755
index 0000000..6645cb0
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Jump1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Jump2.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Jump2.ogg
new file mode 100755
index 0000000..1276308
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Jump2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Jump3.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Jump3.ogg
new file mode 100755
index 0000000..9af0188
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Jump3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Justyouwait.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Justyouwait.ogg
new file mode 100755
index 0000000..c8e7e2b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Justyouwait.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Kamikaze.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Kamikaze.ogg
new file mode 100755
index 0000000..67d8655
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Kamikaze.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Laugh.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Laugh.ogg
new file mode 100755
index 0000000..ca1e709
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Laugh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Leavemealone.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Leavemealone.ogg
new file mode 100755
index 0000000..0035252
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Leavemealone.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Melon.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Melon.ogg
new file mode 100755
index 0000000..81f1f5c
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Melon.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Missed.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Missed.ogg
new file mode 100755
index 0000000..17ad6f3
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Missed.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Nooo.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Nooo.ogg
new file mode 100755
index 0000000..1cea3bb
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Nooo.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Nutter.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Nutter.ogg
new file mode 100755
index 0000000..6b7a28b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Nutter.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ohdear.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ohdear.ogg
new file mode 100755
index 0000000..c02824d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ohdear.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ooff1.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ooff1.ogg
new file mode 100755
index 0000000..4d60919
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ooff1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ooff2.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ooff2.ogg
new file mode 100755
index 0000000..9f71d8a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ooff2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ooff3.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ooff3.ogg
new file mode 100755
index 0000000..f3beac6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ooff3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Oops.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Oops.ogg
new file mode 100755
index 0000000..52cb17d
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Oops.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ouch.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ouch.ogg
new file mode 100755
index 0000000..2ca6b04
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ouch.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ow1.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ow1.ogg
new file mode 100755
index 0000000..ae07a8b
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ow1.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ow2.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ow2.ogg
new file mode 100755
index 0000000..775cd89
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ow2.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ow3.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ow3.ogg
new file mode 100755
index 0000000..a60d9a1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ow3.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Ow4.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Ow4.ogg
new file mode 100755
index 0000000..2b37d5f
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Ow4.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Perfect.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Perfect.ogg
new file mode 100755
index 0000000..df2cace
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Perfect.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/PoisonCough.ogg b/project_files/AudioMono/Sounds/voices/Surfer/PoisonCough.ogg
new file mode 100755
index 0000000..f1d3d09
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/PoisonCough.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/PoisonMoan.ogg b/project_files/AudioMono/Sounds/voices/Surfer/PoisonMoan.ogg
new file mode 100755
index 0000000..dfd08a6
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/PoisonMoan.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Reinforcements.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Reinforcements.ogg
new file mode 100755
index 0000000..5c4e84a
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Reinforcements.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Revenge.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Revenge.ogg
new file mode 100755
index 0000000..b456ad7
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Revenge.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Runaway.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Runaway.ogg
new file mode 100755
index 0000000..2305224
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Runaway.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Sameteam.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Sameteam.ogg
new file mode 100755
index 0000000..c7292f1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Sameteam.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Solong.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Solong.ogg
new file mode 100755
index 0000000..a6b5dde
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Solong.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Stupid.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Stupid.ogg
new file mode 100755
index 0000000..29649bf
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Stupid.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Takecover.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Takecover.ogg
new file mode 100755
index 0000000..d3c40e8
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Takecover.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Thisoneismine.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Thisoneismine.ogg
new file mode 100755
index 0000000..e76edb9
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Thisoneismine.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Traitor.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Traitor.ogg
new file mode 100755
index 0000000..07b3e02
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Traitor.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Uh-oh.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Uh-oh.ogg
new file mode 100755
index 0000000..5083a80
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Uh-oh.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Victory.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Victory.ogg
new file mode 100755
index 0000000..891ed36
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Victory.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Watchit.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Watchit.ogg
new file mode 100755
index 0000000..b65c862
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Watchit.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Watchthis.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Watchthis.ogg
new file mode 100755
index 0000000..4afc270
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Watchthis.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Whatthe.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Whatthe.ogg
new file mode 100755
index 0000000..30cd278
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Whatthe.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Whoopsee.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Whoopsee.ogg
new file mode 100755
index 0000000..c7b7446
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Whoopsee.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Yessir.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Yessir.ogg
new file mode 100755
index 0000000..9a2f168
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Yessir.ogg differ
diff --git a/project_files/AudioMono/Sounds/voices/Surfer/Youllregretthat.ogg b/project_files/AudioMono/Sounds/voices/Surfer/Youllregretthat.ogg
new file mode 100755
index 0000000..cf58db1
Binary files /dev/null and b/project_files/AudioMono/Sounds/voices/Surfer/Youllregretthat.ogg differ
diff --git a/project_files/AudioMono/Sounds/warp.ogg b/project_files/AudioMono/Sounds/warp.ogg
new file mode 100755
index 0000000..8f3212b
Binary files /dev/null and b/project_files/AudioMono/Sounds/warp.ogg differ
diff --git a/project_files/AudioMono/Sounds/whipcrack.ogg b/project_files/AudioMono/Sounds/whipcrack.ogg
new file mode 100755
index 0000000..2bbf65d
Binary files /dev/null and b/project_files/AudioMono/Sounds/whipcrack.ogg differ
diff --git a/project_files/hedgewars.pro b/project_files/hedgewars.pro
index cfebe97..4753772 100644
--- a/project_files/hedgewars.pro
+++ b/project_files/hedgewars.pro
@@ -1,226 +1,261 @@
-TEMPLATE = app
-TARGET = hedgewars
-DEPENDPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/model
-INCLUDEPATH += ../QTfrontend/ui
-INCLUDEPATH += ../QTfrontend/ui/widget
-INCLUDEPATH += ../QTfrontend/ui/page
-INCLUDEPATH += ../QTfrontend/ui/dialog
-INCLUDEPATH += ../QTfrontend/net
-INCLUDEPATH += ../QTfrontend/util
-INCLUDEPATH += /usr/local/include/SDL
-INCLUDEPATH += /usr/include/SDL
-INCLUDEPATH += ../misc/quazip/
-
-DESTDIR = .
-
-win32 {
-	RC_FILE	= ../QTfrontend/res/hedgewars.rc
-}
-
-QT += network
-QT += webkit
-
-HEADERS += ../QTfrontend/model/themesmodel.h \
-    ../QTfrontend/model/ammoSchemeModel.h \
-    ../QTfrontend/model/netserverslist.h \
-    ../QTfrontend/model/hats.h \
-    ../QTfrontend/ui/page/pagedrawmap.h \
-    ../QTfrontend/ui/page/pagedata.h \
-    ../QTfrontend/ui/page/pagetraining.h \
-    ../QTfrontend/ui/page/pageselectweapon.h \
-    ../QTfrontend/ui/page/pagesingleplayer.h \
-    ../QTfrontend/ui/page/pagenettype.h \
-    ../QTfrontend/ui/page/pageingame.h \
-    ../QTfrontend/ui/page/pageadmin.h \
-    ../QTfrontend/ui/page/pagescheme.h \
-    ../QTfrontend/ui/page/pagemultiplayer.h \
-    ../QTfrontend/ui/page/pageplayrecord.h \
-    ../QTfrontend/ui/page/pagemain.h \
-    ../QTfrontend/ui/page/pageoptions.h \
-    ../QTfrontend/ui/page/pagenetgame.h \
-    ../QTfrontend/ui/page/pageeditteam.h \
-    ../QTfrontend/ui/page/pageconnecting.h \
-    ../QTfrontend/ui/page/pageroomslist.h \
-    ../QTfrontend/ui/page/pagenet.h \
-    ../QTfrontend/ui/page/pagecampaign.h \
-    ../QTfrontend/ui/page/pageinfo.h \
-    ../QTfrontend/ui/page/pagenetserver.h \
-    ../QTfrontend/ui/page/pagegamestats.h \
-    ../QTfrontend/ui/dialog/input_ip.h \
-    ../QTfrontend/ui/qaspectratiolayout.h \
-    ../QTfrontend/ui/widget/bgwidget.h \
-    ../QTfrontend/ui/widget/fpsedit.h \
-    ../QTfrontend/ui/widget/FreqSpinBox.h \
-    ../QTfrontend/ui/widget/igbox.h \
-    ../QTfrontend/ui/widget/chatwidget.h \
-    ../QTfrontend/ui/widget/togglebutton.h \
-    ../QTfrontend/ui/widget/SquareLabel.h \
-    ../QTfrontend/ui/widget/itemNum.h \
-    ../QTfrontend/ui/widget/frameTeam.h \
-    ../QTfrontend/ui/widget/teamselect.h \
-    ../QTfrontend/ui/widget/vertScrollArea.h \
-    ../QTfrontend/ui/widget/about.h \
-    ../QTfrontend/ui/widget/teamselhelper.h \
-    ../QTfrontend/ui/widget/drawmapwidget.h \
-    ../QTfrontend/ui/widget/databrowser.h \
-    ../QTfrontend/ui/widget/hedgehogerWidget.h \
-    ../QTfrontend/ui/widget/selectWeapon.h \
-    ../QTfrontend/ui/widget/weaponItem.h \
-    ../QTfrontend/ui/widget/gamecfgwidget.h \
-    ../QTfrontend/ui/widget/mapContainer.h \
-    ../QTfrontend/ui/widget/HistoryLineEdit.h \
-    ../QTfrontend/ui/widget/SmartLineEdit.h \
-    ../QTfrontend/util/HWDataManager.h \
-    ../QTfrontend/net/netregister.h \
-    ../QTfrontend/net/netserver.h \
-    ../QTfrontend/net/netudpwidget.h \
-    ../QTfrontend/net/tcpBase.h \
-    ../QTfrontend/net/proto.h \
-    ../QTfrontend/net/newnetclient.h \
-    ../QTfrontend/net/netudpserver.h \
-    ../QTfrontend/net/hwmap.h \
-    ../QTfrontend/util/namegen.h \
-    ../QTfrontend/ui/page/AbstractPage.h \
-    ../QTfrontend/drawmapscene.h \
-    ../QTfrontend/game.h \
-    ../QTfrontend/gameuiconfig.h \
-    ../QTfrontend/HWApplication.h \
-    ../QTfrontend/hwform.h \
-    ../QTfrontend/util/SDLInteraction.h \
-    ../QTfrontend/team.h \
-    ../QTfrontend/achievements.h \
-    ../QTfrontend/binds.h \
-    ../QTfrontend/ui_hwform.h \
-	../QTfrontend/KB.h \
-    ../QTfrontend/hwconsts.h \
-    ../QTfrontend/sdlkeys.h
-
-SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
-    ../QTfrontend/model/themesmodel.cpp \
-    ../QTfrontend/model/hats.cpp \
-    ../QTfrontend/model/netserverslist.cpp \
-    ../QTfrontend/ui/qaspectratiolayout.cpp \
-    ../QTfrontend/ui/page/pagemain.cpp \
-    ../QTfrontend/ui/page/pagetraining.cpp \
-    ../QTfrontend/ui/page/pageroomslist.cpp \
-    ../QTfrontend/ui/page/pagemultiplayer.cpp \
-    ../QTfrontend/ui/page/pagegamestats.cpp \
-    ../QTfrontend/ui/page/pagenettype.cpp \
-    ../QTfrontend/ui/page/pageeditteam.cpp \
-    ../QTfrontend/ui/page/pagenetgame.cpp \
-    ../QTfrontend/ui/page/pagedata.cpp \
-    ../QTfrontend/ui/page/pagedrawmap.cpp \
-    ../QTfrontend/ui/page/pageplayrecord.cpp \
-    ../QTfrontend/ui/page/pageselectweapon.cpp \
-    ../QTfrontend/ui/page/pageingame.cpp \
-    ../QTfrontend/ui/page/pagenetserver.cpp \
-    ../QTfrontend/ui/page/pagecampaign.cpp \
-    ../QTfrontend/ui/page/pageadmin.cpp \
-    ../QTfrontend/ui/page/pageinfo.cpp \
-    ../QTfrontend/ui/page/pageconnecting.cpp \
-    ../QTfrontend/ui/page/pagesingleplayer.cpp \
-    ../QTfrontend/ui/page/pagenet.cpp \
-    ../QTfrontend/ui/page/pagescheme.cpp \
-    ../QTfrontend/ui/page/pageoptions.cpp \
-    ../QTfrontend/ui/dialog/input_ip.cpp \
-    ../QTfrontend/ui/widget/igbox.cpp \
-    ../QTfrontend/ui/widget/selectWeapon.cpp \
-    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
-    ../QTfrontend/ui/widget/SquareLabel.cpp \
-    ../QTfrontend/ui/widget/frameTeam.cpp \
-    ../QTfrontend/ui/widget/fpsedit.cpp \
-    ../QTfrontend/ui/widget/databrowser.cpp \
-    ../QTfrontend/ui/widget/teamselect.cpp \
-    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
-    ../QTfrontend/ui/widget/chatwidget.cpp \
-    ../QTfrontend/ui/widget/itemNum.cpp \
-    ../QTfrontend/ui/widget/bgwidget.cpp \
-    ../QTfrontend/ui/widget/about.cpp \
-    ../QTfrontend/ui/widget/togglebutton.cpp \
-    ../QTfrontend/ui/widget/vertScrollArea.cpp \
-    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
-    ../QTfrontend/ui/widget/teamselhelper.cpp \
-    ../QTfrontend/ui/widget/drawmapwidget.cpp \
-    ../QTfrontend/ui/widget/weaponItem.cpp \
-    ../QTfrontend/ui/widget/mapContainer.cpp \
-    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
-    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
-    ../QTfrontend/util/HWDataManager.cpp \
-    ../QTfrontend/net/tcpBase.cpp \
-    ../QTfrontend/net/netregister.cpp \
-    ../QTfrontend/net/proto.cpp \
-    ../QTfrontend/net/hwmap.cpp \
-    ../QTfrontend/net/netudpserver.cpp \
-    ../QTfrontend/net/newnetclient.cpp \
-    ../QTfrontend/net/netudpwidget.cpp \
-    ../QTfrontend/net/netserver.cpp \
-    ../QTfrontend/util/namegen.cpp \
-    ../QTfrontend/ui/page/AbstractPage.cpp \
-    ../QTfrontend/achievements.cpp \
-    ../QTfrontend/binds.cpp \
-    ../QTfrontend/drawmapscene.cpp \
-    ../QTfrontend/game.cpp \
-    ../QTfrontend/gameuiconfig.cpp \
-    ../QTfrontend/HWApplication.cpp \
-    ../QTfrontend/hwform.cpp \
-    ../QTfrontend/main.cpp \
-    ../QTfrontend/util/SDLInteraction.cpp \
-    ../QTfrontend/team.cpp \
-    ../QTfrontend/ui_hwform.cpp \
-    ../QTfrontend/hwconsts.cpp
-
-win32 {
-	SOURCES += ../QTfrontend/xfire.cpp
-}
-
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_bg.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_cs.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_de.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_en.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_es.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_fi.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_fr.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_hu.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_it.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ja.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ko.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_lt.ts
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_nl.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_pl.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ru.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_sk.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_sv.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_uk.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts 	 
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
-
-RESOURCES += ../QTfrontend/hedgewars.qrc
-
-LIBS += -L../misc/quazip -lquazip
-
-!macx {
-        LIBS += -lSDL -lSDL_mixer
-} else {
-	QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
-	QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
-	
-	OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm 
-	SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
-			../../build/QTfrontend/hwconsts.cpp
-	HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
-		../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
-		../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
-		../QTfrontend/SparkleAutoUpdater.h 
-	
-	LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED 
-	INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
-	CONFIG += warn_on x86
-
- 	#CONFIG += x86 ppc x86_64 ppc64
-}
+TEMPLATE = app
+TARGET = hedgewars
+DEPENDPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/model
+INCLUDEPATH += ../QTfrontend/ui
+INCLUDEPATH += ../QTfrontend/ui/widget
+INCLUDEPATH += ../QTfrontend/ui/page
+INCLUDEPATH += ../QTfrontend/ui/dialog
+INCLUDEPATH += ../QTfrontend/net
+INCLUDEPATH += ../QTfrontend/util
+INCLUDEPATH += ../misc/quazip/
+
+DESTDIR = ../bin
+
+QT += network
+QT += webkit
+
+HEADERS += ../QTfrontend/model/ThemeModel.h \
+    ../QTfrontend/model/MapModel.h \
+    ../QTfrontend/model/ammoSchemeModel.h \
+    ../QTfrontend/model/netserverslist.h \
+    ../QTfrontend/ui/page/pagedrawmap.h \
+    ../QTfrontend/ui/page/pagedata.h \
+    ../QTfrontend/ui/page/pagetraining.h \
+    ../QTfrontend/ui/page/pageselectweapon.h \
+    ../QTfrontend/ui/page/pagesingleplayer.h \
+    ../QTfrontend/ui/page/pagenettype.h \
+    ../QTfrontend/ui/page/pageingame.h \
+    ../QTfrontend/ui/page/pageadmin.h \
+    ../QTfrontend/ui/page/pagescheme.h \
+    ../QTfrontend/ui/page/pagemultiplayer.h \
+    ../QTfrontend/ui/page/pageplayrecord.h \
+    ../QTfrontend/ui/page/pagemain.h \
+    ../QTfrontend/ui/page/pageoptions.h \
+    ../QTfrontend/ui/page/pagenetgame.h \
+    ../QTfrontend/ui/page/pageeditteam.h \
+    ../QTfrontend/ui/page/pageconnecting.h \
+    ../QTfrontend/ui/page/pageroomslist.h \
+    ../QTfrontend/ui/page/pagenet.h \
+    ../QTfrontend/ui/page/pagecampaign.h \
+    ../QTfrontend/ui/page/pageinfo.h \
+    ../QTfrontend/ui/page/pagenetserver.h \
+    ../QTfrontend/ui/page/pagegamestats.h \
+    ../QTfrontend/ui/dialog/input_ip.h \
+    ../QTfrontend/ui/qaspectratiolayout.h \
+    ../QTfrontend/ui/widget/bgwidget.h \
+    ../QTfrontend/ui/widget/fpsedit.h \
+    ../QTfrontend/ui/widget/FreqSpinBox.h \
+    ../QTfrontend/ui/widget/igbox.h \
+    ../QTfrontend/ui/widget/chatwidget.h \
+    ../QTfrontend/ui/widget/togglebutton.h \
+    ../QTfrontend/ui/widget/SquareLabel.h \
+    ../QTfrontend/ui/widget/itemNum.h \
+    ../QTfrontend/ui/widget/frameTeam.h \
+    ../QTfrontend/ui/widget/teamselect.h \
+    ../QTfrontend/ui/widget/vertScrollArea.h \
+    ../QTfrontend/ui/widget/about.h \
+    ../QTfrontend/ui/widget/teamselhelper.h \
+    ../QTfrontend/ui/widget/drawmapwidget.h \
+    ../QTfrontend/ui/widget/databrowser.h \
+    ../QTfrontend/ui/widget/hedgehogerWidget.h \
+    ../QTfrontend/ui/widget/selectWeapon.h \
+    ../QTfrontend/ui/widget/weaponItem.h \
+    ../QTfrontend/ui/widget/gamecfgwidget.h \
+    ../QTfrontend/ui/widget/mapContainer.h \
+    ../QTfrontend/ui/widget/HistoryLineEdit.h \
+    ../QTfrontend/ui/widget/SmartLineEdit.h \
+    ../QTfrontend/util/DataManager.h \
+    ../QTfrontend/net/netregister.h \
+    ../QTfrontend/net/netserver.h \
+    ../QTfrontend/net/netudpwidget.h \
+    ../QTfrontend/net/tcpBase.h \
+    ../QTfrontend/net/proto.h \
+    ../QTfrontend/net/newnetclient.h \
+    ../QTfrontend/net/netudpserver.h \
+    ../QTfrontend/net/hwmap.h \
+    ../QTfrontend/util/namegen.h \
+    ../QTfrontend/ui/page/AbstractPage.h \
+    ../QTfrontend/drawmapscene.h \
+    ../QTfrontend/game.h \
+    ../QTfrontend/gameuiconfig.h \
+    ../QTfrontend/HWApplication.h \
+    ../QTfrontend/hwform.h \
+    ../QTfrontend/util/SDLInteraction.h \
+    ../QTfrontend/team.h \
+    ../QTfrontend/achievements.h \
+    ../QTfrontend/binds.h \
+    ../QTfrontend/ui_hwform.h \
+    ../QTfrontend/KB.h \
+    ../QTfrontend/hwconsts.h \
+    ../QTfrontend/sdlkeys.h \
+    ../QTfrontend/ui/mouseoverfilter.h \
+    ../QTfrontend/ui/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/page/pagefeedback.h \
+    ../QTfrontend/model/roomslistmodel.h \
+    ../QTfrontend/ui/dialog/input_password.h \
+    ../QTfrontend/ui/widget/colorwidget.h \
+    ../QTfrontend/model/HatModel.h \
+    ../QTfrontend/model/GameStyleModel.h \
+    ../QTfrontend/ui/page/pagevideos.h \
+    ../QTfrontend/net/recorder.h \
+    ../QTfrontend/ui/dialog/ask_quit.h \
+    ../QTfrontend/ui/dialog/upload_video.h \
+    ../QTfrontend/campaign.h \
+    ../QTfrontend/model/playerslistmodel.h \
+    ../QTfrontend/util/LibavInteraction.h
+
+SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
+    ../QTfrontend/model/MapModel.cpp \
+    ../QTfrontend/model/ThemeModel.cpp \
+    ../QTfrontend/model/netserverslist.cpp \
+    ../QTfrontend/ui/qaspectratiolayout.cpp \
+    ../QTfrontend/ui/page/pagemain.cpp \
+    ../QTfrontend/ui/page/pagetraining.cpp \
+    ../QTfrontend/ui/page/pageroomslist.cpp \
+    ../QTfrontend/ui/page/pagemultiplayer.cpp \
+    ../QTfrontend/ui/page/pagegamestats.cpp \
+    ../QTfrontend/ui/page/pagenettype.cpp \
+    ../QTfrontend/ui/page/pageeditteam.cpp \
+    ../QTfrontend/ui/page/pagenetgame.cpp \
+    ../QTfrontend/ui/page/pagedata.cpp \
+    ../QTfrontend/ui/page/pagedrawmap.cpp \
+    ../QTfrontend/ui/page/pageplayrecord.cpp \
+    ../QTfrontend/ui/page/pageselectweapon.cpp \
+    ../QTfrontend/ui/page/pageingame.cpp \
+    ../QTfrontend/ui/page/pagenetserver.cpp \
+    ../QTfrontend/ui/page/pagecampaign.cpp \
+    ../QTfrontend/ui/page/pageadmin.cpp \
+    ../QTfrontend/ui/page/pageinfo.cpp \
+    ../QTfrontend/ui/page/pageconnecting.cpp \
+    ../QTfrontend/ui/page/pagesingleplayer.cpp \
+    ../QTfrontend/ui/page/pagenet.cpp \
+    ../QTfrontend/ui/page/pagescheme.cpp \
+    ../QTfrontend/ui/page/pageoptions.cpp \
+    ../QTfrontend/ui/dialog/input_ip.cpp \
+    ../QTfrontend/ui/widget/igbox.cpp \
+    ../QTfrontend/ui/widget/selectWeapon.cpp \
+    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
+    ../QTfrontend/ui/widget/SquareLabel.cpp \
+    ../QTfrontend/ui/widget/frameTeam.cpp \
+    ../QTfrontend/ui/widget/fpsedit.cpp \
+    ../QTfrontend/ui/widget/databrowser.cpp \
+    ../QTfrontend/ui/widget/teamselect.cpp \
+    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
+    ../QTfrontend/ui/widget/chatwidget.cpp \
+    ../QTfrontend/ui/widget/itemNum.cpp \
+    ../QTfrontend/ui/widget/bgwidget.cpp \
+    ../QTfrontend/ui/widget/about.cpp \
+    ../QTfrontend/ui/widget/togglebutton.cpp \
+    ../QTfrontend/ui/widget/vertScrollArea.cpp \
+    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
+    ../QTfrontend/ui/widget/teamselhelper.cpp \
+    ../QTfrontend/ui/widget/drawmapwidget.cpp \
+    ../QTfrontend/ui/widget/weaponItem.cpp \
+    ../QTfrontend/ui/widget/mapContainer.cpp \
+    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
+    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
+    ../QTfrontend/util/DataManager.cpp \
+    ../QTfrontend/net/tcpBase.cpp \
+    ../QTfrontend/net/netregister.cpp \
+    ../QTfrontend/net/proto.cpp \
+    ../QTfrontend/net/hwmap.cpp \
+    ../QTfrontend/net/netudpserver.cpp \
+    ../QTfrontend/net/newnetclient.cpp \
+    ../QTfrontend/net/netudpwidget.cpp \
+    ../QTfrontend/net/netserver.cpp \
+    ../QTfrontend/util/namegen.cpp \
+    ../QTfrontend/ui/page/AbstractPage.cpp \
+    ../QTfrontend/achievements.cpp \
+    ../QTfrontend/binds.cpp \
+    ../QTfrontend/drawmapscene.cpp \
+    ../QTfrontend/game.cpp \
+    ../QTfrontend/gameuiconfig.cpp \
+    ../QTfrontend/HWApplication.cpp \
+    ../QTfrontend/hwform.cpp \
+    ../QTfrontend/main.cpp \
+    ../QTfrontend/util/SDLInteraction.cpp \
+    ../QTfrontend/team.cpp \
+    ../QTfrontend/ui_hwform.cpp \
+    ../QTfrontend/hwconsts.cpp \
+    ../QTfrontend/ui/mouseoverfilter.cpp \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.cpp \
+    ../QTfrontend/ui/page/pagefeedback.cpp \
+    ../QTfrontend/model/roomslistmodel.cpp \
+    ../QTfrontend/ui/dialog/input_password.cpp \
+    ../QTfrontend/ui/widget/colorwidget.cpp \
+    ../QTfrontend/model/HatModel.cpp \
+    ../QTfrontend/model/GameStyleModel.cpp \
+    ../QTfrontend/ui/page/pagevideos.cpp \
+    ../QTfrontend/net/recorder.cpp \
+    ../QTfrontend/ui/dialog/ask_quit.cpp \
+    ../QTfrontend/ui/dialog/upload_video.cpp \
+    ../QTfrontend/campaign.cpp \
+    ../QTfrontend/model/playerslistmodel.cpp \
+    ../QTfrontend/util/LibavInteraction.cpp
+
+
+TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_bg.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_cs.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_de.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_en.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_es.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fi.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fr.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_hu.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_it.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ja.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ko.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_lt.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_nl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_ru.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sv.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_uk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
+
+RESOURCES += ../QTfrontend/hedgewars.qrc
+
+LIBS += -L../bin -lquazip
+
+macx {
+    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
+    QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
+
+    OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm
+    SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
+               ../../build/QTfrontend/hwconsts.cpp
+    HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
+               ../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
+               ../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
+               ../QTfrontend/SparkleAutoUpdater.h
+
+    LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED
+    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
+    CONFIG += warn_on x86
+    #CONFIG += x86 ppc x86_64 ppc64
+}
+
+win32 {
+    RC_FILE = ../QTfrontend/hedgewars.rc
+    SOURCES += ../QTfrontend/xfire.cpp
+    INCLUDEPATH += ../misc/winutils/include
+    LIBS += -L../misc/winutils/lib
+}
+
+!macx {
+    LIBS += -lSDL -lSDL_mixer
+    !win32 {
+        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
+    }
+}
+
+FORMS +=
diff --git a/project_files/promotional_art/Icon.png b/project_files/promotional_art/Icon.png
new file mode 100644
index 0000000..bf8814a
Binary files /dev/null and b/project_files/promotional_art/Icon.png differ
diff --git a/project_files/promotional_art/Marketplace-header.png b/project_files/promotional_art/Marketplace-header.png
new file mode 100644
index 0000000..477bb10
Binary files /dev/null and b/project_files/promotional_art/Marketplace-header.png differ
diff --git a/project_files/promotional_art/Promo-graphic.png b/project_files/promotional_art/Promo-graphic.png
new file mode 100644
index 0000000..118ae3a
Binary files /dev/null and b/project_files/promotional_art/Promo-graphic.png differ
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt
index 2effe59..ce4e9f8 100644
--- a/share/CMakeLists.txt
+++ b/share/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_subdirectory(hedgewars)
 
-IF(APPLE)
+IF(APPLE OR CROSSAPPLE)
 	#needed for CFBundleVersion and CFBundleShortVersionString
 	FIND_PROGRAM(HGCOMMAND hg)
 	IF (HGCOMMAND AND (EXISTS ${hedgewars_SOURCE_DIR}/.hg))
@@ -24,4 +24,4 @@ IF(APPLE)
 		DESTINATION ../Resources/)
 	install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem"
 		DESTINATION ../Resources/)
-ENDIF(APPLE)
+ENDIF(APPLE OR CROSSAPPLE)
diff --git a/share/Info.plist.in b/share/Info.plist.in
index a45de1a..5c16bf2 100644
--- a/share/Info.plist.in
+++ b/share/Info.plist.in
@@ -23,7 +23,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>${HEDGEWARS_VERSION}</string>
 	<key>NSHumanReadableCopyright</key>
-	<string>Copyright © 2004-2011, Hedgewars Project</string>
+	<string>Copyright © 2004-2012, Hedgewars Project</string>
 	<key>NSAppleScriptEnabled</key>
 	<false/>
 	<key>LSRequiresNativeExecution</key>
@@ -47,11 +47,14 @@
 	<string>${minimum_macosx_version}</string>
 	<key>SUPublicDSAKeyFile</key>
 	<string>dsa_pub.pem</string>
+	<key>SUFeedURL</key>
+	<string>http://www.hedgewars.org/download/appcast.xml</string>
 	<key>CFBundleLocalizations</key>
 	<array>
 		<string>ar</string>
 		<string>bg</string>
 		<string>cs</string>
+		<string>da</string>
 		<string>de</string>
 		<string>el</string>
 		<string>en</string>
@@ -63,14 +66,16 @@
 		<string>it</string>
 		<string>ja</string>
 		<string>ko</string>
+		<string>lt</string>
 		<string>nl</string>
 		<string>pl</string>
 		<string>pt_BR</string>
 		<string>pt_PT</string>
+		<string>ro</string>
 		<string>ru</string>
 		<string>sk</string>
 		<string>sv</string>
-		<string>tr</string>
+		<string>tr_TR</string>
 		<string>uk</string>
 		<string>zh_CN</string>
 		<string>zh_TW</string>
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png b/share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png
index 47419ef..4d8f1ec 100644
Binary files a/share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png and b/share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png differ
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png b/share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png
index fe27811..4e7b771 100644
Binary files a/share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png and b/share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png differ
diff --git a/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt b/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt
index f7f749c..ad5300c 100644
--- a/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt
+++ b/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt
@@ -1,5 +1,5 @@
 file(GLOB AmmoMenuSprites *.png)
-list(REMOVE_ITEM AmmoMenuSprites *@2x.png)
+list(REMOVE_ITEM AmmoMenuSprites *@2x.png Border*.png)
 
 install(FILES
 	${AmmoMenuSprites}
diff --git a/share/hedgewars/Data/Graphics/ExplPart.png b/share/hedgewars/Data/Graphics/ExplPart.png
index 1dea672..5a967bd 100644
Binary files a/share/hedgewars/Data/Graphics/ExplPart.png and b/share/hedgewars/Data/Graphics/ExplPart.png differ
diff --git a/share/hedgewars/Data/Graphics/ExplPart2.png b/share/hedgewars/Data/Graphics/ExplPart2.png
index 5612c02..dcb2e27 100644
Binary files a/share/hedgewars/Data/Graphics/ExplPart2.png and b/share/hedgewars/Data/Graphics/ExplPart2.png differ
diff --git a/share/hedgewars/Data/Graphics/Flags/cm_soviet.png b/share/hedgewars/Data/Graphics/Flags/cm_soviet.png
new file mode 100644
index 0000000..94d4c39
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Flags/cm_soviet.png differ
diff --git a/share/hedgewars/Data/Graphics/Flags/cpu_plain.png b/share/hedgewars/Data/Graphics/Flags/cpu_plain.png
new file mode 100644
index 0000000..2d4471b
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Flags/cpu_plain.png differ
diff --git a/share/hedgewars/Data/Graphics/Graves/dragonball.png b/share/hedgewars/Data/Graphics/Graves/dragonball.png
new file mode 100644
index 0000000..95aa89a
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Graves/dragonball.png differ
diff --git a/share/hedgewars/Data/Graphics/Hats/Reserved/a1ed4756b565d13aaecb1f2b1a556570alwayss.png b/share/hedgewars/Data/Graphics/Hats/Reserved/a1ed4756b565d13aaecb1f2b1a556570alwayss.png
deleted file mode 100644
index 7b73f4d..0000000
Binary files a/share/hedgewars/Data/Graphics/Hats/Reserved/a1ed4756b565d13aaecb1f2b1a556570alwayss.png and /dev/null differ
diff --git a/share/hedgewars/Data/Graphics/Hats/chef.png b/share/hedgewars/Data/Graphics/Hats/Reserved/chef.png
similarity index 100%
copy from share/hedgewars/Data/Graphics/Hats/chef.png
copy to share/hedgewars/Data/Graphics/Hats/Reserved/chef.png
diff --git a/share/hedgewars/Data/Graphics/Hedgehog.png b/share/hedgewars/Data/Graphics/Hedgehog.png
index 24286f6..32d18e2 100644
Binary files a/share/hedgewars/Data/Graphics/Hedgehog.png and b/share/hedgewars/Data/Graphics/Hedgehog.png differ
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amCleaver.png b/share/hedgewars/Data/Graphics/Hedgehog/amCleaver.png
new file mode 100644
index 0000000..eb5f7c3
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Hedgehog/amCleaver.png differ
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amKnife.png b/share/hedgewars/Data/Graphics/Hedgehog/amKnife.png
new file mode 100644
index 0000000..52c255b
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Hedgehog/amKnife.png differ
diff --git a/share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png b/share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png
index 8135f68..c13d750 100644
Binary files a/share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png and b/share/hedgewars/Data/Graphics/Hedgehog/amSineGun.png differ
diff --git a/share/hedgewars/Data/Graphics/LandIce.png b/share/hedgewars/Data/Graphics/LandIce.png
new file mode 100644
index 0000000..9b1e3ce
Binary files /dev/null and b/share/hedgewars/Data/Graphics/LandIce.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka.png
index f29166a..8982f6d 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka.png and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka at 2x.png
index c4f36a5..f026c8c 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka at 2x.png and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Bazooka at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Cluster_Bomb at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Cluster_Bomb at 2x.png
new file mode 100644
index 0000000..255532a
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Cluster_Bomb at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade.png
new file mode 100644
index 0000000..9b8d344
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade at 2x.png
new file mode 100644
index 0000000..f31dd5d
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Grenade at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Rope at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Rope at 2x.png
new file mode 100644
index 0000000..d406c48
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Rope at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun.png
index 0a1e7b3..6acffa5 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun.png and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun at 2x.png
index 1a56a93..d81d8f5 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun at 2x.png and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Shotgun at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Sniper_Rifle.png b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Sniper_Rifle.png
index 04d0d24..1a508c3 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Sniper_Rifle.png and b/share/hedgewars/Data/Graphics/Missions/Training/Basic_Training_-_Sniper_Rifle.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Bamboo_Thicket.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Bamboo_Thicket.png
index 41a0187..35dcc82 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Bamboo_Thicket.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Bamboo_Thicket.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Dangerous_Ducklings.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Dangerous_Ducklings.png
index d5a5120..8dc7eb4 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Dangerous_Ducklings.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Dangerous_Ducklings.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Diver.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Diver.png
index 4639d64..ad5c473 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Diver.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Diver.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Newton_and_the_Hammock.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Newton_and_the_Hammock.png
index d73ae62..6b18941 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Newton_and_the_Hammock.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Newton_and_the_Hammock.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge.png
new file mode 100644
index 0000000..2063ced
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge at 2x.png
new file mode 100644
index 0000000..e0a11da
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_RCPlane_Challenge at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge.png
new file mode 100644
index 0000000..f337fac
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge at 2x.png
new file mode 100644
index 0000000..18793bf
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Rope_Knock_Challenge at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree.png
index 840a438..32ebc45 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree at 2x.png
index 1d235bb..4849313 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree at 2x.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Spooky_Tree at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Teamwork.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Teamwork.png
index f1a6673..ff9c0bd 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Teamwork.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_Teamwork.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_That_Sinking_Feeling.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_That_Sinking_Feeling.png
index 1a225ae..0b619c0 100644
Binary files a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_That_Sinking_Feeling.png and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_That_Sinking_Feeling.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape.png
new file mode 100644
index 0000000..cf4d028
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape at 2x.png
new file mode 100644
index 0000000..7aa8836
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/User_Mission_-_The_Great_Escape at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/Missions/Training/portal at 2x.png b/share/hedgewars/Data/Graphics/Missions/Training/portal at 2x.png
new file mode 100644
index 0000000..0b7462a
Binary files /dev/null and b/share/hedgewars/Data/Graphics/Missions/Training/portal at 2x.png differ
diff --git a/share/hedgewars/Data/Graphics/botlevels.png b/share/hedgewars/Data/Graphics/botlevels.png
new file mode 100644
index 0000000..8e1947b
Binary files /dev/null and b/share/hedgewars/Data/Graphics/botlevels.png differ
diff --git a/share/hedgewars/Data/Graphics/cleaver.png b/share/hedgewars/Data/Graphics/cleaver.png
new file mode 100644
index 0000000..6ff7de5
Binary files /dev/null and b/share/hedgewars/Data/Graphics/cleaver.png differ
diff --git a/share/hedgewars/Data/Graphics/knife.png b/share/hedgewars/Data/Graphics/knife.png
new file mode 100644
index 0000000..bc9f673
Binary files /dev/null and b/share/hedgewars/Data/Graphics/knife.png differ
diff --git a/share/hedgewars/Data/Graphics/slider.png b/share/hedgewars/Data/Graphics/slider.png
new file mode 100644
index 0000000..2d15899
Binary files /dev/null and b/share/hedgewars/Data/Graphics/slider.png differ
diff --git a/share/hedgewars/Data/Graphics/star.png b/share/hedgewars/Data/Graphics/star.png
new file mode 100644
index 0000000..7d68944
Binary files /dev/null and b/share/hedgewars/Data/Graphics/star.png differ
diff --git a/share/hedgewars/Data/Locale/cs.lua b/share/hedgewars/Data/Locale/cs.lua
index 6fe12fa..99d3f1a 100644
--- a/share/hedgewars/Data/Locale/cs.lua
+++ b/share/hedgewars/Data/Locale/cs.lua
@@ -2,156 +2,640 @@ locale = {
       [":("] = ":(",
       ["!!!"] = "!!!",
       ["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
       ["Accuracy Bonus!"] = "Bonus za přesnost!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
       ["a Hedgewars mini-game"] = "Hedgewars mini-hra", -- Space_Invasion, The_Specialists
       ["Aiming Practice"] = "Trénink přesnosti", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
       ["Ammo Depleted!"] = "Munice vyčerpána!",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
       ["Ammo Maniac!"] = "Muniční maniak!",
       ["Ammo"] = "Munice",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
       ["Available points remaining: "] = "Zbývá bodů:",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
       ["Bat balls at your enemies and|push them into the sea!"] = "Odpal míčky na své nepřátele|a odstrč je do vody!",
       ["Bat your opponents through the|baskets and out of the map!"] = "Odpal protivníky skrz|koše a pryč z mapy!",
       ["Bazooka Training"] = "Trénink s bazukou",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
       ["Best laps per team: "] = "Nejlepší kola dle týmů:",
       ["Best Team Times: "] = "Nejlepší týmový čas:",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
       ["Bloody Rookies"] = "Zatravení zelenáči", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
       ["Boom!"] = "Bum!",
       ["BOOM!"] = "BUM!",
       ["Boss defeated!"] = "Velitel poražen!",
       ["Boss Slayer!"] = "Velitel zabit!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
       ["CAPTURE THE FLAG"] = "ZAJMI VLAJKU",
       ["Careless"] = "Neopatrný",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
       ["Clumsy"] = "Nešikovný",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
       ["Codename: Teamwork"] = "Krycí jméno: Týmová práce",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
       ["Complete the track as fast as you can!"] = "Dokonči trasu tak rychle, jak můžeš!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
       ["Congratulations!"] = "Gratuluji!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
       ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Gratuluji! Eliminoval jsi všechny cíle|během stanoveného limitu", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
       ["Control pillars to score points."] = "Obsaď všechny sloupy, abys dostal body.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
       ["Cybernetic Empire"] = "Kybernetická říše",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
       ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "ZATRACENĚ, ZELENÁČI! VYPADNI Z MOJI HLAVY!",
       ["DAMMIT, ROOKIE!"] = "ZATRACENĚ, ZELENÁČI!",
       ["Dangerous Ducklings"] = "Nebezpečná káčátka",
       ["Deadweight"] = "Mrtvá váha",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
       ["Depleted Kamikaze!"] = "Vyčerpaný sebevrah!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
       ["Destroy invaders to score points."] = "Znič nájezdníky k získání bodů.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
       ["Drone Hunter!"] = "Lovec trubců!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
       ["Drowner"] = "Utopenec",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
       ["Each turn you get 1-3 random weapons"] = "Každý tah dostaneš 1-3 náhodné zbraně",
       ["Each turn you get one random weapon"] = "Každý tah dostaneš jednu náhodnou zbraň",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
       ["Eliminate all enemies"] = "Znič všechny nepřátele",
       ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Znič všechny cíle, než ti vyprší čas.|Na tuto misi máš neomezeně munice.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
       ["Eliminate Poison before the time runs out"] = "Odstraň Otravu, než vyprší čas.",
       ["Eliminate the Blue Team"] = "Znič modrý tým",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
       ["Eliminate the enemy specialists."] = "Zabij nepřátelské specialisty",
       ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Znič Jednotku 3378 |- Slabý odpor musí přežít",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
       ["Enjoy the swim..."] = "Užij si plavání...",
       ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
       ["Fastest lap: "] = "Nejrychlejší kolo: ",
       ["Feeble Resistance"] = "Slabý odpor",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
       ["Fire"] = "Oheň",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
       ["Flag captured!"] = "Vlajka zabrána!",
       ["Flag respawned!"] = "Vlajka obnovena!",
       ["Flag returned!"] = "Vlajka navrácena!",
       ["Flags, and their home base will be placed where each team ends their first turn."] = "Vlajky a domovské základny budou umístěny tam, kde každý tým skončí svůj první tah.",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
       ["GAME BEGUN!!!"] = "HRA ZAÄŒALA!!!",
       ["Game Modifiers: "] = "Herní modifikátory: ",
       ["GAME OVER!"] = "KONEC HRY!",
       ["Game Started!"] = "Hra začala!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
       ["Get on over there and take him out!"] = "Běž tamhle a dostaň ho!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
       ["Goal"] = "Cíl",
       ["GO! GO! GO!"] = "Běž! Běž! Běž!",
       ["Good birdy......"] = "Hodný ptáček......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
       ["Good luck out there!"] = "Hodně štěstí tam venku!",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
       ["GOTCHA!"] = "Mám tě!",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
       ["Hahahaha!"] = "Hahahaha!",
       ["Haha, now THAT would be something!"] = "Haha, tak TOHLE bude něco!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
       [" Hapless Hogs left!"] = "Nešťastný ježek odešel!",
       ["Hapless Hogs"] = "Nešťastný ježek",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
       ["Heavy"] = "Těžký",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
       ["Hedgewars-Basketball"] = "Hedgewars-Basketbal",
       ["Hedgewars-Knockball"] = "Hedgewars=Vybíjená",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
       ["Heh, it's not that bad."] = "Heh, to není tak špatné.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
       ["Hit Combo!"] = "Opakovaný zásah!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
       ["Hmmm..."] = "Hmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
       ["Hooray!"] = "Hurá!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
       ["Hunter"] = "Lovec", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
       ["Instructor"] = "Instruktor", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
       ["invaders destroyed"] = "nájezdník zničen",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
       ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "To je dobře, že NÁHLÁ SMRT je 99 tahů vzdálená...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
       ["Jumping is disabled"] = "Skákání je vypnuto",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
       ["Kamikaze Expert!"] = "Expert na sebevraždy!",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
       ["KILLS"] = "ÚLOVKY",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
       ["[Left Shift]"] = "[Levý shift]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
       ["Listen up, maggot!!"] = "Poslouchej, bídný červe!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
       ["|- Mines Time:"] = "|- Časovač min:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["MISSION FAILED"] = "MISE NEÚSPĚŠNÁ", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["MISSION SUCCESSFUL"] = "MISE ÚSPĚŠNÁ", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["MISSION SUCCESS"] = "MISE ÚSPĚŠNÁ",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
       ["Movement: [Up], [Down], [Left], [Right]"] = "Pohyb: [nahoru], [dolu], [vlevo], [vpravo]",
       ["Multi-shot!"] = "Vícenásobná rána!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
       ["Nameless Heroes"] = "Bezejmenní hrdinové",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
       ["NEW CLAN RECORD: "] = "NOVÝ KLANOVÝ REKORD: ",
       ["NEW fastest lap: "] = "NOVÉ nejrychlejší kolo: ",
 --      ["New Mines Per Turn"] = "",
       ["NEW RACE RECORD: "] = "NOVÝ TRAŤOVÝ REKORD: ",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
       ["NOT ENOUGH WAYPOINTS"] = "NEDOSTATEK NAVIGAČNÍCH BODŮ",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
       ["Not So Friendly Match"] = "Ne moc přátelský zápas", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
       ["Oh no! Just try again!"] = "Ale ne! ProstÄ› to zkus znovu!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
       ["Oh no! Time's up! Just try again."] = "Ale ne! Čas vypršel! Zkus to znova!", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
       ["Operation Diver"] = "Operace potápěč",
       ["Opposing Team: "] = "Protivníkův tým: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
       ["Pathetic Hog #%d"] = "Žalostný ježek #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
       ["Per-Hog Ammo"] = "Individuální munice",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
       ["Place more waypoints using [ENTER]"] = "Umísti více navigačních bodů pomocí klávesy [enter]",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
       ["points"] = "body", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
       ["Poison"] = "Otrava",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
       ["Power Remaining"] = "Zbývající energie",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
       ["Press [Precise] to skip intro"] = "Stiskni [přesnost] pro přeskočení",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
       ["Race complexity limit reached."] = "Dosažen limit složitosti závodu.",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
       [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Dones nepřátelskou vlajku do své základny k získání bodů | - První tým se třemi ukořistěními vítězí | - Můžeš bodovat, pokud je tvá vlajka v základně | - Ježci pustí vlajku, pokud jsou zabiti, nebo utopeni | - Upuštěná vlajka může být navrácena, nebo opět zajmuta | - Ježci jsou po smrti oživeni",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
       ["Round Limit"] = "Limit kol",
 --      ["Rounds Complete: "] = "",
       ["Rounds Complete"] = "Dokončených kol",
       ["RULES OF THE GAME [Press ESC to view]"] = "PRAVIDLA HRY [Stiskni ESC pro prohlédnutí]",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
       ["Save as many hapless hogs as possible!"] = "Zachraň tolik nešťastných ježků, kolik jen můžeš!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
       ["SCORE"] = "SKÓRE",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
       ["sec"] = "vt.", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
       ["See ya!"] = "Uvidíme se!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
       ["Shield boosted! +30 power"] = "Štít posílen! +30 energie",
       ["Shield Depleted"] = "Štít vyčerpán",
       ["Shield is fully recharged!"] = "Štít je plně dobit",
@@ -160,61 +644,340 @@ locale = {
       ["Shield OFF:"] = "Štít VYPNUT:",
       ["Shield ON:"] = "Štít ZAPNUT:",
       ["Shield Seeker!"] = "Hledač štítů!",
+--      ["Shotgun"] = "", -- Continental_supplies
       ["Shotgun Team"] = "Brokovnicový tým",
       ["Shotgun Training"] = "Trénink s brokovnicí",
 --      ["shots remaining."] = "",
       ["Silly"] = "Hloupý",
       ["Sinky"] = "Propadlý",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
       ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s je venku a tým %d|má penaltu!| |Skóre:", -- Basketball, Knockball
       ["%s is out and Team %d|scored a point!| |Score:"] = "%s je venku a tým %d|skóruje!| |Skóre:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Odstřelovací trénink",
       ["Sniperz"] = "Snajpři",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
       ["Sponge"] = "Mycí houba",
       ["Spooky Tree"] = "Strašidelný strom",
       ["s|"] = "s|",
       ["s"] = "s", -- GaudyRacer, Space_Invasion
       ["STATUS UPDATE"] = "AKTUALIZACE STAVU", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
       ["Switched to "] = "Přepnut na ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
       ["Team %d: "] = "Tým %d: ",
       ["Team Scores"] = "Týmové skóre", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
       ["That Sinking Feeling"] = "Potopené pocity",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
       ["That was pointless."] = "To bylo bezúčelné.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
       ["The enemy is hiding out on yonder ducky!"] = "Nepřítel se skrývá na tamté kachničce!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
       ["The flag will respawn next round."] = "Vlajka se obnoví příští kolo.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
       ["The Nameless One"] = "Bezejmenný",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
       ["THE SPECIALISTS"] = "SPECIALISTÉ",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
       ["This rain is really something..."] = "Tenhle déšť je opravdu něco...",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
       ["TIME: "] = "ÄŒAS: ",
       ["Timed Kamikaze!"] = "Časovaná sebevražda!",
       ["Time Extended!"] = "Čas prodloužen!",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
       ["Toggle Shield"] = "Přepnout štít",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
       ["Toxic Team"] = "Jedovatý tým", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["TRACK COMPLETED"] = "TRASA KOMPLETNÍ",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
       ["TrophyRace"] = "Závod o trofej",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
       ["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
       ["Turn Time"] = "ÄŒas kola",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
       ["Unit 3378"] = "Jednotka 3378",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
       ["Unlimited Attacks"] = "Neomezeně útoků",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
       ["User Challenge"] = "Výzva",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
       ["Use your rope to get from start to finish as fast as you can!"] = "Použij lano a dostaň se ze startu do cíle, jak nejrychleji umíš!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
       ["Victory for the "] = "Vítězství pro ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
       ["Waypoint placed."] = "Navigační bod umístěn.",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Weapons reset."] = "", -- Highlander
       ["Weapons Reset"] = "ZbranÄ› obnoveny",
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
       ["WINNING TIME: "] = "VÍTĚZNÝ ČAS: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
       ["You'd almost swear the water was rising!"] = "Přísahal bys, že voda stoupá!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
       ["You have SCORED!!"] = "SKÓROVAL jsi!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
       ["You saved"] = "Uložil jsi",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
       ["You've failed. Try again."] = "Zklamal jsi. Zkus to znovu.",
       ["You've reached the goal!| |Time: "] = "Dosáhl jsi cíle!| |Čas: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
       ["'Zooka Team"] = "Bazukáři",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/cs.txt b/share/hedgewars/Data/Locale/cs.txt
index 15ce936..fa7e538 100644
--- a/share/hedgewars/Data/Locale/cs.txt
+++ b/share/hedgewars/Data/Locale/cs.txt
@@ -52,6 +52,10 @@
 00:49=Oživovač
 00:50=Vrtákový útok
 00:51=Hrouda bláta
+00:52=Není vybrána žádná zbraň
+00:53=TimeBox
+00:54=Struktura
+00:55=Pozemek s rozprašovačem
 
 01:00=Do boje!
 01:01=Kolo nerozhodnÄ›
@@ -68,6 +72,12 @@
 01:12=Poslední kolo před Náhlou smrtí!
 01:13=%1 kol do Náhlé smrti!
 01:14=Připrav se, %1!
+01:15=Nepatrný
+01:16=Nízký
+01:17=Normální
+01:18=Vysoký
+01:19=Extrémní
+01:20=%1 odskočit
 
 ; Event messages
 ; Hog (%1) died
@@ -175,7 +185,7 @@
 02:01=%1 má v ranách slanou vodu
 02:01=%1 Å¡el po prknÄ›
 02:01=%1 si dává koupel
-02:01=%1 je moc moc moc mokrý
+02:01=%1 je moc moc moc mokrý
 02:01=%1 si namočil bodliny
 02:01=%1 našel truhlu Mrtvého muže
 
@@ -434,6 +444,11 @@
 03:48=ÄŒas na kladivo!
 03:49=Dělá to, co myslíš
 03:50=Krtkův fanda
+03:51=Nalezeno na zemi
+03:52=NEPOUŽITO
+03:53=Typ 40
+03:54=Vytvořit něco
+03:55=Užitečnost
 
 ; Weapon Descriptions (use | as line breaks)
 04:00=Zaútoč na nepřítele pomocí obyčejného granátu.|Exploduje jakmile časovač dojde k nule.|1-5: Nastavuje časovač|Útok: Drž pro hození větší silou
@@ -487,6 +502,12 @@
 04:47=Zdvojnásob zábavu pomocí dvou ostnatých, zákeřných, lepkavých|min. Vytvoř řetězovou reakci nebo se braň (nebo oboje!)|Útok: Drž pro hození větší silou (dvakrát)
 04:48=Proč by se měli týrat jen krtci? Mlácení ježků může|být stejná zábava! Jedna dobrá rána tímhle kladivem|uštědří poškození za jednu třetinu ježkova zdraví a|zarazí ho pod zem.|Útok: Aktivace
 04:49=Vzkřis své přátele! Ale měj se na pozoru, protože|tohle vzkřísí i tvé protivníky.|Útok: Drž stisknuto pro pomalé oživování|Nahoru: Zrychlí oživování
+04:50=Je někdo skrývá v podzemí?|Vykopat s vrtačkou stávky!|Časovač určuje, jak daleko to bude kopat.
+04:51=Získat ve volném záběru vrhá kouli bláta.|Žihadla bit, a srazí prasata zpět.
+04:52=NEPOUŽITO
+04:53=Vydejte se na dobrodružství v čase a prostoru,|přičemž vaši kamarádi bojovat dál sám.|Být připraven vrátit kdykoliv,|nebo náhlé smrti nebo pokud jsou všichni poraženi.|Prohlášení. Nefunguje v náhlé smrti,|Pokud jste sami, nebo jste-li král.
+04:54=NEÚPLNÝ                  
+04:55=Sprej proud lepkavými vločkami.|Stavět mosty, pohřbít nepřátele, utěsnění tunely.|Buďte opatrní, nechcete dostat každý z vás!
 
 ; Game goal strings
 05:00=Herní módy
@@ -510,3 +531,4 @@
 05:18=Neomezeně útoků
 05:19=ZbranÄ› jsou obnoveny na konci tahu
 05:20=Zbraně nejsou sdíleny mezi ježky
+05:21=Tag týmu: Týmy v klanu se postupně střídají|Sdílené čas: Týmy v rámci podílu klan zase čas
diff --git a/share/hedgewars/Data/Locale/da.lua b/share/hedgewars/Data/Locale/da.lua
new file mode 100644
index 0000000..f4bda19
--- /dev/null
+++ b/share/hedgewars/Data/Locale/da.lua
@@ -0,0 +1,983 @@
+locale = {
+        [":("] = ":(",
+        ["!!!"] = "!!!",
+        ["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
+        ["Accuracy Bonus!"] = "Præcisionsbonus",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+        ["Achievement Unlocked"] = "Bedrift Fuldført", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+        ["a Hedgewars mini-game"] = "et Hedgewars-minispil", -- Space_Invasion, The_Specialists
+        ["Aiming Practice"] = "Sigtetræning", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
+        ["Ammo"] = "Ammunition",
+        ["Ammo Depleted!"] = "Ammunition Udtømt",
+        ["ammo extended!"] = "ammunition udstrakt",
+        ["Ammo is reset at the end of your turn."] = "Ammunition nulstilles i slutningen af turen",
+        ["Ammo Maniac!"] = "Ammunitionsgalskab",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
+        ["Available points remaining: "] = "Tilgængeligt point tilbage: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
+        ["[Backspace]"] = "[Tilbage]",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
+        ["Bamboo Thicket"] = "Bambusbuskads",
+        ["Barrel Eater!"] = "Tøndeæder!",
+        ["Barrel Launcher"] = "Tøndekaster",
+--      ["Baseballbat"] = "", -- Continental_supplies
+        ["Bat balls at your enemies and|push them into the sea!"] = "Slå bolde på dine fjender og|skub dem i havet!",
+        ["Bat your opponents through the|baskets and out of the map!"] = "Slå dine modstandere gennem|kurvene og ud af banen!",
+        ["Bazooka Training"] = "Træning med Bazooka",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
+        ["Best laps per team: "] = "Bedste omgang per hold: ",
+        ["Best Team Times: "] = "Bedste Holdtid: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
+        ["Bloody Rookies"] = "Forbandede Begyndere", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
+        ["Boom!"] = "Bum!",
+        ["BOOM!"] = "BUM!",
+        ["Boss defeated!"] = "Boss besejret!",
+        ["Boss Slayer!"] = "Boss-morder!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
+        ["Build a track and race."] = "Byg en bane og ræs.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
+        ["CAPTURE THE FLAG"] = "EROBR FLAGET",
+        ["Careless"] = "Sløset",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
+        ["Change Weapon"] = "Skift VÃ¥ben",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
+        ["Clumsy"] = "Kluntet",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
+        ["Codename: Teamwork"] = "Kodeord: Samarbejde",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
+        ["Complete the track as fast as you can!"] = "Gennemfør banen så hurtigt som muligt!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+        ["Congratulations!"] = "Tillykke!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
+        ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Tillykke! Du har elimineret alle målene|inden for den tilladte tidsramme.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
+        ["Control pillars to score points."] = "Kontroller søjler for at score point.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
+        ["Cybernetic Empire"] = "Kybernetisk Imperium",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
+        ["DAMMIT, ROOKIE!"] = "FOR HELVEDE, REKRUT!",
+        ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "FOR HELVEDE, REKRUT! KOM NED DERFRA!",
+        ["Dangerous Ducklings"] = "Farlige Ællinger",
+        ["Deadweight"] = "Dødvægt",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
+        ["Demolition is fun!"] = "Nedrivning er sjovt!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
+        ["Depleted Kamikaze!"] = "Udtømt Kamikaze!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Destroy invaders to score points."] = "Tilintetgør indtrængere for at score point.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
+        ["Double Kill!"] = "Dobbeltdrab!",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
+        ["Drone Hunter!"] = "Dronjæger!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
+        ["Drowner"] = "Drukner",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
+        ["Each turn you get 1-3 random weapons"] = "Hver tur får du 1-3 tilfældige våben",
+        ["Each turn you get one random weapon"] = "Hver tur får du ét tilfældigt våben",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
+        ["Eliminate all enemies"] = "Eliminer alle fjender",
+        ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Eliminer all mål før tiden løber ud.|Du har uendelig ammunition under denne mission.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
+        ["Eliminate Poison before the time runs out"] = "Eliminer Giften før tiden løber ud",
+        ["Eliminate the Blue Team"] = "Eliminer det Blå Hold",
+        ["Eliminate the enemy before the time runs out"] = "Eliminer fjenden før tiden løber ud", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+        ["Eliminate the enemy hogs to win."] = "Eliminer fjendens pindsvin for at vinde.",
+        ["Eliminate the enemy specialists."] = "Eliminer fjendens specialister.",
+        ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Eliminer Enhed 3378 |- Sølle Modstandere skal overleve",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+        ["Energetic Engineer"] = "Energisk Ingeniør",
+        ["Enjoy the swim..."] = "Nyd svømmeturen...",
+        ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
+        ["Fastest lap: "] = "Hurtigste omgang: ",
+        ["Feeble Resistance"] = "Sølle Modstand",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+        ["Fire"] = "Skyd",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
+        ["Flag captured!"] = "Flag erobred!",
+        ["Flag respawned!"] = "Flag gendannet!",
+        ["Flag returned!"] = "Flag returneret!",
+        ["Flags, and their home base will be placed where each team ends their first turn."] = "Flag og deres hjemmebase bliver placeret der hvor hvert hold afslutter sin første tur.",
+        ["Flamer"] = "Hetzer",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
+        ["Friendly Fire!"] = "Egenbeskydning!",
+        ["fuel extended!"] = "brændstof udstrakt!",
+        ["GAME BEGUN!!!"] = "SPILLET ER STARTET!!!",
+        ["Game Modifiers: "] = "Spilmodifikatorere",
+        ["GAME OVER!"] = "SPILLET ER FÆRDIGT!",
+        ["Game Started!"] = "Spillet er Startet!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
+        ["Get on over there and take him out!"] = "Kom derover og tag ham ud!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
+        ["Goal"] = "MÃ¥l",
+        ["GO! GO! GO!"] = "GO! GO! GO!",
+        ["Good birdy......"] = "God pipfugl......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
+        ["Good luck out there!"] = "Held og lykke derude!",
+        ["Good so far!"] = "Godt indtil videre!",
+        ["Good to go!"] = "Klar!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
+        ["GOTCHA!"] = "FIK DIG!",
+        ["Grab Mines/Explosives"] = "Snup Miner/Sprængstof",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
+        ["Hahahaha!"] = "Hahahaha!",
+        ["Haha, now THAT would be something!"] = "Haha, ja DET ville være noget!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
+        [" Hapless Hogs left!"] = " Uheldige Pindsvin gik!",
+        ["Hapless Hogs"] = "Uheldige Pindsvin",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
+        ["Health crates extend your time."] = "Kasse med helbredelse forlænger din tid.",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+        ["Heavy"] = "Tung",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
+        ["Hedgewars-Basketball"] = "Hedgewars-Basketball",
+        ["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
+        ["Heh, it's not that bad."] = "Heh, det er ikke så slemt.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Hit Combo!"] = "Slagkombi!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+        ["Hmmm..."] = "Hmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
+        ["Hooray!"] = "Hurra!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
+        ["Hunter"] = "Jæger", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
+        ["Instructor"] = "Instruktør", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
+        ["invaders destroyed"] = "indtrængere tilintetgjorte",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
+        ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Det er heldigt at PLUDSELIG DØD er 99 ture væk...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
+        ["Jumping is disabled"] = "Hop er deaktiveret",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
+        ["Kamikaze Expert!"] = "Kamikaze-ekspert!",
+        ["Keep it up!"] = "Hold gejsten!",
+--      ["Kerguelen"] = "", -- Continental_supplies
+        ["Killing spree!"] = "Drabsorgie!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
+        ["KILLS"] = "DRAB",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
+        ["Last Target!"] = "Sidste MÃ¥l!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+        ["[Left Shift]"] = "[Venstre Shift]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
+        ["Listen up, maggot!!"] = "Lyt efter, maddike!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
+        ["Lively Lifeguard"] = "Livlig Livredder",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
+        ["Mine Deployer"] = "Mineudsætter",
+        ["Mine Eater!"] = "Mineæder",
+        ["|- Mines Time:"] = "|- Tid til Miner:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["MISSION FAILED"] = "MISSION MISLYKKEDES", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["MISSION SUCCESSFUL"] = "MISSION VAR SUCCESFULD", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["MISSION SUCCESS"] = "MISSION LYKKEDES",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
+        ["Movement: [Up], [Down], [Left], [Right]"] = "Bevægelse: [Op], [Ned], [Venstre], [Højre]",
+        ["Multi-shot!"] = "Flerskud!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
+        ["Nameless Heroes"] = "Navnløse Helte",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+        ["New Barrels Per Turn"] = "Nye Tønder Per Tur",
+        ["NEW CLAN RECORD: "] = "NY KLANREKORD: ",
+        ["NEW fastest lap: "] = "NY hurtigste omgang: ",
+        ["New Mines Per Turn"] = "Nyt Antal Miner Per Tur",
+        ["NEW RACE RECORD: "] = "NY RÆSREKORD: ",
+        ["Newton's Hammock"] = "Newtons Hængekøje",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
+        ["NOT ENOUGH WAYPOINTS"] = "IKKE NOK RUTEPUNKTER",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
+        ["Not So Friendly Match"] = "Ikke SÃ¥ Venlig Kamp", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
+        ["Oh no! Just try again!"] = "Åh nej! Bare prøv igen!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+        ["Oh no! Time's up! Just try again."] = "Åh nej! Tiden er løbet ud! Bare prøv igen.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Operation Diver"] = "Operation Dykker",
+        ["Opposing Team: "] = "Modstander: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
+        ["Pathetic Hog #%d"] = "Patetisk Pindsvin #%d",
+        ["Pathetic Resistance"] = "Patetisk Modstand", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Per-Hog Ammo"] = "Ammunition Per Pindsvin",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
+        ["Place more waypoints using [ENTER]"] = "Placer flere rutepunkter med [ENTER]",
+        ["Place more waypoints using the 'Air Attack' weapon."] = "Placer flere rutepunkter med 'Luftangreb'-våbnet",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
+        ["points"] = "point", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
+        ["Poison"] = "Gift",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
+        ["Power Remaining"] = "Kraft Tilbage",
+        ["Prepare yourself"] = "Gør dig klar",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
+        ["Press [Precise] to skip intro"] = "Tryk på [Præcis] for at springe introen over",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+        ["Race complexity limit reached."] = "Kompleksitetsgrænsen for ræset er nået.",
+        ["RACER"] = "RACER",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
+        [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Returner fjendens flag til din base for at score | - Første hold til at erobre 3 flag vinder | - Du kan kun score når dit flag er ved din base | Pindsvin taber flaget hvis de dør eller drukner | - Tabte flag kan returneres eller generobres | - Pindsvin genopliver når de bliver dræbt",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
+        ["Round Limit:"] = "Rundebegrænsning: ",
+        ["Round Limit"] = "Rundebegrænsning",
+        ["Rounds Complete: "] = "Runder Færdiggjort: ",
+        ["Rounds Complete"] = "Runder Færdiggjort",
+        ["RULES OF THE GAME [Press ESC to view]"] = "SPILLETS REGLER [Tryk på ESC for at se]",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
+        ["Save as many hapless hogs as possible!"] = "Red så mange uheldige pindsvin som muligt!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
+        ["SCORE"] = "SCORE",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
+        ["sec"] = "sek.", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
+        ["See ya!"] = "Ses!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
+        ["selected!"] = "valgt",
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
+        ["Shield boosted! +30 power"] = "Skjold forstærket! +30 kraft",
+        ["Shield Depleted"] = "Skjold Udtømt",
+        ["Shield is fully recharged!"] = "Skjold er fuldt genopladt!",
+        ["Shield Master!"] = "Skjoldmester!",
+        ["Shield Miser!"] = "Skjoldgnier!",
+        ["Shield OFF:"] = "Skjold SLÃ…ET FRA:",
+        ["Shield ON:"] = "Skjold SLÃ…ET TIL:",
+        ["Shield Seeker!"] = "Skjoldsøger!",
+--      ["Shotgun"] = "", -- Continental_supplies
+        ["Shotgun Team"] = "Haglgeværdshold",
+        ["Shotgun Training"] = "Træning med Haglgevær",
+        ["shots remaining."] = "skud tilbage.",
+        ["Silly"] = "Fjollet",
+        ["Sinky"] = "Synkende",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
+        ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s er ude og Hold %d|scored en straf!| |Score:", -- Basketball, Knockball
+        ["%s is out and Team %d|scored a point!| |Score:"] = "%s er ude og Hold %d|scored et point!| |Score:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
+        ["Sniper Training"] = "Træning med Sniperriffel",
+        ["Sniperz"] = "Sniperz",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
+        ["Sponge"] = "Svamp",
+        ["Spooky Tree"] = "Uhyggeligt Træ",
+        ["s|"] = "s|",
+        ["s"] = "s", -- GaudyRacer, Space_Invasion
+        ["STATUS UPDATE"] = "STATUSOPDATERING", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Switched to "] = "Skiftede til ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
+        ["Team %d: "] = "Hold %d: ",
+        ["Team Scores"] = "Holdscore", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
+        ["That Sinking Feeling"] = "Følelsen af at Synke",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+        ["That was pointless."] = "Det var meningsløst.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
+        ["The enemy is hiding out on yonder ducky!"] = "Fjenden gemmer sig på rapanden derover!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
+        ["The flag will respawn next round."] = "Flaget gendannes næste runde.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
+        ["The Nameless One"] = "Den Navnløse Ene",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
+        ["THE SPECIALISTS"] = "SPECIALISTERNE",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
+        ["This one's tricky."] = "Den her er drilagtig.",
+        ["This rain is really something..."] = "Det her regnvejr er virkelig noget...",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
+        ["Timed Kamikaze!"] = "Tidsindstillet Kamikaze!",
+        ["Time Extended!"] = "Tid Forlænget!",
+        ["Time Extension"] = "Tidsforlængelse",
+        ["TIME: "] = "TID: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
+        ["Toggle Shield"] = "Slå Skjold Til/Fra",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
+        ["Toxic Team"] = "Giftigt Hold", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["TRACK COMPLETED"] = "BANE FULDFØRT",
+        ["TRACK FAILED!"] = "BANE MISLYKKEDES!",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
+        ["TrophyRace"] = "TrofæRæs",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
+        ["T_T"] = "T_T",
+        ["Tumbling Time Extended!"] = "Tumlende Tid Forlænget",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
+        ["Turn Time"] = "Tid til Tur",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+        ["Unit 3378"] = "Enhed 3378",
+        ["Unit 835"] = "Enhed 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+        ["Unit"] = "Enhed",
+        ["Unlimited Attacks"] = "Uendelige Angreb",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
+        ["Unstoppable!"] = "Ustoppelig!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
+        ["User Challenge"] = "Brugerudfordring",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
+        ["Use your rope to get from start to finish as fast as you can!"] = "Brug dit reb til at komme fra start til slut så hurtigt som muligt!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
+        ["Victory for the "] = "Sejr for ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Waypoint placed."] = "Rutepunkt placeret.",
+        ["Way-Points Remaining"] = "Rutepunkter Tilbage",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Weapons reset."] = "", -- Highlander
+        ["Weapons Reset"] = "VÃ¥ben Nulstillede",
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+        ["Well done."] = "Godt klaret.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
+        ["Will this ever end?"] = "Slutter det her nogensinde?",
+--      ["WINNER IS "] = "", -- Mutant
+        ["WINNING TIME: "] = "VINDENDE TID: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
+        ["You'd almost swear the water was rising!"] = "Man kunne næsten sværge på at vandet steg!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
+        ["You have SCORED!!"] = "Du har SCORET!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
+        ["You saved"] = "Du reddede",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
+        ["You've failed. Try again."] = "Det lykkedes dig ikke. Prøv igen.",
+        ["You've reached the goal!| |Time: "] = "Du har nået målet!| |Tid: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
+        ["'Zooka Team"] = "'Zooka-hold",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+    }
diff --git a/share/hedgewars/Data/Locale/da.txt b/share/hedgewars/Data/Locale/da.txt
new file mode 100644
index 0000000..b1a0e05
--- /dev/null
+++ b/share/hedgewars/Data/Locale/da.txt
@@ -0,0 +1,533 @@
+; Danish locale
+
+00:00=Granat
+00:01=Klyngebombe
+00:02=Bazooka
+00:03=Målsøgende Bi
+00:04=Haglgevær
+00:05=Hakke
+00:06=Spring Over
+00:07=Reb
+00:08=Hakke
+00:09=Desert Eagle
+00:10=Dynamit
+00:11=Bat
+00:12=Shoryuken
+00:13=sek.
+00:14=Faldskærm
+00:15=Luftangreb
+00:16=Mineangreb
+00:17=Skærebrænder
+00:18=Konstruktion
+00:19=Teleportering
+00:20=Skift Pindsvin
+00:21=Granatkaster
+00:22=Pisk
+00:23=Kamikaze
+00:24=Kage
+00:25=Forførelse
+00:26=Vandmelon-bombe
+00:27=Helvedes håndgranat
+00:28=Boreraket
+00:29=Boldpistol
+00:30=Napalm
+00:31=Fjernstyret Modelfly
+00:32=Svag Tyngdekraft
+00:33=Ekstra Skade
+00:34=Udødelig
+00:35=Ekstra Tid
+00:36=Lasersigte
+00:37=Vampyr
+00:38=Sniperriffel
+00:39=Flyvende Tallerken
+00:40=Molotovcocktail
+00:41=Pipfugl
+00:42=HÃ¥ndholdt Portal-Pistol
+00:43=Klaveranslag
+00:44=Gamle Ole
+00:45=Sinusgevær (beta)
+00:46=Flammekaster
+00:47=Klæbrige Miner
+00:48=Hammer
+00:49=Genopliver
+00:50=Boreangreb
+00:51=Mudderklat
+00:52=Intet våben valgt
+00:53=Tidsboks
+00:54=Struktur
+00:55=Jordspray
+
+01:00=Kæmp!
+01:01=Runde uafgjort
+01:02=%1 vinder!
+01:03=Lydstyrke %1%
+01:04=Sat på pause
+01:05=Vil du virkelig forlade spillet (Y/Esc)?
+01:06=Pludselig Død!
+01:07=%1 tilbage
+01:08=Brændstof
+01:09=Synkroniserer...
+01:10=Brug af dette værktøj afslutter ikke din tur!
+01:11=Dette våben eller værktøj er ikke tilgængeligt endnu!
+01:12=Sidste runde før Pludselig Død!
+01:13=%1 runder til Pludselig Død!
+01:14=Gør dig klar, %1!
+01:15=Spinkel
+01:16=Lav
+01:17=Normal
+01:18=Høj
+01:19=Ekstrem
+01:20=%1 Tilbagespring
+
+; Event messages
+; Hog (%1) died
+02:00=%1 har stillet træskoene!
+02:00=%1 har set lyset!
+02:00=%1 så det ikke komme!
+02:00=%1 vinker farvel!
+02:00=%1 ser den anden side af græsplænen!
+02:00=%1 møder sin skaver!
+02:00=%1 kan ikke hænge på mere!
+02:00=%1 har gjort sin pligt!
+02:00=%1 gør det ultimative offer!
+02:00=%1 smutter fra de daglige lidelser!
+02:00=%1 blev en grøntsag!
+02:00=%1 gik time-out!
+02:00=%1 fik fred!
+02:00=%1 vil blive husket!
+02:00=%1 har en aneurisme!
+02:00=%1 efterlader kone og børn
+02:00=%1 har affyret sin sidste bazooka
+02:00=%1 har kastet sin sidste grenade
+02:00=%1 har bagt sin sidste kage
+02:00=%1 har svinget sig i sit sidste reb
+02:00=%1 har indkaldt sit sidste luftangreb
+02:00=%1 har ladt sit sidste haglgevær
+02:00=%1 har kastet sin sidste melon
+02:00=%1 har trukket sin sidste Desert Eagle
+02:00=%1's bægre flød over
+02:00=%1 kunne godt have brugt en bandage
+02:00=%1 er smuttet videre til et sjovere spil
+02:00=%1 forlod rasende livet
+02:00=%1 tabte
+02:00=Stakkels, stakkels %1...
+02:00=%1 kan bedre lide Warmux
+02:00=%1 hoppede ind foran et skud
+02:00=%1 er en helt blandt mæ...ehm...pindsvin
+02:00=%1 bliver budt velkommen i Valhalla
+02:00=%1 har forladt bygningen
+02:00=%1 gik samme vej som dinosaurerne
+02:00=%1 bringer pindsvin et skidt tættere på udrydelse
+02:00=%1 bringer tårerne til mine øjne
+02:00=%1 er et ex-pindsvin
+02:00=%1 smuttede
+02:00=%1 er ikke længere
+02:00=Sig farvel til %1
+02:00=Der er intet håb for %1
+02:00=%1 forsvinder bag det sorte tæppe
+02:00=%1 ligger allerede i kisten
+02:00=%1 lider under en Komplet Spontan Eksistensfejl
+02:00=%1 er gået bort
+02:00=%1 er stendød
+02:00=%1 er ikke mere
+02:00=%1 har nået sidste salgsdato
+02:00=Berøvet sit liv,hviler %1 nu i fred
+02:00=%1 er gået ud af drift
+02:00=Farvel %1, vi lærte dig næsten ikke at kende!
+02:00=%1 havde en lav smerteterskel
+02:00=%1 kunne godt have brugt ni liv
+02:00=Er der en læge i nærheden?
+
+; Hog (%1) drowned
+02:01=%1 leger ubåd!
+02:01=%1 efterligner Titanic!
+02:01=%1 svømmer som en sten!
+02:01=%1 flyder som en mursten!
+02:01=%1 tager et kig på den dybe ende
+02:01=%1 huskede ikke svømmebæltet
+02:01=%1 synker
+02:01=%1 glemte sine badevinger
+02:01=%1 burde virkelig have husket svømmeundervisningen
+02:01=%1 glemte surfbrættet derhjemme
+02:01=%1 skyller op længere nede af strømmen
+02:01=%1 er et vådt pindsvin
+02:01=%1 glemte at medbringe sin livvest
+02:01=%1 leder efter dykkerringe
+02:01=%1 sover med fiskene
+02:01=%1 hader vandfysikken i det her spil
+02:01=%1 ser tørstig ud
+02:01=Havet lagde beslag på %1
+02:01=%1 er fortabt til søs
+02:01=%1 burde have medbragt sit dykkerudstyr
+02:01=%1 får spredt sin aske over havet
+02:01=%1 har føler sig lidt tung bag i
+02:01=%1 øver sig på sin rygcrawl
+02:01=%1 leder efter Titanic
+02:01=%1 er desværre ikke Jesus
+02:01=%1 finder Nemo
+02:01=%1 er sprunget læk
+02:01=Man kan undre sig over, hvor mange pindsvin der er på bunden
+02:01=%1 gør havet lidt mere fast
+02:01=%1 er ikke i flåden
+02:01=%1 parodierer en død fisk
+02:01=I det mindste faldt du ikke i toiletkummen, %1
+02:01=Sonic kunne ikke svømme, og det kan %1 heller ikke
+02:01=%1 leger delfin
+02:01=%1 er taget til Lalandia
+02:01=%1 har fundet den forsvundne by Atlantis
+02:01=%1 håber på en hovedrolle i Bioshock 3
+02:01=Du burde arbejde lidt med din hundesvømning, %1
+02:01=%1 burde have medbragt jetski
+02:01=%1 bryder sig ikke om vandsport
+02:01=%1 blæser bobler
+02:01=%1 mangler en tømmerflåde
+02:01=%1 har hørt saltvand er godt for huden
+02:01=%1 gnider salt i sine sår
+02:01=%1 er gået planken ud
+02:01=%1 tager et bad
+02:01=%1 er meget våd
+02:01=%1 får våde pigge
+02:01=%1 synker til bunds
+
+; Round starts
+02:02=Så skal der kæmpes!
+02:02=Vis gevær!
+02:02=SÃ¥ skal der rulles!
+02:02=Så tænder vi op!
+02:02=SÃ¥ starter festen
+02:02=Sidste mand stående
+02:02=Sæt i værk!
+02:02=SÃ¥ skal der rockes!
+02:02=Musikken spiller!
+02:02=Det begynder...
+02:02=Det her er starten på noget stort
+02:02=Velkommen til Hedgewars
+02:02=Velkommen til frontlinjen
+02:02=Knus dine fjender!
+02:02=MÃ¥ det bedste pindsvin vinde
+02:02=Vind eller dø!
+02:02=Der er præmier til vinderen
+02:02=Du kan ikke give op nu
+02:02=Gør klar til dødsskrigene! Nu kommer krigspindsvinene!
+02:02=Hedgewars, produceret af Hedgewars.org
+02:02=Held og lykke, hav det sjovt
+02:02=Du er heldig ikke at være oppe mod Tiyuri
+02:02=Du er heldig ikke at være oppe mod unC0Rr
+02:02=Du er heldig ikke at være oppe mod Nemo
+02:02=Du er heldig ikke at være oppe mod Smaxx
+02:02=Du er heldig ikke at være oppe mod Jessor
+02:02=Giv den hele armen!
+02:02=Taberne ryder op!
+02:02=Lad årtusindets kamp begynde
+02:02=Lad århundredets kamp begynde
+02:02=Lad årtiets kamp begynde
+02:02=Lad årets kamp begynde
+02:02=Lad månedens kamp begynde
+02:02=Lad ugens kamp begynde
+02:02=Lad dagens kamp begynde
+02:02=Lad timens kamp begynde
+02:02=Gør dit bedste!
+02:02=Ødelæg fjenden!
+02:02=Held og lykke
+02:02=Hav det sjovt
+02:02=Kæmp en god kamp
+02:02=Brug feje tricks
+02:02=Kæmp med ære
+02:02=Giv ikke op
+02:02=Overgiv dig aldrig
+02:02=Giv den gas!
+02:02=Lad drabsfesten begynde!
+02:02=Jeg håber du er klar til et slagsmål!
+02:02=Så skal der krudt i røven!
+02:02=Pindsvin taget til næste niveau!
+02:02=Bring kampen til dem!
+02:02=Frygt intet!
+02:02=Vær modig og tapper
+
+; Round ends (win; unused atm)
+02:03=...
+
+; Round ends (draw; unused atm)
+02:04=...
+
+; New health crate
+02:05=Så er der hjælp at hente!
+02:05=Læge!
+02:05=Himmelsk førstehjælp!
+02:05=Wellness til dig
+02:05=Godt helbred... i en kasse!
+02:05=Doktoren ringe
+02:05=Friske bandager!
+02:05=Det her skal nok få dig til at føle dig godt tilpas
+02:05=SÃ¥ er der trylledrik! Ups, forkert spil
+02:05=Saml mig op!
+02:05=Tag den
+02:05=Et sundt mellemmåltid
+02:05=Smertestillende
+02:05=Korrekt dosering: alt hvad du kan finde!
+02:05=Hastelevering
+02:05=Forsyninger!
+
+; New ammo crate
+02:06=Flere våben!
+02:06=Forstærkninger!
+02:06=Tid til at skifte magasin!
+02:06=Gæt hvilket våben der er indeni?
+02:06=Forsyninger!
+02:06=Hvad mon der er i pakken?
+02:06=Julen starter tidligt i år
+02:06=En lille gave!
+02:06=Hastelevering!
+02:06=Det var et mareridt at få den her gennem tolden
+02:06=Destruktivt legetøj fra himlen
+02:06=Advarsel! Sprængfarligt indhold
+02:06=Nap eller spring, frit valg
+02:06=Godter!
+02:06=Mmmmm! Ammunition
+02:06=En lille pakke med koncentreret destruktion
+02:06=Luftpost!
+02:06=Der er ikke pizza i den der pakke
+02:06=Nap den!
+02:06=Så er der våben
+02:06=Lad ikke modstanderen få fat i den dér!
+02:06=Nyt legetøj!
+02:06=En gådefuld pakke!
+
+; New utility crate
+02:07=Værktøjstid!
+02:07=Den her kan måske være nyttig...
+02:07=Nyttige værktøjer!
+02:07=Benyt dig af den her
+02:07=Pås på ryggen
+02:07=Flere værktøjer!
+02:07=Værktøjer til dig!
+02:07=Det her burde klare ærterne!
+02:07=Brug den med omtanke
+02:07=Ã…h, den her er tung
+02:07=Måske får du brug for den her
+
+; Hog (%1) skips his turn
+02:08=%1 er sååå kedelig...
+02:08=%1 gad ikke lige
+02:08=%1 er et dovent pindsvin
+02:08=%1 er tankeløs
+02:08=%1 gav op
+02:08=%1 prøver at sove de andre ihjel
+02:08=%1 springer skamløst sin tur over
+02:08=%1 er meget doven
+02:08=%1 har brug for lidt motivation
+02:08=%1 er pacifist
+02:08=%1 tager sig et pusterum
+02:08=%1 får sig et hvil
+02:08=%1 tager sig en slapper
+02:08=%1 tror ikke på sig selv
+02:08=%1 beslutter sig for slet ikke at gøre noget
+02:08=%1 håber på at modstanderne begår selvmord
+02:08=%1 må være frygtelig at have med til fester
+02:08=%1 gemmer sig under sengen
+02:08=%1 greb ikke chancen
+02:08=%1 besluttede sig for at det bedste han kunne gøre var... ingenting
+02:08=%1 er en pivskid
+02:08=Kluk, kluk, kluk, %1 er en kylling
+02:08=%1 ser lidt uerfaren ud
+02:08=%1 er en bangebuks!
+02:08=%1 venter på Pludselig Død
+02:08=%1 er ikke rigtig den type der slås
+02:08=%1 genovervejer meningen med livet
+02:08=%1 sigter godt, men skyder sjældent
+02:08=%1 ville egentlig ikke i hæren i første omgang
+02:08=Hold op med at spilde vores tid, %1
+02:08=Jeg er skuffet over dig, %1
+02:08=Kom nu, det kan du godt klare bedre, %1
+02:08=%1 er lidt af en kujon
+02:08=%1 har åbenbart andet at lave
+02:08=%1 er stiv af skræk
+02:08=%1 er vist faldet i søvn
+
+; Hog (%1) hurts himself only
+02:09=%1 burde øve sig i at sigte!
+02:09=%1 hader vist sig selv
+02:09=%1 står på den forkerte side!
+02:09=%1 er en sortseer
+02:09=%1 pegede løbet den forkerte vej
+02:09=%1 er en lille sadist
+02:09=%1 er en masochist
+02:09=%1 har ikke nogen selvopholdelsesdrift
+02:09=%1 lavede kludder i den
+02:09=%1 kludrede i den
+02:09=Det var et sølle skud, %1
+02:09=%1 er lidt for uforsvarlige med farlige våben
+02:09=%1 både overveje et karriereskift
+02:09=Værste. Skud. Nogensinde!
+02:09=Nej, nej, nej, %1, du skal skyde på FJENDEN!
+02:09=%1 burde kun sigte efter fjenden
+02:09=%1 bevæger sig et skridt tættere på selvmord
+02:09=%1 hjælper fjenden
+02:09=Det var dumt, %1
+02:09=%1 lever efter mantraet "det skal gøre ondt, før det gør godt"
+02:09=%1 er forvirret
+02:09=%1 sårede sig selv i sin forvirrelse
+02:09=%1 har en særlig evne til at gøre sig selv til grin
+02:09=%1 er en klodsmajor!
+02:09=%1 er klodset
+02:09=%1 viser fjenden hvad han er i stand til
+02:09=Man kan ikke forvente at %1 er perfekt hver gang
+02:09=Bare rolig %1, ingen re perfekte
+02:09=%1 gjorde det med vilje, helt sikkert
+02:09=Jeg skal nok holde munden lukket hvis du også gør, %1
+02:09=Hvor pinligt!
+02:09=Det er jeg helt sikker på at ingen så, %1
+02:09=%1 burde nokke kigge på sin feltmanual igen
+02:09=%1's våben er vist i stykker
+
+; Hog shot an home run (using the bat and another hog)
+02:10=Han kørte den lige hjem!
+02:10=Er det en fugl? Er det et fly? ...
+02:10=Den der er ude!
+
+; Hog (%1) has to leave (team is gone)
+02:11=%1 skal i seng nu!
+02:11=%1 har vist for travlt til spil
+02:11=Mor er klar med aftensmaden!
+02:11=%1 bliver nød til at gå
+
+; Weapon Categories
+03:00=Tidsindstillet Granat
+03:01=Tidsindstillet Granat
+03:02=Balistisk VÃ¥ben
+03:03=Fjernstyret VÃ¥ben
+03:04=Skydevåben (flere skud)
+03:05=Graveværktøj
+03:06=Handling
+03:07=Køretøj
+03:08=Bevægelsesaktiveret Bombe
+03:09=Skydevåben (flere skud)
+03:10=BUM!
+03:11=Bonk!
+03:12=Kampsport
+03:13=UBRUGT
+03:14=Køretøj
+03:15=Luftangreb
+03:16=Luftangreb
+03:17=Graveværktøj
+03:18=Værktøj
+03:19=Køretøj
+03:20=Handling
+03:21=Balistisk VÃ¥ben
+03:22=Kald mig Indiana!
+03:23=(Seriøs) Kampsport
+03:24=Kagen findes!
+03:25=Sminkedåse
+03:26=Saftig Granat
+03:27=Hidsig Granat
+03:28=Balistisk VÃ¥ben
+03:29=Balistisk VÃ¥ben
+03:30=Luftangreb
+03:31=Fjernbetjent Bombe
+03:32=Midlertidig Effekt
+03:33=Midlertidig Effekt
+03:34=Midlertidig Effekt
+03:35=Midlertidig Effekt
+03:36=Midlertidig Effekt
+03:37=Midlertidig Effekt
+03:38=Skydevåben (flere skud)
+03:39=Køretøj
+03:40=Brændspåsættende Granat
+03:41=Stor fan af Squawks
+03:42=Jeg lægger lige en besked...
+; the misspelled "Beethoven" is intentional (-> to beat)
+03:43=Spil en himmelsk solo
+03:44=Mindst holdbar til: 1923
+03:45=Videnskab, det virker!
+03:46=Varm, varm, varm
+03:47=Sæt dem nu et brugbart sted, ikke?
+03:48=Sløjdtimerne vender tilbage
+03:49=Gør lige præcis hvad du forventer
+03:50=Ring til en muldvarp
+03:51=Lige til at samle op
+03:52=UBRUGT
+03:53=Ã…rgang 40
+03:54=Byg noget
+03:55=Værktøj
+
+; Weapon Descriptions (use |as line breaks)
+04:00=Angrib dine fjender med en simpel granat.|Den eksploderer når uret når nul.|1-5: Indstil uret|Angrib: Hold knappen inde for at kaste hårdere
+04:01=Angrib dine fjender med en klyngebombe.|Den splitter sig op i flere bomber når uret|når nul.|1-5: Indstil uret|Angrib: Hold knappen inde for at kaste hårdere
+04:02=Angrib dine fjender med et balistisk projektil|som godt kan rammes af vindstød.|Angrib: Hold knappen inde for at skyde længere
+04:03=Affyr en eksplosiv bi som forsøger at ramme det|valgte mål. Mere præcis hvis du ikke sætter fuld|knald på.|Musemarkør: Vælg mål|Angrib: Hold knappen inde for at give mere fart på
+04:04=Angrib dine fjender med et haglgevær med to skud.|Takket være spredningen behøver du ikke ramme|helt præcist for at gøre skade.|Angrib: Skyd (flere gange)
+04:05=Gå under jorden! Brug hakken til at grave|dig et hul og nå nye højder, ehm...|Angrib: Start eller stop med at grave
+04:06=Keder du dig? Mangler våben? Vil spare på ammunitionen?|Intet problem! bare spring din tur over, kryster!|Angrib: Spring din tur over uden at angribe
+04:07=Overvind store kløfter på kort tid med rebet.|Ram ind i og skub andre pindsvin af vejen|eller lad det regne med granater.|Angrib: Affyr eller slip rebet|Langt Hop: Slip granater eller lignende våben
+04:08=Hold dine fjender på afstand med en mine for foden|af dem eller i tunnelen mellem dem og dig. Husk|at trække dig lidt tilbage før du trykker på aftrækkeren!|Angrib: Læg en mine lige foran dig
+04:09=Ikke så sikker på dine sigteevner? Med Desert Eagle-|pistolen kan du skyde op til fire gange.|Angrib: Skyd (flere gange)
+04:10=Vold er altid en mulighed. Læg en stang dynamit, træd|et skridt tilbage og fjenderne er solgt til stanglakrids.|Angrib: Læg en stang dynamit lige foran dig
+04:11=Et bat der batter. Slå fjenderne ud (af banen)|eller i vandet. Du kan også sende en mine afsted|med luftpost.|Angrib: Slå på alt hvad der står foran dig
+04:12=Gå helt tæt på og slip din indre energi løs med denne|(næsten) dødbringende kampsportsteknik.|Angrib: Udfør en fantastisk Shoryuken.
+04:13=UBRUGT
+04:14=Bange for højder? Nap hellere en faldskærm.|Den folder sig ud hvis du falder for langt|og sikrer dit pindsvin mod at slå sig.|Angrib: Fold paraplyen ud|Langt Hop: Slip granater eller lignende våben
+04:15=Send et fly ind for at angribe dine fjender|med en stribe af bomber.|Venstre/Højre: Vælg angrebsretning|Musemarkør: Vælg målzonen
+04:16=Send et fly ind for at kaste adskillige|miner ned over dine fjender.|Venstre/Højre: Vælg angrebsretning|Musemarkør: Vælg målzonen
+04:17=Brug for ly? Brug skærebrænderen til hurtigt|at grave en tunnel du kan gemme dig i.|Angrib: Start eller stop med at grave
+04:18=Brug for beskyttelse eller for et lille lift?|Placer nogle bærebjælker lige som du ønsker.|Venstre/Højre: Vælg bærebjælke du vil placere|Musemarkør: Placer bærebjælken hvis der er plads til den
+04:19=Hvis den bliver brugt på det rigtige tidpunkt kan teleportation|redde pindsvin fra farlige situationer og efterlade forvirrede fjender.|Musemarkør: Vælg hvor du vil teleportere hen
+04:20=Giver dig mulighed for at bruge et|andet pindsvin denne tur.|Angrib: Muliggør skift af aktivt pindsvin
+04:21=Affyr et granat-agtigt projektil som deler|sig op i mange mindre bomber ved kollision.|Angrib: Affyr med fuld kraft
+04:22=Set på film! Nu kan du være Indiana Jones for en dag!|Pisken er brugbar i mange situationer.|Specielt hvis du lige får lyst til at kaste nogen ud fra et bjerg.|Angrib: Pisk alt hvad der står foran dig
+04:23=Har du alligevel ikke noget at tabe, kan du ofre|er pindsvin og skyde det afsted i en valgfri retning.|Skader alt hvad pindsvinet rammer og slutter af med et stort brag.|Angrib: Affyr dette altødelæggende og dødbringende angreb
+04:24=Tillykke med fødselsdagen! Bare pust lysene ud, og send|kagen hen i den anden ende af bordet|Så får dine "venner" en eksplosiv fest.|Kagen passerer selv svært terræn, men pas på!|Måske springer den lidt tidligere på den måde.|Angrib: Start kagen eller få den til at stoppe og eksplodere
+04:25=Åben sminkedåsen og husk ikke at spare på pudderet.|De andre pindsvin bliver så imponerede, at de|ikke kan undlade at løbe efter dig|(og lige ned i en sprække eller et hul efter behag).|Angrib: Brug sminkedåsen and prøv at forføre et andet pindsvin
+04:26=Kast denne saftige vandmelon efter dine fjender.|Så snart uret ramme nul, splitter den op i|flere eksplosive stykker.|1-5: Indstil uret|Angrib: Hold knappen inde for at kaste hårdere
+04:27=Lad helvedes ild regne ned over dine fjender|med dette dæmoniske sprængstof. Men kom ikke for tæt på,|for der kan godt være mindre flammer efter eksplosionen.|Angrib: Hold knappen inde for at kaste hårdere
+04:28=Kort tid efter du affyrer raketten vil den grave sig|gennem forhindringer og eksplodere så snart dens|lunte bliver antændt eller den rammer jordoverfladen|igen.|Angrib: Hold knappen inde for at affyre med mere kraft
+04:29=Ikke egnet for småbørn! Boldpistolen affyrer |(ulig dens fætter, boltpistolen) masser af små farvede kugler fyldt med sprængstof.|Angrib: Affyr med fuld kraft|Op/Ned: Fortsæt med at sigte
+04:30=Send et fly ind for at kaste napalm ned over|dine fjender. Hvis den rammer kan den destruere|store områder samt et hvilket som helst|uheldigt pindsvin der befinder sig i nærheden.|Venstre/Højre: Vælg angrebsretning|Cursor: Vælg målzone
+04:31=Det Fjernstyrede Fly er det perfekte våben til at samle|kasser op eller angribe pindsvin der er for langt væk.|Du kan enten styre den direkte mod fjenderne|eller kaste nogle bomber først.|Angrib: Send flyet afsted og kast bomber|Langt Hop: Giv en valkyrie et lift til kampens centrum|Venstre/Højre: Styr flyet
+04:32=Svag Tyngdekraft er bedre end nogen slankekur!|Hop højere, svæv længere og send endnu flere|fjender flyvende.|Angrib: Aktiver
+04:33=Nogle gange har du bare brug for lidt mere|skade for virkelig at komme igennem.|Angrib: Aktiver
+04:34=Kom bare an!|Angrib: Aktiver
+04:35=Nogen gange går tiden dræbende langsomt.|Andre gange alt for hurtigt.|Nap et par sekunder ekstra til at angribe i.|Angrib: Aktiver
+04:36=Sigter godt, men rammer skidt? FÃ¥ lidt moderne assistance.|Angrib: Aktiver
+04:37=Du behøver ikke være bange for sollyset. Det holder kun én tur,|men gør det muligt at suge liv ud af de pindsvin|du giver skade til.|Angrib: Aktiver
+04:38=Sniperriflen kan være det mest dødbringende våben i hele|dit arsenal, men virker dårligt på klods hold.|Giver mere skade jo længere der er til målet.|Angrib: Skyd (to gange)
+04:39=Flyv rundt i den Flyvende Talerken.|Den er svær at styre, men giver stor frihed og|mulighed for at bevæge sig på hele banen.|Angrib: Aktiver|Op/Venstre/Højre: Accellerer i en retning|Langt Hop: Slip granater eller lignende våben
+04:40=Tænd op for et flammehav med den (snart)|brændende væske i flasken.|Angrib: Hold inde for at kaste længere
+04:41=Måske slår naturen den Flyvende Talerken. |Pipfuglen kan bære dit pindsvin omkring|og kaste æg ned på dine fjender!|Angrib: Aktiver og kast æg|Op/Venstre/Højre: Flap vingerne i en retning
+04:42=Den Håndholdte Portal-Pistol er i stand til|øjeblikkeligt at transportere dig, dine fjender,|eller dine våben mellem to punkter på banen.|Brug den med omtanke og du vil få...|STOR SUCCES!|Angrib: Affyr en portal|Skift: Skifter mellem portalfarver
+04:43=Få en eksplosiv musikalsk debut!|Smid et klaver ned fra himlen, men husk...|en eller anden skal jo spille på det|og det kommer måske til at koste dig livet!|Musemarkør: Vælg målzone|F1-F9: Spil klaver
+04:44=Det er ikke bare en ost, det er biologisk krigsførsel!|Den giver ikke meget skade når uret rammer nul|men stanken skal nok forgifte alle i nærheden!|1-5: Indstil uret|Angrib: Hold knappen inde for at kaste længere
+04:45=Endelig betaler de endeløse fysiktimer sig.|Afspil en ødelæggende sinusbølge mod dine|modstandere. Men pas på, der er knald på!|(Dette våben er ikke færdigt)|Angrib: Skyd
+04:46=Dæk dine fjender i flydende flammer.|Hjertevarmende, ikke?|Angrib: Aktiver|Up/Down: Fortsæt med at sigte|Venstre/Højre: Ændr på affyringshastigheden
+04:47=Dobbel så meget sjov med to luskede, klæbrige miner.|Sæt en kædereaktion i gang eller forsvar dig|selv (eller begge dele!)|Angrib: Hold knappen inde for at skyde længere (to gange)
+04:48=Hvorfor er det kun muldvarpe vi mishandler?|Det er mindst lige så sjovt at slå til pindsvin!|Et ordentligt slag fra hammeren napper en tredjedel af et|pindsvins liv og slynger det samtidig ned i jorden.|Angrib: Aktiver
+04:49=Genopliv dine venner, men pas på!|Kan også ramme dine fjender|Angrib: Hold knappen inde for langsomt at genoplive|Op: Accelerer genoplivningen
+04:50=Er dine fjender gået under jorden?|Grav dig ind til dem med et Boreangreb!|Uret bestemmer hvor langt du når.
+04:51=Få et skud lige ind med en Mudderklat.|Bider en smule og slår fjender omkuld.
+04:52=UBRUGT
+04:53=Tag på et eventyr gennem tid og rum,|mens du efterlader kampen til dine kammerater.|Vær klar til at vende tilbage når som helst,|eller hvis Pludselig Død indtræder|eller alle dine andre pindsvin dør.|Advarsel! Virker ikke under Pludselig Død,|hvis du er alene eller er Konge.
+04:54=UFÆRDIG                                                                                                                                    
+04:55=Sprøjt rundt med klistrende flammer.|Byg broer, begrav fjender, luk tunneler af.|Pas på ikke selv at få noget på dig.
+
+; Game goal strings
+05:00=Spilsystemer
+05:01=De følgende regler gælder
+05:02=Forter: Forsvar din fæstning; knus dine modstandere!
+05:03=Svag Tyngdekraft: GÃ¥ forsigtigt
+05:04=Udødelighed: Pindsvin er (næsten) udødelige
+05:05=Vampyr: Pindsvin bliver helbredt når de giver skade
+05:06=Karma: Pindsvin tager skade når de giver skade
+05:07=Forsvar Kongen: Undgå at gå skakmat!|Placer din Konge: Vælg et beskyttet sted din konge kan starte
+05:08=Placer Pindsvin: Placer dine pindsvin før spillet starter
+05:09=Artilleri: Pindsvin kan ikke gå for at flytte sig rundt
+05:10=Uforgængeligt Terræn: De fleste våben kan ikke ændre på banen
+05:11=Delt Ammunition: Alle hold af samme farve deler ammunition
+05:12=Mineur: Miner detonerer efter %1 sekund(er)
+05:13=Mineur: Miner detonerer med det samme
+05:14=Mineur: Miner detonerer efter 0 - 5 sekunder
+05:15=Skademodifikator: Alle våben giver %1% skade
+05:16=Alle pindsvin bliver helbredt fuldt ud i slutningen af turen
+05:17=AI-pindsvin genopliver når de dør
+05:18=Uendelige Angreb
+05:19=VÃ¥ben nulstilles i slutningen af turen
+05:20=VÃ¥ben deles ikke mellem pindsvin
+05:21=Tagteam: Hold i en klan tager tur efter hinanden|Delt Tid: Hold i en klan deler tiden til hver tur
diff --git a/share/hedgewars/Data/Locale/de.lua b/share/hedgewars/Data/Locale/de.lua
index 0b044d2..b574d39 100644
--- a/share/hedgewars/Data/Locale/de.lua
+++ b/share/hedgewars/Data/Locale/de.lua
@@ -2,159 +2,644 @@ locale = {
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["Accuracy Bonus!"] = "Präzisions-Bonus!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 	["a Hedgewars mini-game"] = "ein Hedgewars Mini-Spiel", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Zielübung", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 	["Ammo Depleted!"] = "Munition erschöpft!",
 	["ammo extended!"] = "Munition aufgestockt!",
 	["Ammo is reset at the end of your turn."] = "Munition wird am Ende des Spielzuges zurückgesetzt.",
 	["Ammo Maniac!"] = "Munitionsverrückter!",
 	["Ammo"] = "Munition",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 	["Available points remaining: "] = "Verfügbare Punkte verbleibend:",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 	["Barrel Eater!"] = "Fassfresser!",
 	["Barrel Launcher"] = "Fasswerfer",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "Schlage Bälle auf deine Widersacher|und lass sie ins Meer fallen!",
 	["Bat your opponents through the|baskets and out of the map!"] = "Schlage deine Widersacher durch|die Körbe und aus der Karte hinaus!",
 	["Bazooka Training"] = "Bazooka-Training",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Beste Rundenzeiten pro Team: ",
 	["Best Team Times: "] = "Beste Team-Zeiten: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 	["Bloody Rookies"] = "Blutige Anfänger", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 	["Boom!"] = "Bumm!",
 	["BOOM!"] = "KABUMM!",
 	["Boss defeated!"] = "Boss wurde besiegt!",
 	["Boss Slayer!"] = "Boss-Töter!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
     ["Build a track and race."] = "Konstruiere eine Strecke und mach ein Wettrennen.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["CAPTURE THE FLAG"] = "EROBERE DIE FAHNE",
 	["Careless"] = "Achtlos",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Change Weapon"] = "Waffenwechsel",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 	["Clumsy"] = "Hoppla",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 	["Codename: Teamwork"] = "Code-Name: Teamwork",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Complete the track as fast as you can!"] = "Durchlaufe die Strecke so schnell du kannst!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
 	["Congratulations!"] = "Gratulation!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Gratulation! Du hast alle Ziele innerhalb der|verfügbaren Zeit ausgeschaltet.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 	["Control pillars to score points."] = "Kontrolliere die Säulen um Punkte zu erhalten.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Cybernetic Empire"] = "Kybernetisches Imperium",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 	["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "VERDAMMT, REKRUT! RUNTER VON MEINEM KOPF!",
 	["DAMMIT, ROOKIE!"] = "VERDAMMT, REKRUT!",
 --      ["Dangerous Ducklings"] = "",
 	["Deadweight"] = "Gravitus",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 	["Demolition is fun!"] = "Zerstörung macht Spaß!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 	["Depleted Kamikaze!"] = "Munitionsloses Kamikaze!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 	["Destroy invaders to score points."] = "Zerstöre die Angreifer um Punkte zu erhalten.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 	["Drowner"] = "Absäufer",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 	["Each turn you get 1-3 random weapons"] = "Du bekommst jede Runde 1-3 zufällig gewählte Waffen",
 	["Each turn you get one random weapon"] = "Du bekommst jede Runde eine zufällig gewählte Waffe.",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 	["Eliminate all enemies"] = "Vernichte alle Gegner",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Eliminiere alle Ziele bevor die Zeit ausläuft.|Du hast in dieser Mission unbegrenzte Munition.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 	["Eliminate Poison before the time runs out"] = "Neutralisiere das Gift bevor die Zeit abgelaufen ist",
 	["Eliminate the Blue Team"] = "Lösche das Blaue Team aus",
 	["Eliminate the enemy before the time runs out"] = "Vernichte den Feind bevor die Zeit abgelaufen ist", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 	["Eliminate the enemy hogs to win."] = "Vernichte alle gegnerischen Igel um zu gewinnen",
 	["Eliminate the enemy specialists."] = "Vernichte die gegnerischen Spezialisten",
 	["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Vernichte Einheit 3378 |  Kraftloser Widerstand muss überleben",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 	["Enjoy the swim..."] = "Viel Spaß beim Schwimmen...",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Schnellste Runde: ",
 	["Feeble Resistance"] = "Kraftloser Widerstand",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
 	["Fire"] = "Feuer",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 	["Flag captured!"] = "Fahne erobert!",
 	["Flag respawned!"] = "Fahne wieder erschienen!",
 	["Flag returned!"] = "Fahne zurückgebracht!",
 	["Flags, and their home base will be placed where each team ends their first turn."] = "Fahnen und deren Heimatstandort werden dort plaziert wo jedes Team deren ersten Zug beendet.",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 	["fuel extended!"] = "Treibstoff aus!",
 	["GAME BEGUN!!!"] = "SPIEL GESTARTET!!!",
-	["Spielmodifikatoren: "] = "",
+--      ["Game Modifiers: "] = "", -- The_Specialists
 	["GAME OVER!"] = "SPIEL ZU ENDE!",
 	["Game Started!"] = "Spiel Gestartet!]",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 	["Get on over there and take him out!"] = "Mach, dass du hinüber kommst und schalte ihn aus!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 	["Goal"] = "Ziel",
 	["GO! GO! GO!"] = "Bewegung, Bewegung, Bewegung!",
 	["Good birdy......"] = "Braver Vogel......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 	["Good luck out there!"] = "Viel Glück da draußen!",
 	["Good so far!"] = "Gut soweit!",
 	["Good to go!"] = "Startklar!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 	["GOTCHA!"] = "ERWISCHT!",
 	["Grab Mines/Explosives"] = "Sammle Minen/Fässer",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 	["Haha, now THAT would be something!"] = "Haha, na DAS wär ja was!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 	["Hapless Hogs"] = "Glücklose Igel",
 	[" Hapless Hogs left!"] = " Glücklose Igel verbleibend!",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 	["Health crates extend your time."] = "Medipacks verlängern deine Zeit.",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Heavy"] = "Schwierig",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Basketball",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 	["Heh, it's not that bad."] = "Hehe, so schlimm ist es nicht.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
 --      ["Hmmm..."] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 	["Hooray!"] = "Hurra!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Jäger", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 	["Instructor"] = "Ausbilder", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 	["invaders destroyed"] = "Angreifer zerstört",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 	["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Gut, dass SUDDEN DEATH noch 99 Runden entfernt ist...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 	["Jumping is disabled"] = "Sprünge sind deaktiviert!",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 	["Kamikaze Expert!"] = "Kamikazeexperte!",
 	["Keep it up!"] = "Weiter so!",
+--      ["Kerguelen"] = "", -- Continental_supplies
 	["Killing spree!"] = "Blutrausch!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 	["Last Target!"] = "Letzte Zielscheibe!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Listen up, maggot!!"] = "Aufgepasst, du Made!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 	["Mine Deployer"] = "Minenleger",
 	["Mine Eater!"] = "Minenfresser!",
 	["|- Mines Time:"] = "| - Minenzündzeit: ", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION FAILED"] = "MISSION GESCHEITERT", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESSFUL"] = "MISSION ERFOLGREICH", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESS"] = "MISSIONSERFOLG",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 	["Movement: [Up], [Down], [Left], [Right]"] = "Bewegung: [Hoch], [Runter], [Links], [Rechts]",
 --      ["Multi-shot!"] = "",
 	["Munition!"] = "Munition erschöpft!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 	["Nameless Heroes"] = "Namenlose Helden",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 	["New Barrels Per Turn"] = "Neue Fässer jede Runde",
 	["NEW CLAN RECORD: "] = "NEUER KLAN-REKORD",
 	["NEW fastest lap: "] = "NEUE schnellste Runde: ",
 	["New Mines Per Turn"] = "Neue Minen jede Runde",
 	["NEW RACE RECORD: "] = "NEUER RENNREKORD: ",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 	["NOT ENOUGH WAYPOINTS"] = "NICHT GENUG WEGPUNKTE",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "Kein-so-Freundschaftsspiel", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 	["Oh no! Just try again!"] = "Oh nein! Versuch's nochmal!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Oh nein! Die Zeit ist um! Versuche es nochmal.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Operation Diver"] = "",
 	["Opposing Team: "] = "Gegnerisches Team: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 	["Pathetic Hog #%d"] = "Erbärmlicher Igel #%d",
 	["Pathetic Resistance"] = "Erbärmlicher Widerstand", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 	["Per-Hog Ammo"] = "Munition pro Igel",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 	["Place more waypoints using [ENTER]"] = "Setze mehr Wegpunkte durch Drücken von [ENTER]",
 	["Place more waypoints using the 'Air Attack' weapon."] = "Platziere mehr Wegpunkte durch Verwenden der 'Luftangriff'-Waffe",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 	["points"] = "Punkte", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 	["Poison"] = "Gift",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 	["Power Remaining"] = "Verbleibende Energie",
 	["Prepare yourself"] = "Mach dich bereit",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+	["PUNKTESTAND"] = "",
 	["Race complexity limit reached."] = "Rennkomplexitätslimit erreicht.",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 	[" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Bringe die gegnerische Flagge zu deiner Heimatbasis um zu punkten. | - Das Team das zuerst 3 Flaggen erobert gewinnt. | - Du kannst nur punkten wenn deine eigene Flagge in deiner Basis ist | - Igel lassen die Flagge fallen wenn sie sterben oder ertrinken | - Fallen gelassene Flaggen können zurückgebracht oder wieder gestohlen werden | - Igel tauchen nach ihrem Tod wieder auf",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 	["Round Limit"] = "Rundenbegrenzung",
 --      ["Rounds Complete: "] = "",
 	["Rounds Complete"] = "Runden Gespielt",
 	["RULES OF THE GAME [Press ESC to view]"] = "SPIEL REGELN (Drücke ESC zum Anzeigen)",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 	["Save as many hapless hogs as possible!"] = "Rette so viele glücklose Igel als möglich!",
-	["PUNKTESTAND"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
+--      ["SCORE"] = "", -- Space_Invasion
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 	["See ya!"] = "Mach's gut!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 	["selected!"] = "ausgewählt!",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 	["Shield boosted! +30 power"] = "Schild verstärkt! +30 Energie",
 	["Shield Depleted"] = "Schild aufgebraucht!",
 	["Shield is fully recharged!"] = "Schild vollständig aufgeladen!",
@@ -163,60 +648,340 @@ locale = {
 	["Shield OFF:"] = "Schild AUS:",
 	["Shield ON:"] = "Schild AN:",
 	["Shield Seeker!"] = "Schildsucher!",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Schrotflinten-Team",
 	["Shotgun Training"] = "Schrotflinten-Training",
 	["shots remaining."] = "Schüsse übrig",
 	["Silly"] = "Doofi",
 	["Sinky"] = "Blubb",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s ist draußen und Team %d|erhält eine Strafe!| |Punktestand:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s ist draußen und Team %d|erhält einen Punkt!| |Punktestand:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Scharfschützen-Training",
 	["Sniperz"] = "Heckenschützen",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+	["Spielmodifikatoren: "] = "",
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 	["Sponge"] = "Schwamm",
 --      ["Spooky Tree"] = "",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 	["Switched to "] = "Gewechselt zu ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 --	["Team %d: "] = "",
 	["Team Scores"] = "Teampunktestand", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["That was pointless."] = "Das war sinnlos.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 	["The enemy is hiding out on yonder ducky!"] = "Der Feind versteckt sich auf dem Entlein dort drüben!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 	["The flag will respawn next round."] = "Die Fahne wird nächste Runde wieder auftauchen.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 	["The Nameless One"] = "Der Namenlose",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 	["THE SPECIALISTS"] = "DIE SPEZIALISTEN",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 	["This one's tricky."] = "Der hier ist knifflig.",
 	["This rain is really something..."] = "Das nenne ich mal einen Regenschauer...",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 	["Timed Kamikaze!"] = "Pünktliches Kamikaze!",
 	["Time Extended!"] = "Zeit verlängert!",
 	["Time Extension"] = "Zeitverlängerung",
 	["Time Left: "] = "Verbleibende Zeit",
 	["TIME: "] = "ZEIT: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 	["Toggle Shield"] = "Schild ein/aus",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 	["Toxic Team"] = "Giftige Gegner", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["TRACK COMPLETED"] = "STRECKENLAUF BEENDET",
 	["TRACK FAILED!"] = "STRECKENLAUF GESCHEITERT",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 --	["TrophyRace"] = "",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 --      ["T_T"] = "",
 	["Tumbling Time Extended!"] = "Purzelzeit verlängert!",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 	["Turn Time"] = "Zeit pro Zug",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 	["Unit 3378"] = "Einheit 3378",
 	["Unit 835"] = "Einheit 3378",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 	["Unit"] = "Einheit",
 	["Unlimited Attacks"] = "Unbegrenzte Angriffe",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Unstoppable!"] = "Unaufhaltbar!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Nutze das Seil um von Start zu Ziel zu gelangen - so schnell du kannst!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 	["Victory for the "] = "Sieg für ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 	["Waypoint placed."] = "Wegpunkt gesetzt",
 	["Way-Points Remaining"] = "Wegpunkte verbleibend",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Weapons reset."] = "", -- Highlander
 	["Weapons Reset"] = "Waffenzurücksetzung",
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 	["Well done."] = "Gut gemacht.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 	["Will this ever end?"] = "Wird dies je enden?",
+--      ["WINNER IS "] = "", -- Mutant
 	["WINNING TIME: "] = "BESTZEIT: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 	["You'd almost swear the water was rising!"] = "Man könnte fast schwören das Wasser würde steigen!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 	["You have SCORED!!"] = "Du hast GEPUNKTET!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 	["You saved"] = "Gerettet: ",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 	["You've failed. Try again."] = "Du bist gescheitert. Versuche es nochmal.",
 	["You've reached the goal!| |Time: "] = "Ziel erreicht!| |Zeit: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Die Knalltüten",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/de.txt b/share/hedgewars/Data/Locale/de.txt
index 33e4509..5523092 100644
--- a/share/hedgewars/Data/Locale/de.txt
+++ b/share/hedgewars/Data/Locale/de.txt
@@ -56,6 +56,8 @@
 00:53=ZeitBox
 00:54=Bauwerk
 00:55=Landkanone
+00:56=Gefrierer
+00:57=Hackbeil
 
 
 01:00=Auf in die Schlacht!
@@ -81,6 +83,7 @@
 01:18=Hohe
 01:19=Extreme
 01:20=%1 Sprungkraft
+01:21=Audio Stumm
 
 ; Event messages
 ; Hog (%1) died
@@ -103,6 +106,47 @@
 02:00=%1 war einmal.
 02:00=%1 hat wohl versagt.
 02:00=Mach's gut, %1!
+02:00=%1 hinterlässt eine Frau und Kind
+02:00=%1 ins Leben gerufen hat seine letzte Panzerfaust
+02:00=%1 hat seine letzte Granate geworfen
+02:00=%1 hat seine letzte Kuchen gebacken
+02:00=%1 hat auf seiner letzten Seil schwangen
+02:00=%1 genannt hat seinen letzten Luftangriff
+02:00=%1 gepumpt hat seine letzte Schrotflinte
+02:00=%1 geworfen hat seine letzte Melone
+02:00=%1 gezogen hat seinen letzten deagle
+02:00=%1 nahm einen Schuss zu viel
+02:00=%1 könnte wirklich eine gesundheitliche Kiste verwendet haben
+02:00=%1 gegangen ist, um ein besseres Spiel zu spielen
+02:00=%1 hat ragequit Leben
+02:00=%1 scheitert
+02:00=Schlecht schlecht %1...
+02:00=%1 lieber Warmux
+02:00=%1 wurde blockiert Schüsse mit seinem Gesicht
+02:00=%1 ist ein Held unter mir ... err ... Schweine
+02:00=%1 findet seinen Platz in der Walhalla
+02:00=%1 hat das Gebäude verlassen
+02:00=%1 geht den Weg der Dinosaurier
+02:00=%1 Igel bringt, einen Schritt näher zum Aussterben
+02:00=%1 bringt eine Träne zu mir ins Auge
+02:00=%1 ist ein Ex-Schwein
+02:00=%1 wird die Radieschen
+02:00=%1 hat aufgehört zu sein
+02:00=Verabschieden Sie sich von %1
+02:00=Keine Hoffnung mehr für %1
+02:00=%1 steht vor der letzte Vorhang
+02:00=Rauchen, wenn du hast, %1
+02:00=%1 erleidet einen spontanen massiven Vorhandensein Ausfall
+02:00=%1 weitergegeben hat
+02:00=%1 ist mausetot
+02:00=%1 nicht mehr
+02:00=%1 abgelaufen
+02:00=Beraubt des Lebens, %1 ruht in Frieden
+02:00=%1 tritt der Chor unsichtbar
+02:00=Abschied %1, wussten wir kaum ye!
+02:00=%1 hatte eine geringe Toleranz für erschossen
+02:00=%1 hätte verwenden können ein zusätzliches Leben
+02:00=Gibt es einen Arzt im Haus?
 
 ; Hog (%1) drowned
 02:01=%1 geht auf Tauchstation!
@@ -127,6 +171,51 @@
 02:01=%1 erliegt dem Sog der Tiefe!
 02:01=%1 geht der Sache auf den Grund!
 02:01=%1 wäre fast verdurstet!
+02:01=%1 checkt das tiefe Ende
+02:01=%1 geht gluck gluck gluck
+02:01=%1 geht Spritzer
+02:01=%1 vergaß seine Armbinden
+02:01=%1 wirklich genommen haben sollte Schwimmunterricht
+02:01=%1 verließ seinem Surfbrett zu Hause
+02:01=%1 wird gewaschen, bis
+02:01=%1 ist ein Schwein matschig
+02:01=%1 vergessen, sein Leben zu bringen Jacke
+02:01=%1 geht Splish Spritzer
+02:01=%1 wird mit den Fischen schlafen
+02:01=%1 denkt das Wasser saugen Physik in diesem Spiel
+02:01=%1 sieht durstig
+02:01=Das Meer behauptet %1
+02:01=%1 wird auf dem Meer verschollen
+02:01=%1 sollten mitgebracht haben seine Tauchausrüstung
+02:01=%1 bekommt eine Bestattung auf See
+02:01=%1 hat, dass die sinkenden Gefühl
+02:01=%1 übt seine Rückenschwimmen
+02:01=%1 geht auf der Suche nach der Titanic
+02:01=%1 ist nicht Jesus
+02:01=%1 wird Findet Nemo
+02:01=%1 ein Leck
+02:01=Du mußt fragen, wie viele Schweine sind da unten
+02:01=%1 macht das Meer etwas höher
+02:01=%1 nicht in der Marine zu gewinnen
+02:01=%1 tut sein Identitätswechsel von einem toten Fisch
+02:01=Zumindest ging nicht in die Toilette, %1
+02:01=Sonic nicht schwimmen konnte und kann weder %1
+02:01=%1 will spielen Ecco the Dolphin
+02:01=%1, Aquaria ist gegangen, um zu besuchen
+02:01=%1 hat festgestellt, die verlorene Stadt Atlantis
+02:01=%1 Ziele für die Hauptrolle in Bioshock 3
+02:01=Ihre doggy Paddel könnte ein wenig Arbeit, %1
+02:01=%1 sollten mitgebracht haben einen Jet-Ski
+02:01=%1 mag es nicht, Wassersport
+02:01=%1 wird forever blowing bubbles
+02:01=%1 ist kurz von einem Floß
+02:01=%1 denkt Salzwasser ist gut für die Haut
+02:01=%1 bekommt Salzwasser in seine Wunden
+02:01=%1 hat ging die Planke
+02:01=%1 verfügt über eine Badewanne
+02:01=%1 ist nass nass nass
+02:01=%1 bekommt seine Federkiele nass
+02:01=Es ist Davy Jones 'locker für %1
 
 ; Round starts
 02:02=Auf in die Schlacht!
@@ -135,6 +224,55 @@
 02:02=Los geht's!
 02:02=Alles angetreten!
 02:02=Los, los, los!
+02:02=Lassen Sie uns dies Partei beginnen
+02:02=Letzte Schwein steht gewinnt
+02:02=Gehen wir!
+02:02=Lasst uns rocken!
+02:02=Lassen Sie uns jam!
+02:02=Es ist Anfang ...
+02:02=Dies ist der Beginn von etwas Großem
+02:02=Willkommen bei Hedgewars
+02:02=Willkommen auf der Front
+02:02=Crush deine Feinde!
+02:02=Mai die beste Schwein Sieg
+02:02=Sieg oder Tod
+02:02=Dem Sieger geht die Beute
+02:02=Verlieren ist keine Option
+02:02=Cry Havoc! Lassen Sie verlieren die Schweine des Krieges!
+02:02=Hedgewars, die Ihnen von Hedgewars.org
+02:02=GL HF
+02:02=Nur sich glücklich schätzen du bist nicht gegen Tiyuri
+02:02=Nur sich glücklich schätzen du bist nicht gegen unC0Rr
+02:02=Nur sich glücklich schätzen du bist nicht gegen Nemo
+02:02=Nur sich glücklich schätzen du bist nicht gegen Smaxx
+02:02=Nur sich glücklich schätzen du bist nicht gegen Jessor
+02:02=Gib alles!
+02:02=Die Verlierer machen die Reinigung auf!
+02:02=Lassen Sie den Kampf des Jahrtausends beginnen
+02:02=Lassen Sie den Kampf des Jahrhunderts beginnen
+02:02=Lassen Sie den Kampf des Jahrzehnts beginnen
+02:02=Lassen Sie den Kampf des Jahres beginnen
+02:02=Lassen Sie den Kampf des Monats beginnen
+02:02=Lassen Sie den Kampf in der Woche beginnen
+02:02=Lassen Sie den Kampf des Tages beginnen
+02:02=Lassen Sie den Kampf der Stunde beginnen
+02:02=Tun Sie Ihr Bestes!
+02:02=Zerstöre den Feind!
+02:02=Viel Glück
+02:02=Viel Spaß
+02:02=Kämpfe den guten Kampf
+02:02=Kampf schmutzig
+02:02=Kampf mit Ehre
+02:02=Gib nicht auf
+02:02=Never surrender
+02:02=Rock und Socke!
+02:02=Lassen Sie den fragfest beginnen!
+02:02=Ich hoffe du bist bereit für einen Kampf!
+02:02=Gehen gehen!
+02:02=Igel Voraus!
+02:02=Bringt es ihnen!
+02:02=Habt keine Angst!
+02:02=Seien Sie mutig und erobern
 
 ; Round ends (win; unused atm)
 02:03=...
@@ -148,6 +286,16 @@
 02:05=Das kommt gelegen!
 02:05=Jemand denkt an euch!
 02:05=Mit Liebe verpackt?
+02:05=Frisches Pflaster!
+02:05=So werden Sie sich besser fühlen
+02:05=Ein Hallo-Trank! Whoops falsche Spiel
+02:05=Ein wählen mir oben!
+02:05=Zugreifen
+02:05=Ein gesunder Snack
+02:05=Ein Mittel, um Schmerzen
+02:05=Richtige Dosierung: so viele wie du finden kannst!
+02:05=Schnelle Lieferung
+02:05=Vorräte!
 
 ; New ammo crate
 02:06=Nachschub!
@@ -155,6 +303,22 @@
 02:06=Was wohl darin ist?
 02:06=Bringt das die Wende?
 02:06=Tod aus der Luft!
+02:06=Ein Geschenk!
+02:06=Spezielle Lieferung!
+02:06=Es war ein Alptraum bekommen dies durch den Zoll
+02:06=Destruktive Spielzeug aus dem Himmel
+02:06=Warnung! Inhalt Flüchtige
+02:06=Wählen es oder blasen sie auf, ist Qual der Wahl
+02:06=Extras!
+02:06=Mmm Munition
+02:06=Eine Schachtel zerstörerische Kraft
+02:06=Luftpost!
+02:06=Was auch immer ist in diesem Feld ist es nicht Pizza
+02:06=Bekommen!
+02:06=Waffe fallen zu lassen eingehende
+02:06=Lassen Sie sich nicht, dass der Feind schnappen!
+02:06=Shiny neues Spielzeug!
+02:06=Eine geheimnisvolle Kiste!
 
 ; New utility crate
 02:07=Nützliches?
@@ -162,6 +326,12 @@
 02:07=Was wohl darin ist?
 02:07=Lieferung frei Haus!
 02:07=Mehr als nur eine Kiste!
+02:07=Weitere Hilfsmittel!
+02:07=Extras für Sie!
+02:07=Dies sollte gut sein!
+02:07=Verwenden Sie diese mit Bedacht
+02:07=Ooo diese Box ist schwer
+02:07=Möglicherweise müssen Sie diese
 
 ; Hog (%1) skips his turn
 02:08=%1 ist so ein Langeweiler ...
@@ -172,12 +342,68 @@
 02:08=%1 ist ein Drückeberger.
 02:08=%1 überdenkt die Situation.
 02:08=%1 kann sich nicht entscheiden.
+02:08=%1 muss ein wenig mehr Motivation
+02:08=%1 ist ein Pazifist
+02:08=%1 hat eine Verschnaufpause
+02:08=%1 hat einen Rest
+02:08=%1 Schüttelfrost aus
+02:08=%1 hat kein Vertrauen in seine eigenen Fähigkeiten
+02:08=%1 beschließt, nichts zu tun
+02:08=%1 lässt den Feind zu vernichten selbst
+02:08=%1 wäre bei Partys schrecklich
+02:08=%1 versteckt sich
+02:08=%1 hat sich entschlossen, diese Chance geben
+02:08=%1 entscheidet das Beste, was er tun kann, ist nichts ...
+02:08=%1 ist ein großes Weichei
+02:08=Bock bock bock, %1 ist ein Huhn
+02:08=%1 schaut ein wenig gelb
+02:08=%1 ist ein Feigling!
+02:08=%1 wird für den plötzlichen Tod wartet
+02:08=%1 ist wartet auf Sudden Death
+02:08=%1 ist nicht die Bekämpfung von Typ
+02:08=%1 überdenkt seinen Sinn im Leben
+02:08=%1 war nie viel von einem guten Schuss ohnehin
+02:08=%1 wollte nicht, dass die Armee in erster Linie verbinden
+02:08=Aufhören, unsere Zeit, %1
+02:08=Ich bin in dir enttäuscht, %1
+02:08=Los, können Sie es besser machen %1
+02:08=%1 wird gebrochen
+02:08=%1 hat anscheinend Besseres zu tun
+02:08=%1 ist zu Tode erschrocken
+02:08=%1 ist eingeschlafen
 
 ; Hog (%1) hurts himself only
 02:09=%1 sollte besser Zielen üben!
 02:09=%1 scheint sich zu hassen.
 02:09=%1 steht auf der falschen Seite!
 02:09=%1 lebt gefährlich!
+02:09=%1 hat keinen Instinkt der Selbsterhaltung
+02:09=%1 durcheinander
+02:09=%1 vermasselt
+02:09=Das war ein schlechter Schuss, %1
+02:09=%1 ist ein wenig zu sorglos mit gefährlichen Waffen
+02:09=%1 sollte eine Änderung der Laufbahn betrachten
+02:09=Schlechteste. Schuss. Je!
+02:09=Kein kein kein %1, Sie schießen auf den Feind!
+02:09=%1 sollte nur werden, den Feind zu vernichten
+02:09=%1 bewegt sich einen Schritt näher an Selbstmord
+02:09=%1, Hilfsmittel der Feind
+02:09=Das war dumm %1
+02:09=%1 Leben mit dem Mantra des "keine Schmerzen, keine gewinnen"
+02:09=%1 ist verwirrt
+02:09=%1 verletzen sich in seiner Verwirrung
+02:09=%1 hat ein Talent für sich zu blamieren
+02:09=%1 ist ein Trottel!
+02:09=%1 ist ungeschickt
+02:09=%1 zeigt der Feind, wozu er fähig ist
+02:09=%1 kann nicht erwartet werden, perfekt zu sein werden die ganze Zeit
+02:09=Mach dir keine Sorgen %1, pobody die nerfect
+02:09=%1 völlig mit Absicht getan
+02:09=Ich werde niemandem sagen, wenn Sie nicht tun, %1
+02:09=Wie peinlich!
+02:09=Ich bin sicher, niemand sah, dass %1
+02:09=%1, Bedürfnisse, seine Field Manual überprüfen
+02:09=%1 Waffe eindeutig versagt
 
 ; Hog (%1) shot an home run (using the bat and another hog)
 02:10=Home Run!
@@ -305,7 +531,6 @@
 04:52=NICHT IN VERWENDUNG
 04:53=Unternimm eine Reise durch Zeit und Raum,|während du deine Kameraden alleine am Schlachtfeld zurücklässt.|Sei darauf vorbereitet jederzeit wieder zurückzukommen,|oder auf Sudden Death wenn sie alle besiegt wurden.|Disclaimer: Nicht funktionstüchtig wenn in Sudden Death,|wenn du alleine bist - oder der König.
 04:54=IN ARBEIT
-
 04:55=Versprühe einen Strahl klebriger Flocken.|Baue Brücken, begrabe Gegner, versiegle Tunnel.|Pass auf, dass du selbst nichts abbekommst!
 
 ; Game goal strings
diff --git a/share/hedgewars/Data/Locale/en.txt b/share/hedgewars/Data/Locale/en.txt
index 194125e..763be41 100644
--- a/share/hedgewars/Data/Locale/en.txt
+++ b/share/hedgewars/Data/Locale/en.txt
@@ -56,6 +56,8 @@
 00:53=TimeBox
 00:54=Structure
 00:55=Land Spray
+00:56=Freezer
+00:57=Cleaver
 
 01:00=Let's fight!
 01:01=Round draw
@@ -78,6 +80,7 @@
 01:18=High
 01:19=Extreme
 01:20=%1 Bounce
+01:21=Audio Muted
 
 ; Event messages
 ; Hog (%1) died
@@ -490,9 +493,9 @@
 04:36=Well, sometimes you're just too bad in aiming. Get|some assistance using modern day technology.|Attack: Activate
 04:37=Don't fear the daylight. It will just last one turn|but will enable you to absorb the damage you do to|other hogs.|Attack: Activate
 04:38=The sniper rifle can be the most devastating weapon|in your whole arsenal, however it's very ineffective|at close quarters. The damage dealt increases with|the distance to its target.|Attack: Shoot (twice)
-04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility is able to|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force in one direction|Long Jump: Drop grenades or similar weapons
+04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility can|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force in one direction|Long Jump: Drop grenades or similar weapons
 04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Attack: Hold to shoot with more power
-04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction
+04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Be quick, as using Birdy eats into your turn|time!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction
 04:42=This portable portal device is capable|of instantly transporting you, your enemies,|or your weaponry between two points on the|terrain.|Use it wisely and your campaign will be a...|HUGE SUCCESS!|Attack: Shoot a portal|Switch: Cycle portal colours
 04:43=Make your musical debut an explosive success!|Drop a piano from the heavens, but beware...|someone needs to play it, and that may cost you|your life!|Cursor: Select target region|F1-F9: Play the piano
 04:44=This isn't just cheese, it's biological warfare!|It won't cause an huge amount of damage once|the timer reaches zero but it will definitely|poison anyone unlucky to touch the smell!|1-5: Set grenade's timer|Attack: Hold to throw with more power
@@ -504,7 +507,7 @@
 04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig.
 04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back.
 04:52=UNUSED
-04:53=Go on an adventure through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.
+04:53=Take a trip through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.
 04:54=INCOMPLETE                                                                                                                                     
 04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you!
 
diff --git a/share/hedgewars/Data/Locale/es.lua b/share/hedgewars/Data/Locale/es.lua
index d94855d..638205d 100644
--- a/share/hedgewars/Data/Locale/es.lua
+++ b/share/hedgewars/Data/Locale/es.lua
@@ -1,159 +1,641 @@
 locale = {
-	["..."] = "...",
 	[":("] = ":(",
 	["!!!"] = "!!!",
+	["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["Accuracy Bonus!"] = "¡Buena puntería!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 	["Achievement Unlocked"] = "Logro conseguido", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 	["a Hedgewars mini-game"] = "un minijuego de Hedgewars", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Practica tu puntería", --Bazooka, Shotgun, SniperRifle
-	["Ammo"] = "Munición",
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 	["Ammo Depleted!"] = "¡Munición agotada!",
 	["ammo extended!"] = "¡Munición aumentada!",
 	["Ammo is reset at the end of your turn."] = "",
 	["Ammo Maniac!"] = "¡Loco por la munición!",
+	["Ammo"] = "Munición",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 	["Available points remaining: "] = "Puntos restantes:",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 	["[Backspace]"] = "[Retroceso]",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 	["Bamboo Thicket"] = "Maraña de bambú",
 	["Barrel Eater!"] = "¡Tragabarriles!",
 	["Barrel Launcher"] = "Lanzador de barriles",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "¡Batea pelotas contra tus enemigos|y hazlos caer al agua!",
 	["Bat your opponents through the|baskets and out of the map!"] = "¡Batea a tus enemigos fuera del campo de juego|a través de las canastas laterales!",
 	["Bazooka Training"] = "Entrenamiento con bazuca",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Mejores tiempos por equipo: ",
 	["Best Team Times: "] = "Mejores tiempos del equipo: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 	["Bloody Rookies"] = "Reclutas", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 	["Boom!"] = "¡Bum!",
 	["BOOM!"] = "¡BUM!",
 	["Boss defeated!"] = "¡Jefe derrotado!",
 	["Boss Slayer!"] = "¡Matajefes!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 	["Build a track and race."] = "Dibuja un recorrido y compite.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["CAPTURE THE FLAG"] = "Capturar la bandera",
 	["Careless"] = "Descuidado",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Change Weapon"] = "Cambiar arma",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 	["Clumsy"] = "Patoso",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 	["Codename: Teamwork"] = "Nombre en clave: Trabajo en equipo",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Complete the track as fast as you can!"] = "¡Completa el recorrido lo más rápido que puedas!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
 	["Congratulations!"] = "¡Felicidades!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "¡Felicidades! Has destruido todos los objectivos|dentro del tiempo establecido.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 	["Control pillars to score points."] = "Controla los pilares para anotar puntos.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Cybernetic Empire"] = "Imperio cibernético",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 	["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "¡MALDITA SEA, RECLUTA! ¡FUERA DE MI CABEZA!",
 	["DAMMIT, ROOKIE!"] = "¡MALDITA SEA, RECLUTA!",
 	["Dangerous Ducklings"] = "Patitos peligrosos",
 	["Deadweight"] = "Peso muerto",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 	["Demolition is fun!"] = "¡Destruir es divertido!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 	["Depleted Kamikaze!"] = "¡No quedan más kamikazes!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 	["Destroy invaders to score points."] = "Acaba con los invasores para conseguir puntos.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 	["Double Kill!"] = "¡Dos por uno!",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 	["Drone Hunter!"] = "Matadrones",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 	["Drowner"] = "Ahogado",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 	["Each turn you get 1-3 random weapons"] = "Cada turno tendrás de 1 a 3 armas elegidas aleatoriamente",
 	["Each turn you get one random weapon"] = "Cada turno tendrás un arma elegida aleatoriamente",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 	["Eliminate all enemies"] = "Elimina a todos los enemigos",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Destruye todos los objetivos antes de que se agote el tiempo.|La munición en esta misión es ilimitada.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 	["Eliminate Poison before the time runs out"] = "Acaba con los Tóxicos antes de que se agote el tiempo",
 	["Eliminate the Blue Team"] = "Elimina al Equipo azul",
 	["Eliminate the enemy before the time runs out"] = "Acaba con el enemigo antes de que se agote el tiempo", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 	["Eliminate the enemy hogs to win."] = "Acaba con los erizos enemigos para ganar",
 	["Eliminate the enemy specialists."] = "Acaba con los Especialistas",
 	["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Elimina a la Unidad 3378 |- Resistencia Fútil debe sobrevivir",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 	["Energetic Engineer"] = "Ingeniero Eléctrico",
 	["Enjoy the swim..."] = "Disfruta del baño...",
 	["[Enter]"] = "[Intro]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Vuelta rápida: ",
 	["Feeble Resistance"] = "Resistencia Fútil",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
 	["Fire"] = "Fuego",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 	["Flag captured!"] = "¡Bandera capturada!",
 	["Flag respawned!"] = "¡Bandera restablecida!",
 	["Flag returned!"] = "¡Bandera recuperada!",
 	["Flags, and their home base will be placed where each team ends their first turn."] = "Las banderas y las bases se colocarán donde los equipos acaben su primer turno.",
 	["Flamer"] = "Incinerador",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 	["Friendly Fire!"] = "¡Fuego amigo!",
 	["fuel extended!"] = "¡Más combustible!",
 	["GAME BEGUN!!!"] = "¡EL JUEGO HA EMPEZADO!",
 	["Game Modifiers: "] = "Modificadores: ",
 	["GAME OVER!"] = "¡FIN DEL JUEGO!",
 	["Game Started!"] = "¡El juego ha empezado!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 	["Get on over there and take him out!"] = "¡Ves allí y elimínalo!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 	["Goal"] = "Objetivo",
 	["GO! GO! GO!"] = "¡VAMOS! ¡VAMOS! ¡VAMOS!",
 	["Good birdy......"] = "Buen pajarito......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 	["Good luck out there!"] = "¡Buena suerte!",
 	["Good so far!"] = "¡Vamos bien!",
 	["Good to go!"] = "¡Sigue!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 	["GOTCHA!"] = "¡TE PILLÉ!",
 	["Grab Mines/Explosives"] = "Coge minas/explosivos",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 	["Hahahaha!"] = "¡Jajajaja!",
 	["Haha, now THAT would be something!"] = "¡Jajaja, eso SÍ que sería espectacular!",
-	["Hapless Hogs"] = "Pobres desgraciados",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 	[" Hapless Hogs left!"] = " pobres desgraciados restantes!",
+	["Hapless Hogs"] = "Pobres desgraciados",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 	["Health crates extend your time."] = "Los botiquines aumentan el tiempo disponible.",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Heavy"] = "Pesado",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Baloncesto",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 	["Heh, it's not that bad."] = "Jeje, no es para tanto.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 	["Hit Combo!"] = "¡Combo!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Mmm...",
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 	["Hooray!"] = "¡Hurra!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Artillero", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 	["Instructor"] = "Instructor", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 	["invaders destroyed"] = "invasores destruídos",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 	["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Menos mal que aún quedan 99 turnos hasta la MUERTE SÚBITA...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 	["Jumping is disabled"] = "No se puede saltar",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 	["Kamikaze Expert!"] = "¡Kamikaze experto!",
 	["Keep it up!"] = "¡Sigue así!",
+--      ["Kerguelen"] = "", -- Continental_supplies
 	["Killing spree!"] = "¡Frenesí asesino!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 	["KILLS"] = "MUERTES",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 	["Last Target!"] = "¡Último objetivo!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 	["[Left Shift]"] = "[Shift izquierdo]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Listen up, maggot!!"] = "¡Atento, escoria!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 	["Lively Lifeguard"] = "Salvavidas dicharachero",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 	["Mine Deployer"] = "Plantador de minas",
 	["Mine Eater!"] = "¡Tragaminas!",
 	["|- Mines Time:"] = "|- Retraso de las minas:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION FAILED"] = "MISIÓN FRACASADA", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
-	["MISSION SUCCESS"] = "MISIÓN COMPLETADA",
 	["MISSION SUCCESSFUL"] = "MISIÓN COMPLETADA", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+	["MISSION SUCCESS"] = "MISIÓN COMPLETADA",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 	["Movement: [Up], [Down], [Left], [Right]"] = "Movimiento: [Arriba], [Abajo], [Izquierda], [Derecha]",
 	["Multi-shot!"] = "¡Disparo múltiple!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 	["Nameless Heroes"] = "Héroes anónimos",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 	["New Barrels Per Turn"] = "Barriles por turno",
 	["NEW CLAN RECORD: "] = "NUEVO RÉCORD PARA EL CLAN",
 	["NEW fastest lap: "] = "NUEVA vuelta rápida: ",
 	["New Mines Per Turn"] = "Minas por turno",
 	["NEW RACE RECORD: "] = "NUEVO RÉCORD PARA EL RECORRIDO: ",
 	["Newton's Hammock"] = "La hamaca de Newton",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 	["NOT ENOUGH WAYPOINTS"] = "NO HAY SUFICIENTES BALIZAS",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "Partido no-tan-amistoso", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 	["Oh no! Just try again!"] = "¡Oh, no! ¿Por qué no lo intentas de nuevo?", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "¡Oh, no, se te acabó el tiempo! ¿Por qué no lo intentas de nuevo?", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 	["Operation Diver"] = "Buzo",
 	["Opposing Team: "] = "Equipo enemigo: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 	["Pathetic Hog #%d"] = "Erizo patético #%d",
 	["Pathetic Resistance"] = "Patética resistencia", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 	["Per-Hog Ammo"] = "Armamento individualizado",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 	["Place more waypoints using [ENTER]"] = "Coloca más balizas presionando [INTRO]",
 	["Place more waypoints using the 'Air Attack' weapon."] = "Coloca más balizas usando el 'Bombardeo aéreo'",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 	["points"] = "puntos", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 	["Poison"] = "Veneno",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 	["Power Remaining"] = "Energía restante",
 	["Prepare yourself"] = "Prepárate",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 	["Press [Precise] to skip intro"] = "Aprieta [Incrementar precisión] para saltar la intro",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 	["Race complexity limit reached."] = "Máximo de complejidad para el recorrido alcanzado.",
 	["RACER"] = "CORREDOR",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 	[" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "- Vuelve a tu base con la bandera enemiga para anotar un punto | - El equipo que anote 3 puntos gana | - Sólo se puede anotar si tu propia bandera está en tu base | - Los erizos resucitan cuando mueren",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 	["Round Limit:"] = "Límite de rondas:",
 	["Round Limit"] = "Límite de rondas",
 	["Rounds Complete: "] = "Rondas completadas: ",
 	["Rounds Complete"] = "Rondas completadas",
 	["RULES OF THE GAME [Press ESC to view]"] = "REGLAS DEL JUEGO (Presiona ESC para leerlas)",
-	["s|"] = "s|",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 	["Save as many hapless hogs as possible!"] = "¡Salva a tantos pobres desgraciados como puedas!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
 	["SCORE"] = "PUNTUACIÓN",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 	["sec"] = "segundo", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 	["See ya!"] = "¡Hasta otra!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 	["selected!"] = "¡Seleccionado!",
-	["s"] = "s", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 	["Shield boosted! +30 power"] = "¡Escudo mejorado! +30 puntos",
 	["Shield Depleted"] = "Escudo descargado",
 	["Shield is fully recharged!"] = "¡Escudo completamente cargado!",
@@ -162,59 +644,340 @@ locale = {
 	["Shield OFF:"] = "Escudo desactivado:",
 	["Shield ON:"] = "Escudo activado:",
 	["Shield Seeker!"] = "¡A cubierto!",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Escopeteros",
 	["Shotgun Training"] = "Entrenamiento con escopeta",
 	["shots remaining."] = "disparos restantes.",
 	["Silly"] = "Idiota",
 	["Sinky"] = "Sumergible",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "¡%s cayó y Equipo %d|anotó una falta!| |Puntuación:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "¡%s cayó y Equipo %d|anotó un tanto!| |Puntuación:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Entrenamiento con rifle francotirador",
 	["Sniperz"] = "Francotiradores",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 	["Sponge"] = "Esponja",
 	["Spooky Tree"] = "Árbol tenebroso",
+	["s|"] = "s|",
+	["s"] = "s", -- GaudyRacer, Space_Invasion
 	["STATUS UPDATE"] = "ACTUALIZACIÓN DE ESTADO", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 	["Switched to "] = "Cambiar a ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Equipo %d",
 	["Team Scores"] = "Puntuaciones", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 	["That Sinking Feeling"] = "Esa sensación de pesadez",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["That was pointless."] = "Eso era innecesario.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 	["The enemy is hiding out on yonder ducky!"] = "¡El enemigo está escondido detrás del patito del fondo!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 	["The flag will respawn next round."] = "La bandera reaparecerá en el próximo turno.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 	["The Nameless One"] = "Anónimo",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 	["THE SPECIALISTS"] = "LOS ESPECIALISTAS",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 	["This one's tricky."] = "Esto va a ser complicado.",
 	["This rain is really something..."] = "Vaya que si llueve...",
-	["TIME: "] = "TIEMPO: ",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 	["Timed Kamikaze!"] = "¡Kamikaze de precisión!",
 	["Time Extended!"] = "¡Tiempo aumentado!",
 	["Time Extension"] = "¡Bonus de tiempo!",
+	["TIME: "] = "TIEMPO: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 	["Toggle Shield"] = "Activad/desactivar escudo",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 	["Toxic Team"] = "Tóxicos", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["TRACK COMPLETED"] = "¡PISTA COMPLETADA!",
 	["TRACK FAILED!"] = "¡PISTA FRACASADA!",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 	["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 	["T_T"] = "T_T",
 	["Tumbling Time Extended!"] = "¡Tiempo de volteretas aumentado!",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 	["Turn Time"] = "Duración del turno",
-	["Unit"] = "Unidad",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 	["Unit 3378"] = "Unidad 3378",
 	["Unit 835"] = "Unidad 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+	["Unit"] = "Unidad",
 	["Unlimited Attacks"] = "Ataques ilimitados",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Unstoppable!"] = "¡Imparable!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 	["User Challenge"] = "Reto personal",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "¡Usa tu cuerda para llegar a la salida lo más rápido que puedas!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 	["Victory for the "] = "La victoria es para ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 	["Waypoint placed."] = "Baliza colocada.",
 	["Way-Points Remaining"] = "Balizas restantes",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 	["Weapons Reset"] = "Armamento reiniciado",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 	["Well done."] = "Bien hecho.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 	["Will this ever end?"] = "¿Es que nunca se va a terminar?",
+--      ["WINNER IS "] = "", -- Mutant
 	["WINNING TIME: "] = "MEJOR TIEMPO: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 	["You'd almost swear the water was rising!"] = "¡Pero si podría jurar que está subiendo el nivel del mar!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 	["You have SCORED!!"] = "¡Has anotado!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 	["You saved"] = "¡Has salvado",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 	["You've failed. Try again."] = "Has fracasado. Inténtalo de nuevo.",
 	["You've reached the goal!| |Time: "] = "¡Has llegado a la meta!| |Tiempo: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Bazuqueros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/fr.lua b/share/hedgewars/Data/Locale/fr.lua
index c0bba01..f617a1e 100644
--- a/share/hedgewars/Data/Locale/fr.lua
+++ b/share/hedgewars/Data/Locale/fr.lua
@@ -1,220 +1,1248 @@
 locale = {
+      ["???"] = "???",
+      ["..."] = "...",
+      ["..."] = "...",
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
---      ["Accuracy Bonus!"] = "",
---      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
---      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
+      ["011101000"] = "",
+      ["011101000"] = "",
+      ["011101000"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "",
+      ["011101001"] = "011101001",
+      ["30 minutes later..."] = "30 minutes plus tard...",
+      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "Il y a un moins, un cyborg est venu et nous a dit que vous étiez des cannibales !",
+      ["Accuracy Bonus!"] = "Bonus précision",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+      ["Achievement Unlocked"] = "Succes débloqué", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+-- a classic fairytale: backstab
+-- a classic fairytale: dragon's lair
+-- a classic fairytale: epilogue
+-- a classic fairytale: family reunion
+	  -- a classic fairytale: first blood
+-- a classic fairytale: long live the queen
+-- a classic fairytale: the enemy of my enemy...
+-- a classic fairytale: the journey back
+-- a classic fairytale: the shadow falls
+      ["A Classic Fairytale"] = "Un conte de fée classique",
+-- a classic fairytale: united we stand
+      ["Actually, you aren't worthy of life! Take this..."] = "En fait, tu n'es pas digne de vivre ! Prends ça....",
+      ["A cy-what?"] = "Un cy-quoi ?",
+      ["Adventurous"] = "Aventureux",
+--      ["Africa"] = "", -- Continental_supplies
+      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "Après que Leaks A Lot ait trahit sa tribus, il rejoignit les cannibales... ",
+      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "Après le choc causé par l'espion ennemi, Leaks A Lot et Dense cloud partirent chasser pour se détendre.",
+      ["Again with the 'cannibals' thing!"] = "Encore avec votre 'cannibale' truc",
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+      ["a Hedgewars mini-game"] = "Un mini jeux d'Hedgewars", -- Space_Invasion, The_Specialists
       ["Aiming Practice"] = "Entrainement de tir", --Bazooka, Shotgun, SniperRifle
---      ["Ammo"] = "",
---      ["Ammo Depleted!"] = "",
---      ["ammo extended!"] = "",
---      ["Ammo is reset at the end of your turn."] = "",
---      ["Ammo Maniac!"] = "",
---      ["Available points remaining: "] = "",
---      ["[Backspace]"] = "",
---      ["Bamboo Thicket"] = "",
---      ["Barrel Eater!"] = "",
---      ["Barrel Launcher"] = "",
+	  ["A leap in a leap"] = "Un bond dans un bond",
+      ["A little gift from the cyborgs"] = "Un petit cadeau de la part des cyborgs",
+      ["All gone...everything!"] = "évaporé...plus rien !",
+      ["All right, we just need to get to the other side of the island!"] = "",
+      ["All right, we just need to get to the other side of the island!"] = "Très bien, nous devons juste rejoindre l'autre côté de l'île !",
+--      ["All walls touched!"] = "", -- WxW
+      ["Ammo Depleted!"] = "Munitions épuisées !",
+      ["ammo extended!"] = "Munitions en plus !",
+      ["Ammo is reset at the end of your turn."] = "Les munitions sont réinitialisées à la fin du tour",
+      ["Ammo Maniac!"] = "Collectionneur de munitions !",
+      ["Ammo"] = "Munitions",
+      ["And how am I alive?!"] = "Et comment suis je en vie ?",
+      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "Et Leaks A Lot échoua à relever le défi ! Il atteri, honteux....",
+	  ["And so it began..."] = "Et c'est ainsi que ça a commencé...",
+      ["...and so the cyborgs took over the world..."] = "...Et c'est ainsi que les cyborgs prirent le controle du monde...",
+      ["And so they discovered that cyborgs weren't invulnerable..."] = "",
+      ["And so they discovered that cyborgs weren't invulnerable..."] = "",
+      ["And so they discovered that cyborgs weren't invulnerable..."] = "Et c'est ainsi qu'ils découvrirent que les cybords n'étaient pas invulnérables...",
+      ["And where's all the weed?"] = "et où est toute l'herbe ?",
+      ["And you believed me? Oh, god, that's cute!"] = "Et tu m'as cru ? Oh mon dieu, c'est mignon !",
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+      ["Are we there yet?"] = "Somme nous toujours là ?",
+      ["Are you accusing me of something?"] = "Es tu en train de m'accuser de quelque chose ? ",
+      ["Are you saying that many of us have died for your entertainment?"] = "Etes vous en train de dire que beaucoup d'entre nous sont morts pour votre divertissement ? ",
+      ["Artur Detour"] = "",
+      ["As a reward for your performance, here's some new technology!"] = "Comme récompence, voici quelques nouvelles technologie !",
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+      ["Assault Team"] = "",
+      ["Assault Team"] = "",
+      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "Vu que les munitions sont éparpillées tu devrais re-lancer la corde en plein vol",
+      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "Le défi accompli, Leaks A Lot posa les pieds sur le sol...",
+      ["As you can see, there is no way to get on the other side!"] = "Comme tu peux le voir, il n'y a pas de moyen d'atteindre l'autre côté !",
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
+      ["Available points remaining: "] = "points restant disponibles",  -- need the situation of when this sentence is used
+      ["Back Breaker"] = "",
+      ["Back in the village, after telling the villagers about the threat..."] = "De retour au village, après avoir averti les villageois de la menace...",
+--      ["[Backspace]"] = "effacement arrière",  --maybe the original name is better...
+      ["Backstab"] = "",
+      ["Backstab"] = "",
+      ["Backstab"] = "",
+      ["Backstab"] = "",
+      ["Backstab"] = "coup de poignard dans le dos",
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Bamboo Thicket"] = "", --really, i don't know the good translation for this
+      ["Barrel Eater!"] = "Mangeur de Barrils",
+      ["Barrel Launcher"] = "Lanceur de barrils", --need the situation for me to understand sens of sentence
+--      ["Baseballbat"] = "", -- Continental_supplies
       ["Bat balls at your enemies and|push them into the sea!"] = "Frappez vos ennemis à la batte|et envoyez-les à la mer !",
       ["Bat your opponents through the|baskets and out of the map!"] = "Frappez vos ennemis à la batte|, marquez des paniers ou envoyez-les à la mer !",
       ["Bazooka Training"] = "Entrainement au Bazooka",
+      ["Beep Loopers"] = "",
+      ["Beep Loopers"] = "",
       ["Best laps per team: "] = "Meilleur temps par équipe",
 --      ["Best Team Times: "] = "",
+      ["Beware, though! If you are slow, you die!"] = "Attention tout de meme ! si tu es lent, tu meurt !",
+      ["Biomechanic Team"] = "",
+      ["Biomechanic Team"] = "",
+      ["Blender"] = "",
+      ["Bloodpie"] = "",
+      ["Bloodrocutor"] = "Bloodrocutor",
+      ["Bloodsucker"] = "Bloodsucker",
       ["Bloody Rookies"] = "Nouvelles recrues", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
---      ["Boom!"] = "",
---      ["BOOM!"] = "",
---      ["Boss defeated!"] = "",
---      ["Boss Slayer!"] = "",
---      ["Build a track and race."] = "",
+      ["Bone Jackson"] = "",
+      ["Bonely"] = "Bonely",
+      ["Boom!"] = "Boom!",
+      ["BOOM!"] = "BOOM!",
+      ["Boss defeated!"] = "Boss vaincu",
+      ["Boss Slayer!"] = "Tueur de Boss !",
+      ["Brain Blower"] = "Brain Blower",
+      ["Brainiac"] = "",
+      ["Brainiac"] = "",
+      ["Brainiac"] = "Brainiac",
+      ["Brainiac"] = "Brainic",
+      ["Brainila"] = "",
+      ["Brain Stu"] = "",
+      ["Brain Teaser"] = "",
+      ["Brutal Lily"] = "",
+      ["Brutal Lily"] = "Brutal Lily",
+      ["Brutus"] = "",
+      ["Brutus"] = "Brutus",
+      ["Build a track and race."] = "construisez un parcours et faites la course.",
+      ["Bullseye"] = "Dans le mille",
+      ["But it proved to be no easy task!"] = "Mais cela ne s'avéra pas etre une tache facile !",
+      ["But that's impossible!"] = "Mais c'est impossible !",
+      ["But the ones alive are stronger in their heart!"] = "Mais les survivants sont plus forts dans leur coeur !",
+      ["But...we died!"] = "Mais... nous avons été tués !",
+      ["But where can we go?"] = "Mais où pouvons nous aller ? ",
+      ["But why would they help us?"] = "Mais pourquoi nous aideraient-ils ? ",
+      ["But you're cannibals. It's what you do."] = "Mais vous etes cannibales. C'est ce que vous faites.",
+      ["But you said you'd let her go!"] = "Mais vous aviez dit que vous la laisseriez partir !",
+      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "Appele moi Beep ! Hum, parce que je suis genre une personne sympa !",
+						--CAMPAIGN MISSIONS TRANSLATION FRENCH--
+      ["Cannibals"] = "",
+      ["Cannibals"] = "",
+      ["Cannibals"] = "",
+      ["Cannibals"] = "",
+      ["Cannibals"] = "Cannibales",
+      ["Cannibals"] = "Cannibals",
+      ["Cannibal Sentry"] = "",
+      ["Cannibal Sentry"] = "",
+      ["Cannibal Sentry"] = "Sentinelle cannibale",
+      ["Cannibals?! You're the cannibals!"] = "Cannibales ? C'est vous les cannibales !",
       ["CAPTURE THE FLAG"] = "Capturez le drapeau !",
---      ["Careless"] = "",
---      ["Change Weapon"] = "",
---      ["Clumsy"] = "",
+      ["Careless"] = "Imprudent",
+      ["Carol"] = "",
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
+      ["Change Weapon"] = "changez d'arme",
+      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "Choisis ton côté ! Si tu veux rejoindre l'étranger, marche vers lui. |Dans le cas contraire, éloigne toi de lui. Si tu décide de l'att...non laisse tomber...",
+      ["Clumsy"] = "Maladroit",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
       ["Codename: Teamwork"] = "Nom de code : Travail d'équipe",
---      ["Complete the track as fast as you can!"] = "",
+      ["Collateral Damage"] = "Dommage collatéraux",
+      ["Collateral Damage II"] = "",
+      ["Collateral Damage II"] = "Dommage collatéraux II",
+	  ["Collect all the crates, but remember, our time in this life is limited!"] = "Collectes toutes les caisses mais souviens toi, notre temps dans cette vie est limité !",
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+	  ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "collecte les caisses à droite. |astuce : selectionne la corde ninja, [haut] ou [bas] pour viser, flèches directionnelles pour bouger. |La corde peut etre re-lancée en plein vol !",
+	  ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "collectes les caisses dans le temps imparti ! |si tu rates, tu devras réessayer.",
+	  ["Come closer, so that your training may continue!"] = "Rapproche toi, ainsi ton entraînement pourra continuer !",
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
+      ["Complete the track as fast as you can!"] = "Finissez la course aussi vite que possible !",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
       ["Congratulations!"] = "Félicitations !",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
       ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Félicitations ! Vous avez éliminé toutes les cibles|pendant le temps alloué.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
       ["Control pillars to score points."] = "Contrôlez les piliers pour marquer des points",
+      ["Corporationals"] = "",
+      ["Corporationals"] = "",
+      ["Corpsemonger"] = "Corpsemonger",
+      ["Corpse Thrower"] = "Corpse Thrower",
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
       ["Cybernetic Empire"] = "Empire cybernétique",
+      ["Cyborg. It's what the aliens call themselves."] = "Cyborg. C'est ainsi que s'appellent les aliens entre eux.",
+      ["Dahmer"] = "",
       ["DAMMIT, ROOKIE!"] = "Et merde, recrue",
       ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "Et merde, recrue ! Dégage de me tête !",
       ["Dangerous Ducklings"] = "Canetons dangereux",
---      ["Deadweight"] = "",
---      ["Demolition is fun!"] = "",
---      ["Depleted Kamikaze!"] = "",
---      ["Destroy invaders to score points."] = "",
---      ["Double Kill!"] = "",
---      ["Drone Hunter!"] = "",
---      ["Drowner"] = "",
---      ["Each turn you get 1-3 random weapons"] = "",
---      ["Each turn you get one random weapon"] = "",
+--      ["Deadweight"] = "poids mort/boulet", 
+      ["Defeat the cannibals"] = "",
+      ["Defeat the cannibals!|"] = "Bat les cannibales",
+      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "Bat les cannibales ! |Astuce Grenade : Règle le compte à rebour avec [1-5], vises avec [haut]/[bas] et maintient [Espace] pour la puissance",
+      ["Defeat the cyborgs!"] = "Bats les cyborgs !",
+      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "Défends toi ! |Conseil : Tu peux obtenir des astuces sur l'utilisation des armes en placant ta souris dessus dans le menu de séléction des armes",
+      ["Demolition is fun!"] = "La démolition c'est cool",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "",
+      ["Dense Cloud"] = "Dense Cloud",
+      ["Dense Cloud must have already told them everything..."] = "Dense Cloud doit déjà leur avoir tout raconter...",
+--      ["Depleted Kamikaze!"] = "Kamikaze ... !", 
+      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "Détruis le, Leaks A Lot ! Il est responsable de la mort de beaucoup d'entre nous !",
+      ["Destroy invaders to score points."] = "Détruisez les envahisseur pour marquer des points",
+	  ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "Détruis les cibles ! |Astuce : selectionne le Shoryuken et appuyez sur [Espace] |P.S. vous pouvez l'utilisez en plein vol",
+      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "Détruis les cibles ! |Astuce : [haut], [bas] pour viser, [Espace] pour tirer",
+	  ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "Détruis les cibles ! |Astuce : [haut], [bas] pour viser, [Espace] pour tirer",
+      ["Did anyone follow you?"] = "As tu été suivis ? ",
+      ["Did you see him coming?"] = "L'a tu vu venir ?",
+      ["Did you warn the village?"] = "As tu averti le village ?",
+      ["Die, die, die!"] = "Meurt, meurt, meurt !",
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "Ne rit pas, inexpérimenté, car il dit la vérité ! ",
+      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "Ne laisse pas ses mots de distraire l'apprenti ! Il te poignardera dès que tu auras le dos tourné !",
+	  ["Do the deed"] = "Accomplir l'acte",
+      ["Double Kill!"] = "Double meurtre",
+--      ["DOUBLE KILL"] = "", -- Mutant
+      ["Do you have any idea how valuable grass is?"] = "Est ce que vous avez une idée de la valeur de votre herbe ?",
+      ["Do you think you're some kind of god?"] = "Vous vous prenez pour un genre de dieu ?",
+      ["Dragon's Lair"] = "",
+      ["Dragon's Lair"] = "",
+      ["Dragon's Lair"] = "",
+      ["Dragon's Lair"] = "La tanière du dragon",
+      ["Drills"] = "",
+      ["Drone Hunter!"] = "Chasseur de drone",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
+--      ["Drowner"] = "",-- can't have a good translation, think its a merge of drone and owner so if wanna translate it will be : tueur de drone, wich is like drone hunter...
+      ["Dude, all the plants are gone!"] = "Mec, toutes les plantes sont parties !",
+      ["Dude, can you see Ramon and Spiky?"] = "Mec, peux tu voir Ramon et Spkiky ? ",
+      ["Dude, that's so cool!"] = "Mec, c'est si cool !",
+      ["Dude, we really need a new shaman..."] = "mec, on a vraiment besoin d'un nouveau Shaman...",
+      ["Dude, what's this place?!"] = "Mec, quel est cet endroit?",
+      ["Dude, where are we?"] = "Mec, où sommes nous ? ",
+     -- ["Dude, wow! I just had the weirdest high!"] = "",
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
+      ["Each turn you get 1-3 random weapons"] = "A chaque tour, tu as 1 à 3 armes aléatoires",
+      ["Each turn you get one random weapon"] = "A chaque tour, tu as une arme aléatoire",
+      ["Eagle Eye"] = "",
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+      ["Ear Sniffer"] = "",
+      ["Ear Sniffer"] = "Ear Sniffer",
+      ["Elderbot"] = "",
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
       ["Eliminate all enemies"] = "Éliminez tous les ennemis",
       ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Éliminez toutes les cibles avant d'être à cours de temps.|Vos munitions sont illimitées pour cette mission.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
       ["Eliminate Poison before the time runs out"] = "Éliminez tout le Poison avant d'être à cours de temps.",
       ["Eliminate the Blue Team"] = "Éliminez l'équipe bleue",
---      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
---      ["Eliminate the enemy hogs to win."] = "",
---      ["Eliminate the enemy specialists."] = "",
+      ["Eliminate the enemy before the time runs out"] = "Eliminez les ennemis avant que le temps ne soit épuisé", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+      ["Eliminate the enemy hogs to win."] = "Eliminez les hérissons ennemis pour gagner",
+      ["Eliminate the enemy specialists."] = "Eliminez les spécialists ennemis",
       ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "Éliminez l'unité 3378|- Résistance Futile doit survivre",
+      ["Elmo"] = "",
+      ["Elmo"] = "",
+      ["Elmo"] = "",
 --      ["Energetic Engineer"] = "",
       ["Enjoy the swim..."] = "Profitez du bain ...",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+      ["Everyone knows this."] = "Tout le monde sait ça.",
+      ["Every single time!"] = "A chaque fois !",
+      ["Everything looks OK..."] = "Tout à l'air d'être OK ...",
+      ["Exactly, man! That was my dream."] = "Exactement, mec ! C'était mon rêve.",
+      ["Eye Chewer"] = "Eye Chewer",
+--      ["FAG"] = "", -- Mutant
+	  = "Fais sortir tes coéquipiers de leur prison naturelle et sauve la princesse ! |Percer des trous résoudrait tout. |ca serait une bonne idée de placer quelque poutres avant de commencer à percer. je dis ça, je dis rien. |Tous vos hérissons doivent être au dessus de la hauteur marquée ! | Leaks A Lot doit être très proche de la princesse !  ",
+      ["Family Reunion"] = "",
+      ["Family Reunion"] = "Réunion de famille ",
       ["Fastest lap: "] = "Meilleur tour : ",
       ["Feeble Resistance"] = "Résistance Futile",
+      ["Fell From Grace"] = "",
+      ["Fell From Grace"] = "",
+      ["Fell From Grace"] = "",
+      ["Fell From Grace"] = "",
+      ["Fell From Grace"] = "",
+      ["Fell From Grace"] = "Fell From Grace",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "",
+      ["Fell From Heaven"] = "Fell From Heaven",
+      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "Fell From Heaven est la meilleure ! Fell From Heaven est la meilleure !",
+      ["Femur Lover"] = "Femur Lover",
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "",
+      ["Fiery Water"] = "Fiery Water",
+      ["Find your tribe!|Cross the lake!"] = "Trouves ta tribue ! |travers le lac !",
+      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "Finis ton entraînement ! |Astuce : Les animations peuvent être passées en appuyant sur la touche [Precise]",
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+      ["First aid kits?!"] = "Des kits de premiers secours ?!",
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+      ["First Blood"] = "Premier sang",
+      ["First Blood"] = "Premier sang",
+	  ["First Blood"] = "Premier sang",
+	  ["First Steps"] = "Premiers pas",
       ["Flag captured!"] = "Drapeau capturé !",
       ["Flag respawned!"] = "Drapeau réapparu",
       ["Flag returned!"] = "Drapeau récupéré",
---      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
+      ["Flags, and their home base will be placed where each team ends their first turn."] = "Les drapeaux et leur base seront placés là où chaque équipe finit son premier tour",
 --      ["Flamer"] = "",
+      ["Flaming Worm"] = "",
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+      ["Flesh for Brainz"] = "Flesh for Brainz",
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+      ["Free Dense Cloud and continue the mission!"] = "Libérez Dense Cloud et continuez la mission !",
 --      ["Friendly Fire!"] = "",
---      ["fuel extended!"] = "",
---      ["GAME BEGUN!!!"] = "",
+      ["fuel extended!"] = "Le plein d'essence !",
+      ["GAME BEGUN!!!"] = "Le jeu a commencé !!!",
 --      ["Game Modifiers: "] = "",
       ["GAME OVER!"] = "Fin du jeu ! ",
       ["Game Started!"] = "Début du jeu ! ",
+      ["Game? Was this a game to you?!"] = "Jeu ? Etais ce un jeu pour vous ?!",
+--      ["GasBomb"] = "", -- Continental_supplies
+      ["Gas Gargler"] = "",
+      ["Get Dense Cloud out of the pit!"] = "Sortez Dense Cloud de la fosse",
       ["Get on over there and take him out!"] = "Viens par ici et débarrasse-toi de lui ! ",
+	  ["Get on the head of the mole"] = "Va sur la tête de la taupe",
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+	  ["Get that crate!"] = "Prends cette caisse",
+      ["Get the crate on the other side of the island!|"] = "Prends la caisse de l'autre côté de l'île !",
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|	  Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] 
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+      ["Gimme Bones"] = "",
+      ["Glark"] = "Glark",
 --      ["Goal"] = "",
 --      ["GO! GO! GO!"] = "",
       ["Good birdy......"] = "Gentil oiseau ...",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+      ["Good idea, they'll never find us there!"] = "Bonne idée, ils ne nous trouverons jamais là bas !",
+      ["Good luck...or else!"] = "",
+      ["Good luck...or else!"] = "Bonne chance.... ou pas !",
       ["Good luck out there!"] = "Bonne chance pour sortir d'ici",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
---      ["GOTCHA!"] = "",
---      ["Grab Mines/Explosives"] = "",
+	  ["Go on top of the flower"] = "Atteins le dessus de la fleur",
+      ["Go, quick!"] = "Va ! Vite !",
+      ["Gorkij"] = "Gorkij",
+--      ["Go surf!"] = "", -- WxW
+--      ["GOTCHA!"] = "je t'ai eu !",  is this good ? 
+      ["Grab Mines/Explosives"] = "Emparez vous des Mines/Explosifs",
+      ["Great choice, Steve! Mind if I call you that?"] = "Bon choix, Steve ! Ca t'ennuie si je t'appele comme ça ?",
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+      ["Great! You will be contacted soon for assistance."] = "super ! Tu seras bientot contacté pour de l'assistance.",
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+      ["Greetings, cloudy one!"] = "Salutation, le nuageux !",
+      ["Greetings, "] = "Salutations, ",
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+      ["Guys, do you think there's more of them?"] = "Les gars, vous pensez qu'ils y en plus encore ?",
 --      ["Hahahaha!"] = "",
---      ["Haha, now THAT would be something!"] = "",
+      ["Haha!"] = "Haha !",
+      ["HAHA!"] = "HAHA !",
+      ["Haha, now THAT would be something!"] = "Haha, maintenant CA va être quelquechose !",
+      ["Hannibal"] = "Hannibal",
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
---      ["Health crates extend your time."] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+      ["Hatless Jerry"] = "",
+      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "N'ai pas d'illusion, ta tribue est morte, quel que soit ton choix",
+      ["Have we ever attacked you first?"] = "nous avons vous jamais attaqué en premier ? ",
+      ["Health crates extend your time."] = "Les caisses de vie augmentent votre temps.",
 --      ["Heavy"] = "",
+      ["Heavy Cannfantry"] = "",
+      ["Hedge-cogs"] = "",
+      ["Hedge-cogs"] = "",
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 --      ["Hedgewars-Basketball"] = "",
 --      ["Hedgewars-Knockball"] = "",
---      ["Heh, it's not that bad."] = "",
+      ["Hedgibal Lecter"] = "",
+      ["Heh, it's not that bad."] = "Hé, c'est pas si mal.",
+      ["Hello again, "] = "Re*bonjour,",
+      ["Help me, Leaks!"] = "Aide moi, Leaks !",
+      ["Help me, please!!!"] = "",
+      ["Help me, please!"] = "",
+      ["Help me, please!!!"] = "Aide moi, s'il te plait !!!",
+      ["Help me, please!"] = "Aide moi, s'il te plaît !",
+	  ["He moves like an eagle in the sky."] = "Il se déplace comme un aigle dans le ciel",
+      ["He must be in the village already."] = "Il doit déjà être au village",
+      ["Here, let me help you!"] = "Laissez moi vous aider !",
+      ["Here, let me help you save her!"] = "Laisse moi vous aider à la sauver !",
+      ["Here...pick your weapon!"] = "ici...choisis ton arme !",
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+	  ["He's so brave..."] = "Il est si courageux",
+      ["He won't be selling us out anymore!"] = "Il ne nous vendra plus !",
+      ["Hey, guys!"] = "",
+      ["Hey guys!"] = "Salut les gars !",
+      ["Hey! This is cheating!"] = "",
+      ["Hey! This is cheating!"] = "Hé ! C'est de la triche !",
+--      ["HIGHLANDER"] = "", -- Highlander
+	  ["Hightime"] = "Meilleur temps",
+      ["Hint: Double Jump - Press [Backspace] twice"] = "Astuce : Double saut : appuyez deux fois sur [retour arrière]",
+      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "Astuce : Selectionnez le chalumeau, visez et tirez[Espace]. [espace] a nouveau pour stopper. |N'explosez pas la caisse.",
+      ["Hint: Select the LowGravity and press [Fire]."] = "Astuce : Selectionnez : gravité faible et appuyez sur [espace]",
+      ["Hint: you might want to stay out of sight and take all the crates...|"] = "Astuce : Vous aimeriez probablement rester hors de vue et prendre toutes les caisses...|",
+	  ["His arms are so strong!"] = "Ces bras sont si forts !",
 --      ["Hit Combo!"] = "",
 --      ["Hmmm..."] = "",
+      ["Hmmm...actually...I didn't either."] = "Humm... en fait...je ne savais pas non plus.",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+      ["Hmmm...it's a draw. How unfortunate!"] = "Hmmm... C'est un dessin. Pas de chance !",
+	  ["Hmmm...perhaps a little more time will help."] = "humm...Peut être qu'un peu plus de temps aiderait",
+      ["Hogminator"] = "",
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+      ["Honest Lee"] = "",
       ["Hooray!"] = "Hourra ! ",
+      ["Hostage Situation"] = "Situation d'otage",
+      ["How can I ever repay you for saving my life?"] = "",
+      ["How can I ever repay you for saving my life?"] = "",
+      ["How can I ever repay you for saving my life?"] = "Comment pourrais-je jamais te remercier de m'avoir sauver la vie ?",
+      ["How come in a village full of warriors, it's up to me to save it?"] = "Comment entrer dans un village plein de guerriers, c'est à moi de le sauver ?",
+	  ["How difficult would you like it to be?"] = "A quel point veut tu que ce soit difficile ?",
+      ["HOW DO THEY KNOW WHERE WE ARE???"] = "COMMENT SAVENT-ILS OU NOUS SOMMES ?",
+      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "",
+      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "Cependant, si tu échoues, elle aura une mort encore plus violente ! Muahahaha!",
+      ["However, my mates don't agree with me on letting you go..."] = "Mes amis ne sont pas d'accord pour vous laisser partit ...",
+--      [" HP"] = "", -- Mutant
       ["Hunter"] = "Chasseur", --Bazooka, Shotgun, SniperRifle
+      ["I believe there's more of them."] = "Je crois qu'il y en a encore d'autres",
+	  ["I can see you have been training diligently."] = "Je vois que tu t'es entraîné assiduement.",
+      ["I can't believe it worked!"] = "Je ne peux pas croire que ça a marché !",
+      ["I can't believe this!"] = "Je ne peux pas le croire !",
+      ["I can't believe what I'm hearing!"] = "Je ne peux pas croire ce que j'entends !",
+      ["I can't wait any more, I have to save myself!"] = "Je ne peux plus attendre, je dois me sauver !",
+      ["I could just teleport myself there..."] = "Je pourrai juste me téléporter la bas...",
+      ["I'd better get going myself."] = "Je ferai mieux de rentrer.",
+      ["I didn't until about a month ago."] = "Je ne savais pas jusqu'à il y a un mois",
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+      ["I feel something...a place! They will arrive near the circles!"] = "",
+      ["I feel something...a place! They will arrive near the circles!"] = "Je sens quelque chose... une localisation ! Ils vont arriver près des cercles !",
+      ["If only I had a way..."] = "",
+      ["If only I had a way..."] = "Si seulement j'avais un moyen...",
+      ["If only I were given a chance to explain my being here..."] = "Si seulement vous me laissiez une chance d'expliquer ce que je fais ici...",
+      ["I forgot that she's the daughter of the chief, too..."] = "J'avais oublié qu'elle était aussi la fille du chef...",
+      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "S'ils essaient de venir, ils pourront gouter de mes poings",
+      ["If you agree to provide the information we need, you will be spared!"] = "Si tu es d'accord pour nous donner les informations dont nous avons besoin, tu seras épargné !",
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "Si tu décides de nous aider, et bien, nous n'aurons plus besoin de chercher un nouveau gouverneur pour l'île.",
+      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "Si vous êtes coincés, utiliser le Desert Eable, ou recommencez la missions",
+      ["If you know what I mean..."] = "Si tu vois ce que je veux dire...",
+      ["If you say so..."] = "Si tu le dis...",
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)!|"] = "Si tu soihaire recommencer la coursse, maintien [precise] quand ton tour se termine (avec [passe ton tour ] par exemple",
+      ["I guess you'll have to kill them."] = "Je suppose que vous devrez les tuer",
+      ["I have come to make you an offering..."] = "Je suis venu te faire une offre...",
+      ["I have no idea where that mole disappeared...Can you see it?"] = "Je n'ai aucune idée où cette taupe à bien pu aller...Peux tu la voir ?",
+      ["I have to follow that alien."] = "Je dois suivre cet extraterrestre",
+      ["I have to get back to the village!"] = "Je dois retourner au village !",
+	  ["I hope you are prepared for a small challenge, young one."] = "J'espere que tu es préparé pour un petit défi, l'apprenti",
+      ["I just don't want to sink to your level."] = "Je ne veux pas m'abaisser à votre niveau.",
+      ["I just found out that they have captured your princess!"] = "Je viens de m'apercevoir qu'ils ont capturé votre princesse !",
+      ["I just wonder where Ramon and Spiky disappeared..."] = "Je me demande seulement où Ramon et Spiky ont disparu",
+      ["I'll hold them off while you return to the village!"] = "Je vais les retenir pendant que tu retourne au village",
+	  ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "imagines que ces cibles sont les loups qui ont tués tes parents ! Défoule ta colère sur eux !",
+      ["I'm...alive? How? Why?"] = "Je suis...vivant ? Comment ? Pourquoi ?",
+      ["I'm a ninja."] = "Je suis un ninja",
+      ["I marked the place of their arrival. You're welcome!"] = "J'ai marqués les lieux d'où ils arriveront. Derien !",
+      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "Ce doit être une erreur, mes chers hérissons",
+      ["I mean, none of you ceased to live."] = "Je veux dire, aucun d'entre vous n'a cessé de vivre",
+      ["I'm getting old for this!"] = "Je deviens vieux pour ça !",
+      ["I'm getting thirsty..."] = "je deviens trentenaire",
+      ["I'm here to help you rescue her."] = "Je suis ici pour t'aider à la secourir.",
+      ["I'm not sure about that!"] = "",
+      ["I'm not sure about that!"] = "Je n'en suis pas si sûr !",
+	  ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "Impressionnant...tu es aussi sec que le cadavre d'un faucon après une semaine dans le désert...",
+      ["I'm so scared!"] = "Je suis si effrayé !",
+      ["Incredible..."] = "Incroyable",
+      ["I need to find the others!"] = "Je dois trouver les autres !",
+      ["I need to get to the other side of this island, fast!"] = "Je dois aller sur l'autre côté de cette île, rapidemment !",
+      ["I need to move the tribe!"] = "Je dois emmener la tribue",
+      ["I need to prevent their arrival!"] = "Je dois prévoir leur arrivée !",
+      ["I need to warn the others."] = "Je dois avertir les autres.",
+      ["In fact, you are the only one that's been acting strangely."] = "En fait, tu es le seul qui a agi étrangement.",
+      ["In order to get to the other side, you need to collect the crates first.|"] = "dans le but d'atteindre l'autre coté, tu dois d'abord collectez les caisses ",
       ["Instructor"] = "Instructeur", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
---      ["invaders destroyed"] = "",
---      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
---      ["Jumping is disabled"] = "",
+      ["Interesting idea, haha!"] = "Idee interessante, haha !",
+      ["Interesting! Last time you said you killed a cannibal!"] = "Interessant ! La dernière fois tu as dit que tu avais tué un cannibale !",
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
+      ["invaders destroyed"] = "envahisseur détruit",
+      ["Invasion"] = "Invasion",
+      ["I saw it with my own eyes!"] = "Je l'ai vu de mes propres yeux !",
+      ["I see..."] = "Je vois...",
+	  ["I see you have already taken the leap of faith."] = "Je vois que tu as déjà fait le saut de la foi.",
+      ["I see you would like his punishment to be more...personal..."] = "Je vois que tu voudrais que son châtiment soit plus...personnel...",
+      ["I sense another wave of cannibals heading my way!"] = "",
+      ["I sense another wave of cannibals heading our way!"] = "Je sens une autre vague de cannibale qui arrivent !",
+      ["I shouldn't have drunk that last pint."] = "Je n'aurais pas du boire cette derniere pinte",
+      ["Is this place in my head?"] = "est ce que cet endroit est dans ma tete ?",
+      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "Ca n'a pas d'importance. je ne laisserai pas cet alien blesser ma fille !",
+      ["I think we are safe here."] = "Je pense que nous sommes en sécurité ici.",
+      ["I thought their shaman died when he tried our medicine!"] = "Je pensais que leur shaman est mort quand il a essayé notre médecine !",
+      ["It is called 'Hogs of Steel'."] = "C'est appelé 'hérissions d'acier' .",
+	  ["It is time to practice your fighting skills."] = "Il est temps d'entraîner tes compétences de combat",
+      ["It must be a childhood trauma..."] = "Ca doit être un traumatisme d'enfance",
+      ["It must be the aliens!"] = "Ce doit être les extraterrestres !",
+      ["It must be the aliens' deed."] = "Ce doit être à cause des extraterrestres",
+      ["It must be the cyborgs again!"] = "Ce doit encore etre les cyborgs !",
+      ["I told you, I just found them."] = "Je te l'ai dit, je les ai juste trouvés",
+      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "c'est une bonne chose que la MORT SUBITE soit dans 99 tours",
+      ["It's always up to women to clear up the mess men created!"] = "C'est toujours aux femmes de s'occuper du bazar que les hommes ont créés !",
+      ["It's a shame, I forgot how to do that!"] = "C'est une honte, j'ai oublié comment faire !",
+      ["It's impossible to communicate with the spirits without a shaman."] = "C'est impossible de communiquer avec les esprits sans un shaman.",
+      ["It's over..."] = "C'est terminé...",
+      ["It's time you learned that your actions have consequences!"] = "Il est toi pour toi d'apprendre que tes actions ont des conséquences !",
+      ["It's worth more than wood!"] = "C'est pire que le bois !",
+      ["It wants our brains!"] = "Ca veut nos cerveaux",
+      ["It was not a dream, unwise one!"] = "Ce n'était pas un rêve, imprudent !",
+      ["I've seen this before. They just appear out of thin air."] = "J'ai déjà vu ça. Ils apparaissent dans les airs",
+      ["I want to play a game..."] = "",
+      ["I want to play a game..."] = "Je veux faire un jeu...",
+      ["I want to see how it handles this!"] = "",
+      ["I want to see how it handles this!"] = "Je veux voir comment ils vont faire avec ça !",
+      ["I wish to help you, "] = "Je souhaite t'aider,",
+      ["I wonder where Dense Cloud is..."] = "Je me demande où est Dense Cloud... ",
+      ["I wonder where Dense Cloud is..."] = "Je me demande où est Dense Cloud...",
+      ["I wonder why I'm so angry all the time..."] = "Je me demande pourquoi je suis toujours tellement en colère",
+      ["I won't let you kill her!"] = "Je ne te laisserai pas la tuer !",
+      ["Jack"] = "",
+      ["Jack"] = "",
+      ["Jack"] = "",
+      ["Jeremiah"] = "",
+      ["John"] = "John",
+      ["Judas"] = "Judas",
+      ["Jumping is disabled"] = "Le saut est désactivé",
+      ["Just kidding, none of you have died!"] = "Je rigole, aucun d'entre vous n'est mort !",
+      ["Just on a walk."] = "Je faisais juste une promenade",
+      ["Just wait till I get my hands on that trauma! ARGH!"] = "Attends un peu que je mette la main sur ce traumatisme !  ARGH !",
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
---      ["Killing spree!"] = "",
---      ["KILLS"] = "",
---      ["Last Target!"] = "",
---      ["[Left Shift]"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
+      ["Killing spree!"] = "Massacre",
+	  ["KILL IT!"] = "Tue le",
+      ["KILL IT!"] = "TUE LE !",
+      ["KILLS"] = "Meurtres",
+      ["Kill the aliens!"] = "",
+      ["Kill the cannibal!"] = "Tue le cannibale !",
+	  ["Kill the cannibal!"] = "Tue le cannibale",
+      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "Tue le traître... ou épargnes sa vie ! |Tue le ou appuies sur [Precise] !",
+      ["Last Target!"] = "Dernière cible !",
+      ["Leader"] = "",
+      ["Leaderbot"] = "",
+      ["Leaderbot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot"] = "",
+      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "",
+      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "",
+      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "Leaks A Lot, déprimé d'avoir tué l'élue de son coeur, échoua à sauver le village...",
+      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "Leaks A Lot à donné sa vie pour sa tribus ! Il aurait du survivre !",
+      ["Leaks A Lot"] = "Leaks A Lot",
+      ["Leaks A Lot must survive!"] = "Leaks A Lot doit survivre !",
+      ["Led Heart"] = "",
+      ["Lee"] = "",
+      ["Lee"] = "",
+      ["Lee"] = "",
+--      ["[Left Shift]"] = "",-- touche majuscule gauche
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+      ["Let me test your skills a little, will you?"] = "",
+      ["Let me test your skills a little, will you?"] = "Laisse moi te tester un peu, veux tu ?",
+      ["Let's go home!"] = "",
+      ["Let's go home!"] = "",
+      ["Let's go home!"] = "Rentrons à la maison !",
+      ["Let's head back to the village!"] = "Retournons au village !",
+      ["Let's see what your comrade does now!"] = "",
+      ["Let's see what your comrade does now!"] = "Voyons ce que fait ton camarade maintenant !",
+      ["Let's show those cannibals what we're made of!"] = "",
+      ["Let's show those cannibals what we're made of!"] = "Montrons à ces cannibales de quel bois on se chauffe !",
+      ["Let them have a taste of my fury!"] = "Ils vont gouter de ma fureur !",
+      ["Let us help, too!"] = "Allons aider nous aussi !",
+      ["Light Cannfantry"] = "",
       ["Listen up, maggot!!"] = "Écoutez, asticots",
+      ["Little did they know that this hunt will mark them forever..."] = "Savait-il que cette chasse allait les marquer à jamais...",
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+      ["Look, I had no choice!"] = "ecoute, je n'avais pas le choix !",
+      ["Look out! There's more of them!"] = "Ils sont plus nombreux !",
+      ["Look out! We're surrounded by cannibals!"] = "Regarde ! nous sommes entourés par les cannibales !",
+      ["Looks like the whole world is falling apart!"] = "On dirait que le monde entier tombe en morceaux !",
+      ["Luckily, I've managed to snatch some of them."] = "Heureusement, j'ai réussi à en avoir quelques unes",
+--      ["LUDICROUS KILL"] = "", -- Mutant
+      ["May the spirits aid you in all your quests!"] = "Puisse les esprits t'aider dans tes quêtes !",
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+      ["Meiwes"] = "",
+      ["Mindy"] = "",
 --      ["Mine Deployer"] = "",
---      ["Mine Eater!"] = "",
+      ["Mine Eater!"] = "Mangeur de Mines",
 --      ["|- Mines Time:"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["MISSION FAILED"] = "Mission échouée", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
---      ["MISSION SUCCESS"] = "",
       ["MISSION SUCCESSFUL"] = "Mission réussie", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
---      ["Movement: [Up], [Down], [Left], [Right]"] = "",
+      ["MISSION SUCCESS"] = "SUCCES DE LA MISSION",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+      ["More Natives"] = "More Natives",
+      ["Movement: [Up], [Down], [Left], [Right]"] = "Mouvement: [haut], [bas], [gauche], [droite]",
 --      ["Multi-shot!"] = "",
---      ["Nameless Heroes"] = "",
---      ["New Barrels Per Turn"] = "",
+      ["Muriel"] = "",
+      ["Muriel"] = "",
+      ["Muriel"] = "",
+      ["Muriel"] = "",
+      ["Muscle Dissolver"] = "Muscle Dissolver",
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+      ["Name"] = "",
+      ["Nameless Heroes"] = "Heros sans noms",
+      ["Nancy Screw"] = "",
+      ["Nancy Screw"] = "",
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "",
+      ["Natives"] = "Natives",
+      ["Natives"] = "Natives",
+      ["New Barrels Per Turn"] = "Nouveaux barrils par tour",
 --      ["NEW CLAN RECORD: "] = "",
       ["NEW fastest lap: "] = "Nouveau meilleur temps",
---      ["New Mines Per Turn"] = "",
---      ["NEW RACE RECORD: "] = "",
---      ["Newton's Hammock"] = "",
---      ["NOT ENOUGH WAYPOINTS"] = "",
+      ["New Mines Per Turn"] = "Nouvelles mines par tour",
+      ["NEW RACE RECORD: "] = "NOUVEAU RECORD DE COURSE",
+      ["Newton's Hammock"] = "Le hammac de Newton",
+      ["Nicely done, meatbags!"] = "Bien joués, sac à viande !",
+      ["Nice work!"] = "",
+      ["Nice work, "] = "Beau boulot",
+      ["Nice work!"] = "Beau travail !",
+      ["Nilarian"] = "",
+      ["No, I came back to help you out..."] = "Non je suis revenu pour t'aider...",
+      ["No...I wonder where they disappeared?!"] = "Non...Je me demande où ils ont disparu ?!",
+      ["NomNom"] = "",
+      ["Nom-Nom"] = "Nom-Nom",
+      ["Nope. It was one fast mole, that's for sure."] = "Non. C'était une taupe rapide, ça c'est certain.",
+      ["No! Please, help me!"] = "Non ! S'il te plaît, aide moi !",
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
+      ["NOT ENOUGH WAYPOINTS"] = "Pas assez de points de passage",
+      ["Not now, Fiery Water!"] = "Pas maintenant, Fiery Water !",
       ["Not So Friendly Match"] = "Match pas si amical", -- Basketball, Knockball
+      ["Not you again! My head still hurts from last time!"] = "Pas encore vous ! Ma tête me fait encore mal de la dernière fois !",
+      ["No, we made sure of that!"] = "Non, nous nous en sommes assurés",
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+      ["No! What have I done?! What have YOU done?!"] = "Non ! Qu'ai je fait ? Qu'as TU fais ?!",
+      ["No. Where did he come from?"] = "Non. D'où est-il venu ?",
+      ["Now how do I get on the other side?!"] = "Maintenant comme je me rends de l'autre coté ?",
+      ["No. You and the rest of the tribe are safer there!"] = "Non, Toi et le reste de la tribue etes plus en sécurité ici ! ",
+      ["Obliterate them!|Hint: You might want to take cover..."] = "",
+      ["Obstacle course"] = "Course d'obstacle",
+      ["Of course I have to save her. What did I expect?!"] = "Bien sur je dois la sauver. Qu'est ce que j'imaginais ?",
+      ["OH, COME ON!"] = "",
+      ["OH, COME ON!"] = "OH, ALLEZ !",
+      ["Oh, my!"] = "Oh mon dieu !",
+      ["Oh, my! This is even more entertaining than I've expected!"] = "Oh mon dieu ! c'est meme plus amusant que ce que je pensais !",
       ["Oh no! Just try again!"] = "Eh non ! Essayez encore ! ", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
       ["Oh no! Time's up! Just try again."] = "Eh non ! Temps écoulé ! Essayez encore ! ", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+      ["Oh, silly me! I forgot that I'm the shaman."] = "",
+      ["Oh, silly me! I forgot that I'm the shaman."] = "Oh suis je bête ! j'ai oublié que j'étais le shaman.",
+      ["Olive"] = "",
+	  ["Omnivore"] = "Omnivore",
+	  ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "Il était une fois, sur une île possédant de grandes ressources naturelles, vivait deux tribus en violent conflit...",
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+	  ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "L'une des deux tribus était pacifique, passant son temps à chasser et à s'entraîner, appréciants les petits plaisirs de la vie",
+      ["Oops...I dropped them."] = "oups ... Je les ai laissées tomber.",
+	  ["Open that crate and we will continue!"] = "Ouvre cette caisse et nous pourrons continuer",
 --      ["Operation Diver"] = "",
       ["Opposing Team: "] = "Équipe opposée",
+      ["Orlando Boom!"] = "",
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+      ["Our tribe, our beautiful island!"] = "Notre tibue, notre belle ile !",
+--      ["Parachute"] = "", -- Continental_supplies
       ["Pathetic Hog #%d"] = "Hérisson pathétique #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
---      ["Per-Hog Ammo"] = "",
---      ["Place more waypoints using [ENTER]"] = "",
---      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+	  ["Perfect! Now try to get the next crate without hurting yourself!"] = "Parfait, maintenant essaye d'avoir la prochaine caisse sans te blesser !",
+      ["Per-Hog Ammo"] = "Munitions par hérissons",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+      ["Pfew! That was close!"] = "Ouf! C'est pas passé loin !",
+      ["Pfew! That was close!"] = "Ouf ! C'étais pas loin !",
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
+      ["Place more waypoints using [ENTER]"] = "Place plus de points de passage avec [enter]",
+      ["Place more waypoints using the 'Air Attack' weapon."] = "Place plus de points de passage avec l'arme : attaque aérienne.",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+      ["Play with me!"] = "Joue avec moi !",
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
       ["points"] = "points", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
       ["Poison"] = "Poison",
+      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "portails astuce : l'un est la destination, l'autre est l'entrée ",
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
---      ["Prepare yourself"] = "",
---      ["Press [Precise] to skip intro"] = "",
+      ["Prepare yourself"] = "prépare toi",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+	  ["Press [Left] or [Right] to move around, [Enter] to jump"] = "Appuyez [Gauche] ou [Droite] pour vous déplacer, [Entrée] pour sauter",
+      ["Press [Precise] to skip intro"] = "appuie sur [precise] pour passer l'intro",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "Protèges toi ! |Astuce Grenade : Règle le compte à rebour avec [1-5], vises avec [haut]/[bas] et maintient [Espace] pour la puissance",
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+      ["Rachel"] = "",
+      ["Rachel"] = "",
+      ["Rachel"] = "",
+--      ["Radar Ping"] = "", -- Space_Invasion
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "",
+      ["Raging Buffalo"] = "Raging Buffalo",
+      ["Ramon"] = "",
+      ["Ramon"] = "",
+      ["Ramon"] = "",
+      ["Ramon"] = "Ramon",
+      ["Ramon"] = "Ramon",
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+      ["Really?! You thought you could harm me with your little toys?"] = "Vraiment ? tu pensais pouvoir me blesser avec tes petits jouets ?",
+      ["Regurgitator"] = "",
+      ["Reinforcements"] = "",
+      ["Reinforcements"] = "",
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "Souviens toi, animal pathétique : quand le jour viendra, tu regrettera ton aveugle loyauté !",
       [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "Ramenez le drapeau ennemi à votre base pour marquer | -La première équipe à 3 captures gagne | - Vous marquez uniquement si votre drapeau est dans votre base | - Les hérissons vont lâcher le drapeau s'ils sont tués ou noyés | - Les drapeaux lâchés peuvent être ramenés ou recapturés | - Les hérissons réapparaissent quand ils sont tués",
+      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "",
+      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "Retourne vers Leaks A Lot ! Si tu es bloqué, appuie sur [Precise] pour réessayer !",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "",
+      ["Righteous Beard"] = "Righteous Beard",
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+      ["Rot Molester"] = "Rot Molester",
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
       ["RULES OF THE GAME [Press ESC to view]"] = "RÈGLES DU JEU | [Appuyez Échap pour voir]",
+      ["Rusty Joe"] = "",
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+      ["Salivaslurper"] = "",
+      ["Salvation"] = "Le salut",
+      ["Salvation was one step closer now..."] = "Le salut était tout proche...",
 --      ["Save as many hapless hogs as possible!"] = "",
+      ["Save Fell From Heaven!"] = "",
+      ["Save Fell From Heaven!"] = "Sauve Fell From Heaven ! ",
+      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "Sauve Leaks A Lot ! |L'outil changer de hérisson pourrait aider",
+      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "Sauve la princesse, tous vos hérissons doivent survivre ! |tue les cyborgs en premier ! utilise les munitions très prudemment ! |Tu voudras peut etre garder une poutre pour te couvrir !",
+      ["Save the princess by collecting the crate in under 12 turns!"] = "Sauve la princesse en collectant la caisse en moins de 3 tours !",
+      ["Scalp Muncher"] = "",
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+	  ["See that crate farther on the right?"] = "Tu vois cette caisse plus loin sur la droite ? ",
       ["See ya!"] = "Bye bye",
+      ["Segmentation Paul"] = "",
+--      ["Select continent!"] = "", -- Continental_supplies
+      ["Select difficulty: [Left] - easier or [Right] - harder"] = "Choisis la difficulté : [Gauche] : plus facile, ou [Droite] : plus dur",
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
---      ["Shield boosted! +30 power"] = "",
---      ["Shield Depleted"] = "",
---      ["Shield is fully recharged!"] = "",
---      ["Shield Master!"] = "",
---      ["Shield Miser!"] = "",
---      ["Shield OFF:"] = "",
---      ["Shield ON:"] = "",
+      ["... share your beauty with the world every morning, my princess!"] = "...partager ta beauté avec le monde chaque matin, ma princesse !",
+      ["She's behind that tall thingy."] = "Elle est derrière ce grand truc.",
+      ["Shield boosted! +30 power"] = "Bouclier boosté! +30",
+      ["Shield Depleted"] = "Bouclier épuisé",
+      ["Shield is fully recharged!"] = "bouclier chargé à fond!",
+      ["Shield Master!"] = "Bouclier master",
+      ["Shield Miser!"] = "",
+      ["Shield OFF:"] = "bouclier OFF",
+      ["Shield ON:"] = "Bouclier ON",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
       ["Shotgun Team"] = "Équipe de choc",
       ["Shotgun Training"] = "Entrainement au fusil",
---      ["shots remaining."] = "",
+      ["shots remaining."] = "tirs restants",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+      ["Sirius Lee"] = "",
       ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s est dehors et l'équipe %d| reçoit une pénalité ! | |Score : ", -- Basketball, Knockball
       ["%s is out and Team %d|scored a point!| |Score:"] = "%s est dehors et l'équipe %d| reçoit un point ! | |Score : ", -- Basketball, Knockball
+      ["Slippery"] = "Glissant",
+      ["Smith 0.97"] = "",
+      ["Smith 0.98"] = "",
+      ["Smith 0.99a"] = "",
+      ["Smith 0.99b"] = "",
+      ["Smith 0.99f"] = "",
+      ["Smith 1.0"] = "",
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Entrainement au fusil de sniper",
---      ["Sniperz"] = "",
---      ["Sponge"] = "",
+      ["Sniperz"] = "Snipers",
+	  ["So humiliating..."] = "Si humiliant...",
+--      ["South America"] = "", -- Continental_supplies
+      ["So? What will it be?"] = "Alors ? Qu'est ce que ce sera ?",
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+      ["Spiky Cheese"] = "",
+      ["Spiky Cheese"] = "",
+      ["Spiky Cheese"] = "",
+      ["Spiky Cheese"] = "Spiky cheese",
+      ["Spiky Cheese"] = "Spiky Cheese",
+      ["Spleenlover"] = "",
+--      ["Sponge"] = "éponde",--??
       ["Spooky Tree"] = "Arbre fantomatique",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+      ["Steel Eye"] = "",
+      ["Step By Step"] = "Pas à Pas",
+      ["Steve"] = "",
+      ["Steve"] = "",
+      ["Steve"] = "",
+--      ["Sticky Mine"] = "", -- Continental_supplies
+      ["Stronglings"] = "Stronglings",
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "Survis ! Les cinématique peuvent être passées avec la touche [Precise]. ",
+	  ["Swing, Leaks A Lot, on the wings of the wind!"] = "Balances toi Leaks a Lot, sur les ailes du vent",
 --      ["Switched to "] = "",
+      ["Syntax Errol"] = "",
+      ["Talk about mixed signals..."] = "Parlons des signaux mélangés",
       ["Team %d: "] = "Équipe %d : ",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+      ["Teleport hint: just use the mouse to select the destination!"] = "Teleporte : utilise la souris pour selectionner la destination !",
+      ["Thanks!"] = "Merci !",
+      ["Thank you, my hero!"] = "Merci, mon héro !",
+      ["Thank you, oh, thank you, Leaks A Lot!"] = "Merci, oh, Merci, Leaks A Lot !",
+      ["Thank you, oh, thank you, my heroes!"] = "",
+      ["Thank you, oh, thank you, my heroes!"] = "Merci, oh, merci mes héros !",
+      ["That is, indeed, very weird..."] = "c'est ça, en effet, très étrange...",
+      ["That makes it almost invaluable!"] = "Ca la rends presque inestimable !",
+      ["That ought to show them!"] = "Ca doit leur montrer",
+      ["That's for my father!"] = "C'est pour mon père !",
+      ["That shaman sure knows what he's doing!"] = "Ce Shaman sait vraiment ce qu'il fait !",
 --      ["That Sinking Feeling"] = "",
+      ["That's not our problem!"] = "Ce n'est pas notre problème !",
+      ["That's typical of you!"] = "C'est typiquemment vous !",
+      ["That was just mean!"] = "C'était radin !",
       ["That was pointless."] = "C'était inutile.",
+      ["The answer is...entertaintment. You'll see what I mean."] = "La réponse est... divertissement. Tu comprendras ce que je veux dire",
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+      ["The Bull's Eye"] = "Dans le mille",
+      ["The caves are well hidden, they won't find us there!"] = "Les cavernes sont bien cachées, ils ne nous y trouverons pas !",
+	  ["The Crate Frenzy"] = "Frenesie de caisses",
+      ["The Dilemma"] = "Le dilemne",
+      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "les ennemis ne peuvent pas bouger mais ce serait une bonne idée de rester hors de vue",
       ["The enemy is hiding out on yonder ducky!"] = "L'ennemi se cache là-bas sur le canard !",
+      ["The Enemy Of My Enemy"] = "Les ennemis de mes ennemis",
+      ["The First Blood"] = "Le premier sang",
+	  ["The First Blood"] = "Le premier sang",
+      ["The First Encounter"] = "La première rencontre",
       ["The flag will respawn next round."] = "Le drapeau va réapparaitre au prochain tour",
---      ["The Nameless One"] = "",
+      ["The food bites back"] = "La nourriture mords en retour",
+	  ["The giant umbrella from the last crate should help break the fall."] = "La toile géante de la dernière caisse devrait aider à arrêter la chute.",
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+      ["The guardian"] = "Le gardien",
+      ["The Individualist"] = "L'individualiste",
+      ["Their buildings were very primitive back then, even for an uncivilised island."] = "Leurs batiments étaient très primitif à l'époque, même pour une ile non civilisée.",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "",
+      ["The Journey Back"] = "Le voyage de retour",
+	  ["The Leap of Faith"] = "Le saut de la foi",
+      ["The Moonwalk"] = "Le Moonwalk",
+      ["The Nameless One"] = "Le sans nom",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+      ["Then how do they keep appearing?"] = "Alors, comment continuent-il à apparaître ?",
+	  ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "L'autre était une tribus de cannibales, ils passaient leur temps à manger les organes d'autres hérissons...",
+      ["There must be a spy among us!"] = "Il doit y avoir un espion parmi nous",
+      ["There's more of them? When did they become so hungry?"] = "Il y en encore ? Quand sont-ils devenu si affamés ?",
+      ["There's more of them? When did they become so hungry?"] = "Il y en encore ? Quand sont-ils devenu si affamés ?",
+      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "Il n'y a rien de plus satisfaisant pour moi que de te voir partager ta beauté avec le monde chaque matin, ma princesse !",
+      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "Il n'y a rien de plus satisfaisant pour moi que de te voir partager ta beauté...",
+      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "",
+	  ["The Rising"] = "L'ascension",
+      ["The Savior"] = "Le sauveur",
+      ["These primitive people are so funny!"] = "Ces primitis sont si amusants !",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "",
+      ["The Shadow Falls"] = "La chute des ombres",
+      ["The Showdown"] = "La confrontation",
+      ["The Slaughter"] = "",
+	  ["The Slaughter"] = "Le massacre",
 --      ["THE SPECIALISTS"] = "",
---      ["This one's tricky."] = "",
---      ["This rain is really something..."] = "",
---      ["TIME: "] = "",
+      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "Les esprits des ancêtres sont sûrement ravis, Leaks A Lot.",
+      ["The Torment"] = "Le supplice",
+      ["The Tunnel Maker"] = "Le creuseur de tunnel",
+      ["The Ultimate Weapon"] = "L'arme ultime",
+	  ["The Ultimate Weapon"] = "L'arme ultime",
+      ["The Union"] = "L'union",
+      ["The village, unprepared, was destroyed by the cyborgs..."] = "",
+      ["The village, unprepared, was destroyed by the cyborgs..."] = "Le village, pas préparé, fut détruit par les cyborgs...",
+      ["The walk of Fame"] = "",
+      ["The walk of Fame"] = "La marche d'honneur",
+      ["The wasted youth"] = "Une jeunesse ruinée",
+      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "L'arme dans cette dernière caisse nous a été conféré par les ancients",
+      ["The what?!"] = "",
+	  ["The wind whispers that you are ready to become familiar with tools, now..."] = "Le vent me murmure que tu es maintenant prêt à te familiariser avec les outils ...",
+      ["They are all waiting back in the village, haha."] = "Ils attendent tous au village, haha.",
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+      ["They have weapons we've never seen before!"] = "",
+      ["They have weapons we've never seen before!"] = "Ils ont des armes que nous n'avons jamais vu avant !",
+      ["They keep appearing like this. It's weird!"] = "",
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+      ["They must be trying to weaken us!"] = "Ils doivent essayer de nous affaiblir !",
+      ["They never learn"] = "Ils n'apprennent jamais",
+      ["They told us to wear these clothes. They said that this is the newest trend."] = "Ils nous ont dit de porter ces vêtements. Ils nous ont dit que c'était la nouvelle mode.",
+      ["They've been manipulating us all this time!"] = "Ils nous ont tous manipulé cette fois !",
+      ["Thighlicker"] = "",
+	  ["This is it! It's time to make Fell From Heaven fall for me..."] = "Ca y est ! il est temps d'impressionner Fell From Heaven ",
+      ["This island is the only place left on Earth with grass on it!"] = "Cette ile est le dernier endroit sur terre avec de l'herbe dessus !",
+      ["This is typical!"] = "C'est typique !",
+      ["This must be some kind of sorcery!"] = "Ce doit être une sorte de sorcellerie",
+      ["This must be the caves!"] = "Ce doit être les cavernes !",
+      ["This one's tricky."] = "celui ci n'est pas facile",
+      ["This rain is really something..."] = "Cette pluie est vraiment quelquechose",
+      ["This will be fun!"] = "Ce sera fun !",
+      ["Those aliens are destroying the island!"] = "Ces aliens détruisent l'ile !",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+      ["TIME: "] = "TEMPS : ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+      ["To help you, of course!"] = "Pour t'aider évidemment !",
+      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "Pour placer une barre, selectionne la, et utilise [gauche] et [droite] pour choisir l'angle et la taille, ensuite place là avec [Clic gauche]",
+      ["Torn Muscle"] = "Torn Muscle",
+      [" to save the village."] = "de sauver le village",
+      ["To the caves..."] = "Aux cavernes...",
       ["Toxic Team"] = "Équipe toxique", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
---      ["TRACK COMPLETED"] = "",
---      ["TRACK FAILED!"] = "",
+      ["TRACK COMPLETED"] = "COURSE COMPLETEE",
+      ["TRACK FAILED!"] = "COURSE RATEE",
+--      ["training"] = "", -- portal
+      ["Traitors"] = "Traitors",
+      ["Tribe"] = "",
+      ["Tribe"] = "",
+      ["Tribe"] = "",
+      ["Tribe"] = "",
+      ["Tribe"] = "",
 --      ["TrophyRace"] = "",
+      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "Essaie de protéger le chef ! Tu ne perdras pas s'il meurt, mais il serait avisé qu'il survive",
 --      ["T_T"] = "",
 --      ["Tumbling Time Extended!"] = "",
+      ["Turns until Sudden Death: "] = "",
+      [" turns until Sudden Death! Better hurry!"] = "tours avant la mort subite ! tu ferais mieux de te dépecher !",
 --      ["Turn Time"] = "",
+      ["Two little hogs cooperating, getting past obstacles..."] = "",
+      ["Two little hogs cooperating, getting past obstacles..."] = "Deux petits hérissons coopérant à passer les obstacles...",
+      ["Uhm...I met one of them and took his weapons."] = "hum... J'ai rencontré l'un d'entre eux et j'ai pris ses armes.",
+      ["Uhmm...ok no."] = "Humm... ok non.",
+--      ["ULTRA KILL"] = "", -- Mutant
+      ["Under Construction"] = "En construction",
+      ["Unexpected Igor"] = "",
 --      ["Unit"] = "",
+      ["Unit 0x0007"] = "",
+      ["Unit 334a$7%;.*"] = "",
+      ["Unit 334a$7%;.*"] = "",
+      ["Unit 334a$7%;.*"] = "",
+      ["Unit 334a$7%;.*"] = "",
+      ["Unit 334a$7%;.*"] = "",
+      ["Unit 334a$7%;.*"] = "",
       ["Unit 3378"] = "Unité 3378",
 --      ["Unit 835"] = "",
---      ["Unlimited Attacks"] = "",
+      ["United We Stand"] = "Nous restons unis",
+      ["Unlimited Attacks"] = "Attaques illimitées",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+	  ["[Up], [Down] to aim, [Space] to shoot!"] = "[haut], [bas] pour viser, [espace] pour tirer !",
+      ["Use it wisely!"] = "a utiliser intelligemment",
+      ["Use it with precaution!"] = "Utilise la avec prudence",
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+	  ["Use the parachute ([Space] while in air) to get the next crate"] = "utilisez le parachute ([Espace] en vol) pour atteindre la prochaine caisse ",
+      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "Utilise le fusil à portail pour atteindre la prochaine caisse, puis utilise le nouveau fusil pour atteindre la destination finale",
+	  ["Use the rope to get on the head of the mole, young one!"] = "Utilise la corde pour atteindre la tête de la taupe, l'apprenti !",
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
       ["Use your rope to get from start to finish as fast as you can!"] = "Utilisez votre Corde Ninja pour aller du début à la fin aussi vite que vous pouvez !",
+      ["Vedgies"] = "Vedgies",
+      ["Vegan Jack"] = "",
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
       ["Victory for the "] = "Victoire pour ", -- CTF_Blizzard, Capture_the_Flag
---      ["Waypoint placed."] = "",
---      ["Way-Points Remaining"] = "",
---      ["Weapons Reset"] = "",
+	  ["Violence is not the answer to your problems!"] = "La violence n'est pas la réponse à tes problèmes !",
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+      ["Watch your steps, young one!"] = "Regarde ou tu marches l'apprenti !",
+      ["Waypoint placed."] = "Point de passage placé.",
+      ["Way-Points Remaining"] = "Points de passage restants",
+      ["Weaklings"] = "Weaklings",
+      ["Weaklings"] = "Weaklings",
+	  ["We all know what happens when you get frightened..."] = "Nous savons tous ce qui arrive quand tu es effrayé",
+      ["Weapons Reset"] = "Armes réinitialisées",
+--      ["Weapons reset."] = "", -- Highlander
+      ["We are indeed."] = "Nous le sommes, en effet.",
+      ["We can't defeat them!"] = "Nous ne pouvons pas les battres !",
+      ["We can't hold them up much longer!"] = "Nous ne pouvons pas les retenir plus longtemps !",
+      ["We can't let them take over our little island!"] = "nous ne pouvons pas les laisser prendre notre petite ile !",
+      ["We have no time to waste..."] = "Nous n'avons pas de temps à perdre...",
+      ["We have nowhere else to live!"] = "Nous n'avons nul part autre ou vivre !",
+      ["We have to protect the village!"] = "Nous devons protéger le village !",
+      ["We have to unite and defeat those cylergs!"] = "nous devons nous unir et battre ces cyborgs !",
+      ["Welcome, Leaks A Lot!"] = "",
+      ["Welcome, Leaks A Lot!"] = "Bienvenue, Leaks A Lot !",
 --      ["Well done."] = "",
+      ["We'll give you a problem then!"] = "Nous allons vous donner des problèmes alors !",
+      ["We'll spare your life for now!"] = "Nous t'épargnons la vie pour le moment !",
+      ["Well, that was a waste of time."] = "Bien, c'était une perte de temps.",
+      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "",
+      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "Bien, Bien ! N'est pas la chose la plus mignonne que tu aies jamais vu ? ",
+      ["Well, yes. This was a cyborg television show."] = "Bien, oui. c'est une émission de télévision cyborg.",
+      ["We made sure noone followed us!"] = "Nous nous sommes assurés que personne ne nous as suivis !",
+      ["We need to move!"] = "Nous devons partir !",
+      ["We need to prevent their arrival!"] = "Nous devons prévoir leur arrivée !",
+      ["We need to warn the village."] = "Nous devons avertir le village",
+      ["We should head back to the village now."] = "Nous devrions retourner au village maintenant.",
+      ["We were trying to save her and we got lost."] = "On essayait de la sauver et on s'est perdu.",
+      ["We won't let you hurt her!"] = "",
+      ["We won't let you hurt her!"] = "Nous ne te laisserons pas la blesser !",
+      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "Quoi ?! Un cannibale ? Ici ? Il n'y a pas de temps à perdre ! Viens, tu es préparé.",
+      ["What a douche!"] = "Quelle douche !",
+      ["What am I gonna...eat, yo?"] = "",
+	  ["What are you doing at a distance so great, young one?"] = "Qu'est ce que tu fais si loin, l'apprenti ? ",
+      ["What are you doing? Let her go!"] = "",
+      ["What are you doing? Let her go!"] = "Que fais tu ? Laisses la partir ! ",
+      ["What a ride!"] = "Quel voyage !",
+      ["What a strange cave!"] = "quelle etrange caverne",
+      ["What a strange feeling!"] = "",
+      ["What a strange feeling!"] = "Quel étrange sentiment !",
+      ["What do my faulty eyes observe? A spy!"] = "Que voient mes vieux yeux ? Un espion !",
+      --["Whatever floats your boat..."] = "Comme tu veux...",
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+      ["What? Here? How did they find us?!"] = "Quoi ? ici ? Comment nous ont ils trouvés ?",
+      ["What is this place?"] = "quel est cet endroit ,",
+      ["What is this place?"] = "Quel est cet endroit ? ",
+      ["What shall we do with the traitor?"] = "",
+      ["What shall we do with the traitor?"] = "Que devons nous faire avec le traître ? ",
+      ["WHAT?! You're the ones attacking us!"] = "Quoi ?! C'est vous qui nous attaquez !",
+      ["When I find it..."] = "Quand je vais le trouver...",
+      ["When?"] = "Quand ?",
+      ["Where are all these crates coming from?!"] = "D'où viennent toutes ces caisses ?!",
+      ["Where are they?!"] = "Où sont ils ?!",
+      ["Where did that alien run?"] = "Où est parti cet alien ?",
+      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "Ou as tu obtenu les pommes explosives et l'arc magique qui tire tant de flèches ?",
+      ["Where did you get the exploding apples?"] = "Ou as tu obtenu les pommes explosives ?",
+      ["Where did you get the magic bow that shoots many arrows?"] = "Ou as tu obtenu l'arc magique qui tire tant de flèches ?",
+      ["Where did you get the weapons in the forest, Dense Cloud?"] = "Où as tu trouvé les armes dans la foret, Dense Cloud ?",
+      ["Where do you get that?!"] = "D'ou ça vous vient ?!!",
+      ["Where have you been?!"] = "Où étais tu ?!",
+      ["Where have you been?"] = "Où étais tu ? ",
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+      ["Why are you doing this?"] = "",
+      ["Why are you doing this?"] = "Pourquoi fais tu ça ? ",
+      ["Why are you helping us, uhm...?"] = "Pourquoi nous aidez vous, hum ...?",
+      ["Why can't he just let her go?!"] = "Pourquoi ne peut-il pas juste la laisser partit ?!",
+	  ["Why do men keep hurting me?"] = "Pourquoi les hommes continuent de me blesser ?",
+      ["Why do you not like me?"] = "Pourquoi ne m'aimes tu pas ?",
+      ["Why do you want to take over our island?"] = "Pourquoi voulez vous notre ile ?",
+      ["Why me?!"] = "Pourquoi moi ?§",
+      ["Why would they do this?"] = "Pourquoi feraient-ils ça ?",
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
---      ["WINNING TIME: "] = "",
+--      ["WINNER IS "] = "", -- Mutant
+      ["WINNING TIME: "] = "Temps gagnant : ",
+      ["Wise Oak"] = "",
+      ["Wise Oak"] = "",
+      ["Wise Oak"] = "",
+      ["Wise Oak"] = "",
+      ["Wise Oak"] = "",
+      ["Wise Oak"] = "Wise Oak",
+      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "Avec Dense Cloud dans le territoire des ombres, je suis le seul espoir du village...",
+      ["With the rest of the tribe gone, it was up to "] = "Avec le reste de la tribue partie, il était temps de ",
+	  ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "Pas d'inquiétude, c'est un animal pacifique ! il n'y a pas de raison d'avoir peur...",
+      ["Wow, what a dream!"] = "Wow, quel rêve !",
+      ["Y3K1337"] = "Y3K1337",
+      ["Y3K1337"] = "Y3K1337",
+      ["Yay, we won!"] = "",
+      ["Yay, we won!"] = "Ouais, on a gagné !",
+      ["Y Chwiliad"] = "",
+      ["Yeah...I think it's a 'he', lol."] = "Ouais... Je crois que c'est un 'homme', lol.",
+      ["Yeah, sure! I died. Hillarious!"] = "Ouais, sûr ! il est mort. Hillarant !",
+      ["Yeah, take that!"] = "Ouais, prends ça !",
+      ["Yeah? Watcha gonna do? Cry?"] = "",
+      ["Yeah? Watcha gonna do? Cry?"] = "Ouais? Qu'est ce que tu vas faire ? Pleurer ? ",
+      ["Yes!"] = "Oui !",
+      ["Yes, yeees! You are now ready to enter the real world!"] = "Oui, Ouiii ! Maintenant tu es prêt à entrer dans le monde réel !",
+      ["Yo, dude, we're here, too!"] = "Yo mec, on est là aussi !",
+      ["You are given the chance to turn your life around..."] = "Tu as une chance de voir ta vie changer de cap",
+      ["You are playing with our lives here!"] = "Vous jouez avec nos vies !",
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+      ["You bear impressive skills, "] = "tu as des compétences impressionantes, ",
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "Tu ne pouvais pas croire qu'après avoir refusé mon offre, je vous laisserai partir comme ça !",
 --      ["You'd almost swear the water was rising!"] = "",
+      ["You'd better watch your steps..."] = "tu ferais mieux de regarder où tu marches....",
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|	  Hint: you might want to use some mines..."] = "Tu as 7 tours avant la prochaine vague. |Assures toi que les prochains arrivant soient bien accueillis ! |Si le hérissons meurt, la cause est perdue. | Conseil : Tu pourrais vouloir utiliser des mines ...",
+      ["You have been giving us out to the enemy, haven't you!"] = "Tu nous as vendu aux ennemis, n'est ce pas ?!",
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+      ["You have chosen the perfect moment to leave."] = "Tu as choisis le moment parfait pour partit.",
+      ["You have failed to complete your task, young one!"] = "Tu as échoué à compléter ta tâche, disciple !",
+      ["You have failed to save the tribe!"] = "Tu n'as pas su sauvé la tribue !",
+      ["You have finally figured it out!"] = "Tu t'en es finallement rendu compte !",
+      ["You have kidnapped our whole tribe!"] = "Vous avez kidnappé notre tribue entière !",
+      ["You have killed an innocent hedgehog!"] = "Tu as tué un innocent !",
+      ["You have proven yourself worthy to see our most ancient secret!"] = "Tu as prouvé que tu étais digne de voir notre plus ancien secret !",
+      ["You have proven yourselves worthy!"] = "Vous vous êtes montrez dignes !",
       ["You have SCORED!!"] = "Vous avez marqué !",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+      ["You have "] = "Tu as",
+      ["You have won the game by proving true cooperative skills!"] = "Vous avez gagné le jeu en prouvant de vraies compétantce de coopération !",
+      ["You just appeared out of thin air!"] = "tu es apparu comme par magie ! ",
+      ["You just committed suicide..."] = "Tu viens de signer ton arrêt de mort...",
+      ["You killed my father, you monster!"] = "Tu as tué mon père, monstre !",
+      ["You know...taking a stroll."] = "Vous savez... promenade.",
+      ["You know what? I don't even regret anything!"] = "Tu sais quoi ? je ne regrette rien !",
+      ["You'll see what I mean!"] = "Vous allez comprendre ce que je veux dire !",
+--      ["You may only attack from a rope!"] = "", -- WxW
+      ["You meatbags are pretty slow, you know!"] = "Vous les sacs à viande êtes plutot lent vous savez !",
+      ["You might want to find a way to instantly kill arriving cannibals!"] = "tu aimerais surement trouver un moyen de tuer instantanément les cannibales qui arrivent !",
+      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "L'apprenti, tu es en train de nous dire qu'ils peuvent changer de place sans shaman ?",
+	  ["You probably know what to do next..."] = "Tu sais probablement ce que tu dois faire ensuite....",
+      ["Your deaths will be avenged, cannibals!"] = "",
+      ["Your deaths will be avenged, cannibals!"] = "Vos morts seront vengées, cannibales !",
+      ["Your death will not be in vain, Dense Cloud!"] = "Tu ne seras pas mort en vain, Dense Cloud !",
+      ["You're...alive!? But we saw you die!"] = "Tu es...vivant ? Mais nous t'avons vu mourrir !",
+      ["You're a pathetic liar!"] = "Tu es un menteur pathétique",
+      ["You're funny!"] = "Tu es drôle !",
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+      ["You're pathetic! You are not worthy of my attention..."] = "Tu es pathétique ! Tu n'es pas digne de mon attention... ",
+      ["You're probably wondering why I bought you back..."] = "Tu te demandes probablement pourquoi je t'ai ramené...",
+      ["You're terrorizing the forest...We won't catch anything like this!"] = "Tu terrorrises la fôret... Nous n'attraperons rien comme ça !",
+      ["Your hogs must survive!"] = "Vos hérissons doivent survivre !",
+	  ["Your movement skills will be evaluated now."] = "Tes compétences de mouvement vont maintenant être évaluées .",
 --      ["You saved"] = "",
+      ["You've been assaulting us, we have been just defending ourselves!"] = "vous nous avez assiégé, nous nous sommes justes défendus !",
       ["You've failed. Try again."] = "Vous avez échoué. Essayez encore.",
       ["You've reached the goal!| |Time: "] = "Vous avez atteins le but !| |Temps : ",
+      ["You will be avenged!"] = "Tu seras vengé !",
+      ["You won't believe what happened to me!"] = "Vous ne croirez pas ce qui m'est arrivé !",
+      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "beurck ! je parie qu'ils continueront à l'adorer meme après que j'ai sauvé le village !",
+--      ["Zealandia"] = "", -- Continental_supplies
 --      ["'Zooka Team"] = "",
+      ["Zork"] = "",
+      ["Zork"] = "",
+      ["Zork"] = "",
     }
diff --git a/share/hedgewars/Data/Locale/hedgewars_ar.ts b/share/hedgewars/Data/Locale/hedgewars_ar.ts
index 771a907..2d10c61 100644
--- a/share/hedgewars/Data/Locale/hedgewars_ar.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_ar.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>جديد</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>جديد</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -49,14 +41,6 @@
         <translation>تغيير سلاح</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>نظام اسلحة غير صحيح</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Edit schemes</translation>
     </message>
@@ -70,23 +54,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 تم حذفة من قائمة الترك</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 تم اضافته الى قائمة النرك</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 تم حذقه الى قائمة الاصدقاء</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 تم حذفة من قائمة الاصدقاء</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -131,38 +106,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">جديد</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>خطا</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>لم اتمكن من بدا الخادم</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>لم اتمكن من حقظ الملف %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>اختار من القائمة</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -189,10 +140,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">كلمة السر</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -208,14 +155,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished">اسم اللاعب</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -343,20 +288,6 @@ Please pick another nickname:</source>
         <translation>تم طردك</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">كلمة السر</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">اسمك %1
-سجلت على Hedgewars.org
-اعطي كلمة السر
-او اختر اسم ثاني</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 انضم للغرفة</translation>
     </message>
@@ -373,11 +304,33 @@ or pick another nickname:</source>
         <translation>%1 *** %2 خرج</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">اسم اللاعب</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">كلمة السر</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -389,15 +342,27 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Server message:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Set message</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Clear Accounts Cache</translation>
@@ -433,10 +398,6 @@ or pick another nickname:</source>
         <source>Connecting...</source>
         <translation type="unfinished">جاري الاتصال</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">الغاء</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -472,6 +433,10 @@ or pick another nickname:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -487,20 +452,6 @@ or pick another nickname:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>افضل ضربة كانت من قبل <b>%1</b> with <b>%2</b> pts.</p></translation>
-    </message>
-    <message>
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete"><p>افضل لاعب هو <b>%1</b> with <b>%2</b> kills in a turn.</p>
-        </translation>
-    </message>
-    <message>
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete"><p>المجموع<b>%1</b> من اللاعبين قضوا في اللعبة.</p>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -567,15 +518,14 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
+    <name>PageInfo</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>لعبة محلية</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>لعبة شبكية (عن طريق شبكة اتصال)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -825,6 +775,46 @@ or pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -834,33 +824,18 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>خطا</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>اختار من القائمة</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>تحكم</translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>DLC</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">ادخل رقم الغرقة</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -873,6 +848,14 @@ or pick another nickname:</source>
         <source>Official server</source>
         <translation>الخادم الرسمي</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -889,18 +872,6 @@ or pick another nickname:</source>
         <translation>حذف فريق</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">طريقة اسلحة جديدة</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">تغيير طريقة الاسلحة</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">حذف طريقة الاسلحة</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -928,181 +899,119 @@ or pick another nickname:</source>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
+        <source>General</source>
+        <translation type="unfinished">عام</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">متقدم</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>تغيير الشباك</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation type="unfinished">ادخل اسم الملف</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>لا استطيع التغيير الى</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>لا استطيع حذف الملف</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>اختر المقطع من القائمة</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>اصنع</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>انضم</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>تحديث</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Rename dialog</source>
+        <translation>تغيير الشباك</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>الادارة</translation>
+        <source>Enter new file name:</source>
+        <translation type="unfinished">ادخل اسم الملف</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation type="unfinished">رقم الغرقة</translation>
+        <source>Create</source>
+        <translation>اصنع</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>هذه غرقة اللعب
-يمكنك الانضمام و بدء اللعب عند الاتضمام الى غرفة
-You may join and start playing once the game starts.</translation>
+        <source>Join</source>
+        <translation>انضم</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished">اللعبة قيد اللعب
-يمكنك الانضمام و المشاهدة</translation>
+        <source>Admin features</source>
+        <translation>الادارة</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished">%1هو المضيف الذي يبدا و يغيير اعدادات اللعبة</translation>
+        <source>Room Name:</source>
+        <translation type="unfinished">رقم الغرقة</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>خارطة عشوائية</translation>
+        <source>Rules:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation type="unfinished">اللعبة يمكن ان تكون على خارطة عشوائية او يدوية</translation>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation type="unfinished">طراز اللعية يحدد الخيارات مثل وقت الجولة، الموت المفاجئ و مصاص الدماء</translation>
+        <source>Search:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation type="unfinished">طراز الاسلحة يحدد المتوفرة منها و عددها</translation>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
+        <source>%1 players online</source>
         <translation type="unfinished">
-            <numerusform>يوجد %1 مرتبطون بالغرقة
-        </numerusform>
             <numerusform></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <numerusform>يوجد %1 فريق في الغرفة
-        </numerusform>
             <numerusform></numerusform>
         </translation>
     </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>ادخل رقم الغرقة</translation>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation type="unfinished">دافع عن القلعة و دمر الاعداء. فريقان الحد الاقصى</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>اختر الغرقة من القائمة</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished">متاهة عشوائية</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation type="unfinished">دافع عن القلعة و دمر الاعداء. فريقان الحد الاقصى</translation>
-    </message>
-    <message>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation type="unfinished">الفرق تبدا في مكانين متقابلين. فريقان الحد الاقصى</translation>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
+        <translation type="unfinished">الفرق تبدا في مكانين متقابلين. فريقان الحد الاقصى</translation>
     </message>
     <message>
         <source>Land can not be destroyed!</source>
         <translation type="unfinished">الارض لا يمكن ان تدمر</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">اضف اطار لا يمكن تدميره</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>جاذبية قليلة</translation>
     </message>
@@ -1115,10 +1024,6 @@ Do you still want to join the room?</source>
         <translation>كل اللاعبين لهم حقل قوى</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">فعل الالغام العشوائية</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>احصل على 80% من التدمير في صحتك</translation>
     </message>
@@ -1237,31 +1142,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>لعية بسيطة ضد الحاسوب</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>لعبة متعددة</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">نمط التدريب، تحت التطوير</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>عرض</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>تحميل</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">تحميل</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1275,6 +1196,52 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">اسم</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1362,10 +1329,6 @@ Do you still want to join the room?</source>
         <translation>اضف التاريخ و اليوم الى الملف</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">قلل الجودة</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>اضهر قوائم للعتاد</translation>
     </message>
@@ -1381,6 +1344,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>تأثيرات المقدمة</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1425,10 +1408,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">التلقائي</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1516,10 +1495,6 @@ Do you still want to join the room?</source>
         <translation>فرق</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">اسلحة</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>قوائم الصوتيات و المرئيات</translation>
     </message>
@@ -1551,6 +1526,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1567,10 +1566,6 @@ Do you still want to join the room?</source>
         <translation>نسخة</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation type="unfinished">المطورون</translation>
     </message>
@@ -1603,10 +1598,6 @@ Do you still want to join the room?</source>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>اسم اللاعب</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>الوضوح</translation>
     </message>
@@ -1683,10 +1674,6 @@ Do you still want to join the room?</source>
         <translation>محلي</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>اعد تشغيل اللعبة لتفعيل التغيير</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>متفجرات</translation>
     </message>
@@ -1735,10 +1722,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">كلمة السر</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1746,6 +1729,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">اسم اللاعب</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1757,6 +1802,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1768,10 +1817,6 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>شبكة</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>ضاع الاتصال للخادم</translation>
     </message>
@@ -1780,81 +1825,222 @@ Do you still want to join the room?</source>
         <translation>خطأ</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Cannot create directory %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Failed to open data directory:
- %1
-Please check your installation</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>اسلحة</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Can not edit default weapon set</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Unable to start the server: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Can not delete default weapon set</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation type="unfinished">هل تريد حذف قائمة الاسلحة</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">فرق</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">ادخل رقم الغرقة</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">اختر المقطع من القائمة</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">اختر الغرقة من القائمة</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Cannot create directory %1</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>اسم اللاعب</translation>
     </message>
@@ -1937,36 +2123,76 @@ Please check your installation</translation>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>اسم الغرقة</translation>
+        <translation type="unfinished">اسم الغرقة</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>المالك</translation>
+        <translation type="unfinished">المالك</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>خارطة</translation>
+        <translation type="unfinished">خارطة</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>قوانين</translation>
+        <translation type="unfinished">قوانين</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>اسلحة</translation>
+        <translation type="unfinished">اسلحة</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">خارطة عشوائية</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">متاهة عشوائية</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -1997,21 +2223,6 @@ Please check your installation</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>خطأ</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Unable to start the server: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Unable to run engine: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2054,10 +2265,6 @@ Please check your installation</translation>
         <translation>غير قابل للتدمير</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">اضف الغام</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>توزيع عشوائي</translation>
     </message>
@@ -2282,6 +2489,14 @@ info</translation>
         <source>slot 10</source>
         <translation type="unfinished">slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2368,6 +2583,10 @@ info</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished">تغيير العناوبن فوق اللاعبين</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_bg.ts b/share/hedgewars/Data/Locale/hedgewars_bg.ts
index ae20ac1..d94944e 100644
--- a/share/hedgewars/Data/Locale/hedgewars_bg.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_bg.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="bg">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -52,14 +44,6 @@
         <translation>Редактиране на оръжията</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Невалидна оръжейна схема</translation>
-    </message>
-    <message>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation>Когато тази настройка е включена, при избирането на игрова схема автоматично ще се избере оръжие</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 беше премахнат от списъка с игнорирани</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 беше добавен към списъка с игнорирани</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 беше премахнат от списъка с приятели</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 беше добавен към списъка с приятели</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Добре</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Грешка при запис във файл %1</translation>
     </message>
     <message>
-        <source>Unable to start the server</source>
-        <translation>Грешка при стартиране на сървъра</translation>
-    </message>
-    <message>
-        <source>new</source>
-        <translation type="obsolete">Нов отбор</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Изберете запис от списъка</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>СтандартенОтбор</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Парола</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished">Прякор</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -337,10 +282,6 @@ Please pick another nickname:</source>
         <translation>Вие бяхте изхвърлен</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Парола</translation>
-    </message>
-    <message>
         <source>Quit reason: </source>
         <translation>Причина за напускане:</translation>
     </message>
@@ -365,21 +306,33 @@ Please pick another nickname:</source>
         <translation>%1 *** %2 напусна</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Прякорът ви %1 е
-регистриран на Hedgewars.org
-Моля въдете паролата си по-долу
-или изберете друг прякор в настройките на играта:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Прякор</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Парола</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -391,6 +344,26 @@ or pick another nickname in game config:</source>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -427,10 +400,6 @@ or pick another nickname in game config:</source>
         <source>Connecting...</source>
         <translation>Свързване...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Отказ</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -455,10 +424,6 @@ or pick another nickname in game config:</source>
         <translation>Зареждане на начертана карта</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Начертани карти (*.hwmap);;Всички файлове (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Запазване на начертана карта</translation>
     </message>
@@ -470,6 +435,10 @@ or pick another nickname in game config:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -485,10 +454,6 @@ or pick another nickname in game config:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Награда за най-добър изстрел е спечелена от <b>%1</b> с <b>%2</b> точки.</p></translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Подробности</translation>
     </message>
@@ -555,15 +520,14 @@ or pick another nickname in game config:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Локална игра (играйте на един компютър)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Мрежова игра (играйте в мрежа)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -813,6 +777,46 @@ or pick another nickname in game config:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -822,32 +826,17 @@ or pick another nickname in game config:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Изберете сървър от списъка</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Контрол</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Грешка</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Моля въведете име на стая</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -861,6 +850,14 @@ or pick another nickname in game config:</source>
         <source>Official server</source>
         <translation>Официален сървър</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -904,177 +901,117 @@ or pick another nickname in game config:</source>
         <source>Delete weapon set</source>
         <translation>Изтриване на комплекта оръжия</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
+        <source>General</source>
+        <translation type="unfinished">Общи</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">За напреднали</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Преименуване</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Въведете ново име на файл:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Не може да се преименува в</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Файлът не може да се изтрие</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Изберете запис от списъка</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Създаване</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Присъединяване</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Опресняване</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Административни функционалности</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
+        <source>Rename dialog</source>
+        <translation>Преименуване</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Enter new file name:</source>
+        <translation>Въведете ново име на файл:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation>Име на стаята:</translation>
+        <source>Create</source>
+        <translation>Създаване</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Тази игра е в лоби.
-След като започне, може да се присъедините и да играете.</translation>
+        <source>Join</source>
+        <translation>Присъединяване</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Играта тече в момента.
-Можете да се присъедините и да гледате, но ще трябва да изчакате да свърши, за да започнете да играете.</translation>
+        <source>Admin features</source>
+        <translation>Административни функционалности</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 е домакина. Той може да променя настройките и да започне играта.</translation>
+        <source>Room Name:</source>
+        <translation>Име на стаята:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Случайна карта</translation>
+        <source>Rules:</source>
+        <translation>Правила:</translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Игрите могат да се играят на предварително създадени или случайно генерирани карти.</translation>
+        <source>Weapons:</source>
+        <translation>Оръжия:</translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Игровата схема определя общите настройки и предпочитания, като продължителност на рунда, внезапна смърт или вампиризъм.</translation>
+        <source>Search:</source>
+        <translation>Търсене:</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Схемата на оръжията определя наличните оръжия и количеството боеприпаси за тях.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
+        <source>Clear</source>
+        <translation>Изчистване</translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
+        <source>%1 players online</source>
         <translation type="unfinished">
             <numerusform></numerusform>
             <numerusform></numerusform>
         </translation>
     </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Моля въведете име на стая</translation>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Моля изберете стая от списъка</translation>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Случан лабиринт</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Състояние:</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Правила:</translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation>Оръжия:</translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation>Търсене:</translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation>Изчистване</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation>Внимание</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Играта, към която се опитвате да се присъедините вече е започнала.
-Все още ли желаете да се присъедините към стаята?</translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Land can not be destroyed!</source>
-        <translation type="unfinished"></translation>
+        <source>Land can not be destroyed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Lower gravity</source>
@@ -1207,35 +1144,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Солова игра (бърза игра срещу компютър с готови настройки)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Мрежова игра (играйте срещу приятели или ИИ отбори)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Тренировка (упражнете уменията си в редица тренировъчни мисии). В ПРОЦЕС НА РАЗРАБОТКА</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демо (гледайте записани демота)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Зареди (заредете предишно запаметена игра)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим кампания (...). В ПРОЦЕС НА РАЗРАБОТКА</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Зареждане</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1249,6 +1198,52 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Име</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1351,6 +1346,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>Ефекти</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1395,10 +1410,6 @@ Do you still want to join the room?</source>
         <translation>В прогрес</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">По подразбиране</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>Ръчно нарисувана карта...</translation>
     </message>
@@ -1506,10 +1517,6 @@ Do you still want to join the room?</source>
         <translation>Мрежова игра</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Оръжия</translation>
-    </message>
-    <message>
         <source>Team Settings</source>
         <translation>Настройки на отборите</translation>
     </message>
@@ -1521,6 +1528,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation>Схеми и оръжия</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1561,14 +1592,6 @@ Do you still want to join the room?</source>
         <translation>Име на схемата:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Прякор</translation>
-    </message>
-    <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Тази програма се разпространява под GNU (the GNU General Public License) лиценз</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Разделителна способност</translation>
     </message>
@@ -1653,10 +1676,6 @@ Do you still want to join the room?</source>
         <translation>Локал</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Рестартирайте играта за да влезе в сила</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Експлозиви</translation>
     </message>
@@ -1693,10 +1712,6 @@ Do you still want to join the room?</source>
         <translation>% Дължина на въжето</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Геймплей</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Стерео режим</translation>
     </message>
@@ -1709,10 +1724,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Парола</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1720,6 +1731,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Прякор</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1731,6 +1804,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1746,89 +1823,227 @@ Do you still want to join the room?</source>
         <translation>Грешка</translation>
     </message>
     <message>
+        <source>Connection to server is lost</source>
+        <translation>Загубена е връзката със сървъра</translation>
+    </message>
+    <message>
+        <source>File association failed.</source>
+        <translation>Файловата асоциация се провали.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Не може да се създаде папка %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Не може да се отвори папката с данните:
-%1
-Проверете инсталацията си</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Network</source>
-        <translation>Мрежа</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
-        <translation>Загубена е връзката със сървъра</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Грешка при стартиране на сървъра: %1.</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Оръжия</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Не могат да се изтрият оръжията по подразбиране</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Да се изтрият ли тези оръжия?</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Не може да се редактират оръжията по подразбиране</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Не моге да се презапише стандартния комплект с оръжия '%1'!</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Всички файлови асоциации са зададени.</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Моля въведете име на стая</translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Файловата асоциация се провали.</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Отбори</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Изберете запис от списъка</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Наистина ли да бъде изтрит този отбор?</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Схеми</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Стандартната схема '%1' не може да бъде изтрита!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Наистина ли да бъде изтрите тази игрова схема?</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Моля изберете стая от списъка</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Не моге да се изтрие стандартния комплект с оръжия '%1'!</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Играта, към която се опитвате да се присъедините вече е започнала.
+Все още ли желаете да се присъедините към стаята?</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Не може да се създаде папка %1</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Прякор</translation>
     </message>
@@ -1911,36 +2126,76 @@ Please check your installation</source>
         <source>more</source>
         <translation>повече</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">В прогрес</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Име на стаята</translation>
+        <translation type="unfinished">Име на стаята</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Притежател</translation>
+        <translation type="unfinished">Притежател</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Карта</translation>
+        <translation type="unfinished">Карта</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Правила</translation>
+        <translation type="unfinished">Правила</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Оръжия</translation>
+        <translation type="unfinished">Оръжия</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Случайна карта</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Случан лабиринт</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -1971,21 +2226,6 @@ Please check your installation</source>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Грешка</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Грешка при стартиране на сървъра: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Грешка при пускане на engine-a: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Fort Mode</source>
@@ -2252,6 +2492,14 @@ info</source>
         <source>slot 10</source>
         <translation>Слот 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2338,6 +2586,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Премключване на надписи над таралежите:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_cs.ts b/share/hedgewars/Data/Locale/hedgewars_cs.ts
index 799a564..fb3ef4b 100644
--- a/share/hedgewars/Data/Locale/hedgewars_cs.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_cs.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="cs">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -49,14 +41,6 @@
         <translation>Editovat zbranÄ›</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Nepovolené schéma zbraní</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Editovat schémata</translation>
     </message>
@@ -70,23 +54,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 byl odstraněn ze seznamu ignorovaných</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 byl přidán na seznam ignorovaných</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 byl odstraněn ze seznamu přátel</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 byl přidán na seznam přátel</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -131,38 +106,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">nový</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Nemohu spustit server</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Nemohu uložit záznam do souboru %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Prosím vyberte záznam ze seznamu výše</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>VýchozíTeam</translation>
     </message>
@@ -189,10 +140,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -211,14 +158,12 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <translation type="unfinished">Přezdívka</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -346,10 +291,6 @@ Please pick another nickname:</source>
         <translation>Byl jsi vykopnut</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Heslo</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 se připojil do místnosti</translation>
     </message>
@@ -366,21 +307,33 @@ Please pick another nickname:</source>
         <translation>%1 *** %2 odešel</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Tvoje přezdívka %1 je
-registrovaná na Hedgewars.org
-Prosím, zadej své heslo
-nebo si v konfiguraci vyber jinou přezdívku:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Přezdívka</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Heslo</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -392,6 +345,26 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -428,10 +401,6 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <source>Connecting...</source>
         <translation>Připojuji...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Zrušit</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -456,10 +425,6 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <translation>Nahrát nakreslenou mapu</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Nakreslené mapy (*.hwmap);;Všechny soubory (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Uložit nakreslenou mapu</translation>
     </message>
@@ -471,6 +436,10 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -486,10 +455,6 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Cenu za nejlepší zásah vyhrál <b>%1</b> s <b>%2</b> body.</p></translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detaily</translation>
     </message>
@@ -562,15 +527,14 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Místní hra (Hra na tomto počítači)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Síťová hra (Hra přes síť)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -807,11 +771,6 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <translation>Windows verze Hedgewars podporuje Xfire. Přidej si Hedgewars do jeho seznamu her, abys viděl přátele, kteří ho hrají.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Naváděná včela může být obtížná na použití. Její poloměr otáčení je závislý na její rychlosti, zkus ji nepoužívat při plné síle.</translation>
-    </message>
-    <message>
         <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
         <translation>Použij Molotov nebo plamenomet, abys dočasně zamezil ježkům v přechodu terénu jako jsou tunely nebo plošiny.</translation>
@@ -825,6 +784,46 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -834,33 +833,18 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Prosím vyberte server ze seznamu výše</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Ovládání</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Chyba</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Prosím zadejte jméno místnosti</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -873,6 +857,14 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <source>Official server</source>
         <translation>Oficiální server</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -916,36 +908,60 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <source>Delete weapon set</source>
         <translation>Smazat sadu zbraní</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
+        <source>General</source>
+        <translation type="unfinished">Obecné</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Rozšířené</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Přejmenovávací dialog</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Zadejte jméno nového souboru:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Nemohu přejmenovat na</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Nemohu smazat soubor</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Prosím vyberte záznam ze seznamu</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Přejmenovávací dialog</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Zadejte jméno nového souboru:</translation>
     </message>
 </context>
 <context>
@@ -959,18 +975,6 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <translation>Připojit se</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Obnovit</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Možnosti správce</translation>
     </message>
@@ -979,117 +983,43 @@ nebo si v konfiguraci vyber jinou přezdívku:</translation>
         <translation>Jméno místnosti:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Tato hra je v čekárně.
-Můžeš se přidat a začít hrát, jakmile hra začne.</translation>
+        <source>Rules:</source>
+        <translation>Pravidla:</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Tato hra právě probíhá.
-Můžeš se přidat a pozorovat, ale musíš počkat, než hra skončí, jestli chceš začít hrát.</translation>
+        <source>Weapons:</source>
+        <translation>ZbranÄ›:</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 je hostitel. On může nastavovat a odstartovat hru.</translation>
+        <source>Search:</source>
+        <translation>Hledej:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Náhodná mapa</translation>
+        <source>Clear</source>
+        <translation>Vyčisti</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 players online</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
     </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Hra může být hrána na předem vytvořené nebo na náhodné mapě.</translation>
+        <source>New</source>
+        <translation>Nové</translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Herní schéma definuje obecné možnosti a nastavení jako třeba počet kol, náhlou smrt nebo vampyrismus.</translation>
+        <source>Delete</source>
+        <translation>Smazat</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Zbraňové schéma definuje zbraně, které budou k dispozici a jejich munici.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>V místnosti je %1 připojený klient.</numerusform>
-            <numerusform>V místnosti jsou %1 připojení klienti.</numerusform>
-            <numerusform>V místnosti je %1 připojených klientů.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>V místnosti je %1 účastnící se tým.</numerusform>
-            <numerusform>V místnosti jsou %1 účastnící se týmy.</numerusform>
-            <numerusform>V místnosti je %1 účastnících se týmů.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Prosím zadejte jméno místnosti</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Prosím vyberte místnost ze seznamu</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Náhodný labyrint</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Stav:</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Pravidla:</translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation>ZbranÄ›:</translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation>Hledej:</translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation>Vyčisti</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation>Pozor</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Hra, do které se snažíš připojit, začala.
-Ještě stále se chceš připojit do místosti?</translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>New</source>
-        <translation>Nové</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>Smazat</translation>
-    </message>
-    <message>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation>Braň svou pevnoust a znič protivníky, dvě barvy týmů maximálně!</translation>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation>Braň svou pevnoust a znič protivníky, dvě barvy týmů maximálně!</translation>
     </message>
     <message>
         <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
@@ -1100,10 +1030,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Krajina nejde zničit!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Přidá nezničitelnou hranici okolo terénu</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Nižší gravitace</translation>
     </message>
@@ -1226,35 +1152,47 @@ Ještě stále se chceš připojit do místosti?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Prostá hra (rychlá hra proti počítači, nastavení je zvoleno)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Hra více hráčů (hrát na jednom počítači proti přátelům nebo počítači)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Výcvikový mód (Procvič si schopnosti v řadě tréningových misí). VE VÝVOJI</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Ukázky (Sledování nahraných her)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Nahrát (Nahrát uloženou hru)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Mód tažení (...). VE VÝVOJI</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Nahrát</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1268,6 +1206,53 @@ Ještě stále se chceš připojit do místosti?</translation>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Jméno</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1370,6 +1355,26 @@ Ještě stále se chceš připojit do místosti?</translation>
         <source>Frontend effects</source>
         <translation>Efekty v menu</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1414,10 +1419,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Probíhá</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Základní</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>ručně kreslená mapa...</translation>
     </message>
@@ -1505,10 +1506,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Týmy</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">ZbranÄ›</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Nastavení audio/video</translation>
     </message>
@@ -1540,6 +1537,30 @@ Ještě stále se chceš připojit do místosti?</translation>
         <source>Schemes and Weapons</source>
         <translation>Schémata a zbraně</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1548,10 +1569,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Verze</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Tento program je poskytovaný pod GNU General Public licencí</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Vývojáři:</translation>
     </message>
@@ -1584,10 +1601,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Síťová přezdívka</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Rozlišení</translation>
     </message>
@@ -1672,10 +1685,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Jazyk</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Aby se nastavení použilo, restartuj hru</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Výbušniny</translation>
     </message>
@@ -1712,10 +1721,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>% délky lana</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Hra</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation type="unfinished">Duální vykreslování</translation>
     </message>
@@ -1728,10 +1733,6 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1739,6 +1740,68 @@ Ještě stále se chceš připojit do místosti?</translation>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Přezdívka</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1750,6 +1813,10 @@ Ještě stále se chceš připojit do místosti?</translation>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1761,10 +1828,6 @@ Ještě stále se chceš připojit do místosti?</translation>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Síť</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Spojení se serverem ztraceno</translation>
     </message>
@@ -1773,81 +1836,224 @@ Ještě stále se chceš připojit do místosti?</translation>
         <translation>Chyba</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Asociace souborů selhala.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Nemohu vytvořit adresář %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Chyba při otevírání adresáře s daty:
-%1
-Prosím zkontorlujte vaši instalaci</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>ZbranÄ›</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nemohu editovat základní nastavení zbraní</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Nemohu spustit server: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nemohu smazat základní nastavení zbraní</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Opravdu smazat toto nastavení zbraní?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Nemohu přepsat výchozí sadu zbraní '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Všechny asociace souborů byly nastaveny.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Asociace souborů selhala.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Týmy</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Prosím zadejte jméno místnosti</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Opravdu smazat tento tým?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Schémata</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Prosím vyberte záznam ze seznamu</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Nemohu smazat výchozí schéma '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Opravdu smazat toto herní schéma?</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Nemohu smazat výchozí sadu zbraní '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Prosím vyberte místnost ze seznamu</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nemohu vytvořit adresář %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Hra, do které se snažíš připojit, začala.
+Ještě stále se chceš připojit do místosti?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Přezdívka</translation>
     </message>
@@ -1930,36 +2136,76 @@ Prosím zkontorlujte vaši instalaci</translation>
         <source>more</source>
         <translation>více</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">Probíhá</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Jméno místnosti</translation>
+        <translation type="unfinished">Jméno místnosti</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>K</translation>
+        <translation type="unfinished">K</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Vlastník</translation>
+        <translation type="unfinished">Vlastník</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Mapa</translation>
+        <translation type="unfinished">Mapa</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Pravidla</translation>
+        <translation type="unfinished">Pravidla</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>ZbranÄ›</translation>
+        <translation type="unfinished">ZbranÄ›</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Náhodná mapa</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Náhodný labyrint</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -1990,21 +2236,6 @@ Prosím zkontorlujte vaši instalaci</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Nemohu spustit server: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Nemohu spustit engine: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2270,6 +2501,14 @@ info</source>
         <source>slot 10</source>
         <translation>pozice 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2356,6 +2595,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Přepni popisky nad ježky:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_da.ts b/share/hedgewars/Data/Locale/hedgewars_da.ts
new file mode 100644
index 0000000..01dda1c
--- /dev/null
+++ b/share/hedgewars/Data/Locale/hedgewars_da.ts
@@ -0,0 +1,2704 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="da">
+<context>
+    <name>AmmoSchemeModel</name>
+    <message>
+        <source>new</source>
+        <translation>ny</translation>
+    </message>
+    <message>
+        <source>copy of</source>
+        <translation>kopi af</translation>
+    </message>
+</context>
+<context>
+    <name>DrawMapWidget</name>
+    <message>
+        <source>File error</source>
+        <translation>Fejl i fil</translation>
+    </message>
+    <message>
+        <source>Cannot open file '%1' for writing</source>
+        <translation>Kan ikke åbne filen '%1' til skrivning</translation>
+    </message>
+    <message>
+        <source>Cannot read file '%1'</source>
+        <translation>Kan ikke læse filen '%1'</translation>
+    </message>
+</context>
+<context>
+    <name>FreqSpinBox</name>
+    <message>
+        <source>Never</source>
+        <translation>Aldrig</translation>
+    </message>
+    <message numerus="yes">
+        <source>Every %1 turn</source>
+        <translation>
+            <numerusform>Hver %1 tur</numerusform>
+            <numerusform>Hver %1 tur</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>GameCFGWidget</name>
+    <message>
+        <source>Edit weapons</source>
+        <translation>Rediger våben</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Illegal ammo scheme</source>
+        <translation>Ugyldig ammunitionssystem</translation>
+    </message>
+    <message>
+        <source>Edit schemes</source>
+        <translation>Rediger spilsystemer</translation>
+    </message>
+    <message>
+        <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
+        <translation>Når denne indstilling er aktiveret vælges automatisk et våben når et spilsystem vælges</translation>
+    </message>
+    <message>
+        <source>Game Options</source>
+        <translation>Spilindstillinger</translation>
+    </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
+    <message>
+        <source>%1 *** %2 has been removed from your ignore list</source>
+        <translation>%1 *** %2 er blevet fjernet fra din ignoreringsliste</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been added to your ignore list</source>
+        <translation>%1 *** %2 er blevet tilføjet til din ignoreringsliste</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been removed from your friends list</source>
+        <translation>%1 *** %2 er blevet fjernet fra din venneliste</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been added to your friends list</source>
+        <translation>%1 *** %2 er blevet tilføjet til din venneliste</translation>
+    </message>
+    <message>
+        <source>%1 has been removed from your ignore list</source>
+        <translation>%1 er blevet fjernet fra din ignoreringsliste</translation>
+    </message>
+    <message>
+        <source>%1 has been added to your ignore list</source>
+        <translation>%1 er blevet tilføjet til din ignoreringsliste</translation>
+    </message>
+    <message>
+        <source>%1 has been removed from your friends list</source>
+        <translation>%1 er blevet fjernet fra din venneliste</translation>
+    </message>
+    <message>
+        <source>%1 has been added to your friends list</source>
+        <translation>%1 er blevet tilføjet til din venneliste</translation>
+    </message>
+    <message>
+        <source>Stylesheet imported from %1</source>
+        <translation>Typografiark importeret fra %1</translation>
+    </message>
+    <message>
+        <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
+        <translation>Tryk %1 hvis du vil bruge det nuværende typografiark i fremtiden, tryk %2 for at nulstille!</translation>
+    </message>
+    <message>
+        <source>Couldn't read %1</source>
+        <translation>Kunne ikke læse %1</translation>
+    </message>
+    <message>
+        <source>StyleSheet discarded</source>
+        <translation>Typografiark kasseret</translation>
+    </message>
+    <message>
+        <source>StyleSheet saved to %1</source>
+        <translation>Typografiark gemt til %1</translation>
+    </message>
+    <message>
+        <source>Failed to save StyleSheet to %1</source>
+        <translation>Mislykkedes at gemme typografiark til %1</translation>
+    </message>
+    <message>
+        <source>%1 is not a valid command!</source>
+        <translation>%1 er ikke en gyldig kommando!</translation>
+    </message>
+    <message>
+        <source>Kicking %1 ...</source>
+        <translation>Smider %1 ud...</translation>
+    </message>
+</context>
+<context>
+    <name>HWForm</name>
+    <message>
+        <source>new</source>
+        <translation>ny</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Unable to start the server</source>
+        <translation>Ude af stand til at starte serveren</translation>
+    </message>
+    <message>
+        <source>Cannot save record to file %1</source>
+        <translation>Kan ikke gemme optagelse til fil %1</translation>
+    </message>
+    <message>
+        <source>Please select record from the list above</source>
+        <translation>Vælg venligst en optagelse fra den ovenstående liste</translation>
+    </message>
+    <message>
+        <source>DefaultTeam</source>
+        <translation>StandardHold</translation>
+    </message>
+    <message>
+        <source>Hedgewars Demo File</source>
+        <comment>File Types</comment>
+        <translation>Hedgewars Demofil</translation>
+    </message>
+    <message>
+        <source>Hedgewars Save File</source>
+        <comment>File Types</comment>
+        <translation>Hedgewars Spilfil</translation>
+    </message>
+    <message>
+        <source>Demo name</source>
+        <translation>Demonavn</translation>
+    </message>
+    <message>
+        <source>Demo name:</source>
+        <translation>Demonavn:</translation>
+    </message>
+    <message>
+        <source>Game aborted</source>
+        <translation>Spil afbrudt</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>Kodeord</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</source>
+        <translation>Dit brugernavn %1 er
+registreret på Hedgewars.org
+Indtast venligst dit kodeord nedenfor
+eller vælg et andet brugernavn under spilkonfigurationen:</translation>
+    </message>
+    <message>
+        <source>No password supplied.</source>
+        <translation>Intet kodeord indtastet.</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Brugernavn</translation>
+    </message>
+    <message>
+        <source>Some one already uses
+ your nickname %1
+on the server.
+Please pick another nickname:</source>
+        <translation>En eller anden bruger allerede
+dit brugernavn %1
+på serveren.
+Vælg venligst et andet brugernavn:</translation>
+    </message>
+    <message>
+        <source>No nickname supplied.</source>
+        <translation>Intet brugernavn indtastet.</translation>
+    </message>
+</context>
+<context>
+    <name>HWGame</name>
+    <message>
+        <source>en.txt</source>
+        <translation>en.txt</translation>
+    </message>
+    <message>
+        <source>Cannot open demofile %1</source>
+        <translation>Kan ikke åbne demofil %1</translation>
+    </message>
+</context>
+<context>
+    <name>HWMapContainer</name>
+    <message>
+        <source>Map</source>
+        <translation>Bane</translation>
+    </message>
+    <message>
+        <source>Themes</source>
+        <translation>Temaer</translation>
+    </message>
+    <message>
+        <source>Filter</source>
+        <translation>Filter</translation>
+    </message>
+    <message>
+        <source>All</source>
+        <translation>Alle</translation>
+    </message>
+    <message>
+        <source>Small</source>
+        <translation>Lille</translation>
+    </message>
+    <message>
+        <source>Medium</source>
+        <translation>Medium</translation>
+    </message>
+    <message>
+        <source>Large</source>
+        <translation>Stor</translation>
+    </message>
+    <message>
+        <source>Cavern</source>
+        <translation>Grotte</translation>
+    </message>
+    <message>
+        <source>Wacky</source>
+        <translation>Skør</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>Small tunnels</source>
+        <translation>Små tunneler</translation>
+    </message>
+    <message>
+        <source>Medium tunnels</source>
+        <translation>Mellemstore tunneler</translation>
+    </message>
+    <message>
+        <source>Large tunnels</source>
+        <translation>Store tunneler</translation>
+    </message>
+    <message>
+        <source>Small floating islands</source>
+        <translation>Små svævende øer</translation>
+    </message>
+    <message>
+        <source>Medium floating islands</source>
+        <translation>Mellemstore svævende øer</translation>
+    </message>
+    <message>
+        <source>Large floating islands</source>
+        <translation>Store svævende øer</translation>
+    </message>
+    <message>
+        <source>Seed</source>
+        <translation>Spire</translation>
+    </message>
+    <message>
+        <source>Set</source>
+        <translation>Indstil</translation>
+    </message>
+</context>
+<context>
+    <name>HWNetServersModel</name>
+    <message>
+        <source>Title</source>
+        <translation>Titel</translation>
+    </message>
+    <message>
+        <source>IP</source>
+        <translation>Ip</translation>
+    </message>
+    <message>
+        <source>Port</source>
+        <translation>Port</translation>
+    </message>
+</context>
+<context>
+    <name>HWNewNet</name>
+    <message>
+        <source>The host was not found. Please check the host name and port settings.</source>
+        <translation>Værtsmaskinen blev ikke fundet. Tjek venligst værtsnavnet og portindstillingerne.</translation>
+    </message>
+    <message>
+        <source>Connection refused</source>
+        <translation>Forbindelse afvist</translation>
+    </message>
+    <message>
+        <source>Room destroyed</source>
+        <translation>Rum fjernet</translation>
+    </message>
+    <message>
+        <source>Quit reason: </source>
+        <translation>Forlod fordi: </translation>
+    </message>
+    <message>
+        <source>You got kicked</source>
+        <translation>Du blev smidt ud</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>Kodeord</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password
+or pick another nickname:</source>
+        <translation type="obsolete">Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password
+or pick another nickname:</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has joined the room</source>
+        <translation>%1 *** %2 har tilsluttet sig til rummet</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has joined</source>
+        <translation>%1 *** %2 har tilsluttet sig</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has left (%3)</source>
+        <translation>%1 *** %2 har forladt (%3)</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has left</source>
+        <translation>%1 *** %2 har forladt</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</source>
+        <translation type="obsolete">Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Brugernavn</translation>
+    </message>
+    <message>
+        <source>User quit</source>
+        <translation>En bruger forlod</translation>
+    </message>
+</context>
+<context>
+    <name>KB</name>
+    <message>
+        <source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</source>
+        <translation>SDL_ttf returnerede en fejl under tekstrendering, højst sandsynligt er den relateret til en fejl i freetype2. Det anbefales at opdatere dit freetype bibliotek.</translation>
+    </message>
+</context>
+<context>
+    <name>PageAdmin</name>
+    <message>
+        <source>Server message:</source>
+        <translation>Serverbesked:</translation>
+    </message>
+    <message>
+        <source>Set message</source>
+        <translation>Indstil besked</translation>
+    </message>
+    <message>
+        <source>Clear Accounts Cache</source>
+        <translation>Ryd Bruger-cache</translation>
+    </message>
+    <message>
+        <source>Fetch data</source>
+        <translation>Hent data</translation>
+    </message>
+    <message>
+        <source>Server message for latest version:</source>
+        <translation>Serverbesked for nyeste version:</translation>
+    </message>
+    <message>
+        <source>Server message for previous versions:</source>
+        <translation>Serverbesked for tidligere versioner:</translation>
+    </message>
+    <message>
+        <source>Latest version protocol number:</source>
+        <translation>Nyeste versions protokolnummer:</translation>
+    </message>
+    <message>
+        <source>MOTD preview:</source>
+        <translation>Forhåndsvisning af dagens besked:</translation>
+    </message>
+    <message>
+        <source>Set data</source>
+        <translation>Indstil data</translation>
+    </message>
+</context>
+<context>
+    <name>PageConnecting</name>
+    <message>
+        <source>Connecting...</source>
+        <translation>Opretter forbindelse...</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Annuler</translation>
+    </message>
+</context>
+<context>
+    <name>PageDrawMap</name>
+    <message>
+        <source>Undo</source>
+        <translation>Fortryd</translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation>Ryd</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Indlæs</translation>
+    </message>
+    <message>
+        <source>Save</source>
+        <translation>Gem</translation>
+    </message>
+    <message>
+        <source>Load drawn map</source>
+        <translation>Indlæs tegnet bane</translation>
+    </message>
+    <message>
+        <source>Save drawn map</source>
+        <translation>Gem tegnet bane</translation>
+    </message>
+    <message>
+        <source>Drawn Maps</source>
+        <translation>Tegnede Baner</translation>
+    </message>
+    <message>
+        <source>All files</source>
+        <translation>Alle filer</translation>
+    </message>
+</context>
+<context>
+    <name>PageEditTeam</name>
+    <message>
+        <source>General</source>
+        <translation>Generelt</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation>Advanceret</translation>
+    </message>
+</context>
+<context>
+    <name>PageGameStats</name>
+    <message>
+        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
+        <translation><p>Prisen for det bedste skud gik til <b>%1</b> med <b>%2</b> point.</p></translation>
+    </message>
+    <message numerus="yes">
+        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
+        <translation type="obsolete">
+            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kill in a turn.</p></numerusform>
+            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
+        <translation type="obsolete">
+            <numerusform><p>A total of <b>%1</b> hedgehog was killed during this round.</p></numerusform>
+            <numerusform><p>A total of <b>%1</b> hedgehogs were killed during this round.</p></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Details</source>
+        <translation>Detaljer</translation>
+    </message>
+    <message>
+        <source>Health graph</source>
+        <translation>Helbredsgraf</translation>
+    </message>
+    <message>
+        <source>Ranking</source>
+        <translation>Rangliste</translation>
+    </message>
+    <message>
+        <source>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</source>
+        <translation>Prisen for det bedste skud gik til <b>%1</b> med <b>%2</b> point.</translation>
+    </message>
+    <message numerus="yes">
+        <source>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</source>
+        <translation>
+            <numerusform>Den bedste dræber er <b>%1</b> med <b>%2</b> drab på én tur.</numerusform>
+            <numerusform>Den bedste dræber er <b>%1</b> med <b>%2</b> drab på én tur.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
+        <translation>
+            <numerusform><b>%1</b> pindsvin blev dræbt i denne runde.</numerusform>
+            <numerusform>Totalt blev <b>%1</b> pindsvin dræbt i denne runde.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>(%1 kill)</source>
+        <translation>
+            <numerusform>(%1 drab)</numerusform>
+            <numerusform>(%1 drab)</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
+        <translation>
+            <numerusform><b>%1</b> troede det var en god idé at skyde sine egne pindsvin med <b>%2</b> point.</numerusform>
+            <numerusform><b>%1</b> troede det var en god idé at skyde sine egne pindsvin med <b>%2</b> point.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> killed <b>%2</b> of his own hedgehogs.</source>
+        <translation>
+            <numerusform><b>%1</b> dræbte <b>%2</b> af sine egne pindsvin.</numerusform>
+            <numerusform><b>%1</b> dræbte <b>%2</b> af sine egne pindsvin.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
+        <translation>
+            <numerusform><b>%1</b> blev bange og sprang over sin tur <b>%2</b> gang.</numerusform>
+            <numerusform><b>%1</b> blev bange og sprang over sin tur <b>%2</b> gange.</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>PageInGame</name>
+    <message>
+        <source>In game...</source>
+        <translation>I spillet...</translation>
+    </message>
+</context>
+<context>
+    <name>PageMain</name>
+    <message>
+        <source>Local Game (Play a game on a single computer)</source>
+        <translation>Lokalt spil (Spil et spil på én enkelt computer)</translation>
+    </message>
+    <message>
+        <source>Network Game (Play a game across a network)</source>
+        <translation>Netværksspil (Spil et spil over et netværk)</translation>
+    </message>
+    <message>
+        <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
+        <comment>Tips</comment>
+        <translation>Bare vælg samme farve som en ven for at spille sammen som et hold. Hver af jer vil stadig kontrollere sine egne pindsvin, men vil vinde eller tabe sammen.</translation>
+    </message>
+    <message>
+        <source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
+        <comment>Tips</comment>
+        <translation>Nogle våben giver måske ikke særlig meget skade, men de kan være meget mere farlige i de rigtige situationer. Prøv at bruge Desert Eagle-pistolen til at skubbe flere pindsvin i vandet.</translation>
+    </message>
+    <message>
+        <source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
+        <comment>Tips</comment>
+        <translation>Hvis du er usikker på hvad du skal gøre og ikke vil spilde ammunition, kan du springe en runde over. Men lad der ikke gå alt for meget tid, for ellers indtræffer Pludselig Død!</translation>
+    </message>
+    <message>
+        <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
+        <comment>Tips</comment>
+        <translation>Hvis du ikke vil have at andre anvender dit foretrukne brugernavn på den officielle server, kan du registrere en bruger på http://www.hedgewars.org/.</translation>
+    </message>
+    <message>
+        <source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
+        <comment>Tips</comment>
+        <translation>Er du træt af den almindelige måde at spille på? Prøv en af missionerne - de tilbyder forskellige måder at spille på afhængigt af hvilken en du vælger.</translation>
+    </message>
+    <message>
+        <source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
+        <comment>Tips</comment>
+        <translation>Som standard optager spillet altid det sidste spil du har spillet som en demo. Tryk på 'Lokalt spil' og vælg 'Demoer'-knappen i nederste højre hjørne for at afspille eller administrere dem.</translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er Open Source og et gratis spil vi laver i vores fritid. Hvis du har problemer er du velkommen til at spørge på forummet, men forvent ikke at få hjælp 24 timer i døgnet!</translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er Open Source og et gratis spil vi laver i vores fritid. Hvis du holder af det, kan du hjælpe os med en lille donation eller ved at indsende dine egne modifikationer!</translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er Open Source og et gratis spil vi laver i vores fritid. Del det med dine venner og din familie som du ønsker!</translation>
+    </message>
+    <message>
+        <source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
+        <comment>Tips</comment>
+        <translation>Fra tid til anden er der officielle turneringer. Kommende begivenheder vil blive annonceret på http://www.hedgewars.org/ et par dage i forvejen.</translation>
+    </message>
+    <message>
+        <source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er tilgængeligt på mange sprog. Hvis oversættelsen på dit sprog mangler noget eller er uddateret, skal du være velkommen til at kontakte os!</translation>
+    </message>
+    <message>
+        <source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars kan køre på mange forskellige operativsystemer, herunder Microsoft Windows, Mac OS X og Linux.</translation>
+    </message>
+    <message>
+        <source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
+        <comment>Tips</comment>
+        <translation>Husk altid at du kan sætte dine egne spil op under lokale-, netværks- og online-spil. Du er ikke begrænset til kun at bruge 'Simpelt spil'-muligheden.</translation>
+    </message>
+    <message>
+        <source>While playing you should give yourself a short break at least once an hour.</source>
+        <comment>Tips</comment>
+        <translation>Mens du spiller bør du tage en kort pause mindst en gang i timen.</translation>
+    </message>
+    <message>
+        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
+        <comment>Tips</comment>
+        <translation>Hvis dit grafikkort ikke understøtter hardware-accelereret OpenGL, kan du prøve at slå indstillingen 'Reduceret kvalitet' til for at forbedre ydelsen.</translation>
+    </message>
+    <message>
+        <source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
+        <comment>Tips</comment>
+        <translation>Vi er åbne over for foreslag og konstruktive tilbagemeldinger. Fortæl os det hvis der er noget du ikke kan lide eller hvis du har en god idé!</translation>
+    </message>
+    <message>
+        <source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
+        <comment>Tips</comment>
+        <translation>Specielt når du spiller online bør du være venlig og altid huske at du måske også spiller med eller mod børn!</translation>
+    </message>
+    <message>
+        <source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
+        <comment>Tips</comment>
+        <translation>Specielle måder at spille på som f.eks. 'Varmpyr' eller 'Karma' tillader dig at udvikle helt nye taktikker. Prøv dem i et brugerdefineret spil!</translation>
+    </message>
+    <message>
+        <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
+        <comment>Tips</comment>
+        <translation>Du bør aldrig installere Hedgewars på computere du ikke ejer (skole, universitet, arbejde,e.l.). Spørg venligst den ansvarlige person i stedet!</translation>
+    </message>
+    <message>
+        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er perfekt til korte spil under pauser. Bare par på du ikke tilføjer for mange pindsvin eller bruger en kæmpe bane. Det kan også hjælpe at reducere tid og liv.</translation>
+    </message>
+    <message>
+        <source>No hedgehogs were harmed in making this game.</source>
+        <comment>Tips</comment>
+        <translation>Ingen pindsvin kom til skade under produktionen af dette spil.</translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
+        <comment>Tips</comment>
+        <translation>Hedgewars er Open Source og et gratis spil vi laver i vores fritid. Hvis nogen solgte dig spiller skal du bede om at få pengene tilbage!</translation>
+    </message>
+    <message>
+        <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
+        <comment>Tips</comment>
+        <translation>Tilslut en eller flere gamepads før du starter spiller for at kunne tildele dem til dit hold.</translation>
+    </message>
+    <message>
+        <source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
+        <comment>Tips</comment>
+        <translation>Opret en bruger på %1 hvis du ikke vil have at andre anvender dit foretrukne brugernavn på den officielle server.</translation>
+    </message>
+    <message>
+        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
+        <comment>Tips</comment>
+        <translation>Hvis du ikke er i stand til at slå hardware-accelereret OpenGL til, bør du prøve at opdatere dine grafikkort-drivere.</translation>
+    </message>
+    <message>
+        <source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
+        <comment>Tips</comment>
+        <translation>Der er tre forskellige typer hop tilgængelige. Tryk hurtigt på [hight jump] to gange i træk for at lave et højt, baglæns hop.</translation>
+    </message>
+    <message>
+        <source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
+        <comment>Tips</comment>
+        <translation>Er du bange for at falde ned fra en skrænt? Hold [precise] nede for at vende dig mod [left] eller [right] uden at bevæge dig.</translation>
+    </message>
+    <message>
+        <source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
+        <comment>Tips</comment>
+        <translation>Nogle våben kræver specielle strategier eller bare masser af træning, så undlad ikke at bruge et bestemt våben bare fordi du rammer ved siden af én gang.</translation>
+    </message>
+    <message>
+        <source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
+        <comment>Tips</comment>
+        <translation>De fleste våben virker ikke så snart de har rørt vandet. Den Målsøgende Bi og Kagen er de eneste undtagelser.</translation>
+    </message>
+    <message>
+        <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
+        <comment>Tips</comment>
+        <translation>Gamle Ole laver kun en lille eksplosion. Til gengæld kan den stænkende sky den udsender føres rundt af vinden og ramme mange pindsvin på én gang.</translation>
+    </message>
+    <message>
+        <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
+        <comment>Tips</comment>
+        <translation>Klaveranslaget er det luftvåben der giver allermest skade. Til gengæld mister du det pindsvin som bruger angrebet, så der er også en bagside af medaljen.</translation>
+    </message>
+    <message>
+        <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
+        <comment>Tips</comment>
+        <translation>Klæbrige Miner er det perfekte værktøj til at lave små kædereaktioner og smide pindsvin ud i faretruende situationer... eller bare direkte i vandet.</translation>
+    </message>
+    <message>
+        <source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
+        <comment>Tips</comment>
+        <translation>Hammeren er mest effektiv når den bruges enten på broer eller bærebjælker. Sigter du mod pindsvin med den, laver du bare huller i jorden.</translation>
+    </message>
+    <message>
+        <source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
+        <comment>Tips</comment>
+        <translation>Hvis du sidder fast bag en af modstanderens pindsvin, kan du bruge Hammeren til at slå dig fri uden at tage skade under en eksplosion.</translation>
+    </message>
+    <message>
+        <source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
+        <comment>Tips</comment>
+        <translation>Kagen kan gå kortere eller længere, afhængig af hvad den skal over på vejen. Du kan brrug [attack] til at detonere den før den når sin destination.</translation>
+    </message>
+    <message>
+        <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
+        <comment>Tips</comment>
+        <translation>Flammekasteren er et våben, men den kan også bruges til hurtigt at grave tunneler.</translation>
+    </message>
+    <message>
+        <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
+        <comment>Tips</comment>
+        <translation>Vil du vide hvem der står bag spillet? Klik på Hedgewars-logoet i hovedmenuen for at se rulleteksterne.</translation>
+    </message>
+    <message>
+        <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
+        <comment>Tips</comment>
+        <translation>Er du glad for Hedgewars? Bliv fan på %1 eller følge vores opdateringer på %2!</translation>
+    </message>
+    <message>
+        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
+        <comment>Tips</comment>
+        <translation>Du skal være velkommen til at tegne dine egne gravsten, hatte, flag eller endda baner og temaer! Men læg mærke til at du bliver nød til at dele dem med andre hvis du vil spille med dem online.</translation>
+    </message>
+    <message>
+        <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
+        <comment>Tips</comment>
+        <translation>Vil du virkelig gerne have en specifik hat? Send os en donation, så kvitterer vi med en eksklusiv hat efter eget valg!</translation>
+    </message>
+    <message>
+        <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
+        <comment>Tips</comment>
+        <translation>Hold dine grafikkortdrivere opdaterede for at undgå problemmer i spillet.</translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen "(Mine) Dokumenter\Hedgewars". Opret gerne en back-up eller tag filerne med dig, men lad være med selv at ændre i dem.</translation>
+    </message>
+    <message>
+        <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
+        <comment>Tips</comment>
+        <translation>Du kan indstille Hedgewars-filer (gemte spil og demooptagelser) til automatisk at åbne når du trykker på dem eller åbner dem i din internet-browser.</translation>
+    </message>
+    <message>
+        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
+        <comment>Tips</comment>
+        <translation>Vil du gerne spare på dine reb? Slip rebet midt i luften og skyd straks igen. Så længe du ikke rører jorden bruger du ikke noget ammunition!</translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen "Bibliotek/Application Support/Hedgewars" i din hjemmemappe. Opret gerne en back-up eller tag filerne med dig, men lad være med selv at ændre i dem.</translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation>Du kan finde konfigurationsfilerne til Hedgewars under mappen ".hedgewars" i din hjemmemappe. Opret gerne en back-up eller tag filerne med dig, men lad være med selv at ændre i dem.</translation>
+    </message>
+    <message>
+        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
+        <comment>Tips</comment>
+        <translation>Windows-versionen af Hedgewars understøtter integrering med Xfire. Husk at tilføje Hedgewars til din liste med spil så dine venner kan se hvornår du spiller.</translation>
+    </message>
+    <message>
+        <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
+        <comment>Tips</comment>
+        <translation>Brug en Molotovcocktail eller Flammekasteren til midlertidigt at forhindre pindsvin i at passere et område, f.eks. en tunnel eller platform.</translation>
+    </message>
+    <message>
+        <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
+        <comment>Tips</comment>
+        <translation>Den Målsøgende Bi kan være svær at bruge. Den vender lettere hvis den ikke flyver alt for hurtigt, så prøv at spare på kraften når du affyrer den.</translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation>Indhold der kan Downloades</translation>
+    </message>
+</context>
+<context>
+    <name>PageMultiplayer</name>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+</context>
+<context>
+    <name>PageNet</name>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Please select server from the list above</source>
+        <translation>Vælg venligst en server fra den ovenstående liste</translation>
+    </message>
+</context>
+<context>
+    <name>PageNetGame</name>
+    <message>
+        <source>Control</source>
+        <translation>Kontrol</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation>Indtast venligst navnet på rummet</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+</context>
+<context>
+    <name>PageNetType</name>
+    <message>
+        <source>LAN game</source>
+        <translation>Netværksspil</translation>
+    </message>
+    <message>
+        <source>Official server</source>
+        <translation>Officiel server</translation>
+    </message>
+</context>
+<context>
+    <name>PageOptions</name>
+    <message>
+        <source>New team</source>
+        <translation>Nyt hold</translation>
+    </message>
+    <message>
+        <source>Edit team</source>
+        <translation>Rediger hold</translation>
+    </message>
+    <message>
+        <source>Delete team</source>
+        <translation>Slet hold</translation>
+    </message>
+    <message>
+        <source>New weapon scheme</source>
+        <translation>Nyt våbensystem</translation>
+    </message>
+    <message>
+        <source>Edit weapon scheme</source>
+        <translation>Rediger våbensystem</translation>
+    </message>
+    <message>
+        <source>Delete weapon scheme</source>
+        <translation>Slet våbensystem</translation>
+    </message>
+    <message>
+        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
+        <translation>Du kan ikke ændre på holdene fra holdvalgsskærmen. Gå tilbage til hovedmenuen for at tilføje, redigere og slette hold.</translation>
+    </message>
+    <message>
+        <source>New scheme</source>
+        <translation>Nyt spilsystem</translation>
+    </message>
+    <message>
+        <source>Edit scheme</source>
+        <translation>Rediger spilsystem</translation>
+    </message>
+    <message>
+        <source>Delete scheme</source>
+        <translation>Slet spilsystem</translation>
+    </message>
+    <message>
+        <source>New weapon set</source>
+        <translation>Nyt våbensæt</translation>
+    </message>
+    <message>
+        <source>Edit weapon set</source>
+        <translation>Rediger våbensæt</translation>
+    </message>
+    <message>
+        <source>Delete weapon set</source>
+        <translation>Slet våbensæt</translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Dialogboks til omdøbelse</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Indtast nyt filnavn:</translation>
+    </message>
+    <message>
+        <source>Cannot rename to</source>
+        <translation>Kan ikke omdøbe til</translation>
+    </message>
+    <message>
+        <source>Cannot delete file</source>
+        <translation>Kan ikke slette fil</translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation>Vælg venligst en optagelse fra listen</translation>
+    </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
+    <message>
+        <source>Create</source>
+        <translation>Opret</translation>
+    </message>
+    <message>
+        <source>Join</source>
+        <translation>Tilslut</translation>
+    </message>
+    <message>
+        <source>Refresh</source>
+        <translation>Opdater</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Admin features</source>
+        <translation>Administratorfunktioner</translation>
+    </message>
+    <message>
+        <source>Room Name:</source>
+        <translation>Navn på Rum:</translation>
+    </message>
+    <message>
+        <source>This game is in lobby.
+You may join and start playing once the game starts.</source>
+        <translation>Dette spil er i lobbyen.
+Du kan tilslutte dig og spille med når spillet starter.</translation>
+    </message>
+    <message>
+        <source>This game is in progress.
+You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
+        <translation>Dette spil er i gang.
+Du kan tilslutte dig og kigge med med det samme, men du må vente på at spillet slutter med selv at kunne spille med.</translation>
+    </message>
+    <message>
+        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <translation>%1 er værten. Han kan ændre indstillingerne og starte spillet.</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Tilfældig Bane</translation>
+    </message>
+    <message>
+        <source>Games may be played on precreated or randomized maps.</source>
+        <translation>Man kan spille enten på allerede lavede eller tilfældigt genererede baner.</translation>
+    </message>
+    <message>
+        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <translation>Spilsystemet definerer generelle indstillinger og præferencer, så som rundelængden, Pludselig Død og Vampyr.</translation>
+    </message>
+    <message>
+        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <translation>Våbensystemet definere hvilke våben der er tilgængelige og hvor meget ammunition de har.</translation>
+    </message>
+    <message numerus="yes">
+        <source>There are %1 clients connected to this room.</source>
+        <translation>
+            <numerusform>Der er %1 klient forbundet til dette rum.</numerusform>
+            <numerusform>Der er %1 klienter forbundet til dette rum.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>There are %1 teams participating in this room.</source>
+        <translation>
+            <numerusform>Der deltager %1 hold i dette rum.</numerusform>
+            <numerusform>Der deltager %1 hold i dette rum.</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation>Indtast venligst rummets navn</translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation>Vælg venligst et rum fra listen</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Tilfældig Labyrint</translation>
+    </message>
+    <message>
+        <source>Rules:</source>
+        <translation>Regler:</translation>
+    </message>
+    <message>
+        <source>Weapons:</source>
+        <translation>VÃ¥ben:</translation>
+    </message>
+    <message>
+        <source>Search:</source>
+        <translation>Søg:</translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation>Ryd</translation>
+    </message>
+    <message>
+        <source>Warning</source>
+        <translation>Advarsel</translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>Det spil du forsøge at tilslutte dig er allerede startet.
+Har du stadig lyst til at tilslutte dig rummet?</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 players online</source>
+        <translation>
+            <numerusform>%1 spiller er online</numerusform>
+            <numerusform>%1 spillere er online</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>PageScheme</name>
+    <message>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation>Forsvar dit fort og udryd dine modstandere. Maksimalt to holdfarver!</translation>
+    </message>
+    <message>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
+        <translation>Hold starter på hver sin side af banen. Maksimalt to holdfarver!</translation>
+    </message>
+    <message>
+        <source>Land can not be destroyed!</source>
+        <translation>Landmassen kan ikke ødelægges!</translation>
+    </message>
+    <message>
+        <source>Add an indestructable border around the terrain</source>
+        <translation>Tilføj en kant rundt om banen som ikke kan destrueres</translation>
+    </message>
+    <message>
+        <source>Lower gravity</source>
+        <translation>Svagere tyngdekraft</translation>
+    </message>
+    <message>
+        <source>Assisted aiming with laser sight</source>
+        <translation>Lasersigte til hjælp med at ramme</translation>
+    </message>
+    <message>
+        <source>All hogs have a personal forcefield</source>
+        <translation>Alle pindsvin har deres eget personlige kraftfelt</translation>
+    </message>
+    <message>
+        <source>Enable random mines</source>
+        <translation>Aktiver tilfældige miner</translation>
+    </message>
+    <message>
+        <source>Gain 80% of the damage you do back in health</source>
+        <translation>FÃ¥ 80% af den skade du giver tilbage som liv</translation>
+    </message>
+    <message>
+        <source>Share your opponents pain, share their damage</source>
+        <translation>Del dine modstanderes lidelser, del deres skader</translation>
+    </message>
+    <message>
+        <source>Your hogs are unable to move, put your artillery skills to the test</source>
+        <translation>Dine pindsvin kan ikke bevæge sig, så nu skal du vinde kun ved artilleriet</translation>
+    </message>
+    <message>
+        <source>Random</source>
+        <translation>Tilfældig</translation>
+    </message>
+    <message>
+        <source>Seconds</source>
+        <translation>Sekunder</translation>
+    </message>
+    <message>
+        <source>New</source>
+        <translation>Ny</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Slet</translation>
+    </message>
+    <message>
+        <source>Order of play is random instead of in room order.</source>
+        <translation>Turrækkefølgen er tilfældig i stedet for rækkefølgen i rummet.</translation>
+    </message>
+    <message>
+        <source>Play with a King. If he dies, your side dies.</source>
+        <translation>Spil med en Konge. Taber du ham, taber du.</translation>
+    </message>
+    <message>
+        <source>Take turns placing your hedgehogs before the start of play.</source>
+        <translation>Tag ture med at placere pindsvinene før spillet starter.</translation>
+    </message>
+    <message>
+        <source>Ammo is shared between all teams that share a colour.</source>
+        <translation>Ammunition deles melem alle hold der deler en farve.</translation>
+    </message>
+    <message>
+        <source>Disable girders when generating random maps.</source>
+        <translation>Deaktiver bærebjælker når der genereres tilfældige baner.</translation>
+    </message>
+    <message>
+        <source>Disable land objects when generating random maps.</source>
+        <translation>Deaktiver overfladeobjekter når der genereres tilfældige baner.</translation>
+    </message>
+    <message>
+        <source>AI respawns on death.</source>
+        <translation>AI-pindsvin genopliver straks efter de dør.</translation>
+    </message>
+    <message>
+        <source>All (living) hedgehogs are fully restored at the end of turn</source>
+        <translation>Alle (levende) pindsvin bliver helbredt helt i slutningen af turen</translation>
+    </message>
+    <message>
+        <source>Attacking does not end your turn.</source>
+        <translation>Angreb slutter ikke turen.</translation>
+    </message>
+    <message>
+        <source>Weapons are reset to starting values each turn.</source>
+        <translation>Våben bliver nulstillet til startværdier hver tur.</translation>
+    </message>
+    <message>
+        <source>Each hedgehog has its own ammo. It does not share with the team.</source>
+        <translation>Hvert pindsvin har sin egen ammunition. Den deler ikke med holdet.</translation>
+    </message>
+    <message>
+        <source>You will not have to worry about wind anymore.</source>
+        <translation>Du behøver ikke længere bekymre dig om vindstød.</translation>
+    </message>
+    <message>
+        <source>Wind will affect almost everything.</source>
+        <translation>Vinden tager fat i næsten alt.</translation>
+    </message>
+    <message>
+        <source>Copy</source>
+        <translation>Kopier</translation>
+    </message>
+    <message>
+        <source>Teams in each clan take successive turns sharing their turn time.</source>
+        <translation>Hold i hver klan deler én tidspulje, som de alle bruger af i løbet af deres tur.</translation>
+    </message>
+    <message>
+        <source>Add an indestructible border around the terrain</source>
+        <translation>Tilføj en kant rundt om banen som ikke kan destrueres</translation>
+    </message>
+    <message>
+        <source>Add an indestructible border along the bottom</source>
+        <translation>Tilføj en kant under banen som ikke kan destrueres</translation>
+    </message>
+</context>
+<context>
+    <name>PageSelectWeapon</name>
+    <message>
+        <source>Default</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Slet</translation>
+    </message>
+    <message>
+        <source>New</source>
+        <translation>Ny</translation>
+    </message>
+    <message>
+        <source>Copy</source>
+        <translation>Kopier</translation>
+    </message>
+</context>
+<context>
+    <name>PageSinglePlayer</name>
+    <message>
+        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
+        <translation>Simpelt spil (et hurtigt spil mod computeren, hvor indstillingerne er valgt på forhånd)</translation>
+    </message>
+    <message>
+        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
+        <translation>Multiplayer (spil mod flere venner eller AI hold ved samme computer)</translation>
+    </message>
+    <message>
+        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <translation>Træningsspil (Rafiner dine evner i en række forskellige træningsmissioner)</translation>
+    </message>
+    <message>
+        <source>Demos (Watch recorded demos)</source>
+        <translation>Demoer (Afspil optagede demoer)</translation>
+    </message>
+    <message>
+        <source>Load (Load a previously saved game)</source>
+        <translation>Indlæs (Indlæs et tidligere gemt spil)</translation>
+    </message>
+    <message>
+        <source>Campaign Mode (...)</source>
+        <translation>Kampagnespil (...)</translation>
+    </message>
+</context>
+<context>
+    <name>PageTraining</name>
+    <message>
+        <source>No description available</source>
+        <translation>Ingen beskrivelse tilgængelig</translation>
+    </message>
+    <message>
+        <source>Select a mission!</source>
+        <translation>Vælg en mission!</translation>
+    </message>
+</context>
+<context>
+    <name>QAction</name>
+    <message>
+        <source>Kick</source>
+        <translation>Smid ud</translation>
+    </message>
+    <message>
+        <source>Info</source>
+        <translation>Info</translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+    <message>
+        <source>Restrict Joins</source>
+        <translation>Begræns tilslutninger</translation>
+    </message>
+    <message>
+        <source>Restrict Team Additions</source>
+        <translation>Begræns holdtilslutninger</translation>
+    </message>
+    <message>
+        <source>Ban</source>
+        <translation>Bandlys</translation>
+    </message>
+    <message>
+        <source>Follow</source>
+        <translation>Følg</translation>
+    </message>
+    <message>
+        <source>Ignore</source>
+        <translation>Ignorer</translation>
+    </message>
+    <message>
+        <source>Add friend</source>
+        <translation>Tilføj ven</translation>
+    </message>
+    <message>
+        <source>Unignore</source>
+        <translation>Hold op med at ignorere</translation>
+    </message>
+    <message>
+        <source>Remove friend</source>
+        <translation>Fjern ven</translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation>Opdater</translation>
+    </message>
+</context>
+<context>
+    <name>QCheckBox</name>
+    <message>
+        <source>Check for updates at startup</source>
+        <translation>Tjek efter opdatering når spillet startes</translation>
+    </message>
+    <message>
+        <source>Fullscreen</source>
+        <translation>Fuldskærm</translation>
+    </message>
+    <message>
+        <source>Frontend fullscreen</source>
+        <translation>Fullskærm (frontend)</translation>
+    </message>
+    <message>
+        <source>Enable sound</source>
+        <translation>Aktiver lyd</translation>
+    </message>
+    <message>
+        <source>Enable music</source>
+        <translation>Aktiver musik</translation>
+    </message>
+    <message>
+        <source>Show FPS</source>
+        <translation>Fremvis antal billeder vist per sekund</translation>
+    </message>
+    <message>
+        <source>Alternative damage show</source>
+        <translation>Vis skade efter hvert skud</translation>
+    </message>
+    <message>
+        <source>Append date and time to record file name</source>
+        <translation>Tilføj dato og tidspunkt til filnavnet for optagelser</translation>
+    </message>
+    <message>
+        <source>Reduced quality</source>
+        <translation>Reduceret kvalitet</translation>
+    </message>
+    <message>
+        <source>Show ammo menu tooltips</source>
+        <translation>Vis værktøjstip i ammunitionsmenuer</translation>
+    </message>
+    <message>
+        <source>Enable frontend sounds</source>
+        <translation>Aktiver lyd (frontend)</translation>
+    </message>
+    <message>
+        <source>Enable frontend music</source>
+        <translation>Aktiver musik (frontend)</translation>
+    </message>
+    <message>
+        <source>Frontend effects</source>
+        <translation>Effekter (frontend)</translation>
+    </message>
+</context>
+<context>
+    <name>QComboBox</name>
+    <message>
+        <source>generated map...</source>
+        <translation>genereret bane...</translation>
+    </message>
+    <message>
+        <source>Human</source>
+        <translation>Menneske</translation>
+    </message>
+    <message>
+        <source>Level</source>
+        <translation>Niveau</translation>
+    </message>
+    <message>
+        <source>(System default)</source>
+        <translation>(Systemstandard)</translation>
+    </message>
+    <message>
+        <source>Mission</source>
+        <translation>Mission</translation>
+    </message>
+    <message>
+        <source>generated maze...</source>
+        <translation>genereret labyrint...</translation>
+    </message>
+    <message>
+        <source>Community</source>
+        <translation>Fællesskab</translation>
+    </message>
+    <message>
+        <source>Any</source>
+        <translation>Ethvert</translation>
+    </message>
+    <message>
+        <source>In lobby</source>
+        <translation>I lobbyen</translation>
+    </message>
+    <message>
+        <source>In progress</source>
+        <translation>I gang</translation>
+    </message>
+    <message>
+        <source>Default</source>
+        <translation>Standard</translation>
+    </message>
+    <message>
+        <source>hand drawn map...</source>
+        <translation>håndtegnet bane...</translation>
+    </message>
+    <message>
+        <source>Disabled</source>
+        <translation>Deaktiveret</translation>
+    </message>
+    <message>
+        <source>Red/Cyan</source>
+        <translation>Rød/Cyan</translation>
+    </message>
+    <message>
+        <source>Cyan/Red</source>
+        <translation>Cyan/Rød</translation>
+    </message>
+    <message>
+        <source>Red/Blue</source>
+        <translation>Rød/Blå</translation>
+    </message>
+    <message>
+        <source>Blue/Red</source>
+        <translation>Blå/Rød</translation>
+    </message>
+    <message>
+        <source>Red/Green</source>
+        <translation>Rød/Grøn</translation>
+    </message>
+    <message>
+        <source>Green/Red</source>
+        <translation>Grøn/Rød</translation>
+    </message>
+    <message>
+        <source>Side-by-side</source>
+        <translation>Side-om-side</translation>
+    </message>
+    <message>
+        <source>Top-Bottom</source>
+        <translation>Top-Bund</translation>
+    </message>
+    <message>
+        <source>Wiggle</source>
+        <translation>Vrikke</translation>
+    </message>
+    <message>
+        <source>Red/Cyan grayscale</source>
+        <translation>Rød/Cyan gråskala</translation>
+    </message>
+    <message>
+        <source>Cyan/Red grayscale</source>
+        <translation>Cyan/Rød gråskala</translation>
+    </message>
+    <message>
+        <source>Red/Blue grayscale</source>
+        <translation>Rød/Blå gråskala</translation>
+    </message>
+    <message>
+        <source>Blue/Red grayscale</source>
+        <translation>Blå/Rød gråskala</translation>
+    </message>
+    <message>
+        <source>Red/Green grayscale</source>
+        <translation>Rød/Grøn gråskala</translation>
+    </message>
+    <message>
+        <source>Green/Red grayscale</source>
+        <translation>Grøn/Rød gråskala</translation>
+    </message>
+</context>
+<context>
+    <name>QGroupBox</name>
+    <message>
+        <source>Team Members</source>
+        <translation>Holdmedlemmer</translation>
+    </message>
+    <message>
+        <source>Fort</source>
+        <translation>Fort</translation>
+    </message>
+    <message>
+        <source>Key binds</source>
+        <translation>Tasteindstillinger</translation>
+    </message>
+    <message>
+        <source>Teams</source>
+        <translation>Hold</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>VÃ¥ben</translation>
+    </message>
+    <message>
+        <source>Audio/Graphic options</source>
+        <translation>Lyd-/Grafikindstillinger</translation>
+    </message>
+    <message>
+        <source>Net game</source>
+        <translation>Netspil</translation>
+    </message>
+    <message>
+        <source>Playing teams</source>
+        <translation>Hold i spil</translation>
+    </message>
+    <message>
+        <source>Game Modifiers</source>
+        <translation>Spilmodifikatorer</translation>
+    </message>
+    <message>
+        <source>Basic Settings</source>
+        <translation>Grundlæggende indstillinger</translation>
+    </message>
+    <message>
+        <source>Team Settings</source>
+        <translation>Holdindstillinger</translation>
+    </message>
+    <message>
+        <source>Misc</source>
+        <translation>Diverse</translation>
+    </message>
+    <message>
+        <source>Schemes and Weapons</source>
+        <translation>Spilsystemer og VÃ¥ben</translation>
+    </message>
+</context>
+<context>
+    <name>QLabel</name>
+    <message>
+        <source>Mines Time</source>
+        <translation>Mine-tid</translation>
+    </message>
+    <message>
+        <source>Mines</source>
+        <translation>Miner</translation>
+    </message>
+    <message>
+        <source>Version</source>
+        <translation>Version</translation>
+    </message>
+    <message>
+        <source>This program is distributed under the GNU General Public License</source>
+        <translation>Dette program distribueres under GNU General Public License</translation>
+    </message>
+    <message>
+        <source>Developers:</source>
+        <translation>Udviklere:</translation>
+    </message>
+    <message>
+        <source>Art:</source>
+        <translation>Grafik:</translation>
+    </message>
+    <message>
+        <source>Sounds:</source>
+        <translation>Lyde:</translation>
+    </message>
+    <message>
+        <source>Translations:</source>
+        <translation>Oversættelser:</translation>
+    </message>
+    <message>
+        <source>Special thanks:</source>
+        <translation>Særlig tak til:</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>VÃ¥ben</translation>
+    </message>
+    <message>
+        <source>Host:</source>
+        <translation>Vært:</translation>
+    </message>
+    <message>
+        <source>Port:</source>
+        <translation>Port:</translation>
+    </message>
+    <message>
+        <source>Net nick</source>
+        <translation>Brugernavn</translation>
+    </message>
+    <message>
+        <source>Resolution</source>
+        <translation>Opløsning</translation>
+    </message>
+    <message>
+        <source>FPS limit</source>
+        <translation>Grænse over antal billeder vist i sekundet</translation>
+    </message>
+    <message>
+        <source>Server name:</source>
+        <translation>Servernavn:</translation>
+    </message>
+    <message>
+        <source>Server port:</source>
+        <translation>Serverport:</translation>
+    </message>
+    <message>
+        <source>Initial sound volume</source>
+        <translation>Lydstyrke til start</translation>
+    </message>
+    <message>
+        <source>Damage Modifier</source>
+        <translation>Skademodifikator</translation>
+    </message>
+    <message>
+        <source>Turn Time</source>
+        <translation>Tur-tid</translation>
+    </message>
+    <message>
+        <source>Initial Health</source>
+        <translation>Liv til start</translation>
+    </message>
+    <message>
+        <source>Sudden Death Timeout</source>
+        <translation>Pludselig Død Timeout</translation>
+    </message>
+    <message>
+        <source>Scheme Name:</source>
+        <translation>Spilsystems Navn:</translation>
+    </message>
+    <message>
+        <source>Crate Drops</source>
+        <translation>Antal Kasser</translation>
+    </message>
+    <message>
+        <source>Game scheme</source>
+        <translation>Spilsystem</translation>
+    </message>
+    <message>
+        <source>% Dud Mines</source>
+        <translation>% Miner er Fusere</translation>
+    </message>
+    <message>
+        <source>Name</source>
+        <translation>Navn</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>Grave</source>
+        <translation>Gravsten</translation>
+    </message>
+    <message>
+        <source>Flag</source>
+        <translation>Flag</translation>
+    </message>
+    <message>
+        <source>Voice</source>
+        <translation>Stemme</translation>
+    </message>
+    <message>
+        <source>Locale</source>
+        <translation>Lokalitet</translation>
+    </message>
+    <message>
+        <source>Restart game to apply</source>
+        <translation>Genstart spil for at anvende</translation>
+    </message>
+    <message>
+        <source>Explosives</source>
+        <translation>Eksplosiver</translation>
+    </message>
+    <message>
+        <source>Tip: </source>
+        <translation>Tip:</translation>
+    </message>
+    <message>
+        <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
+        <translation>Denne udviklerversion er under konstruktion og er ikke nødvendigvis kompatibel med andre versioner af spillet. Nogle funktioner er måske i stykker eller ukomplette. Brug er på eget ansvar!</translation>
+    </message>
+    <message>
+        <source>Quality</source>
+        <translation>Kvalitet</translation>
+    </message>
+    <message>
+        <source>% Health Crates</source>
+        <translation>% Kasser der Helbreder</translation>
+    </message>
+    <message>
+        <source>Health in Crates</source>
+        <translation>Liv i hver kasse der helbreder</translation>
+    </message>
+    <message>
+        <source>Sudden Death Water Rise</source>
+        <translation>Pludselig Død Vandstigning</translation>
+    </message>
+    <message>
+        <source>Sudden Death Health Decrease</source>
+        <translation>Pludselig Død Skade</translation>
+    </message>
+    <message>
+        <source>% Rope Length</source>
+        <translation>% reblængde</translation>
+    </message>
+    <message>
+        <source>Stereo rendering</source>
+        <translation>3D-rendering</translation>
+    </message>
+    <message>
+        <source>Style</source>
+        <translation>Stil</translation>
+    </message>
+    <message>
+        <source>Scheme</source>
+        <translation>Spilsystem</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>Kodeord</translation>
+    </message>
+    <message>
+        <source>% Get Away Time</source>
+        <translation>% Tid til at Løbe Væk</translation>
+    </message>
+    <message>
+        <source>This program is distributed under the GNU General Public License v2</source>
+        <translation>Dette program distribueres under GNU General Public License v2</translation>
+    </message>
+</context>
+<context>
+    <name>QLineEdit</name>
+    <message>
+        <source>unnamed</source>
+        <translation>unavngivet</translation>
+    </message>
+    <message>
+        <source>hedgehog %1</source>
+        <translation>pindsvin %1</translation>
+    </message>
+</context>
+<context>
+    <name>QMainWindow</name>
+    <message>
+        <source>Hedgewars %1</source>
+        <translation>Hedgewars %1</translation>
+    </message>
+</context>
+<context>
+    <name>QMessageBox</name>
+    <message>
+        <source>Network</source>
+        <translation>Netværk</translation>
+    </message>
+    <message>
+        <source>Connection to server is lost</source>
+        <translation>Forbindelse til serveren er gået tabt</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Failed to open data directory:
+%1
+Please check your installation</source>
+        <translation>Det mislykkedes at åbne data mappen:
+%1
+Tjek venligst om spillet er installeret korrekt</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>VÃ¥ben</translation>
+    </message>
+    <message>
+        <source>Can not edit default weapon set</source>
+        <translation>Kan ikke ændre standardvåbensæt</translation>
+    </message>
+    <message>
+        <source>Can not delete default weapon set</source>
+        <translation>Kan ikke slette standardvåbensæt</translation>
+    </message>
+    <message>
+        <source>Really delete this weapon set?</source>
+        <translation>Vil du virkelig slette dette våbensæt?</translation>
+    </message>
+    <message>
+        <source>Can not overwrite default weapon set '%1'!</source>
+        <translation>Kan ikke overskrive standardvåbensættet '%1'!</translation>
+    </message>
+    <message>
+        <source>All file associations have been set.</source>
+        <translation>Alle filtilknytninger er blevet indstillede.</translation>
+    </message>
+    <message>
+        <source>File association failed.</source>
+        <translation>Filtilknytninger mislykkedes.</translation>
+    </message>
+    <message>
+        <source>Teams</source>
+        <translation>Hold</translation>
+    </message>
+    <message>
+        <source>Really delete this team?</source>
+        <translation>Vil du virkelig slette dette hold?</translation>
+    </message>
+    <message>
+        <source>Schemes</source>
+        <translation>Spilsystemer</translation>
+    </message>
+    <message>
+        <source>Can not delete default scheme '%1'!</source>
+        <translation>Kan ikke slette standardspilsystemet '%1'!</translation>
+    </message>
+    <message>
+        <source>Really delete this game scheme?</source>
+        <translation>Vil du virkelig slette dette spilsystem?</translation>
+    </message>
+    <message>
+        <source>Can not delete default weapon set '%1'!</source>
+        <translation>Kan ikke slette standardvåbensættet '%1'!</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Kan ikke oprette mappe %1</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Brugernavn</translation>
+    </message>
+    <message>
+        <source>Please enter your nickname</source>
+        <translation>Indtast venligst dit brugernavn</translation>
+    </message>
+</context>
+<context>
+    <name>QPushButton</name>
+    <message>
+        <source>default</source>
+        <translation>standard</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Annuler</translation>
+    </message>
+    <message>
+        <source>Start server</source>
+        <translation>Start server</translation>
+    </message>
+    <message>
+        <source>Connect</source>
+        <translation>Opretter forbindelse</translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation>Opdater</translation>
+    </message>
+    <message>
+        <source>Specify</source>
+        <translation>Specificer</translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+    <message>
+        <source>Go!</source>
+        <translation>I gang!</translation>
+    </message>
+    <message>
+        <source>Play demo</source>
+        <translation>Afspil demo</translation>
+    </message>
+    <message>
+        <source>Rename</source>
+        <translation>Omdøb</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Slet</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Indlæs</translation>
+    </message>
+    <message>
+        <source>Setup</source>
+        <translation>Indstillinger</translation>
+    </message>
+    <message>
+        <source>Ready</source>
+        <translation>Klar</translation>
+    </message>
+    <message>
+        <source>Random Team</source>
+        <translation>Tilfældige Hold</translation>
+    </message>
+    <message>
+        <source>Associate file extensions</source>
+        <translation>Tilknyt filtyper</translation>
+    </message>
+    <message>
+        <source>more</source>
+        <translation>mere</translation>
+    </message>
+</context>
+<context>
+    <name>QTableWidget</name>
+    <message>
+        <source>Room Name</source>
+        <translation>Navn på Rum</translation>
+    </message>
+    <message>
+        <source>C</source>
+        <translation>C</translation>
+    </message>
+    <message>
+        <source>T</source>
+        <translation>T</translation>
+    </message>
+    <message>
+        <source>Owner</source>
+        <translation>Ejer</translation>
+    </message>
+    <message>
+        <source>Map</source>
+        <translation>Bane</translation>
+    </message>
+    <message>
+        <source>Rules</source>
+        <translation>Regler</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>VÃ¥ben</translation>
+    </message>
+</context>
+<context>
+    <name>SelWeaponWidget</name>
+    <message>
+        <source>Weapon set</source>
+        <translation>Våbensæt</translation>
+    </message>
+    <message>
+        <source>Probabilities</source>
+        <translation>Sandsynligheder</translation>
+    </message>
+    <message>
+        <source>Ammo in boxes</source>
+        <translation>Ammunition i bokse</translation>
+    </message>
+    <message>
+        <source>Delays</source>
+        <translation>Forsinkelser</translation>
+    </message>
+    <message>
+        <source>new</source>
+        <translation>ny</translation>
+    </message>
+    <message>
+        <source>copy of</source>
+        <translation>kopi af</translation>
+    </message>
+</context>
+<context>
+    <name>TCPBase</name>
+    <message>
+        <source>Error</source>
+        <translation>Fejl</translation>
+    </message>
+    <message>
+        <source>Unable to start the server: %1.</source>
+        <translation>Ude af stand til at starte serveren: %1.</translation>
+    </message>
+    <message>
+        <source>Unable to run engine: %1 (</source>
+        <translation>Ude af stand til at starte spilmotoren: %1 (</translation>
+    </message>
+</context>
+<context>
+    <name>ToggleButtonWidget</name>
+    <message>
+        <source>Vampirism</source>
+        <translation>Vampyr</translation>
+    </message>
+    <message>
+        <source>Karma</source>
+        <translation>Karma</translation>
+    </message>
+    <message>
+        <source>Artillery</source>
+        <translation>Artilleri</translation>
+    </message>
+    <message>
+        <source>Fort Mode</source>
+        <translation>Brug Forter</translation>
+    </message>
+    <message>
+        <source>Divide Teams</source>
+        <translation>Opdel Hold</translation>
+    </message>
+    <message>
+        <source>Solid Land</source>
+        <translation>Fastland</translation>
+    </message>
+    <message>
+        <source>Add Border</source>
+        <translation>Tilføj Kant</translation>
+    </message>
+    <message>
+        <source>Low Gravity</source>
+        <translation>Svag Tyngdekraft</translation>
+    </message>
+    <message>
+        <source>Laser Sight</source>
+        <translation>Lasersigte</translation>
+    </message>
+    <message>
+        <source>Invulnerable</source>
+        <translation>Udødelighed</translation>
+    </message>
+    <message>
+        <source>Add Mines</source>
+        <translation>Tilføj Miner</translation>
+    </message>
+    <message>
+        <source>Random Order</source>
+        <translation>Tilfældig Rækkefølge</translation>
+    </message>
+    <message>
+        <source>King</source>
+        <translation>Konge</translation>
+    </message>
+    <message>
+        <source>Place Hedgehogs</source>
+        <translation>Placer Pindsvin</translation>
+    </message>
+    <message>
+        <source>Clan Shares Ammo</source>
+        <translation>Klan Deler Ammunition</translation>
+    </message>
+    <message>
+        <source>Disable Girders</source>
+        <translation>Deaktiver Bærebjælker</translation>
+    </message>
+    <message>
+        <source>Disable Land Objects</source>
+        <translation>Deaktiver Overfladeobjekter</translation>
+    </message>
+    <message>
+        <source>AI Survival Mode</source>
+        <translation>AI Overlevelse</translation>
+    </message>
+    <message>
+        <source>Reset Health</source>
+        <translation>Nulstil Liv</translation>
+    </message>
+    <message>
+        <source>Unlimited Attacks</source>
+        <translation>Uendelige Angreb</translation>
+    </message>
+    <message>
+        <source>Reset Weapons</source>
+        <translation>Nulstil VÃ¥ben</translation>
+    </message>
+    <message>
+        <source>Per Hedgehog Ammo</source>
+        <translation>Indivuel Ammunition per Pindsvin</translation>
+    </message>
+    <message>
+        <source>Disable Wind</source>
+        <translation>Deaktiver Vind</translation>
+    </message>
+    <message>
+        <source>More Wind</source>
+        <translation>Mere Vind</translation>
+    </message>
+    <message>
+        <source>Tag Team</source>
+        <translation>Tagteam</translation>
+    </message>
+    <message>
+        <source>Add Bottom Border</source>
+        <translation>Tilføj Kant i Bunden</translation>
+    </message>
+</context>
+<context>
+    <name>binds</name>
+    <message>
+        <source>up</source>
+        <translation>op</translation>
+    </message>
+    <message>
+        <source>left</source>
+        <translation>venstre</translation>
+    </message>
+    <message>
+        <source>right</source>
+        <translation>højre</translation>
+    </message>
+    <message>
+        <source>down</source>
+        <translation>ned</translation>
+    </message>
+    <message>
+        <source>attack</source>
+        <translation>angrib</translation>
+    </message>
+    <message>
+        <source>precise aim</source>
+        <translation>sigt præcist</translation>
+    </message>
+    <message>
+        <source>put</source>
+        <translation>læg</translation>
+    </message>
+    <message>
+        <source>switch</source>
+        <translation>skift</translation>
+    </message>
+    <message>
+        <source>find hedgehog</source>
+        <translation>find pindsvin</translation>
+    </message>
+    <message>
+        <source>ammo menu</source>
+        <translation>ammunitionsmenu</translation>
+    </message>
+    <message>
+        <source>slot 1</source>
+        <translation>Ã¥bning 1</translation>
+    </message>
+    <message>
+        <source>slot 2</source>
+        <translation>Ã¥bning 2</translation>
+    </message>
+    <message>
+        <source>slot 3</source>
+        <translation>Ã¥bning 3</translation>
+    </message>
+    <message>
+        <source>slot 4</source>
+        <translation>Ã¥bning 4</translation>
+    </message>
+    <message>
+        <source>slot 5</source>
+        <translation>Ã¥bning 5</translation>
+    </message>
+    <message>
+        <source>slot 6</source>
+        <translation>Ã¥bning 6</translation>
+    </message>
+    <message>
+        <source>slot 7</source>
+        <translation>Ã¥bning 7</translation>
+    </message>
+    <message>
+        <source>slot 8</source>
+        <translation>Ã¥bning 8</translation>
+    </message>
+    <message>
+        <source>slot 9</source>
+        <translation>Ã¥bning 9</translation>
+    </message>
+    <message>
+        <source>timer 1 sec</source>
+        <translation>timer 1 sekund</translation>
+    </message>
+    <message>
+        <source>timer 2 sec</source>
+        <translation>timer 2 sekunder</translation>
+    </message>
+    <message>
+        <source>timer 3 sec</source>
+        <translation>timer 3 sekunder</translation>
+    </message>
+    <message>
+        <source>timer 4 sec</source>
+        <translation>timer 4 sekunder</translation>
+    </message>
+    <message>
+        <source>timer 5 sec</source>
+        <translation>timer 5 sekunder</translation>
+    </message>
+    <message>
+        <source>chat</source>
+        <translation>chat</translation>
+    </message>
+    <message>
+        <source>chat history</source>
+        <translation>chathistorie</translation>
+    </message>
+    <message>
+        <source>pause</source>
+        <translation>pause</translation>
+    </message>
+    <message>
+        <source>confirmation</source>
+        <translation>bekræftelse</translation>
+    </message>
+    <message>
+        <source>volume down</source>
+        <translation>lydstyrke ned</translation>
+    </message>
+    <message>
+        <source>volume up</source>
+        <translation>lydstyrke op</translation>
+    </message>
+    <message>
+        <source>change mode</source>
+        <translation>ændre tilstand</translation>
+    </message>
+    <message>
+        <source>capture</source>
+        <translation>fang</translation>
+    </message>
+    <message>
+        <source>hedgehogs
+info</source>
+        <translation>pindsvin
+info</translation>
+    </message>
+    <message>
+        <source>quit</source>
+        <translation>afslut</translation>
+    </message>
+    <message>
+        <source>zoom in</source>
+        <translation>zoom ind</translation>
+    </message>
+    <message>
+        <source>zoom out</source>
+        <translation>zoom ud</translation>
+    </message>
+    <message>
+        <source>reset zoom</source>
+        <translation>nulstil zoom</translation>
+    </message>
+    <message>
+        <source>long jump</source>
+        <translation>langt hop</translation>
+    </message>
+    <message>
+        <source>high jump</source>
+        <translation>højt hop</translation>
+    </message>
+    <message>
+        <source>slot 10</source>
+        <translation>Ã¥bning 10</translation>
+    </message>
+</context>
+<context>
+    <name>binds (categories)</name>
+    <message>
+        <source>Basic controls</source>
+        <translation>Grundlæggende styring</translation>
+    </message>
+    <message>
+        <source>Weapon controls</source>
+        <translation>VÃ¥benstyring</translation>
+    </message>
+    <message>
+        <source>Camera and cursor controls</source>
+        <translation>Kamera og musestyring</translation>
+    </message>
+    <message>
+        <source>Other</source>
+        <translation>Andet</translation>
+    </message>
+</context>
+<context>
+    <name>binds (descriptions)</name>
+    <message>
+        <source>Move your hogs and aim:</source>
+        <translation>Bevæg dine pindsvin og sigt:</translation>
+    </message>
+    <message>
+        <source>Traverse gaps and obstacles by jumping:</source>
+        <translation>Hop over sprækker og forhinderinger:</translation>
+    </message>
+    <message>
+        <source>Fire your selected weapon or trigger an utility item:</source>
+        <translation>Affyr dit valgte våben eller udløs en hjælpeting:</translation>
+    </message>
+    <message>
+        <source>Pick a weapon or a target location under the cursor:</source>
+        <translation>Vælg et våben eller en målplacering under musemarkøren:</translation>
+    </message>
+    <message>
+        <source>Switch your currently active hog (if possible):</source>
+        <translation>Skift til et anden pindsvin (om muligt):</translation>
+    </message>
+    <message>
+        <source>Pick a weapon or utility item:</source>
+        <translation>Vælg et våben eller en hjælpeting:</translation>
+    </message>
+    <message>
+        <source>Set the timer on bombs and timed weapons:</source>
+        <translation>Indstil timeren på bomber eller tidsafhængige våben:</translation>
+    </message>
+    <message>
+        <source>Move the camera to the active hog:</source>
+        <translation>Flyt kameraet hen til det aktive pindsvin:</translation>
+    </message>
+    <message>
+        <source>Move the cursor or camera without using the mouse:</source>
+        <translation>Flyt musemarkøren eller kameraet uden at bruge musen:</translation>
+    </message>
+    <message>
+        <source>Modify the camera's zoom level:</source>
+        <translation>Ændr på kameraets zoom-niveau:</translation>
+    </message>
+    <message>
+        <source>Talk to your team or all participants:</source>
+        <translation>Tal til dit hold eller alle deltagere:</translation>
+    </message>
+    <message>
+        <source>Pause, continue or leave your game:</source>
+        <translation>Pause, fortsæt eller forlad spillet:</translation>
+    </message>
+    <message>
+        <source>Modify the game's volume while playing:</source>
+        <translation>Ændr på lydstyrken mens du spiller:</translation>
+    </message>
+    <message>
+        <source>Toggle fullscreen mode:</source>
+        <translation>Skift fra og til fuldskærm:</translation>
+    </message>
+    <message>
+        <source>Take a screenshot:</source>
+        <translation>Tag et skærmbillede:</translation>
+    </message>
+    <message>
+        <source>Toggle labels above hedgehogs:</source>
+        <translation>Slå mærkater over pindsvin fra og til:</translation>
+    </message>
+</context>
+<context>
+    <name>binds (keys)</name>
+    <message>
+        <source>Axis</source>
+        <translation>Akse</translation>
+    </message>
+    <message>
+        <source>(Up)</source>
+        <translation>(Op)</translation>
+    </message>
+    <message>
+        <source>(Down)</source>
+        <translation>(Ned)</translation>
+    </message>
+    <message>
+        <source>Hat</source>
+        <translation>Hat</translation>
+    </message>
+    <message>
+        <source>(Left)</source>
+        <translation>(Venstre)</translation>
+    </message>
+    <message>
+        <source>(Right)</source>
+        <translation>(Højre)</translation>
+    </message>
+    <message>
+        <source>Button</source>
+        <translation>Knap</translation>
+    </message>
+    <message>
+        <source>Keyboard</source>
+        <translation>Tastatur</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Slet</translation>
+    </message>
+    <message>
+        <source>Mouse: Left button</source>
+        <translation>Mus: Venstre knap</translation>
+    </message>
+    <message>
+        <source>Mouse: Middle button</source>
+        <translation>Mus: Midterknap</translation>
+    </message>
+    <message>
+        <source>Mouse: Right button</source>
+        <translation>Mus: Højre knap</translation>
+    </message>
+    <message>
+        <source>Mouse: Wheel up</source>
+        <translation>Mus: Hjul opad</translation>
+    </message>
+    <message>
+        <source>Mouse: Wheel down</source>
+        <translation>Mus: Hjul nedad</translation>
+    </message>
+    <message>
+        <source>Backspace</source>
+        <translation>Tilbageknap</translation>
+    </message>
+    <message>
+        <source>Tab</source>
+        <translation>Tab-knap</translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation>Ryd</translation>
+    </message>
+    <message>
+        <source>Return</source>
+        <translation>Enter</translation>
+    </message>
+    <message>
+        <source>Pause</source>
+        <translation>Pause</translation>
+    </message>
+    <message>
+        <source>Escape</source>
+        <translation>Escape</translation>
+    </message>
+    <message>
+        <source>Space</source>
+        <translation>Mellemrumstast</translation>
+    </message>
+    <message>
+        <source>Numpad 0</source>
+        <translation>Numpad 0</translation>
+    </message>
+    <message>
+        <source>Numpad 1</source>
+        <translation>Numpad 1</translation>
+    </message>
+    <message>
+        <source>Numpad 2</source>
+        <translation>Numpad 2</translation>
+    </message>
+    <message>
+        <source>Numpad 3</source>
+        <translation>Numpad 3</translation>
+    </message>
+    <message>
+        <source>Numpad 4</source>
+        <translation>Numpad 4</translation>
+    </message>
+    <message>
+        <source>Numpad 5</source>
+        <translation>Numpad 5</translation>
+    </message>
+    <message>
+        <source>Numpad 6</source>
+        <translation>Numpad 6</translation>
+    </message>
+    <message>
+        <source>Numpad 7</source>
+        <translation>Numpad 7</translation>
+    </message>
+    <message>
+        <source>Numpad 8</source>
+        <translation>Numpad 8</translation>
+    </message>
+    <message>
+        <source>Numpad 9</source>
+        <translation>Numpad 9</translation>
+    </message>
+    <message>
+        <source>Numpad .</source>
+        <translation>Numpad .</translation>
+    </message>
+    <message>
+        <source>Numpad /</source>
+        <translation>Numpad /</translation>
+    </message>
+    <message>
+        <source>Numpad *</source>
+        <translation>Numpad *</translation>
+    </message>
+    <message>
+        <source>Numpad -</source>
+        <translation>Numpad -</translation>
+    </message>
+    <message>
+        <source>Numpad +</source>
+        <translation>Numpad +</translation>
+    </message>
+    <message>
+        <source>Enter</source>
+        <translation>Enter</translation>
+    </message>
+    <message>
+        <source>Equals</source>
+        <translation>Lig</translation>
+    </message>
+    <message>
+        <source>Up</source>
+        <translation>Op</translation>
+    </message>
+    <message>
+        <source>Down</source>
+        <translation>Ned</translation>
+    </message>
+    <message>
+        <source>Right</source>
+        <translation>Højre</translation>
+    </message>
+    <message>
+        <source>Left</source>
+        <translation>Venstre</translation>
+    </message>
+    <message>
+        <source>Insert</source>
+        <translation>Insert</translation>
+    </message>
+    <message>
+        <source>Home</source>
+        <translation>Home</translation>
+    </message>
+    <message>
+        <source>End</source>
+        <translation>End</translation>
+    </message>
+    <message>
+        <source>Page up</source>
+        <translation>Page up</translation>
+    </message>
+    <message>
+        <source>Page down</source>
+        <translation>Page down</translation>
+    </message>
+    <message>
+        <source>Num lock</source>
+        <translation>Num lock</translation>
+    </message>
+    <message>
+        <source>Caps lock</source>
+        <translation>Caps lock</translation>
+    </message>
+    <message>
+        <source>Scroll lock</source>
+        <translation>Scroll lock</translation>
+    </message>
+    <message>
+        <source>Right shift</source>
+        <translation>Højre shift</translation>
+    </message>
+    <message>
+        <source>Left shift</source>
+        <translation>Venstre shift</translation>
+    </message>
+    <message>
+        <source>Right ctrl</source>
+        <translation>Højre ctrl</translation>
+    </message>
+    <message>
+        <source>Left ctrl</source>
+        <translation>Venstre ctrl</translation>
+    </message>
+    <message>
+        <source>Right alt</source>
+        <translation>Højre alt</translation>
+    </message>
+    <message>
+        <source>Left alt</source>
+        <translation>Venstre alt</translation>
+    </message>
+    <message>
+        <source>Right meta</source>
+        <translation>Højre meta</translation>
+    </message>
+    <message>
+        <source>Left meta</source>
+        <translation>Venstre meta</translation>
+    </message>
+    <message>
+        <source>A button</source>
+        <translation>A-knap</translation>
+    </message>
+    <message>
+        <source>B button</source>
+        <translation>B-knap</translation>
+    </message>
+    <message>
+        <source>X button</source>
+        <translation>X-knap</translation>
+    </message>
+    <message>
+        <source>Y button</source>
+        <translation>Y-knap</translation>
+    </message>
+    <message>
+        <source>LB button</source>
+        <translation>LB-knap</translation>
+    </message>
+    <message>
+        <source>RB button</source>
+        <translation>RB-knap</translation>
+    </message>
+    <message>
+        <source>Back button</source>
+        <translation>Back-knap</translation>
+    </message>
+    <message>
+        <source>Start button</source>
+        <translation>Start-knap</translation>
+    </message>
+    <message>
+        <source>Left stick</source>
+        <translation>Venstre stick</translation>
+    </message>
+    <message>
+        <source>Right stick</source>
+        <translation>Højre stick</translation>
+    </message>
+    <message>
+        <source>Left stick (Right)</source>
+        <translation>Venstre stick (Højre)</translation>
+    </message>
+    <message>
+        <source>Left stick (Left)</source>
+        <translation>Venstre stick (Venstre)</translation>
+    </message>
+    <message>
+        <source>Left stick (Down)</source>
+        <translation>Venstre stick (Ned)</translation>
+    </message>
+    <message>
+        <source>Left stick (Up)</source>
+        <translation>Venstre stick (Op)</translation>
+    </message>
+    <message>
+        <source>Left trigger</source>
+        <translation>Venstre affyringsknap</translation>
+    </message>
+    <message>
+        <source>Right trigger</source>
+        <translation>Højre affyringsknap</translation>
+    </message>
+    <message>
+        <source>Right stick (Down)</source>
+        <translation>Højre stick (Ned)</translation>
+    </message>
+    <message>
+        <source>Right stick (Up)</source>
+        <translation>Højre stick (Op)</translation>
+    </message>
+    <message>
+        <source>Right stick (Right)</source>
+        <translation>Højre stick (Højre)</translation>
+    </message>
+    <message>
+        <source>Right stick (Left)</source>
+        <translation>Højre stick (Venstre)</translation>
+    </message>
+    <message>
+        <source>DPad</source>
+        <translation>DPad</translation>
+    </message>
+</context>
+</TS>
diff --git a/share/hedgewars/Data/Locale/hedgewars_de.ts b/share/hedgewars/Data/Locale/hedgewars_de.ts
index 44f8894..6a841d7 100644
--- a/share/hedgewars/Data/Locale/hedgewars_de.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_de.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="de">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation>Zurück</translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Dateifehler</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Datei '%1' konnte nicht für Schreibzugriff geöffnet werden.</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Datei '%1' konnte nicht gelese werden.</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Waffenzusammenstellung bearbeiten</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Ungültige Waffenzusammenstellung</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Spielprofile bearbeiten</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 wurde aus deiner Ignorierliste entfernt</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 wurde in deine Ignorierliste aufgenommen</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 wurde aus deiner Freundesliste entfernt</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 wurde in deine Freundesliste aufgenommen</translation>
+        <source>Do you really want to quit?</source>
+        <translation>Willst du wirklich beenden?</translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation>%1 wurde aus deiner Ignorierliste entfernt</translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation>%1 ist kein gültiger Befehl!</translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation>%1 wird rausgeworfen ...</translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Server konnte nicht gestartet werden</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Datei %1 konnte nicht gespeichert werden</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">Neu</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Bitte wähle einen Eintrag aus der obigen Liste</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation></translation>
     </message>
@@ -188,10 +139,6 @@
         <translation>Spiel abgebrochen</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Passwort</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -212,19 +159,14 @@ in den Spieloptionen:</translation>
         <translation>Spitzname</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation>Jemand verwendet
-deinen Spiznamen %1 
-bereits auf dem Server.
-Bitte wähle einen anderen Spitznamen:</translation>
-    </message>
-    <message>
         <source>No nickname supplied.</source>
         <translation>Kein Spitznahme angegeben.</translation>
     </message>
+    <message>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
+        <translation>Dein Spitzname '%1' ist bereits in Verwendung. Bitte wähle einen anderen Spitznamen:</translation>
+    </message>
 </context>
 <context>
     <name>HWGame</name>
@@ -276,10 +218,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Verrückt</translation>
     </message>
     <message>
-        <source>Tunnel size</source>
-        <translation type="obsolete">Tunnelgröße</translation>
-    </message>
-    <message>
         <source>Type</source>
         <translation>Typ</translation>
     </message>
@@ -354,21 +292,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Du wurdest hinausgeworfen</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Passwort</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Dein Spitzname '%1' wurde
-auf Hedgewars.org registriert.
-
-Bitte gib dein Passwort ein oder
-wähle einen anderen Spitznamen:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 hat den Raum betreten</translation>
     </message>
@@ -385,33 +308,34 @@ wähle einen anderen Spitznamen:</translation>
         <translation>%1 *** %2 ist gegangen</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Dein Spitzname '%1' wurde
-auf Hedgewars.org registriert.
-
-Bitte gib dein Passwort ein oder
-wähle einen anderen Spitznamen:</translation>
+        <source>User quit</source>
+        <translation>Benutzer ist gegangen</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Spitzname</translation>
+        <source>Remote host has closed connection</source>
+        <translation>Die Verbindung wurde von der anderen Seite geschlossen.</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Jemand verwendet
-deinen Spiznamen %1 
-bereits auf dem Server.
-Bitte wähle einen anderen Spitznamen:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation>Der Server ist zu alt. Verbindung wird beendet.</translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
-        <translation>Benutzer ist gegangen</translation>
+        <source>Password</source>
+        <translation>Passwort</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation>Video hochladen</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Hochladen</translation>
     </message>
 </context>
 <context>
@@ -422,16 +346,28 @@ Bitte wähle einen anderen Spitznamen:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation>Dauer: %1m %2s</translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Servernachricht:</translation>
+        <source>Video: %1x%2, </source>
+        <translation>Video: %1x%2, </translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Servernachricht festlegen</translation>
+        <source>%1 fps, </source>
+        <translation>%1 fps, </translation>
     </message>
     <message>
+        <source>Audio: </source>
+        <translation>Audio: </translation>
+    </message>
+</context>
+<context>
+    <name>PageAdmin</name>
+    <message>
         <source>Clear Accounts Cache</source>
         <translation>Zwischenspeicher leeren</translation>
     </message>
@@ -466,10 +402,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <source>Connecting...</source>
         <translation>Verbinde ...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Abbrechen</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -505,6 +437,10 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <source>All files</source>
         <translation>Alle Dateien</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation>Radierer</translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -520,24 +456,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Der Preis für den besten Schuss geht an <b>%1</b> mit <b>%2</b> Punkten.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Der blutigste Kämpfer ist <b>%1</b> mit <b>%2</b> Opfer in einer Runde.</p></numerusform>
-            <numerusform><p>Der blutigste Kämpfer ist <b>%1</b> mit <b>%2</b> Opfern in einer Runde.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Insgesamt fand <b>%1</b> Igel ein trauriges Ende in dieser Runde.</p></numerusform>
-            <numerusform><p>Insgesamt fanden <b>%1</b> Igel ein trauriges Ende in dieser Runde.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Details</translation>
     </message>
@@ -574,10 +492,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
             <numerusform>(%1 Opfer)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 Kills)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -608,15 +522,14 @@ Bitte wähle einen anderen Spitznamen:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
+    <name>PageInfo</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Lokales Spiel</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Netzwerkspiel</translation>
+        <source>Open the snapshot folder</source>
+        <translation>Schnappschuss-Ordner öffnen</translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -633,11 +546,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Wenn du dir nicht sicher bist was du tun sollst und keine Munition verschwenden willst, überspringe eine Runde. Aber lass nicht zu viele Runden verstreichen, denn später kommt es zum Sudden Death!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Du willst Seile sparen? Lass das Seil in der Luft los und schieß noch einmal. Solange du nicht den Boden berührst kannst du das Seil wiederverwenden ohne Munition zu verlieren!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Wenn du andere daran hindern willst deinen bevorzugten Nickname auf dem offiziellen Server zu nutzen, registriere dich auf http://www.hedgewars.org/.</translation>
@@ -713,11 +621,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Spezielle Spielmodi wie 'Vampirismus' oder 'Karma' erlauben es dir völlig neue Taktiken zu entwickeln. Probier sie einem eigenen Spiel aus!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Die Windowsversion von Hedgewars unterstützt Xfire. Füge Hedgewars zu der Spieleliste hinzu, sodass deine Freunde sehen können wann du spielst.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Du solltest nie Hedgewars auf einem Computer installieren, der dir nicht gehört (Schule, Universität, Arbeit, etc.). Frag bitte stattdessen die verantwortliche Person!</translation>
@@ -783,11 +686,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Der Piano-Angriff ist der verheerenste Luftangriff. Du verlierst allerdings den Igel der ihn vollführt, er hat also auch seine Schattenseite.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Die zielsuchende Biene ist schwierig in der Handhabung. Ihr Wendekreis hängt von ihrer Geschwindigkeit ab, also versuche nicht die volle Kraft zu benutzen.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Haftminen sind perfekte Werkzeuge um Kettenreaktionen auszulösen oder Igel in die gewünschte Richtung zu lenken ... oder ins Wasser.</translation>
@@ -813,11 +711,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Der Flammenwerfer ist zwar eine Waffe, kann aber auch zum Tunnelgraben genutzt werden.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Benutze den Molotov-Cocktail um kurzzeitig Igel daran zu hindern Tunnel zu durchqueren oder Plattformen zu erklimmen.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Du willst wissen wer hinter Hedgewars steckt? Klicke auf das Hedgewars-Logo im Hauptmenü um die Credits zu sehen.</translation>
@@ -848,11 +741,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Du findest deine Hedgewars Konfigurationsdateien unter "Eigene Dateien\Hedgewars". Erstelle Backups oder kopiere deine Dateien, aber editiere sie besser nicht selbst.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Du findest die Hedgewars Konfigurationsdateien in deinem Home-Verzeichnis. Erstelle Backups oder kopiere deine Dateien, aber editiere sie besser nicht selbst.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation>Du kannst Dateien wie Speicherstände oder Demos mit Hedgewars verknüpfen um sie so direkt mit deinem Datei- oder Internetbrowser zu öffnen.</translation>
@@ -891,6 +779,46 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <source>Downloadable Content</source>
         <translation>Herunterladbare Inhalte</translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation>Lokales Spiel</translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation>Spiele auf einem einzelnen PC</translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation>Netzwerkspiel</translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation>Spiele über ein Netwerk</translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation>Lies wer hinter dem Hedgewars-Projekt steckt</translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation>Greife auf von Benutzern ergestellte Inhalte zu, herunterladbar von unserer Webseite</translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation>Spiel verlassen</translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation>Verwalte vom Spiel aufgenommene Videos</translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation>Bearbeite Spieleinstellungen</translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -900,33 +828,18 @@ Bitte wähle einen anderen Spitznamen:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Bitte wähle einen Eintrag aus der Liste aus</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Steuerung</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Bitte einen Raumnamen eingeben</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation>Herunterladbare Inhalte</translation>
     </message>
 </context>
 <context>
@@ -939,6 +852,14 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <source>Official server</source>
         <translation>Offizieller Server</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation>Treffe hunderte Spieler online!</translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation>Erstelle einen eigenen Spiel-Server oder verbinde dich zu einem bestehenden Server im Netzwerk.</translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -955,18 +876,6 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <translation>Team löschen</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Neue Waffenzusammenstellung</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Waffenzusammenstellung bearbeiten</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Waffenzusammenstellung löschen</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Du kannst keine Teams bei der Team-Auswahl ändern. Gehe zum Hauptmenü zurück um Teams hinzuzufügen, zu editieren oder zu löschen.</translation>
     </message>
@@ -994,129 +903,79 @@ Bitte wähle einen anderen Spitznamen:</translation>
         <source>Delete weapon set</source>
         <translation>Waffenprofil löschen</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Umbenennen</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>Neuer Dateiname:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Datei kann nicht umbenannt werden in</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Datei kann nicht gelöscht werden</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Bitte einen Eintrag aus der Liste auswählen</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
-    <message>
-        <source>Create</source>
-        <translation>Erstellen</translation>
+        <source>General</source>
+        <translation>Allgemein</translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Betreten</translation>
+        <source>Advanced</source>
+        <translation>Erweitert</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Aktualisieren</translation>
+        <source>Reset to default colors</source>
+        <translation>Auf Standard-Farben zurücksetzen</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
+        <source>Proxy host</source>
+        <translation>Host</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Proxy port</source>
+        <translation>Port</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Verwalten</translation>
+        <source>Proxy login</source>
+        <translation>Login</translation>
     </message>
     <message>
-        <source>Room Name:</source>
-        <translation>Raumname:</translation>
+        <source>Proxy password</source>
+        <translation>Passwort</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Dieses Spiel wartet im Augenblick auf Mitspieler.
-Du kannst beitreten und mitspielen oder zusehen, sobald das Spiel beginnt.</translation>
+        <source>No proxy</source>
+        <translation>Kein Proxy</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Dieses Spiel läuft gerade.
-Du kannst beitreten und zusehen oder du wartest bis die aktuelle Runde zu Ende ist.</translation>
+        <source>Socks5 proxy</source>
+        <translation>Socks5-Proxy</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 ist der Besitzer dieses Raums und kann die Einstellungen anpassen und die Runde starten.</translation>
+        <source>HTTP proxy</source>
+        <translation>HTTP-Proxy</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Zufallskarte</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Spiele können  auf vorgefertigten oder zufälligen Karten stattfinden.</translation>
+        <source>System proxy settings</source>
+        <translation>Betriebsystem Proxy-Einstellungen</translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Spielprofile geben allgemeine Dinge einer Runde vor, etwa die Rundenzeit, Sudden Death oder Vampirismus.</translation>
+        <source>Rename dialog</source>
+        <translation>Umbenennen</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Waffenzusammenstellungen bestimmen, welche Waffen wann und in welchen Mengen zur Verfügung stehen.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Es befindet sich %1 Spieler in diesem Raum.</numerusform>
-            <numerusform>Es befinden sich %1 Spieler in diesem Raum.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Es nimmt %1 Team in diesem Raum teil.</numerusform>
-            <numerusform>Es nehmen %1 Teams in diesem Raum teil.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Neuer Dateiname:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Bitte einen Raumnamen eingeben</translation>
+        <source>Create</source>
+        <translation>Erstellen</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Bitte einen Raum aus der Liste auswählen</translation>
+        <source>Join</source>
+        <translation>Betreten</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Zufallslabyrinth</translation>
+        <source>Admin features</source>
+        <translation>Verwalten</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Status:</translation>
+        <source>Room Name:</source>
+        <translation>Raumname:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1134,16 +993,6 @@ Du kannst beitreten und zusehen oder du wartest bis die aktuelle Runde zu Ende i
         <source>Clear</source>
         <translation>Leeren</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Warnung</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Das Spiel in das du beitreten möchtest hat bereits begonnen.
-Willst du trotzdem den Raum betreten?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1163,10 +1012,6 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>Löschen</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Zufällige Minen Positionen</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>80% des ausgeteilten Schadens werden in Lebenspunkte gewandelt</translation>
     </message>
@@ -1301,47 +1146,105 @@ Willst du trotzdem den Raum betreten?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Einfaches Spiel (Eine schnelle Runde gegen den PC, Einstellungen werden automatisch gewählt)</translation>
+        <source>Simple Game</source>
+        <translation>Einfaches Spiel</translation>
+    </message>
+    <message>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Spiele ein schnelles Spiel gegen den Computer - mit Zufallseinstellungen</translation>
+    </message>
+    <message>
+        <source>Multiplayer</source>
+        <translation>Multiplayer</translation>
+    </message>
+    <message>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Spiele gegen deine Freunde oder Computer-Teams.</translation>
+    </message>
+    <message>
+        <source>Campaign Mode</source>
+        <translation>Kampagnenmodus</translation>
+    </message>
+    <message>
+        <source>Training Mode</source>
+        <translation>Trainingsmodus</translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Verbessere deine Fähigkeiten in verschiedenen Trainingsmissionen</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Mehrspieler (Spiele gegen deine Freunde oder Computergegner)</translation>
+        <source>Demos</source>
+        <translation>Demos</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Trainingsmodus (Verbessere dein Können in verschiedenen Trainingsmissionen). IN ENTWICKLUNG</translation>
+        <source>Watch recorded demos</source>
+        <translation>Sehe aufgenommene Demos an</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Laden</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
+        <translation>Lade ein vormals gespeichtes Spiel</translation>
+    </message>
+</context>
+<context>
+    <name>PageTraining</name>
+    <message>
+        <source>No description available</source>
+        <translation>Keine Beschreibung verfügbar</translation>
+    </message>
+    <message>
+        <source>Select a mission!</source>
+        <translation>Wähle eine Mission!</translation>
+    </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation>Wähle eine Mission oder ein Training</translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation>Auf in den Kampf!</translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation>Name</translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Wiedergabe einer gespeicherten Demo)</translation>
+        <source>Size</source>
+        <translation>Größe</translation>
     </message>
-    <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Laden (eines vorher gespeicherten Spiels)</translation>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 Byte</numerusform>
+            <numerusform>%1 Bytes</numerusform>
+        </translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampagnenmodus (...) IN ENTWICKLUNG</translation>
+        <source>(in progress...)</source>
+        <translation>(in Bearbeitung...)</translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
+        <source>Date: </source>
+        <translation>Datum: </translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation>Trainingsmodus (Verbessere deine Fähigkeiten in verschiedenen Trainingsmissionen)</translation>
+        <source>Size: </source>
+        <translation>Größe: </translation>
     </message>
-</context>
-<context>
-    <name>PageTraining</name>
     <message>
-        <source>No description available</source>
-        <translation>Keine Beschreibung verfügbar</translation>
+        <source>encoding</source>
+        <translation>encoden</translation>
     </message>
     <message>
-        <source>Select a mission!</source>
-        <translation>Wähle eine Mission!</translation>
+        <source>uploading</source>
+        <translation>hochladen</translation>
     </message>
 </context>
 <context>
@@ -1430,10 +1333,6 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>Beim Start nach neuen Versionen suchen</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Niedrige Qualität</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Kurzinfos für Waffen anzeigen</translation>
     </message>
@@ -1449,6 +1348,26 @@ Willst du trotzdem den Raum betreten?</translation>
         <source>Frontend effects</source>
         <translation>Animationen im Frontend</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation>Passwort speichern</translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation>Kontoname und Passwort speichern</translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation>Video ist privat</translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation>Audio aufnehmen</translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation>Spielauflösung verwenden</translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1493,10 +1412,6 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>Im Spiel</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Standard</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>Handgezeichnete Karte</translation>
     </message>
@@ -1588,10 +1503,6 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>Audio-/Grafik-Einstellungen</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Waffen</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Netzwerkspiel</translation>
     </message>
@@ -1619,14 +1530,34 @@ Willst du trotzdem den Raum betreten?</translation>
         <source>Schemes and Weapons</source>
         <translation>Spielprofile und Waffen</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation>Benutzerdefinierte Farben</translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation>Verschiedenes</translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation>Videoaufnahmeoptionen</translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation>Videos</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Beschreibung</translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation>Proxy-Einstellungen</translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Dieses Programm ist unter der GNU General Public License veröffentlicht</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Entwickler:</translation>
     </message>
@@ -1663,10 +1594,6 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>FPS-Limit</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Spitzname im Netz</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Servername:</translation>
     </message>
@@ -1751,20 +1678,10 @@ Willst du trotzdem den Raum betreten?</translation>
         <translation>Sprache</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Spiel neu starten, um Änderungen zu übernehmen</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Pulverfässer</translation>
     </message>
     <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Diese SVN-Kopie ist noch in Entwicklung und sie ist mit anderen Versionen vielleicht nicht kompatibel.
-Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung auf eigene Gefahr!</translation>
-    </message>
-    <message>
         <source>Tip: </source>
         <translation>Tipp:</translation>
     </message>
@@ -1801,10 +1718,6 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
         <translation>Stereo-Rendering</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Spieloptionen</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Stil</translation>
     </message>
@@ -1813,10 +1726,6 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
         <translation>Spielprofil</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Passwort</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% Rückzugszeit</translation>
     </message>
@@ -1824,6 +1733,70 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation>Dieses Spiel wird unter den Bedingungen der GNU General Public License v2 verbreitet</translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation>Derzeit sind Videos in Bearbeitung.
+Verlassen wird diese abbrechen.
+Willst du wirklich verlassen?</translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation>Bitte gib entwerder deinen YouTube-Kontonamen oder die entsprechende eMail-Adresse des Google-Kontos an.</translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation>Kontoname (oder eMail)</translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation>Passwort</translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation>Video-Titel</translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation>Video-Beschreibung</translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation>Tags (durch Beistriche getrennt)</translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation>Zusammenfassung   </translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Beschreibung</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Spitzname</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation>Format</translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation>Audio-Codec</translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation>Video-Codec</translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation>Bildrate</translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation>Bitrate (Kbps)</translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1835,6 +1808,10 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
         <source>hedgehog %1</source>
         <translation>Igel %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation>anonym</translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1846,10 +1823,6 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Netzwerk</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Verbindung zum Server wurde unterbrochen</translation>
     </message>
@@ -1858,81 +1831,228 @@ Einige Dinge könnten nicht funktionieren oder unvollständig sein. Benutzung au
         <translation>Fehler</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Dateizuordnung fehlgeschlagen.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation>Bitte fülle alle Felder aus</translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation>Fehler während Authentifizierung auf google.com:
+</translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation>Login oder Passwort inkorrekt</translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation>Fehler bei Senden von Meta-Daten zu youtube.com:
+</translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation>Teams - Bist du dir sicher?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation>Willst du das Team '%1' wirklich löschen?</translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation>Standard-Profil '%1' kann nicht gelöscht werden!</translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation>Bitte wähle eine Aufnahme in der Liste aus</translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation>Konnte Server nicht starten</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation>Hedgewars - Fehler</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation>Hedgewars - Erfolg</translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation>Alle Dateizuordnungen wurden gesetzt</translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation>Hedgewars - Fehler</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Verzeichnis %1 konnte nicht angelegt werden</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Das Verzeichnis:
+
+Please check your installation!</source>
+        <translation>Konnte Daten-Verzeichnis nicht öffnen:
 %1
-konnte nicht geöffnet werden. Bitte überprüfen Sie Ihre Installation</translation>
+
+Bitte überprüfe deine Installation!</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Waffen</translation>
+        <source>TCP - Error</source>
+        <translation>TCP - Fehler</translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Das Standard-Waffen-Set kann nicht editiert werden</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation>Server %1 konnte nicht gestartet werden.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Das Standard-Waffen-Set kann nicht gelöscht werden</translation>
+        <source>Unable to run engine at </source>
+        <translation>Konnte Engine nicht starten: </translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Soll dieses Waffen-Set wirklich gelöscht werden?</translation>
+        <source>Error code: %1</source>
+        <translation>Fehler-Code: %1</translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Kann nicht das Standardwaffenset '%1' überschreiben!</translation>
+        <source>Video upload - Error</source>
+        <translation>Video hochladen - Fehler</translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Alle Dateizuordnungen wurden gesetzt.</translation>
+        <source>Netgame - Error</source>
+        <translation>Netwerkspiel - Fehler</translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Dateizuordnung fehlgeschlagen.</translation>
+        <source>Please select a server from the list</source>
+        <translation>Bitte wähle einen Server von der Liste</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Teams</translation>
+        <source>Please enter room name</source>
+        <translation>Bitte einen Raumnamen eingeben</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Dieses Team wirklich löschen?</translation>
+        <source>Record Play - Error</source>
+        <translation>Aufnahmewiedergabe - Fehler</translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Spielprofil</translation>
+        <source>Please select record from the list</source>
+        <translation>Bitte eine Aufnahme aus der Liste auswählen</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Standardspielprofil '%1' kann nicht gelöscht werden!</translation>
+        <source>Cannot rename to </source>
+        <translation>Datei konnte nicht unbenannt werden nach </translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Dieses Spielprofil wirklich löschen?</translation>
+        <source>Cannot delete file </source>
+        <translation>Datei konnte nicht gelöscht werden</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Standardwaffenprofil '%1' kann nicht gelöscht werden!</translation>
+        <source>Room Name - Error</source>
+        <translation>Raumname - Fehler</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
+        <source>Please select room from the list</source>
+        <translation>Bitte einen Raum aus der Liste auswählen</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Verzeichnis %1 konnte nicht angelegt werden</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation>Raumname - Bist du dir sicher?</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>Das Spiel in das du beitreten möchtest hat bereits begonnen.
+Willst du trotzdem den Raum betreten?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation>Spielprofil - Warnung</translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation>Spielprofil - Bist du dir sicher?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation>Willst du das Profil '%1' wirklich löschen?</translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation>Videos - Bist du dir sicher?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation>Willst du das Video '%1' wirklich löschen?</translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation>
+            <numerusform>Willst du wirklich %1 Datei entfernen?</numerusform>
+            <numerusform>Willst du wirklich %1 Dateien entfernen?</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation>Willst du das Hochladen von %1 wirklich abbrechen_</translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation>Dateifehler</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation>'%1' konnte nicht geschrieben werden</translation>
     </message>
     <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation>'%1' konnte nicht gelesen werden</translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation>Munition '%1' kann nicht benutzt werden!</translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation>Waffenprofil - Warnung</translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation>Standard-Waffenprofil '%1' kann nicht überschrieben werden!</translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation>Standard-Waffenprofil '%1' kann nicht gelöscht werden!</translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation>Waffenprofil - Bist du dir sicher?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation>Willst du das Waffenprofil '%1' wirklich löschen?</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Spitzname</translation>
     </message>
@@ -2015,9 +2135,37 @@ konnte nicht geöffnet werden. Bitte überprüfen Sie Ihre Installation</transla
         <source>more</source>
         <translation>mehr</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation>Mehr Info</translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation>Setzen</translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation>Videoverzeichnis anzeigen</translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation>Spielen</translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation>Auf YouTube hochladen</translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation>Hochladen abbrechen</translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation>Im Spiel</translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation>Raumname</translation>
@@ -2046,6 +2194,18 @@ konnte nicht geöffnet werden. Bitte überprüfen Sie Ihre Installation</transla
         <source>Weapons</source>
         <translation>Waffen</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Zufallskarte</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Zufallslabyrinth</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation>Handgemalt</translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -2075,21 +2235,6 @@ konnte nicht geöffnet werden. Bitte überprüfen Sie Ihre Installation</transla
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Fehler</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Server %1 konnte nicht gestartet werden.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Engine konnte nicht gestartet werden: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2132,10 +2277,6 @@ konnte nicht geöffnet werden. Bitte überprüfen Sie Ihre Installation</transla
         <translation>Unverwundbarkeit</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Minen hinzufügen</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Zufällige Reihenfolge</translation>
     </message>
@@ -2360,6 +2501,14 @@ Statistik</translation>
         <source>slot 10</source>
         <translation>Slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation>stummschalten</translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation>aufnehmen</translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2444,7 +2593,11 @@ Statistik</translation>
     </message>
     <message>
         <source>Toggle labels above hedgehogs:</source>
-        <translation>Ändere die Informationen über Igeln:</translation>
+        <translation>Einblendungen über Igeln ein/ausschalten:</translation>
+    </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Video aufnehmen:</translation>
     </message>
 </context>
 <context>
diff --git a/share/hedgewars/Data/Locale/hedgewars_en.ts b/share/hedgewars/Data/Locale/hedgewars_en.ts
index 7c52b75..cae9431 100644
--- a/share/hedgewars/Data/Locale/hedgewars_en.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_en.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="en">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>new</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>new</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -48,14 +40,6 @@
         <translation>Edit weapons</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Illegal ammo scheme</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Edit schemes</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 has been removed from your ignore list</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 has been added to your ignore list</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 has been removed from your friends list</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 has been added to your friends list</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">new</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Unable to start the server</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Cannot save record to file %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Please select record from the list above</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Default Team</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Password</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ or pick another nickname in game config:</translation>
         <translation type="unfinished">Nickname</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -345,20 +290,6 @@ Please pick another nickname:</source>
         <translation>You got kicked</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Password</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 has joined the room</translation>
     </message>
@@ -375,21 +306,33 @@ or pick another nickname:</translation>
         <translation>%1 *** %2 has left</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nickname</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Password</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -401,15 +344,27 @@ or pick another nickname in game config:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Server message:</translation>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Set message</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Clear Accounts Cache</translation>
@@ -445,10 +400,6 @@ or pick another nickname in game config:</translation>
         <source>Connecting...</source>
         <translation>Connecting...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Cancel</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -484,6 +435,10 @@ or pick another nickname in game config:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -499,24 +454,6 @@ or pick another nickname in game config:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kill in a turn.</p></numerusform>
-            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>A total of <b>%1</b> hedgehog was killed during this round.</p></numerusform>
-            <numerusform><p>A total of <b>%1</b> hedgehogs were killed during this round.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Details</translation>
     </message>
@@ -583,15 +520,14 @@ or pick another nickname in game config:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Local Game (Play a game on a single computer)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Network Game (Play a game across a network)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -841,6 +777,46 @@ or pick another nickname in game config:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -850,33 +826,18 @@ or pick another nickname in game config:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Please select server from the list above</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Control</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Error</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Please enter room name</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -889,6 +850,14 @@ or pick another nickname in game config:</translation>
         <source>Official server</source>
         <translation>Official server</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -905,18 +874,6 @@ or pick another nickname in game config:</translation>
         <translation>Delete team</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">New weapon scheme</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Edit weapon scheme</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Delete weapon scheme</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</translation>
     </message>
@@ -944,157 +901,101 @@ or pick another nickname in game config:</translation>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
+        <source>General</source>
+        <translation type="unfinished">General</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Advanced</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Rename dialog</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Enter new file name:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Cannot rename to</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Cannot delete file</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Please select record from the list</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Create</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Join</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Refresh</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Rename dialog</source>
+        <translation>Rename dialog</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Administration</translation>
+        <source>Enter new file name:</source>
+        <translation>Enter new file name:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation>Room Name:</translation>
+        <source>Create</source>
+        <translation>Create</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>This game is in lobby.
-You may join and start playing once the game starts.</translation>
+        <source>Join</source>
+        <translation>Join</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</translation>
+        <source>Admin features</source>
+        <translation>Administration</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 is the host. He may adjust settings and start the game.</translation>
+        <source>Room Name:</source>
+        <translation>Room Name:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Random Map</translation>
+        <source>Rules:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Games may be played on precreated or randomized maps.</translation>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</translation>
+        <source>Search:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>The Weapon Scheme defines available weapons and their ammunition count.</translation>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>There is %1 client connected to this room.</numerusform>
-            <numerusform>There are %1 clients connected to this room.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>There is %1 team participating in this room.</numerusform>
-            <numerusform>There are %1 teams participating in this room.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Please enter room name</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Please select room from the list</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>The game you are trying to join has started.
-Do you still want to join the room?</translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
+        <source>%1 players online</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
         </translation>
     </message>
 </context>
@@ -1113,10 +1014,6 @@ Do you still want to join the room?</translation>
         <translation>Land can not be destroyed!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Add an indestructable border around the terrain</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Lower gravity</translation>
     </message>
@@ -1129,10 +1026,6 @@ Do you still want to join the room?</translation>
         <translation>All hogs have a personal forcefield</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Enable random mines</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Gain 80% of the damage you do back in health</translation>
     </message>
@@ -1251,27 +1144,47 @@ Do you still want to join the room?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Simple Game (a quick game against the computer, settings are chosen for you)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multiplayer (play a hotseat game against your friends, or AI teams)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation>Training Mode (Practice your skills in a range of training missions)</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Watch recorded demos)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Load (Load a previously saved game)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Load</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1285,6 +1198,52 @@ Do you still want to join the room?</translation>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Name</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 byte</numerusform>
+            <numerusform>%1 bytes</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1372,10 +1331,6 @@ Do you still want to join the room?</translation>
         <translation>Append date and time to record file name</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Reduced quality</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Show ammo menu tooltips</translation>
     </message>
@@ -1391,6 +1346,26 @@ Do you still want to join the room?</translation>
         <source>Frontend effects</source>
         <translation>Frontend effects</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1435,10 +1410,6 @@ Do you still want to join the room?</translation>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Default</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1526,10 +1497,6 @@ Do you still want to join the room?</translation>
         <translation>Teams</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Weapons</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Audio/Graphic options</translation>
     </message>
@@ -1561,6 +1528,30 @@ Do you still want to join the room?</translation>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1577,10 +1568,6 @@ Do you still want to join the room?</translation>
         <translation>Version</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Developers:</translation>
     </message>
@@ -1613,10 +1600,6 @@ Do you still want to join the room?</translation>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Net nick</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resolution</translation>
     </message>
@@ -1693,10 +1676,6 @@ Do you still want to join the room?</translation>
         <translation>Locale</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Restart game to apply</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Explosives</translation>
     </message>
@@ -1745,10 +1724,6 @@ Do you still want to join the room?</translation>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Password</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1756,6 +1731,68 @@ Do you still want to join the room?</translation>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Nickname</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1767,6 +1804,10 @@ Do you still want to join the room?</translation>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1778,10 +1819,6 @@ Do you still want to join the room?</translation>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Network</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Connection to server is lost</translation>
     </message>
@@ -1790,81 +1827,223 @@ Do you still want to join the room?</translation>
         <translation>Error</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Cannot create directory %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Failed to open data directory:
- %1
-Please check your installation</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Weapons</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Can not edit default weapon set</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Unable to start the server: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Can not delete default weapon set</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Really delete this weapon set?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Teams</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Please enter room name</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Please select record from the list</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Please select room from the list</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">The game you are trying to join has started.
+Do you still want to join the room?</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Cannot create directory %1</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nickname</translation>
     </message>
@@ -1947,36 +2126,76 @@ Please check your installation</translation>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Room Name</translation>
+        <translation type="unfinished">Room Name</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Owner</translation>
+        <translation type="unfinished">Owner</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Map</translation>
+        <translation type="unfinished">Map</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Rules</translation>
+        <translation type="unfinished">Rules</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Weapons</translation>
+        <translation type="unfinished">Weapons</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Random Map</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2007,21 +2226,6 @@ Please check your installation</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Unable to start the server: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Unable to run engine: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2064,10 +2268,6 @@ Please check your installation</translation>
         <translation>Invulnerable</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Add Mines</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Random Order</translation>
     </message>
@@ -2292,6 +2492,14 @@ info</translation>
         <source>slot 10</source>
         <translation>slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2378,6 +2586,10 @@ info</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Toggle labels above hedgehogs:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_es.ts b/share/hedgewars/Data/Locale/hedgewars_es.ts
index 7580786..20c6805 100644
--- a/share/hedgewars/Data/Locale/hedgewars_es.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_es.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="es">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Error de fichero</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>No se puede abrir el fichero '%1' en modo lectura</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>No se puede leer '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,22 +40,10 @@
         <translation>Editar armas</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Set de armas ilegal</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Editar modos de juego</translation>
     </message>
     <message>
-        <source>When this option is enabled selecting a game scheme will auto-select a weapon (and viceversa)</source>
-        <translation type="obsolete">Cuando esta opción esté activada escoger un modo de juego escogerá el set de armas correspondiente (y viceversa)</translation>
-    </message>
-    <message>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation>Cuando esta opción esté activada escoger un modo de juego escogerá el set de armas correspondiente</translation>
     </message>
@@ -73,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 ha sido eliminado de tu lista de ignorados</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 has sido añadido a tu lista de ignorados</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 ha sido eliminado de tu lista de amigos</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 ha sido añadido a tu lista de amigos</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -134,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>No se pudo iniciar el servidor</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>No se pudo almacenar una entrada en el fichero %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">Nuevo</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Por favor, selecciona una entrada de la lista</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Equipo predeterminado</translation>
     </message>
@@ -192,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Contraseña</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -214,17 +157,12 @@ o elige otro nick en las preferencias del juego:</translation>
         <translation type="unfinished">Nick</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Ya hay alguien conectado
-como %1 en estos momentos
-en el servidor.
-Por favor, introduce otro nick:</translation>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -278,10 +216,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Lunático</translation>
     </message>
     <message>
-        <source>Tunnel size</source>
-        <translation type="obsolete">Tamaño del túnel</translation>
-    </message>
-    <message>
         <source>Type</source>
         <translation>Tipo</translation>
     </message>
@@ -356,20 +290,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Has sido expulsado</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Contraseña</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">El nick %1 ya está
-registrado en Hedgewars.org
-Por favor, introduce tu clave
-o elige otro nick:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 ha entrado en la sala</translation>
     </message>
@@ -386,31 +306,33 @@ o elige otro nick:</translation>
         <translation>%1 *** %2 ha salido</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">El nick %1 ya está registrado 
-en Hedgewars.org. Por favor,
-introduce ahora tu clave de acceso
-o elige otro nick en las preferencias del juego:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nick</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Ya hay alguien conectado
-como %1 en estos momentos
-en el servidor.
-Por favor, introduce otro nick:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
+        <source>Password</source>
+        <translation type="unfinished">Contraseña</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -422,15 +344,27 @@ Por favor, introduce otro nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Mensaje del servidor:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Establecer mensaje</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Vaciar caché de cuentas</translation>
@@ -466,10 +400,6 @@ Por favor, introduce otro nick:</translation>
         <source>Connecting...</source>
         <translation>Estableciendo conexión...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Cancelar</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -494,10 +424,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Cargar mapa</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Mapas dibujados a mano (*.hwmap);;Todos los ficheros (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Guardar mapa</translation>
     </message>
@@ -509,6 +435,10 @@ Por favor, introduce otro nick:</translation>
         <source>All files</source>
         <translation>Todos los ficheros</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -524,24 +454,6 @@ Por favor, introduce otro nick:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>El premio al mejor disparo es para <b>%1</b>, con <b>%2</b> puntos.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>El asesino más eficiente es <b>%1</b>, con <b>%2</b> muerte en un solo turno.</p></numerusform>
-            <numerusform><p>El asesino más eficiente es <b>%1</b>, con <b>%2</b> muertes en un solo turno.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Un total de <b>%1</b> erizo murió esta ronda.</p></numerusform>
-            <numerusform><p>Un total de <b>%1</b> erizos murieron esta ronda.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalles</translation>
     </message>
@@ -578,10 +490,6 @@ Por favor, introduce otro nick:</translation>
             <numerusform>(%1 bajas)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 bajas)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -612,15 +520,14 @@ Por favor, introduce otro nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Juego local (Jugar en la misma computadora)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Juego en red (Jugar a través de la red)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -637,11 +544,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Si no tienes claro qué vas a hacer y prefieres no desperdiciar munición puedes pasar un turno. ¡Pero ten cuidado, si dejas pasar muchos turnos puede que empiece la muerte súbita!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">¿Andas escaso de cuerdas? Suelta la cuerda mientras estés en el aire y vuelve a dispararla de nuevo. ¡Mientras no toques el suelo seguirás usando la misma cuerda sin desperdiciar munición adicional!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Si prefieres que nadie más use tu nick en el servidor oficial puedes registrarlo en http://www.hedgewars.org/.</translation>
@@ -717,11 +619,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Los modos de juego especiales como "vampirismo" o "karma" te permiten desarrollar tácticas de juego completamente nuevas. ¡Pruébalos en tu próxima partida!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">La versión para Windows de Hedgewars soporta Xfire. Recuerda añadie Hedgewars a tu lista de juegos favoritos para que tus amigos sepan cuándo estás jugando.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>¡Nunca instales Hedgewars en ordenadores que no te pertenezcan tales como los de tu escuela, universidad o trabajo sin perdir permiso primero a las personas responsables de los mismos!</translation>
@@ -787,11 +684,6 @@ Por favor, introduce otro nick:</translation>
         <translation>El piano es el ataque aéreo más destructivo del juego, aunque perderás el erizo que lo lance, así que úsalo con cuidado.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">El abejorro puede ser complicado de usar. Su maniobrabilidad depende de su velocidad, así que intenta no lanzarlo a máxima potencia.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Las bombas lapa son perfectas para crear reacciones en cadena y mandar a tus enemigos al agua... o la Luna.</translation>
@@ -817,11 +709,6 @@ Por favor, introduce otro nick:</translation>
         <translation>El lanzallamas es un arma, pero puede usarse para excavar túneles en caso de necesidad.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Puedes usar el cóctel molotov para evitar que erizos enemigos crucen túneles angostos o puentes.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>¿Quieres saber quiénes son los desarrolladores del juego? Pulsa el logo del juego en la pantalla principal para ver los créditos.</translation>
@@ -852,11 +739,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Puedes encontrar los archivos de configuración del juego en la carpeta "Mis Documentos\Hedgewars". Haz copias de seguridad de los mismos o cópialos a otro ordenador si lo deseas, pero no intentes editarlos a mano para evitar posibles pérdidas de datos.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Puedes encontrar los archivos de configuración del juego en la carpeta ~/.hedgewars. Haz copias de seguridad de los mismos o cópialos a otro ordenador si lo deseas, pero no intentes editarlos a mano para evitar posibles pérdidas de datos.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation>Puedes asociar los tipos de archivo relacionados, partidas guardadas y demos, con Hedgewars para lanzarlos directamente desde tu gestor de archivos o navegador favoritos.</translation>
@@ -895,6 +777,46 @@ Por favor, introduce otro nick:</translation>
         <source>Downloadable Content</source>
         <translation>Contenido adicional</translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -904,33 +826,18 @@ Por favor, introduce otro nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Por favor, selecciona un servidor de la lista</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Opciones</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Por favor, introduce un nombre para la sala</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Contenido adicional</translation>
     </message>
 </context>
 <context>
@@ -943,6 +850,14 @@ Por favor, introduce otro nick:</translation>
         <source>Official server</source>
         <translation>Servidor oficial</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -959,18 +874,6 @@ Por favor, introduce otro nick:</translation>
         <translation>Borrar equipo</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Nuevo set de armas</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Editar set de armas</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Borrar set de armas</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>No es posible editar equipos desde la pantalla de elección de equipo. Vuelve al menú principal para añadir, editar o borrar equipos.</translation>
     </message>
@@ -998,36 +901,60 @@ Por favor, introduce otro nick:</translation>
         <source>Delete weapon set</source>
         <translation>Eliminar set de armas</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
+        <source>General</source>
+        <translation type="unfinished">General</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Avanzado</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Renombrar</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Introduce el nuevo nombre del fichero:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>No se pudo cambiar el nombre a</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>No se pudo eliminar el fichero</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Por favor, selecciona una entrada de la lista</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Renombrar</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Introduce el nuevo nombre del fichero:</translation>
     </message>
 </context>
 <context>
@@ -1041,86 +968,12 @@ Por favor, introduce otro nick:</translation>
         <translation>Entrar</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Actualizar</translation>
+        <source>Admin features</source>
+        <translation>Parámetros del administrador</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Admin features</source>
-        <translation>Parámetros del administrador</translation>
-    </message>
-    <message>
-        <source>Room Name:</source>
-        <translation>Nombre de la sala:</translation>
-    </message>
-    <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Este juego está en espera
-Puedes entrar y empezar a jugar cuando la partida comience.</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Esta partida se encuentra en progreso
-Puedes unirte como espectador, pero tendrás que esperar a que el juego termine para poder jugar.</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 es el anfitrión. Puede ajustar los parámetros del juego e iniciar la partida.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Terreno aleatorio</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Las partidas pueden ser jugadas bien en mapas pre-creados o generados aleatoriamente.</translation>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Los modos de juego definen opciones generales y preferencias como el tiempo de las rondas, muerte súbita o vampirismo.</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>El set de armas define las armas y munición disponibles.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Hay %1 cliente en esta sala.</numerusform>
-            <numerusform>Hay %1 clientes en esta sala.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Hay %1 equipo participando en esta sala.</numerusform>
-            <numerusform>Hay %1 equipos participando en esta sala.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Por favor, introduce un nombre para la sala</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Por favor, selecciona una sala de la lista</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Laberinto aleatorio</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Estado:</translation>
+        <source>Room Name:</source>
+        <translation>Nombre de la sala:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1138,16 +991,6 @@ Puedes unirte como espectador, pero tendrás que esperar a que el juego termine
         <source>Clear</source>
         <translation>Limpiar</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Aviso</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>La partida a la que intentas unirte ya ha empezado.
-¿Realmente deseas entrar en la sala?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1167,10 +1010,6 @@ Do you still want to join the room?</source>
         <translation>Borrar</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Habilitar minas aleatorias</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Recuperar el 80% del daño infligido como vida</translation>
     </message>
@@ -1203,10 +1042,6 @@ Do you still want to join the room?</source>
         <translation>¡El terreno es indestructible!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Añade un borde indestructible alrededor del campo de juego</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Baja gravedad</translation>
     </message>
@@ -1309,35 +1144,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Partida sencilla (Una partida rápida contra la computadora; los ajustes se eligen automáticamente)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multijugador (Juega compartiendo el ordenador contra tus amigos o la computadora)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Entrenamiento (Practica tus habilidades en diversas misiones de entrenamiento). EN DESARROLLO</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Visualiza demos previamente grabadas)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Cargar (Cargar un juego previamente guardado)</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Campaña (...) EN DESARROLLO</translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Cargar</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1351,6 +1198,52 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Nombre</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1438,10 +1331,6 @@ Do you still want to join the room?</source>
         <translation>Comprobar actualizaciones al iniciar</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Reducir efectos gráficos (para ordenadores lentos)</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Mostrar globos de ayuda sobre el armamento</translation>
     </message>
@@ -1457,6 +1346,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>Habilitar efectos del interfaz</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1501,42 +1410,6 @@ Do you still want to join the room?</source>
         <translation>En progreso</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Predeterminado</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Modo pro</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Shoppa</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Baloncesto</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Campo de minas</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Bodega infernal</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Erizos subterráneos</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Lunático</translation>
-    </message>
-    <message>
-        <source>Normal</source>
-        <translation type="obsolete">Normal</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>Mapa dibujado a mano...</translation>
     </message>
@@ -1628,10 +1501,6 @@ Do you still want to join the room?</source>
         <translation>Opciones de Audio y Gráficos</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Sets de armas</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Juego en red</translation>
     </message>
@@ -1659,14 +1528,34 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation>Modos de juego y sets de armas</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Este programa está distribuido bajo la licencia GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Desarrolladores:</translation>
     </message>
@@ -1703,10 +1592,6 @@ Do you still want to join the room?</source>
         <translation>Límite de FPS</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Apodo</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Nombre del servidor:</translation>
     </message>
@@ -1791,17 +1676,6 @@ Do you still want to join the room?</source>
         <translation>Idioma</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Requiere reiniciar el juego</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Esta es una versión experimental del juego y puede no ser compatible con otras versiones del mismo,
-así como carecer de algunas funcionalidades o simplemente funcionar mal. 
-¡Úsalo bajo tu propia responsalibidad!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Explosivos</translation>
     </message>
@@ -1836,26 +1710,14 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
         <translation>Disminución de vida por turno en muerte súbita</translation>
     </message>
     <message>
-        <source>Bind schemes and weapons</source>
-        <translation type="obsolete">Enlazar modos y sets</translation>
-    </message>
-    <message>
         <source>% Rope Length</source>
         <translation>% longitud de las cuerdas</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Tipo de juego</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Estereoscopía</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Opciones de juego</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Estilo</translation>
     </message>
@@ -1864,10 +1726,6 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
         <translation>Modo de juego</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Contraseña</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% duración de retirada</translation>
     </message>
@@ -1875,6 +1733,68 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Nick</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1886,6 +1806,10 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
         <source>hedgehog %1</source>
         <translation>erizo %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1897,10 +1821,6 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Red</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Se perdió la conexión con el servidor</translation>
     </message>
@@ -1909,81 +1829,223 @@ así como carecer de algunas funcionalidades o simplemente funcionar mal.
         <translation>Error</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>No se pudieron asociar los tipos de fichero.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">No se pudo crear el directorio %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>No de pudo abrir el directorio:
-%1
-Por favor, compruebe que el juego está debidamente instalado</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Sets de armas</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">No se puede editar el set de armas predefinido</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">No se pudo iniciar el servidor: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">No se puede borrar el set de armas predefinido</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>¿Realmente quieres borrar este set de armas?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>¡No se puede sobreescribir el set de armas por defecto '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Se reestablecieron todas las asociaciones de tipo de archivo.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>No se pudieron asociar los tipos de fichero.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Equipos</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Por favor, introduce un nombre para la sala</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>¿De verdad quieres eliminar este equipo?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Modos de juego</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Por favor, selecciona una entrada de la lista</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>¡No se puede eliminar el modo de juego predefinido '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>¿De verdad quieres eliminar este modo de juego?</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>¡No se puede eliminar el set de armas predefinido '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Error</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Por favor, selecciona una sala de la lista</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>No se pudo crear el directorio %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">La partida a la que intentas unirte ya ha empezado.
+¿Realmente deseas entrar en la sala?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished">Error de fichero</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nick</translation>
     </message>
@@ -2063,43 +2125,79 @@ Por favor, compruebe que el juego está debidamente instalado</translation>
         <translation>Asociar tipos de archivo</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translation type="obsolete">Establecer</translation>
-    </message>
-    <message>
         <source>more</source>
         <translation>más</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">En progreso</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Nombre de la sala</translation>
+        <translation type="unfinished">Nombre de la sala</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>J</translation>
+        <translation type="unfinished">J</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>E</translation>
+        <translation type="unfinished">E</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Propietario</translation>
+        <translation type="unfinished">Propietario</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Mapa</translation>
+        <translation type="unfinished">Mapa</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Reglas</translation>
+        <translation type="unfinished">Reglas</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Set de armas</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Terreno aleatorio</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Laberinto aleatorio</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2130,21 +2228,6 @@ Por favor, compruebe que el juego está debidamente instalado</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Error</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>No se pudo iniciar el servidor: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>No se pudo iniciar el motor: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2187,10 +2270,6 @@ Por favor, compruebe que el juego está debidamente instalado</translation>
         <translation>Invulnerabilidad</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Añadir minas</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Orden aleatorio</translation>
     </message>
@@ -2415,6 +2494,14 @@ los erizos</translation>
         <source>slot 10</source>
         <translation>posición 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2501,6 +2588,10 @@ los erizos</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Cambia las etiquetas sobre los erizos:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_fi.ts b/share/hedgewars/Data/Locale/hedgewars_fi.ts
index c280907..0e33374 100644
--- a/share/hedgewars/Data/Locale/hedgewars_fi.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_fi.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fi">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>uusi</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>uusi</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -48,14 +40,6 @@
         <translation>Muokkaa aseita</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Virheellinen ammussuunnitelma</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Muokkaa kaavaa</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 on poistanut sinut huomiotta jättö-listaltaan</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 on lisännyt sinut huomiotta jättö-listalleen</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 on poistanut sinut kaverilistaltaan</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 on lisännyt sinut kaverilistalleen</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">uusi</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Palvelimen käynnistys ei onnistunut</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Nauhoitetta ei voitu tallentaa tiedostoon %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Ole hyvä ja valitse nauhoite ylläolevasta listasta</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>OletusJoukkue</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Salasana</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation type="unfinished">Nimimerkki</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -345,20 +290,6 @@ Please pick another nickname:</source>
         <translation>Sinut potkittiin</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Salasana</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Nimimerkkisi %1 on
-rekisteröity Hedgewars.org:ssa
-Ole hyvä ja syötä salasana
-tai valitse toinen nimimerkki:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 liittyi huoneeseen</translation>
     </message>
@@ -375,21 +306,33 @@ tai valitse toinen nimimerkki:</translation>
         <translation>%1 *** %2 poistui (%3)</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Nimimerkkisi %1 on
-rekisteröity Hedgewars.org-sivustolla
-Ole hyvä ja syötä salasanasi
-tai aseta eri nimimerkki asetuksissa:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nimimerkki</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Salasana</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -401,15 +344,27 @@ tai aseta eri nimimerkki asetuksissa:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Palvelimen viesti:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Aseta viesti</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Tyhjennä käyttäjätili-välimuisti</translation>
@@ -445,10 +400,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <source>Connecting...</source>
         <translation>Yhdistetään...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Peruuta</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -484,6 +435,10 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -499,24 +454,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Paras laukaus -mitalin voitti <b>%1</b> <b>%2</b> pisteellä</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Paras tappaja oli <b>%1</b> <b>yhdellä</b> tapolla vuoron aikana</p></numerusform>
-            <numerusform><p>Paras tappaja oli <b>%1</b> <b>%2</b>:llä tapolla </p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Yhteensä <b>yksi</b> siili tapettiin tällä kierroksella.</p></numerusform>
-            <numerusform><p>Yhteensä <b>%1</b> siiltä tapettiin tällä kierroksella.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Yksityiskohdat</translation>
     </message>
@@ -553,10 +490,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
             <numerusform></numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 tappoa)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation type="unfinished">
@@ -587,15 +520,14 @@ tai aseta eri nimimerkki asetuksissa:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
+    <name>PageInfo</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Paikallinen peli (Pelaa yhdellä tietokoneella)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Verkkopeli (Pelaa verkon yli)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -612,11 +544,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Jos et tiedä mitä tehdä etkä halua tuhlata ammuksia, jätä vuoro väliin. Mutta älä anna ajan kulua liikaa koska Äkkikuolema koittaa ennemmin tai myöhemmin!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Haluatko säästää köysiä? Päästä köysi irti ilmassa ja ammu uudelleen. Niin pitkään kun et osu maahan, pääse käyttämään köyden uudelleen kuluttamatta ammuksia!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Jos haluat estää muita käyttämästä nimimerkkiäsi virallisella palvelimella, rekisteröi tunnus osoitteessa http://www.hedgewars.org/.</translation>
@@ -692,11 +619,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Erityispelimoodit kuten 'Vampyrismi' ja 'Karma' mahdollistavat kokonaan uusien taktiikoiden kehittämisen. Kokeile niitä muokatussa pelissä!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Windows-versio Hedgewarsista tukee Xfireä. Lisää Hedgewars sen pelilistaan niin kaverisi näkee kun pelaat.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Sinun ei ikinä tulisi asentaa Hedgewarsia tietokoneille joita et omista (koulu, yliopisto, työpaikka jne.). Ole hvä ja pyydä vastuuhenkilöä tekemään se!</translation>
@@ -762,11 +684,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Pianoisku on vahingollisin ilmaisku. Menetät siilen joka sen esittää, joten sillä on myös suuri huono puoli.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Mehiläinen voi olla hankala käyttää. Sen säde riippuu nopeudesta, joten älä käytä sitä täydellä voimalla</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Tarttuvat miinat ovat täydellinen työkalu luomaan pieniä ketjureaktioita jotka vie vihollissiilit kauheisiin tilanteisiin...tai veteen.</translation>
@@ -792,11 +709,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Liekinheitin on ase mutta sitä voi käyttää myös tunneleiden kaivamiseen.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Käytä palavaa kranaattia estämään siilia kulkemasta esimerkiksi tunneleihin ja tasoille.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Haluatko tietää ketkä ovat pelin takana? Klikkaa Hedgewars-logoa päävalikossa nähdäksesi tekijäluettelon.</translation>
@@ -827,11 +739,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Löydät Hedgewars-asetustiedostot hakemistosta "Omat tiedostot\Hedgewars". Ota varmuuskopio tai ota ne mukaasi, mutta älä muokkaa niitä käsin.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Löydät Hedgewars-asetustiedostot "Hedgewars"-hakemistosta kotihakemistossasi. Ota varmuuskopio tai ota ne mukaasi, mutta älä muokkaa niitä käsin.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -870,6 +777,46 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -879,33 +826,18 @@ tai aseta eri nimimerkki asetuksissa:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Ole hyvä ja valitse palvelin ylläolevasta listasta</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Säädöt</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Virhe</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Ole hyvä ja syötä huoneen nimi</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -918,6 +850,14 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <source>Official server</source>
         <translation>Virallinen palvelin</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -934,18 +874,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Poista joukkue</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Uusi ase</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Muokkaa asesuunnitelmaa</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Poista asesuunnitelma</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Et voi muokata joukkueita joukkuevalinnassa. Mene takaisin päävalikkoon lisätäksesi, muokataksesi tai poistaaksesi joukkueita.</translation>
     </message>
@@ -973,36 +901,60 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
+        <source>General</source>
+        <translation type="unfinished">Yleiset</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Lisäasetukset</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Uudelleennimeämis-dialogi</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Syötä uusi tiedostonimi:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Ei voida uudelleennimetä</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Ei voida poistaa tiedostoa</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Ole hyvä ja valitse nauhoite listasta</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Uudelleennimeämis-dialogi</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Syötä uusi tiedostonimi:</translation>
     </message>
 </context>
 <context>
@@ -1016,18 +968,6 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Liity</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Päivitä</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Ylläpitäjän ominaisuudet</translation>
     </message>
@@ -1036,70 +976,8 @@ tai aseta eri nimimerkki asetuksissa:</translation>
         <translation>Huoneen nimi:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Tämä peli on eteisessä.
-Voit liittyä ja alkaa pelaamaan sitten kun peli alkaa.</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Tämä peli on menossa.
-Voit liittyä ja seurata sitä, mutta sinun on odotettava pelin päättymistä päästäksesi pelaamaan.</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 on isäntä. Hän voi säätää asetuksia ja aloittaa pelin.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Satunnainen kartta</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Pelejä voi pelata valmiiksi luoduissa tai satunnaisesti tehdyissä kartoissa.</translation>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Pelikaava määrittelee yleiset asetukset ja säädöt kuten kierrosajan, äkkikuoleman ja vampyrismin.</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Asesuunnitelma määrittelee saatavilla olevat aseet ja niiden panosmäärät.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Yksi asiakas on liittyneenä tähän huoneeseen</numerusform>
-            <numerusform>%1 asiakasta on liittyneenä tähän huoneeseen</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Tässä huoneessa on osallistuneena yksi joukkue</numerusform>
-            <numerusform>Tässä huoneessa on osallistuneena %1 joukkuetta</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Ole hyvä ja syötä huoneen nimi</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Ole hyvä ja valitse huone listalta</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Satunnainen sokkelo</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Tila:</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Säännöt:</translation>
+        <source>Rules:</source>
+        <translation>Säännöt:</translation>
     </message>
     <message>
         <source>Weapons:</source>
@@ -1113,16 +991,6 @@ Voit liittyä ja seurata sitä, mutta sinun on odotettava pelin päättymistä p
         <source>Clear</source>
         <translation>Tyhjennä</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Varoitus</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Peli johon yrität liittyä on jo alkanut.
-Haluatko silti liittyä huoneeseen?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1146,10 +1014,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Maata ei voi tuhota!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Lisää tuhoutumattomat reunat kartan ympärille</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Matalampi painovoima</translation>
     </message>
@@ -1162,10 +1026,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Kaikilla siileillä on oma suojakenttänsä</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Lisää miinoja satunnaisesti</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Saa 80% aiheuttamastasi vahingosta takaisin omaan terveyteesi</translation>
     </message>
@@ -1284,35 +1144,47 @@ Haluatko silti liittyä huoneeseen?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Yksinkertainen peli (pikapeli tietokonetta vastaan, asetukset valitaan puolestasi)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Moninpeli (pelaa samalla koneella kavereitasi tai tekoälyä vastaan)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Harjoittelu (Harjoita taitojasi harjoitustasoissa). KEHITYKSEN ALLA</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demot (Katso nauhoitettuja demoja)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Lataa (Lataa aikaisemmin tallennettu peli)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampanja-tila (...). KEHITYS KESKEN</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Lataa</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1326,6 +1198,52 @@ Haluatko silti liittyä huoneeseen?</translation>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Nimi</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1413,10 +1331,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Lisää päivämäärä ja aika nauhoitusten tiedostonimeen</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Huononnettu laatu</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Näytä asevalikon vihjeet</translation>
     </message>
@@ -1432,6 +1346,26 @@ Haluatko silti liittyä huoneeseen?</translation>
         <source>Frontend effects</source>
         <translation>Käyttöliittymän tehosteet</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1476,38 +1410,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Kesken</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Oletus</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Pro-tila</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Shoppa</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Koripallo</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Miinakenttä</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Tynnyrikaaos</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Tunnelisiilit</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Sekopäinen</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1595,10 +1497,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Joukkueet</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Aseet</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Verkkopeli</translation>
     </message>
@@ -1630,6 +1528,30 @@ Haluatko silti liittyä huoneeseen?</translation>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1646,10 +1568,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Versio</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Tätä ohjelmaa levitetään GNU General Public Licence-lisensisn alla</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Kehittäjät:</translation>
     </message>
@@ -1682,10 +1600,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Portti:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Verkkopeli-nimimerkki</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resoluutio</translation>
     </message>
@@ -1762,10 +1676,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Kieli</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Käynnistä peli uudelleen ottaaksesi muutokset käyttöön</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Räjähteet</translation>
     </message>
@@ -1814,10 +1724,6 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Salasana</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1825,6 +1731,68 @@ Haluatko silti liittyä huoneeseen?</translation>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Nimimerkki</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1836,6 +1804,10 @@ Haluatko silti liittyä huoneeseen?</translation>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1847,10 +1819,6 @@ Haluatko silti liittyä huoneeseen?</translation>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Verkko</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Yhteys palvelimeen katosi</translation>
     </message>
@@ -1859,81 +1827,223 @@ Haluatko silti liittyä huoneeseen?</translation>
         <translation>Virhe</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Hakemiston %1 luonti epäonnistui</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Data-hakemiston avaus epäonnistui:
- %1
-Ole hyvä ja tarkista asennuksesi</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Aseet</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Oletus-asesettiä ei voi muokata</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Palvelinta ei pystytty käynnistämään: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Oletus-asesettiä ei voi poistaa</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Haluatko todella poistaa tämän asesetin?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Oletusasetussettiä '%1' ei voida ylikirjoittaa!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Joukkueet</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Ole hyvä ja syötä huoneen nimi</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Ole hyvä ja valitse nauhoite listasta</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Ole hyvä ja valitse huone listalta</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Peli johon yrität liittyä on jo alkanut.
+Haluatko silti liittyä huoneeseen?</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Hakemiston %1 luonti epäonnistui</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nimimerkki</translation>
     </message>
@@ -2016,36 +2126,76 @@ Ole hyvä ja tarkista asennuksesi</translation>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">Kesken</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Huoneen nimi</translation>
+        <translation type="unfinished">Huoneen nimi</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>A</translation>
+        <translation type="unfinished">A</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>J</translation>
+        <translation type="unfinished">J</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Omistaja</translation>
+        <translation type="unfinished">Omistaja</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Kartta</translation>
+        <translation type="unfinished">Kartta</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Säännöt</translation>
+        <translation type="unfinished">Säännöt</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Aseet</translation>
+        <translation type="unfinished">Aseet</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Satunnainen kartta</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Satunnainen sokkelo</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2076,21 +2226,6 @@ Ole hyvä ja tarkista asennuksesi</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Virhe</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Palvelinta ei pystytty käynnistämään: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Pelimoottorin ajo epäonnistui: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2133,10 +2268,6 @@ Ole hyvä ja tarkista asennuksesi</translation>
         <translation>Vahingoittumaton</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Lisää miinat</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Satunnainen Järjestys</translation>
     </message>
@@ -2361,6 +2492,14 @@ tiedot</translation>
         <source>slot 10</source>
         <translation>paikka 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2447,6 +2586,10 @@ tiedot</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Vaihda siilien yläpuolella näkyviä "leimoja":</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_fr.ts b/share/hedgewars/Data/Locale/hedgewars_fr.ts
index fcaf622..21a0786 100644
--- a/share/hedgewars/Data/Locale/hedgewars_fr.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_fr.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Éditer les armes</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Paramètre de munitions non autorisé</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Éditer les paramètres</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 a été enlevé de votre liste de personnes ignorées</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 a été ajouté dans votre liste de personnes ignorées</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 a été enlevé à votre liste d'amis</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 a été ajouté à votre liste d'amis</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Impossible de sauvegarder la partie dans le fichier %1</translation>
     </message>
     <message>
-        <source>Unable to start the server</source>
-        <translation>Impossible de démarrer le serveur</translation>
-    </message>
-    <message>
-        <source>new</source>
-        <translation type="obsolete">nouveau</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Veuillez sélectionner une partie enregistrée dans la liste ci-dessus</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Équipe par défaut</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Mot de passe</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ ou choisir un nouveau pseudo :</translation>
         <translation type="unfinished">Pseudo</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -345,20 +290,6 @@ Please pick another nickname:</source>
         <translation>Vous avez été expulsé</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Mot de passe</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Votre pseudo %1 est
-enregistré sur Hedgewars.org
-Veuillez fournir votre mot de passe
-ou choisir un nouveau pseudo :</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 a rejoint la salle</translation>
     </message>
@@ -375,21 +306,33 @@ ou choisir un nouveau pseudo :</translation>
         <translation>%1 *** %2 est parti</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Votre pseudo %1 est
-enregistré sur Hedgewars.org
-Veuillez fournir votre mot de passe
-ou choisir un nouveau pseudo :</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Pseudo</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Mot de passe</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -401,15 +344,27 @@ ou choisir un nouveau pseudo :</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Message du serveur:</translation>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Définir le message</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Vider le cache des comptes</translation>
@@ -445,10 +400,6 @@ ou choisir un nouveau pseudo :</translation>
         <source>Connecting...</source>
         <translation>En connexion...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Annuler</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -473,10 +424,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation>Charger une carte dessinée</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Cartes dessinées (*.hwmap);;Tous les fichiers (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Enregistrer une carte dessinée</translation>
     </message>
@@ -488,6 +435,10 @@ ou choisir un nouveau pseudo :</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -503,24 +454,6 @@ ou choisir un nouveau pseudo :</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Le prix du meilleur tir revient à <b>%1</b> avec <b>%2</b> points.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Le meilleur tueur est <b>%1</b> avec <b>%2</b> mort en un tour.</p></numerusform>
-            <numerusform><p>Le meilleur tueur est <b>%1</b> avec <b>%2</b> morts en un tour.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Un total de <b>%1</b> hérisson a été tué pendant cette partie.</p></numerusform>
-            <numerusform><p>Un total de <b>%1</b> hérissons ont été tués pendant cette partie.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Détails</translation>
     </message>
@@ -587,15 +520,14 @@ ou choisir un nouveau pseudo :</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Jeu en local (Jouer une partie sur son propre ordinateur)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jeu en réseau (Jouer une partie sur le réseau)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -687,11 +619,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation>Les modes de jeu spéciaux comme « Vampirisme » ou « Karma » vous permettent de développer de nouvelles tactiques. Essayez-les en parties personnalisées !</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">La version Windows d'Hedgewars fonctionne avec Xfire. Pensez à ajouter Hedgewars dans la liste de jeu pour que vous amis vous voient jouer.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Vous ne devriez jamais installer Hedgewars sur des ordinateurs ne vous appartenant pas (école, université, travail, etc...). Demandez au responsable !</translation>
@@ -757,11 +684,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation type="unfinished">L'attaque du Piano est la plus dévastatrice des attaques aériennes. Mais la contrepartie est grande puisque vous perdrez le hérisson qui la lance.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">L'Abeille Missile peut être délicate à utiliser. Son rayon de courbure dépend de sa vitesse, alors essayer de ne pas l'utiliser à pleine puissance.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation type="unfinished">Les Mines adhésives sont l'outil parfait pour créer de petites réactions en chaines envoyant les ennemis dans des situations délicates ... ou dans l'eau.</translation>
@@ -787,11 +709,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation type="unfinished">Le Lance-flammes est une arme mais peut aussi être utilisé pour creuser un tunnel.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Utilisez la grenade infernale pour empêcher temporairement des hérissons de traverser du terrain comme un tunnel ou une plate-forme.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Vous voulez savoir qui est derrière le jeu ? Cliquez sur le logo Hedgewars dans le menu principal pour voir les crédits.</translation>
@@ -847,11 +764,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation type="unfinished">La version Windows de Hedgewars supporte Xfire. Ajoutez Hedgewars à la liste des jeux pour que vos amis puissent vous voir jouer</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">L'Abeille Missile peut être délicate à utiliser. Sa courbe de lancer dépend de sa vitesse, pour plus de précision ne l'envoyez pas à pleine puissance. </translation>
-    </message>
-    <message>
         <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
         <translation type="unfinished"> Utilisez le Lance-Flammes ou le Cocktail Molotov pour empêcher temporairement les hérissons de circuler dans les tunnels ou sur les plateformes.</translation>
@@ -865,6 +777,46 @@ ou choisir un nouveau pseudo :</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -874,33 +826,18 @@ ou choisir un nouveau pseudo :</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Veuillez sélectionner un serveur dans la liste ci-dessus</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Contrôles</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Erreur</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Veuillez saisir le nom du salon</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -913,6 +850,14 @@ ou choisir un nouveau pseudo :</translation>
         <source>Official server</source>
         <translation>Serveur officiel</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -956,36 +901,60 @@ ou choisir un nouveau pseudo :</translation>
         <source>Delete weapon set</source>
         <translation>Supprimer un ensemble d'armes</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
+        <source>General</source>
+        <translation type="unfinished">Général</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Avancé</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Boîte de dialogue de renommage</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Entrez un nouveau nom de fichier:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Impossible de renommer en</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Impossible de supprimer le fichier</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Veuillez sélectionner une partie dans cette liste</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Boîte de dialogue de renommage</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Entrez un nouveau nom de fichier:</translation>
     </message>
 </context>
 <context>
@@ -999,18 +968,6 @@ ou choisir un nouveau pseudo :</translation>
         <translation>Rejoindre</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Rafraîchir</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Fonctionnalités d'administration</translation>
     </message>
@@ -1019,92 +976,21 @@ ou choisir un nouveau pseudo :</translation>
         <translation>Nom du salon:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Ce jeu est dans le lobby.
-Vous pouvez le rejoindre et commencerez à jouer quand le jeu démarrera.</translation>
+        <source>Rules:</source>
+        <translation>Règles : </translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Ce jeu est en cours.
-Vous pouvez le rejoindre et y assister maintenant mais vous devrez attendre la fin de la partie pour commencer à jouer.</translation>
+        <source>Weapons:</source>
+        <translation>Armes : </translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 est l'hôte. Il peut modifier les options et lancer la partie.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Carte Aléatoire</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Les parties peuvent être jouées sur des cartes aléatoires ou pré-créées.</translation>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Les paramètres de jeu définissent les options et préférences générales comme la Durée d'un Tour, la Mort Subite ou le Vampirisme.</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Les paramètres d'armes définissent les armes disponibles et leur nombre de munitions.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Il y a %1 client connecté à cette salle.</numerusform>
-            <numerusform>Il y a %1 clients connectés à cette salle.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Il y a %1 équipe participant dans cette salle.</numerusform>
-            <numerusform>Il y a %1 équipes participant dans cette salle.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Veuillez saisir le nom du salon</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Veuillez sélectionner un salon dans la liste</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation type="unfinished">Labyrinthe aléatoire</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">État : </translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Règles : </translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation>Armes : </translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation>Recherche : </translation>
+        <source>Search:</source>
+        <translation>Recherche : </translation>
     </message>
     <message>
         <source>Clear</source>
         <translation>Effacer</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Attention</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Vous voulez rejoindre une partie qui a déjà commencée. Voulez-vous tout de même rejoindre la salle ?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1124,10 +1010,6 @@ Do you still want to join the room?</source>
         <translation>Supprimer</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Activer les mines aléatoires</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>80% des dommages que vous infligez sont convertis en santé</translation>
     </message>
@@ -1160,10 +1042,6 @@ Do you still want to join the room?</source>
         <translation>Le terrain est indestructible !</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Ajouter une bordure indestructible autour du terrain</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Gravité faible</translation>
     </message>
@@ -1266,35 +1144,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Jeu en solo (rapide partie contre l'ordinateur, options choisies automatiquement)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Jeu à plusieurs (contre vos amis et/ou contre l'ordinateur)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Missions d'entraînement (Pratiquez vos talents dans une série de missions d'entraînement). EN DÉVELOPPEMENT</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Démonstrations (Visionner les démonstrations enregistrées)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Charger (Charger une partie préalablement sauvegardée)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Mode Campagne (...). EN DÉVELOPPEMENT</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Charger</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1308,6 +1198,52 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Nom</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1395,10 +1331,6 @@ Do you still want to join the room?</source>
         <translation>Vérifiez la présence de mises à jour au démarrage</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Qualité réduite</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation type="unfinished">Montrer les astuces du menu des armes.</translation>
     </message>
@@ -1414,6 +1346,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished">Effets du menu principal</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1458,10 +1410,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished">En cours</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Défaut</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished">Carte dessinée</translation>
     </message>
@@ -1561,10 +1509,6 @@ Do you still want to join the room?</source>
         <translation>Partie en réseau</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Armes</translation>
-    </message>
-    <message>
         <source>Game Modifiers</source>
         <translation>Modificateurs de jeu</translation>
     </message>
@@ -1584,18 +1528,34 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation>Paramètres et Armes</translation>
     </message>
-</context>
-<context>
-    <name>QLabel</name>
     <message>
-        <source>Net nick</source>
-        <translation>Pseudo réseau</translation>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Ce programme est distribué sous la licence GNU GPL (General Public License)</translation>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QLabel</name>
+    <message>
         <source>Resolution</source>
         <translation>Résolution</translation>
     </message>
@@ -1716,10 +1676,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished">Langue</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished">Relancez le jeu pour appliquer</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Explosifs</translation>
     </message>
@@ -1756,10 +1712,6 @@ Do you still want to join the room?</source>
         <translation>% longueur de la Corde Ninja</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Mode de jeu</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation type="unfinished">Rendu stéréo</translation>
     </message>
@@ -1772,10 +1724,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Mot de passe</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1783,6 +1731,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Pseudo</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1794,6 +1804,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1809,89 +1823,226 @@ Do you still want to join the room?</source>
         <translation>Erreur</translation>
     </message>
     <message>
+        <source>Connection to server is lost</source>
+        <translation>La connexion au serveur a été perdue</translation>
+    </message>
+    <message>
+        <source>File association failed.</source>
+        <translation>Les associations d'extensions de fichiers ont échoué.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Impossible de créer le dossier %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Echec lors de l'accès au dossier do données:
-%1
-Veuillez vérifier votre installation</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Network</source>
-        <translation>Réseau</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
-        <translation>La connexion au serveur a été perdue</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Impossible de démarrer le serveur: %1.</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Armes</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Impossible de supprimer le set d'armes par défaut</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Supprimer ce set d'armes ?</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Impossible d'éditer le set d'armes par défaut</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Impossible d'enregistrer sur le set d'armes par défaut.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Toutes les associations d'extensions de fichiers ont été effectuées.</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Veuillez saisir le nom du salon</translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Les associations d'extensions de fichiers ont échoué.</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Équipes</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Veuillez sélectionner une partie dans cette liste</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Voulez-vous vraiment effacer cette équipe ?</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Paramètres de jeu</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Impossible d'effacer les paramètres de jeu par défaut.</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Voulez-vous vraiment effacer ces paramètres de jeu ?</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Veuillez sélectionner un salon dans la liste</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Impossible d'effacer le set d'armes par défaut.</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Vous voulez rejoindre une partie qui a déjà commencée. Voulez-vous tout de même rejoindre la salle ?</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Impossible de créer le dossier %1</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Pseudo</translation>
     </message>
@@ -1974,36 +2125,76 @@ Veuillez vérifier votre installation</translation>
         <source>more</source>
         <translation>plus</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">En cours</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Nom de la salle</translation>
+        <translation type="unfinished">Nom de la salle</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>É</translation>
+        <translation type="unfinished">É</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Propriétaire</translation>
+        <translation type="unfinished">Propriétaire</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Carte</translation>
+        <translation type="unfinished">Carte</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Règles</translation>
+        <translation type="unfinished">Règles</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Armes</translation>
+        <translation type="unfinished">Armes</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Carte Aléatoire</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Labyrinthe aléatoire</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2034,21 +2225,6 @@ Veuillez vérifier votre installation</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Erreur</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Impossible de démarrer le serveur: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Impossible de démarrer le moteur: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2091,10 +2267,6 @@ Veuillez vérifier votre installation</translation>
         <translation>Invulnérable</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Ajouter des Mines</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Ordre aléatoire</translation>
     </message>
@@ -2320,6 +2492,14 @@ zoom</translation>
         <source>slot 10</source>
         <translation type="unfinished">slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2406,6 +2586,10 @@ zoom</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>(Dés)activez les étiquettes au-dessus des hérissons:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_hu.ts b/share/hedgewars/Data/Locale/hedgewars_hu.ts
index 01c9fa9..b72028d 100644
--- a/share/hedgewars/Data/Locale/hedgewars_hu.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_hu.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="hu">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>új</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>új</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -47,14 +39,6 @@
         <translation>Fegyverek beállítása</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Szabálytalan lőszerséma</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Sémák szerkesztése</translation>
     </message>
@@ -68,23 +52,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 eltávolítva a figyelmen kívül hagyottak listájáról</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 hozzáadva a figyelmen kívül hagyottak listájához</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 eltávolítva a barátlistáról</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 hozzáadva a barátlistádhoz</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -129,38 +104,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">új</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>A szervert nem sikerült elindítani</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Nem sikerült menteni a %1 fájlba</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Kérlek válassz a fentebbi listából</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -187,10 +138,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">JElszó</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -206,14 +153,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished">Becenév</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -341,20 +286,6 @@ Please pick another nickname:</source>
         <translation>Kirúgtak</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">JElszó</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">A %1 név már
-regisztrálva van a Hedgewars.org-on
-Írd be a jelszavad
-vagy válassz másik nevet:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 belépett a szobába</translation>
     </message>
@@ -371,11 +302,33 @@ vagy válassz másik nevet:</translation>
         <translation>%1 *** %2 távozott</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Becenév</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">JElszó</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -387,15 +340,27 @@ vagy válassz másik nevet:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Server message:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Set message</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Accounts Cache kiürítése</translation>
@@ -431,10 +396,6 @@ vagy válassz másik nevet:</translation>
         <source>Connecting...</source>
         <translation>Csatlakozás...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Mégse</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -470,6 +431,10 @@ vagy válassz másik nevet:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -485,22 +450,6 @@ vagy válassz másik nevet:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>A legjobb lövés díját <b>%1</b> nyerte <b>%2</b> ponttal.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>A legjobb gyilkos <b>%1</b> volt, <b>%2</b> áldozattal egy körben.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Összesen <b>%1</b> süni pusztult el ebben a játékban.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -561,15 +510,14 @@ vagy válassz másik nevet:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Helyi játék (Játssz egyetlen számítógépen)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Hálózati játék (Játék hálózaton keresztül)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -819,6 +767,46 @@ vagy válassz másik nevet:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -828,33 +816,18 @@ vagy válassz másik nevet:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Kérlek, válassz szervert a fenti listából</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Irányítás</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Hiba</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Add meg a szoba nevét</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -867,6 +840,14 @@ vagy válassz másik nevet:</translation>
         <source>Official server</source>
         <translation>Hivatalos szerver</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -883,18 +864,6 @@ vagy válassz másik nevet:</translation>
         <translation>Csapat törlése</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Új fegyverséma</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Fegyverséma szerkesztése</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Fegyverséma törlése</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -922,36 +891,60 @@ vagy válassz másik nevet:</translation>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
+        <source>General</source>
+        <translation type="unfinished">Általános</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Haladó</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Párbeszéd átnevezése</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Add meg az új fájl nevét:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Nem nevezhető át erre -</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Fájl nem törölhető</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Kérlek, válassz a listából</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Párbeszéd átnevezése</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Add meg az új fájl nevét:</translation>
     </message>
 </context>
 <context>
@@ -965,18 +958,6 @@ vagy válassz másik nevet:</translation>
         <translation>Csatlakozás</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Frissítés</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Adminisztráció</translation>
     </message>
@@ -985,110 +966,41 @@ vagy válassz másik nevet:</translation>
         <translation>Szoba neve:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Ez a játék elérhető.
-Csatlakozz és játssz, amikor a játék elkezdődik.</translation>
+        <source>Rules:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Ez a játék folyamatban van.
-Csatlakozhatsz mint megfigyelő, de a játszáshoz meg kell várnod a jelenlegi meccs befejeződését.</translation>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 a host. Ő kezeli a beállításokat és a játék indítását.</translation>
+        <source>Search:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Véletlen pálya</translation>
+        <source>Clear</source>
+        <translation type="unfinished">Törlés</translation>
     </message>
+    <message numerus="yes">
+        <source>%1 players online</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>A játékok előkészített vagy véletlen pályákon játszódnak.</translation>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation>Védd meg az erődöd, és pusztítsd el az ellenfelekét! Legfeljebb két csapatszín!</translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>A játék sémája az általános beállításokat határozza meg. illetve egyéb dolgokat, mint egy kör ideje, Hirtelen halál vagy Vámpírizmus.</translation>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
+        <translation>A csapatok a pálya két végén kezdenek. Legfeljebb két csapatszín!</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>A fegyverséma az elérhető fegyverek és a lőszer mennyiségét határozza meg.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Összesen %1 kliens csatlakozott a szobához.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Összesen %1 csapat van a szobában.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Add meg a szoba nevét</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Válassz egy szobát a listából</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Véletlen labirintus</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation type="unfinished">Törlés</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation>Védd meg az erődöd, és pusztítsd el az ellenfelekét! Legfeljebb két csapatszín!</translation>
-    </message>
-    <message>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation>A csapatok a pálya két végén kezdenek. Legfeljebb két csapatszín!</translation>
-    </message>
-    <message>
-        <source>Land can not be destroyed!</source>
-        <translation>A talajt nem lehet elpusztítani!</translation>
-    </message>
-    <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">A pálya köré egy elpusztíthatatlan keret felhúzása</translation>
+        <source>Land can not be destroyed!</source>
+        <translation>A talajt nem lehet elpusztítani!</translation>
     </message>
     <message>
         <source>Lower gravity</source>
@@ -1103,10 +1015,6 @@ Do you still want to join the room?</source>
         <translation>Minden süninek saját erőtere van</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Véletlen aknaidőzítés engedélyezése</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Az általad okozott sebzés 80% -át visszagyógyulod</translation>
     </message>
@@ -1225,31 +1133,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Egyszerű játék (gyors játék a gép ellen, a beállításokat már kiválasztottuk neked)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Többjátékos (hotseat játék a barátaid vagy a gép csapatai ellen)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Gyakorlás (fejleszd magad a gyakorlóküldetéseken keresztül). FEJLESZTÉS ALATT</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demók (felvett demók megtekintése)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Betöltés (korábbi mentett állás visszatöltése)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Betöltés</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1263,6 +1187,51 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Név</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1350,10 +1319,6 @@ Do you still want to join the room?</source>
         <translation>Dátum és idő hozzáadása a tároló fájl nevéhez</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Csökkentett minőség</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Lőszer menü tippjeinek mutatása</translation>
     </message>
@@ -1369,6 +1334,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>Frontend effektusok</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1413,10 +1398,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Default</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1504,10 +1485,6 @@ Do you still want to join the room?</source>
         <translation>Csapatok</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Fegyverek</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Hang- és képi beállítások</translation>
     </message>
@@ -1539,6 +1516,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1555,10 +1556,6 @@ Do you still want to join the room?</source>
         <translation>Verzió</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Ez a program a GNU General Public License alatt terjesztett</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Fejlesztők:</translation>
     </message>
@@ -1591,10 +1588,6 @@ Do you still want to join the room?</source>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Becenév a neten</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Felbontás</translation>
     </message>
@@ -1671,20 +1664,10 @@ Do you still want to join the room?</source>
         <translation>Nyelv</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Újraindításkor lép érvénybe</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Robbanótöltetek</translation>
     </message>
     <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Ez az SVN build még fejlesztés alatt áll és esetlegesen nem kompatibilis a játék más verzióival.
-Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelősségre használd!</translation>
-    </message>
-    <message>
         <source>Tip: </source>
         <translation type="unfinished"></translation>
     </message>
@@ -1729,10 +1712,6 @@ Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelős
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">JElszó</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1740,6 +1719,68 @@ Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelős
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Becenév</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1751,6 +1792,10 @@ Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelős
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1762,10 +1807,6 @@ Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelős
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Hálózat</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>A kapcsolat a szerverrel megszakadt</translation>
     </message>
@@ -1774,81 +1815,221 @@ Néhány részlet esetleg nem működik vagy nincs készen. Csak saját felelős
         <translation>Hiba</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Nem sikerült létrehozni %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Nem sikerült megnyitni az alábbi könyvtárat:
- %1
-Kérlek, ellenőrizd a telepítésed</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Fegyverek</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Az alap fegverkészlet nem szerkeszthető</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Nem sikerült a szerverhez csatlakozni: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Az alap fegyverkeszléet nem törölhető</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Valóban törlöd ezt a fegyverkészletet?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Csapatok</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Add meg a szoba nevét</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Kérlek, válassz a listából</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Válassz egy szobát a listából</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nem sikerült létrehozni %1</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Becenév</translation>
     </message>
@@ -1931,36 +2112,76 @@ Kérlek, ellenőrizd a telepítésed</translation>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Szoba neve</translation>
+        <translation type="unfinished">Szoba neve</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Tulajdonos</translation>
+        <translation type="unfinished">Tulajdonos</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Pálya</translation>
+        <translation type="unfinished">Pálya</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Szabályok</translation>
+        <translation type="unfinished">Szabályok</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Fegyverek</translation>
+        <translation type="unfinished">Fegyverek</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Véletlen pálya</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Véletlen labirintus</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -1991,21 +2212,6 @@ Kérlek, ellenőrizd a telepítésed</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Hiba</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Nem sikerült a szerverhez csatlakozni: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Nem sikerült a játékot futtatni: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2048,10 +2254,6 @@ Kérlek, ellenőrizd a telepítésed</translation>
         <translation>Sérthetetlenség</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Aknák hozzáadása</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Véletlen sorrend</translation>
     </message>
@@ -2276,6 +2478,14 @@ info</translation>
         <source>slot 10</source>
         <translation type="unfinished">slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2362,6 +2572,10 @@ info</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Sünik feletti címkék beállítása:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_it.ts b/share/hedgewars/Data/Locale/hedgewars_it.ts
index c303f92..e371bbf 100644
--- a/share/hedgewars/Data/Locale/hedgewars_it.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_it.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="it">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation>Indietro</translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Errore file</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Impossibile aprire il file '%1' in scrittura</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Impossibile leggere il file '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Modifica armi</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Schema armi non valido</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Modifica schemi</translation>
     </message>
@@ -65,105 +49,72 @@
     </message>
     <message>
         <source>Game Options</source>
-        <translation type="unfinished">Opzioni di gioco</translation>
+        <translation>Opzioni di Gioco</translation>
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 è stato rimosso dalla tua lista ignorati</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 è stato aggiunto alla tua lista ignorati</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 è stato rimosso dalla tua lista amici</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 è stato aggiunto alla tua lista amici</translation>
+        <source>Do you really want to quit?</source>
+        <translation>Vuoi veramente uscire?</translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 è stato rimosso dalla tua lista ignorati</translation>
     </message>
     <message>
         <source>%1 has been added to your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 è stato aggiunto alla tua lista ignorati</translation>
     </message>
     <message>
         <source>%1 has been removed from your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 è stato rimosso dalla tua lista amici</translation>
     </message>
     <message>
         <source>%1 has been added to your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 è stato aggounto alla tua lista amici</translation>
     </message>
     <message>
         <source>Stylesheet imported from %1</source>
-        <translation type="unfinished"></translation>
+        <translation>StyleSheet importata da %1</translation>
     </message>
     <message>
         <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
-        <translation type="unfinished"></translation>
+        <translation>Inserisci %1 se vuoi utilizzare la StyleSheet corrente in futuro, inserisci %2 per resettarla!</translation>
     </message>
     <message>
         <source>Couldn't read %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Impossibile leggere %1</translation>
     </message>
     <message>
         <source>StyleSheet discarded</source>
-        <translation type="unfinished"></translation>
+        <translation>StyleSheet scartata</translation>
     </message>
     <message>
         <source>StyleSheet saved to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>StyleSheet salvata in %1</translation>
     </message>
     <message>
         <source>Failed to save StyleSheet to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Impossibile salvare la StyleSheet in %1! Errore interno!</translation>
     </message>
     <message>
         <source>%1 is not a valid command!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 non è un comando valido!</translation>
     </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Impossibile avviare il server</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Impossibile salvare il record al file %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">nuovo</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Inserisci il record dalla lista sottostante</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
-        <translation>SquadraPredefinita</translation>
+        <translation>Squadra_Predefinita</translation>
     </message>
     <message>
         <source>Hedgewars Demo File</source>
@@ -185,42 +136,33 @@
     </message>
     <message>
         <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Password</translation>
+        <translation>Gioco concluso per volere del giocatore</translation>
     </message>
     <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
 or pick another nickname in game config:</source>
-        <translation type="unfinished">Il nickname %1 è
+        <translation>Il nickname %1 è
 registrato su Hedgewars.org
 Per favore inserisci la tua password
 o scegli un altro nickname:</translation>
     </message>
     <message>
         <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nessuna password valida inserita.</translation>
     </message>
     <message>
         <source>Nickname</source>
-        <translation type="unfinished">Nickname</translation>
+        <translation>Nickname</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Qualcun altro sta usando
- il tuo nickname %1
-sul server.
-Per favore scelto un altro nickname:</translation>
+        <source>No nickname supplied.</source>
+        <translation>Nessun nickname valido inserito.</translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -232,7 +174,7 @@ Per favore scelto un altro nickname:</translation>
     </message>
     <message>
         <source>Cannot open demofile %1</source>
-        <translation>Impossibile aprire file demo %1</translation>
+        <translation>Impossibile aprire il file demo %1</translation>
     </message>
 </context>
 <context>
@@ -274,10 +216,6 @@ Per favore scelto un altro nickname:</translation>
         <translation>Stramba</translation>
     </message>
     <message>
-        <source>Tunnel size</source>
-        <translation type="obsolete">Grandezza Gallerie</translation>
-    </message>
-    <message>
         <source>Type</source>
         <translation>Tipo</translation>
     </message>
@@ -352,20 +290,6 @@ Per favore scelto un altro nickname:</translation>
         <translation>Sei stato espulso</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Password</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Il nickname %1 è
-registrato su Hedgewars.org
-Per favore inserisci la tua password
-o scegli un altro nickname:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 è entrato nella stanza</translation>
     </message>
@@ -379,54 +303,68 @@ o scegli un altro nickname:</translation>
     </message>
     <message>
         <source>%1 *** %2 has left</source>
-        <translation>%1 *** %2 se ne è andato</translation>
+        <translation>%1 *** %2 se n'è andato</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Il nickname %1 è
-registrato su Hedgewars.org
-Per favore inserisci la tua password
-o scegli un altro nickname:</translation>
+        <source>User quit</source>
+        <translation>Esci</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nickname</translation>
+        <source>Remote host has closed connection</source>
+        <translation>L'host remoto ha terminato la connessione.</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Qualcun altro sta usando
- il tuo nickname %1
-sul server.
-Per favore scelto un altro nickname:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation>Il server è troppo datato. Si verrà immediatamente disconessi.</translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation>Password</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation>Carica video</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Carica</translation>
     </message>
 </context>
 <context>
     <name>KB</name>
     <message>
         <source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</source>
-        <translation>SDL_ttf ha restituito un errore durante il rendering del testo, probabilmente relativo ad un bug in freetype2. Si raccomanda di aggiornare le proprie librerie freetype.</translation>
+        <translation>SDL_ttf ha restituito un errore durante il rendering del testo, probabilmente relativo ad un bug della libreria freetype2. Si raccomanda di aggiornare le proprie librerie freetype.</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation>Durata: %1m %2s</translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation>Video: %1x%2, </translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Messaggio del server:</translation>
+        <source>%1 fps, </source>
+        <translation>%1 fps, </translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Inserisci messaggio</translation>
+        <source>Audio: </source>
+        <translation>Audio:</translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Pulisci la cache degli account</translation>
@@ -462,10 +400,6 @@ Per favore scelto un altro nickname:</translation>
         <source>Connecting...</source>
         <translation>Connessione in corso...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Annulla</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -490,10 +424,6 @@ Per favore scelto un altro nickname:</translation>
         <translation>Carica mappa disegnata</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Mappe Disegnate (*.hwmap);;Tutti i file (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Salva mappa disegnata</translation>
     </message>
@@ -505,6 +435,10 @@ Per favore scelto un altro nickname:</translation>
         <source>All files</source>
         <translation>Tutti i file</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation>Gomma</translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -520,24 +454,6 @@ Per favore scelto un altro nickname:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Il premio per il miglior colpo è stato vinto da <b>%1</b> , con <b>%2</b> punti.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Il miglior killer è <b>%1</b> con <b>%2</b> uccisione in un turno.</p></numerusform>
-            <numerusform><p>Il miglior killer è <b>%1</b> con <b>%2</b> uccisioni in un turno.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Durante questo round è stato ucciso <b>%1</b> riccio in totale.</p></numerusform>
-            <numerusform><p>Un totale di <b>%1</b> ricci sono stati uccisi durante questo round.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Dettagli</translation>
     </message>
@@ -564,7 +480,7 @@ Per favore scelto un altro nickname:</translation>
         <source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
         <translation>
             <numerusform><p>Durante questo round sono stati uccisi <b>%1</b> ricci in totale.</p></numerusform>
-            <numerusform><p>Un totale di <b>%1</b> ricci sono stati uccisi durante questo round.</p></numerusform>
+            <numerusform><p>Un totale di <b>%1</b> è stato ucciso durante questo round.</p></numerusform>
         </translation>
     </message>
     <message numerus="yes">
@@ -600,19 +516,18 @@ Per favore scelto un altro nickname:</translation>
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
-        <translation type="unfinished"></translation>
+        <translation>In Game....</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Gioco locale (Gioca una partita su un singolo computer)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Gioco in rete (Gioca una partita attraverso la rete)</translation>
+        <source>Open the snapshot folder</source>
+        <translation>Apri cartella schermate</translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -621,67 +536,67 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
         <comment>Tips</comment>
-        <translation>Alcune armi potrebbero fare pochi danni ma possono essere molto più devastanti al momento giusto. Prova a usare la Desert Eagle per spingere più ricci in acqua.</translation>
+        <translation>Alcune armi potrebbero fare pochi danni ma possono essere devastanti se usate al momento giusto. Prova ad esempio ad utilizzare la Desert Eagle per spingere più ricci in acqua.</translation>
     </message>
     <message>
         <source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
         <comment>Tips</comment>
-        <translation>Se non sai cosa fare e non vuoi sprecare munizioni, salta il turno. Ma non troppe volte perché c'è il Sudden Death!</translation>
+        <translation>Se non sai cosa fare e non vuoi sprecare munizioni, salta il turno. Ma non farlo troppe volte perché c'è il Sudden Death!</translation>
     </message>
     <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
-        <translation>Se vuoi evitare che altri possano usare il tuo nickname preferito sul server ufficiali, registrati su http://www.hedgewars.org/.</translation>
+        <translation>Se vuoi evitare che altri possano impersonarti, utilizzando il tuo nickname, sul server ufficiale, registrati su http://www.hedgewars.org/.</translation>
     </message>
     <message>
         <source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
         <comment>Tips</comment>
-        <translation>Sei stanco delle partite predefinite? Prova una delle missioni - offrono partite differenti in base alle tue scelte.</translation>
+        <translation>Sei stanco delle partite preimpostate? Prova una missione - le missioni offrono interessanti modalità differenti di partite in base alle tue scelte.</translation>
     </message>
     <message>
         <source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
         <comment>Tips</comment>
-        <translation>Il gioco salverà sempre l'ultima partita giocata come demo. Selezione 'Local Game' e clicca il bottone 'Demos' nell'angolo in basso a destra per gestire le demo.</translation>
+        <translation>Il gioco salverà sempre l'ultima partita giocata come demo. Seleziona 'Gioco locale' e clicca il bottone 'Demos' nell'angolo in basso a destra per gestirle.</translation>
     </message>
     <message>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
         <comment>Tips</comment>
-        <translation>Hedgewars è un programma Open Source e gratuito che creiamo nel nostro tempo libero. Se hai problemi, chiedi nei nostri forum ma, per favore, non aspettarti supporto 24/7!</translation>
+        <translation>Hedgewars è un programma Open Source e gratuito che noi creiamo nel nostro tempo libero. Se hai problemi, chiedi nei nostri forum ma, per favore, non aspettarti un supporto 24/7!</translation>
     </message>
     <message>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
         <comment>Tips</comment>
-        <translation>Hedgewars è un programma Open Source e gratuito che creiamo nel nostro tempo libero. Se ti piace, aiutaci con una piccola donazione o contribuisci col tuo lavoro!</translation>
+        <translation>Hedgewars è un programma Open Source e gratuito che creiamo nel nostro tempo libero. Se ti piace, aiutaci con una piccola donazione o contribuisci con il tuo lavoro!</translation>
     </message>
     <message>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
         <comment>Tips</comment>
-        <translation>Hedgewars è un programma Open Source e gratuito che creiamo nel nostro tempo libero. Condividilo colla tua famiglia e cogli amici come più ti piace!</translation>
+        <translation>Hedgewars è un programma Open Source e gratuito che creiamo nel nostro tempo libero. Condividilo con tutta la famiglia e e con gli amici come più ti piace!</translation>
     </message>
     <message>
         <source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
         <comment>Tips</comment>
-        <translation>Di tanto in tanto ci saranno tornei ufficiali. Gli eventi imminenti saranno annunciati su http://www.hedgewars.org/ con qualche giorno di anticipo.</translation>
+        <translation>Di tanto in tanto ci saranno tornei ufficiali. Gli eventi saranno annunciati su http://www.hedgewars.org/ con qualche giorno di anticipo.</translation>
     </message>
     <message>
         <source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
         <comment>Tips</comment>
-        <translation>Hedgewars è disponibile in molte lingue. Se la traduzione nella tua lingua sembra mancante o non aggiornata, per favore contattaci!</translation>
+        <translation>Hedgewars è disponibile in molte lingue. Se la traduzione nella tua lingua sembra mancante o non aggiornata, sentiti libero di contattaci!</translation>
     </message>
     <message>
         <source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
         <comment>Tips</comment>
-        <translation>Hedgewars può essere usato su molti sistemi operativi differenti come Microsoft Windows, Mac OS X e GNU/Linux.</translation>
+        <translation>Hedgewars può essere usato su molti sistemi operativi differenti come Microsoft Windows - XP, Vista, 7 -, Mac OS X e Linux.</translation>
     </message>
     <message>
         <source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
         <comment>Tips</comment>
-        <translation>Ricordati che sei sempre in grado di configurare i tuoi giochi in locale e in rete/online. Non sei limitato all'opzione 'Simple Game'.</translation>
+        <translation>Ricordati che sei sempre in grado di configurare partire personalizzate in locale e online. Non devi sentirti limitato alle opzioni predefinite!</translation>
     </message>
     <message>
         <source>While playing you should give yourself a short break at least once an hour.</source>
         <comment>Tips</comment>
-        <translation>Durante il gioco dovresti fare una breve pausa almeno ogni ora.</translation>
+        <translation>Durante il gioco dovresti fare una breve pausa almeno ogni ora. In caso di partite più lunghe, sospendi l'attività per almeno 30 minuti al termine del gioco!</translation>
     </message>
     <message>
         <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
@@ -691,12 +606,12 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
         <comment>Tips</comment>
-        <translation>Siamo aperti a suggerimenti e consigli costruttivi. Se non ti piace qualcosa o hai una buona idea, faccelo sapere!</translation>
+        <translation>Siamo aperti a suggerimenti e consigli costruttivi. Se non ti piace qualcosa o hai una buona idea, comunicacelo!</translation>
     </message>
     <message>
         <source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
         <comment>Tips</comment>
-        <translation>Specialmente quando giochi online sii educato e ricorda che potrebbero esserci dei minorenni che stanno giocando con te o contro di te!</translation>
+        <translation>In particolare quando giochi online sii educato e ricorda che potrebbero esserci dei minorenni che stanno giocando con te o contro di te!</translation>
     </message>
     <message>
         <source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
@@ -711,7 +626,7 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
         <comment>Tips</comment>
-        <translation>Hedgwars può essere perfetto per brevi partite durante le pause. Solo assicurati di non aggiungere troppi ricci o di usare una mappa gigante. Ridurre durata e vita può aiutare allo stesso modo.</translation>
+        <translation>Hedgewars può essere perfetto per brevi partite durante le pause. Assicurati solamente di non aver aggiunto troppi ricci o di usare una mappa troppo grande. Ridurre tempo e vita può aiutare allo stesso modo.</translation>
     </message>
     <message>
         <source>No hedgehogs were harmed in making this game.</source>
@@ -751,7 +666,7 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
         <comment>Tips</comment>
-        <translation>Alcune armi richiedono stragetie particolari o semplicemente molto allenamento quindi non arrenderti con uno specifico attrezzo se manchi il nemico una volta.</translation>
+        <translation>Alcune armi richiedono strategie particolari o semplicemente molto allenamento, quindi non arrenderti nell'utilizzo di un'arma specifica se manchi il nemico una volta.</translation>
     </message>
     <message>
         <source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
@@ -761,17 +676,17 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
         <comment>Tips</comment>
-        <translation>Il vecchio Limburger causa solo una piccola esplosione. Comunque, il vento influisce sulla nuvola puzzolente e può avvelenare più ricci contemporaneamente.</translation>
+        <translation>Il vecchio Limburger causa solo una piccola esplosione. Tuttavia il vento influisce sulla nuvola puzzolente e può avvelenare più ricci contemporaneamente.</translation>
     </message>
     <message>
         <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
         <comment>Tips</comment>
-        <translation>Ultima Sonata è l'attacco aereo più dannoso. Perderai il tuo riccio, eseguendolo, quindi ci sono anche delle grosse controindicazioni.</translation>
+        <translation>L'Ultima Sonata è l'attacco aereo più dannoso. Perderai il tuo riccio, eseguendolo, quindi ci sono anche delle grosse controindicazioni.</translation>
     </message>
     <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
-        <translation>Mine Adesive è lo strumento perfetto per creare piccole reazioni a catena e spingere i ricci nemici in situazioni difficili... o in acqua.</translation>
+        <translation>Le Mine Adesive sono lo strumento perfetto per creare piccole reazioni a catena e spingere i ricci nemici in situazioni difficili... o in acqua.</translation>
     </message>
     <message>
         <source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
@@ -781,22 +696,22 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
         <comment>Tips</comment>
-        <translation>Se se ibloccato dietro un riccio nemico, usa il Martello per liberarti senza essere danneggiato da un'esplosione.</translation>
+        <translation>Se sei bloccato dietro un riccio nemico, usa il Martello per liberarti senza essere danneggiato da un'esplosione.</translation>
     </message>
     <message>
         <source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
         <comment>Tips</comment>
-        <translation>La distanza massima di camminata della Torta dipende dal terreno che deve attraversare. Usa [attacca] per farla esplodere prima.</translation>
+        <translation>La distanza massima di cammino della Torta dipende dal terreno che deve attraversare. Usa [attacca] per farla esplodere prima.</translation>
     </message>
     <message>
         <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
         <comment>Tips</comment>
-        <translation>Il Lanciafiamme è un'arma ma può essere usato anche per scavare gallerie.</translation>
+        <translation>Il Lanciafiamme è un'arma che può essere usata anche per scavare gallerie.</translation>
     </message>
     <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
-        <translation>Vuoi sapere chi c'è dietro il gioco? Clicca sul logo Hedgewars nel menu principale per vedere gli autori.</translation>
+        <translation>Vuoi sapere chi c'è dietro il gioco? Clicca sul logo Hedgewars nel menu principale per vederne gli autori e sviluppatori.</translation>
     </message>
     <message>
         <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
@@ -806,7 +721,7 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
         <comment>Tips</comment>
-        <translation>Sei livero di disegnare le tue tombe, cappelli, bandiere o anche mappe e temi! Ma nota che dovrai condividerli in qualche modo per usarli online.</translation>
+        <translation>Sentiti libero di disegnare tombe, cappelli, bandiere o anche mappe e temi personalizzati - lo puoi fare con TheGIMP! Ma nota che dovrai condividerli in qualche modo per usarli online.</translation>
     </message>
     <message>
         <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
@@ -821,27 +736,27 @@ Per favore scelto un altro nickname:</translation>
     <message>
         <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazione Hedgewars in "Documenti\Hedgewars". Crea delle copie di sicurezza o prendi i file con te, ma non modificarli a mano.</translation>
+        <translation>Puoi trovare i file di configurazione del gioco in "Documenti\Hedgewars". Crea delle copie di sicurezza o prendi i file con te, ma non modificarli manualmente!</translation>
     </message>
     <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
-        <translation>Puoi associare i file relativi a Hedgewars (partite salvate e registrazioni demo) al gioco, in modo da lanciarli dal tuo gestore file o browser Internet preferiti.</translation>
+        <translation>Puoi associare i file relativi a Hedgewars (partite salvate e registrazioni demo) al gioco, in modo da lanciarli direttamente dal tuo gestore file o browser Internet.</translation>
     </message>
     <message>
         <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
         <comment>Tips</comment>
-        <translation>Vuoi risparmiare le corde? Rilascia la corda a mezz'aria e spara di nuovo. Finché non tocchi il terreno potrai riusare la corda senza sprecare munizioni!</translation>
+        <translation>Vuoi utilizzare più a lungo la corda? Rilascia la corda a mezz'aria e spara di nuovo. Finché non tocchi il terreno potrai riusare la corda senza sprecare munizioni!</translation>
     </message>
     <message>
         <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazioen di Hedgewars in "Library/Application Support/Hedgewars" nella tua cartella utente. Crea una copia di sicurezza o porta i file con te, ma non modificarli a mano.</translation>
+        <translation>Puoi trovare i file di configurazione del gioco in "Library/Application Support/Hedgewars" nella tua cartella utente. Crea una copia di sicurezza o porta i file con te, ma non modificarli mai manualmente.</translation>
     </message>
     <message>
         <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
-        <translation>Puoi trovare i tuoi file di configurazioen di Hedgewars in ".hedgewars" nella tua cartella utente. Crea una copia di sicurezza o porta i file con te, ma non modificarli a mano.</translation>
+        <translation>Puoi trovare i file di configurazione del gioco in ".hedgewars" nella tua cartella home. Crea una copia di sicurezza o porta i file con te, ma non modificarli mai manualmente.</translation>
     </message>
     <message>
         <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
@@ -849,14 +764,9 @@ Per favore scelto un altro nickname:</translation>
         <translation>La versione Windows di Hedgewars supporta Xfire. Assicurati di aggiungere Hedgewars alla sua lista giochi, così i tuoi amici potranno vederti giocare.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">l'Ape a Ricerca può essere complessa da usare. Il suo raggio di curvatura dipende dalla velocità, quindi prova a non usare a piena potenza.</translation>
-    </message>
-    <message>
         <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
-        <translation>Usa la Bomba Molotov o il Lanciafiamme per impedire temporaneamente ai ricci di attraversari terreni come tunnel o piattaforme.</translation>
+        <translation>Usa la Bomba Molotov o il Lanciafiamme per impedire temporaneamente ai ricci di attraversari terreni pianeggianti, tunnel o collinette.</translation>
     </message>
     <message>
         <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
@@ -865,7 +775,47 @@ Per favore scelto un altro nickname:</translation>
     </message>
     <message>
         <source>Downloadable Content</source>
-        <translation>Contenuto scaricabile</translation>
+        <translation>Contenuti Scaricabili</translation>
+    </message>
+    <message>
+        <source>Local Game</source>
+        <translation>Gioco in locale</translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation>Gioca una partita offline</translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation>Gioco in rete</translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation>Gioca una partita attraverso una rete</translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation>Leggi chi c'è dietro allo sviluppo di Hedgewars</translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation>Lascia un feedback segnalando problemi, suggerendo nuove funzionalità o solamente indicando il tuo livello di gradimento del gioco.</translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation>Accedi al download di contenuti creati dalla comunità dal nostro sito web</translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation>Esci dal gioco</translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation>Organizza i video registrati tramite il gioco</translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation>Modifica preferenze</translation>
     </message>
 </context>
 <context>
@@ -876,33 +826,18 @@ Per favore scelto un altro nickname:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Seleziona il server dalla lista sottostante</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Controllo</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Inserisci il nome della stanza</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation>Contenuti Scaricabili</translation>
     </message>
 </context>
 <context>
@@ -915,6 +850,14 @@ Per favore scelto un altro nickname:</translation>
         <source>Official server</source>
         <translation>Server ufficiale</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation>Incontra centinaia di giocatori online!</translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation>Unisciti ad un server o creane uno nuovo per il gioco online in una rete LAN.</translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -931,18 +874,6 @@ Per favore scelto un altro nickname:</translation>
         <translation>Elimina squadra</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Nuovo schema armi</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Modifica schema armi</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Elimina schema armi</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Non puoi modificare le squadre in questo modo. Vai al menu principale per aggiungere, modificare o eliminare squadre.</translation>
     </message>
@@ -970,129 +901,79 @@ Per favore scelto un altro nickname:</translation>
         <source>Delete weapon set</source>
         <translation>Elimina set delle armi</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Rename dialog</source>
-        <translation>Rinomina</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>Inserisci il nome file:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Impossibile rinominarlo in</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Impossibile cancellare il file</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Seleziona un record dalla lista</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Crea</translation>
-    </message>
-    <message>
-        <source>Join</source>
-        <translation>Entra</translation>
+        <source>General</source>
+        <translation>Generale</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Aggiorna</translation>
+        <source>Advanced</source>
+        <translation>Avanzate</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
+        <source>Reset to default colors</source>
+        <translation>Ripristina colori originali</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Opzioni amministratore</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Room Name:</source>
-        <translation>Nome stanza:</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Questa partita è nella lobby.
-Puoi entrare e iniziare a giocare quando la partita inizia.</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Questa partita è in corso.
-Puoi entrare come spettatore ma dovrai aspettare la fine della partita per giocare.</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 è l'host. Può modificare le impostazioni e far partire il gioco.</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Mappa casuale</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Le partite possono essere giocate su mappe statiche o casuali.</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Lo Schema di Gioco definisce le opzioni generali e le preferenze come Tempo di Round, Sudden Death o Vampirismo.</translation>
+        <source>Rename dialog</source>
+        <translation>Rinomina</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Lo Schema delle Armi definisce le armi disponibili le loro munizioni.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>E' presente %1 utente connesso a questa stanza.</numerusform>
-            <numerusform>Sono presenti %1 utenti connessi a questa stanza.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>E' presente %1 squadra partecipante in questa stanza.</numerusform>
-            <numerusform>Sono presenti %1 squadre partecipanti in questa stanza.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Inserisci il nome del file:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Inserisci il nome della stanza</translation>
+        <source>Create</source>
+        <translation>Crea</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Seleziona la stanza dalla lista</translation>
+        <source>Join</source>
+        <translation>Entra</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Casuale</translation>
+        <source>Admin features</source>
+        <translation>Opzioni amministrative</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Stato:</translation>
+        <source>Room Name:</source>
+        <translation>Nome stanza:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1110,16 +991,6 @@ Puoi entrare come spettatore ma dovrai aspettare la fine della partita per gioca
         <source>Clear</source>
         <translation>Cancella</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Attenzione</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>La partita a cui stai cercando di unirti è già iniziata.
-Voui comunque entrare nella stanza?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1131,10 +1002,6 @@ Voui comunque entrare nella stanza?</translation>
 <context>
     <name>PageScheme</name>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Abilita mine casuali</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Guadagna in salute l'80% del danno che fai</translation>
     </message>
@@ -1175,16 +1042,12 @@ Voui comunque entrare nella stanza?</translation>
         <translation>Il terreno non può essere distrutto!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Aggiungi un bordo indistruttibile intorno al terreno</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Gravità zero</translation>
     </message>
     <message>
         <source>Assisted aiming with laser sight</source>
-        <translation>Mirino facilitato con LASER</translation>
+        <translation>Mira con più precisione grazie al mirino laser!</translation>
     </message>
     <message>
         <source>All hogs have a personal forcefield</source>
@@ -1204,7 +1067,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Ammo is shared between all teams that share a colour.</source>
-        <translation>Le munizioni sono condivise tra tutti i team che hanno lo stesso colore.</translation>
+        <translation>Le munizioni sono condivise tra tutte le squadre che hanno lo stesso colore.</translation>
     </message>
     <message>
         <source>Disable girders when generating random maps.</source>
@@ -1240,7 +1103,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Wind will affect almost everything.</source>
-        <translation>Il vento avrà effetto su praticamente ogni cosa.</translation>
+        <translation>Il vento avrà effetto su tutte (o quasi tutte) le armi.</translation>
     </message>
     <message>
         <source>Copy</source>
@@ -1248,7 +1111,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Teams in each clan take successive turns sharing their turn time.</source>
-        <translation>Le squadre di ogni clan possono avere turni consecutivi condividendo il tempo del loro turno.</translation>
+        <translation>Le squadre di ogni clan giocano turni consecutivi condividendo il tempo di ogni turno.</translation>
     </message>
     <message>
         <source>Add an indestructible border around the terrain</source>
@@ -1256,7 +1119,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Add an indestructible border along the bottom</source>
-        <translation>Aggiungi un bordo indistruttibile lungo la parte inferiore</translation>
+        <translation>Aggiungi un bordo indistruttibile lungo la parte inferiore della mappa</translation>
     </message>
 </context>
 <context>
@@ -1281,54 +1144,112 @@ Voui comunque entrare nella stanza?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Partita singola (Una partita veloce contro il computer, con le impostazioni scelte da te)</translation>
+        <source>Simple Game</source>
+        <translation>Partita Semplice</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multigiocatore (Gioca contro i tuoi amici, o squadre di AI)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Gioca una partita rapida contro il computer con impostazioni casuali</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modalità Allenamento (Allena le tue abilità in una gamma di missioni). IN SVILUPPO</translation>
+        <source>Multiplayer</source>
+        <translation>Multiplayer</translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (Guarda le partite registrate)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Gioca una partira controlo un amico oppure contro il computer</translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carica (Carica una partita precedentemente salvata)</translation>
+        <source>Campaign Mode</source>
+        <translation>Modalità Campagna</translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modalità Campagna. IN SVILUPPO</translation>
+        <source>Training Mode</source>
+        <translation>Modalità allenamento</translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Metti alla prova le tue capacità in una vasta gamma di missioni di addestramento</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation type="unfinished"></translation>
+        <source>Demos</source>
+        <translation>Demo</translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation>Visualizza demo registrate</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Carica</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
+        <translation>Carica un gioco salvato in precedenza</translation>
     </message>
 </context>
 <context>
     <name>PageTraining</name>
     <message>
         <source>No description available</source>
-        <translation type="unfinished"></translation>
+        <translation>Nessuna descrizione disponibile</translation>
     </message>
     <message>
         <source>Select a mission!</source>
-        <translation type="unfinished"></translation>
+        <translation>Seleziona una missione!</translation>
+    </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation>Scegli la missione, sfida o addestramento da intraprendere</translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation>Inizia combattimento</translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation>Nome</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation>Dimensione</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 bytes</numerusform>
+            <numerusform>%1 bytes</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation>(in corso...)</translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation>Data: </translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation>Dimensione: </translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation>encoding</translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation>caricamento</translation>
     </message>
 </context>
 <context>
     <name>QAction</name>
     <message>
         <source>Kick</source>
-        <translation>Caccia</translation>
+        <translation>Caccia via</translation>
     </message>
     <message>
         <source>Start</source>
@@ -1364,7 +1285,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Unignore</source>
-        <translation>Togli ignora</translation>
+        <translation>Non ignorare</translation>
     </message>
     <message>
         <source>Remove friend</source>
@@ -1410,10 +1331,6 @@ Voui comunque entrare nella stanza?</translation>
         <translation>Concatena data e ora di registrazione al nome file</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Qualità ridotta</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Mostra suggerimenti nel menu armi</translation>
     </message>
@@ -1427,7 +1344,27 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Frontend effects</source>
-        <translation>Effetti nel frontend</translation>
+        <translation>Effetti speciali nel frontend</translation>
+    </message>
+    <message>
+        <source>Save password</source>
+        <translation>Salva password</translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation>Salva nome utente e password</translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation>Il video è privato</translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation>Registra audio</translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation>Usa la risoluzione del gioco</translation>
     </message>
 </context>
 <context>
@@ -1469,12 +1406,8 @@ Voui comunque entrare nella stanza?</translation>
         <translation>In lobby</translation>
     </message>
     <message>
-        <source>In progress</source>
-        <translation>In corso</translation>
-    </message>
-    <message>
-        <source>Default</source>
-        <translation type="obsolete">Predefinito</translation>
+        <source>In progress</source>
+        <translation>In corso</translation>
     </message>
     <message>
         <source>hand drawn map...</source>
@@ -1510,7 +1443,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Side-by-side</source>
-        <translation>Lato-a-lato</translation>
+        <translation>Side-by-side</translation>
     </message>
     <message>
         <source>Top-Bottom</source>
@@ -1522,27 +1455,27 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Red/Cyan grayscale</source>
-        <translation>Scala di grigio rosso/azzurro</translation>
+        <translation>Scala di grigi rosso/azzurro</translation>
     </message>
     <message>
         <source>Cyan/Red grayscale</source>
-        <translation>Scala di grigio azzurro/rosso</translation>
+        <translation>Scala di grigi azzurro/rosso</translation>
     </message>
     <message>
         <source>Red/Blue grayscale</source>
-        <translation>Scala di grigio rosso/blu</translation>
+        <translation>Scala di grigi rosso/blu</translation>
     </message>
     <message>
         <source>Blue/Red grayscale</source>
-        <translation>Scala di grigio blu/rosso</translation>
+        <translation>Scala di grigi blu/rosso</translation>
     </message>
     <message>
         <source>Red/Green grayscale</source>
-        <translation>Scala di grigio rosso/verde</translation>
+        <translation>Scala di grigi rosso/verde</translation>
     </message>
     <message>
         <source>Green/Red grayscale</source>
-        <translation>Scala di grigio verde/rosso</translation>
+        <translation>Scala di grigi verde/rosso</translation>
     </message>
 </context>
 <context>
@@ -1553,7 +1486,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Key binds</source>
-        <translation>Associazione dei tasti</translation>
+        <translation>Associazione tasti</translation>
     </message>
     <message>
         <source>Fort</source>
@@ -1568,10 +1501,6 @@ Voui comunque entrare nella stanza?</translation>
         <translation>Opzioni Audio/Grafica</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Armi</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Gioco in rete</translation>
     </message>
@@ -1599,22 +1528,42 @@ Voui comunque entrare nella stanza?</translation>
         <source>Schemes and Weapons</source>
         <translation>Schemi di Gioco e Armi</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation>Colori personalizzati</translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation>Varie</translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation>Opzioni di registrazione video</translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation>Video</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Descrizione</translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
         <source>Mines Time</source>
-        <translation>Durata delle mine</translation>
+        <translation>Tempo delle mine</translation>
     </message>
     <message>
         <source>Mines</source>
         <translation>Mine</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Questo programma è distribuito sotto licenza GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Sviluppatori:</translation>
     </message>
@@ -1624,7 +1573,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Translations:</source>
-        <translation>Traduzioni:</translation>
+        <translation>Traduttori:</translation>
     </message>
     <message>
         <source>Special thanks:</source>
@@ -1640,7 +1589,7 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Port:</source>
-        <translation>Port:</translation>
+        <translation>Porta:</translation>
     </message>
     <message>
         <source>Resolution</source>
@@ -1651,10 +1600,6 @@ Voui comunque entrare nella stanza?</translation>
         <translation>Limite FPS</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Nickname di rete</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Nome del server:</translation>
     </message>
@@ -1688,11 +1633,11 @@ Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
         <source>Sudden Death Timeout</source>
-        <translation>Durata del sudden death</translation>
+        <translation>Durata del Sudden Death</translation>
     </message>
     <message>
         <source>Scheme Name:</source>
-        <translation>Nome dello schema:</translation>
+        <translation>Nome dello Schema:</translation>
     </message>
     <message>
         <source>Crate Drops</source>
@@ -1731,26 +1676,16 @@ Voui comunque entrare nella stanza?</translation>
         <translation>Lingua</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Riavvia il gioco per applicare</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Questa versione SVN è in corso d'opera e può non essere compatibile con le altre versioni del gioco.
-Alcune opzioni potrebbero essere incomplete o non funzionanti. Usatela a vostro rischio!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Esplosivi</translation>
     </message>
     <message>
         <source>Tip: </source>
-        <translation>Suggerimento:</translation>
+        <translation>Suggerimento: </translation>
     </message>
     <message>
         <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation>Questa versione di sviluppo è in corso d'opera e può non essere compatibile con le altre versioni del gioco. Alcune feature potrebbero essere incomplete o non funzionanti. Usatela a vostro rischio!</translation>
+        <translation>Questa versione di sviluppo è in corso d'opera e può non essere compatibile con le altre versioni del gioco. Alcune funzionalità potrebbero essere incomplete o non funzionanti. Usatela a vostro rischio!</translation>
     </message>
     <message>
         <source>Quality</source>
@@ -1777,47 +1712,103 @@ Alcune opzioni potrebbero essere incomplete o non funzionanti. Usatela a vostro
         <translation>% Lunghezza della Corda</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Tipo di gioco</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Resa stereo</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Opzioni di gioco</translation>
-    </message>
-    <message>
         <source>Style</source>
-        <translation>Style</translation>
+        <translation>Stile</translation>
     </message>
     <message>
         <source>Scheme</source>
         <translation>Schema</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
-        <translation>% tempo regalo</translation>
+        <translation>% Tempo Regalo (Get Away Time)</translation>
     </message>
     <message>
         <source>This program is distributed under the GNU General Public License v2</source>
-        <translation type="unfinished"></translation>
+        <translation>Questo programma è distribuito con licenza GNU General Public License v2</translation>
+    </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation>Ci sono video che stanno ancora venendo elaborati.
+Uscire ora annullerà questo processo e conseguentemente i video non verrano salvati.
+Vuoi veramente uscire?</translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation>Inserire il nome utente YouTube o l'indirizzo e-mail associato all'account Google.</translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation>Nome utente (o e-mail): </translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation>Password: </translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation>Titolo del video: </translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation>Descrizione del video:</translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation>Tag (separate da una virgola): </translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation>Riassunto   </translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Descrizione</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Nickname</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation>Formato</translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation>Codec audio</translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation>Codec video</translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation>Framerate</translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation>Bitrate (Kbps)</translation>
     </message>
 </context>
 <context>
     <name>QLineEdit</name>
     <message>
         <source>unnamed</source>
-        <translation>senza nome</translation>
+        <translation>senza_nome</translation>
     </message>
     <message>
         <source>hedgehog %1</source>
-        <translation>riccio %1</translation>
+        <translation>Riccio %1</translation>
+    </message>
+    <message>
+        <source>anonymous</source>
+        <translation>anonimo</translation>
     </message>
 </context>
 <context>
@@ -1830,10 +1821,6 @@ Alcune opzioni potrebbero essere incomplete o non funzionanti. Usatela a vostro
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Rete</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Connessione con il server persa</translation>
     </message>
@@ -1842,81 +1829,223 @@ Alcune opzioni potrebbero essere incomplete o non funzionanti. Usatela a vostro
         <translation>Errore</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Associazione delle estensioni a Hedgewars fallita.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation>E' necessario compilare tutti i campi</translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation>Errore durante l'autenticazione su google.com:</translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation>Nome utente e password non riconosciuti</translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation>Errore nell'invio dei dati a youtube.com:</translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Impossibile creare la directory %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Impossibile aprire la directory:
-%1
-Controllare la propria installazione</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Armi</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Non è possibile modificare il set di armi predefinito</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Impossibile avviare il server: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Non è possibile eliminare il set di armi predefinito</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Vuoi davvero eliminare questo set di armi?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Impossibile sovrascrivere il set delle armi predefinito '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Associazione delle estensioni a Hedgewars completata con successo.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Associazione delle estensioni a Hedgewars fallita.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Squadre</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Inserisci il nome della stanza</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Eliminare veramente questa squadra?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Seleziona un record dalla lista</translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Schemi di gioco</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Impossibile eliminare lo schema di gioco predefinito '%1'!</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Eliminare veramente questo schema di gioco?</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Impossibile elimininare il set delle armi predefinito '%1'!</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Seleziona la stanza dalla lista</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Errore</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Impossibile creare la directory %1</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">La partita a cui stai cercando di unirti è già iniziata.
+Voui comunque entrare nella stanza?</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished">Errore con il file</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nickname</translation>
     </message>
@@ -1997,14 +2126,42 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>more</source>
-        <translation>Altro</translation>
+        <translation>altro</translation>
+    </message>
+    <message>
+        <source>More info</source>
+        <translation>Più informazioni</translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation>Imposta opzioni predefinite</translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation>Apri cartella video</translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation>Riproduci</translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation>Carica su YouTube</translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation>Sospendi caricamento</translation>
     </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation>In corso</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Nome Stanza</translation>
+        <translation>Nome della Stanza</translation>
     </message>
     <message>
         <source>C</source>
@@ -2016,7 +2173,7 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Creata da</translation>
+        <translation>Proprietario</translation>
     </message>
     <message>
         <source>Map</source>
@@ -2030,6 +2187,18 @@ Controllare la propria installazione</translation>
         <source>Weapons</source>
         <translation>Armi</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Mappa casuale</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Labirinto Casuale</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation>Disegnata a mano</translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -2059,21 +2228,6 @@ Controllare la propria installazione</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Errore</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Impossibile avviare il server: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Impossibile eseguire il motore: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2089,37 +2243,33 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Fort Mode</source>
-        <translation>Modalità fortino</translation>
+        <translation>Modalità Fortino</translation>
     </message>
     <message>
         <source>Divide Teams</source>
-        <translation>Dividi le squadre</translation>
+        <translation>Dividi le Squadre</translation>
     </message>
     <message>
         <source>Solid Land</source>
-        <translation>Terreno solido</translation>
+        <translation>Terreno Solido</translation>
     </message>
     <message>
         <source>Add Border</source>
-        <translation>Aggiungi bordo</translation>
+        <translation>Aggiunta Bordo</translation>
     </message>
     <message>
         <source>Low Gravity</source>
-        <translation>Gravità zero</translation>
+        <translation>Gravità Zero</translation>
     </message>
     <message>
         <source>Laser Sight</source>
-        <translation>Vista LASER</translation>
+        <translation>Vista Laser</translation>
     </message>
     <message>
         <source>Invulnerable</source>
         <translation>Invulnerabilità</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Aggiungi mine</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Ordine Casuale</translation>
     </message>
@@ -2141,7 +2291,7 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Disable Land Objects</source>
-        <translation>Disabilità Oggetti</translation>
+        <translation>Disabilita Oggetti Terreno</translation>
     </message>
     <message>
         <source>AI Survival Mode</source>
@@ -2149,7 +2299,7 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Reset Health</source>
-        <translation>Resetta la Vita</translation>
+        <translation>Resetta la vita allo stato di partenza</translation>
     </message>
     <message>
         <source>Unlimited Attacks</source>
@@ -2157,11 +2307,11 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Reset Weapons</source>
-        <translation>Resetta le Armi</translation>
+        <translation>Resetta le armi allo stato di partenza</translation>
     </message>
     <message>
         <source>Per Hedgehog Ammo</source>
-        <translation>Munzioni non Condivise con gli altri Ricci</translation>
+        <translation>Munzioni non condivise con gli altri ricci</translation>
     </message>
     <message>
         <source>Disable Wind</source>
@@ -2173,11 +2323,11 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>Tag Team</source>
-        <translation>Squadre etichettate</translation>
+        <translation>Tag Team</translation>
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation>Aggiungi bordo inferiore</translation>
+        <translation>Aggiungi Bordo Inferiore</translation>
     </message>
 </context>
 <context>
@@ -2204,7 +2354,7 @@ Controllare la propria installazione</translation>
     </message>
     <message>
         <source>put</source>
-        <translation>usa</translation>
+        <translation>usa/piazza sul terreno</translation>
     </message>
     <message>
         <source>switch</source>
@@ -2344,6 +2494,14 @@ ricci</translation>
         <source>slot 10</source>
         <translation>slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation>disattiva audio</translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation>registra</translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2392,7 +2550,7 @@ ricci</translation>
     </message>
     <message>
         <source>Set the timer on bombs and timed weapons:</source>
-        <translation>Imposta il timer su bombe e armi a tempo:</translation>
+        <translation>Imposta il timer di granate e armi a tempo:</translation>
     </message>
     <message>
         <source>Move the camera to the active hog:</source>
@@ -2424,12 +2582,16 @@ ricci</translation>
     </message>
     <message>
         <source>Take a screenshot:</source>
-        <translation>Fotografa una schermata:</translation>
+        <translation>Cattura la schermata:</translation>
     </message>
     <message>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Cambia le etichette sui ricci:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Registra video:</translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_ja.ts b/share/hedgewars/Data/Locale/hedgewars_ja.ts
index 2551c85..de4eac5 100644
--- a/share/hedgewars/Data/Locale/hedgewars_ja.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_ja.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ja">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -47,14 +39,6 @@
         <translation>武器を編集</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>弾薬配分は不規則</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>しくみを編集</translation>
     </message>
@@ -68,23 +52,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 さんは無視リストから削除されています</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 さんは無視リストに追加されています</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 さんは友達リストから削除されています</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 さんは友達リストに追加されています</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -129,38 +104,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">作成</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>サーバーのスタートが不可能</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>ファイル%1に保存することができません</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>上方のリストからレコードを選んで下さい</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -187,10 +138,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">パスワード</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ Hedgewars.orgに登録されました。
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -345,10 +290,6 @@ Please pick another nickname:</source>
         <translation>けとばされました</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">パスワード</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 さんはルームに参加しています</translation>
     </message>
@@ -365,18 +306,33 @@ Please pick another nickname:</source>
         <translation>%1 *** %2 さんは退室</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">あなたの「%1」というニック名は
-Hedgewars.orgに登録されました。
-下にパスワードを入力して、または
-ゲーム構成に別の名を選択してください:
-</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">パスワード</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -388,6 +344,26 @@ Hedgewars.orgに登録されました。
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -424,10 +400,6 @@ Hedgewars.orgに登録されました。
         <source>Connecting...</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">キャンセル</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -463,6 +435,10 @@ Hedgewars.orgに登録されました。
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -478,10 +454,6 @@ Hedgewars.orgに登録されました。
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p> <b>%2</b> で <b>%1</b> が一番良いショットの賞をもらった </p></translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -542,15 +514,14 @@ Hedgewars.orgに登録されました。
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>ロカール ゲーム (一台のパソコンゲーム)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>ネットワーク ゲーム</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -800,6 +771,46 @@ Hedgewars.orgに登録されました。
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -809,32 +820,17 @@ Hedgewars.orgに登録されました。
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>下のリストの中でサーバーを選択下さい</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>コントロール</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">エラー</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">ルーム名を入力してください</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -848,6 +844,14 @@ Hedgewars.orgに登録されました。
         <source>Official server</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -891,178 +895,127 @@ Hedgewars.orgに登録されました。
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>エラー</translation>
+        <source>General</source>
+        <translation type="unfinished">一般</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">高級</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Rename dialog</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>新しいファイル名:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Cannot rename to</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>ファイル削除は不可能</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>録画を選択下さい</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>作成</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>接続</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>æ›´æ–°</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>エラー</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Rename dialog</source>
+        <translation>Rename dialog</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation type="unfinished">アドミン機能</translation>
+        <source>Enter new file name:</source>
+        <translation>新しいファイル名:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation type="unfinished">ルーム名:</translation>
+        <source>Create</source>
+        <translation>作成</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished">このゲームはロビー中。</translation>
+        <source>Join</source>
+        <translation>接続</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished"></translation>
+        <source>Admin features</source>
+        <translation type="unfinished">アドミン機能</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished"></translation>
+        <source>Room Name:</source>
+        <translation type="unfinished">ルーム名:</translation>
     </message>
     <message>
-        <source>Random Map</source>
+        <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
+        <source>Weapons:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <source>Search:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
+        <source>%1 players online</source>
         <translation type="unfinished">
             <numerusform></numerusform>
         </translation>
     </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>ルーム名を入力してください</translation>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Maze</source>
+        <source>Land can not be destroyed!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Rules:</source>
+        <source>Lower gravity</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons:</source>
+        <source>Assisted aiming with laser sight</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Search:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Land can not be destroyed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Lower gravity</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Assisted aiming with laser sight</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>All hogs have a personal forcefield</source>
+        <source>All hogs have a personal forcefield</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -1184,31 +1137,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>簡単ゲーム (パソコンとのゲーム、自動設定)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>マルチプレイヤー (パソコンまたは友達との戦い)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">訓練モード (訓練任務で上達) 開発中</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>デモ (録画されたデモを見る)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>ロード (その前保存したゲームをやる)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">ロード</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1222,6 +1191,51 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1324,6 +1338,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1368,10 +1402,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">デフォールト</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1459,10 +1489,6 @@ Do you still want to join the room?</source>
         <translation>チーム</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">武器</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>オディオ/画面 設定</translation>
     </message>
@@ -1494,6 +1520,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1510,10 +1560,6 @@ Do you still want to join the room?</source>
         <translation>バーション</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>開発者:</translation>
     </message>
@@ -1546,10 +1592,6 @@ Do you still want to join the room?</source>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>ネット別名</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resolution</translation>
     </message>
@@ -1626,10 +1668,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1678,10 +1716,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">パスワード</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1689,6 +1723,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1700,6 +1796,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1711,10 +1811,6 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>ネットワーク</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>サーバーの接続は切断された</translation>
     </message>
@@ -1723,80 +1819,220 @@ Do you still want to join the room?</source>
         <translation>エラー</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">フォルダー%1作成拒否</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>フォルダー
- %1 は開かれなかった
-インストールをチェックしてください</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>武器</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">デフォールトセットの編集は不可能</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">サーバー%1の起動は出来なかった</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">デフォールトセットの削除は不可能</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>本当にこのデフォールトセットを削除する?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">チーム</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">ルーム名を入力してください</translation>
+    </message>
+    <message>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">録画を選択下さい</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Please select room from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>エラー</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>フォルダー%1作成拒否</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>オケ</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QObject</name>
     <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
@@ -1880,9 +2116,37 @@ Please check your installation</source>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation type="unfinished"></translation>
@@ -1911,6 +2175,18 @@ Please check your installation</source>
         <source>Weapons</source>
         <translation type="unfinished">武器</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -1940,21 +2216,6 @@ Please check your installation</source>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>エラー</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>サーバー%1の起動は出来なかった</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>エンジン%1の起動は出来なかった</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2221,6 +2482,14 @@ info</source>
         <source>slot 10</source>
         <translation type="unfinished">スロットX</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2307,6 +2576,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_ko.ts b/share/hedgewars/Data/Locale/hedgewars_ko.ts
index 817635d..3d63535 100644
--- a/share/hedgewars/Data/Locale/hedgewars_ko.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_ko.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ko">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
+        <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -47,14 +39,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation type="unfinished"></translation>
     </message>
@@ -68,6 +52,13 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
@@ -113,34 +104,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -167,10 +138,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -186,14 +153,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -340,6 +305,32 @@ Please pick another nickname:</source>
         <source>User quit</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>KB</name>
@@ -349,6 +340,26 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -420,6 +431,10 @@ Please pick another nickname:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -495,15 +510,14 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
+    <name>PageInfo</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
+        <source>Open the snapshot folder</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -753,211 +767,202 @@ Please pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageMultiplayer</name>
     <message>
-        <source>Start</source>
+        <source>Local Game</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNet</name>
     <message>
-        <source>Error</source>
+        <source>Play a game on a single computer</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select server from the list above</source>
+        <source>Network Game</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNetGame</name>
     <message>
-        <source>Control</source>
+        <source>Play a game across a network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>Read about who is behind the Hedgewars Project</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Access the user created content downloadable from our website</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNetType</name>
     <message>
-        <source>LAN game</source>
+        <source>Exit game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Official server</source>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>PageOptions</name>
+    <name>PageMultiplayer</name>
     <message>
-        <source>New team</source>
+        <source>Start</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageNetGame</name>
     <message>
-        <source>Edit team</source>
+        <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete team</source>
+        <source>DLC</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageNetType</name>
     <message>
-        <source>New scheme</source>
+        <source>LAN game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit scheme</source>
+        <source>Official server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete scheme</source>
+        <source>Join hundreds of players online!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New weapon set</source>
+        <source>Join or host your own game server in a Local Area Network.</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageOptions</name>
     <message>
-        <source>Edit weapon set</source>
+        <source>New team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete weapon set</source>
+        <source>Edit team</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
+        <source>Delete team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Rename dialog</source>
+        <source>New scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
+        <source>Edit scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
+        <source>Delete scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
+        <source>New weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
+        <source>Edit weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
+        <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
+        <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
+        <source>Advanced</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>Reset to default colors</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Proxy host</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
+        <source>Proxy port</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Room Name:</source>
+        <source>Proxy login</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
+        <source>Proxy password</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
+        <source>No proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <source>Socks5 proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
+        <source>HTTP proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
+        <source>System proxy settings</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <source>Rename dialog</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
+</context>
+<context>
+    <name>PageRoomsList</name>
+    <message>
+        <source>Create</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
+        <source>Join</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
+        <source>Admin features</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Maze</source>
+        <source>Room Name:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -976,15 +981,6 @@ You may join and spectate now but you'll have to wait for the game to end t
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1137,116 +1133,181 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
+        <source>Simple Game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
+        <source>Play a quick game against the computer with random settings</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
+        <source>Multiplayer</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
+        <source>Play a hotseat game against your friends, or AI teams</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Campaign Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageTraining</name>
     <message>
-        <source>No description available</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select a mission!</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QAction</name>
     <message>
-        <source>Kick</source>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Info</source>
+        <source>Load</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Start</source>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageTraining</name>
     <message>
-        <source>Restrict Joins</source>
+        <source>No description available</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restrict Team Additions</source>
+        <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Ban</source>
+        <source>Pick the mission or training to play</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Follow</source>
+        <source>Start fighting</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageVideos</name>
     <message>
-        <source>Ignore</source>
+        <source>Name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add friend</source>
+        <source>Size</source>
         <translation type="unfinished"></translation>
     </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
     <message>
-        <source>Unignore</source>
+        <source>(in progress...)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove friend</source>
+        <source>Date: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Update</source>
+        <source>Size: </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QCheckBox</name>
     <message>
-        <source>Check for updates at startup</source>
+        <source>encoding</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen</source>
+        <source>uploading</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QAction</name>
     <message>
-        <source>Frontend fullscreen</source>
+        <source>Kick</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enable sound</source>
+        <source>Info</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enable music</source>
+        <source>Start</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show FPS</source>
+        <source>Restrict Joins</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Restrict Team Additions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Ban</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Follow</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Ignore</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Add friend</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unignore</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Remove friend</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QCheckBox</name>
+    <message>
+        <source>Check for updates at startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Fullscreen</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Frontend fullscreen</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Enable sound</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Enable music</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Show FPS</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -1273,6 +1334,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1435,6 +1516,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1483,10 +1588,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1563,10 +1664,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1615,15 +1712,73 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
+        <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>% Get Away Time</source>
+        <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License v2</source>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1637,6 +1792,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1648,83 +1807,229 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
+        <source>Connection to server is lost</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
+        <source>Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
+
+Please check your installation!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
+        <source>TCP - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
+        <source>Unable to start the server: %1.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Unable to run engine at </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Error code: %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please enter room name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Please select record from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1807,9 +2112,37 @@ Please check your installation</source>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation type="unfinished"></translation>
@@ -1838,46 +2171,43 @@ Please check your installation</source>
         <source>Weapons</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>SelWeaponWidget</name>
     <message>
-        <source>Weapon set</source>
+        <source>Random Map</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Probabilities</source>
+        <source>Random Maze</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Ammo in boxes</source>
+        <source>Hand-drawn</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>SelWeaponWidget</name>
     <message>
-        <source>Delays</source>
+        <source>Weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>new</source>
+        <source>Probabilities</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>copy of</source>
+        <source>Ammo in boxes</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>TCPBase</name>
     <message>
-        <source>Error</source>
+        <source>Delays</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to start the server: %1.</source>
+        <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to run engine: %1 (</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -2147,6 +2477,14 @@ info</source>
         <source>slot 10</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2233,6 +2571,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_lt.ts b/share/hedgewars/Data/Locale/hedgewars_lt.ts
index 489ac25..4411760 100644
--- a/share/hedgewars/Data/Locale/hedgewars_lt.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_lt.ts
@@ -2,34 +2,23 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="lt_LT">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="672"/>
-        <source>new</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="678"/>
-        <source>copy of</source>
+        <location filename="../../../../QTfrontend/ui/page/AbstractPage.cpp" line="51"/>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="89"/>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="102"/>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="89"/>
-        <source>Cannot open file '%1' for writing</source>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="673"/>
+        <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="102"/>
-        <source>Cannot read file '%1'</source>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="679"/>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -53,95 +42,88 @@
 <context>
     <name>GameCFGWidget</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="53"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="54"/>
         <source>Game Options</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="109"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="79"/>
         <source>Edit schemes</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="124"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="94"/>
         <source>Edit weapons</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="132"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="102"/>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWAskQuitDialog</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="301"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="301"/>
-        <source>Illegal ammo scheme</source>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="33"/>
+        <source>Do you really want to quit?</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>HWChatWidget</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="714"/>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="753"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="627"/>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="767"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="637"/>
         <source>%1 has been added to your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="790"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="667"/>
         <source>%1 has been removed from your friends list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="803"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="676"/>
         <source>%1 has been added to your friends list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="928"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="742"/>
         <source>Stylesheet imported from %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="929"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="743"/>
         <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="937"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="751"/>
         <source>Couldn't read %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="945"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="759"/>
         <source>StyleSheet discarded</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="970"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="784"/>
         <source>StyleSheet saved to %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="973"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="787"/>
         <source>Failed to save StyleSheet to %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="993"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="807"/>
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
@@ -149,39 +131,18 @@
 <context>
     <name>HWForm</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="392"/>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="394"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="463"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="465"/>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="489"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="569"/>
         <source>Game aborted</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="692"/>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="973"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="693"/>
-        <source>Please select record from the list above</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="694"/>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="729"/>
-        <source>Password</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="729"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="981"/>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -189,58 +150,51 @@ or pick another nickname in game config:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="732"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="985"/>
         <source>No password supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="748"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1011"/>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="748"/>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="751"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
         <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="974"/>
-        <source>Unable to start the server</source>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1011"/>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1149"/>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1385"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1430"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1717"/>
         <source>Cannot save record to file %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1337"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1660"/>
         <source>Hedgewars Demo File</source>
         <comment>File Types</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1338"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1661"/>
         <source>Hedgewars Save File</source>
         <comment>File Types</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1377"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1709"/>
         <source>Demo name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1377"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1709"/>
         <source>Demo name:</source>
         <translation type="unfinished"></translation>
     </message>
@@ -248,12 +202,13 @@ Please pick another nickname:</source>
 <context>
     <name>HWGame</name>
     <message>
-        <location filename="../../../../QTfrontend/game.cpp" line="313"/>
+        <location filename="../../../../QTfrontend/game.cpp" line="350"/>
+        <location filename="../../../../QTfrontend/net/recorder.cpp" line="118"/>
         <source>en.txt</source>
         <translation>lt.txt</translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/game.cpp" line="324"/>
+        <location filename="../../../../QTfrontend/game.cpp" line="361"/>
         <source>Cannot open demofile %1</source>
         <translation type="unfinished"></translation>
     </message>
@@ -261,92 +216,92 @@ Please pick another nickname:</source>
 <context>
     <name>HWMapContainer</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="166"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="82"/>
         <source>Map</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="169"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="85"/>
         <source>Filter</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="173"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="89"/>
         <source>All</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="174"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="90"/>
         <source>Small</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="175"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="91"/>
         <source>Medium</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="176"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="92"/>
         <source>Large</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="177"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="93"/>
         <source>Cavern</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="178"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="94"/>
         <source>Wacky</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="183"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="99"/>
         <source>Type</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="187"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="103"/>
         <source>Small tunnels</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="188"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="104"/>
         <source>Medium tunnels</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="189"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="105"/>
         <source>Large tunnels</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="190"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="106"/>
         <source>Small floating islands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="191"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="107"/>
         <source>Medium floating islands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="192"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="108"/>
         <source>Large floating islands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="202"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="118"/>
         <source>Themes</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="244"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="162"/>
         <source>Seed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="613"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="555"/>
         <source>Set</source>
         <translation type="unfinished"></translation>
     </message>
@@ -354,17 +309,17 @@ Please pick another nickname:</source>
 <context>
     <name>HWNetServersModel</name>
     <message>
-        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="45"/>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="46"/>
         <source>Title</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="46"/>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="48"/>
         <source>IP</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="47"/>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="50"/>
         <source>Port</source>
         <translation type="unfinished"></translation>
     </message>
@@ -372,59 +327,91 @@ Please pick another nickname:</source>
 <context>
     <name>HWNewNet</name>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="50"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="71"/>
         <source>User quit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="189"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="212"/>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="215"/>
         <source>The host was not found. Please check the host name and port settings.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="192"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="218"/>
         <source>Connection refused</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="379"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="276"/>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="648"/>
         <source>Room destroyed</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="385"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="447"/>
         <source>You got kicked</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="408"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="597"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="724"/>
         <source>%1 *** %2 has joined the room</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="430"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="471"/>
         <source>%1 *** %2 has joined</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="443"/>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="467"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="518"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="739"/>
         <source>%1 *** %2 has left</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="445"/>
-        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="469"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="520"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="741"/>
         <source>%1 *** %2 has left (%3)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1285"/>
         <source>Quit reason: </source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_password.cpp" line="30"/>
+        <source>Password</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="53"/>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="149"/>
+        <source>Upload</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>KB</name>
     <message>
         <location filename="../../../../QTfrontend/KB.h" line="28"/>
@@ -433,6 +420,30 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="282"/>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="294"/>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="298"/>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="302"/>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="34"/>
@@ -481,44 +492,49 @@ Please pick another nickname:</source>
 <context>
     <name>PageDrawMap</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="31"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="32"/>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="34"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="32"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="35"/>
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="33"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="36"/>
         <source>Load</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="34"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="37"/>
         <source>Save</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="57"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
         <source>Load drawn map</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="57"/>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="65"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
         <source>Drawn Maps</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="57"/>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="65"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="65"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
         <source>Save drawn map</source>
         <translation type="unfinished"></translation>
     </message>
@@ -554,12 +570,12 @@ Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="170"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="173"/>
         <source>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</source>
         <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="177"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="181"/>
         <source>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -568,7 +584,7 @@ Please pick another nickname:</source>
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="183"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="188"/>
         <source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -577,7 +593,7 @@ Please pick another nickname:</source>
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="244"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="252"/>
         <source>(%1 kill)</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -586,7 +602,7 @@ Please pick another nickname:</source>
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="254"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="263"/>
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -595,7 +611,7 @@ Please pick another nickname:</source>
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="261"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="271"/>
         <source><b>%1</b> killed <b>%2</b> of his own hedgehogs.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -604,7 +620,7 @@ Please pick another nickname:</source>
         </translation>
     </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="268"/>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="279"/>
         <source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
         <translation type="unfinished">
             <numerusform></numerusform>
@@ -622,312 +638,360 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageinfo.cpp" line="44"/>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageMain</name>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="45"/>
-        <source>Local Game (Play a game on a single computer)</source>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="46"/>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="50"/>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="51"/>
+        <source>Play a game across a network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="49"/>
-        <source>Network Game (Play a game across a network)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="58"/>
+        <source>Read about who is behind the Hedgewars Project</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="57"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="63"/>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="67"/>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="104"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="69"/>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="89"/>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="93"/>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="97"/>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="128"/>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="105"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="129"/>
         <source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="106"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="130"/>
         <source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="107"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="131"/>
         <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="108"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="132"/>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="109"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="133"/>
         <source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="110"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="134"/>
         <source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="111"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="135"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="112"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="136"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="113"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="137"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="114"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="138"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="115"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="139"/>
         <source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="116"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="140"/>
         <source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="117"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="141"/>
         <source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="118"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="142"/>
         <source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="119"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="143"/>
         <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="120"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="144"/>
         <source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="121"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="145"/>
         <source>While playing you should give yourself a short break at least once an hour.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="122"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="146"/>
         <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="123"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="147"/>
         <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="124"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="148"/>
         <source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="125"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="149"/>
         <source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="126"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="150"/>
         <source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="127"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="151"/>
         <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="128"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="152"/>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="129"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="153"/>
         <source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="130"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="154"/>
         <source>No hedgehogs were harmed in making this game.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="131"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="155"/>
         <source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="132"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="156"/>
         <source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="133"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="157"/>
         <source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="134"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="158"/>
         <source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="135"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="159"/>
         <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="136"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="160"/>
         <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="137"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="161"/>
         <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="138"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="162"/>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="139"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="163"/>
         <source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="140"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="164"/>
         <source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="141"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="165"/>
         <source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="142"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="166"/>
         <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="143"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="167"/>
         <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="144"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="168"/>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="145"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="169"/>
         <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="146"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="170"/>
         <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="147"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="171"/>
         <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="151"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="175"/>
         <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="152"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="176"/>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="154"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="178"/>
         <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="156"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="180"/>
         <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="158"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="182"/>
         <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
@@ -942,449 +1006,368 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
+    <name>PageNetGame</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="111"/>
-        <source>Error</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="65"/>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="66"/>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="111"/>
-        <source>Please select server from the list above</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="87"/>
+        <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>PageNetGame</name>
+    <name>PageNetType</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="84"/>
-        <source>Control</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="35"/>
+        <source>LAN game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="156"/>
-        <source>Error</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="36"/>
+        <source>Join or host your own game server in a Local Area Network.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="157"/>
-        <source>Please enter room name</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="37"/>
+        <source>Official server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="158"/>
-        <source>OK</source>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="38"/>
+        <source>Join hundreds of players online!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>PageNetType</name>
+    <name>PageOptions</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="35"/>
-        <source>LAN game</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="50"/>
+        <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="36"/>
-        <source>Official server</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="51"/>
+        <source>Advanced</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageOptions</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="76"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="77"/>
         <source>New team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="84"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="85"/>
         <source>Edit team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="92"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="93"/>
         <source>Delete team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="100"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="101"/>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="126"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="127"/>
         <source>New scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="133"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="134"/>
         <source>Edit scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="140"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="141"/>
         <source>Delete scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="154"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="155"/>
         <source>New weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="161"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="162"/>
         <source>Edit weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="168"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="169"/>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="111"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="134"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="146"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="157"/>
-        <source>Error</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="405"/>
+        <source>Reset to default colors</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="112"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="147"/>
-        <source>Please select record from the list</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="454"/>
+        <source>Proxy host</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="113"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="148"/>
-        <source>OK</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="455"/>
+        <source>Proxy port</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="122"/>
-        <source>Rename dialog</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="456"/>
+        <source>Proxy login</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="122"/>
-        <source>Enter new file name:</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="457"/>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="468"/>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="469"/>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="470"/>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="471"/>
+        <source>HTTP proxy</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="134"/>
-        <source>Cannot rename to</source>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="137"/>
+        <source>Rename dialog</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="157"/>
-        <source>Cannot delete file</source>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="137"/>
+        <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>PageRoomsList</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="40"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="44"/>
         <source>Room Name:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="67"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="71"/>
         <source>Rules:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="75"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="79"/>
         <source>Weapons:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="83"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="87"/>
         <source>Search:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="95"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="102"/>
         <source>Create</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="96"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="103"/>
         <source>Join</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="97"/>
-        <source>Refresh</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="98"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="104"/>
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="123"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="129"/>
         <source>Admin features</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="283"/>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="288"/>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="296"/>
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
     <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="302"/>
-        <source>There are %1 teams participating in this room.</source>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="492"/>
+        <source>%1 players online</source>
         <translation type="unfinished">
             <numerusform></numerusform>
             <numerusform></numerusform>
             <numerusform></numerusform>
         </translation>
     </message>
+</context>
+<context>
+    <name>PageScheme</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="310"/>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="72"/>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="315"/>
-        <source>Random Map</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="77"/>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="321"/>
-        <source>Random Maze</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="82"/>
+        <source>Land can not be destroyed!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="345"/>
-        <source>Games may be played on precreated or randomized maps.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="87"/>
+        <source>Add an indestructible border around the terrain</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="350"/>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="92"/>
+        <source>Lower gravity</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="355"/>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="97"/>
+        <source>Assisted aiming with laser sight</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="389"/>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="400"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="390"/>
-        <source>Please enter room name</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="391"/>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="402"/>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="401"/>
-        <source>Please select room from the list</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="437"/>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="438"/>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="447"/>
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="71"/>
-        <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="75"/>
-        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="79"/>
-        <source>Land can not be destroyed!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="83"/>
-        <source>Add an indestructible border around the terrain</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="87"/>
-        <source>Lower gravity</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="91"/>
-        <source>Assisted aiming with laser sight</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="95"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="102"/>
         <source>All hogs have a personal forcefield</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="99"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="107"/>
         <source>All (living) hedgehogs are fully restored at the end of turn</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="103"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="112"/>
         <source>Gain 80% of the damage you do back in health</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="107"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="117"/>
         <source>Share your opponents pain, share their damage</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="111"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="122"/>
         <source>Your hogs are unable to move, put your artillery skills to the test</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="115"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="127"/>
         <source>Order of play is random instead of in room order.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="119"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="132"/>
         <source>Play with a King. If he dies, your side dies.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="123"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="137"/>
         <source>Take turns placing your hedgehogs before the start of play.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="127"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="142"/>
         <source>Ammo is shared between all teams that share a colour.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="131"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
         <source>Disable girders when generating random maps.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="135"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="152"/>
         <source>Disable land objects when generating random maps.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="139"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="157"/>
         <source>AI respawns on death.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="143"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="162"/>
         <source>Attacking does not end your turn.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="167"/>
         <source>Weapons are reset to starting values each turn.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="151"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="172"/>
         <source>Each hedgehog has its own ammo. It does not share with the team.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="155"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="177"/>
         <source>You will not have to worry about wind anymore.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="159"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="182"/>
         <source>Wind will affect almost everything.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="163"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="187"/>
         <source>Teams in each clan take successive turns sharing their turn time.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="167"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="192"/>
         <source>Add an indestructible border along the bottom</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="325"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="350"/>
         <source>Random</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="326"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="351"/>
         <source>Seconds</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="402"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="427"/>
         <source>Copy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="403"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="428"/>
         <source>New</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="404"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="429"/>
         <source>Delete</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1416,109 +1399,192 @@ Do you still want to join the room?</source>
     <name>PageSinglePlayer</name>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="39"/>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="40"/>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="43"/>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="44"/>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="49"/>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="50"/>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="54"/>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="42"/>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="55"/>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="47"/>
-        <source>Campaign Mode (...)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="66"/>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="51"/>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="67"/>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="62"/>
-        <source>Demos (Watch recorded demos)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="70"/>
+        <source>Load</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="65"/>
-        <source>Load (Load a previously saved game)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="71"/>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>PageTraining</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="209"/>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="78"/>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="93"/>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="211"/>
         <source>No description available</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="217"/>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="219"/>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
+    <name>PageVideos</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="233"/>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="234"/>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="492"/>
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="736"/>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="740"/>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="741"/>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="955"/>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="957"/>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>QAction</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="299"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="248"/>
         <source>Info</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="303"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="252"/>
         <source>Kick</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="307"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="256"/>
         <source>Ban</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="311"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="260"/>
         <source>Follow</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="315"/>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="843"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="264"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="865"/>
         <source>Ignore</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="319"/>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="854"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="268"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="877"/>
         <source>Add friend</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="838"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="860"/>
         <source>Unignore</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="849"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="872"/>
         <source>Remove friend</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="79"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="82"/>
         <source>Update</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="107"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="112"/>
         <source>Restrict Joins</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="109"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="114"/>
         <source>Restrict Team Additions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="87"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="90"/>
         <source>Start</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1526,203 +1592,228 @@ Do you still want to join the room?</source>
 <context>
     <name>QCheckBox</name>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="175"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="431"/>
         <source>Show ammo menu tooltips</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="239"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="365"/>
         <source>Alternative damage show</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="243"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="436"/>
         <source>Append date and time to record file name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="254"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="241"/>
         <source>Check for updates at startup</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="274"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="261"/>
         <source>Frontend fullscreen</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="278"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="265"/>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="282"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="269"/>
         <source>Enable frontend sounds</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="286"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="273"/>
         <source>Enable frontend music</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="304"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="291"/>
         <source>Fullscreen</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="363"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="349"/>
         <source>Enable sound</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="367"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="353"/>
         <source>Enable music</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="385"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="424"/>
         <source>Show FPS</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_password.cpp" line="43"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="231"/>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="95"/>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="131"/>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="151"/>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="192"/>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1307"/>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="150"/>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="116"/>
         <source>Mission</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="74"/>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="50"/>
         <source>generated map...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="78"/>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="52"/>
         <source>generated maze...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="80"/>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="54"/>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="114"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="115"/>
         <source>Human</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="118"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="119"/>
         <source>Level</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="324"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="323"/>
         <source>Community</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="218"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="199"/>
         <source>(System default)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="325"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="312"/>
         <source>Disabled</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="326"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="313"/>
         <source>Red/Cyan</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="327"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="314"/>
         <source>Cyan/Red</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="328"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="315"/>
         <source>Red/Blue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="329"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="316"/>
         <source>Blue/Red</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="330"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="317"/>
         <source>Red/Green</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="331"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="318"/>
         <source>Green/Red</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="332"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="319"/>
         <source>Side-by-side</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="333"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="320"/>
         <source>Top-Bottom</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="334"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="321"/>
         <source>Wiggle</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="335"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="322"/>
         <source>Red/Cyan grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="336"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="323"/>
         <source>Cyan/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="337"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="324"/>
         <source>Red/Blue grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="338"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="325"/>
         <source>Blue/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="339"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="326"/>
         <source>Red/Green grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="340"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="327"/>
         <source>Green/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="105"/>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="106"/>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="162"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="111"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="112"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="176"/>
         <source>Any</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="107"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="113"/>
         <source>In lobby</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="108"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="114"/>
         <source>In progress</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1735,17 +1826,17 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="88"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="89"/>
         <source>Team Settings</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="142"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="143"/>
         <source>Fort</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="161"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="162"/>
         <source>Key binds</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1755,26 +1846,41 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="68"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="69"/>
         <source>Teams</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="115"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="116"/>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="187"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="184"/>
         <source>Misc</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="266"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="253"/>
         <source>Audio/Graphic options</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="381"/>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="412"/>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="448"/>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="48"/>
         <source>Game Modifiers</source>
         <translation type="unfinished"></translation>
@@ -1785,10 +1891,25 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/teamselect.cpp" line="229"/>
+        <location filename="../../../../QTfrontend/ui/widget/teamselect.cpp" line="253"/>
         <source>Playing teams</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="120"/>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="230"/>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="265"/>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1828,18 +1949,18 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="54"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="55"/>
         <source>Style</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="104"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="74"/>
         <source>Scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="147"/>
-        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="116"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="148"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="86"/>
         <source>Weapons</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1854,37 +1975,37 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="92"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="93"/>
         <source>Name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="95"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="96"/>
         <source>Type</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="98"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="99"/>
         <source>Grave</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="101"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="102"/>
         <source>Flag</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="104"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="105"/>
         <source>Voice</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="94"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="116"/>
         <source>Tip: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="97"/>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="120"/>
         <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1899,268 +2020,532 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="119"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="120"/>
         <source>Game scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="191"/>
-        <source>Net nick</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="201"/>
-        <source>Password</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="189"/>
+        <source>Locale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="209"/>
-        <source>Locale</source>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="221"/>
+        <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="296"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="283"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="172"/>
         <source>Resolution</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="308"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="295"/>
         <source>Quality</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="321"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="308"/>
         <source>Stereo rendering</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="354"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="340"/>
         <source>Initial sound volume</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="378"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="418"/>
         <source>FPS limit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="395"/>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="175"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="200"/>
         <source>Damage Modifier</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="189"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="214"/>
         <source>Turn Time</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="203"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="228"/>
         <source>Initial Health</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="217"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="242"/>
         <source>Sudden Death Timeout</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="231"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="256"/>
         <source>Sudden Death Water Rise</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="245"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="270"/>
         <source>Sudden Death Health Decrease</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="259"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="284"/>
         <source>% Rope Length</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="273"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="298"/>
         <source>Crate Drops</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="286"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="311"/>
         <source>% Health Crates</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="300"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="325"/>
         <source>Health in Crates</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="314"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="339"/>
         <source>Mines Time</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="330"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="355"/>
         <source>Mines</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="344"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="369"/>
         <source>% Dud Mines</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="358"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="383"/>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="372"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="397"/>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="386"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="411"/>
         <source>Scheme Name:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="38"/>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="74"/>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="80"/>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="87"/>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="105"/>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="114"/>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="121"/>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagefeedback.cpp" line="45"/>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagefeedback.cpp" line="52"/>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="125"/>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="142"/>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="163"/>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="197"/>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="208"/>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="637"/>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="196"/>
-        <source>unnamed</source>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="882"/>
+        <source>unnamed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/team.cpp" line="42"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="335"/>
+        <source>hedgehog %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="226"/>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QMainWindow</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui_hwform.cpp" line="59"/>
+        <source>Hedgewars %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QMessageBox</name>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="904"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="388"/>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="905"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="389"/>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="921"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="525"/>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="947"/>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1241"/>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1285"/>
+        <source>Connection to server is lost</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1392"/>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1692"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1783"/>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1693"/>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1784"/>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1796"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1809"/>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1812"/>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1698"/>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1734"/>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="276"/>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="277"/>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="232"/>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="234"/>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="240"/>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="302"/>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="297"/>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/main.cpp" line="96"/>
+        <location filename="../../../../QTfrontend/main.cpp" line="212"/>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/main.cpp" line="97"/>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/main.cpp" line="213"/>
+        <source>Failed to open data directory:
+%1
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="50"/>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="122"/>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="51"/>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="123"/>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="124"/>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="113"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="162"/>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="114"/>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="163"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="431"/>
+        <source>Please enter room name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="125"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="152"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="169"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="184"/>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="126"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="170"/>
+        <source>Please select record from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/team.cpp" line="40"/>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="336"/>
-        <source>hedgehog %1</source>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="153"/>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QMainWindow</name>
     <message>
-        <location filename="../../../../QTfrontend/ui_hwform.cpp" line="57"/>
-        <source>Hedgewars %1</source>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="185"/>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QMessageBox</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="658"/>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="387"/>
-        <source>Teams</source>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="430"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="445"/>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="658"/>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="387"/>
-        <source>Really delete this team?</source>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="446"/>
+        <source>Please select room from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="667"/>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="494"/>
-        <source>Schemes</source>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="479"/>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="667"/>
-        <source>Can not delete default scheme '%1'!</source>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="480"/>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1014"/>
-        <source>Network</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="524"/>
+        <source>Schemes - Warning</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
-        <source>Connection to server is lost</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="533"/>
+        <source>Schemes - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1365"/>
-        <source>All file associations have been set.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="534"/>
+        <source>Do you really want to delete the game scheme '%1'?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="1366"/>
-        <source>File association failed.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="844"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="868"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="1093"/>
+        <source>Videos - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="161"/>
-        <source>Error</source>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="845"/>
+        <source>Do you really want to delete the video '%1'?</source>
         <translation type="unfinished"></translation>
     </message>
+    <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="869"/>
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="162"/>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="1094"/>
+        <source>Do you really want to cancel uploading %1?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="494"/>
-        <source>Really delete this game scheme?</source>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="101"/>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="121"/>
+        <source>File error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="193"/>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="240"/>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="244"/>
-        <source>Weapons</source>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="102"/>
+        <source>Cannot open '%1' for writing</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="193"/>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="122"/>
+        <source>Cannot open '%1' for reading</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="240"/>
-        <source>Can not delete default weapon set '%1'!</source>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="199"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="254"/>
+        <source>Weapons - Warning</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="244"/>
-        <source>Really delete this weapon set?</source>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="200"/>
+        <source>Cannot overwrite default weapon set '%1'!</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="49"/>
-        <source>Error</source>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="255"/>
+        <source>Cannot delete default weapon set '%1'!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="50"/>
-        <source>Cannot create directory %1</source>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="263"/>
+        <source>Weapons - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/main.cpp" line="51"/>
-        <source>OK</source>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="264"/>
+        <source>Do you really want to delete the weapon set '%1'?</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QObject</name>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="936"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1203"/>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/hwform.cpp" line="937"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1204"/>
         <source>Please enter your nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2180,23 +2565,23 @@ Please check your installation</source>
     </message>
     <message>
         <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="57"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="729"/>
         <source>Cancel</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="252"/>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="170"/>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagecampaign.cpp" line="42"/>
-        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="43"/>
+        <location filename="../../../../QTfrontend/ui/page/pagecampaign.cpp" line="44"/>
         <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="92"/>
         <source>Go!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="83"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="84"/>
         <source>Random Team</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2227,7 +2612,7 @@ Please check your installation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="71"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="75"/>
         <source>Ready</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2237,69 +2622,122 @@ Please check your installation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="247"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="440"/>
         <source>Associate file extensions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="42"/>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="83"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="45"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="87"/>
         <source>Play demo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="46"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="49"/>
         <source>Rename</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="50"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="53"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="300"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="729"/>
         <source>Delete</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="88"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="93"/>
         <source>Load</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="50"/>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="219"/>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="252"/>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="297"/>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="303"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="730"/>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="730"/>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="37"/>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="212"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="38"/>
         <source>Room Name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="213"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="39"/>
         <source>C</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="214"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="40"/>
         <source>T</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="215"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="41"/>
         <source>Owner</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="216"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="42"/>
         <source>Map</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="217"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="43"/>
         <source>Rules</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="218"/>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="44"/>
         <source>Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="131"/>
+        <source>Random Map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="132"/>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="133"/>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -2324,38 +2762,19 @@ Please check your installation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="254"/>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="258"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="277"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="282"/>
         <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="285"/>
-        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="289"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="313"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="318"/>
         <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="44"/>
-        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="104"/>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="45"/>
-        <source>Unable to start the server: %1.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="105"/>
-        <source>Unable to run engine: %1 (</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="71"/>
@@ -2363,122 +2782,122 @@ Please check your installation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="75"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="76"/>
         <source>Divide Teams</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="79"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="81"/>
         <source>Solid Land</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="83"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="86"/>
         <source>Add Border</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="87"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="91"/>
         <source>Low Gravity</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="91"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="96"/>
         <source>Laser Sight</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="95"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="101"/>
         <source>Invulnerable</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="99"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="106"/>
         <source>Reset Health</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="103"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="111"/>
         <source>Vampirism</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="107"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="116"/>
         <source>Karma</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="111"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="121"/>
         <source>Artillery</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="115"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="126"/>
         <source>Random Order</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="119"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="131"/>
         <source>King</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="123"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="136"/>
         <source>Place Hedgehogs</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="127"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="141"/>
         <source>Clan Shares Ammo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="131"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="146"/>
         <source>Disable Girders</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="135"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="151"/>
         <source>Disable Land Objects</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="139"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="156"/>
         <source>AI Survival Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="143"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="161"/>
         <source>Unlimited Attacks</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="166"/>
         <source>Reset Weapons</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="151"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="171"/>
         <source>Per Hedgehog Ammo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="155"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="176"/>
         <source>Disable Wind</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="159"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="181"/>
         <source>More Wind</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="163"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="186"/>
         <source>Tag Team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="167"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="191"/>
         <source>Add Bottom Border</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2676,20 +3095,30 @@ Please check your installation</source>
     </message>
     <message>
         <location filename="../../../../QTfrontend/binds.cpp" line="65"/>
-        <source>change mode</source>
+        <source>mute audio</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
-        <source>capture</source>
+        <source>change mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
+        <source>capture</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="68"/>
         <source>hedgehogs
 info</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="69"/>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2782,417 +3211,422 @@ info</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/binds.cpp" line="65"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
         <source>Toggle fullscreen mode:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
         <source>Take a screenshot:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="68"/>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="69"/>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="125"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="129"/>
         <source>Axis</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="129"/>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="144"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="133"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="148"/>
         <source>(Up)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="133"/>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="148"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="137"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="152"/>
         <source>(Down)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="140"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="144"/>
         <source>Hat</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="152"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="156"/>
         <source>(Left)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="156"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="160"/>
         <source>(Right)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="164"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="168"/>
         <source>Button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="200"/>
+        <location filename="../../../../QTfrontend/util/DataManager.cpp" line="193"/>
         <source>Keyboard</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="20"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="21"/>
         <source>Mouse: Left button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="21"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="22"/>
         <source>Mouse: Middle button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="22"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="23"/>
         <source>Mouse: Right button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="23"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="24"/>
         <source>Mouse: Wheel up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="24"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="25"/>
         <source>Mouse: Wheel down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="25"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="26"/>
         <source>Backspace</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="26"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="27"/>
         <source>Tab</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="27"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="28"/>
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="28"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="29"/>
         <source>Return</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="29"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="30"/>
         <source>Pause</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="30"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="31"/>
         <source>Escape</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="31"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="32"/>
         <source>Space</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="95"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="96"/>
         <source>Delete</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="96"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="97"/>
         <source>Numpad 0</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="97"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="98"/>
         <source>Numpad 1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="98"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="99"/>
         <source>Numpad 2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="99"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="100"/>
         <source>Numpad 3</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="100"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="101"/>
         <source>Numpad 4</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="101"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="102"/>
         <source>Numpad 5</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="102"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="103"/>
         <source>Numpad 6</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="103"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="104"/>
         <source>Numpad 7</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="104"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="105"/>
         <source>Numpad 8</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="105"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="106"/>
         <source>Numpad 9</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="106"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="107"/>
         <source>Numpad .</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="107"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="108"/>
         <source>Numpad /</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="108"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="109"/>
         <source>Numpad *</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="109"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="110"/>
         <source>Numpad -</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="110"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="111"/>
         <source>Numpad +</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="111"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="112"/>
         <source>Enter</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="112"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="113"/>
         <source>Equals</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="113"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="114"/>
         <source>Up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="114"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="115"/>
         <source>Down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="115"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="116"/>
         <source>Right</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="116"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="117"/>
         <source>Left</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="117"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="118"/>
         <source>Insert</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="118"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="119"/>
         <source>Home</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="119"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="120"/>
         <source>End</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="120"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="121"/>
         <source>Page up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="121"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="122"/>
         <source>Page down</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="137"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="138"/>
         <source>Num lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="138"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="139"/>
         <source>Caps lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="139"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="140"/>
         <source>Scroll lock</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="140"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="141"/>
         <source>Right shift</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="141"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="142"/>
         <source>Left shift</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="142"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="143"/>
         <source>Right ctrl</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="143"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="144"/>
         <source>Left ctrl</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="144"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="145"/>
         <source>Right alt</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="145"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="146"/>
         <source>Left alt</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="146"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="147"/>
         <source>Right meta</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="147"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="148"/>
         <source>Left meta</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="153"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="155"/>
         <source>A button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="154"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="156"/>
         <source>B button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="155"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="157"/>
         <source>X button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="156"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="158"/>
         <source>Y button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="157"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="159"/>
         <source>LB button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="158"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="160"/>
         <source>RB button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="159"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="161"/>
         <source>Back button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="160"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="162"/>
         <source>Start button</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="161"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="163"/>
         <source>Left stick</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="162"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="164"/>
         <source>Right stick</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="168"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="171"/>
         <source>Left stick (Right)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="169"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="172"/>
         <source>Left stick (Left)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="170"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="173"/>
         <source>Left stick (Down)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="171"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="174"/>
         <source>Left stick (Up)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="172"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="175"/>
         <source>Left trigger</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="173"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="176"/>
         <source>Right trigger</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="174"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="177"/>
         <source>Right stick (Down)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="175"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="178"/>
         <source>Right stick (Up)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="176"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="179"/>
         <source>Right stick (Right)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="177"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="180"/>
         <source>Right stick (Left)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../../QTfrontend/sdlkeys.h" line="179"/>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="182"/>
         <source>DPad</source>
         <translation type="unfinished"></translation>
     </message>
diff --git a/share/hedgewars/Data/Locale/hedgewars_nl.ts b/share/hedgewars/Data/Locale/hedgewars_nl.ts
index e2aa155..9c52333 100644
--- a/share/hedgewars/Data/Locale/hedgewars_nl.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_nl.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="nl">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
+        <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -48,14 +40,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation type="unfinished"></translation>
     </message>
@@ -69,6 +53,13 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
@@ -114,34 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -168,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -187,14 +154,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -322,16 +287,6 @@ Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation type="unfinished"></translation>
     </message>
@@ -351,6 +306,32 @@ or pick another nickname:</translation>
         <source>User quit</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>KB</name>
@@ -360,6 +341,26 @@ or pick another nickname:</translation>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -431,6 +432,10 @@ or pick another nickname:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -512,15 +517,14 @@ or pick another nickname:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
+        <source>Open the snapshot folder</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -770,213 +774,202 @@ or pick another nickname:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageMultiplayer</name>
     <message>
-        <source>Start</source>
+        <source>Local Game</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNet</name>
     <message>
-        <source>Error</source>
+        <source>Play a game on a single computer</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select server from the list above</source>
+        <source>Network Game</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNetGame</name>
     <message>
-        <source>Control</source>
+        <source>Play a game across a network</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>Read about who is behind the Hedgewars Project</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Access the user created content downloadable from our website</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageNetType</name>
     <message>
-        <source>LAN game</source>
+        <source>Exit game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Official server</source>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>PageOptions</name>
+    <name>PageMultiplayer</name>
     <message>
-        <source>New team</source>
+        <source>Start</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageNetGame</name>
     <message>
-        <source>Edit team</source>
+        <source>Control</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete team</source>
+        <source>DLC</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageNetType</name>
     <message>
-        <source>New scheme</source>
+        <source>LAN game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit scheme</source>
+        <source>Official server</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete scheme</source>
+        <source>Join hundreds of players online!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New weapon set</source>
+        <source>Join or host your own game server in a Local Area Network.</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageOptions</name>
     <message>
-        <source>Edit weapon set</source>
+        <source>New team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Delete weapon set</source>
+        <source>Edit team</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
+        <source>Delete team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Rename dialog</source>
+        <source>New scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
+        <source>Edit scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
+        <source>Delete scheme</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
+        <source>New weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
+        <source>Edit weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
+        <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
+        <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
+        <source>Advanced</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>Reset to default colors</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Proxy host</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
+        <source>Proxy port</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Room Name:</source>
+        <source>Proxy login</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
+        <source>Proxy password</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
+        <source>No proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <source>Socks5 proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
+        <source>HTTP proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
+        <source>System proxy settings</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <source>Rename dialog</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <source>Enter new file name:</source>
         <translation type="unfinished"></translation>
     </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-            <numerusform></numerusform>
-        </translation>
+</context>
+<context>
+    <name>PageRoomsList</name>
+    <message>
+        <source>Create</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
+        <source>Join</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
+        <source>Admin features</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Maze</source>
+        <source>Room Name:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -995,15 +988,6 @@ You may join and spectate now but you'll have to wait for the game to end t
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1157,107 +1141,173 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
+        <source>Simple Game</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
+        <source>Play a quick game against the computer with random settings</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
+        <source>Multiplayer</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
+        <source>Play a hotseat game against your friends, or AI teams</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Campaign Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageTraining</name>
     <message>
-        <source>No description available</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select a mission!</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QAction</name>
     <message>
-        <source>Kick</source>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Info</source>
+        <source>Load</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Start</source>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageTraining</name>
     <message>
-        <source>Restrict Joins</source>
+        <source>No description available</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restrict Team Additions</source>
+        <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Ban</source>
+        <source>Pick the mission or training to play</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Follow</source>
+        <source>Start fighting</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageVideos</name>
     <message>
-        <source>Ignore</source>
+        <source>Name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add friend</source>
+        <source>Size</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Unignore</source>
-        <translation type="unfinished"></translation>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
     </message>
     <message>
-        <source>Remove friend</source>
+        <source>(in progress...)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Update</source>
+        <source>Date: </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QCheckBox</name>
     <message>
-        <source>Check for updates at startup</source>
+        <source>Size: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen</source>
+        <source>encoding</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Frontend fullscreen</source>
+        <source>uploading</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
+</context>
+<context>
+    <name>QAction</name>
+    <message>
+        <source>Kick</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Restrict Joins</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Restrict Team Additions</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Ban</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Follow</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Ignore</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Add friend</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unignore</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Remove friend</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QCheckBox</name>
+    <message>
+        <source>Check for updates at startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Fullscreen</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Frontend fullscreen</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <source>Enable sound</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1293,6 +1343,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1455,6 +1525,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1503,10 +1597,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1583,10 +1673,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1635,15 +1721,73 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
+        <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>% Get Away Time</source>
+        <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License v2</source>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1657,6 +1801,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1668,83 +1816,230 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
+        <source>Connection to server is lost</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
+        <source>Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
+
+Please check your installation!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start the server: %1.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
+        <source>Unable to run engine at </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Error code: %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Please enter room name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Please select record from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
+        <source>Please select room from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1827,9 +2122,37 @@ Please check your installation</source>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation type="unfinished"></translation>
@@ -1858,46 +2181,43 @@ Please check your installation</source>
         <source>Weapons</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>SelWeaponWidget</name>
     <message>
-        <source>Weapon set</source>
+        <source>Random Map</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Probabilities</source>
+        <source>Random Maze</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Ammo in boxes</source>
+        <source>Hand-drawn</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>SelWeaponWidget</name>
     <message>
-        <source>Delays</source>
+        <source>Weapon set</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>new</source>
+        <source>Probabilities</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>copy of</source>
+        <source>Ammo in boxes</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>TCPBase</name>
     <message>
-        <source>Error</source>
+        <source>Delays</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to start the server: %1.</source>
+        <source>new</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to run engine: %1 (</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -2167,6 +2487,14 @@ info</source>
         <source>slot 10</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2253,6 +2581,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_pl.ts b/share/hedgewars/Data/Locale/hedgewars_pl.ts
index f921287..af42910 100644
--- a/share/hedgewars/Data/Locale/hedgewars_pl.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_pl.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pl">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation>Wstecz</translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>BÅ‚Ä…d pliku</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Nie można otworzyć '%1' do zapisu</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Nie można odczytać pliku '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -45,14 +37,6 @@
 <context>
     <name>GameCFGWidget</name>
     <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Niepoprawny schemat amunicji</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Edytuj schematy</translation>
     </message>
@@ -61,10 +45,6 @@
         <translation>Edytuj uzbrojenie</translation>
     </message>
     <message>
-        <source>When this option is enabled selecting a game scheme will auto-select a weapon (and viceversa)</source>
-        <translation type="obsolete">Kiedy ta opcja jest włączona, wybór ustawnień gry zmienia uzbrojenie na odpowiadające (i vice versa)</translation>
-    </message>
-    <message>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation>Kiedy ta opcja jest włączona, wybór ustawień gry zmienia uzbrojenie na odpowiednie</translation>
     </message>
@@ -74,23 +54,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 został usunięty z listy ignorowanych</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 został dodany do listy ignorowanych</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 został usunięty z listy przyjaciół</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 został dodany do listy przyjaciół</translation>
+        <source>Do you really want to quit?</source>
+        <translation>Na pewno chcesz zakończyć?</translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation>%1 został usunięty z listy ignorowanych</translation>
@@ -135,38 +106,14 @@
         <source>%1 is not a valid command!</source>
         <translation>%1 nie jest poprawnym poleceniem!</translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation>Wyrzucam %1...</translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Nie można uruchomić serwera</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Nie można zapisać nagrania do pliku %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">nowy</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Wybierz nagranie z listy</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>DomyślnaDrużyna</translation>
     </message>
@@ -193,10 +140,6 @@
         <translation>Gra przerwana</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Hasło</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -215,19 +158,15 @@ w ustawieniach gry:</translation>
         <translation>Nick</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation>Ktoś właśnie używa
-tego nicku %1
-na serwerze.
-Proszę wybrać nowy nick:</translation>
-    </message>
-    <message>
         <source>No nickname supplied.</source>
         <translation>Nie podano nicku.</translation>
     </message>
+    <message>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
+        <translation>Ktoś używa tego nicku %1 na serwerze.
+Wybierz inny nick:</translation>
+    </message>
 </context>
 <context>
     <name>HWGame</name>
@@ -279,10 +218,6 @@ Proszę wybrać nowy nick:</translation>
         <translation>Odjechane</translation>
     </message>
     <message>
-        <source>Tunnel size</source>
-        <translation type="obsolete">Tunele</translation>
-    </message>
-    <message>
         <source>Type</source>
         <translation>Typ</translation>
     </message>
@@ -357,20 +292,6 @@ Proszę wybrać nowy nick:</translation>
         <translation>Zostałeś wyrzucony</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Hasło</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Twój nick %1 jest
-zarejestrowany na Hedgewars.org
-Proszę podać twoje hasło 
-bądź wybierz inny nick:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 dołączył do pokoju</translation>
     </message>
@@ -387,32 +308,34 @@ bądź wybierz inny nick:</translation>
         <translation>%1 *** %2 wyszedł</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Twój nick %1 jest zarejestrowany
-na Hedgewars.org
-Proszę podać hasło bądź zmienić nick
-w ustawieniach gry:</translation>
+        <source>User quit</source>
+        <translation>Użytkownik wyszedł</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nick</translation>
+        <source>Remote host has closed connection</source>
+        <translation>Zdalny host zakończył połączenie</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Ktoś właśnie używa
-tego nicku %1
-na serwerze.
-Przoszę wybrać nowy nick:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation>Stara wersja serwera. Nastąpi rozłączenie.</translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
-        <translation>Użytkownik wyszedł</translation>
+        <source>Password</source>
+        <translation>Hasło</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation>Prześłij wideo</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Prześlij</translation>
     </message>
 </context>
 <context>
@@ -423,16 +346,28 @@ Przoszę wybrać nowy nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation>Długość: %1m %2s </translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Wiadomość od serwera:</translation>
+        <source>Video: %1x%2, </source>
+        <translation>Wideo: %1x%2, </translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Ustaw wiadomość</translation>
+        <source>%1 fps, </source>
+        <translation>%1 kl/s, </translation>
     </message>
     <message>
+        <source>Audio: </source>
+        <translation>Audio: </translation>
+    </message>
+</context>
+<context>
+    <name>PageAdmin</name>
+    <message>
         <source>Clear Accounts Cache</source>
         <translation>Wyczyść pamięć podręczną</translation>
     </message>
@@ -467,10 +402,6 @@ Przoszę wybrać nowy nick:</translation>
         <source>Connecting...</source>
         <translation>Łączenie...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Anuluj</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -495,10 +426,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Załaduj mapę</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Narysowane mapy (*.hwmap);;Wszystkie pliki (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Zapisz mapÄ™</translation>
     </message>
@@ -510,6 +437,10 @@ Przoszę wybrać nowy nick:</translation>
         <source>All files</source>
         <translation>Wszystkie pliki</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation>Gumka</translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -525,26 +456,6 @@ Przoszę wybrać nowy nick:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Odznaczenie za najlepszy strzał przyznano <b>%1</b>, zadał(a) on(a) <b>%2</b> punktów obrażeń.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Najlepszym zabójcą jest <b>%1</b> z <b>%2</b> zabiciami w przeciągu tury.</p></numerusform>
-            <numerusform><p>Najlepszym zabójcą jest <b>%1</b> z <b>%2</b> zabiciami w przeciągu tury.</p></numerusform>
-            <numerusform><p>Najlepszym zabójcą jest <b>%1</b> z <b>%2</b> zabiciami w przeciągu tury.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>W sumie <b>%1</b> jeży zostało zabitych w tej walce.</p></numerusform>
-            <numerusform><p>W sumie <b>%1</b> jeży zostało zabitych w tej walce.</p></numerusform>
-            <numerusform><p>W sumie <b>%1</b> jeży zostało zabitych w tej walce.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Szczegóły</translation>
     </message>
@@ -584,10 +495,6 @@ Przoszę wybrać nowy nick:</translation>
             <numerusform>(%1 zabitych jeży)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 zabitych)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -621,15 +528,14 @@ Przoszę wybrać nowy nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Gra lokalna (graj na jednym komputerze)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Gra sieciowa (graj przez internet lub LAN)</translation>
+        <source>Open the snapshot folder</source>
+        <translation>Otwórz folder ze zrzutami ekranu</translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -646,11 +552,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Jeśli nie jesteś pewien co zrobić w danej turze i nie chcesz tracić amunicji możesz pominąć turę. Nie rób tak jednak zbyt często gdyż nagła śmierć jest nieuchronna!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Chcesz zaoszczędzić liny? Odłącz ją będąc w powietrzu, a potem wypuść ją ponownie. Tak długo jak nie dotkniesz ziemi, będziesz używał pojedynczego naboju!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Jeśli chciałbyś zapobiec używania własnego nicka przez kogoś innego, zarejestruj go na http://www.hedgewars.org .</translation>
@@ -701,16 +602,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Zawsze możesz zmieniać ustawienia gry w opcjach gry lokalnej lub sieciowej. Nie musisz ciągle używać tzw. "Szybkiej gry".</translation>
     </message>
     <message>
-        <source>Connect a gamepad before launching the game to be able to assign its controls to your team.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Jeśli podłączysz Gamepada przed włączeniem gry, będziesz miał możliwość przypisania klawiszy by sterować nim własne jeże.</translation>
-    </message>
-    <message>
-        <source>Create an account on http://www.hedgewars.org/ to keep others from using your most favourite nickname while playing on the official server.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Stwórz konto na http://www.hedgewars.org/ by zapobiec używania twojego ulubionego nicku przez innych.</translation>
-    </message>
-    <message>
         <source>While playing you should give yourself a short break at least once an hour.</source>
         <comment>Tips</comment>
         <translation>Zawsze pamiętaj o robieniu krótkich przerw co godzinę kiedy grasz na komputerze.</translation>
@@ -736,11 +627,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Specjalne tryby gry takie jak "Karma" bądź "Wampiryzm" pozwalają na stworzenie nowej taktyki!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Wersja Hedgewars dla systemu Windows wspiera XFire. Upewnij się, że dodałeś Hedgewars do listy gier by Twoi znajomi mogli zobaczyć Ciebie w czasie gry.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Nie powinieneś instalować Hedgewars na komputerach których nie posiadasz (w szkole, na studiach, w pracy itp.). Zapytaj osoby odpowiedzialnej za te komputery!</translation>
@@ -756,11 +642,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Żaden jeż nie został ranny w czasie tworzenia tej gry.</translation>
     </message>
     <message>
-        <source>Connect one or more gamepads before launching the game to be able to assign their controls to your teams.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Jeśli podłączysz jeden lub więcej gamepadów przed włączeniem gry, będziesz miał możliwość przypisania klawiszy by sterować nimi własne jeże.</translation>
-    </message>
-    <message>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
         <comment>Tips</comment>
         <translation>Hedgewars jest darmową grą o otwartym kodzie źródłowym którą tworzymy w naszym wolnym czasie. Jeśli ktokolwiek sprzedał Tobie tę grę powinieneś upomnieć się o swoje pieniądze!</translation>
@@ -811,11 +692,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Zrzut pianina jest najbardziej morderczym atakiem powietrznym. Pamiętaj, że tracisz jeża którym wykonujesz ten atak więc dobrze zaplanuj swój ruch.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Pszczoła potrafi być ciężka w użyciu. Jej promień skrętu zależy od prędkości lotu, więc nie staraj się nie używać pełnej mocy podczas strzału.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Miny samoprzylepne są idealnym narzędziem by tworzyć małe reakcje łańcuchowe bądź do zmuszenia przeciwnika by popadł w tarapaty lub wpadł do wody.</translation>
@@ -841,11 +717,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Miotacz ognia jest śmiercionośną bronią ale może być użyty również jako narzędzie do kopania tuneli.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Użyj koktajlu Mołotowa by powstrzymać przeciwnika przed przedostaniem się przez tunele lub platformy.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Chcesz wiedzieć kto tworzy tę grę? Kliknij logo w głównym menu by zobaczyć autorów.</translation>
@@ -876,11 +747,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Swoje zespoły i konfigurację gry znajdziesz w folderze "Moje Dokumenty\Hedgewars". Twórz regularnie kopie zapasowe, ale nie edytuj tych plików własnoręcznie.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Swoje zespoły i konfigurację gry znajdzie4sz w folderze ".hedgewars" w twoim katalogu domowym. Twórz regularnie kopie zapasowe ale nie edytuj tych plików własnoręcznie.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation>Możesz powiązać typy plików związane z Hedgewars (zapisy gier i dema) by móc je uruchamiać bezpośrednio z ulubionego menedżera plików bądź przeglądarki internetowej.</translation>
@@ -919,6 +785,46 @@ Przoszę wybrać nowy nick:</translation>
         <source>Downloadable Content</source>
         <translation>Dodatki</translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation>Gra lokalna</translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation>Graj na swoim komputerze</translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation>Gra sieciowa</translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation>Graj poprzez sieć</translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation>Dowiedz się kto jest twórcą gry</translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation>Opisz problem, zasugeruj zmiany lub napisz po prostu jak bardzo lubisz Hedgewars</translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation>ÅšciÄ…gnij rzeczy stworzone przez graczy</translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation>Wyjdź z gry</translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation>ZarzÄ…dzaj filmami z gry</translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation>Zmień ustawienia gry</translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -928,33 +834,18 @@ Przoszę wybrać nowy nick:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Wybierz serwer z powyższej listy</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Kontrola</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Wprowadź nazwę pokoju</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation>Dodatki</translation>
     </message>
 </context>
 <context>
@@ -967,6 +858,14 @@ Przoszę wybrać nowy nick:</translation>
         <source>Official server</source>
         <translation>Oficjalny serwer</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation>Dołącz do setek graczy w sieci!</translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation>Dołącz lub stwórz nową grę w sieci lokalnej.</translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -983,18 +882,6 @@ Przoszę wybrać nowy nick:</translation>
         <translation>Usuń drużynę</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Nowy schemat uzbrojenia</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Edytuj schemat uzbrojenia</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Usuń schemat uzbrojenia</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Nie możesz edytować drużyn z menu wyboru drużyn. By to uczynić, wróć do głównego menu.</translation>
     </message>
@@ -1022,131 +909,79 @@ Przoszę wybrać nowy nick:</translation>
         <source>Delete weapon set</source>
         <translation>Usuń zestaw uzbrojenia</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Rename dialog</source>
-        <translation>Zmiana nazwy</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>Podaj nowÄ… nazwÄ™ pliku:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Nie można zmienić nazwy na</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Nie można usunąć pliku</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Wybierz nagranie z listy</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Stwórz</translation>
-    </message>
-    <message>
-        <source>Join</source>
-        <translation>Dołącz</translation>
+        <source>General</source>
+        <translation>Ogólne</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Odśwież</translation>
+        <source>Advanced</source>
+        <translation>Zaawansowane</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
+        <source>Reset to default colors</source>
+        <translation>Przywróć domyślne kolory</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Proxy host</source>
+        <translation>Server proxy</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Ustawienia admina</translation>
+        <source>Proxy port</source>
+        <translation>Port proxy</translation>
     </message>
     <message>
-        <source>Room Name:</source>
-        <translation>Nazwa pokoju:</translation>
+        <source>Proxy login</source>
+        <translation>Login do proxy</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Ta gra jest w poczekalni.
-Możesz dołączyć i zacząć grać gdy gra się rozpocznie.</translation>
+        <source>Proxy password</source>
+        <translation>Hasło</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Ta gra jest w toku.
-Możesz dołączyć i obserwować grę, ale by móc zagrać musisz poczekać aż gra się skończy.</translation>
+        <source>No proxy</source>
+        <translation>Bez proxy</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 jest właścicielem. Może on zmienić ustawienia i rozpocząć grę.</translation>
+        <source>Socks5 proxy</source>
+        <translation>Socks5 proxy</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Losowa mapa</translation>
+        <source>HTTP proxy</source>
+        <translation>HTTP proxy</translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Gry mogą być rozgrywane na losowych lub uprzednio stworzonych mapach.</translation>
+        <source>System proxy settings</source>
+        <translation>Systemowe ustawienia proxy</translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Schemat określa ustawienia i preferencje takie jak Czas trwania tury, Nagłą śmierć, Wampiryzm itp.</translation>
+        <source>Rename dialog</source>
+        <translation>Zmiana nazwy</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Zestaw uzbrojenia określa dostępną broń oraz ilość amunicji.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Do tego pokoju jest podłączony %1 gracz.</numerusform>
-            <numerusform>Do tego pokoju jest podłączonych %1 graczy.</numerusform>
-            <numerusform>Do tego pokoju jest podłączonych %1 graczy.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>W tym pokoju gra %1 drużyna.</numerusform>
-            <numerusform>W tym pokoju grają %1 drużyny.</numerusform>
-            <numerusform>W tym pokoju grają %1 drużyny.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Podaj nowÄ… nazwÄ™ pliku:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Wprowadź nazwę pokoju</translation>
+        <source>Create</source>
+        <translation>Stwórz</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Wybierz pokój z listy</translation>
+        <source>Join</source>
+        <translation>Dołącz</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Losowy labirynt</translation>
+        <source>Admin features</source>
+        <translation>Ustawienia admina</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Stan:</translation>
+        <source>Room Name:</source>
+        <translation>Nazwa pokoju:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1164,16 +999,6 @@ Możesz dołączyć i obserwować grę, ale by móc zagrać musisz poczekać aż
         <source>Clear</source>
         <translation>Wyczyść</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Uwaga</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Gra do której chcesz dołączyć już się rozpoczęła.
-Czy chcesz dołączyć do pokoju?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1206,10 +1031,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Podłoże jest niezniszczalne!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Dodaje niezniszczalną ramkę dookoła terenu</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Niższa grawitacja</translation>
     </message>
@@ -1222,10 +1043,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Wszystkie jeże posiadają osobiste pole siłowe</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Dodaj miny</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Odzyskaj 80% życia z zadanych obrażeń</translation>
     </message>
@@ -1336,36 +1153,48 @@ Czy chcesz dołączyć do pokoju?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Szybka gra (szybka gra przeciwko komputerowi, ustawienia sÄ… wybierane za ciebie)</translation>
+        <source>Simple Game</source>
+        <translation>Szybka gra</translation>
+    </message>
+    <message>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Zagraj szybkÄ… grÄ™ z losowymi ustawieniami przeciwko komputerowi</translation>
+    </message>
+    <message>
+        <source>Multiplayer</source>
+        <translation>Gra wieloosobowa</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Gra wieloosobowa (graj z komputerem lub na zmianÄ™ ze znajomymi)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Graj na zmianę ze swoimi przyjaciółmi lub przeciwko komputerowi</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Trening (sprawdź swoje umiejętności podczas misji treningowych). W PRODUKCJI</translation>
+        <source>Campaign Mode</source>
+        <translation>Kampania</translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Dema (zobacz nagrane dema)</translation>
+        <source>Training Mode</source>
+        <translation>Trening</translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Wczytaj grÄ™ (wczytaj poprzednio zapisanÄ… grÄ™)</translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Sprawdź swoje umiejętności przwechodząc kilka misji</translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampania (...). W PRODUKCJI</translation>
+        <source>Demos</source>
+        <translation>Dema</translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
-        <translation>Kampania (...)</translation>
+        <source>Watch recorded demos</source>
+        <translation>Obejrzyj nagrane dema</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation>Trening (sprawdź swoje umiejętności podczas misji treningowych)</translation>
+        <source>Load</source>
+        <translation>Wczytaj</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
+        <translation>Wczytaj zapisanÄ… grÄ™</translation>
     </message>
 </context>
 <context>
@@ -1378,6 +1207,53 @@ Czy chcesz dołączyć do pokoju?</translation>
         <source>Select a mission!</source>
         <translation>Wybierz misjÄ™!</translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation>Wybierz misje w którą chcesz zagrać</translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation>Start</translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation>Nazwa</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation>Rozmiar</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 bajtów</numerusform>
+            <numerusform>%1 bajty</numerusform>
+            <numerusform>%1 bajtów</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation>(w trakcie...)</translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation>Data: </translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation>Rozmiar: </translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation>enkodowanie</translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation>wysyłanie</translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1465,10 +1341,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Dodaj czas i datÄ™ do nazwy pliku</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Obniż jakość</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Pokaż opisy broni</translation>
     </message>
@@ -1481,8 +1353,28 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>WÅ‚Ä…cz muzykÄ™ w menu</translation>
     </message>
     <message>
-        <source>Frontend effects</source>
-        <translation>Efekty w menu</translation>
+        <source>Frontend effects</source>
+        <translation>Efekty w menu</translation>
+    </message>
+    <message>
+        <source>Save password</source>
+        <translation>Zapisz hasło</translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation>Zapisz nazwę użytkownika i hasło</translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation>Film jest prywatny</translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation>Nagraj dźwięk</translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation>Użyj rozdzielczości z gry</translation>
     </message>
 </context>
 <context>
@@ -1528,42 +1420,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>W toku</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Domyślne</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Pro mode</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Shoppa</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Basketball</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Minefield</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Barrel mayhem</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Tunnel hogs</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Crazy</translation>
-    </message>
-    <message>
-        <source>Normal</source>
-        <translation type="obsolete">Normalna</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>Mapa rysowana ręcznie...</translation>
     </message>
@@ -1655,10 +1511,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Ustawienia dźwięku/grafiki</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Uzbrojenie</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Gra sieciowa</translation>
     </message>
@@ -1686,14 +1538,34 @@ Czy chcesz dołączyć do pokoju?</translation>
         <source>Schemes and Weapons</source>
         <translation>Schematy i uzbrojenie</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation>WÅ‚asne kolory</translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation>Różne</translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation>Ustawienia nagrywania</translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation>Filmy</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Opis</translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation>Ustawienia proxy</translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Ten program jest rozprowadzany na zasadach powszechnej licencji publicznej GNU</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Twórcy:</translation>
     </message>
@@ -1730,10 +1602,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Ograniczenie FPS</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Pseudonim sieciowy</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Nazwa serwera:</translation>
     </message>
@@ -1818,16 +1686,6 @@ Czy chcesz dołączyć do pokoju?</translation>
         <translation>Język</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Zrestartuj grę by wprowadzić zmiany</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Ta wersja jest w fazie produkcji i może nie być kompatybilna z innymi wersjami gry.
-Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne ryzyko!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Mat. wybuchowe</translation>
     </message>
@@ -1836,11 +1694,6 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <translation>Rada:</translation>
     </message>
     <message>
-        <source>This HG build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Ta wersja jest w fazie produkcji i może nie być kompatybilna z innymi wersjami gry.
-Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne ryzyko!</translation>
-    </message>
-    <message>
         <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
         <translation>Ta wersja testowa jest w fazie produkcji i może nie być kompatybilna z innymi wersjami gry.
 Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne ryzyko!</translation>
@@ -1866,26 +1719,14 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <translation>Tracone HP podczas NÅš</translation>
     </message>
     <message>
-        <source>Bind schemes and weapons</source>
-        <translation type="obsolete">Połącz ustawienia gry z uzbrojeniem</translation>
-    </message>
-    <message>
         <source>% Rope Length</source>
         <translation>Długość liny w %</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Rozgrywka</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Wyświetlanie w 3D</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Opcje</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Tryb gry</translation>
     </message>
@@ -1894,10 +1735,6 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <translation>Schemat</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Hasło</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>Czas na ucieczkÄ™ w %</translation>
     </message>
@@ -1905,6 +1742,70 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation>Ten program jest rozprowadzany na zasadach GNU GPL v2</translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation>Są filmy które właśnie są przetwarzane.
+Wyjście spowoduje przerwanie pracy.
+Czy na pewno chcesz wyjść?</translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation>Wprowadź nazwę użytkownika YouTube lub adres mailowy powiązany z Kontem Google.</translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation>Nazwa konta (lub email): </translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation>Hasło: </translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation>Nazwa filmu: </translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation>Opis filmu: </translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation>Tagi (oddzielone przecinkami): </translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation>Podsumowanie </translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Opis</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Nick</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation>Format</translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation>Kodek audio</translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation>Kodek wideo</translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation>Klatki/s</translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation>Bitrate (Kbps)</translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1916,6 +1817,10 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <source>hedgehog %1</source>
         <translation>jeż %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation>anonimowy</translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1927,10 +1832,6 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Sieć</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Połączenie z serwerem zostało przerwane</translation>
     </message>
@@ -1939,81 +1840,227 @@ Niektóre funkcje mogą nie działać lub być niekompletne. Używaj na własne
         <translation>BÅ‚Ä…d</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Powiązanie plików nie powiodło się.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation>Wypełnij wszystkie pola</translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation>BÅ‚Ä…d logowania na google.com:</translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation>Login lub hasło są niepoprawne</translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation>Błąd w trakcie wysyłania danych do Youtube:</translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation>Drużyny - Jesteś pewien?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation>Jesteś pewien że chcesz usunąć drużynę '%1'?</translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation>Nie można usunąć domyślnego schematu '%1'!</translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation>Wybierz nagranie z listy</translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation>Nie można uruchomić serwera</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation>Hedgewars - BÅ‚Ä…d</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation>Hedgewars - Sukces</translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation>Wszystkie powiązania plików zostały ustawione</translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation>Pomyślnie utworzono wpis na hedgewars.googlecode.com </translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation>BÅ‚Ä…d podczas logowania do google.com</translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation>Bład podczas wysyłania informacji. Spróbuj ponownie później lub odwiedź hedgewars.googlecode.com)</translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation>BÅ‚Ä…d</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Nie można utworzyć katalogu %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
+
+Please check your installation!</source>
         <translation>Nie można otworzyć katalogu z danymi:
 %1
-Sprawdź poprawność instalacji</translation>
+
+Sprawdź poprawność instalacji!</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Uzbrojenie</translation>
+        <source>TCP - Error</source>
+        <translation>TCP - BÅ‚Ä…d</translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nie można zmienić domyślnego zestawu uzbrojenia</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation>Nie można uruchomić serwera: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nie można usunąć domyślnego zestawu uzbrojenia</translation>
+        <source>Unable to run engine at </source>
+        <translation>Nie można uruchomić silnika na </translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Czy na pewno usunąć ten zestaw uzbrojenia?</translation>
+        <source>Error code: %1</source>
+        <translation>Kod błędu: %1</translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Nie można nadpisać zestawu uzbrojenia '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation>Wysyłanei filmu - Błąd</translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Wszystkie powiązania plików zostały utworzone</translation>
+        <source>Netgame - Error</source>
+        <translation>Gra sieciowa - BÅ‚Ä…d</translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Powiązanie plików nie powiodło się.</translation>
+        <source>Please select a server from the list</source>
+        <translation>Wybierz serwer z listy</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Drużyny</translation>
+        <source>Please enter room name</source>
+        <translation>Wprowadź nazwę pokoju</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Na pewno usunąć tę drużynę?</translation>
+        <source>Record Play - Error</source>
+        <translation>Nagraj grÄ™ - BÅ‚Ä…d</translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Schematy</translation>
+        <source>Please select record from the list</source>
+        <translation>Wybierz nagranie z listy</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Nie można usunąć domyśłnego schematu '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation>Nie można zmienić nazwy na </translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Na pewno usunąć ten schemat?</translation>
+        <source>Cannot delete file </source>
+        <translation>Nie można usunąc pliku </translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Nie można usunąć domyśłnego zestawu usbrojenia '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation>Nazwa pokoju - BÅ‚Ä…d</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
+        <source>Please select room from the list</source>
+        <translation>Wybierz pokój z listy</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nie można utworzyć katalogu %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation>Nazwa pokoju - JesteÅ› pewien?</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>Gra do której chcesz dołączyć już się rozpoczęła.
+Czy chcesz dołączyć do pokoju?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation>Schematy - Ostrzeżenie</translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation>Schematy - JesteÅ› pewien?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation>Na pewno chcesz usunąć schemat '%1'?</translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation>Filmy - JesteÅ› pewien?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation>Na pewno chcesz usunÄ…c film '%1'?</translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation>
+            <numerusform>Na pewno chcesz usunąć %1 plik?</numerusform>
+            <numerusform>Na pewno chcesz usunąć %1 pliki?</numerusform>
+            <numerusform>Na pewno chcesz usunąć %1 plików?</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation>Na pewno chcesz anulować wysyłanie '%1'?</translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation>BÅ‚Ä…d pliku</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation>Nie można otworzyć '%1' do zapisu</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation>Nie można otworzyć '%1' do odczytu</translation>
     </message>
     <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation>Nie możn aużyć aminucji '%1'!</translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation>Uzbrojenie - Ostrzeżenie</translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation>Nie można nadpisać domyślnego zestawu broni '%1'!</translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation>Nie można usunąć domyślnego zestawu broni '%1'!</translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation>Uzbrojenie - JesteÅ› pewien?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation>Na pewno chcesz usunÄ…c zestaw broni '%1'?</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nick</translation>
     </message>
@@ -2093,16 +2140,40 @@ Sprawdź poprawność instalacji</translation>
         <translation>Powiąż typy plików z Hedgewars</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translation type="obsolete">Ustaw</translation>
-    </message>
-    <message>
         <source>more</source>
         <translation>Więcej</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation>Więcej informacji</translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation>Zapisz jako domyśłne ustawienia</translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation>Otwórz katalog z filmami</translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation>Odtwórz</translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation>Wyślij do YouTube</translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation>Anuluj wysyłanie</translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation>W toku</translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation>Nazwa pokoju</translation>
@@ -2131,6 +2202,18 @@ Sprawdź poprawność instalacji</translation>
         <source>Weapons</source>
         <translation>Uzbrojenie</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Losowa mapa</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Losowy labirynt</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation>Rys. ręcznie</translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -2160,21 +2243,6 @@ Sprawdź poprawność instalacji</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>BÅ‚Ä…d</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Nie można uruchomić serwera: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Nie można uruchomić silnika gry: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2217,10 +2285,6 @@ Sprawdź poprawność instalacji</translation>
         <translation>Nieśmiertelność</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Dodaj miny</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Losowa kolejność</translation>
     </message>
@@ -2444,6 +2508,14 @@ info</source>
         <source>slot 10</source>
         <translation>slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation>wycisz dźwięk</translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation>nagrywaj</translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2530,6 +2602,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Zmień szczegółowość opisów nad jeżami:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Nagraj wideo:</translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts b/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts
index 989345e..84d9b4a 100644
--- a/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_pt_BR.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pt_BR">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Editar armas</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Esquema de armas ilegal</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Editar esquemas</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 foi removido da sua lista de ignorados</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 foi adicionado a sua lista de ignorados</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 foi removido da sua lista de amigos</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 foi adicionado a sua lista de amigos</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Falha ao iniciar o servidor</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Falha ao salvar registro no arquivo %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">novo</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Selecione um registro na lista acima</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>EquipePadrão</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Senha</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,14 +157,12 @@ ou escolha outro apelido:</translation>
         <translation type="unfinished">Apelido</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -346,20 +291,6 @@ Please pick another nickname:</source>
         <translation>Você foi chutado</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Senha</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Seu apelido %1 é 
-registrado no Hedgewars.org
-Por favor, forneça sua senha
-ou escolha outro apelido:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 entrou na sala</translation>
     </message>
@@ -376,21 +307,33 @@ ou escolha outro apelido:</translation>
         <translation>%1 *** %2 saiu</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Seu apelido %1 é
-registrado no Hedgewars.org
-Por favor, forneça sua senha
-ou escolha outro apelido:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Apelido</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Senha</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -402,6 +345,26 @@ ou escolha outro apelido:</translation>
     </message>
 </context>
 <context>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
@@ -438,10 +401,6 @@ ou escolha outro apelido:</translation>
         <source>Connecting...</source>
         <translation>Conectando...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Cancelar</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -466,10 +425,6 @@ ou escolha outro apelido:</translation>
         <translation>Carregar mapa</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Mapas Desenhados (*.hwmaps);; Todos os arquivos (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Salvar Mapa</translation>
     </message>
@@ -481,6 +436,10 @@ ou escolha outro apelido:</translation>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -496,74 +455,6 @@ ou escolha outro apelido:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>O prêmio de melhor disparo foi ganho por <b>%1</b> , com <b>%2</b> pontos.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>O prêmio de melhor matador é de <b>%1</b>, com <b>%2</b> morto em um turno.</p></numerusform>
-            <numerusform><p>Os prêmios de melhor matador vão para <b>%1</b>, com <b>%2</b> mortos em um turno.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Um total de <b>%1</b> ouriço foi morto nesta batalha.</p></numerusform>
-            <numerusform><p>Um total de <b>%1</b> ouriços foram mortos nesta batalha.</p></numerusform>
-        </translation>
-    </message>
-    <message>
-        <source><h1><img src=":/res/StatsD.png"> Details</h1></source>
-        <translation type="obsolete"><h1><img src=":/res/StatsD.png"> Detalhes</h1></translation>
-    </message>
-    <message>
-        <source><br><h1><img src=":/res/StatsH.png"> Health graph</h1></source>
-        <translation type="obsolete"><br><h1><img src=":/res/StatsH.png"> Desenvolvimento</h1></translation>
-    </message>
-    <message>
-        <source><h1><img src=":/res/StatsR.png"> Ranking</h1></source>
-        <translation type="obsolete"><h1><img src=":/res/StatsR.png"> Ranking</h1></translation>
-    </message>
-    <message>
-        <source><p><img src=":/res/StatsBestShot.png"> The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p><img src=":/res/StatsBestShot.png"> O prêmio de melhor tiro vai para <b>%1</b> com <b>%2</b> pts.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p><img src=":/res/StatsBestKiller.png"> The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p><img src=":/res/StatsBestKiller.png"> O melhor matador é <b>%1</b> com <b>%2</b> mortes em um turno.</p></numerusform>
-            <numerusform><p><img src=":/res/StatsBestKiller.png"> Os melhores matadores são <b>%1</b> com <b>%2</b> mortes em um turno.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p><img src=":/res/StatsHedgehogsKilled.png"> A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p><img src=":/res/StatsHedgehogsKilled.png"> Um total de <b>%1</b> ouriço foi morto neste round.</p></numerusform>
-            <numerusform><p><img src=":/res/StatsHedgehogsKilled.png"> Um total de <b>%1</b> ouriços foram mortos neste round.</p></numerusform>
-        </translation>
-    </message>
-    <message>
-        <source><p><h2>%1 %2. <font color="%5">%3</font>  (%4 kill).</h2></p></source>
-        <translation type="obsolete"><p><h2>%1 %2. <font color="%5">%3</font>  (%4 morte).</h2></p></translation>
-    </message>
-    <message>
-        <source><p><h2>%1 %2. <font color="%5">%3</font>  (%4 kills).</h2></p></source>
-        <translation type="obsolete"><p><h2>%1 %2. <font color="%5">%3</font>  (%4 mortes).</h2></p></translation>
-    </message>
-    <message>
-        <source><p><img src=":/res/StatsMostSelfDamage.png"> <b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p><img src=":/res/StatsMostSelfDamage.png"> <b>%1</b> pensou que era bom atirar na sua própria equipe totalizando <b>%2</b> pts.</p></translation>
-    </message>
-    <message>
-        <source><p><img src=":/res/StatsSelfKilled.png"> <b>%1</b> killed <b>%2</b> of his own hedgehogs.</p></source>
-        <translation type="obsolete"><p><img src=":/res/StatsSelfKilled.png"> <b>%1</b> matou <b>%2</b> dos próprios ouriços.</p></translation>
-    </message>
-    <message>
-        <source><p><img src=":/res/StatsSkipped.png"> <b>%1</b> was scared and skipped turn <b>%2</b> times.</p></source>
-        <translation type="obsolete"><p><img src=":/res/StatsSkipped.png"> <b>%1</b> estava assustado e passou o turno <b>%2</b> vezes.</p></translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalhes</translation>
     </message>
@@ -600,10 +491,6 @@ ou escolha outro apelido:</translation>
             <numerusform>(%1 mortes)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 mortes)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -634,15 +521,14 @@ ou escolha outro apelido:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Jogo Local (Jogue uma partida em apenas um computador)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jogo em Rede (Jogue uma partida em rede)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -659,11 +545,6 @@ ou escolha outro apelido:</translation>
         <translation>Se você não tem certeza se quer desperdiçar munição ou ítens, passe a vez. Mas não deixe muitos turnos passarem ou chegará a Morte Súbita!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Quer economizar corda? Dispare-a enquanto estiver no meio do ar. Se você não tocar o solo, você não estará usando as cordas do seu arsenal!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Se você quiser evitar que outros usem seu apelido no servidor oficial, registre-o em http://www.hedgewars.org/.</translation>
@@ -714,16 +595,6 @@ ou escolha outro apelido:</translation>
         <translation>Lembre-se que você pode selecionar suas próprias regras em jogos locais ou em rede. Você não está limitado ao "Jogo Simples".</translation>
     </message>
     <message>
-        <source>Connect a gamepad before launching the game to be able to assign its controls to your team.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Conecte um joystick ou controle antes de iniciar o jogo para poder atribuir os controles ao seu time.</translation>
-    </message>
-    <message>
-        <source>Create an account on http://www.hedgewars.org/ to keep others from using your most favourite nickname while playing on the official server.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Crie um conta em http://www.hedgewars.org/ para evitar que outros use o seu apelido favorito no servidoroficial.</translation>
-    </message>
-    <message>
         <source>While playing you should give yourself a short break at least once an hour.</source>
         <comment>Tips</comment>
         <translation>Não jogue por diversas horas sem descansar! De uma pausa a cada hora.</translation>
@@ -749,11 +620,6 @@ ou escolha outro apelido:</translation>
         <translation>Modos especiais de jogo, como Vampirismo ou Karma permitem desenvolver novas táticas. Tente-os em um jogo personalisado!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">A versão Windows deste jogo permite o uso do Xfire. Certifique-se de adicionar Hedgewars para sua lista de jogos para ver quem está jogando.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Não instale este jogo em computadores que não seja permitido (escola, trabalho, universidade). Solicite isso ao responsável!</translation>
@@ -769,11 +635,6 @@ ou escolha outro apelido:</translation>
         <translation>Nenhum ouriço foi ferido para fazer este jogo.</translation>
     </message>
     <message>
-        <source>Connect one or more gamepads before launching the game to be able to assign their controls to your teams.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Conecte um ou mais  controles antes de iniciar o jogo para que você possa atribuí-los para sua equipe</translation>
-    </message>
-    <message>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
         <comment>Tips</comment>
         <translation>Hedgewars é um jogo de Código Aberto e grátis que criamos em nosso tempo livre. Se alguém te vendeu este jogo, você deveria pedir reembolso!</translation>
@@ -825,11 +686,6 @@ ou escolha outro apelido:</translation>
         <translation>O Ataque com Piano é o mais violento ataque aéreo. Você perderá seu ouriço ao executá-lo, logo, há uma grande contra-partida.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">A Abelha pode ser dificil de usar. O raio da sua volta depende da velocidade dela, então evite usar força máxima.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Minas Adesivas são a arma perfeita para criar pequenas reações em cadeias, colocando ouriços inimigos em situações complicadas.... ou na água</translation>
@@ -855,11 +711,6 @@ ou escolha outro apelido:</translation>
         <translation>O Lança-Chamas é uma arma porém pode ser usado para cavar túneis também.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Use o Cocktail Molotov para evitar que ouriços atravessem terrenos como túneis ou plataformas temporariamente.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Quer saber quem está por trás desse jogo? Clique no logo do Hedgewars no menu principal para ver os créditos.</translation>
@@ -890,11 +741,6 @@ ou escolha outro apelido:</translation>
         <translation>Você pode encontrar os arquivos de configuração em "Meus Documentos\Hedgewars". Crie cópias ou leve os arquivos com você, mas não edite eles manualmente.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Você pode encontrar os arquivos de configuração em ".hedgewars". Crie cópias ou leve os arquivos com você, mas não edite eles manualmente.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation>Você pode associar os arquivos relacionados ao Hedgewars (jogos salvos e gravações demo), podendo abrí-los diretamente do gerenciador de arquivos ou do navegador</translation>
@@ -933,6 +779,46 @@ ou escolha outro apelido:</translation>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -942,33 +828,18 @@ ou escolha outro apelido:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Por favor selecione o servidor na lista acima</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Controle</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Erro</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Entre com um nome de sala</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -981,6 +852,14 @@ ou escolha outro apelido:</translation>
         <source>Official server</source>
         <translation>Servidor Oficial</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -997,18 +876,6 @@ ou escolha outro apelido:</translation>
         <translation>Apagar equipe</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Novo esquema de armas</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Editar esquema de armas</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Apagar esquema de armas</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Você não pode editar as equipes a partir da seleção de equipes. Volte ao menu para adicionar, editar ou apagar equipes.</translation>
     </message>
@@ -1036,129 +903,79 @@ ou escolha outro apelido:</translation>
         <source>Delete weapon set</source>
         <translation>Apagar esquema de armas</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
+        <source>General</source>
+        <translation type="unfinished">Geral</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Avançado</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Renomear</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Especifique o novo nome do arquivo:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Não foi possível renomear para</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Não foi possível excluir o arquivo</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Por favor selecione uma entrada da lista</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
-    <message>
-        <source>Create</source>
-        <translation>Criar</translation>
-    </message>
-    <message>
-        <source>Join</source>
-        <translation>Entrar</translation>
-    </message>
-    <message>
-        <source>Refresh</source>
-        <translation>Atualizar</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Opções do Administrador</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Room Name:</source>
-        <translation>Nome da Sala:</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Este jogo está em espera.
-Você pode entrar e começar a jogar quando o jogo iniciar.</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Este jogo já está acontecendo.
-Você pode entrar e assitir, mas terá que esperar o jogo terminar para poder jogar.</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 é o anfitrião. Ele pode ajustar opções e iniciar o jogo.</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Mapa Aleatório</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Partidas podem ser jogadas em mapas pré-criados ou aleatórios.</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>O Esquema de Jogo define as opções gerais e preferências como Tempo do Round, Morte Súbita ou Vampirismo.</translation>
+        <source>Rename dialog</source>
+        <translation>Renomear</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>o Esquema de Armas define as armas disponíveis e as quantidades de munições delas.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Existe %1 cliente conectado a esta sala.</numerusform>
-            <numerusform>Existem %1 clientes conectados a esta sala.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Existe %1 equipe participando desta sala.</numerusform>
-            <numerusform>Existem %1 equipes participando desta sala.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Especifique o novo nome do arquivo:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Entre com um nome de sala</translation>
+        <source>Create</source>
+        <translation>Criar</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Selecione uma sala da lista</translation>
+        <source>Join</source>
+        <translation>Entrar</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Aleatório</translation>
+        <source>Admin features</source>
+        <translation>Opções do Administrador</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Estado:</translation>
+        <source>Room Name:</source>
+        <translation>Nome da Sala:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1176,16 +993,6 @@ Você pode entrar e assitir, mas terá que esperar o jogo terminar para poder jo
         <source>Clear</source>
         <translation>Limpar</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Aviso</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>O jogo no qual você está tentando entrar já começou.
-Você ainda quer entrar na sala?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1205,10 +1012,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Excluir</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Habilitar minas aleatórias</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Ganhe 80% dos danos de vida para você</translation>
     </message>
@@ -1241,10 +1044,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Terreno não pode ser destruído!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Adicione uma borda indestrutível em volta do terreno</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Baixa gravidade</translation>
     </message>
@@ -1347,35 +1146,47 @@ Você ainda quer entrar na sala?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Jogo Simples (uma partida rápida contra o computador, opções são escolhidas por você)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multiplayer (jogue no mesmo computador contra seus amigos ou contra o computador)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo de Treino (Pratique suas habilidades nas missões de treino). EM DESENVOLVIMENTO</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (Assista a demos gravadas)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carregar (Carregue um jogo salvo)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo Campanha (...) EM DESENVOLVIMENTO</translation>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Load</source>
+        <translation type="unfinished">Carregar</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1389,6 +1200,52 @@ Você ainda quer entrar na sala?</translation>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Nome</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1476,10 +1333,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Checar por atualizações ao iniciar</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Qualidade reduzida</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Mostrar instruções no menu de armas</translation>
     </message>
@@ -1495,6 +1348,26 @@ Você ainda quer entrar na sala?</translation>
         <source>Frontend effects</source>
         <translation>Efeitos da interface</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1539,42 +1412,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Em progresso</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Padrão</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Modo Pro</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Shoppa</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Basketball</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Campo Minado</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Inferno de Barris</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Túneis</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Crazy</translation>
-    </message>
-    <message>
-        <source>Normal</source>
-        <translation type="obsolete">Normal</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished">mapa desenhado a mão...</translation>
     </message>
@@ -1666,10 +1503,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Opções de áudio e gráficos</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Armas</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Jogo em rede</translation>
     </message>
@@ -1697,14 +1530,34 @@ Você ainda quer entrar na sala?</translation>
         <source>Schemes and Weapons</source>
         <translation>Esquemas e Armas</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Este programa é distribuido sob a Licensa Pública GNU</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Desenvolvedores:</translation>
     </message>
@@ -1741,10 +1594,6 @@ Você ainda quer entrar na sala?</translation>
         <translation>Limite de FPS</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Apelido de rede</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Nome do servidor:</translation>
     </message>
@@ -1829,24 +1678,10 @@ Você ainda quer entrar na sala?</translation>
         <translation>Localização</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Reinicie o jogo para aplicar as modificações</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Esta construção a partir do SVN é "trabalho em progresso" e pode não ser compatível com outras versões do jogo.
-Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e risco!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Explosivos</translation>
     </message>
     <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Esta construção a partir do SVN é "trabalho em progresso" e pode não ser compatível com outras versões do jogo. Algumas funcionalidades podem estar quebradas ou incompletas. Use por sua conta e risco!</translation>
-    </message>
-    <message>
         <source>Tip: </source>
         <translation>Dica:</translation>
     </message>
@@ -1879,10 +1714,6 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
         <translation type="unfinished">% Comprimento da Corda</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Modo de Jogo</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1895,10 +1726,6 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Senha</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1906,6 +1733,68 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Apelido</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1917,6 +1806,10 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1928,10 +1821,6 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Rede</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>A conexão com o servidor foi perdida</translation>
     </message>
@@ -1940,83 +1829,223 @@ Algumas funcionalidades podem estar quebradas ou incompletas. Use a sua conta e
         <translation>Erro</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Associação de arquivos falhou.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Não foi possível criar o diretório %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Não foi possível abrir diretório de dados:
-%1
-Por favor verifique sua instalação</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Armas</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translatorcomment>Duvida:Esquema ou disposição?</translatorcomment>
-        <translation type="obsolete">Não foi possível editar o equemas de armas padrão</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Não foi possível iniciar o servidor: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translatorcomment>Duvida:Esquema ou disposição?</translatorcomment>
-        <translation type="obsolete">Não foi possível excluir o esquema padrão de armas</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Realmente deseja remover este esquema de armas?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Não pode sobre-escrever o esquema %1!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Todos os arquivos foram associados.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Associação de arquivos falhou.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Equipes</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Entre com um nome de sala</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation type="unfinished">Realmente deseja apagar esta Equipe?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation type="unfinished">Esquemas</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Por favor selecione uma entrada da lista</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation type="unfinished">Esquema padrão não pode ser apagado '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation type="unfinished">Realmente deseja apagar este esquema de jogo?</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation type="unfinished">Esquema de armas não pode ser apagado '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Selecione uma sala da lista</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Não foi possível criar o diretório %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">O jogo no qual você está tentando entrar já começou.
+Você ainda quer entrar na sala?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Apelido</translation>
     </message>
@@ -2096,45 +2125,79 @@ Por favor verifique sua instalação</translation>
         <translation>Associar extensão de arquivos.</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translatorcomment>Esquema esta muito genérico</translatorcomment>
-        <translation type="obsolete">Esquema</translation>
+        <source>more</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>more</source>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">Em progresso</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Nome da Sala</translation>
+        <translation type="unfinished">Nome da Sala</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translatorcomment>E de equipe, na tabela de salas. (Equipes conectadas)</translatorcomment>
-        <translation>E</translation>
+        <translation type="unfinished">E</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Dono</translation>
+        <translation type="unfinished">Dono</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Mapa</translation>
+        <translation type="unfinished">Mapa</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Regras</translation>
+        <translation type="unfinished">Regras</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Armas</translation>
+        <translation type="unfinished">Armas</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Mapa Aleatório</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Labirinto Aleatório</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2166,21 +2229,6 @@ Por favor verifique sua instalação</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Não foi possível iniciar o servidor: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Não foi possível iniciar o motor: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2223,10 +2271,6 @@ Por favor verifique sua instalação</translation>
         <translation>Invulnerabilidade</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Adicionar Minas</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Ordem Aleatória</translation>
     </message>
@@ -2451,6 +2495,14 @@ ouriços</translation>
         <source>slot 10</source>
         <translation>posição 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2537,6 +2589,10 @@ ouriços</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Alterna as informações sobre os ouriços:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts b/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts
index b831926..5a39430 100644
--- a/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_pt_PT.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pt_PT">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation>Retrodecer</translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Erro no ficheiro</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Impossivel abrir o ficheiro '%1' para escrita</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Impossivel let o ficheiro '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Editar armas</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Esquema de armas inválido</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Editar esquemas</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 foi removido da tua Ignore List</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 foi adicionado à tua Ignore List</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 foi removido da tua lista de amigos</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 foi adicionado à tua lista de amigos</translation>
+        <source>Do you really want to quit?</source>
+        <translation>Deseja realmente saír?</translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation>%1 foi removido da tua lista de utilizadores ignorados</translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation>%1 não é um comando valido!</translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation>A expulsar %1 ...</translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">novo</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Não foi possível iniciar o servidor</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Não foi possível gravar no ficheiro %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Seleccione uma gravação da lista acima</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>EquipaPorOmissão</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation>Jogo abortado</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,18 +157,15 @@ outro nome de utilizador no menu de configuração:</translation>
         <translation>Nome de utilizador</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation>O nome de utilizador %1
-já está a ser utilizado.
-Por favor escolhe outro nome de utilizador.</translation>
-    </message>
-    <message>
         <source>No nickname supplied.</source>
         <translation>Não foi fornecido um nome de utilizador.</translation>
     </message>
+    <message>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
+        <translation>Alguem já está a utilizar o teu nome de utilizador %1 no servidor.
+Por favor escolhe outro nome de utilizador:</translation>
+    </message>
 </context>
 <context>
     <name>HWGame</name>
@@ -347,20 +291,6 @@ Por favor escolhe outro nome de utilizador.</translation>
         <translation>Foi expulso</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Password</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">O nome de utilizador %1 está
-registado em Hedgewars.org
-Por favor digite a sua palavra passe
-ou escolha outro nome de utilizador:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 juntou-se à sala</translation>
     </message>
@@ -377,31 +307,34 @@ ou escolha outro nome de utilizador:</translation>
         <translation>%1 *** %2 saíu</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">O nome de utilizador %1 está
-registado em Hedgewars.org
-Por favor digite a sua palavra passe ou escolha
-outro nome de utilizador no menu de configuração:</translation>
+        <source>User quit</source>
+        <translation>Utilizador saiu</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Nome de utilizador</translation>
+        <source>Remote host has closed connection</source>
+        <translation>O anfitrião remoto terminou a ligação</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">O nome de utilizador %1
-já está a ser utilizado no servidor.
-Por favor escolha outro nome de utilizador.</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation>O servidor é demasiado antigo. Desconectado.</translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
-        <translation>Utilizador saiu</translation>
+        <source>Password</source>
+        <translation>Palavra-passe</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation>Upload vídeo</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Upload</translation>
     </message>
 </context>
 <context>
@@ -412,18 +345,29 @@ Por favor escolha outro nome de utilizador.</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s</source>
+        <translation>Duração: %1m %2s</translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Mensagem do servidor:</translation>
+        <source>Video: %1x%2, </source>
+        <translation>Vídeo:  %1x%2, </translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Definir mensagem</translation>
+        <source>%1 fps, </source>
+        <translation>%1 fps, </translation>
     </message>
     <message>
+        <source>Audio: </source>
+        <translation>Audio: </translation>
+    </message>
+</context>
+<context>
+    <name>PageAdmin</name>
+    <message>
         <source>Clear Accounts Cache</source>
-        <translation>Limpar a cache das contas</translation>
+        <translation>Limpar Cache das Contas</translation>
     </message>
     <message>
         <source>Fetch data</source>
@@ -456,10 +400,6 @@ Por favor escolha outro nome de utilizador.</translation>
         <source>Connecting...</source>
         <translation>A ligar...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Cancelar</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -484,10 +424,6 @@ Por favor escolha outro nome de utilizador.</translation>
         <translation>Carregar mapa desenhado</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Mapas Desenhados (*.hwmap);;Todos os ficheiros (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Gravar mapa desenhado</translation>
     </message>
@@ -499,6 +435,10 @@ Por favor escolha outro nome de utilizador.</translation>
         <source>All files</source>
         <translation>Todos os ficheiros</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation>Apagador</translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -514,24 +454,6 @@ Por favor escolha outro nome de utilizador.</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>O título de melhor tiro foi para <b>%1</b> com <b>%2</b> pontos de dano.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>O extreminador da ronda foi <b>%1</b> com <b>%2</b> morto num unico turno.</p></numerusform>
-            <numerusform><p>O extreminador da ronda foi <b>%1</b> com <b>%2</b> mortes num unico turno.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Apenas <b>%1</b> ouriço perdeu a vida durante esta ronda.</p></numerusform>
-            <numerusform><p>Um total de <b>%1</b> ouriços perderam a vida durante esta ronda.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detalhes</translation>
     </message>
@@ -571,8 +493,8 @@ Por favor escolha outro nome de utilizador.</translation>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
-            <numerusform><b>%1</b> axou que seria divertido atacar a sua própria equipa fazendo <b>%2</b> ponto de dano.</numerusform>
-            <numerusform><b>%1</b> axou que seria divertido atacar a sua própria equipa fazendo <b>%2</b> pontos de dano.</numerusform>
+            <numerusform><b>%1</b> axou que seria divertido atacar a sua própria equipa causando <b>%2</b> ponto de dano.</numerusform>
+            <numerusform><b>%1</b> axou que seria divertido atacar a sua própria equipa causando um total de <b>%2</b> pontos de dano.</numerusform>
         </translation>
     </message>
     <message numerus="yes">
@@ -585,8 +507,8 @@ Por favor escolha outro nome de utilizador.</translation>
     <message numerus="yes">
         <source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
         <translation>
-            <numerusform><b>%1</b> estava tão intimidado que passou <b>%2</b> turno.</numerusform>
-            <numerusform><b>%1</b> estava tão intimidado que passou <b>%2</b> turnos.</numerusform>
+            <numerusform><b>%1</b> estava tão amedrontado que passou <b>%2</b> turno.</numerusform>
+            <numerusform><b>%1</b> estava tão amedrontado que passou <b>%2</b> turnos.</numerusform>
         </translation>
     </message>
 </context>
@@ -598,15 +520,14 @@ Por favor escolha outro nome de utilizador.</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Jogo local (Joga Hedgewars apenas com este computador)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Jogo em rede (Joga em rede ou na internet)</translation>
+        <source>Open the snapshot folder</source>
+        <translation>Abrir a pasta com as capturas de ecrã</translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -856,6 +777,46 @@ Por favor escolha outro nome de utilizador.</translation>
         <source>Downloadable Content</source>
         <translation>Conteúdo Transferível (DLC)</translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation>Jogo Local</translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation>Joga num único computador</translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation>Jogo em Rede</translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation>Joga Hedgewars através da rede</translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation>Lê sobre quem está por trás do Projecto Hedgewars</translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation>Deixa feedback expondo problemas, sugerindo novas funcionalidades ou simplesmente expressando o quanto adoras o Hedgewars</translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation>Acede a conteúdo criado pelos utilizadores acessível do nosso website</translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation>Saír do jogo</translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation>Gere vídeos de partidas gravadas</translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation>Editar as preferencias de jogo</translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -865,33 +826,18 @@ Por favor escolha outro nome de utilizador.</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Seleccione um servidor da lista acima</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Controlo</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
+        <source>DLC</source>
+        <translation>DLC</translation>
     </message>
     <message>
-        <source>Please enter room name</source>
-        <translation>Por favor insira o nome da sala</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation>Conteúdo Transferível</translation>
     </message>
 </context>
 <context>
@@ -904,6 +850,14 @@ Por favor escolha outro nome de utilizador.</translation>
         <source>Official server</source>
         <translation>Servidor oficial</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation>Junta-te a centenas de jogadores online!</translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation>Cria ou junta-te a jogo numa Rede Local</translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -920,18 +874,6 @@ Por favor escolha outro nome de utilizador.</translation>
         <translation>Apagar equipa</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Novo esquema de armas</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Editar esquema de armas</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Apagar esquema de armas</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Não é possível editar equipas do menu de selecção de equipa. Volte ao menu principal se pretender adicionar, editar ou apagar equipas.</translation>
     </message>
@@ -959,129 +901,79 @@ Por favor escolha outro nome de utilizador.</translation>
         <source>Delete weapon set</source>
         <translation>Apagar esquema de armas</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Rename dialog</source>
-        <translation>Renomear</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>Insira um novo nome para o ficheiro:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Não foi possível renomear para</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Não é possível eliminar o ficheiro</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Por favor seleccione uma gravação da lista</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
-    <message>
-        <source>Create</source>
-        <translation>Criar</translation>
-    </message>
     <message>
-        <source>Join</source>
-        <translation>Entrar</translation>
+        <source>General</source>
+        <translation>Geral</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Actualizar</translation>
+        <source>Advanced</source>
+        <translation>Avançado</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
+        <source>Reset to default colors</source>
+        <translation>Repor cores por omisão</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Proxy host</source>
+        <translation>Servidor</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Recursos de administrador</translation>
+        <source>Proxy port</source>
+        <translation>Porta</translation>
     </message>
     <message>
-        <source>Room Name:</source>
-        <translation>Nome da Sala:</translation>
+        <source>Proxy login</source>
+        <translation>Login</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Este jogo está ainda na entrada.
-Pode-se juntar e jogar assim que o jogo começe.</translation>
+        <source>Proxy password</source>
+        <translation>Password</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Este jogo está em progresso.
-Pode-se juntar e observar, mas vai ter de esperar que o jogo termine para poder jogar.</translation>
+        <source>No proxy</source>
+        <translation>Não utilizar proxy</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 é o anfitrião. Ele pode ajustar as configurações e começar o jogo.</translation>
+        <source>Socks5 proxy</source>
+        <translation>Proxy Socks5</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Mapa Aleatório</translation>
+        <source>HTTP proxy</source>
+        <translation>Proxy HTTP</translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>É possivel jogar em mapas pré-criados ou aleatórios.</translation>
+        <source>System proxy settings</source>
+        <translation>Configuração proxy do sistema</translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>O Esquema de Jogo define as configurações gerais e preferências como Tempo da Ronda, Morte súbita ou Vampirismo.</translation>
+        <source>Rename dialog</source>
+        <translation>Renomear</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>O Esquema de Armas define que armas estão disponíveis e a quantidade de munições.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Apenas %1 cliente esta conectado a esta sala.</numerusform>
-            <numerusform>Um total de %1 clientes estão conectados a esta sala.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Apenas %1 equipa esta a participar nesta sala.</numerusform>
-            <numerusform>Existem %1 equipas a participar nesta sala.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Insira um novo nome para o ficheiro:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Insira o nome da sala</translation>
+        <source>Create</source>
+        <translation>Criar</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Seleccione uma sala da lista</translation>
+        <source>Join</source>
+        <translation>Entrar</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Labirinto Aleatório</translation>
+        <source>Admin features</source>
+        <translation>Recursos de administrador</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Estado:</translation>
+        <source>Room Name:</source>
+        <translation>Nome da Sala:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1099,16 +991,6 @@ Pode-se juntar e observar, mas vai ter de esperar que o jogo termine para poder
         <source>Clear</source>
         <translation>Limpar</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Atenção</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>O jogo a que te estas a tentar juntar já começou.
-Desejas juntar-te ao jogo de qualquer maneira?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1121,11 +1003,11 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     <name>PageScheme</name>
     <message>
         <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation>Defende o teu forte e destrói os inimigos, duas cores de equipa no máximo!</translation>
+        <translation>Defende o teu forte e destrói os oponentes, duas cores de equipa no máximo!</translation>
     </message>
     <message>
         <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation>As equipas começarão em lados opostos do terreno, duas cores de equipa no máximo!</translation>
+        <translation>As equipas começam em lados opostos do terreno, duas cores de equipa no máximo!</translation>
     </message>
     <message>
         <source>Land can not be destroyed!</source>
@@ -1133,31 +1015,27 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Lower gravity</source>
-        <translation>Baixa gravidade</translation>
+        <translation>Gravidade ainda mais baixa</translation>
     </message>
     <message>
         <source>Assisted aiming with laser sight</source>
-        <translation>Mira assistida por laser</translation>
+        <translation>Pontaria assistida por mira laser</translation>
     </message>
     <message>
         <source>All hogs have a personal forcefield</source>
         <translation>Todos os ouriços têm um campo de forças pessoal</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Adiciona minas aleatoriamente</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Converte 80% do dano realizado em vida</translation>
     </message>
     <message>
         <source>Share your opponents pain, share their damage</source>
-        <translation>Partilhe o sofrimento dos inimigos, e os danos</translation>
+        <translation>Partilha o sofrimento dos teus oponentes, e os seus danos</translation>
     </message>
     <message>
         <source>Your hogs are unable to move, put your artillery skills to the test</source>
-        <translation>Os teus ouriços serão impossibilidados de se mexer, testa as tuas capacidades no modo artilharia</translation>
+        <translation>Os teus ouriços serão impossibilidados de se mover, testa as tuas capacidades no modo artilharia</translation>
     </message>
     <message>
         <source>Random</source>
@@ -1181,7 +1059,7 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Play with a King. If he dies, your side dies.</source>
-        <translation>Jogar com um Rei. Se ele morrer, o teu lado morre.</translation>
+        <translation>Jogar com um Rei. Se ele morrer, toda a equipa perde o jogo.</translation>
     </message>
     <message>
         <source>Take turns placing your hedgehogs before the start of play.</source>
@@ -1197,7 +1075,7 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Disable land objects when generating random maps.</source>
-        <translation>Não adicionar objectos de terreno ao gerar mapas aleatórios.</translation>
+        <translation>Não adicionar objectos no terreno ao gerar mapas aleatórios.</translation>
     </message>
     <message>
         <source>AI respawns on death.</source>
@@ -1205,7 +1083,7 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>All (living) hedgehogs are fully restored at the end of turn</source>
-        <translation>Todos os ouriços (vivos) são completamente restaurados no final do turn</translation>
+        <translation>Todos os ouriços (vivos) são completamente restaurados no final do turno</translation>
     </message>
     <message>
         <source>Attacking does not end your turn.</source>
@@ -1217,7 +1095,7 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Each hedgehog has its own ammo. It does not share with the team.</source>
-        <translation>Cada ouriço tem as suas próprias armas. Não são partilhadas com a equipa.</translation>
+        <translation>Cada ouriço tem as suas próprias munições. Não são partilhadas com a equipa.</translation>
     </message>
     <message>
         <source>You will not have to worry about wind anymore.</source>
@@ -1225,7 +1103,7 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Wind will affect almost everything.</source>
-        <translation>O vento afecta quase tudo.</translation>
+        <translation>O vento afecta praticamente tudo.</translation>
     </message>
     <message>
         <source>Copy</source>
@@ -1266,36 +1144,48 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Jogo simples (jogo rápido contra o computador, as definições serão escolhidas para si)</translation>
+        <source>Simple Game</source>
+        <translation>Jogo Simples</translation>
+    </message>
+    <message>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Joga um jogo rápido contra o computador com configurações aleatórias</translation>
+    </message>
+    <message>
+        <source>Multiplayer</source>
+        <translation>Multi-jogador</translation>
+    </message>
+    <message>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Joga alternadamente contra os teus amigos, ou o computador</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multi Jogador (jogo estratégico contra amigos ou equipas IA)</translation>
+        <source>Campaign Mode</source>
+        <translation>Modo Campanha</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo de Treino (pratica as tuas capacidades numa variedade de missões de treino). EM DESENVOLVIMENTO</translation>
+        <source>Training Mode</source>
+        <translation>Modo Treino</translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (ver demos gravados)</translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Pratica as tuas habilidades numa variedade de missões de treino</translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Carregar (carrega um jogo salvo previamente)</translation>
+        <source>Demos</source>
+        <translation>Demos</translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Modo Campanha (...) EM DESENVOLVIMENTO</translation>
+        <source>Watch recorded demos</source>
+        <translation>Assistir aos demos guardados</translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
-        <translation>Modo Campanha (...)</translation>
+        <source>Load</source>
+        <translation>Carregar</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation>Modo Treino (Treina as tuas habilidades numa panóplia de missões de treino)</translation>
+        <source>Load a previously saved game</source>
+        <translation>Carrega um jogo gravado anteriormente</translation>
     </message>
 </context>
 <context>
@@ -1308,6 +1198,52 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <source>Select a mission!</source>
         <translation>Selecciona uma missão!</translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation>Seleciona uma missão ou treino para jogar</translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation>Começar a batalha</translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation>Nome</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation>Tamanho</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 byte</numerusform>
+            <numerusform>%1 bytes</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation>(em progresso...)</translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation>Data: </translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation>Tamanho: </translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation>a converter</translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation>a enviar</translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1395,10 +1331,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Adicionar data e hora ao nome do ficheiro de gravação</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Qualidade reduzida</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Mostrar a ajuda no menu das armas</translation>
     </message>
@@ -1414,6 +1346,26 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <source>Frontend effects</source>
         <translation>Efeitos no frontend</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation>Guardar Palavra-passe</translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation>Guardar o nome da conta e palavra-passe</translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation>O vídeo é privado</translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation>Gravar audio</translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation>Utilizar a resolução do jogo</translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1458,10 +1410,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Em progresso</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Predefinido</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>mapa desenhado à mão...</translation>
     </message>
@@ -1549,10 +1497,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Equipas</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Armas</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Opções de Áudio/Gráficos</translation>
     </message>
@@ -1584,6 +1528,30 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <source>Schemes and Weapons</source>
         <translation>Esquemas e Armamento</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation>Cores personalizadas</translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation>Outras opções</translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation>Opções de criação de vídeo</translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation>Vídeos</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Descrição</translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation>Definições do Proxy</translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1600,10 +1568,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Versão</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Este programa é distribuído sob a GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Programadores:</translation>
     </message>
@@ -1636,10 +1600,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Porta:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Nick de rede</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Resolução</translation>
     </message>
@@ -1661,15 +1621,15 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Damage Modifier</source>
-        <translation>Modificador de dano</translation>
+        <translation>Modificador de Dano</translation>
     </message>
     <message>
         <source>Turn Time</source>
-        <translation>Tempo por turno</translation>
+        <translation>Tempo por Turno</translation>
     </message>
     <message>
         <source>Initial Health</source>
-        <translation>Vida inicial</translation>
+        <translation>Vida Inicial</translation>
     </message>
     <message>
         <source>Sudden Death Timeout</source>
@@ -1677,11 +1637,11 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Scheme Name:</source>
-        <translation>Nome do esquema:</translation>
+        <translation>Nome do Esquema:</translation>
     </message>
     <message>
         <source>Crate Drops</source>
-        <translation>Queda de caixas</translation>
+        <translation>Queda de Caixas</translation>
     </message>
     <message>
         <source>Game scheme</source>
@@ -1716,10 +1676,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Idioma</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Reinicie o jogo para aplicar as alterações</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Explosivos</translation>
     </message>
@@ -1745,11 +1701,11 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
     </message>
     <message>
         <source>Sudden Death Water Rise</source>
-        <translation>Súbida da água durante Morte Súbita</translation>
+        <translation>Súbida da Água durante Morte Súbita</translation>
     </message>
     <message>
         <source>Sudden Death Health Decrease</source>
-        <translation>Vida perdida durante Morte Súbita</translation>
+        <translation>Vida Perdida durante Morte Súbita</translation>
     </message>
     <message>
         <source>% Rope Length</source>
@@ -1760,10 +1716,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Renderização estereoscópica</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Opções de Jogo</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Estilo</translation>
     </message>
@@ -1772,10 +1724,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Esquema</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Password</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% Tempo Para Retirar</translation>
     </message>
@@ -1783,6 +1731,70 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation>Esta aplicação é distribuída sob a GNU General Public License v2</translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation>Existem vídeos a serem currentemente processados.
+Sair irá cancela-los.
+Deseja mesmo sair?</translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation>Por favor forneça o nome da conta do YouTube ou o endereço de email associado com a conta do Google.</translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation>Nome de conta (ou email): </translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation>Palavra-passe: </translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation>Título do vídeo: </translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation>Descrição do vídeo</translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation>Tags\Etiquetas (separados por virgula)</translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation>Sumário   </translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Descrição</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Nome de utilizador</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation>Formato</translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation>Codec de Audio</translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation>Codec de Vídeo</translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation>Framerate</translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation>Bitrate (Kbps)</translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1794,6 +1806,10 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <source>hedgehog %1</source>
         <translation>ouriço %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation>anónimo</translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1805,10 +1821,6 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Rede</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Conexão com o servidor perdida</translation>
     </message>
@@ -1817,81 +1829,228 @@ Desejas juntar-te ao jogo de qualquer maneira?</translation>
         <translation>Erro</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Não foi possivel associar os ficheiros.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation>Por favor preencha todos os campos</translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation>Erro ao autenticar em google.com:
+</translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation>Login ou palavra-passe incorretos</translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation>Erro durante o envio de metadata para youtube.com:
+</translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation>Equipas - Tens a certeza?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation>Desejas mesmo apagar a equipa '%1'?</translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation>Não é possivel apagar o esquema por omisão '%1'!</translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation>Por favor seleciona uma gravação da lista</translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation>Não foi possível iniciar servidor</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation>Hedgewars - Erro</translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation>Hedgewars - Sucesso</translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation>Todos os ficheiros foram corretamente associados</translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation>Problema publicado com sucesso em hedgewars.googlecode.com</translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation>Ocorreu um erro durante a autenticação em google.com</translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation>Erro ao reportar o problema, por favor tenta novamente mais tarde (ou visita hedgewars.googlecode.com diretamente)</translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation>Main - Erro</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Não foi possível criar o directório %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Não foi possível abrir o directório:
+
+Please check your installation!</source>
+        <translation>Erro ao abrir o diretório:
 %1
-Por favor verifique a sua instalação</translation>
+
+Por favor verifica a tua instalação!</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Armas</translation>
+        <source>TCP - Error</source>
+        <translation>TCP - Erro</translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Não é possível editar o esquema de armas predefinido</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation>Não foi possível iniciar o servidor: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Não é possível eliminar o esquema de armas predefinido</translation>
+        <source>Unable to run engine at </source>
+        <translation>Não foi possivel lançar o motor de jogo em </translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Deseja mesmo eliminar este esquema de armas?</translation>
+        <source>Error code: %1</source>
+        <translation>Código de erro: %1</translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Não é possivel sobrescrever o esquema de armas por omissão '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation>Upload do vídeo - Erro</translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Os ficheiros foram associados com sucesso.</translation>
+        <source>Netgame - Error</source>
+        <translation>Netgame - Erro</translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Não foi possivel associar os ficheiros.</translation>
+        <source>Please select a server from the list</source>
+        <translation>Por favor seleciona um servidor da lista</translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Equipas</translation>
+        <source>Please enter room name</source>
+        <translation>Por favor insere um nome para a sala</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Deseja mesmo apagar esta equipa?</translation>
+        <source>Record Play - Error</source>
+        <translation>Record Play - Erro</translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Esquemas</translation>
+        <source>Please select record from the list</source>
+        <translation>Por favor selecciona uma gravação da lista</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Não é possível eliminar o esquema por omisão '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation>Não é possivel renomear para </translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Deseja mesmo apagar este esquema de jogo?</translation>
+        <source>Cannot delete file </source>
+        <translation>Não é possivel apagar o ficheiro </translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Não é possível eliminar o esquema de armas por omisão '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation>Nome da Sala - Erro</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Erro</translation>
+        <source>Please select room from the list</source>
+        <translation>Por favor selecciona uma sala da lista</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Não foi possível criar o directório %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation>Nome da Sala - Tens a certeza?</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>O jogo a que te estas a tentar juntar já começou.
+Desejas entrar na sala de qualquer maneira?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation>Esquemas - Aviso</translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation>Esquemas - Tens a certeza?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation>Desejas mesmo apagar o esquema de jogo '%1'?</translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation>Vídeos - Tens a certeza?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation>Desejas mesmo apagar o vídeo '%1'?</translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation>
+            <numerusform>Desejas mesmo remover o ficheiro %1?</numerusform>
+            <numerusform>Desejas mesmo remover os ficheiros %1?</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation>Desejas mesmo cancelar o upload de %1?</translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation>Erro no ficheiro</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation>Impossivel abrir '%1' para escrita</translation>
     </message>
     <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation>Impossivel abrir '%1' para leitura</translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation>Impossivel utilizar as munições '%1'!</translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation>Armas - Aviso</translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation>Não é possivel substituir o esquema de armas '%1'!</translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation>Não é possivel apagar o esquema de armas por omisão '%1'!</translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation>Armas - Tens a certeza?</translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation>Desejas mesmo apagar o esquema de armas '%1'?</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Nome de utilizador</translation>
     </message>
@@ -1974,9 +2133,37 @@ Por favor verifique a sua instalação</translation>
         <source>more</source>
         <translation>mais</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation>Mais informação</translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation>Restaurar opções por omisão</translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation>Abrir o directório dos vídeos</translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation>Reproduzir</translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation>Enviar para o Youtube</translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation>Cancelar o upload</translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation>Em progresso</translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation>Nome da Sala</translation>
@@ -2003,7 +2190,19 @@ Por favor verifique a sua instalação</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Armas</translation>
+        <translation>Armamento</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Mapa Aleatório</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Labirinto Aleatório</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation>Desenhado à mão</translation>
     </message>
 </context>
 <context>
@@ -2034,21 +2233,6 @@ Por favor verifique a sua instalação</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Erro</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Não foi possível iniciar o servidor: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Não foi possível executar o motor: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2076,7 +2260,7 @@ Por favor verifique a sua instalação</translation>
     </message>
     <message>
         <source>Add Border</source>
-        <translation>Adicionar Borda</translation>
+        <translation>Adicionar Limites</translation>
     </message>
     <message>
         <source>Low Gravity</source>
@@ -2084,17 +2268,13 @@ Por favor verifique a sua instalação</translation>
     </message>
     <message>
         <source>Laser Sight</source>
-        <translation>Mira laser</translation>
+        <translation>Mira Laser</translation>
     </message>
     <message>
         <source>Invulnerable</source>
         <translation>Invulnerabilidade</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Adicionar minas</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Ordem Aleatória</translation>
     </message>
@@ -2124,7 +2304,7 @@ Por favor verifique a sua instalação</translation>
     </message>
     <message>
         <source>Reset Health</source>
-        <translation>Restaurar a Vida</translation>
+        <translation>Restaurar Vida</translation>
     </message>
     <message>
         <source>Unlimited Attacks</source>
@@ -2152,7 +2332,7 @@ Por favor verifique a sua instalação</translation>
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation>Adicionar borda inferior</translation>
+        <translation>Adicionar limite inferior</translation>
     </message>
 </context>
 <context>
@@ -2319,6 +2499,14 @@ ouriços</translation>
         <source>slot 10</source>
         <translation>slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation>Silenciar audio</translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation>gravar</translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2405,6 +2593,10 @@ ouriços</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Alterar as etiquetas acima dos ouriços:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Gravar vídeo:</translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_ro.ts b/share/hedgewars/Data/Locale/hedgewars_ro.ts
new file mode 100644
index 0000000..5066be7
--- /dev/null
+++ b/share/hedgewars/Data/Locale/hedgewars_ro.ts
@@ -0,0 +1,2701 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ro">
+<context>
+    <name>AmmoSchemeModel</name>
+    <message>
+        <source>new</source>
+        <translation>new</translation>
+    </message>
+    <message>
+        <source>copy of</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>DrawMapWidget</name>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open file '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot read file '%1'</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>FreqSpinBox</name>
+    <message>
+        <source>Never</source>
+        <translation>Never</translation>
+    </message>
+    <message numerus="yes">
+        <source>Every %1 turn</source>
+        <translation>
+            <numerusform>Each turn</numerusform>
+            <numerusform>Every %1 turns</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>GameCFGWidget</name>
+    <message>
+        <source>Edit weapons</source>
+        <translation>Edit weapons</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>Illegal ammo scheme</source>
+        <translation>Illegal ammo scheme</translation>
+    </message>
+    <message>
+        <source>Edit schemes</source>
+        <translation>Edit schemes</translation>
+    </message>
+    <message>
+        <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Game Options</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
+    <message>
+        <source>%1 *** %2 has been removed from your ignore list</source>
+        <translation type="obsolete">%1 *** %2 has been removed from your ignore list</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been added to your ignore list</source>
+        <translation type="obsolete">%1 *** %2 has been added to your ignore list</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been removed from your friends list</source>
+        <translation type="obsolete">%1 *** %2 has been removed from your friends list</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has been added to your friends list</source>
+        <translation type="obsolete">%1 *** %2 has been added to your friends list</translation>
+    </message>
+    <message>
+        <source>%1 has been removed from your ignore list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 has been added to your ignore list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 has been removed from your friends list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 has been added to your friends list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Stylesheet imported from %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Couldn't read %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>StyleSheet discarded</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>StyleSheet saved to %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Failed to save StyleSheet to %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 is not a valid command!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Kicking %1 ...</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWForm</name>
+    <message>
+        <source>new</source>
+        <translation type="obsolete">new</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Unable to start the server</source>
+        <translation>Unable to start the server</translation>
+    </message>
+    <message>
+        <source>Cannot save record to file %1</source>
+        <translation>Cannot save record to file %1</translation>
+    </message>
+    <message>
+        <source>Please select record from the list above</source>
+        <translation>Please select record from the list above</translation>
+    </message>
+    <message>
+        <source>DefaultTeam</source>
+        <translation>Default Team</translation>
+    </message>
+    <message>
+        <source>Hedgewars Demo File</source>
+        <comment>File Types</comment>
+        <translation>Hedgewars Demo File</translation>
+    </message>
+    <message>
+        <source>Hedgewars Save File</source>
+        <comment>File Types</comment>
+        <translation>Hedgewars Save File</translation>
+    </message>
+    <message>
+        <source>Demo name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Demo name:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Game aborted</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Password</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</source>
+        <translation type="unfinished">Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</translation>
+    </message>
+    <message>
+        <source>No password supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Nickname</translation>
+    </message>
+    <message>
+        <source>Some one already uses
+ your nickname %1
+on the server.
+Please pick another nickname:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWGame</name>
+    <message>
+        <source>en.txt</source>
+        <translation>en.txt</translation>
+    </message>
+    <message>
+        <source>Cannot open demofile %1</source>
+        <translation>Cannot open demofile %1</translation>
+    </message>
+</context>
+<context>
+    <name>HWMapContainer</name>
+    <message>
+        <source>Map</source>
+        <translation>Map</translation>
+    </message>
+    <message>
+        <source>Themes</source>
+        <translation>Themes</translation>
+    </message>
+    <message>
+        <source>Filter</source>
+        <translation>Filter</translation>
+    </message>
+    <message>
+        <source>All</source>
+        <translation>All</translation>
+    </message>
+    <message>
+        <source>Small</source>
+        <translation>Small</translation>
+    </message>
+    <message>
+        <source>Medium</source>
+        <translation>Medium</translation>
+    </message>
+    <message>
+        <source>Large</source>
+        <translation>Large</translation>
+    </message>
+    <message>
+        <source>Cavern</source>
+        <translation>Cavern</translation>
+    </message>
+    <message>
+        <source>Wacky</source>
+        <translation>Wacky</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>Small tunnels</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Medium tunnels</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Large tunnels</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Small floating islands</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Medium floating islands</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Large floating islands</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Seed</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWNetServersModel</name>
+    <message>
+        <source>Title</source>
+        <translation>Title</translation>
+    </message>
+    <message>
+        <source>IP</source>
+        <translation>IP</translation>
+    </message>
+    <message>
+        <source>Port</source>
+        <translation>Port</translation>
+    </message>
+</context>
+<context>
+    <name>HWNewNet</name>
+    <message>
+        <source>The host was not found. Please check the host name and port settings.</source>
+        <translation>The host was not found. Please check the host name and port settings.</translation>
+    </message>
+    <message>
+        <source>Connection refused</source>
+        <translation>Connection refused</translation>
+    </message>
+    <message>
+        <source>Room destroyed</source>
+        <translation>Room destroyed</translation>
+    </message>
+    <message>
+        <source>Quit reason: </source>
+        <translation>Quit reason: </translation>
+    </message>
+    <message>
+        <source>You got kicked</source>
+        <translation>You got kicked</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation type="obsolete">Password</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password
+or pick another nickname:</source>
+        <translation type="obsolete">Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password
+or pick another nickname:</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has joined the room</source>
+        <translation>%1 *** %2 has joined the room</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has joined</source>
+        <translation>%1 *** %2 has joined</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has left (%3)</source>
+        <translation>%1 *** %2 has left (%3)</translation>
+    </message>
+    <message>
+        <source>%1 *** %2 has left</source>
+        <translation>%1 *** %2 has left</translation>
+    </message>
+    <message>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</source>
+        <translation type="obsolete">Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="obsolete">Nickname</translation>
+    </message>
+    <message>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>KB</name>
+    <message>
+        <source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</source>
+        <translation>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</translation>
+    </message>
+</context>
+<context>
+    <name>PageAdmin</name>
+    <message>
+        <source>Server message:</source>
+        <translation type="obsolete">Server message:</translation>
+    </message>
+    <message>
+        <source>Set message</source>
+        <translation type="obsolete">Set message</translation>
+    </message>
+    <message>
+        <source>Clear Accounts Cache</source>
+        <translation>Clear Accounts Cache</translation>
+    </message>
+    <message>
+        <source>Fetch data</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Server message for latest version:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Server message for previous versions:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Latest version protocol number:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>MOTD preview:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set data</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageConnecting</name>
+    <message>
+        <source>Connecting...</source>
+        <translation>Connecting...</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation type="obsolete">Cancel</translation>
+    </message>
+</context>
+<context>
+    <name>PageDrawMap</name>
+    <message>
+        <source>Undo</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Load</translation>
+    </message>
+    <message>
+        <source>Save</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load drawn map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save drawn map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Drawn Maps</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All files</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageEditTeam</name>
+    <message>
+        <source>General</source>
+        <translation>General</translation>
+    </message>
+    <message>
+        <source>Advanced</source>
+        <translation>Advanced</translation>
+    </message>
+</context>
+<context>
+    <name>PageGameStats</name>
+    <message>
+        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
+        <translation type="obsolete"><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></translation>
+    </message>
+    <message numerus="yes">
+        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
+        <translation type="obsolete">
+            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kill in a turn.</p></numerusform>
+            <numerusform><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
+        <translation type="obsolete">
+            <numerusform><p>A total of <b>%1</b> hedgehog was killed during this round.</p></numerusform>
+            <numerusform><p>A total of <b>%1</b> hedgehogs were killed during this round.</p></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Details</source>
+        <translation>Details</translation>
+    </message>
+    <message>
+        <source>Health graph</source>
+        <translation>Health graph</translation>
+    </message>
+    <message>
+        <source>Ranking</source>
+        <translation>Ranking</translation>
+    </message>
+    <message>
+        <source>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</source>
+        <translation>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</translation>
+    </message>
+    <message numerus="yes">
+        <source>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</source>
+        <translation>
+            <numerusform>The best killer is <b>%1</b> with <b>%2</b> kill in a turn.</numerusform>
+            <numerusform>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
+        <translation>
+            <numerusform><b>%1</b> hedgehog was killed during this round.</numerusform>
+            <numerusform>A total of <b>%1</b> hedgehogs were killed during this round.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>(%1 kill)</source>
+        <translation>
+            <numerusform>(%1 kill)</numerusform>
+            <numerusform>(%1 kills)</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> killed <b>%2</b> of his own hedgehogs.</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
+        <translation>
+            <numerusform><b>%1</b> was scared and skipped turn <b>%2</b> time.</numerusform>
+            <numerusform><b>%1</b> was scared and skipped turn <b>%2</b> times.</numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>PageInGame</name>
+    <message>
+        <source>In game...</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageMain</name>
+    <message>
+        <source>Local Game (Play a game on a single computer)</source>
+        <translation>Local Game (Play a game on a single computer)</translation>
+    </message>
+    <message>
+        <source>Network Game (Play a game across a network)</source>
+        <translation>Network Game (Play a game across a network)</translation>
+    </message>
+    <message>
+        <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>While playing you should give yourself a short break at least once an hour.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No hedgehogs were harmed in making this game.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageMultiplayer</name>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+</context>
+<context>
+    <name>PageNet</name>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>Please select server from the list above</source>
+        <translation>Please select server from the list above</translation>
+    </message>
+</context>
+<context>
+    <name>PageNetGame</name>
+    <message>
+        <source>Control</source>
+        <translation>Control</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation type="unfinished">Error</translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Please enter room name</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation type="unfinished">OK</translation>
+    </message>
+</context>
+<context>
+    <name>PageNetType</name>
+    <message>
+        <source>LAN game</source>
+        <translation>LAN game</translation>
+    </message>
+    <message>
+        <source>Official server</source>
+        <translation>Official server</translation>
+    </message>
+</context>
+<context>
+    <name>PageOptions</name>
+    <message>
+        <source>New team</source>
+        <translation>New team</translation>
+    </message>
+    <message>
+        <source>Edit team</source>
+        <translation>Edit team</translation>
+    </message>
+    <message>
+        <source>Delete team</source>
+        <translation>Delete team</translation>
+    </message>
+    <message>
+        <source>New weapon scheme</source>
+        <translation type="obsolete">New weapon scheme</translation>
+    </message>
+    <message>
+        <source>Edit weapon scheme</source>
+        <translation type="obsolete">Edit weapon scheme</translation>
+    </message>
+    <message>
+        <source>Delete weapon scheme</source>
+        <translation type="obsolete">Delete weapon scheme</translation>
+    </message>
+    <message>
+        <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
+        <translation>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</translation>
+    </message>
+    <message>
+        <source>New scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Delete scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>New weapon set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit weapon set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Delete weapon set</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Rename dialog</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Enter new file name:</translation>
+    </message>
+    <message>
+        <source>Cannot rename to</source>
+        <translation>Cannot rename to</translation>
+    </message>
+    <message>
+        <source>Cannot delete file</source>
+        <translation>Cannot delete file</translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation>Please select record from the list</translation>
+    </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
+    <message>
+        <source>Create</source>
+        <translation>Create</translation>
+    </message>
+    <message>
+        <source>Join</source>
+        <translation>Join</translation>
+    </message>
+    <message>
+        <source>Refresh</source>
+        <translation>Refresh</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Admin features</source>
+        <translation>Administration</translation>
+    </message>
+    <message>
+        <source>Room Name:</source>
+        <translation>Room Name:</translation>
+    </message>
+    <message>
+        <source>This game is in lobby.
+You may join and start playing once the game starts.</source>
+        <translation>This game is in lobby.
+You may join and start playing once the game starts.</translation>
+    </message>
+    <message>
+        <source>This game is in progress.
+You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
+        <translation>This game is in progress.
+You may join and spectate now but you'll have to wait for the game to end to start playing.</translation>
+    </message>
+    <message>
+        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <translation>%1 is the host. He may adjust settings and start the game.</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Random Map</translation>
+    </message>
+    <message>
+        <source>Games may be played on precreated or randomized maps.</source>
+        <translation>Games may be played on precreated or randomized maps.</translation>
+    </message>
+    <message>
+        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <translation>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</translation>
+    </message>
+    <message>
+        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
+        <translation>The Weapon Scheme defines available weapons and their ammunition count.</translation>
+    </message>
+    <message numerus="yes">
+        <source>There are %1 clients connected to this room.</source>
+        <translation>
+            <numerusform>There is %1 client connected to this room.</numerusform>
+            <numerusform>There are %1 clients connected to this room.</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <source>There are %1 teams participating in this room.</source>
+        <translation>
+            <numerusform>There is %1 team participating in this room.</numerusform>
+            <numerusform>There are %1 teams participating in this room.</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation>Please enter room name</translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation>Please select room from the list</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Rules:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Search:</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>The game you are trying to join has started.
+Do you still want to join the room?</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 players online</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+</context>
+<context>
+    <name>PageScheme</name>
+    <message>
+        <source>Defend your fort and destroy the opponents, two team colours max!</source>
+        <translation>Defend your fort and destroy the opponents, two team colours max!</translation>
+    </message>
+    <message>
+        <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
+        <translation>Teams will start on opposite sides of the terrain, two team colours max!</translation>
+    </message>
+    <message>
+        <source>Land can not be destroyed!</source>
+        <translation>Land can not be destroyed!</translation>
+    </message>
+    <message>
+        <source>Add an indestructable border around the terrain</source>
+        <translation type="obsolete">Add an indestructable border around the terrain</translation>
+    </message>
+    <message>
+        <source>Lower gravity</source>
+        <translation>Lower gravity</translation>
+    </message>
+    <message>
+        <source>Assisted aiming with laser sight</source>
+        <translation>Assisted aiming with laser sight</translation>
+    </message>
+    <message>
+        <source>All hogs have a personal forcefield</source>
+        <translation>All hogs have a personal forcefield</translation>
+    </message>
+    <message>
+        <source>Enable random mines</source>
+        <translation type="obsolete">Enable random mines</translation>
+    </message>
+    <message>
+        <source>Gain 80% of the damage you do back in health</source>
+        <translation>Gain 80% of the damage you do back in health</translation>
+    </message>
+    <message>
+        <source>Share your opponents pain, share their damage</source>
+        <translation>Share your opponents pain, share their damage</translation>
+    </message>
+    <message>
+        <source>Your hogs are unable to move, put your artillery skills to the test</source>
+        <translation>Your hogs are unable to move, put your artillery skills to the test</translation>
+    </message>
+    <message>
+        <source>Random</source>
+        <translation>Random</translation>
+    </message>
+    <message>
+        <source>Seconds</source>
+        <translation>Seconds</translation>
+    </message>
+    <message>
+        <source>New</source>
+        <translation>New</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <source>Order of play is random instead of in room order.</source>
+        <translation>Order of play is random instead of in room order.</translation>
+    </message>
+    <message>
+        <source>Play with a King. If he dies, your side dies.</source>
+        <translation>Play with a King. If he dies, your side dies.</translation>
+    </message>
+    <message>
+        <source>Take turns placing your hedgehogs before the start of play.</source>
+        <translation>Take turns placing your hedgehogs before the start of play.</translation>
+    </message>
+    <message>
+        <source>Ammo is shared between all teams that share a colour.</source>
+        <translation>Ammo is shared between all teams that share a colour.</translation>
+    </message>
+    <message>
+        <source>Disable girders when generating random maps.</source>
+        <translation>Disable girders when generating random maps.</translation>
+    </message>
+    <message>
+        <source>Disable land objects when generating random maps.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>AI respawns on death.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All (living) hedgehogs are fully restored at the end of turn</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Attacking does not end your turn.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons are reset to starting values each turn.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Each hedgehog has its own ammo. It does not share with the team.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>You will not have to worry about wind anymore.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Wind will affect almost everything.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams in each clan take successive turns sharing their turn time.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Add an indestructible border around the terrain</source>
+        <translation>Add an indestructible border around the terrain</translation>
+    </message>
+    <message>
+        <source>Add an indestructible border along the bottom</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageSelectWeapon</name>
+    <message>
+        <source>Default</source>
+        <translation>Default</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <source>New</source>
+        <translation type="unfinished">New</translation>
+    </message>
+    <message>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageSinglePlayer</name>
+    <message>
+        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
+        <translation>Simple Game (a quick game against the computer, settings are chosen for you)</translation>
+    </message>
+    <message>
+        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
+        <translation>Multiplayer (play a hotseat game against your friends, or AI teams)</translation>
+    </message>
+    <message>
+        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <translation>Training Mode (Practice your skills in a range of training missions)</translation>
+    </message>
+    <message>
+        <source>Demos (Watch recorded demos)</source>
+        <translation>Demos (Watch recorded demos)</translation>
+    </message>
+    <message>
+        <source>Load (Load a previously saved game)</source>
+        <translation>Load (Load a previously saved game)</translation>
+    </message>
+    <message>
+        <source>Campaign Mode (...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageTraining</name>
+    <message>
+        <source>No description available</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Select a mission!</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QAction</name>
+    <message>
+        <source>Kick</source>
+        <translation>Kick</translation>
+    </message>
+    <message>
+        <source>Info</source>
+        <translation>Info</translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+    <message>
+        <source>Restrict Joins</source>
+        <translation>Restrict Joins</translation>
+    </message>
+    <message>
+        <source>Restrict Team Additions</source>
+        <translation>Restrict Team Additions</translation>
+    </message>
+    <message>
+        <source>Ban</source>
+        <translation>Ban</translation>
+    </message>
+    <message>
+        <source>Follow</source>
+        <translation>Follow</translation>
+    </message>
+    <message>
+        <source>Ignore</source>
+        <translation>Ignore</translation>
+    </message>
+    <message>
+        <source>Add friend</source>
+        <translation>Add friend</translation>
+    </message>
+    <message>
+        <source>Unignore</source>
+        <translation>Unignore</translation>
+    </message>
+    <message>
+        <source>Remove friend</source>
+        <translation>Remove friend</translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation type="unfinished">Update</translation>
+    </message>
+</context>
+<context>
+    <name>QCheckBox</name>
+    <message>
+        <source>Check for updates at startup</source>
+        <translation>Check for updates at startup</translation>
+    </message>
+    <message>
+        <source>Fullscreen</source>
+        <translation>Fullscreen</translation>
+    </message>
+    <message>
+        <source>Frontend fullscreen</source>
+        <translation>Frontend fullscreen</translation>
+    </message>
+    <message>
+        <source>Enable sound</source>
+        <translation>Enable sound</translation>
+    </message>
+    <message>
+        <source>Enable music</source>
+        <translation>Enable music</translation>
+    </message>
+    <message>
+        <source>Show FPS</source>
+        <translation>Show FPS</translation>
+    </message>
+    <message>
+        <source>Alternative damage show</source>
+        <translation>Alternative damage show</translation>
+    </message>
+    <message>
+        <source>Append date and time to record file name</source>
+        <translation>Append date and time to record file name</translation>
+    </message>
+    <message>
+        <source>Reduced quality</source>
+        <translation type="obsolete">Reduced quality</translation>
+    </message>
+    <message>
+        <source>Show ammo menu tooltips</source>
+        <translation>Show ammo menu tooltips</translation>
+    </message>
+    <message>
+        <source>Enable frontend sounds</source>
+        <translation>Enable frontend sounds</translation>
+    </message>
+    <message>
+        <source>Enable frontend music</source>
+        <translation>Enable frontend music</translation>
+    </message>
+    <message>
+        <source>Frontend effects</source>
+        <translation>Frontend effects</translation>
+    </message>
+</context>
+<context>
+    <name>QComboBox</name>
+    <message>
+        <source>generated map...</source>
+        <translation>generated map...</translation>
+    </message>
+    <message>
+        <source>Human</source>
+        <translation>Human</translation>
+    </message>
+    <message>
+        <source>Level</source>
+        <translation>Level</translation>
+    </message>
+    <message>
+        <source>(System default)</source>
+        <translation>(System default)</translation>
+    </message>
+    <message>
+        <source>Mission</source>
+        <translation>Mission</translation>
+    </message>
+    <message>
+        <source>generated maze...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Community</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Any</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>In lobby</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Default</source>
+        <translation type="obsolete">Default</translation>
+    </message>
+    <message>
+        <source>hand drawn map...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Disabled</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Cyan</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cyan/Red</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Blue</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Blue/Red</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Green</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Green/Red</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Side-by-side</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Top-Bottom</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Wiggle</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Cyan grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cyan/Red grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Blue grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Blue/Red grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Red/Green grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Green/Red grayscale</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QGroupBox</name>
+    <message>
+        <source>Team Members</source>
+        <translation>Team Members</translation>
+    </message>
+    <message>
+        <source>Fort</source>
+        <translation>Fort</translation>
+    </message>
+    <message>
+        <source>Key binds</source>
+        <translation>Key binds</translation>
+    </message>
+    <message>
+        <source>Teams</source>
+        <translation>Teams</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation type="obsolete">Weapons</translation>
+    </message>
+    <message>
+        <source>Audio/Graphic options</source>
+        <translation>Audio/Graphic options</translation>
+    </message>
+    <message>
+        <source>Net game</source>
+        <translation>Net game</translation>
+    </message>
+    <message>
+        <source>Playing teams</source>
+        <translation>Playing teams</translation>
+    </message>
+    <message>
+        <source>Game Modifiers</source>
+        <translation>Game Modifiers</translation>
+    </message>
+    <message>
+        <source>Basic Settings</source>
+        <translation>Basic Settings</translation>
+    </message>
+    <message>
+        <source>Team Settings</source>
+        <translation>Team Settings</translation>
+    </message>
+    <message>
+        <source>Misc</source>
+        <translation>Misc</translation>
+    </message>
+    <message>
+        <source>Schemes and Weapons</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QLabel</name>
+    <message>
+        <source>Mines Time</source>
+        <translation>Mines Time</translation>
+    </message>
+    <message>
+        <source>Mines</source>
+        <translation>Mines</translation>
+    </message>
+    <message>
+        <source>Version</source>
+        <translation>Version</translation>
+    </message>
+    <message>
+        <source>This program is distributed under the GNU General Public License</source>
+        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
+    </message>
+    <message>
+        <source>Developers:</source>
+        <translation>Developers:</translation>
+    </message>
+    <message>
+        <source>Art:</source>
+        <translation>Art:</translation>
+    </message>
+    <message>
+        <source>Sounds:</source>
+        <translation>Sounds:</translation>
+    </message>
+    <message>
+        <source>Translations:</source>
+        <translation>Translations:</translation>
+    </message>
+    <message>
+        <source>Special thanks:</source>
+        <translation>Special thanks:</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>Weapons</translation>
+    </message>
+    <message>
+        <source>Host:</source>
+        <translation>Host:</translation>
+    </message>
+    <message>
+        <source>Port:</source>
+        <translation>Port:</translation>
+    </message>
+    <message>
+        <source>Net nick</source>
+        <translation>Net nick</translation>
+    </message>
+    <message>
+        <source>Resolution</source>
+        <translation>Resolution</translation>
+    </message>
+    <message>
+        <source>FPS limit</source>
+        <translation>FPS limit</translation>
+    </message>
+    <message>
+        <source>Server name:</source>
+        <translation>Server name:</translation>
+    </message>
+    <message>
+        <source>Server port:</source>
+        <translation>Server port:</translation>
+    </message>
+    <message>
+        <source>Initial sound volume</source>
+        <translation>Initial sound volume</translation>
+    </message>
+    <message>
+        <source>Damage Modifier</source>
+        <translation>Damage Modifier</translation>
+    </message>
+    <message>
+        <source>Turn Time</source>
+        <translation>Turn Time</translation>
+    </message>
+    <message>
+        <source>Initial Health</source>
+        <translation>Initial Health</translation>
+    </message>
+    <message>
+        <source>Sudden Death Timeout</source>
+        <translation>Sudden Death Timeout</translation>
+    </message>
+    <message>
+        <source>Scheme Name:</source>
+        <translation>Scheme Name:</translation>
+    </message>
+    <message>
+        <source>Crate Drops</source>
+        <translation>Crate Drops</translation>
+    </message>
+    <message>
+        <source>Game scheme</source>
+        <translation>Game scheme</translation>
+    </message>
+    <message>
+        <source>% Dud Mines</source>
+        <translation>% Dud Mines</translation>
+    </message>
+    <message>
+        <source>Name</source>
+        <translation>Name</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>Grave</source>
+        <translation>Grave</translation>
+    </message>
+    <message>
+        <source>Flag</source>
+        <translation>Flag</translation>
+    </message>
+    <message>
+        <source>Voice</source>
+        <translation>Voice</translation>
+    </message>
+    <message>
+        <source>Locale</source>
+        <translation>Locale</translation>
+    </message>
+    <message>
+        <source>Restart game to apply</source>
+        <translation>Restart game to apply</translation>
+    </message>
+    <message>
+        <source>Explosives</source>
+        <translation>Explosives</translation>
+    </message>
+    <message>
+        <source>Tip: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Quality</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>% Health Crates</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Health in Crates</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Sudden Death Water Rise</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Sudden Death Health Decrease</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>% Rope Length</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Stereo rendering</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Style</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Scheme</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Password</translation>
+    </message>
+    <message>
+        <source>% Get Away Time</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>This program is distributed under the GNU General Public License v2</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QLineEdit</name>
+    <message>
+        <source>unnamed</source>
+        <translation>unnamed</translation>
+    </message>
+    <message>
+        <source>hedgehog %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QMainWindow</name>
+    <message>
+        <source>Hedgewars %1</source>
+        <translation>Hedgewars %1</translation>
+    </message>
+</context>
+<context>
+    <name>QMessageBox</name>
+    <message>
+        <source>Network</source>
+        <translation>Network</translation>
+    </message>
+    <message>
+        <source>Connection to server is lost</source>
+        <translation>Connection to server is lost</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>Failed to open data directory:
+%1
+Please check your installation</source>
+        <translation>Failed to open data directory:
+ %1
+Please check your installation</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>Weapons</translation>
+    </message>
+    <message>
+        <source>Can not edit default weapon set</source>
+        <translation type="obsolete">Can not edit default weapon set</translation>
+    </message>
+    <message>
+        <source>Can not delete default weapon set</source>
+        <translation type="obsolete">Can not delete default weapon set</translation>
+    </message>
+    <message>
+        <source>Really delete this weapon set?</source>
+        <translation>Really delete this weapon set?</translation>
+    </message>
+    <message>
+        <source>Can not overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams</source>
+        <translation type="unfinished">Teams</translation>
+    </message>
+    <message>
+        <source>Really delete this team?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Can not delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Really delete this game scheme?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Can not delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation>Cannot create directory %1</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Nickname</translation>
+    </message>
+    <message>
+        <source>Please enter your nickname</source>
+        <translation>Please enter your nickname</translation>
+    </message>
+</context>
+<context>
+    <name>QPushButton</name>
+    <message>
+        <source>default</source>
+        <translation>default</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Cancel</translation>
+    </message>
+    <message>
+        <source>Start server</source>
+        <translation>Start server</translation>
+    </message>
+    <message>
+        <source>Connect</source>
+        <translation>Connect</translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation>Update</translation>
+    </message>
+    <message>
+        <source>Specify</source>
+        <translation>Specify</translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation>Start</translation>
+    </message>
+    <message>
+        <source>Go!</source>
+        <translation>Go!</translation>
+    </message>
+    <message>
+        <source>Play demo</source>
+        <translation>Play demo</translation>
+    </message>
+    <message>
+        <source>Rename</source>
+        <translation>Rename</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Load</translation>
+    </message>
+    <message>
+        <source>Setup</source>
+        <translation>Setup</translation>
+    </message>
+    <message>
+        <source>Ready</source>
+        <translation>Ready</translation>
+    </message>
+    <message>
+        <source>Random Team</source>
+        <translation>Random Team</translation>
+    </message>
+    <message>
+        <source>Associate file extensions</source>
+        <translation>Associate file extensions</translation>
+    </message>
+    <message>
+        <source>more</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QTableWidget</name>
+    <message>
+        <source>Room Name</source>
+        <translation>Room Name</translation>
+    </message>
+    <message>
+        <source>C</source>
+        <translation>C</translation>
+    </message>
+    <message>
+        <source>T</source>
+        <translation>T</translation>
+    </message>
+    <message>
+        <source>Owner</source>
+        <translation>Owner</translation>
+    </message>
+    <message>
+        <source>Map</source>
+        <translation>Map</translation>
+    </message>
+    <message>
+        <source>Rules</source>
+        <translation>Rules</translation>
+    </message>
+    <message>
+        <source>Weapons</source>
+        <translation>Weapons</translation>
+    </message>
+</context>
+<context>
+    <name>SelWeaponWidget</name>
+    <message>
+        <source>Weapon set</source>
+        <translation>Weapon set</translation>
+    </message>
+    <message>
+        <source>Probabilities</source>
+        <translation>Probabilities</translation>
+    </message>
+    <message>
+        <source>Ammo in boxes</source>
+        <translation>Ammo in boxes</translation>
+    </message>
+    <message>
+        <source>Delays</source>
+        <translation>Delays</translation>
+    </message>
+    <message>
+        <source>new</source>
+        <translation type="unfinished">new</translation>
+    </message>
+    <message>
+        <source>copy of</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>TCPBase</name>
+    <message>
+        <source>Error</source>
+        <translation>Error</translation>
+    </message>
+    <message>
+        <source>Unable to start the server: %1.</source>
+        <translation>Unable to start the server: %1.</translation>
+    </message>
+    <message>
+        <source>Unable to run engine: %1 (</source>
+        <translation>Unable to run engine: %1 (</translation>
+    </message>
+</context>
+<context>
+    <name>ToggleButtonWidget</name>
+    <message>
+        <source>Vampirism</source>
+        <translation>Vampirism</translation>
+    </message>
+    <message>
+        <source>Karma</source>
+        <translation>Karma</translation>
+    </message>
+    <message>
+        <source>Artillery</source>
+        <translation>Artillery</translation>
+    </message>
+    <message>
+        <source>Fort Mode</source>
+        <translation>Fort Mode</translation>
+    </message>
+    <message>
+        <source>Divide Teams</source>
+        <translation>Divide Teams</translation>
+    </message>
+    <message>
+        <source>Solid Land</source>
+        <translation>Solid Land</translation>
+    </message>
+    <message>
+        <source>Add Border</source>
+        <translation>Add Border</translation>
+    </message>
+    <message>
+        <source>Low Gravity</source>
+        <translation>Low Gravity</translation>
+    </message>
+    <message>
+        <source>Laser Sight</source>
+        <translation>Laser Sight</translation>
+    </message>
+    <message>
+        <source>Invulnerable</source>
+        <translation>Invulnerable</translation>
+    </message>
+    <message>
+        <source>Add Mines</source>
+        <translation type="obsolete">Add Mines</translation>
+    </message>
+    <message>
+        <source>Random Order</source>
+        <translation>Random Order</translation>
+    </message>
+    <message>
+        <source>King</source>
+        <translation>King</translation>
+    </message>
+    <message>
+        <source>Place Hedgehogs</source>
+        <translation>Place Hedgehogs</translation>
+    </message>
+    <message>
+        <source>Clan Shares Ammo</source>
+        <translation>Clan Shares Ammo</translation>
+    </message>
+    <message>
+        <source>Disable Girders</source>
+        <translation>Disable Girders</translation>
+    </message>
+    <message>
+        <source>Disable Land Objects</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>AI Survival Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Reset Health</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unlimited Attacks</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Reset Weapons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Per Hedgehog Ammo</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Disable Wind</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>More Wind</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tag Team</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Add Bottom Border</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>binds</name>
+    <message>
+        <source>up</source>
+        <translation>up</translation>
+    </message>
+    <message>
+        <source>left</source>
+        <translation>left</translation>
+    </message>
+    <message>
+        <source>right</source>
+        <translation>right</translation>
+    </message>
+    <message>
+        <source>down</source>
+        <translation>down</translation>
+    </message>
+    <message>
+        <source>attack</source>
+        <translation>attack</translation>
+    </message>
+    <message>
+        <source>precise aim</source>
+        <translation>precise aim</translation>
+    </message>
+    <message>
+        <source>put</source>
+        <translation>put</translation>
+    </message>
+    <message>
+        <source>switch</source>
+        <translation>switch</translation>
+    </message>
+    <message>
+        <source>find hedgehog</source>
+        <translation>find hedgehog</translation>
+    </message>
+    <message>
+        <source>ammo menu</source>
+        <translation>ammo menu</translation>
+    </message>
+    <message>
+        <source>slot 1</source>
+        <translation>slot 1</translation>
+    </message>
+    <message>
+        <source>slot 2</source>
+        <translation>slot 2</translation>
+    </message>
+    <message>
+        <source>slot 3</source>
+        <translation>slot 3</translation>
+    </message>
+    <message>
+        <source>slot 4</source>
+        <translation>slot 4</translation>
+    </message>
+    <message>
+        <source>slot 5</source>
+        <translation>slot 5</translation>
+    </message>
+    <message>
+        <source>slot 6</source>
+        <translation>slot 6</translation>
+    </message>
+    <message>
+        <source>slot 7</source>
+        <translation>slot 7</translation>
+    </message>
+    <message>
+        <source>slot 8</source>
+        <translation>slot 8</translation>
+    </message>
+    <message>
+        <source>slot 9</source>
+        <translation>slot 9</translation>
+    </message>
+    <message>
+        <source>timer 1 sec</source>
+        <translation>timer 1 sec</translation>
+    </message>
+    <message>
+        <source>timer 2 sec</source>
+        <translation>timer 2 sec</translation>
+    </message>
+    <message>
+        <source>timer 3 sec</source>
+        <translation>timer 3 sec</translation>
+    </message>
+    <message>
+        <source>timer 4 sec</source>
+        <translation>timer 4 sec</translation>
+    </message>
+    <message>
+        <source>timer 5 sec</source>
+        <translation>timer 5 sec</translation>
+    </message>
+    <message>
+        <source>chat</source>
+        <translation>chat</translation>
+    </message>
+    <message>
+        <source>chat history</source>
+        <translation>chat history</translation>
+    </message>
+    <message>
+        <source>pause</source>
+        <translation>pause</translation>
+    </message>
+    <message>
+        <source>confirmation</source>
+        <translation>confirmation</translation>
+    </message>
+    <message>
+        <source>volume down</source>
+        <translation>volume down</translation>
+    </message>
+    <message>
+        <source>volume up</source>
+        <translation>volume up</translation>
+    </message>
+    <message>
+        <source>change mode</source>
+        <translation>change mode</translation>
+    </message>
+    <message>
+        <source>capture</source>
+        <translation>capture</translation>
+    </message>
+    <message>
+        <source>hedgehogs
+info</source>
+        <translation>hedgehogs
+info</translation>
+    </message>
+    <message>
+        <source>quit</source>
+        <translation>quit</translation>
+    </message>
+    <message>
+        <source>zoom in</source>
+        <translation>zoom in</translation>
+    </message>
+    <message>
+        <source>zoom out</source>
+        <translation>zoom out</translation>
+    </message>
+    <message>
+        <source>reset zoom</source>
+        <translation>reset zoom</translation>
+    </message>
+    <message>
+        <source>long jump</source>
+        <translation>long jump</translation>
+    </message>
+    <message>
+        <source>high jump</source>
+        <translation>high jump</translation>
+    </message>
+    <message>
+        <source>slot 10</source>
+        <translation>slot 10</translation>
+    </message>
+</context>
+<context>
+    <name>binds (categories)</name>
+    <message>
+        <source>Basic controls</source>
+        <translation>Basic controls</translation>
+    </message>
+    <message>
+        <source>Weapon controls</source>
+        <translation>Weapon controls</translation>
+    </message>
+    <message>
+        <source>Camera and cursor controls</source>
+        <translation>Camera and cursor controls</translation>
+    </message>
+    <message>
+        <source>Other</source>
+        <translation>Other</translation>
+    </message>
+</context>
+<context>
+    <name>binds (descriptions)</name>
+    <message>
+        <source>Move your hogs and aim:</source>
+        <translation>Move your hogs and aim:</translation>
+    </message>
+    <message>
+        <source>Traverse gaps and obstacles by jumping:</source>
+        <translation>Traverse gaps and obstacles by jumping:</translation>
+    </message>
+    <message>
+        <source>Fire your selected weapon or trigger an utility item:</source>
+        <translation>Fire your selected weapon or trigger an utility item:</translation>
+    </message>
+    <message>
+        <source>Pick a weapon or a target location under the cursor:</source>
+        <translation>Pick a weapon or a target location under the cursor:</translation>
+    </message>
+    <message>
+        <source>Switch your currently active hog (if possible):</source>
+        <translation>Switch your currently active hog (if possible):</translation>
+    </message>
+    <message>
+        <source>Pick a weapon or utility item:</source>
+        <translation>Pick a weapon or utility item:</translation>
+    </message>
+    <message>
+        <source>Set the timer on bombs and timed weapons:</source>
+        <translation>Set the timer on bombs and timed weapons:</translation>
+    </message>
+    <message>
+        <source>Move the camera to the active hog:</source>
+        <translation>Move the camera to the active hog:</translation>
+    </message>
+    <message>
+        <source>Move the cursor or camera without using the mouse:</source>
+        <translation>Move the cursor or camera without using the mouse:</translation>
+    </message>
+    <message>
+        <source>Modify the camera's zoom level:</source>
+        <translation>Modify the camera's zoom level:</translation>
+    </message>
+    <message>
+        <source>Talk to your team or all participants:</source>
+        <translation>Talk to your team or all participants:</translation>
+    </message>
+    <message>
+        <source>Pause, continue or leave your game:</source>
+        <translation>Pause, continue or leave your game:</translation>
+    </message>
+    <message>
+        <source>Modify the game's volume while playing:</source>
+        <translation>Modify the game's volume while playing:</translation>
+    </message>
+    <message>
+        <source>Toggle fullscreen mode:</source>
+        <translation>Toggle fullscreen mode:</translation>
+    </message>
+    <message>
+        <source>Take a screenshot:</source>
+        <translation>Take a screenshot:</translation>
+    </message>
+    <message>
+        <source>Toggle labels above hedgehogs:</source>
+        <translation>Toggle labels above hedgehogs:</translation>
+    </message>
+</context>
+<context>
+    <name>binds (keys)</name>
+    <message>
+        <source>Axis</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>(Up)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>(Down)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hat</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>(Left)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>(Right)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Keyboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Delete</translation>
+    </message>
+    <message>
+        <source>Mouse: Left button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Mouse: Middle button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Mouse: Right button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Mouse: Wheel up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Mouse: Wheel down</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Backspace</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tab</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Return</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Pause</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Escape</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Space</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 0</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 3</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 4</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 5</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 6</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 7</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 8</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad 9</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad .</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad /</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad *</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad -</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Numpad +</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Enter</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Equals</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Down</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Insert</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Home</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>End</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Page up</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Page down</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Num lock</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Caps lock</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Scroll lock</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right shift</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left shift</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right ctrl</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left ctrl</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right alt</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left alt</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right meta</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left meta</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>A button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>B button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>X button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Y button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>LB button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>RB button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Back button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start button</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left stick</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right stick</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left stick (Right)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left stick (Left)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left stick (Down)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left stick (Up)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Left trigger</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right trigger</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right stick (Down)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right stick (Up)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right stick (Right)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Right stick (Left)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>DPad</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+</TS>
diff --git a/share/hedgewars/Data/Locale/hedgewars_ru.ts b/share/hedgewars/Data/Locale/hedgewars_ru.ts
index 2604fdd..42656e5 100644
--- a/share/hedgewars/Data/Locale/hedgewars_ru.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_ru.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ru">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation>Назад</translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Ошибка при работе с файлом</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Не могу открыть файл '%1' на запись</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Не могу прочитать файл '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -49,124 +41,79 @@
         <translation>Редактировать оружие</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Неправильный набор оружия</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Редактировать схемы</translation>
     </message>
     <message>
-        <source>When this option is enabled selecting a game scheme will auto-select a weapon (and viceversa)</source>
-        <translation type="obsolete">При включении этой опции выбор настроек игры автоматически выберет схему оружия (и наоборот)</translation>
-    </message>
-    <message>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation>При включении этой опции выбор настроек игры автоматически выберет схему оружия</translation>
     </message>
     <message>
         <source>Game Options</source>
-        <translation type="unfinished">Настройки игры</translation>
+        <translation>Настройки игры</translation>
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 был удалён из вашего списка игнорирования</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 был добавлен в ваш список игнорирования</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 был удалён из вашего списка друзей</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 был добавлен в ваш список друзей</translation>
+        <source>Do you really want to quit?</source>
+        <translation>Хотите выйти?</translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 был удалён из вашего списка игнорирования</translation>
     </message>
     <message>
         <source>%1 has been added to your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 был добавлен в ваш список игнорирования</translation>
     </message>
     <message>
         <source>%1 has been removed from your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 был удалён из вашего списка друзей</translation>
     </message>
     <message>
         <source>%1 has been added to your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 был добавлен в ваш список друзей</translation>
     </message>
     <message>
         <source>Stylesheet imported from %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Импортирован стиль из %1</translation>
     </message>
     <message>
         <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
-        <translation type="unfinished"></translation>
+        <translation>Введите %1 для использования текущего стиля и в будущем, введите %2 для сброса!</translation>
     </message>
     <message>
         <source>Couldn't read %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Не могу прочитать %1</translation>
     </message>
     <message>
         <source>StyleSheet discarded</source>
-        <translation type="unfinished"></translation>
+        <translation>Стиль снят</translation>
     </message>
     <message>
         <source>StyleSheet saved to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Стиль сохранён в %1</translation>
     </message>
     <message>
         <source>Failed to save StyleSheet to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Ошибка при сохранении стиля в %1</translation>
     </message>
     <message>
         <source>%1 is not a valid command!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 не является корректной командой</translation>
     </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>ОК</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Не могу сохранить запись в файл %1</translation>
     </message>
     <message>
-        <source>Unable to start the server</source>
-        <translation>Ошибка запуска сервера</translation>
-    </message>
-    <message>
-        <source>new</source>
-        <translation type="obsolete">новый</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Выберите запись из списка</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Команда по умолчанию</translation>
     </message>
@@ -182,51 +129,43 @@
     </message>
     <message>
         <source>Demo name</source>
-        <translation type="unfinished"></translation>
+        <translation>Название демки</translation>
     </message>
     <message>
         <source>Demo name:</source>
-        <translation type="unfinished"></translation>
+        <translation>Название демки:</translation>
     </message>
     <message>
         <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Пароль</translation>
+        <translation>Игра прекращена</translation>
     </message>
     <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
 or pick another nickname in game config:</source>
-        <translation type="unfinished">Ваше имя пользователя %1 
+        <translation>Ваше имя пользователя %1 
 зарегистрировано на сайте hedgewars.org
 Пожалуйста, укажите ваш пароль в поле ввода внизу
 или выберите иное имя пользователя в настройках игры:</translation>
     </message>
     <message>
         <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
+        <translation>Пароль не указан.</translation>
     </message>
     <message>
         <source>Nickname</source>
-        <translation type="unfinished">Псевдоним</translation>
+        <translation>Псевдоним</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Кто-то на этом сервере
-уже использует
-ваш псевдоним %1.
-Выберите другой псевдоним:</translation>
+        <source>No nickname supplied.</source>
+        <translation>Псевдоним не указан.</translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
-        <translation type="unfinished"></translation>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
+        <translation>Кто-то уже использует ваш псевдоним %1 на сервере.
+Пожалуйста, выберите другой псевдоним:</translation>
     </message>
 </context>
 <context>
@@ -353,20 +292,6 @@ Please pick another nickname:</source>
         <translation>Вас выкинули</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Пароль</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Ваш псевдоним %1 уже
-зарегистрирован на сайте Hedgewars.org
-Пожалуйста, укажите ваш пароль
-или выберите другой псевдоним:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 вошёл в комнату</translation>
     </message>
@@ -383,32 +308,34 @@ or pick another nickname:</source>
         <translation>%1 *** %2 ушёл</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Ваше имя пользователя %1 
-зарегистрировано на сайте hedgewars.org
-Пожалуйста, укажите ваш пароль в поле ввода внизу
-или выберите иное имя пользователя в настройках игры:</translation>
+        <source>User quit</source>
+        <translation>Пользователь вышел</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Псевдоним</translation>
+        <source>Remote host has closed connection</source>
+        <translation>Удалённый хост закрыл соединение</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Кто-то на этом сервере
-уже использует
-ваш псевдоним %1.
-Выберите другой псевдоним:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation>Слишком старый сервер. Отсоединяюсь.</translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation>Пароль</translation>
     </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
     <message>
-        <source>User quit</source>
-        <translation type="unfinished"></translation>
+        <source>Upload video</source>
+        <translation>Залить видео</translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation>Залить</translation>
     </message>
 </context>
 <context>
@@ -419,15 +346,27 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation>Длительность: %1мин %2сек</translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation>Видео: %1x%2, </translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Сообщение сервера:</translation>
+        <source>%1 fps, </source>
+        <translation>%1 кадров/сек,</translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Установить сообщение</translation>
+        <source>Audio: </source>
+        <translation>Аудио: </translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Очистить кэш учётных записей</translation>
@@ -463,10 +402,6 @@ Please pick another nickname:</source>
         <source>Connecting...</source>
         <translation>Соединение...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Отмена</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -491,20 +426,20 @@ Please pick another nickname:</source>
         <translation>Загрузить рисованную карту</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Рисованные карты (*.hwmap);;Все файлы (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Сохранить рисованную карту</translation>
     </message>
     <message>
         <source>Drawn Maps</source>
-        <translation type="unfinished"></translation>
+        <translation>Рисованные карты</translation>
     </message>
     <message>
         <source>All files</source>
-        <translation type="unfinished"></translation>
+        <translation>Все файлы</translation>
+    </message>
+    <message>
+        <source>Eraser</source>
+        <translation>Стирательная резинка</translation>
     </message>
 </context>
 <context>
@@ -521,26 +456,6 @@ Please pick another nickname:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Приз за лучший выстрел получает <b>%1</b> с <b>%2</b> пунктами урона.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Лучший киллер ‒ это <b>%1</b> с <b>%2</b> убитым за ход.</p></numerusform>
-            <numerusform><p>Лучший киллер ‒ это <b>%1</b> с <b>%2</b> убитыми за ход.</p></numerusform>
-            <numerusform><p>Лучший киллер ‒ это <b>%1</b> с <b>%2</b> убитыми за ход.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Всего <b>%1</b> ёж был убит за этот поединок.</p></numerusform>
-            <numerusform><p>Всего <b>%1</b> ежа были убиты за этот поединок.</p></numerusform>
-            <numerusform><p>Всего <b>%1</b> ежей были убиты за этот поединок.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Подробности</translation>
     </message>
@@ -609,19 +524,18 @@ Please pick another nickname:</source>
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
-        <translation type="unfinished"></translation>
+        <translation>В игре...</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Локальная игра (игра на одном компьютере)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Сетевая игра</translation>
+        <source>Open the snapshot folder</source>
+        <translation>Открыть папку скриншотов</translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -871,6 +785,46 @@ Please pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation>Локальная игра</translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation>Играть на одном компьютере</translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation>Сетевая игра</translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation>Играть по сети</translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation>Прочитать, кто стоит за проектом Hedgewars</translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation>Выйти из игры</translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation>Управление видеозаписями игры</translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation>Редактировать настройки игры</translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -880,33 +834,18 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Выберите сервер из списка</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Управление</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Введите название комнаты</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -919,6 +858,14 @@ Please pick another nickname:</source>
         <source>Official server</source>
         <translation>Официальный сервер</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation>Присоединиться к сотням игроков!</translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation>Присоединиться или создать собственный сервер в локальной сети.</translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -935,18 +882,6 @@ Please pick another nickname:</source>
         <translation>Удалить команду</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Новая схема оружия</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Редактировать схему оружия</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Удалить схему оружия</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Невозможно редактировать команды со страницы выбора команд. Вернитесь в главное меню для добавления, редактирования или удаления команд.</translation>
     </message>
@@ -974,160 +909,98 @@ Please pick another nickname:</source>
         <source>Delete weapon set</source>
         <translation>Удалить набор оружия</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
+        <source>General</source>
+        <translation>Основные настройки</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Advanced</source>
+        <translation>Дополнительно</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Переименование</translation>
+        <source>Reset to default colors</source>
+        <translation>Сбросить на цвета по умолчанию</translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Введите новое имя файла:</translation>
+        <source>Proxy host</source>
+        <translation>Адрес прокси-сервера</translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Не могу переименовать в</translation>
+        <source>Proxy port</source>
+        <translation>Порт</translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Не могу удалить файл</translation>
+        <source>Proxy login</source>
+        <translation>Имя пользователя</translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Выберите запись из списка</translation>
+        <source>Proxy password</source>
+        <translation>Пароль</translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Создать</translation>
+        <source>No proxy</source>
+        <translation>Без прокси</translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Присоединиться</translation>
+        <source>Socks5 proxy</source>
+        <translation>Socks5 прокси</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Обновить</translation>
+        <source>HTTP proxy</source>
+        <translation>HTTP прокси</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
+        <source>System proxy settings</source>
+        <translation>Системные настройки</translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Rename dialog</source>
+        <translation>Переименование</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Администрирование</translation>
+        <source>Enter new file name:</source>
+        <translation>Введите новое имя файла:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation>Название комнаты:</translation>
+        <source>Create</source>
+        <translation>Создать</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>В этой комнате игра ещё не запущена.
-Вы можете зайти и присоединиться к игре.</translation>
+        <source>Join</source>
+        <translation>Присоединиться</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>В этой комнате происходит игра.
-Вы можете зайти и наблюдать. Чтобы играть, придётся подождать окончания текущей игры.</translation>
+        <source>Admin features</source>
+        <translation>Администрирование</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 управляет комнатой. Он может изменять настройки и запускать игру.</translation>
+        <source>Room Name:</source>
+        <translation>Название комнаты:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Случайная карта</translation>
+        <source>Rules:</source>
+        <translation>Правила:</translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Можно играть на нарисованных или сгенерированных картах.</translation>
+        <source>Weapons:</source>
+        <translation>Оружие:</translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Схема игры определяет общие настройки, такие как время хода или вампиризм.</translation>
+        <source>Search:</source>
+        <translation>Поиск:</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Схема оружия определяет доступное оружие и число снарядов.</translation>
+        <source>Clear</source>
+        <translation>Очистить</translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Всего %1 игрок находится в этой комнате.</numerusform>
-            <numerusform>Всего %1 игрока находятся в этой комнате.</numerusform>
-            <numerusform>Всего %1 игроков находятся в этой комнате.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Всего %1 команда участвует в игре в этой комнате.</numerusform>
-            <numerusform>Всего %1 команды участвуют в игре в этой комнате.</numerusform>
-            <numerusform>Всего %1 команд участвуют в игре в этой комнате.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Введите название комнаты</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Выберите комнату из списка</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Случайный лабиринт</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Состояние:</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Правила:</translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation>Оружие:</translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation>Поиск:</translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation>Очистить</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation>Предупреждение</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Игра, к которой вы хотите присоединиться, уже началась
-Вы всё равно хотите зайти в комнату?</translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
+        <source>%1 players online</source>
         <translation>
             <numerusform>на сервере %1 игрок</numerusform>
             <numerusform>на сервере %1 игрока</numerusform>
@@ -1138,10 +1011,6 @@ Do you still want to join the room?</source>
 <context>
     <name>PageScheme</name>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Включить мины</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>80% урона, нанесённого врагу, вернётся в виде здоровья вашему ежу</translation>
     </message>
@@ -1182,10 +1051,6 @@ Do you still want to join the room?</source>
         <translation>Земля не может быть разрушена!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Добавить неразрушимую границу вокруг карты</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Пониженная гравитация</translation>
     </message>
@@ -1263,7 +1128,7 @@ Do you still want to join the room?</source>
     </message>
     <message>
         <source>Add an indestructible border along the bottom</source>
-        <translation type="unfinished"></translation>
+        <translation>Добавить неразрушимую границу внизу карты</translation>
     </message>
 </context>
 <context>
@@ -1288,47 +1153,106 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Быстрый старт (быстрый запуск игры против компьютера на случайной карте)</translation>
+        <source>Simple Game</source>
+        <translation>Простая игра</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Схватка (игра с друзьями за одним компьютером или против ботов)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation>Играть против компьютера</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Тренировка (тренируйте своё мастерство в тренировочных миссиях) В РАЗРАБОТКЕ</translation>
+        <source>Multiplayer</source>
+        <translation>Схватка</translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демки (просмотр записанных демок)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation>Играть с друзьями за одним компьютером или против ботов</translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Загрузить (загрузить сохранённую игру)</translation>
+        <source>Campaign Mode</source>
+        <translation>Кампания</translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим прохождения кампании. В РАЗРАБОТКЕ</translation>
+        <source>Training Mode</source>
+        <translation>Тренировка</translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
-        <translation type="unfinished"></translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation>Тренировка мастерства в тренировочных миссиях</translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
-        <translation type="unfinished"></translation>
+        <source>Demos</source>
+        <translation>Демки</translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation>Смотреть записанные демки</translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation>Загрузить</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
+        <translation>Загрузить сохранённую игру</translation>
     </message>
 </context>
 <context>
     <name>PageTraining</name>
     <message>
         <source>No description available</source>
-        <translation type="unfinished"></translation>
+        <translation>Описание отсутствует</translation>
     </message>
     <message>
         <source>Select a mission!</source>
-        <translation type="unfinished"></translation>
+        <translation>Выберите миссию!</translation>
+    </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation>Выберите миссию или тренировку</translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation>Начать битву</translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation>Название</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation>Размер</translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation>
+            <numerusform>%1 байт</numerusform>
+            <numerusform>%1 байта</numerusform>
+            <numerusform>%1 байтов</numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation>(в игре...)</translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation>Дата: </translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation>Размер: </translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation>кодирование</translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation>отправка</translation>
     </message>
 </context>
 <context>
@@ -1417,10 +1341,6 @@ Do you still want to join the room?</source>
         <translation>Указывать дату и время в названиях демок и сейвов</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Пониженное качество</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Показывать подсказки к оружию</translation>
     </message>
@@ -1436,6 +1356,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>Эффекты в меню</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation>Сохранить пароль</translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation>Сохранить псевдоним и пароль</translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation>Частное видео</translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation>Запись звука</translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation>Использовать разрешение игры</translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1480,10 +1420,6 @@ Do you still want to join the room?</source>
         <translation>В игре</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">По умолчанию</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>рисованная карта...</translation>
     </message>
@@ -1583,10 +1519,6 @@ Do you still want to join the room?</source>
         <translation>Сетевая игра</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Оружие</translation>
-    </message>
-    <message>
         <source>Game Modifiers</source>
         <translation>Модификаторы игры</translation>
     </message>
@@ -1606,6 +1538,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation>Схемы игры и наборы оружия</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation>Свои цвета</translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation>Разное</translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation>Настройки видео</translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation>Видео</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Описание</translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation>Настройки прокси</translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1618,14 +1574,6 @@ Do you still want to join the room?</source>
         <translation>Мины</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Имя игрока</translation>
-    </message>
-    <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Эта программа распространяется на условиях лицензии GNU (the GNU General Public License)</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Разрешение</translation>
     </message>
@@ -1738,16 +1686,6 @@ Do you still want to join the room?</source>
         <translation>Язык</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Перезапустите игру для применения</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Взрывчатка</translation>
     </message>
@@ -1780,10 +1718,6 @@ Some features might be broken or incomplete. Use at your own risk!</translation>
         <translation>Скорость уменьшения здоровья</translation>
     </message>
     <message>
-        <source>Bind schemes and weapons</source>
-        <translation type="obsolete">Объединить настройки игры и оружия</translation>
-    </message>
-    <message>
         <source>% Rope Length</source>
         <translation>% длины верёвки</translation>
     </message>
@@ -1792,10 +1726,6 @@ Some features might be broken or incomplete. Use at your own risk!</translation>
         <translation>Стереоизображение</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Настройки игры</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Стиль</translation>
     </message>
@@ -1804,15 +1734,75 @@ Some features might be broken or incomplete. Use at your own risk!</translation>
         <translation>Схема</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% времени ухода</translation>
     </message>
     <message>
         <source>This program is distributed under the GNU General Public License v2</source>
+        <translation>Эта программа распространяется на условиях лицензии GNU General Public License, версия 2</translation>
+    </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation>Сейчас происходит обработка видео.
+Выход отменить обработку.
+Всё равно выйти?</translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation>Пароль:</translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation>Краткое описание</translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation>Описание</translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation>Псевдоним</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation>Формат</translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation>Видеокодек</translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation>Аудиокодек</translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1824,7 +1814,11 @@ Some features might be broken or incomplete. Use at your own risk!</translation>
     </message>
     <message>
         <source>hedgehog %1</source>
-        <translation type="unfinished"></translation>
+        <translation>ёжик %1</translation>
+    </message>
+    <message>
+        <source>anonymous</source>
+        <translation>аноним</translation>
     </message>
 </context>
 <context>
@@ -1841,89 +1835,226 @@ Some features might be broken or incomplete. Use at your own risk!</translation>
         <translation>Ошибка</translation>
     </message>
     <message>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
-        <translation>Не могу найти папку с данными:
-%1
-Проверьте правильность установки</translation>
+        <source>Connection to server is lost</source>
+        <translation>Соединение с сервером потеряно</translation>
     </message>
     <message>
-        <source>Network</source>
-        <translation>Сеть</translation>
+        <source>File association failed.</source>
+        <translation>Сопоставление не удалось.</translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
-        <translation>Соединение с сервером потеряно</translation>
+        <source>Please fill out all fields</source>
+        <translation>Заполните все поля</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Оружие</translation>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Невозможно удалить набор оружия по умолчанию</translation>
+        <source>Login or password is incorrect</source>
+        <translation>Некорректное имя пользователя или пароль</translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Удалить выбранный набор оружия?</translation>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Невозможно редактировать набор оружия по умолчанию</translation>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Не могу переписать встроенный набор оружия '%1'!</translation>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Проведено сопоставление расширений файлов.</translation>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Сопоставление не удалось.</translation>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Команды</translation>
+        <source>Unable to start server</source>
+        <translation>Ошибка запуска сервера</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Удалить выбранную команду?</translation>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Схемы</translation>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Не могу удалить встроенную схему '%1'!</translation>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Удалить выбранную схему игры?</translation>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Не могу удлить встроенный набор оружия '%1'!</translation>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Cannot create directory %1</source>
         <translation>Не могу создать папку %1</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Failed to open data directory:
+%1
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start the server: %1.</source>
+        <translation>Ошибка запуска сервера: %1.</translation>
+    </message>
+    <message>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please enter room name</source>
+        <translation>Введите название комнаты</translation>
+    </message>
+    <message>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select record from the list</source>
+        <translation>Выберите запись из списка</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete file </source>
+        <translation>Не могу удалить файл </translation>
+    </message>
+    <message>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select room from the list</source>
+        <translation>Выберите комнату из списка</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation>Игра, к которой вы хотите присоединиться, уже началась
+Вы всё равно хотите зайти в комнату?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation>Ошибка при работе с файлом</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Псевдоним</translation>
     </message>
@@ -2006,9 +2137,37 @@ Please check your installation</source>
         <source>more</source>
         <translation>ещё</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation>Дополнительная информация</translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation>Установить настройки по умолчанию</translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation>Открыть папку с видеозаписями</translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation>Проиграть</translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation>Отправить на YouTube</translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation>Отменить отправку</translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation>В игре</translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation>Название</translation>
@@ -2037,6 +2196,18 @@ Please check your installation</source>
         <source>Weapons</source>
         <translation>Оружие</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation>Случайная карта</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation>Случайный лабиринт</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation>Рисованная карта</translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -2066,21 +2237,6 @@ Please check your installation</source>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Ошибка</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Ошибка запуска сервера: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Ошибка запуска движка: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2123,10 +2279,6 @@ Please check your installation</source>
         <translation>Неуязвимость</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Добавить мины</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Случайный порядок</translation>
     </message>
@@ -2184,7 +2336,7 @@ Please check your installation</source>
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation type="unfinished"></translation>
+        <translation>Добавить нижнюю границу</translation>
     </message>
 </context>
 <context>
@@ -2351,6 +2503,14 @@ info</source>
         <source>slot 10</source>
         <translation>слот 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation>отключить звук</translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation>записать</translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2437,6 +2597,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Переключение меток над ежами:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation>Запись видео:</translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_sk.ts b/share/hedgewars/Data/Locale/hedgewars_sk.ts
index 3453374..7602908 100644
--- a/share/hedgewars/Data/Locale/hedgewars_sk.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_sk.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="sk">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Chyba v súbore</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Nepodarilo sa otvoriť súbor '%1' pre zápis</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Nepodarilo sa prečítať súbor '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -49,124 +41,79 @@
         <translation>Upraviť zbrane</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Neplatná schéma zbraní</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Upraviť schémy</translation>
     </message>
     <message>
-        <source>When this option is enabled selecting a game scheme will auto-select a weapon (and viceversa)</source>
-        <translation type="obsolete">Ak je táto voľba vybraná, zvolením hernej schémy budú automaticky vybrané aj zbrane (a naopak)</translation>
-    </message>
-    <message>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
         <translation>Keď je vybraná táto voľba výberom hernej schémy vyberiete automaticky aj zbraň</translation>
     </message>
     <message>
         <source>Game Options</source>
-        <translation type="unfinished">Voľby hry</translation>
+        <translation>Voľby hry</translation>
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 bol(a) odstránený(á) zo zoznamu ignorovaných</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 bol(a) pridaný(á) do zoznamu ignorovaných</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 bol(a) odstránený(á) zo zoznamu priateľov</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 bol(a) pridaný(á) do zoznamu priateľov</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 bol odstránený zo zoznamu ignorovaných</translation>
     </message>
     <message>
         <source>%1 has been added to your ignore list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 bol pridaný na zoznam ignorovaných</translation>
     </message>
     <message>
         <source>%1 has been removed from your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 bol odstránený zo zoznamu priateľov</translation>
     </message>
     <message>
         <source>%1 has been added to your friends list</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 bol pridaný do zoznamu priateľov</translation>
     </message>
     <message>
         <source>Stylesheet imported from %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Súbor so štýlom importovaný z %1</translation>
     </message>
     <message>
         <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
-        <translation type="unfinished"></translation>
+        <translation>Zadajte %1, ak chcete použiť aktuálny súbor so štýlom v budúcnosti, zadajte %2 pre resetovanie!</translation>
     </message>
     <message>
         <source>Couldn't read %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Nepodarilo sa prečítať %1</translation>
     </message>
     <message>
         <source>StyleSheet discarded</source>
-        <translation type="unfinished"></translation>
+        <translation>Súbor so štýlom zneplatnený</translation>
     </message>
     <message>
         <source>StyleSheet saved to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Súbor so štýlom uložený do %1</translation>
     </message>
     <message>
         <source>Failed to save StyleSheet to %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Nepodarilo sa uložiť súbor so štýlom do %1</translation>
     </message>
     <message>
         <source>%1 is not a valid command!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
+        <translation>%1 nie je platným príkazom!</translation>
     </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Nie je možné spustiť server</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Nie je možné zapísať záznam do súboru %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">nový</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Prosím vyberte záznam zo zoznamu vyššie</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>VýchodzíTím</translation>
     </message>
@@ -182,26 +129,22 @@
     </message>
     <message>
         <source>Demo name</source>
-        <translation type="unfinished"></translation>
+        <translation>Demo meno</translation>
     </message>
     <message>
         <source>Demo name:</source>
-        <translation type="unfinished"></translation>
+        <translation>Demo meno:</translation>
     </message>
     <message>
         <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">Heslo</translation>
+        <translation>Hra zrušená</translation>
     </message>
     <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
 or pick another nickname in game config:</source>
-        <translation type="unfinished">Prezývka %1, ktorú ste
+        <translation>Prezývka %1, ktorú ste
 si vybrali je registrovaná na
 Hedgewars.org.
 Prosím, napíšte heslo do poľa
@@ -210,24 +153,19 @@ v nastaveniach hry:</translation>
     </message>
     <message>
         <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
+        <translation>Nebolo zadané žiadne heslo.</translation>
     </message>
     <message>
         <source>Nickname</source>
-        <translation type="unfinished">Prezývka</translation>
+        <translation>Prezývka</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Niekto už používa
-vašu prezývku %1
-na serveri.
-Prosím vyberte si inú prezývku:</translation>
+        <source>No nickname supplied.</source>
+        <translation>Nebola zadaná žiadna prezývka.</translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -355,20 +293,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Boli ste vykopnutý</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Heslo</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Vaša prezývka %1 je
-zaregistrovaná na Hedgewars.org
-Prosím, zadajte heslo alebo
-si vyberte inú prezývku:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 prišiel do miestnosti</translation>
     </message>
@@ -385,33 +309,33 @@ si vyberte inú prezývku:</translation>
         <translation>%1 *** %2 odišiel</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Prezývka %1, ktorú ste
-si vybrali je registrovaná na
-Hedgewars.org.
-Prosím, napíšte heslo do poľa
-nižšie alebo si zvoľte inú prezývku
-v nastaveniach hry:</translation>
+        <source>User quit</source>
+        <translation>Užívateľ odišiel</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Prezývka</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Niekto už používa
-vašu prezývku %1
-na serveri.
-Prosím vyberte si inú prezývku:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>User quit</source>
+        <source>Password</source>
+        <translation type="unfinished">Heslo</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -423,15 +347,27 @@ Prosím vyberte si inú prezývku:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Správa serveru:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Nastaviť správu</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Vymazať vyrovnávaciu pamäť účtov</translation>
@@ -467,10 +403,6 @@ Prosím vyberte si inú prezývku:</translation>
         <source>Connecting...</source>
         <translation>Pripájam sa...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Zrušiť</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -495,19 +427,19 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Načítať nakreslenú mapu</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Nakreslené mapy (*.hwmap);;Všetky súbory (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Uložiť nakreslenú mapu</translation>
     </message>
     <message>
         <source>Drawn Maps</source>
-        <translation type="unfinished"></translation>
+        <translation>Kreslené mapy</translation>
     </message>
     <message>
         <source>All files</source>
+        <translation>Všetky súbory</translation>
+    </message>
+    <message>
+        <source>Eraser</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -525,26 +457,6 @@ Prosím vyberte si inú prezývku:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Ocenenie za najlepší zásah vyhral(a) <b>%1</b> so ziskom <b>%2</b> bodov.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Najlepším zabijákom je <b>%1</b> s <b>jedným</b> zabitím počas ťahu.</p></numerusform>
-            <numerusform><p>Najlepším zabijákom je <b>%1</b> s <b>%2</b> zabitiami počas ťahu.</p></numerusform>
-            <numerusform><p>Najlepším zabijákom je <b>%1</b> s <b>%2</b> zabitiami počas ťahu.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Celkovo bol v tomto kole zabitý <b>jeden</b> ježko.</p></numerusform>
-            <numerusform><p>Celkovo boli v tomto kole zabití <b>%1</b> ježkovia.</p></numerusform>
-            <numerusform><p>Celkovo boli v tomto kole zabití <b>%1</b> ježkovia.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Podrobnosti</translation>
     </message>
@@ -584,10 +496,6 @@ Prosím vyberte si inú prezývku:</translation>
             <numerusform>(%1 zabití)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 zabití)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -617,19 +525,18 @@ Prosím vyberte si inú prezývku:</translation>
     <name>PageInGame</name>
     <message>
         <source>In game...</source>
-        <translation type="unfinished"></translation>
+        <translation>Prebieha hra...</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Miestna hra (Hrať hru proti počítaču)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Sieťová hra (Hrať hru proti súperom na sieti)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -646,11 +553,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Ak neviete, čo robiť a nechcete mrhať muníciou, preskočte ťah. Ale nerobte tak príliš často, pretože príde Náhla smrť!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Chcete ušetriť lano? Kým ste vo vzduchu, uvoľnite ho a opäť vystreľte. Kým sa nedotknete zeme, môžete to isté lano znovu použiť bez toho, aby sa vám míňali jeho zásoby!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Ak nechcete, aby niekto iný používal vašu prezývku na oficiálnom serveri, registrujte si účet na http://www.hedgewars.org/.</translation>
@@ -726,11 +628,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Špeciálne herné režimy ako 'Vampírizmus' alebo 'Karma' vám umožnia vyvinúť úplne novú taktiku. Vyskúšajte ich vo vlastnej hre!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Verzia Hedgewars pre Windows podporuje Xfire. Ubezpečte sa, že ste pridali Hedgewars do zoznamu hier tak, aby vaši priatelia videli, že hráte.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Nikdy by ste nemali inštalovať Hedgewars na cudzí počítač (v škole, na univerzite, v práci, atď). Prosím, radšej požiadajte zodpovednú osobu!</translation>
@@ -793,12 +690,7 @@ Prosím vyberte si inú prezývku:</translation>
     <message>
         <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
         <comment>Tips</comment>
-        <translation>Klavírový útok je najzničujúcejší vzdušný útok. Pri jeho použití prídete o ježka, čo je jeho veľké mínus.</translation>
-    </message>
-    <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Navádzaná včela je trošku zložitejšia na použitie. Jej polomer otočenia závisí na jej rýchlosti, takže ju radšej nepoužívajte pri plnej sile.</translation>
+        <translation>Klavírový útok je najničivejší vzdušný útok. Pri jeho použití prídete o ježka, čo je jeho veľké mínus.</translation>
     </message>
     <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
@@ -826,21 +718,11 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Plameňomet je zbraň, no rovnako môže byť použitý na kopanie tunelov.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Použite spaľujúci granát na dočasné zabránenie ježkom prejsť terénom ako sú tunely alebo plošiny.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Chcete vedieť, kto stojí za hrou? Kliknite na logo Hedgewars v hlavnom menu pre zobrazenie zásluh.</translation>
     </message>
     <message>
-        <source>Like Hedgewars? Become a fan on %1 or join our group at %2. You could follow us on %3 as well!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Pačia sa vám Hedgewars? Staňte sa fanúšikom na %1 alebo sa pripojte k našej skupine na %2. Môžte nás tiež nasledovať na %3!</translation>
-    </message>
-    <message>
         <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
         <comment>Tips</comment>
         <translation>Ak máte chuť, môžte si nakresliť vlastné hrobčeky, klobúky, vlajky alebo dokonca mapy a témy! Pamätajte však, že ak ich budete chcieť použiť v hre online, budete ich musieť zdieľať s ostatnými.</translation>
@@ -861,11 +743,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Konfiguračné súbory Hedgewars nájdete v "Moje Dokumenty\Hedgewars". Vytvárajte si zálohy alebo prenášajte si tieto súbory medzi počítačmi, ale needitujte ich ručne.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Konfiguračné súbory Hedgewars nájdete v "Hedgewars" vo vašom domovskom adresári. Vytvárajte si zálohy alebo prenášajte si tieto súbory medzi počítačmi, ale needitujte ich ručne.</translation>
-    </message>
-    <message>
         <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
         <comment>Tips</comment>
         <translation>Chcete ušetriť lano? Kým ste vo vzduchu, uvoľnite ho a opäť vystreľte. Kým sa nedotknete zeme, môžete to isté lano znovu použiť bez toho, aby sa vám míňali jeho zásoby!</translation>
@@ -896,11 +773,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Hedgewars vo verzii pre Windows podporujú Xfire. Pridajte si Hedgewars do vášho zoznamu hier tak, aby vás vaši priatelia videli hrať.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Navádzaná včela je trošku zložitejšia na použitie. Jej polomer otočenia závisí na jej rýchlosti, takže ju radšej nepoužívajte pri plnej sile.</translation>
-    </message>
-    <message>
         <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
         <translation>Použite Molotovov koktejl alebo plameňomet na dočasné zabránenie ježkom prejsť terénom ako sú tunely alebo plošiny.</translation>
@@ -912,6 +784,46 @@ Prosím vyberte si inú prezývku:</translation>
     </message>
     <message>
         <source>Downloadable Content</source>
+        <translation>Stiahnuteľný obsah</translation>
+    </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -923,33 +835,18 @@ Prosím vyberte si inú prezývku:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Prosím vyberte server zo zoznamu vyššie</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Ovládanie</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Prosím zadajte názov miestnosti</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Stiahnuteľný obsah</translation>
     </message>
 </context>
 <context>
@@ -962,6 +859,14 @@ Prosím vyberte si inú prezývku:</translation>
         <source>Official server</source>
         <translation>Oficiálny server</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -978,18 +883,6 @@ Prosím vyberte si inú prezývku:</translation>
         <translation>Vymazať tím</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Nová schéma pre zbrane</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Upraviť schému pre zbrane</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Vymazať schému pre zbrane</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Z výberu tímov nemôžete upravovať tímy. Vráťte sa do hlavného menu, odkiaľ môžete pridávať, upravovať alebo mazať tímy.</translation>
     </message>
@@ -1017,131 +910,79 @@ Prosím vyberte si inú prezývku:</translation>
         <source>Delete weapon set</source>
         <translation>Vymazať sadu zbraní</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
+        <source>General</source>
+        <translation type="unfinished">Všeobecné</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Pokročilé</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Dialóg na zmenu mena</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Zadajte nový názov súboru:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Nemôžem premenovať na</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Nemôžem vymazať súbor</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Prosím vyberte záznam zo zoznamu</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Vytvoriť</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Pripojiť sa</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Obnoviť</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Admin features</source>
-        <translation>Vlastnosti pre admina</translation>
-    </message>
-    <message>
-        <source>Room Name:</source>
-        <translation>Názov miestnosti:</translation>
-    </message>
-    <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Táto hra je v lobby.
-Môžete sa pridať a začať hru akonáhle hra skončí.</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Táto hra práve prebieha.
-Môžete sa pridať a sledovať hru, ale ak chcete hrať budete musieť počkať na koniec hry.</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 je hostiteľom. Može meniť nastavenia a spúšťať hru.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Náhodná mapa</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Hry môžu byť hrané na predvytvorených alebo náhodných mapách.</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Schéma hry určuje všeobecné voľby ako napríklad Dĺžka kola, Režim rýchlej smrti alebo Vampírizmus.</translation>
+        <source>Rename dialog</source>
+        <translation>Dialóg na zmenu mena</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Schémy hry určuje dostupné zbrane a množstvo výzbroje.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>K tejto miestnosti je pripojený jeden klient.</numerusform>
-            <numerusform>K tejto miestnosti sú pripojení %1 klienti.</numerusform>
-            <numerusform>K tejto miestnosti je pripojených %1 klientov.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>V tejto miestnosti je jeden hrajúci tím.</numerusform>
-            <numerusform>V tejto miestnosti sú %1 hrajúce tímy.</numerusform>
-            <numerusform>V tejto miestnosti je %1 hrajúcich tímov.</numerusform>
-        </translation>
+        <source>Enter new file name:</source>
+        <translation>Zadajte nový názov súboru:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Please enter room name</source>
-        <translation>Prosím zadajte názov miestnosti</translation>
+        <source>Create</source>
+        <translation>Vytvoriť</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Prosím vyberte miestnosť zo zoznamu</translation>
+        <source>Join</source>
+        <translation>Pripojiť sa</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation>Náhodné bludisko</translation>
+        <source>Admin features</source>
+        <translation>Vlastnosti pre admina</translation>
     </message>
     <message>
-        <source>State:</source>
-        <translation type="obsolete">Stav:</translation>
+        <source>Room Name:</source>
+        <translation>Názov miestnosti:</translation>
     </message>
     <message>
         <source>Rules:</source>
@@ -1159,16 +1000,6 @@ Môžete sa pridať a sledovať hru, ale ak chcete hrať budete musieť počkať
         <source>Clear</source>
         <translation>Vyčistiť</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Varovanie</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Hra, ku ktorej sa snažíte pripojiť, už začala.
-Aj napriek tomu chcete vojsť do miestnosti?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1181,10 +1012,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
 <context>
     <name>PageScheme</name>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Povoliť náhodne rozmiestnené míny</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>K vášmu zdraviu sa priráta 80 % škody, ktorú spôsobíte</translation>
     </message>
@@ -1225,10 +1052,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Krajina sa nedá zničiť!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Pridať nezničiteľný okraj okolo terénu</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Nižšia gravitácia</translation>
     </message>
@@ -1306,7 +1129,7 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
     </message>
     <message>
         <source>Add an indestructible border along the bottom</source>
-        <translation type="unfinished"></translation>
+        <translation>Pridať nezničiteľný okraj popri spodku obrazovky</translation>
     </message>
 </context>
 <context>
@@ -1331,35 +1154,47 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Jednoduchá hra (rýchla hra proti počítaču, s preddefinovanými nastaveniami)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Multiplayer (hrať hru, pri ktorej sa striedate s hráčmi pri počítači alebo proti počítačovým tímom)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Tréningový režim (vylepšujte si svoje zručnosti v rade tréningových misií). VO VÝVOJI</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demá (prehrávanie natočených demonahrávok)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Načítať (načíta v minulosti uloženú hru)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Režim kampane (...) VO VÝVOJI</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Načítať</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1367,10 +1202,57 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
     <name>PageTraining</name>
     <message>
         <source>No description available</source>
-        <translation type="unfinished"></translation>
+        <translation>Žiaden popis nie je dostupný</translation>
     </message>
     <message>
         <source>Select a mission!</source>
+        <translation>Vyberte misiu!</translation>
+    </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Meno</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1460,10 +1342,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Pripojiť dátum a čas k súboru so záznamom</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Znížená kvalita</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Zobrazovať nápovedu pre zbrane</translation>
     </message>
@@ -1479,6 +1357,26 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <source>Frontend effects</source>
         <translation>Efekty vo frontende</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1523,42 +1421,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Prebieha</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Východzie</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Režim profesionálov</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Nakupovanie</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Basketbal</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Mínové pole</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Vzbura sudov</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Tunelujúci ježkovia</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Šialené</translation>
-    </message>
-    <message>
-        <source>Normal</source>
-        <translation type="obsolete">Normálna</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>ručne kreslená mapa...</translation>
     </message>
@@ -1650,10 +1512,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Nastavenia zvuku/grafiky</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Zbrane</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Sieťová hra</translation>
     </message>
@@ -1681,6 +1539,30 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <source>Schemes and Weapons</source>
         <translation>Schémy a zbrane</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1693,10 +1575,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Míny</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Tento program je distribuovaný podľa podmienok GNU General Publice License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Vývojári:</translation>
     </message>
@@ -1733,10 +1611,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Limit FPS</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Sieťový nick</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Názov servera:</translation>
     </message>
@@ -1813,16 +1687,6 @@ Aj napriek tomu chcete vojsť do miestnosti?</translation>
         <translation>Jazykové nastavenia</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Vyžaduje reštart hry</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Toto zostavenie SVN je 'stále-vo-vývoji' a nemusí byť kompatibilné s inými verziami hry.
-Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používajte na vlastné riziko!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Výbušniny</translation>
     </message>
@@ -1840,10 +1704,6 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
         <translation>Kvalita</translation>
     </message>
     <message>
-        <source>Bind schemes and weapons</source>
-        <translation type="obsolete">Prepojiť schémy a zbrane</translation>
-    </message>
-    <message>
         <source>Sudden Death Water Rise</source>
         <translation>Stúpanie vody počas rýchlej smrti</translation>
     </message>
@@ -1864,18 +1724,10 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
         <translation>% dĺžka lana</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Hra</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Zobrazenie stereo</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Voľby hry</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Štýl</translation>
     </message>
@@ -1884,15 +1736,73 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
         <translation>Schéma</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Heslo</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% času na útek</translation>
     </message>
     <message>
         <source>This program is distributed under the GNU General Public License v2</source>
+        <translation>Tento program je distribuovaný pod licenciou GNU General Public License v2</translation>
+    </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Prezývka</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1904,6 +1814,10 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
     </message>
     <message>
         <source>hedgehog %1</source>
+        <translation>ježko %1</translation>
+    </message>
+    <message>
+        <source>anonymous</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1917,10 +1831,6 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Sieť</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Spojenie so serverom bolo prerušené</translation>
     </message>
@@ -1929,81 +1839,224 @@ Niektoré vlastnosti nemusia fungovať alebo nemusia byť dokončené. Používa
         <translation>Chyba</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Nastavenie súborových asociácii zlyhalo.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Nepodarilo sa vytvoriť adresár %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Nepodarilo sa otvoriť dátový adresár:
-%1
-Skontrolujte si vašu inštaláciu</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Zbrane</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Nie je možné upraviť východziu sadu zbraní</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Nie je možné spustiť server: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Nie je možné vymazať východziu sadu zbraní</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Určite chcete vymazať túto sadu zbraní?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Nie je možné prepísať východziu sadu zbraní '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Všetky súborové asociácie boli nastavené.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Nastavenie súborových asociácii zlyhalo.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Tímy</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Prosím zadajte názov miestnosti</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Naozaj vymazať tento tím?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Schémy</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Prosím vyberte záznam zo zoznamu</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Nie je možné vymazať východziu schému '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Naozaj chcete vymazať túto hernú schému?</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Nie je možné vymazať východziu sadu zbraní '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Prosím vyberte miestnosť zo zoznamu</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Nepodarilo sa vytvoriť adresár %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Hra, ku ktorej sa snažíte pripojiť, už začala.
+Aj napriek tomu chcete vojsť do miestnosti?</translation>
     </message>
     <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished">Chyba v súbore</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Prezývka</translation>
     </message>
@@ -2083,43 +2136,79 @@ Skontrolujte si vašu inštaláciu</translation>
         <translation>Asociovať prípony súborov.</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translation type="obsolete">Nastaviť</translation>
-    </message>
-    <message>
         <source>more</source>
         <translation>viac</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">Prebieha</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Názov miestnosti</translation>
+        <translation type="unfinished">Názov miestnosti</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>C</translation>
+        <translation type="unfinished">C</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>T</translation>
+        <translation type="unfinished">T</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Majiteľ</translation>
+        <translation type="unfinished">Majiteľ</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Mapa</translation>
+        <translation type="unfinished">Mapa</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Pravidlá</translation>
+        <translation type="unfinished">Pravidlá</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Zbrane</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Náhodná mapa</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Náhodné bludisko</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2150,21 +2239,6 @@ Skontrolujte si vašu inštaláciu</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Chyba</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Nie je možné spustiť server: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Nie je možné spustiť engine: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2207,10 +2281,6 @@ Skontrolujte si vašu inštaláciu</translation>
         <translation>Nesmrteľnosť</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Pridať míny</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Náhodné poradie</translation>
     </message>
@@ -2268,7 +2338,7 @@ Skontrolujte si vašu inštaláciu</translation>
     </message>
     <message>
         <source>Add Bottom Border</source>
-        <translation type="unfinished"></translation>
+        <translation>Pridať spodný okraj</translation>
     </message>
 </context>
 <context>
@@ -2435,6 +2505,14 @@ ježkov</translation>
         <source>slot 10</source>
         <translation>slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2521,6 +2599,10 @@ ježkov</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Prepnúť nápisy nad ježkami:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_sv.ts b/share/hedgewars/Data/Locale/hedgewars_sv.ts
index ab8840c..202c4c2 100644
--- a/share/hedgewars/Data/Locale/hedgewars_sv.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_sv.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="sv">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Fel på fil</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Kan inte skriva till '%1'</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Kan inte läsa '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -48,14 +40,6 @@
         <translation>Redigera vapenset</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Ogiltigt vapenschema</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Redigera spelscheman</translation>
     </message>
@@ -69,23 +53,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 har tagits bort från din ignoreringslista</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 har lagts till i din ignoreringslista</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 har tagits bort från din kompislista</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 har lagts till i din kompislista</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -130,38 +105,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Kunde inte starta servern</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Kan inte spara inspelning till fil %1</translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">ny</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>Var god välj inspelning från listan ovanför</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Standardlag</translation>
     </message>
@@ -188,10 +139,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Lösenord</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -210,17 +157,12 @@ ett annat smeknamn i spelinställningarna:</translation>
         <translation type="unfinished">Smeknamn</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Någon använder redan
-ditt smeknamn %1
-på servern.
-Välj ett annat smeknamn:</translation>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -348,20 +290,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Du sparkades ut</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Lösenord</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Ditt smeknamn (%1) är
-registrerat på Hedgewars.org
-Var god ange ditt lösenord
-eller välj ett annat smeknamn:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 har gått med i rummet</translation>
     </message>
@@ -378,31 +306,33 @@ eller välj ett annat smeknamn:</translation>
         <translation>%1 *** %2 har lämnat</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Ditt smeknamn (%1) är
-registrerat på Hedgewars.org
-Var god ange ditt lösenord eller välj
-ett annat smeknamn i spelinställningarna:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Smeknamn</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Någon använder redan
-ditt smeknamn %1
-på servern.
-Välj ett annat smeknamn:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Lösenord</translation>
     </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
     <message>
-        <source>User quit</source>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -414,15 +344,27 @@ Välj ett annat smeknamn:</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Servermeddelande</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Ställ in meddelande</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Töm användarcache</translation>
@@ -458,10 +400,6 @@ Välj ett annat smeknamn:</translation>
         <source>Connecting...</source>
         <translation>Ansluter...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Avbryt</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -486,10 +424,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Läs in ritad karta</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Ritade kartor (*.hwmap);;Alla filer (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Spara ritad karta</translation>
     </message>
@@ -501,6 +435,10 @@ Välj ett annat smeknamn:</translation>
         <source>All files</source>
         <translation>Alla filer</translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -516,24 +454,6 @@ Välj ett annat smeknamn:</translation>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Priset för bästa skott går till <b>%1</b> med <b>%2</b> poäng.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Den bästa mördaren är <b>%1</b> med <b>%2</b> dödad på samma tur.</p></numerusform>
-            <numerusform><p>Den bästa mördaren är <b>%1</b> med <b>%2</b> dödade på samma tur.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Totalt <b>%1</b> igelkott dödades denna omgång.</p></numerusform>
-            <numerusform><p>Totalt <b>%1</b> igelkottar dödades denna omgång.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Detaljer</translation>
     </message>
@@ -570,10 +490,6 @@ Välj ett annat smeknamn:</translation>
             <numerusform>(%1 döda)</numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 döda)</translation>
-    </message>
     <message numerus="yes">
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
         <translation>
@@ -604,15 +520,14 @@ Välj ett annat smeknamn:</translation>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Lokalt spel (Spela en omgång på en enskild dator)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Nätverkspel (Spela en omgång över ett nätverk)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -629,11 +544,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Om du inte är säker på vad du ska göra och inte vill slösa på ammunition, hoppa över en tur. Men låt inte för lång tid passera eftersom sudden death kommer!</translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Vill du spara rep? Släpp repet i luften och sedan sjut igen. Så länge du inte nuddar marken använder du samma rep utan att slösa på ammunition!</translation>
-    </message>
-    <message>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
         <translation>Om du vill förhindra andra från att använda ditt favoritnamn på den officiella servern kan du registrera ett konto på http://www.hedgewars.org/.</translation>
@@ -709,11 +619,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Speciella spellägen som 'Vampyrism' eller 'Karma' låter dig utveckla helt nya taktiker. Pröva dem i ett eget spel!</translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Windows-versionen av Hedgewars har stöd för Xfire. Se till att lägga till Hedgewars till spellistan så att dina vänner kan se dig spela.</translation>
-    </message>
-    <message>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
         <translation>Du ska aldrig installera Hedgewars på en dator som du inte äger (skola, universitet, arbete, etc.). Fråga den ansvarige personen istället!</translation>
@@ -779,11 +684,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Pianoanfall är det farligaste luftanfallet. Du blir av med en igelkott när du använder det, så det finns en stor nackdel också.</translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Målsökande biet kan vara svårt att använda. Biets sväng beror på hastigheten, så försök inte att använda full kraft.</translation>
-    </message>
-    <message>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
         <translation>Fästande minor är ett perfekt verktyg för att skapa små kedjereaktioner som slår ner fiender i farliga situationer ... eller vatten.</translation>
@@ -809,11 +709,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Eldkastaren är ett vapen, men den kan användas för att gräva tunnlar också.</translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Använd Molotov för att tillfälligt förhindra igelkottar från att passera terräng såsom tunnlar och platformer.</translation>
-    </message>
-    <message>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
         <translation>Vill du veta vilka som ligger bakom spelet? Tryck på Hedgewars-loggan i huvudmenyn för att se medverkande.</translation>
@@ -844,11 +739,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Du kan hitta dina konfigurationsfiler under "Mina Dokument\Hedgewars". Gör en säkerhetskopia eller ta med dig filerna, men redigera dem inte för hand.</translation>
     </message>
     <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">Du kan hitta dina konfigurationsfiler under "Hedgewars" i din hem-mapp. Gör en säkerhetskopia eller ta med dig filerna, men redigera dem inte för hand.</translation>
-    </message>
-    <message>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
         <translation>Du kan associera Hedgewars-relaterade filer (sparfiler och demo-inspelningar) med spelet för att köra dem direkt från den filhanterare eller webbläsare du tycker bäst om.</translation>
@@ -887,6 +777,46 @@ Välj ett annat smeknamn:</translation>
         <source>Downloadable Content</source>
         <translation>Nedladdningsbart innehåll</translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -896,33 +826,18 @@ Välj ett annat smeknamn:</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Var god välj server från listan ovanför</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Kontroll</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Skriv in rummets namn</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished">Nedladdningsbart innehåll</translation>
     </message>
 </context>
 <context>
@@ -935,6 +850,14 @@ Välj ett annat smeknamn:</translation>
         <source>Official server</source>
         <translation>Officiell server</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -951,18 +874,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Ta bort lag</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Nytt vapenschema</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Redigera vapenschema</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Ta bort vapenschema</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Du kan inte redigera lag från ett spel. Gå tillbaka till huvudmenyn för att lägga till, redigera eller ta bort lag.</translation>
     </message>
@@ -990,36 +901,60 @@ Välj ett annat smeknamn:</translation>
         <source>Delete weapon set</source>
         <translation>Ta bort vapenset</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
+        <source>General</source>
+        <translation type="unfinished">Allmänt</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Avancerat</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Namnbytesdialig</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Skriv in nytt filnamn:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Kan inte byta namn till</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Kan inte ta bort fil</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Välj inspelning från listan</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
+    <message>
+        <source>Rename dialog</source>
+        <translation>Namnbytesdialig</translation>
+    </message>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Skriv in nytt filnamn:</translation>
     </message>
 </context>
 <context>
@@ -1033,18 +968,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Anslut</translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Uppdatera</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
         <source>Admin features</source>
         <translation>Adminfunktioner</translation>
     </message>
@@ -1053,68 +976,6 @@ Välj ett annat smeknamn:</translation>
         <translation>Rumnamn:</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Detta spel är i lobby.
-Du kan gå med och börja spela när spelet börjar.</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Detta spel pågår.
-Du kan gå med och se på men du måste vänta tills spelet är slut för att kunna börja spela.</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 är ägaren. Han kan ändra inställningar och starta spelet.</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>Slumpad karta</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Spel kan spelas på färdiga eller slumpade kartor.</translation>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Spelschemat anger allmäna inställningar som tid per person, Sudden Death eller Vampyrism.</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Vapenschemat anger tillgängliga vapen och deras ammunitionsantal.</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>Det är %1 klient uppkopplad till detta rum.</numerusform>
-            <numerusform>Det är %1 klienter uppkopplade till detta rum.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>Det är %1 deltagande lag i detta rum.</numerusform>
-            <numerusform>Det är %1 deltagande lag i detta rum.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Skriv in rummets namn</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Välj ett rum från listan</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Slumpad labyrint</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Status:</translation>
-    </message>
-    <message>
         <source>Rules:</source>
         <translation>Regler:</translation>
     </message>
@@ -1130,16 +991,6 @@ Du kan gå med och se på men du måste vänta tills spelet är slut för att ku
         <source>Clear</source>
         <translation>Rensa</translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation>Varning</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Spelet du försöker gå med i har startat.
-Vill du fortfarande gå med i rummet?</translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation>
@@ -1159,10 +1010,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Ta bort</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Aktivera slumpade minor</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Få 80% av skadan du gör tillbaka i liv</translation>
     </message>
@@ -1195,10 +1042,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Land kan inte förstöras!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Lägger till en oförstörbar kant runt terrängen</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Lägre gravitation</translation>
     </message>
@@ -1301,35 +1144,47 @@ Vill du fortfarande gå med i rummet?</translation>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Enkelt spel (en snabbomgång mot datorn, inställningar väljs åt dig)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Flera spelare (spela en hotseat-omgång mot dina vänner eller AI-lag)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Träningsläge (öva dina färdigheter i en rad träningsuppdrag). UNDER UTVECKLING</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demos (se inspelade demos)</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Ladda (ladda ett tidigare sparat spel)</translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Kampanjläge (...). UNDER UTVECKLING</translation>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Load</source>
+        <translation type="unfinished">Läs in</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1343,6 +1198,52 @@ Vill du fortfarande gå med i rummet?</translation>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Namn</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1430,10 +1331,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Leta efter uppdatering vid programstart</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Minskad kvalité</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Visa hjälp i ammunitionsmenyn</translation>
     </message>
@@ -1449,6 +1346,26 @@ Vill du fortfarande gå med i rummet?</translation>
         <source>Frontend effects</source>
         <translation>Effekter i spelmenyn</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1493,42 +1410,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Pågår</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Standard</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">Pro-läge</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">Shoppa</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">Basket</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">Minfält</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">Tunnförödelse</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">Tunnelkottar</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">Galet</translation>
-    </message>
-    <message>
-        <source>Normal</source>
-        <translation type="obsolete">Vanligt</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>handritad karta...</translation>
     </message>
@@ -1620,10 +1501,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Ljud/grafikinställningar</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Vapen</translation>
-    </message>
-    <message>
         <source>Net game</source>
         <translation>Internetspel</translation>
     </message>
@@ -1651,14 +1528,34 @@ Vill du fortfarande gå med i rummet?</translation>
         <source>Schemes and Weapons</source>
         <translation>Scheman och vapen</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Detta program distribueras under GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Utvecklare:</translation>
     </message>
@@ -1695,10 +1592,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>FPS-begränsning</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Internetnamn</translation>
-    </message>
-    <message>
         <source>Server name:</source>
         <translation>Servernamn:</translation>
     </message>
@@ -1783,16 +1676,6 @@ Vill du fortfarande gå med i rummet?</translation>
         <translation>Språk</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Starta om spelet för att verkställa</translation>
-    </message>
-    <message>
-        <source>This SVN build is 'work in progress' and may not be compatible with other versions of the game.
-Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation type="obsolete">Detta SVN-bygge är 'under utveckling' och kanske inte är kompatibel med andra versioner av spelet.
-Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Bombtunnor</translation>
     </message>
@@ -1829,18 +1712,10 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
         <translation>% replängd</translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">Speltyp</translation>
-    </message>
-    <message>
         <source>Stereo rendering</source>
         <translation>Stereorendering</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Spelinställningar</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Stil</translation>
     </message>
@@ -1849,10 +1724,6 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
         <translation>Schema</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Lösenord</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% flykttid</translation>
     </message>
@@ -1860,6 +1731,68 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">Smeknamn</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1871,6 +1804,10 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
         <source>hedgehog %1</source>
         <translation>igelkott %1</translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1882,10 +1819,6 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Nätverk</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Ansluting till servern bröts</translation>
     </message>
@@ -1894,81 +1827,223 @@ Det kan finnas trasiga eller ofullständiga funktioner. Använd på egen risk!</
         <translation>Fel</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Filassociationer har misslyckats.</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Kan inte skapa katalog %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Kunde inte öppna datakatalog:
-%1
-Var god kontrollera din installation</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Vapen</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Kan inte redigera ursprungliga vapenscheman</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Kunde inte starta servern: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Kan inte ta bort ursprungliga vapenscheman</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Vill du verkligen ta bort detta vapenschema?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Kan inte skriva över standardvapenschema '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Alla filassociationer har satts.</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Filassociationer har misslyckats.</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Lag</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Skriv in rummets namn</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Vill du verkligen ta bort detta lag?</translation>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Scheman</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Välj inspelning från listan</translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Kan inte ta bort standardschema '%1'!</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Vill du verkligen ta bort detta spelschema?</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Kan inte ta bort standardvapenset '%1'!</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Fel</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Välj ett rum från listan</translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Kan inte skapa katalog %1</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Spelet du försöker gå med i har startat.
+Vill du fortfarande gå med i rummet?</translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished">Fel på fil</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Smeknamn</translation>
     </message>
@@ -2048,43 +2123,79 @@ Var god kontrollera din installation</translation>
         <translation>Associera filextentioner</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translation type="obsolete">Ange</translation>
-    </message>
-    <message>
         <source>more</source>
         <translation>mer</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">Pågår</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Rumnamn</translation>
+        <translation type="unfinished">Rumnamn</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>A</translation>
+        <translation type="unfinished">A</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>L</translation>
+        <translation type="unfinished">L</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Ägare</translation>
+        <translation type="unfinished">Ägare</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Karta</translation>
+        <translation type="unfinished">Karta</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Regler</translation>
+        <translation type="unfinished">Regler</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Vapen</translation>
+        <translation type="unfinished">Vapen</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Slumpad karta</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Slumpad labyrint</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2115,21 +2226,6 @@ Var god kontrollera din installation</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Fel</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Kunde inte starta servern: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Kunde inte köra motorn: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2172,10 +2268,6 @@ Var god kontrollera din installation</translation>
         <translation>Osårbar</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Lägg till minor</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Slumpad ordning</translation>
     </message>
@@ -2399,6 +2491,14 @@ info</source>
         <source>slot 10</source>
         <translation>fack 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2485,6 +2585,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Visa etiketter över igelkottar:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts b/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts
index e9815c0..1f997ee 100644
--- a/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_tr_TR.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="tr_TR">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>yeni</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>yeni</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -47,14 +39,6 @@
         <translation>Silahları düzenle</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Uygunsuz cephane düzeni</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Düzeni değiştir</translation>
     </message>
@@ -68,6 +52,13 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
@@ -113,38 +104,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">yeni</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Sunucu başlatılamadı</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Kayıt %1 dosyasına yazılamadı</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Lütfen üstteki listeden kaydı seçin</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -171,10 +138,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Parola</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -190,14 +153,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -325,10 +286,6 @@ Please pick another nickname:</source>
         <translation>Kovuldunuz</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Parola</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation type="unfinished"></translation>
     </message>
@@ -348,6 +305,32 @@ Please pick another nickname:</source>
         <source>User quit</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Parola</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>KB</name>
@@ -357,15 +340,27 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Sunucu iletisi:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Ä°letiyi ayarla</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation type="unfinished"></translation>
@@ -401,10 +396,6 @@ Please pick another nickname:</source>
         <source>Connecting...</source>
         <translation>Bağlanıyor...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Ä°ptal</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -440,6 +431,10 @@ Please pick another nickname:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -455,10 +450,6 @@ Please pick another nickname:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>En iyi atış ödülünü <b>%2</b> puanla <b>%1</b> kazandı.</p></translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -519,15 +510,14 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
+    <name>PageInfo</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Yerel Oyun (Tek bilgisayarda oyna)</translation>
-    </message>
-    <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Ağ Oyunu (Bir bilgisayar ağı üzerinde oyna)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -777,6 +767,46 @@ Please pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -786,33 +816,18 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Lütfen üstteki listeden bir sunucu seçin</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Kontrol</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">Hata</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">Lütfen oda ismini girin</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished">Tamam</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -825,6 +840,14 @@ Please pick another nickname:</source>
         <source>Official server</source>
         <translation>Resmi sunucu</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -868,120 +891,78 @@ Please pick another nickname:</source>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
-    <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
-    </message>
-    <message>
-        <source>Rename dialog</source>
-        <translation>Yeniden adlandırma</translation>
-    </message>
-    <message>
-        <source>Enter new file name:</source>
-        <translation>Yeni dosya adını girin:</translation>
-    </message>
-    <message>
-        <source>Cannot rename to</source>
-        <translation>Adlandırılamıyor</translation>
-    </message>
-    <message>
-        <source>Cannot delete file</source>
-        <translation>Dosya silinemiyor</translation>
-    </message>
-    <message>
-        <source>Please select record from the list</source>
-        <translation>Lütfen listeden kaydı seçin</translation>
-    </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
-    <message>
-        <source>Create</source>
-        <translation>OluÅŸtur</translation>
-    </message>
-    <message>
-        <source>Join</source>
-        <translation>Katıl</translation>
-    </message>
     <message>
-        <source>Refresh</source>
-        <translation>Tazele</translation>
+        <source>General</source>
+        <translation type="unfinished">Genel</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Hata</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">GeliÅŸmiÅŸ</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Yönetici görevleri</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Room Name:</source>
+        <source>Proxy port</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
+        <source>Proxy login</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
+        <source>Proxy password</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
+        <source>No proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Random Map</source>
+        <source>Socks5 proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
+        <source>HTTP proxy</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
+        <source>System proxy settings</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation type="unfinished"></translation>
+        <source>Rename dialog</source>
+        <translation>Yeniden adlandırma</translation>
     </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
+    <message>
+        <source>Enter new file name:</source>
+        <translation>Yeni dosya adını girin:</translation>
     </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
+</context>
+<context>
+    <name>PageRoomsList</name>
+    <message>
+        <source>Create</source>
+        <translation>OluÅŸtur</translation>
     </message>
     <message>
-        <source>Please enter room name</source>
-        <translation>Lütfen oda ismini girin</translation>
+        <source>Join</source>
+        <translation>Katıl</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>Lütfen listeden bir oda seçin</translation>
+        <source>Admin features</source>
+        <translation>Yönetici görevleri</translation>
     </message>
     <message>
-        <source>Random Maze</source>
+        <source>Room Name:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -1000,15 +981,6 @@ You may join and spectate now but you'll have to wait for the game to end t
         <source>Clear</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
     <message numerus="yes">
         <source>%1 players online</source>
         <translation type="unfinished">
@@ -1031,10 +1003,6 @@ Do you still want to join the room?</source>
         <translation>Zemin yok edilemez!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Bölgenin etrafına yok edilemez bir sınır ekle</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Düşük yer çekimi</translation>
     </message>
@@ -1047,10 +1015,6 @@ Do you still want to join the room?</source>
         <translation>Tüm kirpilerin kişisel güç kalkanı olur</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Rastgele mayınlar</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Verdiğin hasarın %%80'ini sağlık olarak kazan</translation>
     </message>
@@ -1169,44 +1133,105 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Basit Oyun (bilgisayara karşı oynayın, ayarlar sizin yerinize seçilir)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Çok oyunculu (arkadaşlarınızın veya bilgisayarın takımlarına karşı oynayın)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete"> Talim Modu (Bir takım talimlere katılarak kirpilerinizi eğitin). YAPIM AŞAMASINDA</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Kayıtlı Oyunlar (Kaydedilmiş oyunları izleyin)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Yükle (Kaydedilmiş bir oyunu yükleyin)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Training Mode</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageTraining</name>
     <message>
-        <source>No description available</source>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Yükle</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageTraining</name>
+    <message>
+        <source>No description available</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1309,6 +1334,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1353,10 +1398,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">Öntanımlı</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1444,10 +1485,6 @@ Do you still want to join the room?</source>
         <translation>Takımlar</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Silahlar</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Ses/Görüntü seçenekleri</translation>
     </message>
@@ -1479,6 +1516,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1495,10 +1556,6 @@ Do you still want to join the room?</source>
         <translation>Sürüm</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Bu program GNU Genel Kamu Lisansı'yla dağıtılmaktadır</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>GeliÅŸtiriciler:</translation>
     </message>
@@ -1531,10 +1588,6 @@ Do you still want to join the room?</source>
         <translation>Port:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Takma ad</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Çözünürlük</translation>
     </message>
@@ -1611,10 +1664,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1663,10 +1712,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Parola</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1674,6 +1719,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1685,6 +1792,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1696,10 +1807,6 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>AÄŸ</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>Sunucuyla olan bağlantı kesildi</translation>
     </message>
@@ -1708,81 +1815,221 @@ Do you still want to join the room?</source>
         <translation>Hata</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">%1 dizini oluşturulamadı</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Veri dizini açılamadı:
- %1
-Lütfen kurulumunuzu kontrol edin</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Silahlar</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Öntanımlı silah seti düzenlenemez</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Sunucu başlatılamadı: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Öntanımlı silah seti silinemez</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Bu silah seti silinsin mi?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>Video upload - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">Takımlar</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Lütfen oda ismini girin</translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Lütfen listeden kaydı seçin</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Room Name - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Lütfen listeden bir oda seçin</translation>
+    </message>
+    <message>
+        <source>Room Name - Are you sure?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Hata</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>%1 dizini oluşturulamadı</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Tamam</translation>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1865,9 +2112,37 @@ Lütfen kurulumunuzu kontrol edin</translation>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation type="unfinished"></translation>
@@ -1896,6 +2171,18 @@ Lütfen kurulumunuzu kontrol edin</translation>
         <source>Weapons</source>
         <translation type="unfinished">Silahlar</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -1925,21 +2212,6 @@ Lütfen kurulumunuzu kontrol edin</translation>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Hata</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Sunucu başlatılamadı: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Oyun motoru çalıştırılamadı: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -1982,10 +2254,6 @@ Lütfen kurulumunuzu kontrol edin</translation>
         <translation>Ölümsüzlük</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Mayın Ekle</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2210,6 +2478,14 @@ bilgileri</translation>
         <source>slot 10</source>
         <translation type="unfinished">slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2296,6 +2572,10 @@ bilgileri</translation>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_uk.ts b/share/hedgewars/Data/Locale/hedgewars_uk.ts
index 15c9479..4b2cb39 100644
--- a/share/hedgewars/Data/Locale/hedgewars_uk.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_uk.ts
@@ -2,6 +2,13 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="uk">
 <context>
+    <name>AbstractPage</name>
+    <message>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>AmmoSchemeModel</name>
     <message>
         <source>new</source>
@@ -13,21 +20,6 @@
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation>Помилка файлу</translation>
-    </message>
-    <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation>Не можу відкрити файл '%1' для запису</translation>
-    </message>
-    <message>
-        <source>Cannot read file '%1'</source>
-        <translation>Не можу прочитати файл '%1'</translation>
-    </message>
-</context>
-<context>
     <name>FreqSpinBox</name>
     <message>
         <source>Never</source>
@@ -49,14 +41,6 @@
         <translation>Редагувати зброю</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>Неможлива схема баєприпасів</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation>Редагувати схеми</translation>
     </message>
@@ -70,23 +54,14 @@
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 був видалений з вашого списку ігнорування</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 був доданий до вашого списку ігнорування</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 був видалений з вашого списку друзів</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 був доданий до вашого списку друзів</translation>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
@@ -131,38 +106,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>new</source>
-        <translation type="obsolete">нова</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>Так</translation>
-    </message>
-    <message>
-        <source>Unable to start the server</source>
-        <translation>Помилка запуску сервера</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>Не можу зберегти запис до файлу %1</translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>Виберіть запис зі списку</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation>Команда за замовчуванням</translation>
     </message>
@@ -189,10 +140,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">Пароль</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -211,17 +158,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished">Хтось вже використовує
- нікнейм %1
-на сервері.
-Виберіть інший нікнейм:</translation>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -349,20 +291,6 @@ Please pick another nickname:</source>
         <translation>Вас вигнали</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">Пароль</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">Ваше ім'я %1 вже
-зареєстроване на Hedgewars.org
-Будь-ласка введіть ваш пароль
-або змініть ім'я:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1 *** %2 увійшов до кімнати</translation>
     </message>
@@ -379,31 +307,33 @@ or pick another nickname:</source>
         <translation>%1 *** %2 від'єднаний</translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">Ваш нік %1 вже
-зареєстрований на Hedgewars.org
-Введіть ваш пароль нижче або
-виберіть інший нік в налаштуваннях гри:</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">Нікнейм</translation>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="obsolete">Хтось вже використовує
- нікнейм %1
-на сервері.
-Виберіть інший нікнейм:</translation>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Пароль</translation>
     </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
     <message>
-        <source>User quit</source>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -415,15 +345,27 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">Повідомлення сервера:</translation>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">Встановити повідомлення</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>Очистити Кеш Профілів</translation>
@@ -459,10 +401,6 @@ Please pick another nickname:</source>
         <source>Connecting...</source>
         <translation>Під'єднання...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">Скасувати</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -487,10 +425,6 @@ Please pick another nickname:</source>
         <translation>Завантажити намальовану мапу</translation>
     </message>
     <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">Намальовані мапи (*.hwmap);;Всі файли (*.*)</translation>
-    </message>
-    <message>
         <source>Save drawn map</source>
         <translation>Зберегти намальовану мапу</translation>
     </message>
@@ -502,6 +436,10 @@ Please pick another nickname:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -517,26 +455,6 @@ Please pick another nickname:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>Нагороду за кращий постріл отримує <b>%1</b> з <b>%2</b> пунктами нанесених втрат.</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>Кращим вбивцею є <b>%1</b> з <b>%2</b> вбивством за хід.</p></numerusform>
-            <numerusform><p>Кращим вбивцею є <b>%1</b> з <b>%2</b> вбивствами за хід.</p></numerusform>
-            <numerusform><p>Кращим вбивцею є <b>%1</b> з <b>%2</b> вбивствами за хід.</p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p><b>%1</b> їжак був вбитий протягом раунду.</p></numerusform>
-            <numerusform><p><b>%1</b> їжаки були вбиті протягом раунду.</p></numerusform>
-            <numerusform><p><b>%1</b> їжаків було вбито протягом раунду.</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation>Деталі</translation>
     </message>
@@ -609,15 +527,14 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>Локальна Гра (Грати на одному комп'ютері)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>Мережна Гра (Грати по мережі)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -867,6 +784,46 @@ Please pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -876,33 +833,18 @@ Please pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>Выберіть сервер зі списку</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>Керування</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Введіть назву кімнати</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Так</translation>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -915,6 +857,14 @@ Please pick another nickname:</source>
         <source>Official server</source>
         <translation>Офіційний сервер</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -931,18 +881,6 @@ Please pick another nickname:</source>
         <translation>Видалити команду</translation>
     </message>
     <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">Нова схема зброї</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">Редагувати схему зброї</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">Видалити схему зброї</translation>
-    </message>
-    <message>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
         <translation>Не можна редагувати команду з меню вибору. Перейдіть в головне меню щоб додати, редагувати чи видалити команду.</translation>
     </message>
@@ -970,164 +908,102 @@ Please pick another nickname:</source>
         <source>Delete weapon set</source>
         <translation>Видалити набір зброї</translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
+        <source>General</source>
+        <translation type="unfinished">Основні</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Так</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">Розширені</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>Перейменування</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>Введіть нове ім'я файлу:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>Не можу перейменувати на</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>Не можу видалити файл</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>Выберіть запис зі списку</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>Створити</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>Приєднатися</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>Оновити</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>Так</translation>
+        <source>Rename dialog</source>
+        <translation>Перейменування</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>Адміністрування</translation>
+        <source>Enter new file name:</source>
+        <translation>Введіть нове ім'я файлу:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation>Назва Кімнати:</translation>
+        <source>Create</source>
+        <translation>Створити</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>Ця гра скоро почнеться.
-Ви можете приєднатися і почати грати після старту.</translation>
+        <source>Join</source>
+        <translation>Приєднатися</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>Ця гра вже триває.
-Ви можете приєднатись та спостерігати, але повинні дочекатись поки гра закінчиться, і лише тоді зможете грати.</translation>
+        <source>Admin features</source>
+        <translation>Адміністрування</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 - це хост. Він може змінювати налаштування і починати гру.</translation>
+        <source>Room Name:</source>
+        <translation>Назва Кімнати:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation>Випадкова Мапа</translation>
+        <source>Rules:</source>
+        <translation>Правила:</translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>Грати можна на обраних або випадкових мапах.</translation>
+        <source>Weapons:</source>
+        <translation>Зброя:</translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>Схема Гри визначає загальні налаштування(час гри, час до смерті, вампіризм...)</translation>
+        <source>Search:</source>
+        <translation>Пошук:</translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>Схема зброї визначає наявну зброю та боєприпаси.</translation>
+        <source>Clear</source>
+        <translation>Очистити</translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
+        <source>%1 players online</source>
         <translation>
-            <numerusform>До кімнати приєднаний %1 клієнт.</numerusform>
-            <numerusform>До кімнати приєднані %1 клієнти.</numerusform>
-            <numerusform>До кімнати приєднані %1 клієнтів.</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>В кімнаті знаходиться %1 команда.</numerusform>
-            <numerusform>В кімнаті знаходяться %1 команди.</numerusform>
-            <numerusform>В кімнаті знаходяться %1 команд.</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>Введіть назву кімнати</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>Виберіть кімнату зі списку</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>Випадковий лабіринт</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">Стан:</translation>
-    </message>
-    <message>
-        <source>Rules:</source>
-        <translation>Правила:</translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation>Зброя:</translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation>Пошук:</translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation>Очистити</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation>Увага</translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>Гра, до якої ви хочети при'єднатись вже почалась.
-Ви все ще хочете ввійти в кімнату?</translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation>
-            <numerusform>%1 гравець в мережі</numerusform>
-            <numerusform>%1 гравця в мережі</numerusform>
-            <numerusform>%1 гравців в мережі</numerusform>
+            <numerusform>%1 гравець в мережі</numerusform>
+            <numerusform>%1 гравця в мережі</numerusform>
+            <numerusform>%1 гравців в мережі</numerusform>
         </translation>
     </message>
 </context>
@@ -1146,10 +1022,6 @@ Do you still want to join the room?</source>
         <translation>Грунт не може бути знищений!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">Додати невразливу рамку навколо місцевості</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>Слабка гравітація</translation>
     </message>
@@ -1162,10 +1034,6 @@ Do you still want to join the room?</source>
         <translation>Всі їжаки мають особисте силове поле</translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">Увімкнути випадкові міни</translation>
-    </message>
-    <message>
         <source>Gain 80% of the damage you do back in health</source>
         <translation>Отримання 80% здоров'я, яке втратив противник</translation>
     </message>
@@ -1284,35 +1152,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>Проста Гра (швидка гра проти комп'ютера, налаштування вибираються за вас)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>Мультиплеєр (гра проти ваших друзів, або проти AI команд)</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим Навчання (практика в цілому ряді навчальних місій). В РОЗРОБЦІ</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Демки (дивитись записані демо-відео)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>Завантаження (Завантажити попередньо збережені ігри)</translation>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">Режим Кампанії (...). В РОЗРОБЦІ</translation>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">Завантажити</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1326,6 +1206,53 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">Назва</translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1413,10 +1340,6 @@ Do you still want to join the room?</source>
         <translation>Додавати дату і час в назву записаного файлу</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">Знижена якість</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation>Показувати підказки в меню зброї</translation>
     </message>
@@ -1432,6 +1355,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation>Ефекти меню</translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1476,10 +1419,6 @@ Do you still want to join the room?</source>
         <translation>В процесі</translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">За замовчуванням</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation>вручну намальована мапа...</translation>
     </message>
@@ -1567,10 +1506,6 @@ Do you still want to join the room?</source>
         <translation>Команди</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">Зброя</translation>
-    </message>
-    <message>
         <source>Audio/Graphic options</source>
         <translation>Налаштування Звуку та Графіки</translation>
     </message>
@@ -1602,6 +1537,30 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation>Схеми та Зброя</translation>
     </message>
+    <message>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLabel</name>
@@ -1618,10 +1577,6 @@ Do you still want to join the room?</source>
         <translation>Версія</translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">Ця программа розповсюджується на умовах ліцензії GNU General Public License</translation>
-    </message>
-    <message>
         <source>Developers:</source>
         <translation>Розробники:</translation>
     </message>
@@ -1654,10 +1609,6 @@ Do you still want to join the room?</source>
         <translation>Порт:</translation>
     </message>
     <message>
-        <source>Net nick</source>
-        <translation>Ім'я гравця</translation>
-    </message>
-    <message>
         <source>Resolution</source>
         <translation>Роздільна здатність</translation>
     </message>
@@ -1734,10 +1685,6 @@ Do you still want to join the room?</source>
         <translation>Мова</translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>Перезапустіть гру щоб застосувати</translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation>Вибухівка</translation>
     </message>
@@ -1778,10 +1725,6 @@ Do you still want to join the room?</source>
         <translation>Стерео рендеринг</translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="obsolete">Параметри гри</translation>
-    </message>
-    <message>
         <source>Style</source>
         <translation>Стиль</translation>
     </message>
@@ -1790,10 +1733,6 @@ Do you still want to join the room?</source>
         <translation>Схема</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation>% Час Тікати</translation>
     </message>
@@ -1801,6 +1740,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1812,6 +1813,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1823,10 +1828,6 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
-        <source>Network</source>
-        <translation>Мережа</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>З'єднання з сервером втрачено</translation>
     </message>
@@ -1835,81 +1836,224 @@ Do you still want to join the room?</source>
         <translation>Помилка</translation>
     </message>
     <message>
+        <source>File association failed.</source>
+        <translation>Файлове асоціювання не вдалось</translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">Не можу створити директорію %1</translation>
+    </message>
+    <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>Не можу знайти теку с даними:
-%1
-Перевірте правильність встановлення</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>Зброя</translation>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">Неможливо редагувати набір зброї за замовчуванням</translation>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">Помилка запуску сервера: %1.</translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">Неможливо видалити набір зброї за замовчуванням</translation>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>Видалити вибраний набір зброї?</translation>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>Не можу перезаписати стандартний набір зброї '%1'!</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>Всі асоціації файлів були встановлені</translation>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
-        <translation>Файлове асоціювання не вдалось</translation>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>Команди</translation>
+        <source>Please enter room name</source>
+        <translation type="unfinished">Введіть назву кімнати</translation>
+    </message>
+    <message>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>Справді видалити цю команду?</translation>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">Выберіть запис зі списку</translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>Схеми</translation>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>Не можу видалити стандартну схему '%1'!</translation>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>Справді видалити цю схему гри?</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>Не можу видалити стандартний набір зброї '%1'!</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">Виберіть кімнату зі списку</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>Не можу створити директорію %1</translation>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished">Гра, до якої ви хочети при'єднатись вже почалась.
+Ви все ще хочете ввійти в кімнату?</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Так</translation>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished">Помилка файлу</translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation>Ім'я</translation>
     </message>
@@ -1992,36 +2136,76 @@ Please check your installation</source>
         <source>more</source>
         <translation>більше</translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished">В процесі</translation>
+    </message>
     <message>
         <source>Room Name</source>
-        <translation>Назва Кімнати</translation>
+        <translation type="unfinished">Назва Кімнати</translation>
     </message>
     <message>
         <source>C</source>
-        <translation>Кл</translation>
+        <translation type="unfinished">Кл</translation>
     </message>
     <message>
         <source>T</source>
-        <translation>Км</translation>
+        <translation type="unfinished">Км</translation>
     </message>
     <message>
         <source>Owner</source>
-        <translation>Власник</translation>
+        <translation type="unfinished">Власник</translation>
     </message>
     <message>
         <source>Map</source>
-        <translation>Мапа</translation>
+        <translation type="unfinished">Мапа</translation>
     </message>
     <message>
         <source>Rules</source>
-        <translation>Правила</translation>
+        <translation type="unfinished">Правила</translation>
     </message>
     <message>
         <source>Weapons</source>
-        <translation>Зброя</translation>
+        <translation type="unfinished">Зброя</translation>
+    </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">Випадкова Мапа</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished">Випадковий лабіринт</translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
@@ -2052,21 +2236,6 @@ Please check your installation</source>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>Помилка</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>Помилка запуску сервера: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>Помилка запуску движку: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2109,10 +2278,6 @@ Please check your installation</source>
         <translation>Невразливість</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">Додати Міни</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation>Випадковий Порядок</translation>
     </message>
@@ -2337,6 +2502,14 @@ info</source>
         <source>slot 10</source>
         <translation>слот 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2423,6 +2596,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation>Перемикання надписів над їжаками:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts b/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts
index dd77427..d1721a4 100644
--- a/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_zh_CN.ts
@@ -2,231 +2,211 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="zh_CN">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>新建</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
-        <translation>备份</translation>
+        <location filename="../../../../QTfrontend/ui/page/AbstractPage.cpp" line="51"/>
+        <source>Go back</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished">文件错误</translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished">无法打开文件 '%1' 写入</translation>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="673"/>
+        <source>new</source>
+        <translation type="unfinished">æ–°</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
-        <translation type="unfinished">无法读取文件 '%1'</translation>
+        <location filename="../../../../QTfrontend/model/ammoSchemeModel.cpp" line="679"/>
+        <source>copy of</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>FreqSpinBox</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/FreqSpinBox.cpp" line="36"/>
         <source>Never</source>
         <translation>从不</translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/widget/FreqSpinBox.cpp" line="38"/>
         <source>Every %1 turn</source>
         <translation>
-            <numerusform>每 %1 个回合</numerusform>
+            <numerusform>每隔 %1 回合</numerusform>
         </translation>
     </message>
 </context>
 <context>
     <name>GameCFGWidget</name>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>无法使用此弹药设置</translation>
-    </message>
-    <message>
-        <source>Edit schemes</source>
-        <translation>修改游戏设置</translation>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="54"/>
+        <source>Game Options</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="94"/>
         <source>Edit weapons</source>
-        <translation>修改武器</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="102"/>
         <source>When this option is enabled selecting a game scheme will auto-select a weapon</source>
-        <translation>使用此项则游戏框架自动选择武器配备</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Game Options</source>
-        <translation type="unfinished"></translation>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="79"/>
+        <source>Edit schemes</source>
+        <translation>修改游戏设置</translation>
     </message>
 </context>
 <context>
-    <name>HWChatWidget</name>
-    <message>
-        <source>%1 *** %2 has been removed from your ignore list</source>
-        <translation type="obsolete">%1 *** %2 已经从您的忽略列表中移除</translation>
-    </message>
+    <name>HWAskQuitDialog</name>
     <message>
-        <source>%1 *** %2 has been added to your ignore list</source>
-        <translation type="obsolete">%1 *** %2 已经添加到您的忽略列表中</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been removed from your friends list</source>
-        <translation type="obsolete">%1 *** %2 已经从您的朋友列表中移除</translation>
-    </message>
-    <message>
-        <source>%1 *** %2 has been added to your friends list</source>
-        <translation type="obsolete">%1 *** %2 已经添加到您的朋友列表中</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="33"/>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>HWChatWidget</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="627"/>
         <source>%1 has been removed from your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="637"/>
         <source>%1 has been added to your ignore list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="667"/>
         <source>%1 has been removed from your friends list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="676"/>
         <source>%1 has been added to your friends list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="742"/>
         <source>Stylesheet imported from %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="743"/>
         <source>Enter %1 if you want to use the current StyleSheet in future, enter %2 to reset!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="751"/>
         <source>Couldn't read %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="759"/>
         <source>StyleSheet discarded</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="784"/>
         <source>StyleSheet saved to %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="787"/>
         <source>Failed to save StyleSheet to %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="807"/>
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="463"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="465"/>
+        <source>DefaultTeam</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>确认</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="569"/>
+        <source>Game aborted</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot save record to file %1</source>
-        <translation>无法录入文件 %1</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="981"/>
+        <source>Your nickname %1 is
+registered on Hedgewars.org
+Please provide your password below
+or pick another nickname in game config:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to start the server</source>
-        <translation>开启服务端出现错误</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="985"/>
+        <source>No password supplied.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>new</source>
-        <translation type="obsolete">æ–°</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1011"/>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list above</source>
-        <translation>请选择一个记录</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1011"/>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>DefaultTeam</source>
-        <translation>默认队伍</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1015"/>
+        <source>No nickname supplied.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1660"/>
         <source>Hedgewars Demo File</source>
         <comment>File Types</comment>
-        <translation>刺猬大作战回放文件</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1661"/>
         <source>Hedgewars Save File</source>
         <comment>File Types</comment>
-        <translation>刺猬大作战存档文件</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1709"/>
         <source>Demo name</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1709"/>
         <source>Demo name:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Game aborted</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="unfinished">您的昵称%1
-在Hedgewars.org已注册
-请输入您的密码
-或从游戏配置中选择另一个昵称:</translation>
-    </message>
-    <message>
-        <source>No password supplied.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Nickname</source>
-        <translation type="unfinished">昵称</translation>
-    </message>
-    <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>No nickname supplied.</source>
-        <translation type="unfinished"></translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1430"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1717"/>
+        <source>Cannot save record to file %1</source>
+        <translation>无法录入文件 %1</translation>
     </message>
 </context>
 <context>
     <name>HWGame</name>
     <message>
+        <location filename="../../../../QTfrontend/game.cpp" line="350"/>
+        <location filename="../../../../QTfrontend/net/recorder.cpp" line="118"/>
         <source>en.txt</source>
         <translation>zh_CN.txt</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/game.cpp" line="361"/>
         <source>Cannot open demofile %1</source>
         <translation>DEMO %1 打不开</translation>
     </message>
@@ -234,89 +214,110 @@ Please pick another nickname:</source>
 <context>
     <name>HWMapContainer</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="82"/>
         <source>Map</source>
         <translation>地图</translation>
     </message>
     <message>
-        <source>Themes</source>
-        <translation>主题</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="99"/>
+        <source>Type</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Filter</source>
-        <translation>过滤</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="103"/>
+        <source>Small tunnels</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All</source>
-        <translation>全部</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="104"/>
+        <source>Medium tunnels</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Small</source>
-        <translation>小型</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="105"/>
+        <source>Large tunnels</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium</source>
-        <translation>中型</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="106"/>
+        <source>Small floating islands</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Large</source>
-        <translation>大型</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="107"/>
+        <source>Medium floating islands</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cavern</source>
-        <translation>æ´žç©´</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="108"/>
+        <source>Large floating islands</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Wacky</source>
-        <translation>险峻</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="118"/>
+        <source>Themes</source>
+        <translation>主题</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>类型</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="162"/>
+        <source>Seed</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Small tunnels</source>
-        <translation>小型隧道</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="555"/>
+        <source>Set</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium tunnels</source>
-        <translation>中型隧道</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="85"/>
+        <source>Filter</source>
+        <translation>过滤</translation>
     </message>
     <message>
-        <source>Large tunnels</source>
-        <translation>大型隧道</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="89"/>
+        <source>All</source>
+        <translation>全部</translation>
     </message>
     <message>
-        <source>Small floating islands</source>
-        <translation>小型漂浮岛屿</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="90"/>
+        <source>Small</source>
+        <translation>小型</translation>
     </message>
     <message>
-        <source>Medium floating islands</source>
-        <translation>中型漂浮岛屿</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="91"/>
+        <source>Medium</source>
+        <translation>中型</translation>
     </message>
     <message>
-        <source>Large floating islands</source>
-        <translation>大型漂浮岛屿</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="92"/>
+        <source>Large</source>
+        <translation>大型</translation>
     </message>
     <message>
-        <source>Seed</source>
-        <translation>作种</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="93"/>
+        <source>Cavern</source>
+        <translation>æ´žç©´</translation>
     </message>
     <message>
-        <source>Set</source>
-        <translation>设定</translation>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="94"/>
+        <source>Wacky</source>
+        <translation>曲折</translation>
     </message>
 </context>
 <context>
     <name>HWNetServersModel</name>
     <message>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="46"/>
         <source>Title</source>
-        <translation>名称</translation>
+        <translation>标题</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="48"/>
         <source>IP</source>
         <translation>IP</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/netserverslist.cpp" line="50"/>
         <source>Port</source>
         <translation>端口</translation>
     </message>
@@ -324,177 +325,227 @@ Please pick another nickname:</source>
 <context>
     <name>HWNewNet</name>
     <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="71"/>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="212"/>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="215"/>
         <source>The host was not found. Please check the host name and port settings.</source>
-        <translation>没找到主机。请检查主机名和端口设置。</translation>
+        <translation>错误没找到这个主机。请检查主机名和端口设置。</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="218"/>
         <source>Connection refused</source>
         <translation>连接被拒绝</translation>
     </message>
     <message>
-        <source>Quit reason: </source>
-        <translation>退出原因:</translation>
-    </message>
-    <message>
-        <source>Room destroyed</source>
-        <translation>房间损坏</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="276"/>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You got kicked</source>
-        <translation>被踢出</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="471"/>
+        <source>%1 *** %2 has joined</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">密码</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="518"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="739"/>
+        <source>%1 *** %2 has left</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">您的昵称%1
-在Hedgewars.org已注册
-请输入您的密码
-或选择另一个昵称:</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="520"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="741"/>
+        <source>%1 *** %2 has left (%3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="597"/>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="724"/>
         <source>%1 *** %2 has joined the room</source>
-        <translation>%1 *** %2 进入这个房间了</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>%1 *** %2 has joined</source>
-        <translation>%1 *** %2 加入了</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1285"/>
+        <source>Quit reason: </source>
+        <translation>退出原因:</translation>
     </message>
     <message>
-        <source>%1 *** %2 has left (%3)</source>
-        <translation>%1 *** %2 离开了(%3)</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="648"/>
+        <source>Room destroyed</source>
+        <translation>房间损坏</translation>
     </message>
     <message>
-        <source>%1 *** %2 has left</source>
-        <translation>%1 *** %2 离开了</translation>
+        <location filename="../../../../QTfrontend/net/newnetclient.cpp" line="447"/>
+        <source>You got kicked</source>
+        <translation>被踢出</translation>
     </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
     <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password below
-or pick another nickname in game config:</source>
-        <translation type="obsolete">您的昵称%1
-在Hedgewars.org已注册
-请输入您的密码
-或从游戏配置中选择另一个昵称:</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/input_password.cpp" line="30"/>
+        <source>Password</source>
+        <translation type="unfinished">密码</translation>
     </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">昵称</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="53"/>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="149"/>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>KB</name>
     <message>
+        <location filename="../../../../QTfrontend/KB.h" line="28"/>
         <source>SDL_ttf returned error while rendering text, most propably it is related to the bug in freetype2. It's recommended to update your freetype lib.</source>
-        <translation>渲染文字时SDL_ttf 返回错误,可能有关freetype2的bug。建议升级 freetype。</translation>
+        <translation>SDL_ttf 返回错误-渲染文字失败,可能有关freetype2的bug。建议升级 freetype。</translation>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">服务器信息:</translation>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="282"/>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">设定信息</translation>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="294"/>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Clear Accounts Cache</source>
-        <translation>清空账户缓存</translation>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="298"/>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/libav_iteraction.cpp" line="302"/>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="34"/>
         <source>Fetch data</source>
-        <translation>获取数据</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="38"/>
         <source>Server message for latest version:</source>
-        <translation>最新版本的服务器信息</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="46"/>
         <source>Server message for previous versions:</source>
-        <translation>之前版本的服务器信息</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="54"/>
         <source>Latest version protocol number:</source>
-        <translation>最新版本的通讯协议号码:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="62"/>
         <source>MOTD preview:</source>
-        <translation>MOTD预览:</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="71"/>
+        <source>Clear Accounts Cache</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageadmin.cpp" line="74"/>
         <source>Set data</source>
-        <translation>设定数据</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>PageConnecting</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageconnecting.cpp" line="29"/>
         <source>Connecting...</source>
         <translation>连接中...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">取消</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="32"/>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="34"/>
         <source>Undo</source>
-        <translation>取消</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="35"/>
         <source>Clear</source>
-        <translation>清除</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="36"/>
         <source>Load</source>
-        <translation>读取</translation>
+        <translation type="unfinished">读取</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="37"/>
         <source>Save</source>
-        <translation>保存</translation>
+        <translation type="unfinished">保存</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
         <source>Load drawn map</source>
-        <translation>读取已经绘制的地图</translation>
-    </message>
-    <message>
-        <source>Drawn Maps (*.hwmap);;All files (*.*)</source>
-        <translation type="obsolete">绘制的地图 (*.hwmap);;全部文件 (*.*)</translation>
-    </message>
-    <message>
-        <source>Save drawn map</source>
-        <translation>保存绘制的地图</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
         <source>Drawn Maps</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="61"/>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagedrawmap.cpp" line="69"/>
+        <source>Save drawn map</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="45"/>
         <source>General</source>
         <translation>常规</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="46"/>
         <source>Advanced</source>
         <translation>进阶</translation>
     </message>
@@ -502,1360 +553,1671 @@ or pick another nickname in game config:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>最佳射手奖给与 <b>%1</b>:伤害 <b>%2</b>点。</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>最佳杀手是 <b>%1</b>单回合击杀刺猬数:<b>%2</b></p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>本轮总共有<b>%1</b>只刺猬被击杀</p></numerusform>
-        </translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="56"/>
         <source>Details</source>
-        <translation>细节</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="70"/>
         <source>Health graph</source>
-        <translation>健康值图形</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="87"/>
         <source>Ranking</source>
-        <translation>排名</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="173"/>
         <source>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</source>
-        <translation>最佳射手<b>%1</b>为同族制造了<b>%2</b>点创伤</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="181"/>
         <source>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</source>
-        <translation>
-            <numerusform>最佳杀手<b>%1</b> 完成了单回合<b>%2</b>次击杀</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="188"/>
         <source>A total of <b>%1</b> hedgehog(s) were killed during this round.</source>
-        <translation>
-            <numerusform>总共<b>%1</b>只刺猬在本轮失去生命。</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="252"/>
         <source>(%1 kill)</source>
-        <translation>
-            <numerusform>(%1 击杀)</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
-    <message>
-        <source>(%1 kills)</source>
-        <translation type="obsolete">(%1 击杀)</translation>
-    </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="263"/>
         <source><b>%1</b> thought it's good to shoot his own hedgehogs with <b>%2</b> pts.</source>
-        <translation>
-            <numerusform><b>%1</b>以为给自己的刺猬造成 <b>%2</b> 点创伤是小意思。</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="271"/>
         <source><b>%1</b> killed <b>%2</b> of his own hedgehogs.</source>
-        <translation>
-            <numerusform><b>%1</b> 整垮了 <b>%2</b> 只自己的刺猬。</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagegamestats.cpp" line="279"/>
         <source><b>%1</b> was scared and skipped turn <b>%2</b> times.</source>
-        <translation>
-            <numerusform><b>%1</b> 受惊了,共计 <b>%2</b> 次放弃。</numerusform>
+        <translation type="unfinished">
+            <numerusform></numerusform>
         </translation>
     </message>
 </context>
 <context>
     <name>PageInGame</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageingame.cpp" line="29"/>
         <source>In game...</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
+    <name>PageInfo</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageinfo.cpp" line="44"/>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>PageMain</name>
     <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>单机游戏(在一台电脑上)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="45"/>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="46"/>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="50"/>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="51"/>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="58"/>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="63"/>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="67"/>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="69"/>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="89"/>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>网络游戏(通过网络)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="93"/>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="97"/>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="128"/>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
-        <translation>点击同色作为同一组的友军。控制权不分享,但是共同胜利/失败。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="129"/>
         <source>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</source>
         <comment>Tips</comment>
-        <translation>有些武器可能威力低下但是有毁灭性的效果。比如沙漠之鹰能把多个刺猬打入水中。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="130"/>
         <source>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</source>
         <comment>Tips</comment>
-        <translation>加入不确定怎么做,不要浪费弹药,跳过此回合。但是注意突然时间!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Want to save ropse? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="131"/>
+        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
         <comment>Tips</comment>
-        <translation type="obsolete">保存绳子?在半空释放然后再次射出。只要不接触地面停止就可以继续使用同一根不会浪费!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="132"/>
         <source>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</source>
         <comment>Tips</comment>
-        <translation>如果您确定好了一个昵称不想让别人使用,那么在  http://www.hedgewars.org/. 注册一个帐号吧</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="133"/>
         <source>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</source>
         <comment>Tips</comment>
-        <translation>厌倦了默认的玩法?试试任务——</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="134"/>
         <source>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</source>
         <comment>Tips</comment>
-        <translation>默认情况下游戏记录最后的游戏作为Demo,选择单机游戏——然后Demo——然后点击右下角开始回放或者整理。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="135"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you've got problems, ask on our forums but please don't expect 24/7 support!</source>
         <comment>Tips</comment>
-        <translation>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。如果您有问题,到论坛来吧,不过7×24小时支持不可能!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="136"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. If you like it, help us with a small donation or contribute your own work!</source>
         <comment>Tips</comment>
-        <translation>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。如果您喜欢它,我们接受您的捐赠/感谢!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="137"/>
         <source>Hedgewars is Open Source and Freeware we create in our spare time. Share it with your family and friends as you like!</source>
         <comment>Tips</comment>
-        <translation>刺猬大作战是一个开放源代码的免费软件,它充分利用了我们的业余时间。与他人分享它吧!</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="138"/>
+        <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="139"/>
         <source>From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.</source>
         <comment>Tips</comment>
-        <translation>官方的竞赛一直存在。临近时去  http://www.hedgewars.org/  即可看到。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="140"/>
         <source>Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!</source>
         <comment>Tips</comment>
-        <translation>Hedgewars 被翻译成多种语言,中文是刺猬大作战——同样为翻译名。如果您的语言翻译有什么缺失/过时/遗漏或任何问题,来联系我们吧!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="141"/>
         <source>Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and Linux.</source>
         <comment>Tips</comment>
-        <translation>刺猬大作战可以运行的操作系统包括:GNU/Linux、Mac OS X、MicroSoft Windows。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="142"/>
         <source>Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.</source>
         <comment>Tips</comment>
-        <translation>您可以建立自己的网络游戏/局域网游戏。不仅限于 "简单游戏" 选项。</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="143"/>
+        <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Create an account on http://www.hedgewars.org/ to keep others from using your most favourite nickname while playing on the official server.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="144"/>
+        <source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
         <comment>Tips</comment>
-        <translation type="obsolete">在官方服务器 http://www.hedgewars.org/ 建立自己的帐号——就能一直使用最喜欢的昵称</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="145"/>
         <source>While playing you should give yourself a short break at least once an hour.</source>
         <comment>Tips</comment>
-        <translation>最好玩一个小时就休息一下,如果你要继续用电脑。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="146"/>
         <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.</source>
         <comment>Tips</comment>
-        <translation>假如你的显卡不能提供OpenGL硬件加速,试着用降低效果的方式运行</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="147"/>
+        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
+        <comment>Tips</comment>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="148"/>
         <source>We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!</source>
         <comment>Tips</comment>
-        <translation>我们接受意见和建设性反馈。假如您有好电子或者不喜欢的东西,告诉我们!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="149"/>
         <source>Especially while playing online be polite and always remember there might be some minors playing with or against you as well!</source>
         <comment>Tips</comment>
-        <translation>特别是网络游戏,请有礼貌记住对方也和您一样是人!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="150"/>
         <source>Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!</source>
         <comment>Tips</comment>
-        <translation>特别游戏模式“吸血“、”因果报应“需要全新的战术。现在自定义游戏里试试!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgwars to its game list so your friends can see you playing.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="151"/>
+        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
         <comment>Tips</comment>
-        <translation type="obsolete">Windows版本的刺猬大作战支持Xfire。添加它到游戏列表里让您的朋友看到。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="152"/>
         <source>You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!</source>
         <comment>Tips</comment>
-        <translation>您不应该在不属于您的计算机上安装刺猬大作战——比如学校/工作场所。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="153"/>
         <source>Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.</source>
         <comment>Tips</comment>
-        <translation>刺猬大作战适合短时间休息,不需要太多刺猬挤在大地图上。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="154"/>
         <source>No hedgehogs were harmed in making this game.</source>
         <comment>Tips</comment>
-        <translation>制作这个游戏时不曾伤害任何刺猬</translation>
-    </message>
-    <message>
-        <source>Connect one or more gamepads before launching the game to be able to assign their controls to your teams.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">在运行游戏前连接游戏板</translation>
-    </message>
-    <message>
-        <source>Hedgewars is Open Source and Freeware we create in our spare time. If someone sold you the game, you should try get a refund!</source>
-        <comment>Tips</comment>
-        <translation>刺猬大作战是开放源代码的免费软件,用我们的闲暇时间创造。如果有人卖给你,那么应该把钱拿回来!</translation>
-    </message>
-    <message>
-        <source>Create an account on %1 to keep others from using your most favourite nickname while playing on the official server.</source>
-        <comment>Tips</comment>
-        <translation>在 %1 建立一个帐号阻止其他人使用你喜欢的名称在官方服务器游戏。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="155"/>
         <source>There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.</source>
         <comment>Tips</comment>
-        <translation>三种跳跃方式。点击[高跳]两次做出跳跃高度极限的后空翻。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="156"/>
         <source>Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.</source>
         <comment>Tips</comment>
-        <translation>害怕掉下悬崖?按住[精确]后再点击[左][右]就会只转身,不移动位置。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="157"/>
         <source>Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.</source>
         <comment>Tips</comment>
-        <translation>有些武器需要特殊策略或者仅仅是大量的练习,假如你一次失去准星,也不要放弃。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="158"/>
         <source>Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.</source>
         <comment>Tips</comment>
-        <translation>多数武器不会在接触水之后生效。归巢的蜜蜂和蛋糕是例外。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="159"/>
         <source>The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.</source>
         <comment>Tips</comment>
-        <translation>老干酪发射器造成小规模爆炸,然后产生随风移动的有毒云雾——能一次毒害多个刺猬。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="160"/>
         <source>The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.</source>
         <comment>Tips</comment>
-        <translation>钢琴攻击是最大威力的空袭。弹奏钢琴的刺猬会跟着钢琴返回天堂。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. It's turn radius depends on it's velocity, so try to not use full power.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="161"/>
+        <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
         <comment>Tips</comment>
-        <translation type="obsolete">归巢的蜜蜂有些技巧。它的回转半径和初速有关,最好不用全力发射。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="162"/>
         <source>Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.</source>
         <comment>Tips</comment>
-        <translation>黏着地雷是创造小范围连锁反应的绝佳武器。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="163"/>
         <source>The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.</source>
         <comment>Tips</comment>
-        <translation>锤是桥梁上/分界处最佳武器之一,只是刚刚好把刺猬打陷——如果没底就没办法了。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="164"/>
         <source>If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.</source>
         <comment>Tips</comment>
-        <translation>假如对方刺猬把你堵住了,一锤打下去让自己轻松些。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="165"/>
         <source>The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.</source>
         <comment>Tips</comment>
-        <translation>蛋糕的最大行走距离取决于地表。也可按下[攻击键]激活起爆。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="166"/>
         <source>The Flame Thrower is a weapon but it can be used for tunnel digging as well.</source>
         <comment>Tips</comment>
-        <translation>火焰喷射器是一种武器,也是一种开路机器。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the Incinerating Grenade to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="167"/>
+        <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
         <comment>Tips</comment>
-        <translation type="obsolete">燃烧瓶可以短时阻止刺猬通过特定区域(比如通道或平台)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="168"/>
         <source>Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.</source>
         <comment>Tips</comment>
-        <translation>想要知道谁是此游戏的幕后人员?点击主菜单的Hedgewars Logo就可以看到贡献者名单。</translation>
-    </message>
-    <message>
-        <source>Like hedgewars? Become a fan on %1 or join our group at %2. You could follow us on %3 as well!</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">喜欢刺猬大作战(hedgewars)?那么加入我们 %1 或者 %2.。你可以在 %3 跟随我们!</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>你可以在( 我的文档\Hedgewars)里找到设置文件。可以创建备份,但不要手动修改。</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under "Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation type="obsolete">你可以在家目录找到 .hedgewars。可以创建备份,但不要手动修改。</translation>
-    </message>
-    <message>
-        <source>Connect one or more gamepads before starting the game to be able to assign their controls to your teams.</source>
-        <comment>Tips</comment>
-        <translation>在游戏开始前连接游戏手柄才能用于操控</translation>
-    </message>
-    <message>
-        <source>If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.</source>
-        <comment>Tips</comment>
-        <translation>加入你的显卡不能使用OpenGL硬件加速,请升级相应驱动。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Like Hedgewars? Become a fan on %1 or join our group at %2. You could follow us on %3 as well!</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="169"/>
+        <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
         <comment>Tips</comment>
-        <translation type="obsolete">喜欢刺猬大作战(Hedgewars)吗?加入 %2 ,成为 %1 粉丝,也可以在  %3 跟随我们!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="170"/>
         <source>Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.</source>
         <comment>Tips</comment>
-        <translation>欢迎你自己绘制墓碑,帽子(头饰),旗帜或者地图,主题!但是记住,如果要在网上使用,你的必须把它们分享出来。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="171"/>
         <source>Really want to wear a specific hat? Donate to us and receive an exclusive hat of your choice!</source>
         <comment>Tips</comment>
-        <translation>非常想要一个帽子?捐赠的话就给你!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="175"/>
         <source>Keep your video card drivers up to date to avoid issues playing the game.</source>
         <comment>Tips</comment>
-        <translation>保持显卡驱动最新避免可能的麻烦。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="176"/>
         <source>You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.</source>
         <comment>Tips</comment>
-        <translation>你可以使用网络浏览器或已存在的文件关联刺猬大作战的相关文件(比如存档和回放)</translation>
-    </message>
-    <message>
-        <source>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</source>
-        <comment>Tips</comment>
-        <translation>想要节省绳子?放开绳子之后再次发射,只要你不曾脱离绳子接触接触地面就可以继续使用同一根!</translation>
-    </message>
-    <message>
-        <source>Like Hedgewars? Become a fan on %1 or follow us on %2!</source>
-        <comment>Tips</comment>
-        <translation>喜欢刺猬大作战Hedgewars吗?来 %1 或者 %2 追随我们吧!</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>在家目录的"Library/Application Support/Hedgewars"找到刺猬的配置文件。备份随你,但是不要手动编辑。</translation>
-    </message>
-    <message>
-        <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
-        <comment>Tips</comment>
-        <translation>在家目录的".hedgewars"找到刺猬的配置文件。备份随你,但是不要手动编辑。</translation>
-    </message>
-    <message>
-        <source>The Windows version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.</source>
-        <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="178"/>
+        <source>You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="180"/>
+        <source>You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
         <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Downloadable Content</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="182"/>
+        <source>You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.</source>
+        <comment>Tips</comment>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemultiplayer.cpp" line="55"/>
         <source>Start</source>
         <translation>开始</translation>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>请选择一个服务器</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
-        <source>Control</source>
-        <translation>房间管理</translation>
-    </message>
-    <message>
-        <source>Error</source>
-        <translation type="unfinished">错误</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="65"/>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">请键入房间名</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="66"/>
+        <source>Downloadable Content</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="87"/>
+        <source>Control</source>
+        <translation>Ctrl</translation>
     </message>
 </context>
 <context>
     <name>PageNetType</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="35"/>
         <source>LAN game</source>
         <translation>局域网游戏</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="36"/>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="37"/>
         <source>Official server</source>
         <translation>官方服务器</translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenettype.cpp" line="38"/>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="50"/>
+        <source>General</source>
+        <translation type="unfinished">常规</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="51"/>
+        <source>Advanced</source>
+        <translation type="unfinished">进阶</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="77"/>
         <source>New team</source>
         <translation>新队伍</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="85"/>
         <source>Edit team</source>
         <translation>修改队伍设定</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="93"/>
         <source>Delete team</source>
-        <translation>删除队伍</translation>
-    </message>
-    <message>
-        <source>New weapon scheme</source>
-        <translation type="obsolete">新武器配置</translation>
-    </message>
-    <message>
-        <source>Edit weapon scheme</source>
-        <translation type="obsolete">修改武器配置</translation>
-    </message>
-    <message>
-        <source>Delete weapon scheme</source>
-        <translation type="obsolete">删除武器配置</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="101"/>
         <source>You can't edit teams from team selection. Go back to main menu to add, edit or delete teams.</source>
-        <translation>您不能在队伍选择界面修改队伍。请返回主页面进行添加、修改、删除队伍等操作。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="127"/>
         <source>New scheme</source>
-        <translation>新框架</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="134"/>
         <source>Edit scheme</source>
-        <translation>修改框架</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="141"/>
         <source>Delete scheme</source>
-        <translation>删除框架</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="155"/>
         <source>New weapon set</source>
-        <translation>新武器配置</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="162"/>
         <source>Edit weapon set</source>
-        <translation>修改武器配置</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="169"/>
         <source>Delete weapon set</source>
-        <translation>删除武器配置</translation>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="405"/>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>确认</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="454"/>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>重命名对话框</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="455"/>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>输入新的文件名:</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="456"/>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>不能改变名字</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="457"/>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>不能删除文件</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="468"/>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>请从列表选择记录</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="469"/>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>建立</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="470"/>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>加入</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="471"/>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>Refresh</source>
-        <translation>刷新</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="137"/>
+        <source>Rename dialog</source>
+        <translation>重命名对话框</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>确认</translation>
-    </message>
-    <message>
-        <source>Admin features</source>
-        <translation>管理员功能</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="137"/>
+        <source>Enter new file name:</source>
+        <translation>输入新的文件名:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="44"/>
         <source>Room Name:</source>
-        <translation>房间名:</translation>
-    </message>
-    <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation>游戏正在大厅中。
-您可以加入等待游戏开始。</translation>
-    </message>
-    <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation>游戏正在进行中。
-您可以加入观战但必须等游戏结束才能参与游戏。</translation>
-    </message>
-    <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation>%1 是房主,他可以调整设置、开始游戏。</translation>
-    </message>
-    <message>
-        <source>Random Map</source>
-        <translation>随机地图</translation>
-    </message>
-    <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>游戏可以在预先创建或者随机产生的地图上进行。</translation>
-    </message>
-    <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation>游戏设置包括一般选项例如回合时间,突然死亡或吸血模式。</translation>
-    </message>
-    <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation>武器配置包括可以选用的武器和弹药数量。</translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
-        <translation>
-            <numerusform>有 %1 个客户端连接到这个房间。</numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation>
-            <numerusform>有 %1 个队伍加入这个房间。</numerusform>
-        </translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation>请键入房间名</translation>
-    </message>
-    <message>
-        <source>Please select room from the list</source>
-        <translation>请从列表选中房间</translation>
-    </message>
-    <message>
-        <source>Random Maze</source>
-        <translation>随机迷宫</translation>
-    </message>
-    <message>
-        <source>State:</source>
-        <translation type="obsolete">游戏状态</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="71"/>
         <source>Rules:</source>
-        <translation>规则</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="79"/>
         <source>Weapons:</source>
-        <translation>武器</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="87"/>
         <source>Search:</source>
-        <translation>搜索</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Clear</source>
-        <translation>清除</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="102"/>
+        <source>Create</source>
+        <translation>建立</translation>
     </message>
     <message>
-        <source>Warning</source>
-        <translation>警告</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="103"/>
+        <source>Join</source>
+        <translation>加入</translation>
     </message>
     <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation>你要加入的游戏已经开始了。
-还要进入房间吗?</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="104"/>
+        <source>Clear</source>
+        <translation type="unfinished"></translation>
     </message>
     <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="492"/>
         <source>%1 players online</source>
         <translation type="unfinished">
             <numerusform></numerusform>
         </translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="129"/>
+        <source>Admin features</source>
+        <translation>管理员功能</translation>
+    </message>
 </context>
 <context>
     <name>PageScheme</name>
     <message>
-        <source>New</source>
-        <translation>新模式</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>删除</translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="72"/>
         <source>Defend your fort and destroy the opponents, two team colours max!</source>
-        <translation>保卫你的城堡,破坏对手的,努力吧!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="77"/>
         <source>Teams will start on opposite sides of the terrain, two team colours max!</source>
-        <translation>队伍开始在对手的地盘,努力!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="82"/>
         <source>Land can not be destroyed!</source>
-        <translation>地面无法破坏!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">添加不可毁坏地边界</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="87"/>
+        <source>Add an indestructible border around the terrain</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="92"/>
         <source>Lower gravity</source>
-        <translation>低重力</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="97"/>
         <source>Assisted aiming with laser sight</source>
-        <translation>激光瞄准辅助</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="102"/>
         <source>All hogs have a personal forcefield</source>
-        <translation>每个刺猬都有一个力场</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">开启随机地雷</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="107"/>
+        <source>All (living) hedgehogs are fully restored at the end of turn</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="112"/>
         <source>Gain 80% of the damage you do back in health</source>
-        <translation>伤害的80%变成自身力量</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="117"/>
         <source>Share your opponents pain, share their damage</source>
-        <translation>分担你的对手的疼痛</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="122"/>
         <source>Your hogs are unable to move, put your artillery skills to the test</source>
-        <translation>你的刺猬不能移动,检验你射击技巧的时候到了</translation>
-    </message>
-    <message>
-        <source>Random</source>
-        <translation>随机</translation>
-    </message>
-    <message>
-        <source>Seconds</source>
-        <translation>秒钟</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="127"/>
         <source>Order of play is random instead of in room order.</source>
-        <translation>随机出场顺序</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="132"/>
         <source>Play with a King. If he dies, your side dies.</source>
-        <translation>国王不能死!!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="137"/>
         <source>Take turns placing your hedgehogs before the start of play.</source>
-        <translation>在开局前手动放置刺猬</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="142"/>
         <source>Ammo is shared between all teams that share a colour.</source>
-        <translation>同色队伍共享所有弹药。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="147"/>
         <source>Disable girders when generating random maps.</source>
-        <translation>禁止随机生成地图使用梁</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="152"/>
         <source>Disable land objects when generating random maps.</source>
-        <translation>禁止随机生成地图使用地面物体</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="157"/>
         <source>AI respawns on death.</source>
-        <translation>AI 死亡再生</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="162"/>
         <source>Attacking does not end your turn.</source>
-        <translation>攻击不会结束当前回合</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="167"/>
         <source>Weapons are reset to starting values each turn.</source>
-        <translation>每回合开始武器自动重置到默认设定</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="172"/>
         <source>Each hedgehog has its own ammo. It does not share with the team.</source>
-        <translation>每个刺猬都有独立的弹药,非团队分享</translation>
-    </message>
-    <message>
-        <source>All (living) hedgehogs are fully restored at the end of turn</source>
-        <translation>所有活着的刺猬回合结尾时彻底恢复健康。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="177"/>
         <source>You will not have to worry about wind anymore.</source>
-        <translation>不用担心风的影响了。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="182"/>
         <source>Wind will affect almost everything.</source>
-        <translation>风无所不在。</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Copy</source>
-        <translation>备份</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="187"/>
+        <source>Teams in each clan take successive turns sharing their turn time.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams in each clan take successive turns sharing their turn time.</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="192"/>
+        <source>Add an indestructible border along the bottom</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add an indestructible border around the terrain</source>
-        <translation>添加不可毁坏地边界</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="350"/>
+        <source>Random</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add an indestructible border along the bottom</source>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="351"/>
+        <source>Seconds</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageSelectWeapon</name>
     <message>
-        <source>Default</source>
-        <translation>默认</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="427"/>
+        <source>Copy</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="428"/>
+        <source>New</source>
+        <translation>新游戏</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="429"/>
         <source>Delete</source>
         <translation>删除</translation>
     </message>
+</context>
+<context>
+    <name>PageSelectWeapon</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageselectweapon.cpp" line="46"/>
         <source>New</source>
-        <translation>新模式</translation>
+        <translation type="unfinished">新游戏</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageselectweapon.cpp" line="47"/>
+        <source>Default</source>
+        <translation>默认</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageselectweapon.cpp" line="50"/>
         <source>Copy</source>
-        <translation>备份</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageselectweapon.cpp" line="51"/>
+        <source>Delete</source>
+        <translation>删除</translation>
     </message>
 </context>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>快速游戏 (使用预设对抗电脑)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="39"/>
+        <source>Simple Game</source>
+        <translation type="unfinished">简单游戏</translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>多人游戏 (热坐对抗朋友或AI)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="40"/>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">训练模式 (一系列训练任务)。开发中</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="44"/>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (观看记录的Demo)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="49"/>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="50"/>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>读取 (读取之前保存的游戏)</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="54"/>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...). IN DEVELOPMENT</source>
-        <translation type="obsolete">战役模式 ——开发中</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="55"/>
+        <source>Practice your skills in a range of training missions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="67"/>
+        <source>Watch recorded demos</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="70"/>
+        <source>Load</source>
+        <translation type="unfinished">读取</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="71"/>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="43"/>
+        <source>Multiplayer</source>
+        <translation type="unfinished">多人游戏</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagesingleplayer.cpp" line="66"/>
+        <source>Demos</source>
+        <translation type="unfinished">Demo</translation>
+    </message>
 </context>
 <context>
     <name>PageTraining</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="78"/>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="93"/>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="211"/>
         <source>No description available</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="219"/>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
+    <name>PageVideos</name>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="233"/>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="234"/>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="492"/>
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="736"/>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="740"/>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="741"/>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="955"/>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="957"/>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>QAction</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="252"/>
         <source>Kick</source>
         <translation>踢</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="82"/>
+        <source>Update</source>
+        <translation type="unfinished">æ›´æ–°</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="90"/>
         <source>Start</source>
         <translation>开始</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="112"/>
         <source>Restrict Joins</source>
         <translation>限制参与</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="114"/>
         <source>Restrict Team Additions</source>
         <translation>限制团队插件</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="248"/>
         <source>Info</source>
         <translation>信息</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="256"/>
         <source>Ban</source>
         <translation>屏蔽</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="260"/>
         <source>Follow</source>
-        <translation>跟随</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="264"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="865"/>
         <source>Ignore</source>
-        <translation>忽略</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="268"/>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="877"/>
         <source>Add friend</source>
-        <translation>添加朋友</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="860"/>
         <source>Unignore</source>
-        <translation>取消忽略</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/chatwidget.cpp" line="872"/>
         <source>Remove friend</source>
-        <translation>移除朋友</translation>
-    </message>
-    <message>
-        <source>Update</source>
-        <translation type="unfinished">æ›´æ–°</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QCheckBox</name>
     <message>
-        <source>Check for updates at startup</source>
-        <translation>启动时检查程序升级</translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="349"/>
         <source>Enable sound</source>
-        <translation>开启游戏音效</translation>
+        <translation>开启音效</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="291"/>
         <source>Fullscreen</source>
         <translation>游戏全屏幕</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="424"/>
         <source>Show FPS</source>
         <translation>显示帧率 (FPS)</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="365"/>
         <source>Alternative damage show</source>
         <translation>另一种伤害显示方式</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="241"/>
+        <source>Check for updates at startup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="265"/>
+        <source>Frontend effects</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="269"/>
+        <source>Enable frontend sounds</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="273"/>
+        <source>Enable frontend music</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="353"/>
         <source>Enable music</source>
-        <translation>开启游戏音乐</translation>
+        <translation>开启音乐</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="431"/>
+        <source>Show ammo menu tooltips</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="261"/>
         <source>Frontend fullscreen</source>
-        <translation>前端界面全屏幕</translation>
+        <translation>界面全屏幕</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="436"/>
         <source>Append date and time to record file name</source>
-        <translation>记录名称中包含具体时间和日期</translation>
+        <translation>记录名称中包含具体时间日期</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">降低显示效果</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/input_password.cpp" line="43"/>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="231"/>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show ammo menu tooltips</source>
-        <translation>显示武器菜单提示</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="95"/>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enable frontend sounds</source>
-        <translation>开启前端界面音效</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="131"/>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enable frontend music</source>
-        <translation>开启前端界面音乐</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="151"/>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Frontend effects</source>
-        <translation>前端界面效果</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="192"/>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QComboBox</name>
     <message>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="50"/>
         <source>generated map...</source>
         <translation>生成地图...</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="52"/>
+        <source>generated maze...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="54"/>
+        <source>hand drawn map...</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/MapModel.cpp" line="116"/>
+        <source>Mission</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="115"/>
         <source>Human</source>
         <translation>玩家</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="323"/>
+        <source>Community</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="119"/>
         <source>Level</source>
         <translation>Lv 级别</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="199"/>
         <source>(System default)</source>
-        <translation>(系统默认)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>generated maze...</source>
-        <translation>生成迷宫</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="312"/>
+        <source>Disabled</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Mission</source>
-        <translation>任务</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="313"/>
+        <source>Red/Cyan</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Community</source>
-        <translation>社区</translation>
-    </message>
-    <message>
-        <source>Any</source>
-        <translation>任意</translation>
-    </message>
-    <message>
-        <source>In lobby</source>
-        <translation>大厅中</translation>
-    </message>
-    <message>
-        <source>In progress</source>
-        <translation>进行中</translation>
-    </message>
-    <message>
-        <source>Default</source>
-        <translation type="obsolete">默认</translation>
-    </message>
-    <message>
-        <source>Pro mode</source>
-        <translation type="obsolete">高手模式</translation>
-    </message>
-    <message>
-        <source>Shoppa</source>
-        <translation type="obsolete">绳子党</translation>
-    </message>
-    <message>
-        <source>Basketball</source>
-        <translation type="obsolete">篮球</translation>
-    </message>
-    <message>
-        <source>Minefield</source>
-        <translation type="obsolete">雷区</translation>
-    </message>
-    <message>
-        <source>Barrel mayhem</source>
-        <translation type="obsolete">炼狱场</translation>
-    </message>
-    <message>
-        <source>Tunnel hogs</source>
-        <translation type="obsolete">刺猬洞</translation>
-    </message>
-    <message>
-        <source>Crazy</source>
-        <translation type="obsolete">疯狂刺猬</translation>
-    </message>
-    <message>
-        <source>hand drawn map...</source>
-        <translation>手绘地图</translation>
-    </message>
-    <message>
-        <source>Disabled</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Red/Cyan</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cyan/Red</source>
-        <translation type="unfinished"></translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="314"/>
+        <source>Cyan/Red</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="315"/>
         <source>Red/Blue</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="316"/>
         <source>Blue/Red</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="317"/>
         <source>Red/Green</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="318"/>
         <source>Green/Red</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="319"/>
         <source>Side-by-side</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="320"/>
         <source>Top-Bottom</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="321"/>
         <source>Wiggle</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="322"/>
         <source>Red/Cyan grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="323"/>
         <source>Cyan/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="324"/>
         <source>Red/Blue grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="325"/>
         <source>Blue/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="326"/>
         <source>Red/Green grayscale</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="327"/>
         <source>Green/Red grayscale</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="111"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="112"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="176"/>
+        <source>Any</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="113"/>
+        <source>In lobby</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="114"/>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QGroupBox</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="60"/>
         <source>Team Members</source>
         <translation>成员</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="89"/>
+        <source>Team Settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="143"/>
         <source>Fort</source>
         <translation>城堡模式</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="162"/>
         <source>Key binds</source>
         <translation>键位绑定</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="69"/>
         <source>Teams</source>
         <translation>队伍</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="116"/>
+        <source>Schemes and Weapons</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="184"/>
+        <source>Misc</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="253"/>
         <source>Audio/Graphic options</source>
         <translation>音频/视频选项</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="381"/>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="412"/>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="448"/>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/teamselect.cpp" line="253"/>
         <source>Playing teams</source>
         <translation>玩家队伍</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="40"/>
         <source>Net game</source>
-        <translation>局域网络游戏</translation>
-    </message>
-    <message>
-        <source>Weapons</source>
-        <translation type="obsolete">武器</translation>
+        <translation>网络游戏</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="48"/>
         <source>Game Modifiers</source>
         <translation>游戏修改</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="49"/>
         <source>Basic Settings</source>
         <translation>基本设置</translation>
     </message>
     <message>
-        <source>Team Settings</source>
-        <translation>队伍设定</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="120"/>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Misc</source>
-        <translation>杂项</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="230"/>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes and Weapons</source>
-        <translation>游戏框架和武器配置</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="265"/>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QLabel</name>
     <message>
-        <source>Net nick</source>
-        <translation>网络游戏昵称</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="189"/>
+        <source>Locale</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="221"/>
+        <source>Nickname</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="283"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="172"/>
         <source>Resolution</source>
         <translation>分辨率</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="295"/>
+        <source>Quality</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="308"/>
+        <source>Stereo rendering</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="418"/>
         <source>FPS limit</source>
         <translation>FPS 上限</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="55"/>
+        <source>This program is distributed under the GNU General Public License v2</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="70"/>
         <source>Developers:</source>
         <translation>开发者:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="90"/>
         <source>Art:</source>
         <translation>艺术:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="118"/>
         <source>Translations:</source>
         <translation>翻译:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="142"/>
         <source>Special thanks:</source>
         <translation>特别感谢:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetserver.cpp" line="51"/>
         <source>Server name:</source>
         <translation>服务器名:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetserver.cpp" line="58"/>
         <source>Server port:</source>
         <translation>服务器端口:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="32"/>
         <source>Host:</source>
         <translation>主机:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="36"/>
         <source>Port:</source>
         <translation>端口:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="148"/>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="86"/>
         <source>Weapons</source>
         <translation>武器</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="53"/>
         <source>Version</source>
         <translation>版本</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/about.cpp" line="108"/>
         <source>Sounds:</source>
         <translation>声音:</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="340"/>
         <source>Initial sound volume</source>
         <translation>初始音量</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="200"/>
         <source>Damage Modifier</source>
-        <translation>伤害修正值</translation>
+        <translation>伤害修改</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="214"/>
         <source>Turn Time</source>
         <translation>回合时间</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="228"/>
         <source>Initial Health</source>
         <translation>初始生命值</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="242"/>
         <source>Sudden Death Timeout</source>
         <translation>死亡模式倒计时</translation>
     </message>
     <message>
-        <source>Scheme Name:</source>
-        <translation>设置名称:</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="256"/>
+        <source>Sudden Death Water Rise</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Crate Drops</source>
-        <translation>箱子降落</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="270"/>
+        <source>Sudden Death Health Decrease</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Game scheme</source>
-        <translation>游戏设置</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="284"/>
+        <source>% Rope Length</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="311"/>
+        <source>% Health Crates</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="325"/>
+        <source>Health in Crates</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="339"/>
         <source>Mines Time</source>
-        <translation>布雷时间</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="355"/>
         <source>Mines</source>
-        <translation>地雷</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="369"/>
         <source>% Dud Mines</source>
-        <translation>% 地雷故障</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>名称</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="383"/>
+        <source>Explosives</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>类型</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="397"/>
+        <source>% Get Away Time</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Grave</source>
-        <translation>墓碑</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="411"/>
+        <source>Scheme Name:</source>
+        <translation>设置名称:</translation>
     </message>
     <message>
-        <source>Flag</source>
-        <translation>旗帜</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="298"/>
+        <source>Crate Drops</source>
+        <translation>箱子降落</translation>
     </message>
     <message>
-        <source>Voice</source>
-        <translation>声音</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="120"/>
+        <source>Game scheme</source>
+        <translation>游戏设置</translation>
     </message>
     <message>
-        <source>Locale</source>
-        <translation>Locale</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="38"/>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation>需要重新启动游戏方可应用</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="74"/>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Explosives</source>
-        <translation>爆炸物</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="80"/>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Tip: </source>
-        <translation>提示:</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="87"/>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
-        <translation>当前运行的为开发版本,不同其他版本兼容。功能或许损坏、不完整。请自行承担风险!</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="105"/>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality</source>
-        <translation>图像质量</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="114"/>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Sudden Death Water Rise</source>
-        <translation>死亡模式水位上涨</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="121"/>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Sudden Death Health Decrease</source>
-        <translation>死亡模式健康降低</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="93"/>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>% Rope Length</source>
-        <translation>% 绳长</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="96"/>
+        <source>Type</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>% Health Crates</source>
-        <translation>% 生命箱</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="99"/>
+        <source>Grave</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Health in Crates</source>
-        <translation>生命箱的值数</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="102"/>
+        <source>Flag</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Gameplay</source>
-        <translation type="obsolete">游戏</translation>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="105"/>
+        <source>Voice</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stereo rendering</source>
+        <location filename="../../../../QTfrontend/ui/page/pagefeedback.cpp" line="45"/>
+        <source>Summary   </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Style</source>
+        <location filename="../../../../QTfrontend/ui/page/pagefeedback.cpp" line="52"/>
+        <source>Description</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Scheme</source>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="116"/>
+        <source>Tip: </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">密码</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagemain.cpp" line="120"/>
+        <source>This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>% Get Away Time</source>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="125"/>
+        <source>Format</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License v2</source>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="142"/>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="163"/>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="197"/>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="208"/>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="55"/>
+        <source>Style</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="74"/>
+        <source>Scheme</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QLineEdit</name>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="882"/>
         <source>unnamed</source>
         <translation>无名</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/team.cpp" line="42"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="335"/>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="226"/>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
     <message>
+        <location filename="../../../../QTfrontend/ui_hwform.cpp" line="59"/>
         <source>Hedgewars %1</source>
         <translation>刺猬大作战 %1</translation>
     </message>
@@ -1863,352 +2225,659 @@ Do you still want to join the room?</source>
 <context>
     <name>QMessageBox</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="276"/>
         <source>Error</source>
         <translation>错误</translation>
     </message>
     <message>
-        <source>Failed to open data directory:
-%1
-Please check your installation</source>
-        <translation>打不开数据文件目录:
-%1
-请检查</translation>
+        <location filename="../../../../QTfrontend/ui/widget/gamecfgwidget.cpp" line="277"/>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Network</source>
-        <translation>网络</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="904"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="388"/>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection to server is lost</source>
-        <translation>与服务器的连接丢失</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="905"/>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="389"/>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>武器</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="921"/>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="525"/>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">不能删除默认武器设定</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="947"/>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>真的删除这个武器设定吗?</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1241"/>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">不能更改默认的武器设定</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1285"/>
+        <source>Connection to server is lost</source>
+        <translation>服务器连接丢失</translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
-        <translation>不能覆盖默认的武器配置 '%1'</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1392"/>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
-        <translation>所有相关文件已经设定。</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1692"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1783"/>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation>队伍</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1693"/>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
-        <translation>真的要删除队伍?</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1784"/>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
-        <translation>游戏框架</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1796"/>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1809"/>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
-        <translation>无法删除默认游戏框架 '%1'!</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1812"/>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1698"/>
         <source>File association failed.</source>
-        <translation>文件关联失败</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
-        <translation>真的删除此游戏框架?</translation>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1734"/>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
-        <translation>无法删除武器配置%1'!</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="232"/>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>错误</translation>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="234"/>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="240"/>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="302"/>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/dialog/upload_video.cpp" line="297"/>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/main.cpp" line="96"/>
+        <location filename="../../../../QTfrontend/main.cpp" line="212"/>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/main.cpp" line="97"/>
         <source>Cannot create directory %1</source>
-        <translation>无法创建路径 %1</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>确认</translation>
+        <location filename="../../../../QTfrontend/main.cpp" line="213"/>
+        <source>Failed to open data directory:
+%1
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="50"/>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="122"/>
+        <source>TCP - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="51"/>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="123"/>
+        <source>Unable to run engine at </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/net/tcpBase.cpp" line="124"/>
+        <source>Error code: %1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="113"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="162"/>
+        <source>Netgame - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="114"/>
+        <source>Please select a server from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="163"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="431"/>
+        <source>Please enter room name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="125"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="152"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="169"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="184"/>
+        <source>Record Play - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="126"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="170"/>
+        <source>Please select record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="153"/>
+        <source>Cannot rename to </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="185"/>
+        <source>Cannot delete file </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="430"/>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="445"/>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="446"/>
+        <source>Please select room from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="479"/>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageroomslist.cpp" line="480"/>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="524"/>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="533"/>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="534"/>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="844"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="868"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="1093"/>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="845"/>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="869"/>
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="1094"/>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="101"/>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="121"/>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="102"/>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/drawmapwidget.cpp" line="122"/>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="199"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="254"/>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="200"/>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="255"/>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="263"/>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="264"/>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1203"/>
         <source>Nickname</source>
-        <translation>昵称</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/hwform.cpp" line="1204"/>
         <source>Please enter your nickname</source>
-        <translation>请输入您的昵称</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>QPushButton</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagemultiplayer.cpp" line="40"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="51"/>
         <source>Setup</source>
         <translation>设置</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="45"/>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="87"/>
         <source>Play demo</source>
         <translation>播放 demo</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="49"/>
         <source>Connect</source>
         <translation>连接</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagecampaign.cpp" line="44"/>
+        <location filename="../../../../QTfrontend/ui/page/pagetraining.cpp" line="92"/>
         <source>Go!</source>
         <translation>上场!</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetserver.cpp" line="77"/>
         <source>Start</source>
         <translation>开始</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="73"/>
         <source>Start server</source>
         <translation>开始服务端</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="58"/>
         <source>Update</source>
         <translation>æ›´æ–°</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="93"/>
         <source>Load</source>
         <translation>读取</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenet.cpp" line="63"/>
         <source>Specify</source>
         <translation>指定</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="48"/>
+        <location filename="../../../../QTfrontend/ui/page/pagenetserver.cpp" line="67"/>
         <source>default</source>
         <translation>默认</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="49"/>
         <source>Rename</source>
         <translation>重命名</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="52"/>
         <source>OK</source>
         <translation>确定</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/input_ip.cpp" line="57"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="729"/>
         <source>Cancel</source>
         <translation>取消</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageplayrecord.cpp" line="53"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="300"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="729"/>
         <source>Delete</source>
         <translation>删除</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagenetgame.cpp" line="75"/>
         <source>Ready</source>
         <translation>准备好了</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/dialog/ask_quit.cpp" line="50"/>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pageeditteam.cpp" line="84"/>
         <source>Random Team</source>
-        <translation>随机分配队伍</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pageoptions.cpp" line="440"/>
         <source>Associate file extensions</source>
-        <translation>相关文件扩展</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="219"/>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="252"/>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="297"/>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="303"/>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="730"/>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/page/pagevideos.cpp" line="730"/>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/ui/widget/mapContainer.cpp" line="170"/>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QTableWidget</name>
+</context>
+<context>
+    <name>RoomsListModel</name>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="37"/>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="38"/>
         <source>Room Name</source>
-        <translation>房间名</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="39"/>
         <source>C</source>
-        <translation>人数限制</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="40"/>
         <source>T</source>
-        <translation>时间限制</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="41"/>
         <source>Owner</source>
-        <translation>创建者</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="42"/>
         <source>Map</source>
-        <translation>地图</translation>
+        <translation type="unfinished">地图</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="43"/>
         <source>Rules</source>
-        <translation>规则</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="44"/>
         <source>Weapons</source>
-        <translation>武器</translation>
+        <translation type="unfinished">武器</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="131"/>
+        <source>Random Map</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="132"/>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/model/roomslistmodel.cpp" line="133"/>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="119"/>
         <source>Weapon set</source>
-        <translation>武器设置</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="120"/>
         <source>Probabilities</source>
-        <translation>空中支援几率</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="121"/>
         <source>Ammo in boxes</source>
-        <translation>弹药箱</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="122"/>
         <source>Delays</source>
-        <translation>延迟回合数</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="277"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="282"/>
         <source>new</source>
-        <translation>æ–°</translation>
+        <translation type="unfinished">æ–°</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="313"/>
+        <location filename="../../../../QTfrontend/ui/widget/selectWeapon.cpp" line="318"/>
         <source>copy of</source>
-        <translation type="unfinished">备份</translation>
-    </message>
-</context>
-<context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>错误</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>无法开始服务端: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>无法运行引擎: %1 (</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>ToggleButtonWidget</name>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="71"/>
         <source>Fort Mode</source>
         <translation>城堡模式</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="76"/>
         <source>Divide Teams</source>
         <translation>团体行动</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="81"/>
         <source>Solid Land</source>
         <translation>固实地面</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="86"/>
         <source>Add Border</source>
         <translation>添加边界</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="91"/>
         <source>Low Gravity</source>
         <translation>低重力</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="96"/>
         <source>Laser Sight</source>
         <translation>激光瞄准</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="101"/>
         <source>Invulnerable</source>
         <translation>刀枪不入</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">布置地雷</translation>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="106"/>
+        <source>Reset Health</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="111"/>
         <source>Vampirism</source>
-        <translation>吸血鬼</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="116"/>
         <source>Karma</source>
-        <translation>因果报应</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="121"/>
         <source>Artillery</source>
-        <translation>射术</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="126"/>
         <source>Random Order</source>
-        <translation>随机顺序</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="131"/>
         <source>King</source>
-        <translation>国王模式</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="136"/>
         <source>Place Hedgehogs</source>
-        <translation>手动放置刺猬</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="141"/>
         <source>Clan Shares Ammo</source>
-        <translation>团队共享弹药</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="146"/>
         <source>Disable Girders</source>
-        <translation>禁止梁</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="151"/>
         <source>Disable Land Objects</source>
-        <translation>禁止地面物件</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="156"/>
         <source>AI Survival Mode</source>
-        <translation>AI生存模式</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="161"/>
         <source>Unlimited Attacks</source>
-        <translation>无限攻击</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="166"/>
         <source>Reset Weapons</source>
-        <translation>重置武器</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="171"/>
         <source>Per Hedgehog Ammo</source>
-        <translation>每个刺猬的弹药</translation>
-    </message>
-    <message>
-        <source>Reset Health</source>
-        <translation>重置生命值</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="176"/>
         <source>Disable Wind</source>
-        <translation>禁止风力作用</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="181"/>
         <source>More Wind</source>
-        <translation>让风来地更猛烈吧!</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="186"/>
         <source>Tag Team</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/ui/page/pagescheme.cpp" line="191"/>
         <source>Add Bottom Border</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2216,571 +2885,731 @@ Please check your installation</source>
 <context>
     <name>binds</name>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="23"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="50"/>
         <source>up</source>
         <translation>上</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="24"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="51"/>
         <source>left</source>
         <translation>å·¦</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="25"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="52"/>
         <source>right</source>
         <translation>右</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="26"/>
+        <location filename="../../../../QTfrontend/binds.cpp" line="53"/>
         <source>down</source>
         <translation>下</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="30"/>
         <source>attack</source>
         <translation>攻击</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="31"/>
         <source>put</source>
         <translation>放</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="32"/>
         <source>switch</source>
         <translation>切换</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="34"/>
         <source>slot 1</source>
         <translation>slot 1</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="35"/>
         <source>slot 2</source>
         <translation>slot 2</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="36"/>
         <source>slot 3</source>
         <translation>slot 3</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="37"/>
         <source>slot 4</source>
         <translation>slot 4</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="38"/>
         <source>slot 5</source>
         <translation>slot 5</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="39"/>
         <source>slot 6</source>
         <translation>slot 6</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="40"/>
         <source>slot 7</source>
         <translation>slot 7</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="41"/>
         <source>slot 8</source>
         <translation>slot 8</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="43"/>
+        <source>slot 10</source>
+        <translation type="unfinished">slot 10</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="44"/>
         <source>timer 1 sec</source>
         <translation>定时1秒</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="45"/>
         <source>timer 2 sec</source>
         <translation>定时2秒</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="46"/>
         <source>timer 3 sec</source>
         <translation>定时3秒</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="47"/>
         <source>timer 4 sec</source>
         <translation>定时4秒</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="48"/>
         <source>timer 5 sec</source>
         <translation>定时5秒</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="55"/>
+        <source>zoom in</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="56"/>
+        <source>zoom out</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="57"/>
+        <source>reset zoom</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="65"/>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
         <source>capture</source>
-        <translation>截取</translation>
+        <translation>夺取</translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="69"/>
+        <source>record</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="61"/>
         <source>quit</source>
         <translation>退出</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="49"/>
         <source>find hedgehog</source>
-        <translation>寻找刺猬</translation>
+        <translation>找到 刺猬</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="33"/>
         <source>ammo menu</source>
         <translation>弹药菜单</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="28"/>
+        <source>long jump</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="29"/>
+        <source>high jump</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="63"/>
         <source>volume down</source>
         <translation>降低音量</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="64"/>
         <source>volume up</source>
         <translation>提高音量</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
         <source>change mode</source>
         <translation>改变模式</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="60"/>
         <source>pause</source>
         <translation>暂停</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="42"/>
         <source>slot 9</source>
         <translation>slot 9</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="68"/>
         <source>hedgehogs
 info</source>
         <translation>刺猬大作战
 信息</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="58"/>
         <source>chat</source>
         <translation>聊天</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="59"/>
         <source>chat history</source>
         <translation>聊天记录</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="62"/>
         <source>confirmation</source>
         <translation>确认</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="27"/>
         <source>precise aim</source>
         <translation>练习瞄准</translation>
     </message>
-    <message>
-        <source>zoom in</source>
-        <translation>放大</translation>
-    </message>
-    <message>
-        <source>zoom out</source>
-        <translation>缩小</translation>
-    </message>
-    <message>
-        <source>reset zoom</source>
-        <translation>重置</translation>
-    </message>
-    <message>
-        <source>long jump</source>
-        <translation>远跳</translation>
-    </message>
-    <message>
-        <source>high jump</source>
-        <translation>高跳</translation>
-    </message>
-    <message>
-        <source>slot 10</source>
-        <translation>slot 10</translation>
-    </message>
 </context>
 <context>
     <name>binds (categories)</name>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="23"/>
         <source>Basic controls</source>
-        <translation>基本控制</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="33"/>
         <source>Weapon controls</source>
-        <translation>武器控制</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="49"/>
         <source>Camera and cursor controls</source>
-        <translation>镜头和光标控制</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="58"/>
         <source>Other</source>
-        <translation>其他</translation>
+        <translation type="unfinished">其他</translation>
     </message>
 </context>
 <context>
     <name>binds (descriptions)</name>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="23"/>
         <source>Move your hogs and aim:</source>
-        <translation>移动您的刺猬同时瞄准:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="28"/>
         <source>Traverse gaps and obstacles by jumping:</source>
-        <translation>使用跳跃越过沟渠、障碍:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="30"/>
         <source>Fire your selected weapon or trigger an utility item:</source>
-        <translation>使用选择的武器开火、使用物品:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="31"/>
         <source>Pick a weapon or a target location under the cursor:</source>
-        <translation>选取一个武器或者瞄准光标下的地点:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="32"/>
         <source>Switch your currently active hog (if possible):</source>
-        <translation>切换到您当前活动的刺猬(如果可用):</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="33"/>
         <source>Pick a weapon or utility item:</source>
-        <translation>选择一个武器或物品:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="44"/>
         <source>Set the timer on bombs and timed weapons:</source>
-        <translation>设置定时炸弹等武器起爆时间:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="49"/>
         <source>Move the camera to the active hog:</source>
-        <translation>移动镜头到选中的刺猬:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="50"/>
         <source>Move the cursor or camera without using the mouse:</source>
-        <translation>不用鼠标移动光标或镜头:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="55"/>
         <source>Modify the camera's zoom level:</source>
-        <translation>调整镜头放大倍数:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="58"/>
         <source>Talk to your team or all participants:</source>
-        <translation>同队友或全部参与者对话:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="60"/>
         <source>Pause, continue or leave your game:</source>
-        <translation>暂停、继续或离开游戏:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="63"/>
         <source>Modify the game's volume while playing:</source>
-        <translation>调整游戏时音量:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="66"/>
         <source>Toggle fullscreen mode:</source>
-        <translation>全屏模式:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="67"/>
         <source>Take a screenshot:</source>
-        <translation>截图:</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="68"/>
         <source>Toggle labels above hedgehogs:</source>
-        <translation>切换刺猬头顶标签的显示方式:</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/binds.cpp" line="69"/>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
     <name>binds (keys)</name>
     <message>
-        <source>Axis</source>
-        <translation>Axisè½´</translation>
-    </message>
-    <message>
-        <source>(Up)</source>
-        <translation>(上)</translation>
-    </message>
-    <message>
-        <source>(Down)</source>
-        <translation>(下)</translation>
-    </message>
-    <message>
-        <source>Hat</source>
-        <translation>帽子</translation>
-    </message>
-    <message>
-        <source>(Left)</source>
-        <translation>(å·¦)</translation>
-    </message>
-    <message>
-        <source>(Right)</source>
-        <translation>(右)</translation>
-    </message>
-    <message>
-        <source>Button</source>
-        <translation>按键</translation>
-    </message>
-    <message>
-        <source>Keyboard</source>
-        <translation>键盘</translation>
-    </message>
-    <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="21"/>
         <source>Mouse: Left button</source>
-        <translation>鼠标:左键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="22"/>
         <source>Mouse: Middle button</source>
-        <translation>鼠标:中键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="23"/>
         <source>Mouse: Right button</source>
-        <translation>鼠标:右键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="24"/>
         <source>Mouse: Wheel up</source>
-        <translation>鼠标滚轮:向上</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="25"/>
         <source>Mouse: Wheel down</source>
-        <translation>鼠标滚轮:向下</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="26"/>
         <source>Backspace</source>
-        <translation>退格键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="27"/>
         <source>Tab</source>
-        <translation>Tab</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="28"/>
         <source>Clear</source>
-        <translation>Num Lock / Clear</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="29"/>
         <source>Return</source>
-        <translation>回车</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="30"/>
         <source>Pause</source>
-        <translation>暂停键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="31"/>
         <source>Escape</source>
-        <translation>ESC键(退出键)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="32"/>
         <source>Space</source>
-        <translation>空格键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="96"/>
         <source>Delete</source>
-        <translation>Del(删除键)</translation>
+        <translation type="unfinished">删除</translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="97"/>
         <source>Numpad 0</source>
-        <translation>小键盘0</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="98"/>
         <source>Numpad 1</source>
-        <translation>小键盘1</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="99"/>
         <source>Numpad 2</source>
-        <translation>小键盘2</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="100"/>
         <source>Numpad 3</source>
-        <translation>小键盘3</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="101"/>
         <source>Numpad 4</source>
-        <translation>小键盘4</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="102"/>
         <source>Numpad 5</source>
-        <translation>小键盘5</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="103"/>
         <source>Numpad 6</source>
-        <translation>小键盘6</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="104"/>
         <source>Numpad 7</source>
-        <translation>小键盘7</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="105"/>
         <source>Numpad 8</source>
-        <translation>小键盘8</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="106"/>
         <source>Numpad 9</source>
-        <translation>小键盘9</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="107"/>
         <source>Numpad .</source>
-        <translation>小键盘.</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="108"/>
         <source>Numpad /</source>
-        <translation>小键盘/</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="109"/>
         <source>Numpad *</source>
-        <translation>小键盘*</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="110"/>
         <source>Numpad -</source>
-        <translation>小键盘-</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="111"/>
         <source>Numpad +</source>
-        <translation>小键盘+</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="112"/>
         <source>Enter</source>
-        <translation>回车键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="113"/>
         <source>Equals</source>
-        <translation>等于</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="114"/>
         <source>Up</source>
-        <translation>上</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="115"/>
         <source>Down</source>
-        <translation>下</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="116"/>
         <source>Right</source>
-        <translation>右</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="117"/>
         <source>Left</source>
-        <translation>å·¦</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="118"/>
         <source>Insert</source>
-        <translation>插入键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="119"/>
         <source>Home</source>
-        <translation>Homeé”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="120"/>
         <source>End</source>
-        <translation>Endé”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="121"/>
         <source>Page up</source>
-        <translation>向上翻页键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="122"/>
         <source>Page down</source>
-        <translation>向下翻页键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="138"/>
         <source>Num lock</source>
-        <translation>小键盘数字锁</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="139"/>
         <source>Caps lock</source>
-        <translation>大小写切换键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="140"/>
         <source>Scroll lock</source>
-        <translation>Scroll Locké”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="141"/>
         <source>Right shift</source>
-        <translation>右Shift键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="142"/>
         <source>Left shift</source>
-        <translation>å·¦Shifté”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="143"/>
         <source>Right ctrl</source>
-        <translation>右Ctrl键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="144"/>
         <source>Left ctrl</source>
-        <translation>å·¦Ctrlé”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="145"/>
         <source>Right alt</source>
-        <translation>右Alt键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="146"/>
         <source>Left alt</source>
-        <translation>å·¦Alté”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="147"/>
         <source>Right meta</source>
-        <translation>右meta键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="148"/>
         <source>Left meta</source>
-        <translation>å·¦metaé”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="155"/>
         <source>A button</source>
-        <translation>A é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="156"/>
         <source>B button</source>
-        <translation>B é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="157"/>
         <source>X button</source>
-        <translation>X é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="158"/>
         <source>Y button</source>
-        <translation>Y é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="159"/>
         <source>LB button</source>
-        <translation>LB é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="160"/>
         <source>RB button</source>
-        <translation>RB é”®</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="161"/>
         <source>Back button</source>
-        <translation>返回键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="162"/>
         <source>Start button</source>
-        <translation>开始键</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="163"/>
         <source>Left stick</source>
-        <translation>左摇杆</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="164"/>
         <source>Right stick</source>
-        <translation>右摇杆</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="171"/>
         <source>Left stick (Right)</source>
-        <translation>右(左摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="172"/>
         <source>Left stick (Left)</source>
-        <translation>左(左摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="173"/>
         <source>Left stick (Down)</source>
-        <translation>下(左摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="174"/>
         <source>Left stick (Up)</source>
-        <translation>上(左摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="175"/>
         <source>Left trigger</source>
-        <translation>左制动</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="176"/>
         <source>Right trigger</source>
-        <translation>右制动</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="177"/>
         <source>Right stick (Down)</source>
-        <translation>下(右摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="178"/>
         <source>Right stick (Up)</source>
-        <translation>上(右摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="179"/>
         <source>Right stick (Right)</source>
-        <translation>右(右摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="180"/>
         <source>Right stick (Left)</source>
-        <translation>左(右摇杆)</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <location filename="../../../../QTfrontend/sdlkeys.h" line="182"/>
         <source>DPad</source>
-        <translation>DPad板</translation>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/DataManager.cpp" line="193"/>
+        <source>Keyboard</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="129"/>
+        <source>Axis</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="133"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="148"/>
+        <source>(Up)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="137"/>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="152"/>
+        <source>(Down)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="144"/>
+        <source>Hat</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="156"/>
+        <source>(Left)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="160"/>
+        <source>(Right)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../../QTfrontend/util/SDLInteraction.cpp" line="168"/>
+        <source>Button</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 </TS>
diff --git a/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts b/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
index 8cb6e0b..fdb50c6 100644
--- a/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
+++ b/share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
@@ -2,28 +2,20 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="zh_TW">
 <context>
-    <name>AmmoSchemeModel</name>
-    <message>
-        <source>new</source>
-        <translation>æ–°</translation>
-    </message>
+    <name>AbstractPage</name>
     <message>
-        <source>copy of</source>
+        <source>Go back</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>DrawMapWidget</name>
-    <message>
-        <source>File error</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>AmmoSchemeModel</name>
     <message>
-        <source>Cannot open file '%1' for writing</source>
-        <translation type="unfinished"></translation>
+        <source>new</source>
+        <translation>æ–°</translation>
     </message>
     <message>
-        <source>Cannot read file '%1'</source>
+        <source>copy of</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -47,14 +39,6 @@
         <translation type="unfinished">改變武器設置</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>Illegal ammo scheme</source>
-        <translation>無法使用此彈藥設置</translation>
-    </message>
-    <message>
         <source>Edit schemes</source>
         <translation type="unfinished">修改遊戲設置</translation>
     </message>
@@ -68,6 +52,13 @@
     </message>
 </context>
 <context>
+    <name>HWAskQuitDialog</name>
+    <message>
+        <source>Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>HWChatWidget</name>
     <message>
         <source>%1 has been removed from your ignore list</source>
@@ -113,38 +104,14 @@
         <source>%1 is not a valid command!</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Kicking %1 ...</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>HWForm</name>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>確認</translation>
-    </message>
-    <message>
         <source>Cannot save record to file %1</source>
         <translation>無法錄入檔 %1</translation>
     </message>
     <message>
-        <source>Unable to start the server</source>
-        <translation>開啟服務端出現錯誤</translation>
-    </message>
-    <message>
-        <source>new</source>
-        <translation type="obsolete">æ–°</translation>
-    </message>
-    <message>
-        <source>Please select record from the list above</source>
-        <translation>請選擇一個記錄</translation>
-    </message>
-    <message>
         <source>DefaultTeam</source>
         <translation type="unfinished"></translation>
     </message>
@@ -171,10 +138,6 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">密碼</translation>
-    </message>
-    <message>
         <source>Your nickname %1 is
 registered on Hedgewars.org
 Please provide your password below
@@ -190,14 +153,12 @@ or pick another nickname in game config:</source>
         <translation type="unfinished">匿稱</translation>
     </message>
     <message>
-        <source>Some one already uses
- your nickname %1
-on the server.
-Please pick another nickname:</source>
+        <source>No nickname supplied.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No nickname supplied.</source>
+        <source>Someone already uses your nickname %1 on the server.
+Please pick another nickname:</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -325,20 +286,6 @@ Please pick another nickname:</source>
         <translation>被踢出</translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="obsolete">密碼</translation>
-    </message>
-    <message>
-        <source>Your nickname %1 is
-registered on Hedgewars.org
-Please provide your password
-or pick another nickname:</source>
-        <translation type="obsolete">您的匿稱%1
-在Hedgewars.org已註冊
-請輸入您的密碼
-或選擇另一個匿稱:</translation>
-    </message>
-    <message>
         <source>%1 *** %2 has joined the room</source>
         <translation>%1***%2已經進入房間</translation>
     </message>
@@ -355,11 +302,33 @@ or pick another nickname:</source>
         <translation>%1***%2已經離開</translation>
     </message>
     <message>
-        <source>Nickname</source>
-        <translation type="obsolete">匿稱</translation>
+        <source>User quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User quit</source>
+        <source>Remote host has closed connection</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The server is too old. Disconnecting now.</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HWPasswordDialog</name>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">密碼</translation>
+    </message>
+</context>
+<context>
+    <name>HWUploadVideoDialog</name>
+    <message>
+        <source>Upload video</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -371,15 +340,27 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageAdmin</name>
+    <name>LibavIteraction</name>
+    <message>
+        <source>Duration: %1m %2s
+</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Server message:</source>
-        <translation type="obsolete">伺服器資訊:</translation>
+        <source>Video: %1x%2, </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>%1 fps, </source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Set message</source>
-        <translation type="obsolete">設定信息</translation>
+        <source>Audio: </source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageAdmin</name>
     <message>
         <source>Clear Accounts Cache</source>
         <translation>清空帳戶緩存</translation>
@@ -415,10 +396,6 @@ or pick another nickname:</source>
         <source>Connecting...</source>
         <translation>連接中...</translation>
     </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="obsolete">取消</translation>
-    </message>
 </context>
 <context>
     <name>PageDrawMap</name>
@@ -454,6 +431,10 @@ or pick another nickname:</source>
         <source>All files</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Eraser</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageEditTeam</name>
@@ -469,22 +450,6 @@ or pick another nickname:</source>
 <context>
     <name>PageGameStats</name>
     <message>
-        <source><p>The best shot award was won by <b>%1</b> with <b>%2</b> pts.</p></source>
-        <translation type="obsolete"><p>最佳射手是<b>%1</b>。傷害 <b>%2</b>點。</p></translation>
-    </message>
-    <message numerus="yes">
-        <source><p>The best killer is <b>%1</b> with <b>%2</b> kills in a turn.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>最佳殺手是<b>%1</b>单回合擊殺刺蝟數<b>%2</b></p></numerusform>
-        </translation>
-    </message>
-    <message numerus="yes">
-        <source><p>A total of <b>%1</b> hedgehog(s) were killed during this round.</p></source>
-        <translation type="obsolete">
-            <numerusform><p>本輪總共有<b>%1</b>只刺蝟被擊殺</p></numerusform>
-        </translation>
-    </message>
-    <message>
         <source>Details</source>
         <translation type="unfinished"></translation>
     </message>
@@ -545,15 +510,14 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageMain</name>
-    <message>
-        <source>Local Game (Play a game on a single computer)</source>
-        <translation>本地遊戲(在一台電腦上)</translation>
-    </message>
+    <name>PageInfo</name>
     <message>
-        <source>Network Game (Play a game across a network)</source>
-        <translation>網路遊戲(通過網路)</translation>
+        <source>Open the snapshot folder</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PageMain</name>
     <message>
         <source>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</source>
         <comment>Tips</comment>
@@ -803,6 +767,46 @@ or pick another nickname:</source>
         <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Local Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game on a single computer</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Network Game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play a game across a network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Read about who is behind the Hedgewars Project</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Access the user created content downloadable from our website</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Exit game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Manage videos recorded from game</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Edit game preferences</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageMultiplayer</name>
@@ -812,32 +816,17 @@ or pick another nickname:</source>
     </message>
 </context>
 <context>
-    <name>PageNet</name>
-    <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>Please select server from the list above</source>
-        <translation>請選擇一個伺服器</translation>
-    </message>
-</context>
-<context>
     <name>PageNetGame</name>
     <message>
         <source>Control</source>
         <translation>房間管理</translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation type="unfinished">錯誤</translation>
-    </message>
-    <message>
-        <source>Please enter room name</source>
-        <translation type="unfinished">請鍵入房間名</translation>
+        <source>DLC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
+        <source>Downloadable Content</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -851,6 +840,14 @@ or pick another nickname:</source>
         <source>Official server</source>
         <translation>官方伺服器</translation>
     </message>
+    <message>
+        <source>Join hundreds of players online!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Join or host your own game server in a Local Area Network.</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>PageOptions</name>
@@ -894,181 +891,124 @@ or pick another nickname:</source>
         <source>Delete weapon set</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PagePlayDemo</name>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
+        <source>General</source>
+        <translation type="unfinished">常規</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>確認</translation>
+        <source>Advanced</source>
+        <translation type="unfinished">進階</translation>
     </message>
     <message>
-        <source>Rename dialog</source>
-        <translation>重命名對話方塊</translation>
+        <source>Reset to default colors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter new file name:</source>
-        <translation>輸入新的檔案名:</translation>
+        <source>Proxy host</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot rename to</source>
-        <translation>不能改變名字</translation>
+        <source>Proxy port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot delete file</source>
-        <translation>不能刪除檔</translation>
+        <source>Proxy login</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please select record from the list</source>
-        <translation>請從清單選擇記錄</translation>
+        <source>Proxy password</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>PageRoomsList</name>
     <message>
-        <source>Create</source>
-        <translation>建立</translation>
+        <source>No proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Join</source>
-        <translation>加入</translation>
+        <source>Socks5 proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Refresh</source>
-        <translation>刷新</translation>
+        <source>HTTP proxy</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
+        <source>System proxy settings</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>PagePlayDemo</name>
     <message>
-        <source>OK</source>
-        <translation>確認</translation>
+        <source>Rename dialog</source>
+        <translation>重命名對話方塊</translation>
     </message>
     <message>
-        <source>Admin features</source>
-        <translation>管理員功能</translation>
+        <source>Enter new file name:</source>
+        <translation>輸入新的檔案名:</translation>
     </message>
+</context>
+<context>
+    <name>PageRoomsList</name>
     <message>
-        <source>Room Name:</source>
-        <translation type="unfinished">房間名:</translation>
+        <source>Create</source>
+        <translation>建立</translation>
     </message>
     <message>
-        <source>This game is in lobby.
-You may join and start playing once the game starts.</source>
-        <translation type="unfinished">遊戲正在等待中。
-您可以加入等待遊戲開始。</translation>
+        <source>Join</source>
+        <translation>加入</translation>
     </message>
     <message>
-        <source>This game is in progress.
-You may join and spectate now but you'll have to wait for the game to end to start playing.</source>
-        <translation type="unfinished">遊戲正在進行中。
-您可以加入觀戰但必須等遊戲結束才能參與遊戲。</translation>
+        <source>Admin features</source>
+        <translation>管理員功能</translation>
     </message>
     <message>
-        <source>%1 is the host. He may adjust settings and start the game.</source>
-        <translation type="unfinished">%1是房主,他可以調整設置、開始遊戲。</translation>
+        <source>Room Name:</source>
+        <translation type="unfinished">房間名:</translation>
     </message>
     <message>
-        <source>Random Map</source>
-        <translation type="unfinished">隨機地圖</translation>
+        <source>Rules:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Games may be played on precreated or randomized maps.</source>
-        <translation>遊戲可以在預先創建或者隨機產生的地圖上進行。</translation>
+        <source>Weapons:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Game Scheme defines general options and preferences like Round Time, Sudden Death or Vampirism.</source>
-        <translation type="unfinished">遊戲設置包括一般選項例如回合時間,突然死亡或吸血模式。</translation>
+        <source>Search:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The Weapon Scheme defines available weapons and their ammunition count.</source>
-        <translation type="unfinished">武器設置包括可以選用的武器和彈藥數量。</translation>
+        <source>Clear</source>
+        <translation type="unfinished">清除</translation>
     </message>
     <message numerus="yes">
-        <source>There are %1 clients connected to this room.</source>
+        <source>%1 players online</source>
         <translation type="unfinished">
-            <numerusform>有%1個用戶端連接到這個房間。</numerusform>
+            <numerusform></numerusform>
         </translation>
     </message>
-    <message numerus="yes">
-        <source>There are %1 teams participating in this room.</source>
-        <translation type="unfinished">
-            <numerusform>有%1個隊伍加入這個房間。</numerusform>
-        </translation>
+</context>
+<context>
+    <name>PageScheme</name>
+    <message>
+        <source>New</source>
+        <translation>新模式</translation>
     </message>
     <message>
-        <source>Please enter room name</source>
-        <translation>請鍵入房間名</translation>
+        <source>Delete</source>
+        <translation>刪除</translation>
     </message>
     <message>
-        <source>Please select room from the list</source>
-        <translation>請從列表選中房間</translation>
+        <source>Gain 80% of the damage you do back in health</source>
+        <translation>傷害的80%變成自身力量</translation>
     </message>
     <message>
-        <source>Random Maze</source>
-        <translation type="unfinished"></translation>
+        <source>Share your opponents pain, share their damage</source>
+        <translation>分擔你的對手的疼痛</translation>
     </message>
     <message>
-        <source>Rules:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Weapons:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Search:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Clear</source>
-        <translation type="unfinished">清除</translation>
-    </message>
-    <message>
-        <source>Warning</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>The game you are trying to join has started.
-Do you still want to join the room?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message numerus="yes">
-        <source>%1 players online</source>
-        <translation type="unfinished">
-            <numerusform></numerusform>
-        </translation>
-    </message>
-</context>
-<context>
-    <name>PageScheme</name>
-    <message>
-        <source>New</source>
-        <translation>新模式</translation>
-    </message>
-    <message>
-        <source>Delete</source>
-        <translation>刪除</translation>
-    </message>
-    <message>
-        <source>Enable random mines</source>
-        <translation type="obsolete">開啟隨機地雷</translation>
-    </message>
-    <message>
-        <source>Gain 80% of the damage you do back in health</source>
-        <translation>傷害的80%變成自身力量</translation>
-    </message>
-    <message>
-        <source>Share your opponents pain, share their damage</source>
-        <translation>分擔你的對手的疼痛</translation>
-    </message>
-    <message>
-        <source>Your hogs are unable to move, put your artillery skills to the test</source>
-        <translation>你的刺蝟不能移動,檢驗你射擊技巧的時候到了</translation>
+        <source>Your hogs are unable to move, put your artillery skills to the test</source>
+        <translation>你的刺蝟不能移動,檢驗你射擊技巧的時候到了</translation>
     </message>
     <message>
         <source>Random</source>
@@ -1091,10 +1031,6 @@ Do you still want to join the room?</source>
         <translation>地面無法破壞!</translation>
     </message>
     <message>
-        <source>Add an indestructable border around the terrain</source>
-        <translation type="obsolete">添加不可毀壞地邊界</translation>
-    </message>
-    <message>
         <source>Lower gravity</source>
         <translation>低重力</translation>
     </message>
@@ -1197,31 +1133,47 @@ Do you still want to join the room?</source>
 <context>
     <name>PageSinglePlayer</name>
     <message>
-        <source>Simple Game (a quick game against the computer, settings are chosen for you)</source>
-        <translation>快速遊戲 (對抗電腦,固定設置)</translation>
+        <source>Simple Game</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Multiplayer (play a hotseat game against your friends, or AI teams)</source>
-        <translation>多人遊戲 (熱坐對抗朋友或AI)</translation>
+        <source>Play a quick game against the computer with random settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions). IN DEVELOPMENT</source>
-        <translation type="obsolete">訓練模式 (一系列訓練任務)。開發中</translation>
+        <source>Multiplayer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demos (Watch recorded demos)</source>
-        <translation>Demo (觀看記錄的Demo)</translation>
+        <source>Play a hotseat game against your friends, or AI teams</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Load (Load a previously saved game)</source>
-        <translation>讀取 (讀取之前保存的遊戲)</translation>
+        <source>Campaign Mode</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Training Mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Campaign Mode (...)</source>
+        <source>Practice your skills in a range of training missions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Training Mode (Practice your skills in a range of training missions)</source>
+        <source>Demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Watch recorded demos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Load</source>
+        <translation type="unfinished">讀取</translation>
+    </message>
+    <message>
+        <source>Load a previously saved game</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -1235,6 +1187,51 @@ Do you still want to join the room?</source>
         <source>Select a mission!</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Pick the mission or training to play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Start fighting</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>PageVideos</name>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>%1 bytes</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>(in progress...)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Date: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Size: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>encoding</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QAction</name>
@@ -1322,10 +1319,6 @@ Do you still want to join the room?</source>
         <translation>啟動時檢查程式升級</translation>
     </message>
     <message>
-        <source>Reduced quality</source>
-        <translation type="obsolete">降低顯示效果</translation>
-    </message>
-    <message>
         <source>Show ammo menu tooltips</source>
         <translation type="unfinished">顯示武器提示訊息</translation>
     </message>
@@ -1341,6 +1334,26 @@ Do you still want to join the room?</source>
         <source>Frontend effects</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Save password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Save account name and password</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video is private</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Record audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Use game resolution</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QComboBox</name>
@@ -1385,10 +1398,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Default</source>
-        <translation type="obsolete">默認</translation>
-    </message>
-    <message>
         <source>hand drawn map...</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1488,10 +1497,6 @@ Do you still want to join the room?</source>
         <translation>網路遊戲</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation type="obsolete">武器</translation>
-    </message>
-    <message>
         <source>Game Modifiers</source>
         <translation>遊戲修改</translation>
     </message>
@@ -1511,18 +1516,34 @@ Do you still want to join the room?</source>
         <source>Schemes and Weapons</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QLabel</name>
     <message>
-        <source>Net nick</source>
-        <translation>網路遊戲昵稱</translation>
+        <source>Custom colors</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Miscellaneous</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This program is distributed under the GNU General Public License</source>
-        <translation type="obsolete">This program is distributed under the GNU General Public License</translation>
+        <source>Video recording options</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Videos</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Proxy settings</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QLabel</name>
+    <message>
         <source>Resolution</source>
         <translation>解析度</translation>
     </message>
@@ -1643,10 +1664,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Restart game to apply</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
         <source>Explosives</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1695,10 +1712,6 @@ Do you still want to join the room?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Password</source>
-        <translation type="unfinished">密碼</translation>
-    </message>
-    <message>
         <source>% Get Away Time</source>
         <translation type="unfinished"></translation>
     </message>
@@ -1706,6 +1719,68 @@ Do you still want to join the room?</source>
         <source>This program is distributed under the GNU General Public License v2</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>There are videos that are currently being processed.
+Exiting now will abort them.
+Do you really want to quit?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Account name (or email): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Password: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video title: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video description: </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Tags (comma separated): </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Summary   </source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Description</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Nickname</source>
+        <translation type="unfinished">匿稱</translation>
+    </message>
+    <message>
+        <source>Format</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Audio codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Video codec</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Framerate</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Bitrate (Kbps)</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QLineEdit</name>
@@ -1717,6 +1792,10 @@ Do you still want to join the room?</source>
         <source>hedgehog %1</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>anonymous</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>QMainWindow</name>
@@ -1732,89 +1811,225 @@ Do you still want to join the room?</source>
         <translation>錯誤</translation>
     </message>
     <message>
-        <source>Network</source>
-        <translation>網路</translation>
-    </message>
-    <message>
         <source>Connection to server is lost</source>
         <translation>伺服器連接丟失</translation>
     </message>
     <message>
-        <source>Weapons</source>
-        <translation>武器</translation>
+        <source>File association failed.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Please fill out all fields</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while authenticating at google.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Login or password is incorrect</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error while sending metadata to youtube.com:
+</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Teams - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set</source>
-        <translation type="obsolete">不能刪除默認武器設定</translation>
+        <source>Do you really want to delete the team '%1'?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this weapon set?</source>
-        <translation>真的刪除這個武器設定嗎?</translation>
+        <source>Cannot delete default scheme '%1'!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not edit default weapon set</source>
-        <translation type="obsolete">不能更改默認的武器設定</translation>
+        <source>Please select a record from the list</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Unable to start server</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hedgewars - Success</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All file associations have been set</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Successfully posted the issue on hedgewars.googlecode.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error during authentication at google.com</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Error reporting the issue, please try again later (or visit hedgewars.googlecode.com directly)</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Main - Error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot create directory %1</source>
+        <translation type="unfinished">無法創建路徑 %1</translation>
     </message>
     <message>
         <source>Failed to open data directory:
 %1
-Please check your installation</source>
-        <translation>打不開資料檔案目錄:
-%1
-請檢查</translation>
+
+Please check your installation!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not overwrite default weapon set '%1'!</source>
+        <source>TCP - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>All file associations have been set.</source>
+        <source>Unable to start the server: %1.</source>
+        <translation type="unfinished">無法開始服務端: %1.</translation>
+    </message>
+    <message>
+        <source>Unable to run engine at </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File association failed.</source>
+        <source>Error code: %1</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teams</source>
-        <translation type="unfinished">隊伍</translation>
+        <source>Video upload - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this team?</source>
+        <source>Netgame - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Schemes</source>
+        <source>Please select a server from the list</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default scheme '%1'!</source>
+        <source>Please enter room name</source>
+        <translation type="unfinished">請鍵入房間名</translation>
+    </message>
+    <message>
+        <source>Record Play - Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Really delete this game scheme?</source>
+        <source>Please select record from the list</source>
+        <translation type="unfinished">請從清單選擇記錄</translation>
+    </message>
+    <message>
+        <source>Cannot rename to </source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Can not delete default weapon set '%1'!</source>
+        <source>Cannot delete file </source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
+        <source>Room Name - Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cannot create directory %1</source>
-        <translation>無法創建路徑 %1</translation>
+        <source>Please select room from the list</source>
+        <translation type="unfinished">請從列表選中房間</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>確認</translation>
+        <source>Room Name - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>The game you are trying to join has started.
+Do you still want to join the room?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Schemes - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the game scheme '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Videos - Are you sure?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Do you really want to delete the video '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message numerus="yes">
+        <source>Do you really want to remove %1 file(s)?</source>
+        <translation type="unfinished">
+            <numerusform></numerusform>
+        </translation>
+    </message>
+    <message>
+        <source>Do you really want to cancel uploading %1?</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>File error</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for writing</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot open '%1' for reading</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot use the ammo '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Warning</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot overwrite default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cannot delete default weapon set '%1'!</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Weapons - Are you sure?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Do you really want to delete the weapon set '%1'?</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
         <source>Nickname</source>
         <translation type="unfinished">匿稱</translation>
     </message>
@@ -1897,9 +2112,37 @@ Please check your installation</source>
         <source>more</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>More info</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Set default options</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Open videos directory</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Play</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Upload to YouTube</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Cancel uploading</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
-    <name>QTableWidget</name>
+    <name>RoomsListModel</name>
+    <message>
+        <source>In progress</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
         <source>Room Name</source>
         <translation type="unfinished">房間名</translation>
@@ -1928,6 +2171,18 @@ Please check your installation</source>
         <source>Weapons</source>
         <translation type="unfinished">武器</translation>
     </message>
+    <message>
+        <source>Random Map</source>
+        <translation type="unfinished">隨機地圖</translation>
+    </message>
+    <message>
+        <source>Random Maze</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Hand-drawn</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>SelWeaponWidget</name>
@@ -1957,21 +2212,6 @@ Please check your installation</source>
     </message>
 </context>
 <context>
-    <name>TCPBase</name>
-    <message>
-        <source>Error</source>
-        <translation>錯誤</translation>
-    </message>
-    <message>
-        <source>Unable to start the server: %1.</source>
-        <translation>無法開始服務端: %1.</translation>
-    </message>
-    <message>
-        <source>Unable to run engine: %1 (</source>
-        <translation>無法運行引擎: %1 (</translation>
-    </message>
-</context>
-<context>
     <name>ToggleButtonWidget</name>
     <message>
         <source>Vampirism</source>
@@ -2014,10 +2254,6 @@ Please check your installation</source>
         <translation>刀槍不入</translation>
     </message>
     <message>
-        <source>Add Mines</source>
-        <translation type="obsolete">佈置地雷</translation>
-    </message>
-    <message>
         <source>Random Order</source>
         <translation type="unfinished">隨機順序</translation>
     </message>
@@ -2242,6 +2478,14 @@ info</source>
         <source>slot 10</source>
         <translation type="unfinished">slot 10</translation>
     </message>
+    <message>
+        <source>mute audio</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>record</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (categories)</name>
@@ -2328,6 +2572,10 @@ info</source>
         <source>Toggle labels above hedgehogs:</source>
         <translation type="unfinished">切換刺蝟標籤顯示方式:</translation>
     </message>
+    <message>
+        <source>Record video:</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>binds (keys)</name>
diff --git a/share/hedgewars/Data/Locale/it.lua b/share/hedgewars/Data/Locale/it.lua
index e1cb981..1a37945 100644
--- a/share/hedgewars/Data/Locale/it.lua
+++ b/share/hedgewars/Data/Locale/it.lua
@@ -2,221 +2,985 @@ locale = {
     ["..."] = "...",
 	[":("] = ":(",
 	["!!!"] = "!!!",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
     ["Accuracy Bonus!"] = "Bonus Precisione!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
     ["Achievement Unlocked"] = "Archivio Sbloccato", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
     ["a Hedgewars mini-game"] = "un mini-gioco di Hedgewars", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Pratica la tua mira", --Bazooka, Shotgun, SniperRifle
-    ["Ammo"] = "Munizioni",
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
     ["Ammo Depleted!"] = "Munizioni scarse!",
     ["ammo extended!"] = "Munizioni aggiuntive!",
     ["Ammo is reset at the end of your turn."] = "Le munizioni si azzeranno alla fine del tuo turno",
     ["Ammo Maniac!"] = "Maniaco delle munizioni!",
+    ["Ammo"] = "Munizioni",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
     ["Available points remaining: "] = "Punti disponibili rimasti: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
     ["[Backspace]"] = "[Cancella]",
-    ["Bamboo Thicket"] = "Bosco di Bamboo",
-    ["Barrel Eater!"] = "Mangiatore di Barrili!",
-    ["Barrel Launcher"] = "Lanciatore di Barrili",
-	["Bat balls at your enemies and|push them into the sea!"] = "Lancia delle palle ai tuoi nemici|e spingili in acqua!",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
+    ["Bamboo Thicket"] = "Boschetto di Bambu'",
+    ["Barrel Eater!"] = "Mangiatore di Barili!",
+    ["Barrel Launcher"] = "Lanciatore di Barili",
+--      ["Baseballbat"] = "", -- Continental_supplies
+	["Bat balls at your enemies and|push them into the sea!"] = "Lancia delle palline ai tuoi nemici|e spingili in acqua!",
 	["Bat your opponents through the|baskets and out of the map!"] = "Manda (colpendoli) i tuoi nemici|in acqua attraverso i canestri laterali!",
-	["Bazooka Training"] = "Addestramento con il Bazooka",
+	["Bazooka Training"] = "Addestramento sull'utilizzo del Bazooka",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Tempo migliore per squadra: ",
     ["Best Team Times: "] = "Tempi della squadra migliore: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 	["Bloody Rookies"] = "Reclute Sanguinose", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
-    ["BOOM!"] = "BOOM!",
-    ["Boom!"] = "Boom!",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
+    ["Boom!"] = "Kaboom!",
+    ["BOOM!"] = "KABOOM!",
     ["Boss defeated!"] = "Boss sconfitto!",
-    ["Boss Slayer!"] = "Boss Slayer!",
+    ["Boss Slayer!"] = "Boss Uccisore!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
     ["Build a track and race."] = "Costruisci una pista e corri.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["CAPTURE THE FLAG"] = "Cattura la Bandiera",
     ["Careless"] = "Incauto",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
     ["Change Weapon"] = "Cambia Arma",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
     ["Clumsy"] = "Goffo",
-	["Codename: Teamwork"] = "Nome in codice: Lavoro di Squadra",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
+	["Codename: Teamwork"] = "Nome in Codice: Lavoro di Squadra",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
     ["Complete the track as fast as you can!"] = "Completa la pista più veloce che puoi!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
 	["Congratulations!"] = "Complimenti!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Complimenti! Hai distrutto tutti gli obiettivi|entro il tempo previsto.", --Bazooka, Shotgun, SniperRifle
-	["Control pillars to score points."] = "Controlla i pilastri per guadagnare punti.",
+--      ["Continental supplies"] = "", -- Continental_supplies
+	["Control pillars to score points."] = "Ottieni il controllo dei pilastri per guadagnare punti.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Cybernetic Empire"] = "Impero Cibernetico",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
+	["DAMMIT, ROOKIE!"] = "ACCIDENTI, RECLUTA!",
 	["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "MALEDIZIONE, RECLUTA! VIA DALLA MIA TESTA!",
-	["DAMMIT, ROOKIE!"] = "MALEDIZIONE, RECLUTA!",
-	["Dangerous Ducklings"] = "Papere Pericolose",
+	["Dangerous Ducklings"] = "Anatroccoli Pericolosi",
     ["Deadweight"] = "Peso morto",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
     ["Demolition is fun!"] = "Demolire è divertente!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
     ["Depleted Kamikaze!"] = "Kamikaze Esaurito!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
     ["Destroy invaders to score points."] = "Distruggi gli invasori per guadagnare dei punti.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
     ["Double Kill!"] = "Doppia Uccisione!",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
     ["Drone Hunter!"] = "Cacciatore di Droni!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
     ["Drowner"] = "Affogato",
-    ["Each turn you get 1-3 random weapons"] = "Ad ogni turno hai da 1 a 3 armi casuali",
-    ["Each turn you get one random weapon"] = "Ad ogno turno hai una sola arma casuale",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
+    ["Each turn you get 1-3 random weapons"] = "In ogni turno hai da 1 a 3 armi casuali",
+    ["Each turn you get one random weapon"] = "In ogno turno hai una sola arma casuale",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 	["Eliminate all enemies"] = "Elimina tutti i nemici",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Distruggi tutti gli obiettivi entro il tempo previsto.|Hai armi illimitate per questa missione.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 	["Eliminate Poison before the time runs out"] = "Elimina Veleno prima che il tempo finisca",
 	["Eliminate the Blue Team"] = "Elimina la Squadra Blu",
     ["Eliminate the enemy before the time runs out"] = "Elimina il nemico prima che il tempo scada", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
     ["Eliminate the enemy hogs to win."] = "Elimina i ricci nemici per vincere.",
     ["Eliminate the enemy specialists."] = "Elimina tutti i nemici specialisti.",
 	["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Elimina l'Unità 3378 |- La Resistenza Finale deve sopravvivere",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     ["Energetic Engineer"] = "Ingegnere Energetico",
-	["Enjoy the swim..."] = "Nuota con piacere...",
+	["Enjoy the swim..."] = "Spero che tu gradisca una nuotata...",
     ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Giro migliore: ",
 	["Feeble Resistance"] = "Resistenza Finale",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
 	["Fire"] = "Fuoco",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 	["Flag captured!"] = "Bandiera catturata!",
 	["Flag respawned!"] = "Bandiera restituita!",
 	["Flag returned!"] = "Bandiera recuperata!",
-    ["Flags, and their home base will be placed where each team ends their first turn."] = "Le bandiere saranno piazzate nel luogo in cui le squadre finiscono il loro primo turno",
+    ["Flags, and their home base will be placed where each team ends their first turn."] = "Le bandiere saranno piazzate nel luogo in cui le squadre finiscono il loro primo turno.",
     ["Flamer"] = "Incendiario",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
     ["Friendly Fire!"] = "Fuoco Amico!",
-    ["fuel extended!"] = "carburante aggiuntivo",
-    ["GAME BEGUN!!!"] = "IL GIOCO INIZIA!!!",
+    ["fuel extended!"] = "carburante aggiuntivo!",
+    ["GAME BEGUN!!!"] = "IL GIOCO E' INIZIATO!!!",
     ["Game Modifiers: "] = "Modificatori di Gioco: ",
 	["GAME OVER!"] = "GAME OVER!",
 	["Game Started!"] = "Gioco Iniziato!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 	["Get on over there and take him out!"] = "Vai fuori da qui ed eliminalo!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
     ["Goal"] = "Goal",
 	["GO! GO! GO!"] = "VAI! VAI! VAI!",
 	["Good birdy......"] = "Bell'uccellino......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 	["Good luck out there!"] = "Buona fortuna!",
     ["Good so far!"] = "Molto bene finora!",
     ["Good to go!"] = "Vai!!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
     ["GOTCHA!"] = "COLPITO!!",
     ["Grab Mines/Explosives"] = "Afferra Mine/Esplosivi",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
     ["Hahahaha!"] = "Hahahaha!",
-    ["Haha, now THAT would be something!"] = "Haha, allora questa pioggia ha davvero qualcosa di strano!",
+    ["Haha, now THAT would be something!"] = "Haha, allora questa pioggia ha DAVVERO qualcosa di strano!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
+    ["Hapless Hogs left!"] = "Ricci Sfortunati rimanenti!",
+--      [" Hapless Hogs left!"] = "", -- User_Mission_-_That_Sinking_Feeling
     ["Hapless Hogs"] = "Ricci Sfortunati",
-    ["Hapless Hogs left!"] = "Ricci Sfortunati eliminati!",
-    ["Health crates extend your time."] = "La cassa della salute ha aumentato il tuo tempo",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
+    ["Health crates extend your time."] = "Le casse salute estendono il tuo tempo",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
     ["Heavy"] = "Pesante",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Pallacanestro",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
     ["Heh, it's not that bad."] = "Beh, alla fine non piove così forte.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
     ["Hit Combo!"] = "Hit Combo!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Mmmmm...",
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 	["Hooray!"] = "Hurrà!!!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Cacciatore", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 	["Instructor"] = "Istruttore", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
     ["invaders destroyed"] = "invasori distrutti",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
     ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Almeno il SUDDEN DEATH arriverà tra 99 turni...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
     ["Jumping is disabled"] = "Il salto è disattivato",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
     ["Kamikaze Expert!"] = "Kamikaze Esperto!",
     ["Keep it up!"] = "Mantienilo al sicuro!",
+--      ["Kerguelen"] = "", -- Continental_supplies
     ["Killing spree!"] = "Furia Omicida!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
     ["KILLS"] = "UCCISIONI",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
     ["Last Target!"] = "Ultimo Obiettivo!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     ["[Left Shift]"] = "Shift Sinistro",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Listen up, maggot!!"] = "Recluta, Attenzione!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
     ["Lively Lifeguard"] = "Bagnino Vivace",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
     ["Mine Deployer"] = "Spintore di Mine",
     ["Mine Eater!"] = "Mangiatore di Mine!",
     ["|- Mines Time:"] = "|- Timer delle mine:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION FAILED"] = "MISSIONE FALLITA", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESSFUL"] = "MISSIONE COMPLETATA CON SUCCESSO", -- User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESS"] = "MISSIONE COMPLETATA", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
-    ["Movement: [Up], [Down], [Left], [Right]"] = "Movimenti: [Sù], [Giù], [Sinistra], [Destra]",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
+    ["Movement: [Up], [Down], [Left], [Right]"] = "Movimenti: [Su], [Giù], [Sinistra], [Destra]",
     ["Multi-shot!"] = "Colpi multipli!",
-    ["Nameless Heroes"] = "Eroi senza nome",
-    ["New Barrels Per Turn"] = "Nuovi Barrili ad Ogni Turno",
-    ["NEW CLAN RECORD: "] = "NUOVO CLAN RECORD: ",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
+    ["Nameless Heroes"] = "Eroi Senza Nome",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+    ["New Barrels Per Turn"] = "Nuovi Barili ad Ogni Turno",
+    ["NEW CLAN RECORD: "] = "NUOVO RECORD DEL CLAN: ",
 	["NEW fastest lap: "] = "Nuovo giro migliore: ",
-    ["New Mines Per Turn"] = "Nuove Mine ad ogni Turno",
+    ["New Mines Per Turn"] = "Nuove Mine ad Ogni Turno",
     ["NEW RACE RECORD: "] = "NUOVO RACE RECORD: ",
-    ["Newton's Hammock"] = "L'Amaca di Newton",
-    ["NOT ENOUGH WAYPOINTS"] = "NON CI SONO ABBASTANZA PUNTI DA PIAZZARE",
-	["Not So Friendly Match"] = "Partita non molto amichevole", -- Basketball, Knockball
+    ["Newton's Hammock"] = "Newton e l'Amaca",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
+    ["NOT ENOUGH WAYPOINTS"] = "NON CI SONO ABBASTANZA PUNTI!",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
+	["Not So Friendly Match"] = "Partita (quasi) amichevole", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 	["Oh no! Just try again!"] = "Oh no! Prova ancora!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Oh no! Tempo scaduto! Prova ancora!", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 	["Operation Diver"] = "Operazione Sub",
 	["Opposing Team: "] = "Squadra Nemica: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 	["Pathetic Hog #%d"] = "Riccio Patetico #%d",
     ["Pathetic Resistance"] = "Resistenza Patetica", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
     ["Per-Hog Ammo"] = "Munizioni per Riccio",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
     ["Place more waypoints using [ENTER]"] = "Piazza più punti usando [ENTER]",
-    ["Place more waypoints using the 'Air Attack' weapon."] = "Piazza più punti usando l' 'Attacco Aereo'",
+    ["Place more waypoints using the 'Air Attack' weapon."] = "Piazza più punti usando l'Attacco Aereo",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
     ["points"] = "punti", -- Control, Space_Invasion
 	["Poison"] = "Veleno",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 	["Power Remaining"] = "Potenza Rimasta",
     ["Prepare yourself"] = "Preparati",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
     ["Press [Precise] to skip intro"] = "Premi [Mirino di Precisione] per saltare l'intro",
-    ["Race complexity limit reached."] = "Raggiunto il limite complessivo della corsa.",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+    ["Race complexity limit reached."] = "Raggiunto il limite di complessità della corsa.",
     ["RACER"] = "RACER",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 	[" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Riporta la bandiera nemica alla tua base per guadagnare un punto| - La prima squadra a catturarne 3 vince! | - Puoi guadagnare punti solo quando la tua bandiera si trova nella tua base! | - I ricci lasceranno cadere la bandiera se uccisi o caduti in acqua! | - Le bandiere cadute possono essere restituite o ricatturate! | - I ricci risorgono dalla morte!",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
     ["Round Limit:"] = "Limite del Round: ",
     ["Round Limit"] = "Limite del Round",
     ["Rounds Complete: "] = "Round Completati: ",
     ["Rounds Complete"] = "Round Completati",
     ["RULES OF THE GAME [Press ESC to view]"] = "REGOLE DEL GIOCO [Premi ESC per visualizzarle] ",
 	["RULES OF THE GAME [Press ESC to view]"] = "REGOLE DEL GIOCO (Premi ESC per visualizzarle)",
-    ["s|"] = "s|",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
     ["Save as many hapless hogs as possible!"] = "Salva più ricci sfortunati che puoi!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
     ["SCORE"] = "PUNTEGGIO",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
     ["sec"] = "sec", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 	["See ya!"] = "Ci vediamo!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
     ["selected!"] = "selezionato!",
-    ["s"] = "s", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
     ["Shield boosted! +30 power"] = "Scudo ricaricato! Potenza +30",
     ["Shield Depleted"] = "Scudo Esaurito",
-    ["Shield is fully recharged!"] = "Lo scudo è completamente ricaricato!",
-    ["Shield Master!"] = "Maestro dello Scudo!",
-    ["Shield Miser!"] = "Scudo Breve",
+    ["Shield is fully recharged!"] = "Lo scudo è stato completamente ricaricato!",
+    ["Shield Master!"] = "Shield Master!",
+    ["Shield Miser!"] = "Scudo Piccolo",
     ["Shield OFF:"] = "Scudo OFF",
     ["Shield ON:"] = "Scudo ON",
     ["Shield Seeker!"] = "Cercatore di Scudi",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Squadra Shotgun",
-	["Shotgun Training"] = "Allenamento con il Fucile a Pompa",
+	["Shotgun Training"] = "Addestramento sull'utilizzo del Fucile a Pompa",
     ["shots remaining."] = "colpi rimasti.",
     ["Silly"] = "Stupido",
     ["Sinky"] = "Affondato",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s è fuori dal campo e la squadra %d|prende una penalità!| |Punteggio:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s è fuori dal campo e la squadra %d|guadagna un punto!| |Puntuación:", -- Basketball, Knockball
-	["Sniper Training"] = "Addestramento con il Fucile di Precisione",
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
+	["Sniper Training"] = "Addestramento sull'utilizzo del Fucile di Precisione",
 	["Sniperz"] = "Cecchini",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
     ["Sponge"] = "Spugna",
-	["Spooky Tree"] = "Albero stregato",
+	["Spooky Tree"] = "Albero Stregato",
+    ["s|"] = "s|",
+    ["s"] = "s", -- GaudyRacer, Space_Invasion
     ["STATUS UPDATE"] = "STATUS AGGIORNATO", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
     ["Switched to "] = "Cambiato in",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Squadra %d: ",
     ["Team Scores"] = "Punteggi della Squadra", -- Control, Space_Invasion
-    ["That Sinking Feeling"] = "Quella Sensazione d'Affondamento",
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
+    ["That Sinking Feeling"] = "Quella Sensazione di Affogare...",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
     ["That was pointless."] = "Era senza senso.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 	["The enemy is hiding out on yonder ducky!"] = "Il nemico si sta nascondendo dietro a quella papera!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
     ["The flag will respawn next round."] = "La bandiera verrà restituita alla fine del turno.",
-    ["The Nameless One"] = "Il SenzaNome",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
+    ["The Nameless One"] = "Il Senzanome",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
     ["THE SPECIALISTS"] = "GLI SPECIALISTI",
-    ["This one's tricky."] = "Molto difficile",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
+    ["This one's tricky."] = "Questo è molto complesso.",
     ["This rain is really something..."] = "Questa pioggia ha qualcosa di strano...",
-    ["TIME: "] = "TEMPO: ",
-    ["Timed Kamikaze!"] = "Kamikaze Cronometrato!",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
+    ["Timed Kamikaze!"] = "Kamikaze a Tempo!",
     ["Time Extended!"] = "Tempo Prolungato!",
     ["Time Extension"] = "Prolungamento di Tempo",
+    ["TIME: "] = "TEMPO: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
     ["Toggle Shield"] = "Scudo Manuale",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 	["Toxic Team"] = "Team Velenoso", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
     ["TRACK COMPLETED"] = "PISTA COMPLETATA",
     ["TRACK FAILED!"] = "PISTA FALLITA!",
-	["TrophyRace"] = "Trofeo Race",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
+	["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 	["T_T"] = "T_T",
     ["Tumbling Time Extended!"] = "Tempo di Caduta Prolungato!",
-    ["Turn Time"] = "Tempo di Turno",
-    ["Unit"] = "Unità",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
+    ["Turn Time"] = "Tempo del Turno",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 	["Unit 3378"] = "Unità 3378",
     ["Unit 835"] = "Unità 835",
-    ["Unlimited Attacks"] = "Attacchi illimitati",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+    ["Unit"] = "Unità",
+    ["Unlimited Attacks"] = "Attacchi Illimitati",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
     ["Unstoppable!"] = "Inarrestabile!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
     ["User Challenge"] = "Sfida Utente",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Usa la tua corda per raggiungere il traguardo il più velocemente possibile!",
-    ["Victory for the "] = "La vittoria è di", -- CTF_Blizzard, Capture_the_Flag
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 	["Victory for the"] = "La vittoria è di",
+    ["Victory for the "] = "La vittoria è di ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
     ["Waypoint placed."] = "Punto piazzato.",
-    ["Way-Points Remaining"] = "Punti Da Piazzare Rimasti.",
+    ["Way-Points Remaining"] = "Punti Da Piazzare Rimasti",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
     ["Weapons Reset"] = "Armi Azzerate",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
     ["Well done."] = "Ben fatto.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
     ["Will this ever end?"] = "Finirà mai?",
+--      ["WINNER IS "] = "", -- Mutant
     ["WINNING TIME: "] = "TEMPO VINCENTE: ",
-    ["You'd almost swear the water was rising!"] = "Guarda, l'acqua si sta alzando lentamente!",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
+    ["You'd almost swear the water was rising!"] = "Guarda, l'acqua si sta alzando rapidamente!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 	["You have SCORED!!"] = "Hai guadagnato un PUNTO!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
     ["You saved"] = "Hai salvato",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 	["You've failed. Try again."] = "Hai fallito. Prova di nuovo.",
 	["You've reached the goal!| |Time: "] = "Hai raggiunto il traguardo!| |Tempo: ",
-	["'Zooka Team"] = "'Squadra Zooka",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
+	["'Zooka Team"] = "Squadra 'Zooka",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/it.txt b/share/hedgewars/Data/Locale/it.txt
index 28b125a..83f2568 100644
--- a/share/hedgewars/Data/Locale/it.txt
+++ b/share/hedgewars/Data/Locale/it.txt
@@ -1,18 +1,18 @@
 ; Italian locale
 
 00:00=Granata
-00:01=Bomba a grappolo
+00:01=Bomba a Grappolo
 00:02=Bazooka
 00:03=Ape a Ricerca
 00:04=Fucile a Pompa
 00:05=Martello Pneumatico
-00:06=Salta il turno
+00:06=Salta il Turno
 00:07=Corda
 00:08=Mina
 00:09=Desert Eagle
 00:10=Dinamite
 00:11=Mazza da Baseball
-00:12=Shoryuken
+00:12=Pugno di Fuoco
 00:13=sec
 00:14=Paracadute
 00:15=Attacco Missilistico
@@ -26,9 +26,9 @@
 00:23=Attacco Kamikaze
 00:24=Torta
 00:25=Seduzione
-00:26=Bomba anguria
-00:27=Granata infernale
-00:28=Razzo trivella
+00:26=Bomba Anguria
+00:27=Granata Infernale
+00:28=Razzo Trivella
 00:29=Sparapalle
 00:30=Napalm
 00:31=Aereo Radiocomandato
@@ -45,17 +45,19 @@
 00:42=Portal Gun
 00:43=Ultima Sonata
 00:44=Vecchio Limburger
-00:45=Pistola Sinusoidale (beta)
+00:45=Pistola Sinusoidale
 00:46=Lanciafiamme
 00:47=Mine Adesive
 00:48=Martello
 00:49=Risurrettore
 00:50=Attacco Perforante
 00:51=Palla di Fango
-00:52=Nessuna arma selezionata
-00:53=Macchina del Tempo
-00:54=Costruzione
+00:52=Nessuna Arma Selezionata
+00:53=Macchina Spazio-Temporale
+00:54=Attrezzi da Costruzione
 00:55=Land Spray
+00:56=Congelatore
+00:57=Mannarino
 
 01:00=Combattiamo!
 01:01=Round in parità
@@ -72,12 +74,13 @@
 01:12=Ultimo turno prima del Sudden Death!
 01:13=%1 turni rimanenti prima del Sudden Death!
 01:14=Preparati, %1!
-01:15=Delicato
-01:16=Basso
+01:15=Trascurabile
+01:16=Minimo
 01:17=Medio
-01:18=Alto
-01:19=Forte
-01:20=%1 Rimbalzato
+01:18=Massimo
+01:19=Estremo
+01:20=Rimbalzo %1
+01:21=Audio disattivato
 
 ; Event messages
 ; Hog (%1) died
@@ -132,12 +135,14 @@
 02:00=%1 è caduto per l'onore della sua squadra!
 02:00=%1 non ama questo gioco
 02:00=Non c'è speranza per %1
-02:00=%1 è morto eroicamente per la patria.
+02:00=%1 è morto eroicamente per la patria
 02:00=%1 ti consiglio vivamente il Tetris
-02:00=%1 vuole la mamma
-02:00=%1 non è morto invano...(forse)
+02:00=%1 ha giocato la sua prima e ultima partita!
+02:00=%1 non è morto invano... (forse)
 02:00=L'inferno ti attende, %1
 02:00=%1 vivrà per sempre nei nostri cuori
+02:00=%1 è stato accolto dal nero falciatore
+02:00=Ade ora ha un nuovo schiavo
 
 ; Hog (%1) drowned
 02:01=%1 gioca a fare il sottomarino!
@@ -182,14 +187,18 @@
 02:01=%1 ha perso il battello
 02:01=%1 va a visitare la Fossa delle Marianne
 02:01=%1 è cibo per i pesci
-02:01=Ooops! %1 non può nuotare senza pinne!
 02:01=%1 pare amare l'acqua più di ogni altra cosa
 02:01=%1 avrebbe dovuto fare qualche lezione di nuoto
 02:01=E' abbastanza salata l'acqua, %1?
 02:01=%1 sprofonda nei più neri abissi
-02:01=Pazzia...QUESTA E' SPARTAAAAAAAAAAAAAAAAAAAAAAAAA!!
-02:01=%1 è a 20000 leghe sotto i mari
+02:01=I ricci non sanno nuotare. Ma forse %1 non lo sapeva!
+02:01=%1 si trova a 20000 leghe sotto i mari
 02:01=%1 è il nuovo amichetto di SpongeBob
+02:01=%1 vuole incontrare il capitano Nemo!
+02:01=Pazzia...QUESTA E' SPARTAAAAAAAAAAAAAAAAAAAAAAAAA!
+02:01=%1 aveva moooolta sete...
+; Reference to the game Chip's Challenge. Please do not translate into italian.
+02:01=Ooops! %1 can't swim without flippers!
 
 ; Round starts
 02:02=Combattiamo!
@@ -223,6 +232,7 @@
 02:02=Nessuna paura!
 02:02=Che la festa abbia inizio!
 02:02=Preparatevi alla gloria!
+02:02=Forza e coraggio, che la vita è un passaggio!
 
 ; Round ends (win; unused atm)
 02:03=...
@@ -324,9 +334,11 @@
 02:08=%1 adotta una nuova strategia
 02:08=%1 preferisce rimanere neutrale
 02:08=%1 ha alzato la bandiera bianca
-02:08=%Che vergogna!
+02:08=Che vergogna, %1!
 02:08=Se ci fosse stato Chuck Norris dietro di te, ti avrebbe preso a calci volanti
-02:08=%1 pensava troppo alle donnine nude
+02:08=%1 si è appena ricordato che deve ancora fare i compiti!
+02:08=%1 desidera lasciare che il nemico lo sconfigga
+02:08=%1, domande, dubbi, perplessità?
 
 ; Hog (%1) hurts himself only
 02:09=%1 dovrebbe migliorare la sua mira!
@@ -368,17 +380,20 @@
 02:09=%1 aiuta il nemico!
 02:09=Sono sicuro che nessuno l'abbia visto, %1
 02:09=No comment.
+02:09=%1 segue l'etica stoica!
 
 ; Hog shot an home run (using the bat and another hog)
 02:10=Un fuori campo!
 02:10=E' un uccello, è un aereo, ...
-02:10=E' fuori!
-02:10=BEL COLPO!
+02:10=Quello è fuori!
+02:10=Proprio un bel colpo!
 
 ; Hog (%1) has to leave (team is gone)
-02:11=%1 deve andare a nanna! 
+02:11=%1 deve andare a dormire! 
 02:11=%1 sembra che non abbia tempo per giocare
-02:11=%1 se ne deve andare.
+02:11=%1 se ne deve andare
+02:11=%1 stava giocando sui PC della scuola ed è stato beccato
+02:11=%1 va a fare il rinforzino di matematica!
 
 ; Weapon Categories
 03:00=Granata a tempo
@@ -427,40 +442,42 @@
 ; the misspelled "Beethoven" is intentional (-> to beat)
 03:43=La mortale sonata di Beathoven!
 03:44=Il meglio prima del 1923
-03:45=Arma Scientifica (beta)
+03:45=Arma Scientifica
 03:46=Arma da Fuoco (quello vero!)
 03:47=Arma da Lancio
 03:48=E' tempo di martellate!
 03:49=Antica Arte Mistica
 03:50=Attacco Aereo
-03:51=Trovata per terra
+03:51=Terreno al 100%
 03:52=NON USATO
-03:53=Modello N.40
-03:54=Costruisce qualcosa
+03:53=TARDIS Modello 40
+03:54=(Arma in sviluppo)
 03:55=Utilità di costruzione
+03:56=(Arma in sviluppo)
+03:57=Ecco il grande chef!
 
 ; Weapon Descriptions (use | as line breaks)
-04:00=Attacca i tuoi nemici con una semplice granata.|Esploderà quando il timer arriverà a zero.|1-5: Imposta il timer della granata|Attacco: Tieni premuto per lanciare con più forza
-04:01=Attacca i tuoi nemici con una bomba a grappolo.|Si dividerà in bombe più piccole quando il |timer arriverà a zero.|1-5: Imposta il timer della granata|Attacco: Tieni premuto per lanciare con più forza
+04:00=Attacca i tuoi nemici con una semplice granata.|Esploderà quando il timer arriverà a zero secondi.|1-5: Imposta il timer della granata|Attacco: Tieni premuto per lanciare con più forza|Mirino di Precisione + 1-5: Imposta livello di rimbalzo
+04:01=Attacca i tuoi nemici con una bomba a grappolo.|Si dividerà in bombe più piccole quando il |timer arriverà a zero.|1-5: Imposta il timer della granata|Attacco: Tieni premuto per lanciare con più forza|Mirino di Precisione + 1-5: Imposta livello di rimbalzo
 04:02=Attacca i nemici usando un proiettile balistico|che può essere influenzato dal vento.|Attacco: Tieni premuto per sparare con più potenza
 04:03=Lancia un'ape esplosiva che cercherà il|bersaglio scelto. Non sparare alla massima potenza|per migliorarne la precisione.|Cursore: Scegli il bersaglio|Attacco: Tieni premuto per sparare con più potenza
-04:04=Attacca i nemici usando i due colpi del fucile.|Grazie al suo raggio non hai bisogno di un colpo|diretto per ferire i nemici.|Attacco: Spara (più volte)
+04:04=Attacca i nemici usando i due colpi di fucile.|Grazie al suo raggio non hai bisogno di un colpo|diretto per ferire i nemici.|Attacco: Spara (più volte)
 04:05=Spostati sottoterra! Usa il martello pneumatico|per scavare un buco nel terreno e raggiungere|altre zone.|Attacco: Inizia o ferma lo scavo
 04:06=Annoiato? Non hai modo di attaccare? Non vuoi|sprecare munizioni? Nessun problema!|Salta il turno, codardo!|Attacco: Salta il turno senza combattere
-04:07=Copri lunghe distanze usando colpi precisi del|rampino. Usa la tua inerzia per scivolare contro altri|ricci o fai cadere granate o altre armi|su di loro.|Attacco: Spara o rilascia il rampino|Salto Lungo: Lascia cadere granate o armi simili
+04:07=Copri lunghe distanze usando colpi precisi del|rampino. Usa la tua inerzia per scivolare contro altri|ricci o fai cadere granate o altre armi|su di loro. Questa utilità è fondamentale nella modalità Shoppa.|Attacco: Spara o rilascia il rampino|Salto Lungo: Lascia cadere granate o armi simili dopo averle selezionate
 04:08=Tieni i tuoi nemici alla larga lasciando una|mina in passaggi stretti o proprio sotto i loro|piedi. Assicurati di scappare prima di azionarla|tu stesso!|Attacco: Lascia la mina davanti a te
 04:09=Non confidi nella tua mira? Usa la Desert|Eagle per attaccare usando fino a quattro colpi.|Attacco: Spara (quattro volte)
 04:10=La forza bruta è sempre un'opzione. Lascia questo|classico esplosivo vicino ai tuoi nemici e|batti in ritirata.|Attacco: Lascia la dinamite davanti a te
-04:11=Liberati dei ricci nemici battendoli oltre|i bordi della mappa o nell'acqua. Oppure che|ne diresti di buttare alcune mine ai|tuoi amici?|Attacco: colpisci qualunque cosa di fronte a te
-04:12=Avvicinati faccia a faccia per scatenare il|potere di questa mortale tecnica di arti marziali.|Attacco: esegue il Pugno di Fuoco
+04:11=Liberati dei ricci nemici battendoli oltre|i bordi della mappa o nell'acqua. Oppure che|ne diresti di lanciare alcuni barili ai|tuoi nemici?|Attacco: Colpisci qualunque cosa di fronte a te
+04:12=Avvicinati faccia a faccia per scatenare il|potere di questa mortale tecnica di arti marziali,|che in Giappone viene chiamata Shoryuken.|Attacco: Esegue un potente pugno di fuoco
 04:13=NON USATO
-04:14=Soffri di vertigini? Meglio avere un paracadute.|Si aprirà quando|cadrete da troppo in alto|e salverà il vostro riccio dai|danni da caduta.|Attacco: Apre il paracadute|Salto Lungo: lascia cadere granate o armi simili
+04:14=Soffri di vertigini? Meglio avere un paracadute.|Si aprirà quando|cadrete da troppo in alto|e salverà il vostro riccio dai|danni da caduta.|Attacco: Apre il paracadute|Salto Lungo: Lascia cadere granate o armi simili dopo averle selezionate
 04:15=Chiama un aeroplano per attaccare i nemici|usando un bombardamento a tappeto.|Destra/Sinistra: Determina la direzione dell'attacco|Cursore: Sceglie la zona da attaccare
 04:16=Chiama un aeroplano che butterà diverse mine|nell'area scelta.|Destra/Sinistra: Determina la direzione dell'attacco|Cursore: Sceglie la zona da attaccare
-04:17=Serve un riparo? Usate la Torcia Infuocata|per scavare un tunnel nel terreno e|garantirvi una copertura.|Attacco: Inizia o smetti di scavare
-04:18=Serve ulteriore protezione o vuoi passare|un terreno intransitabile? Piazza alcune travi|come più ti piace.|Destra/Sinistra: Scegli la trave da piazzare|Cursore: fissa la trave in una posizione valida
+04:17=Serve un riparo? Usate la Torcia Infuocata|per scavare un tunnel nel terreno e|garantirvi un buon livello di protezione.|Attacco: Inizia o smetti di scavare
+04:18=Serve ulteriore protezione o vuoi passare|un terreno intransitabile? Piazza alcune travi|come più ti piace. Attenzione! Nei temi Snow e Christmas|saranno coperte di scivoloso ghiaccio!|Destra/Sinistra: Scegli la trave da piazzare|Cursore: Fissa la trave in una posizione valida
 04:19=Usato al momento giusto il teletrasporto|può essere più potente di quasi tutte le armi,|visto che ti permette di salvare i ricci|da situazioni pericolose nel giro di secondi.|Cursore: Sceglie la zona di arrivo
-04:20=Ti permette di giocare il turno corrente|con un riccio diverso.|Attacco: abilita la scelta dei ricci
+04:20=Ti permette di giocare il turno corrente|con un riccio diverso.|Attacco: Abilita la scelta dei ricci
 04:21=Spara un proiettile simile a una granata|che rilascia bombe multiple all'impatto.|Attacco: Spara alla massima potenza
 04:22=Non solo per Indiana Jones! La frusta è una|utile arma in molte situazioni. Specialmente|quando si vuole spingere qualcuno giù da un|burrone.|Attacco: Colpisci qualunque cosa di fronte a te
 04:23=Se non avete niente da perdere, questo può|esservi d'aiuto. Sacrificate il vostro riccio|lanciandolo in una direzione, facendogli urtare|tutto ciò che incontra per poi esplodere alla fine.|Attacco: Lancia il mortale e devastante attacco
@@ -471,31 +488,33 @@
 04:28=Poco dopo averlo lanciato, questo razzo inizierà|a scavare attraverso il terreno ed esploderà|quando la sua spoletta verrà azionata o tornerà|di nuovo in superficie.|Attacco: Tieni premuto per lanciare con più forza
 04:29=Questa non è adatta ai bambini! La Sparapalle spara|tonnellate di piccole palline colorate riempite di|esplosivo.|Attacco: Spara alla massima potenza|Su/Giu: Continua a mirare
 04:30=Chiama un aeroplano per lanciare un potente|attacco napalm. Con la giusta mira questo attacco|può sradicare grandi zone di terreno, inclusi|gli sfortunati ricci nella zona.|Destra/Sinitra: Determina la direzione dell'attacco|Cursore: Sceglie la zona da attaccare
-04:31=L'Aereo Radiocomandato è l'arma ideale per|raccogliere casse e attaccare ricci lontani. Potete|sterzare contro i nemici o lasciargli cadere alcune|bombe prima di farlo.|Attacco: Lancia l'Aereo o lascia le bombe|Salto Lungo: Fai cavalcare le Valchirie in battaglia|Su/Giù/Sinistra/Destra: Manovra l'aereo
+04:31=L'Aereo Radiocomandato è l'arma ideale per|raccogliere casse e attaccare ricci lontani. Potete|sterzare contro i nemici o lasciargli cadere alcune|bombe prima di farlo.|Attacco: Lancia l'Aereo e lascia le bombe|Salto Lungo: Fai cavalcare le Valchirie in battaglia!|Su/Giù/Sinistra/Destra: Manovra l'aereo
 04:32=La bassa gravità è più funzionale di ogni dieta!|Saltate più in alto e coprite grandi distanze o fate|volare i nemici ancora più lontano.|Attacco: Attiva
 04:33=A volte è necessaria quella piccola spintarella in|più per causare più danni.|Attacco: Attiva
-04:34=Non potete toccarmi!|Attacco: Attiva
-04:35=A volte il tempo vola troppo in fretta. Prendetevi|alcuni secondi estra per finire il vostro|attacco.|Attacco: Attiva
+04:34=Ottenete la più totale (o quasi) invincibilità per un turno!|Attenzione! Non protegge da eventuali cadute in acqua!|Attacco: Attiva
+04:35=A volte il tempo vola troppo in fretta. Prendetevi|alcuni secondi extra per finire il vostro|attacco.|Attacco: Attiva
 04:36=Beh, a volte si è davvero uno schifo a mirare.|Sfruttate un po' di assistenza usando la moderna|tecnologia.|Attacco: Attiva
 04:37=Non temete la luce del giorno. Durerà solo un turno|ma vi permetterà di assorbire il danno che farete|agli altri ricci.|Attacco: Attiva
 04:38=Il fucile di precisione può essere l'arma più|devastante del vostro arsenale, tuttavia è molto debole|a distanza ravvicinata. Il danno inflitto aumenta con|la distanza dall'obiettivo.|Attacco: Spara (due volte)
-04:39=Vola in un'altra parte della mappa usando il|disco volante. Questo veicolo difficile da imparare|è in grado di portarvi quasi in ogni zona del|campo di battaglia.|Lo potete usare anche per andare sott'acqua!|Attacco: Attiva|Su/Destra/Sinistra: Applica forza in una direzione
+04:39=Vola in un'altra parte della mappa usando il|disco volante. Questo veicolo dalla giuda difficile|è in grado di portarvi quasi in ogni zona del|campo di battaglia.|Lo potete usare anche come veicolo sottomarino!|Attacco: Attiva|Su/Destra/Sinistra: Applica forza in una direzione
 04:40=Dai fuoco a una parte di terreno usando questa|bottiglia piena di liquido infiammabile.|Attacco: Tieni premuto per lanciare con più potenza
-04:41=La prova che la natura può persino fare meglio|del disco volante. L'uccellino può trasportare|il vostro riccio e bombardare di uova i nemici!|Attacco: Attiva e lancia le uova|Su/Giu/Destra/Sinistra: Vola in una direzione
+04:41=La prova che la natura può persino fare meglio|del disco volante. L'uccellino può trasportare|il vostro riccio e bombardare di uova avvelenate i nemici!|Attacco: Attiva e lancia le uova|Su/Giu/Destra/Sinistra: Vola in una direzione|Salto Lungo: Lascia cadere granate o armi simili dopo averle selezionate
 04:42=Questo dispositivo portatile crea dei portali dimensionali|che possono trasferire all'istante voi, i vostri nemici|o le vostre armi da un punto all'altro del|terreno.|Usatelo saggiamente e potrà riverlarsi...un GRANDE SUCCESSO!|Attacco: Lancia un portale|Tab: Cambia il colore del portale
 04:43=Do! Re! Mi! Fa! Sol! La! Si!|Suonate il mitico pianoforte di Beathoven e|sarà un successo esplosivo!|Il pianoforte cadrà dal cielo ma|qualcuno deve suonarlo e questo costerà|la sua vita!|Cursore: Sceglie la zona da attaccare|F1-F9: Suona il pianoforte
-04:44=Questo non è normale formaggio, è guerriglia biologica!| Non farà un gran danno al momento dell'esplosione|ma avvelenerà chiunque ne senta lo spiacevole odore!|1-5: Imposta il timer del limburger|Attacco: Tieni premuto per lanciare con più forza
-04:45=Tutto il potere della fisica e della scienza in|mano vostra con questa potente arma|in grado di generare una potente curva|sinusoidale di pura energia.|Attenzione! Questa arma vi darà un forte|contraccolpo (ancora in versione beta)|Attacco: Spara
+04:44=Questo non è normale formaggio, è guerriglia biologica!| Non farà un gran danno al momento dell'esplosione|ma avvelenerà chiunque ne senta lo spiacevole odore!|1-5: Imposta il timer del limburger|Attacco: Tieni premuto per lanciare con più forza|Mirino di Precisione + 1-5: Imposta livello di rimbalzo
+04:45=Tutto il potere della fisica e della scienza in|mano vostra con questa potente arma|in grado di generare una potente curva|sinusoidale di pura energia.|Attenzione! Questa arma vi darà un forte|contraccolpo!|Attacco: Spara
 04:46=Lanciate delle brucianti fiamme contro i vostri nemici.|Assolutamente scottante!|Attacco: Attiva|Su/Giù: Continua a mirare|Sinistra/Destra: Modifica la potenza di fuoriuscita delle fiamme
 04:47=Raddoppiate il divertimento con due appiccicose mine.|Usatele per difendervi o creare potenti reazioni a catena (o ambedue le cose!)|Attacco: Tieni premuto per lanciare con più forza (due volte)
 04:48=Colpite i vostri nemici con forza!|Un buon colpo di questo martello toglierà|un terzo della vita della vittima e la farà|sprofondare nel terreno.|Attacco: Attiva
 04:49=Resuscitate i vostri ricci morti in battaglia.|Ma attenzione a non resuscitare i vostri nemici!|Attacco: Tieni premuto per risuscitare lentamente|Su: Accelera la risurrezione
-04:50=Scavate dall'alto verso il basso!|Con questo attacco aereo è possibile scavare a fondo grazie|a cinque razzi trivella lanciati dall'alto, che colpiranno|tutto quello che sarà a tiro.|Il timer indica fin quanto possono scavare prima di esplodere.|Cursore: Sceglie la zona da attaccare
+04:50=Scavate dall'alto verso il basso!|Con questo attacco aereo è possibile scavare a fondo grazie|a cinque razzi trivella lanciati dall'alto, che colpiranno|tutto quello che sarà a tiro.|Il timer indica fin quanto possono scavare prima di esplodere.|1-5: Imposta il timer dei razzi|Cursore: Sceglie la zona da attaccare
 04:51=Spingete i nemici in acqua o sopra le mine!|Questa semplice arma non farà molti danni ma|spingerà con forza i nemici che colpisce!|Nei temi Snow e Christmas è una palla di neve!|Attacco: Tieni premuto per lanciare con più forza
 04:52=NON USATO
-04:53=Avventurati attraverso lo spazio-tempo,|lasciando che i tuoi compagni se la sbrigano da soli.|Preparati a ritornare in qualsiasi momento,|o per il Sudden Death o se sono stati tutti sconfitti.|Attenzione. Non funziona durante il Sudden Death,|se sei rimasto da solo, o se sei il Re.
-04:54=INCOMPLETO                                                                                                                                    
-04:55=Spruzza della schiuma attaccaticcia.|Utile per costruire ponti, seppellire nemici, sigillare tunnel.|Usate con cautela!
+04:53=Parti per un'avventura unica attraverso spazio e tempo,|lasciando i tuoi compagni da soli a combattere.|Preparati a ritornare in qualsiasi momento,|o per il Sudden Death o se sei l'ultimo sopravvissuto.|Attenzione! Non è utilizzabile durante il Sudden Death,|se sei rimasto da solo, o se sei il Re.|Attacco: Inzia la tua avventura nello spazio-tempo!
+04:54=DESCRIZIONE NON DISPONIBILE (arma ancora in sviluppo)
+04:55=Con questo terreno spray non ti mancherà mai la terra |sotto ai piedi. Utilissimo per costruire ponti, |seppellire nemici e sigillare tunnel.|Ma fai attenzione a non usarlo a tuo svantaggio!|Attacco: Attiva|Su/Giù: Continua a mirare|Sinistra/Destra: Modifica la potenza di fuoriuscita del terreno
+04:56=DESCRIZIONE NON DISPONIBILE (arma ancora in sviluppo)
+04:57=Lancia due mannarini da cucina verso i tuoi nemici, se |lanciati con potenza possono rappresentare una... tagliente sorpresa!|Ricorda che rimarranno sul terreno dopo averli lanciati!|Attacco: Tieni premuto per lanciare con più forza
 
 ; Game goal strings
 05:00=Modalità di Gioco
@@ -519,4 +538,4 @@
 05:18=Attacchi illimitati
 05:19=Le armi verranno resettate allo stato di partenza alla fine di ogni turno
 05:20=Le armi non sono condivise tra i ricci della stessa squadra
-05:21=Tag Team: Le squadre amiche guadagnano dei turni|Tempo di condivisione: le squadre tra di loro condividono lo stesso tempo di turno
+05:21=Tag Team: Le squadre di uno stesso clan prendono turni in successione|Tempo Condiviso: Le squadre di uno stesso clan condividono il tempo di gioco
diff --git a/share/hedgewars/Data/Locale/ja.txt b/share/hedgewars/Data/Locale/ja.txt
index 4c4806c..efe0841 100644
--- a/share/hedgewars/Data/Locale/ja.txt
+++ b/share/hedgewars/Data/Locale/ja.txt
@@ -72,41 +72,481 @@
 01:12=サドンデスまで最後の番!
 01:13=サドンデスまで%1番残り!
 01:14=準備して、%1!
+01:15=わずかな
+01:16=低い
+01:17=通常の
+01:18=高い
+01:19=極端な
+01:20=%1のバウンス
 
 ; Event messages
 ; Hog (%1) は死んだ。
 02:00=%1 は天国を見た。
+02:00=%1はバケツを蹴っています!
+02:00=%1は光を見ました!
+02:00=%1はそれが来るのを見ません!
+02:00=%1波さようなら!
+02:00=%1はより良い場所に行ってきました!
+02:00=%1は彼のメーカーを満たしている!
+02:00=%1は、もはやにハングアップすることができます!
+02:00=%1は自分の義務を行っています!
+02:00=%1は究極の犠牲になります!
+02:00=%1はこの浮き世に出発!
+02:00=%1は木や葉のようになります!
+02:00=%1がタイムアウトしました!
+02:00=%1は平和外と言われます。
+02:00=%1を懐かしく思い出すことでしょう!
+02:00=%1は、動脈瘤を持っている!
+02:00=%1は妻と子が残され
+02:00=%1は彼の最後のバズーカを開始しました
+02:00=%1は彼の最後の手榴弾を投げています
+02:00=%1は彼の最後のケーキを焼きました
+02:00=%1は彼の最後のロープに振っています
+02:00=%1は彼の最後の空爆を呼びかけている
+02:00=%1は彼の最後のショットガンをポンプしています
+02:00=%1は彼の最後のメロンをスローしました
+02:00=%1は彼の最後のを集めている
+02:00=%1つがあまりにも多くを撃った
+02:00=%1は実際に健康上のクレートを使用することもできました
+02:00=%1は優れたゲームをプレイしてしまった
+02:00=%1は寿命を有する
+02:00=%1が失敗した
+02:00=貧しい貧しい%1...
+02:00=%1のwarmuxを好む
+02:00=%1は彼の顔をしてショットをブロックされています
+02:00=%1は私の中のヒーローです...誤る...豚
+02:00=%1はヴァルハラで彼の場所を見つける
+02:00=%1は、建物を残している
+02:00=%1は恐竜の道を行く
+02:00=%1が絶滅に一歩近づいたハリネズミをもたらす
+02:00=%1は私の目に涙をもたらす
+02:00=%1は元豚です。
+02:00=%1はヒナギクを押し上げている
+02:00=%1に該当しなくなつたとき、
+02:00=%1に別れを告げる
+02:00=%1のために残された希望しない
+02:00=%1は、最終的なカーテンに直面している
+02:00=%1をあなたが得た場合は、をたばこを吸う
+02:00=%1は自発的大規模な存在の障害を受ける
+02:00=%1に渡されました
+02:00=%1は石死んでいる
+02:00=%1はもうありません
+02:00=%1は有効期限が切れています
+02:00=生命を失って、%1は平和にかかっている
+02:00=%1は目に見えない合唱団に参加する
+02:00=別れ%1は、我々はほとんどあなたがたを知りませんでした!
+02:00=%1が撃たれるの低耐性を持っていた
+02:00=%1は余分な生活を使用することもできました
+02:00=家の中で医者はありますか?
+
 ; Hog (%1) は溺れた。
 02:01=%1 はタイタニック見たい。
+02:01=%1は潜水艦再生!
+02:01=%1はタイタニックを模倣した!
+02:01=石のように%1泳ぐ!
+02:01=レンガのように%1のフロート!
+02:01=%1は深いエンドをチェックアウト
+02:01=%1は一気に飲む一気に飲むゴクリという音を行く
+02:01=%1はスプラッシュを行く
+02:01=%1は彼の腕章を忘れてしまった
+02:01=%1は本当に水泳のレッスンを受けている必要があり
+02:01=%1は自宅で彼のサーフボードを残した
+02:01=%1は、最大で洗浄する
+02:01=%1はねっとり豚です。
+02:01=%1は、彼のライフジャケットを持参するのを忘れた
+02:01=%1はスプラッシュを行く
+02:01=%1は魚類で眠っている
+02:01=%1はこのゲームでは水の物理学を吸うと考えている
+02:01=%1はのどが渇いて見える
+02:01=海は%1を主張
+02:01=%1は海で失われる
+02:01=%1は彼のスキューバギヤを持っている必要があります
+02:01=%1は海に埋葬を取得します。
+02:01=%1はその沈没感を持っている
+02:01=%1は彼の背泳ぎを練習している
+02:01=%1は、タイタニック号の探索に入ります
+02:01=%1はイエスではありません
+02:01=%1はニモを見つけることです
+02:01=%1のばね漏れ
+02:01=あなたがダウンしてありますどのように多くの豚不思議ちゃ
+02:01=%1は海で、若干高めになります
+02:01=%1は海軍に入隊しませんでした
+02:01=%1は死んだ魚の彼の偽装を行っています
+02:01=少なくとも、あなたはトイレ、%1をシャットダウン行きませんでした
+02:01=ソニックは泳げなかった、どちら%1缶
+02:01=%1はエコーザのイルカを再生したい
+02:01=%1は水族館を訪問してしまった
+02:01=%1がアトランティスの失われた都市を発見した
+02:01=%1でBioshock3の先導的な役割を目指して
+02:01=あなたの犬のパドルは、少し作業は、%1を使用することができます
+02:01=%1はジェットスキーを持っている必要があります
+02:01=%1はウォータースポーツが好きではありません。
+02:01=%1は永遠に泡を吹いている
+02:01=%1はいかだの短い
+02:01=%1は、塩の水が肌に良いと考えている
+02:01=%1は彼の傷に塩水を取得します。
+02:01=%1は板を歩いています
+02:01=%1はお風呂を持っている
+02:01=%1は濡れ濡れ濡れている
+02:01=%1は彼のクイルが濡れた
+02:01=これは、%1のデイビージョーンズのロッカーだ
+
 ; 初め!
 02:02=頑張って!
+02:02=のは、戦いましょう!
+02:02=武装して準備を!
+02:02=レッツランブルに準備ができました!
+02:02=それを取得してみましょう!
+02:02=このパーティーを始めるてみましょう
+02:02=最後の豚に立って受賞
+02:02=行きましょう!
+02:02=ロックしましょう!
+02:02=ジャムしましょう!
+02:02=それが始まりだ...
+02:02=これは大きな何かの始まりです
+02:02=Hedgewarsへようこそ
+02:02=前線へようこそ
+02:02=あなたの敵を押しつぶす!
+02:02=最高の豚が勝つ可能性があり
+02:02=勝利か死
+02:02=勝者に戦利品を行く
+02:02=ルージングオプションではありません
+02:02=混乱を叫ぶ!戦争の豚を失いましょう!
+02:02=Hedgewarsは、Hedgewars.orgによってあなたに持って来られる
+02:02=グラム
+02:02=ただTiyuri対戦がわからない自分がラッキーカウント
+02:02=ただunC0Rr対戦がわからない自分がラッキーカウント
+02:02=自分だけはラッキーカウントはニモ対戦じゃないNemo
+02:02=ただSmaxx対戦がわからない自分がラッキーカウント
+02:02=自分だけはラッキーカウントはJessor対戦じゃない
+02:02=それはあなたのすべてを与える!
+02:02=敗者は、クリーニングを行う!
+02:02=ミレニアムの戦いを始めましょう
+02:02=世紀の戦いを始めましょう
+02:02=十年の戦いを始めましょう
+02:02=今年の戦いを始めましょう
+02:02=月の戦いを始めましょう
+02:02=週の戦いを始めましょう
+02:02=一日の戦いを始めましょう
+02:02=時間の戦いを始めましょう
+02:02=あなたのベストを尽くす!
+02:02=敵を破壊する!
+02:02=幸運
+02:02=楽しむ
+02:02=善戦する
+02:02=汚れと戦う
+02:02=名誉と戦う
+02:02=あきらめてはいけない
+02:02=決して降伏しない
+02:02=岩と靴下を!
+02:02=を始めましょう!
+02:02=私はあなたの闘争のために準備が整いましたね!
+02:02=ゴーゴーに行く!
+02:02=ハリネズミ事前に!
+02:02=彼らにそれをもたらす!
+02:02=恐れを持っていません!
+02:02=勇気をだして征服される
+
 ; Round ends (win; unused atm)
 02:03=...
+
 ; Round ends (draw; unused atm)
 02:04=...
+
 ; New health crate
 02:05=救援物資が入って来る!
 02:05=医者の指示を聞いてね。
 02:05=天与救急箱でございます
+02:05=着信援助!
+02:05=メディック!
+02:05=空から応急処置!
+02:05=あなたのための健康パック
+02:05=良好な健康状態...ボックスの形で!
+02:05=医師を呼び出します
+02:05=新鮮なバンドエイド!
+02:05=これは、良い感じになります
+02:05=ハイポーション!間違ったゲームおっ
+02:05=ピックミーアップ!
+02:05=それをつかむ
+02:05=健康的なスナック
+02:05=痛みの治療法
+02:05=正しい用量:あなたが見つけることができる限り多くの!
+02:05=緊急配信
+02:05=電源!
+
 ; New ammo crate
 02:06=もっと火力だ!
 02:06=なかになにかな
 02:06=パワーアップ!
+02:06=より多くの武器!
+02:06=援軍を!
+02:06=ロックと負荷!
+02:06=私は武器がそこにあるものだろうか?
+02:06=電源!
+02:06=何が内部だろうか?
+02:06=クリスマスは、早期Hedgewars入ってくる
+02:06=プレゼント!
+02:06=特別配信!
+02:06=それは、税関を介してこれを取得する悪夢だった
+02:06=天からの破壊的なおもちゃ
+02:06=警告!揮発性の内容
+02:06=それを拾うか、またはそれを爆破する、選択はあなた次第です
+02:06=グッディーズ!
+02:06=の弾薬
+02:06=破壊力のボックス
+02:06=航空便!
+02:06=そのボックスにあるにせよ、それはピザではありません
+02:06=それを入手!
+02:06=武器のドロップの着信
+02:06=敵がいることをつかむことはできません!
+02:06=光沢のある新しいおもちゃ!
+02:06=神秘的なボックス!
+
 ; New utility crate
 02:07=必要かもしれない…
 02:07=これいいでしょう!
 02:07=おっと、重い箱これ
+02:07=ツールの時間!
+02:07=これは便利になることができました...
+02:07=ユーティリティ!
+02:07=このボックスをユーティリティ
+02:07=下に気を付けろ
+02:07=多くのユーティリティ!
+02:07=あなたのためのツール!
+02:07=これは良いはずです!
+02:07=この賢明を使用します。
+02:07=このボックスは重いです
+02:07=あなたはこれを必要があるかもしれません
+
 ; Hog (%1) skips his turn
 02:08=%1 は全くつまらない。
 02:08=%1 は座禅したいもの
 02:08=寝ちゃったの、%1?
+02:08=%1はすっごく退屈だ...
+02:08=%1は気にすることができませんでした
+02:08=%1は怠惰な豚です。
+02:08=%1は軽率です。
+02:08=%1はあきらめた
+02:08=あなたは、あなたが失う%1を居眠り
+02:08=%1臆面もなくスキップします
+02:08=%1は本当に怠け者です。
+02:08=%1はもう少しモチベーションが必要です
+02:08=%1は平和です。
+02:08=%1は息抜きを持っている
+02:08=%1は残りを持っている
+02:08=%1の悪寒より
+02:08=%1は自分の能力には信仰を持っていません
+02:08=%1は、まったく何もしないことを決定
+02:08=%1は敵が自分自身を破壊することができます
+02:08=%1はパーティーでひどいだろう
+02:08=%1を隠して
+02:08=%1はこの機会に合格することを決定しました
+02:08=%1は、彼ができる最善のことはありません...何も決定
+02:08=%1は大きい弱虫です。
+02:08=バックコッコッ、%1はチキンです。
+02:08=%1は少し黄色を探しています
+02:08=%1は臆病者だ!
+02:08=%1は突然死を待っています
+02:08=%1は戦闘型ではありません。
+02:08=%1は彼の人生の目的を再考されてい
+02:08=%1がとにかく良いショットの多くはなかった
+02:08=%1は最初の場所に軍隊に参加したくありませんでした
+02:08=%1を私たちの時間を無駄に停止する
+02:08=私は、%1、あなたにがっかりしてい
+02:08=さあ、あなたはその%1よりも優れて行うことができます
+02:08=%1の壊れています。
+02:08=%1は明らかに行うには良いことをしてい
+02:08=%1は堅いおびえている
+02:08=%1が眠っている
+
 ; Hog (%1) hurts himself only - see en.txt for examples
 02:09=もちろん、%1 がわざとしたねw
 ; The real saying has けってん = shortcoming, whereas てっけん = clenched fist
 02:09=大丈夫 %1、だれにでも てっけん はある
+02:09=%1を目指して練習してください!
+02:09=%1は自分自身を憎むように見える
+02:09=%1は間違った側に立っている!
+02:09=%1はエモのようになります
+02:09=%1のまわりで彼の武器間違った方法を持っていた
+02:09=%1は少しサディスティックです。
+02:09=%1はマゾです。
+02:09=%1は自己保存の本能にはありません
+02:09=%1が台無しに
+02:09=%1が台無しに
+02:09=それは悪いショット、%1であった
+02:09=%1は危険な武器を少し余りに軽率です。
+02:09=%1は、キャリアの変化を考慮する必要があります
+02:09=最悪。撮影した。!
+02:09=いいえいいえいいえ%1には、敵に撃つん!
+02:09=%1は唯一の敵を破壊する必要があります
+02:09=%1は自殺に一歩近づく
+02:09=%1は敵を助ける
+02:09=それは%1愚かであった
+02:09=痛みなくして得るものなしのスローガンで%1の命を
+02:09=%1が混乱している
+02:09=%1は、その混乱の中で自分自身を傷つける
+02:09=%1は、自分自身を恥ずかしいの才覚を持っている
+02:09=%1は不器用です!
+02:09=%1は不器用です。
+02:09=%1は彼の能力何敵を示しています。
+02:09=%1はすべての時間を完璧なものに期待することはできません
+02:09=%1、のを心配する必要はありません
+02:09=%1は完全に意図的にそれをしました
+02:09=そうでない場合、私は、%1を誰にも言われません
+02:09=どのように恥ずかしい!
+02:09=私は誰もその%1を見たことが確信している
+02:09=%1は彼の分野のマニュアルを確認する必要があります
+02:09=%1の武器は明らかに故障
+
 ; Hog shot an home run (using the bat and another hog)
 02:10=ホームラン!
 02:10=鳥、飛行機…いや、%1だ!
+02:10=が出ていることを!
+
 ; Hog (%1) has to leave (team is gone)
 02:11=%1 は出かけなければ…
 02:11=%1 はちょっと用がある
+02:11=ビーム彼のアップ、スコッティ!
+02:11=%1ベッドに移動しています!
+02:11=%1行かなければならない
+
+; Weapon Categories
+03:00=時限グレネード
+03:01=時限グレネード
+03:02=弾道兵器
+03:03=誘導兵器
+03:04=銃(複数枚)
+03:05=掘削ツール
+03:06=アクション
+03:07=トランスポートユーティリティ
+03:08=近接爆弾
+03:09=銃(複数枚)
+03:10=BOOM!
+03:11=ボンク!
+03:12=武術
+03:13=UNUSED
+03:14=トランスポートユーティリティ
+03:15=空中攻撃
+03:16=空中攻撃
+03:17=掘削ツール
+03:18=ユーティリティ
+03:19=トランスポートユーティリティ
+03:20=アクション
+03:21=弾道兵器
+03:22=私インディアナ呼ぶ!
+03:23=本当に)マーシャルアーツ
+03:24=ケーキは嘘ではありません!
+03:25=衣装キット
+03:26=ジューシーなグレネード
+03:27=燃えるようなグレネード
+03:28=弾道兵器
+03:29=弾道兵器
+03:30=空中攻撃
+03:31=リモコン爆弾
+03:32=一時的効果
+03:33=一時的効果
+03:34=一時的効果
+03:35=一時的効果
+03:36=一時的効果
+03:37=一時的効果
+03:38=銃(複数枚)
+03:39=トランスポートユーティリティ
+03:40=グレネードを焼却
+03:41=の大ファン
+03:42=私はここに注意して作っているんだ...
+; the misspelled "Beethoven" is intentional (-> to beat)
+03:43=の致命的なソナタを実行する
+03:44=最高の前:1923
+03:45=科学の力
+03:46=ホット!ホットホット
+03:47=これらはどこかに便利なスティック!
+03:48=それはハンマー時間です!
+03:49=あなたが推測するかしない
+03:50=モルファン
+03:51=地上で発見
+03:52=UNUSED
+03:53=タイプ40
+03:54=何かを構築
+03:55=ユーティリティ
+
+; Weapon Descriptions (use | as line breaks)
+04:00=シンプルな手榴弾を使って敵を攻撃。そのタイマーがゼロに達するとそれが爆発する。1-5:セットグレネードのタイマー攻撃:より多くの電力をスローするようにホールド
+04:01=クラスター爆弾を使用して敵を攻撃。そのタイマーがゼロに達すると、それは小さな爆弾に分割されます。1-5:セットグレネードのタイマー攻撃:より多くの電力をスローするようにホールド
+04:02=風に影響されるかもしれない弾道発射体を使用して敵を攻撃。攻撃:より多くの電力を使って撮影するホールド
+04:03=選択したターゲットにロックされ爆発的な蜂を起動します。その精度を向上させるためにフルパワーを使って撮影しないでください。カーソル:ピックターゲット攻撃:より多くの電力を使って撮影するホールド
+04:04=2ショットでショットガンを使って敵を攻撃する。その広がりあなたのおかげで、あなたの対戦相手に危害を直接ヒットする必要はありません。攻撃:シュート(複数回)
+04:05=地下に移動!地面に穴を開けると他の領域に到達するを使用しています。攻撃の開始または停止掘り
+04:06=退屈?攻撃する方法はありません?あなたの弾薬を保存しますか?問題ありません!ちょうどあなたのターン、臆病者をスキップして!攻撃:戦闘せずにターンをスキップ
+04:07=ロープでタイムアウトショットを使用して、巨大な距離を埋める。他の豚またはドロップ手榴弾およびそれらの他の武器にスライドするように勢いを使用しています。攻撃:ドロップ手榴弾または類似の武器:ロープロングジャンプシュートまたは解放
+04:08=狭い通路の右またはそれらの足の下鉱山をドロップすることで、離れてあなたの敵を保つ。あなた自身でそれをトリガする前に撤退してください!攻撃:あなたの足の隣に地雷を削除します。
+04:09=あなたの照準が分からない?4打差までを使用して攻撃するためにデザートイーグルを使用しています。攻撃:シュート(複数回)
+04:10=ブルートフォースは常にオプションです。あなたの敵と後退の隣にあるこの古典的な爆発物をドロップします。攻撃:あなたの足の隣にあるドロップダイナマイト
+04:11=マップの国境を越えてまたは水の中にそれらをバッティングして敵の豚を取り除く。またはどのようにお友達にいくつかの鉱山をノックでしょうか?攻撃:あなたの前にバットすべてを
+04:12=このほとんど致命的な武道技術の力を解き放つに近いと個人的な取得します。攻撃:素晴らしいを実行します。
+04:13=UNUSED
+04:14=高所恐怖症?優れたパラシュートをつかむ。それはあなたが遠すぎたら落ちる展開と秋のダメージを受けてから豚を保存します。攻撃:ドロップ手榴弾または類似の武器:パラシュートロングジャンプを伸ばし
+04:15=爆撃の実行を使用して敵を攻撃する飛行機の中で呼び出します。左右:選択してターゲット領域:攻撃方向のカーソルを決定
+04:16=ターゲットエリアにいくつかの鉱山をドロップするには飛行機の中で呼び出します。左右:選択してターゲット領域:攻撃方向のカーソルを決定
+04:17=避難が必要ですか?あなたがカバー付与固体地面にトンネルを掘るためにブロートーチを使用しています。攻撃の開始または停止掘り
+04:18=追加の保護が必要な場合、または地面を通過したいですか?好きなように、いくつかの桁に置きます。有効な位置に配置桁:左右:カーソルを配置する選択桁
+04:19=それはあなたが数秒以内に危険な状況から豚を保存することができますように、右瞬間テレポーテーションで使用するほぼすべての武器をより強力にすることができます。カーソル:選択してターゲット領域
+04:20=別の豚と、現在のターンを再生することができます。攻撃:スイッチング豚を有効にする
+04:21=インパクト時に複数の爆弾を解放します手榴弾のような弾丸を撃つ。攻撃:フルパワーで撃つ
+04:22=だけでなく、インディジョーンズのために!鞭は多くの状況で有用な武器である。あなたが崖から誰かを突き出すしたい場合は特に。攻撃:あなたの前にストライクのすべて
+04:23=あなたが失うものは何もない場合、これはかなり便利かもしれません。彼の方法上のすべてを傷つけると終了時に爆発し、特定の方向に彼を起動することで、豚を生け贄に捧げる。攻撃:壊滅的な、致命的な攻撃を開始
+04:24=誕生日おめでとう!このケーキを起動し、それが右の敵の隣に歩いて、彼らが爆発的パーティを持たせてみましょう。ケーキは、ほぼすべての地形を通過することができますが、彼は以前、この方法を爆発させるかもしれません。攻撃:ケーキを起動するか、停止させると爆発する
+04:25=(そして、いくつかのギャップや穴)が豚に向かってジャンプすることがあなたの敵を取得するには、この変装キットを使用しています。攻撃:キットを使用して、別の豚を誘惑しよう
+04:26=あなたの敵で、このジューシーなスイカをスローします。タイマーの期限が切れると、それはいくつかの爆発的な断片に分割されます。1-5:セットスイカのタイマー攻撃:より多くの電力を使って撮影するホールド
+04:27=この悪魔のよう爆発を使用して、あなたの対戦相手に業火の雨してみましょう。近すぎる小さな火災が長く続くかもしれないと爆発に得ることはありません。攻撃:より多くの電力を使って撮影するホールド
+04:28=このロケットを打ち上げた後の短い時間、それは固体地面を掘削を開始し、そのヒューズがトリガされると爆発するか、再び再浮上します。攻撃:より多くの電力を使って撮影するホールド
+04:29=これは小さな子供のためのものではありません!ボール銃は爆薬を充填した小さな色のボールのトンを発生させます。攻撃:アップダウン、フルパワーでシュートを目指して進みます
+04:30=強力なナパームストライキを起動するには飛行機の中で呼び出します。適切にこの攻撃を目指してそこに座って不運な豚を含む風景の巨大な部分を根絶することができます。左右:選択してターゲット領域:攻撃方向のカーソルを決定
+04:31=RCプレーンは箱を収集したり、遠く離れた豚を攻撃するのに理想的な武器です。どちらの敵にそれを操縦するか、最初のいくつかの爆弾をドロップします。攻撃:ワルキューレが戦闘に乗りましょう左右:平面ステアジャンプ平面またはドロップロング爆弾を起動します。
+04:32=低重力はどんなダイエットよりも効果的です!高く、長い距離を飛び越えたり、敵がさらに飛ぶしましょう。攻撃:アクティブ
+04:33=時には、いくつかのより多くのダメージを与えるためにその少し余分なブーストをちょうど必要があります。攻撃:アクティブ
+04:34=私に触れることができない!攻撃:アクティブ
+04:35=時には時間が早すぎる実行している。あなたの攻撃を完了するために、いくつかの余分な秒をつかむ。攻撃:アクティブ
+04:36=さて、時にはあなたが目指すのはあまりにも悪いです。現代の技術を使用していくつかの支援を得る。攻撃:アクティブ
+04:37=日光を恐れてはいけません。それはちょうど1ターン持続しますが、あなたが他の豚に何のダメージを吸収することができるようになります。攻撃:アクティブ
+04:38=スナイパーライフルは、あなたの全体の兵器庫の中で最も壊滅的な武器になります、しかし、それは接近戦で非常に効果的です。ダメージは、そのターゲットまでの距離とともに増加を与えた。攻撃:シュート(回)
+04:39=空飛ぶ円盤を使用してマップの他の部分に飛ぶ。これは、マスターユーティリティのハード戦場のほぼ任意の位置に行くことができるようになりました。攻撃:最大アクティブ左右:ドロップ手榴弾または類似の武器:一方向にロングジャンプ力を適用します。
+04:40=(すぐになる)、燃焼液で満たされたこのボトルを使用して、火災のいくつかの地を設定します。攻撃:より多くの電力を使って撮影するホールド
+04:41=証拠の性質も、空飛ぶ円盤を上回るかもしれません。バーディは、豚を持ち歩くとあなたの敵に卵をドロップすることができます!バーディーを使用すると、あなたのターンの時間に食べるように、迅速である!攻撃:およびドロップ卵アップ左右:一方向にフラップ
+04:42=この携帯ポータル装置は、瞬時に、あなたの敵、または地形上の2点間のあなたの武器あなたを輸送することが可能です。賢明にそれを使用して、キャンペーンがあります...大成功!攻撃:サイクルポータルの色:ポータルスイッチを撃つ
+04:43=あなたの音楽デビュー爆発を成功させる!天からピアノをドロップしますが、注意してください...誰かがそれを再生する必要があり、それはあなたの人生を要するかもしれない!カーソル:選択してターゲット領域F1-F9キーを押して:ピアノを弾く
+04:44=これはただのチーズではなく、生物兵器だ!タイマーがゼロに達すると、それは間違いなく臭いをタッチする誰もが不幸に毒されたら、それは被害の膨大な量が発生することはありません!1-5:セットグレネードのタイマー攻撃:より多くの電力をスローするようにホールド
+04:45=すべてのそれらの物理学のクラスは最終的に報われている、あなたの敵に壊滅的な正弦波を起動します。気を付けろ、この武器は非常にキックをパックします。(この武器は不完全です)攻撃力:シュート
+04:46=液体炎を非常に暑いとあなたの敵をカバーしています。ほのぼの!アタックを上下にアクティブにします。左右を目指して進みます:唾の電源を変更します。
+04:47=2先端のとがった、卑劣な、粘着地雷の楽しみを倍増。連鎖反応を設定するか(あるいは両方!)攻撃を守る:より多くの電力(倍)で撮影するホールド
+04:48=なぜモルすべての虐待を取得する必要があります?豚をは、単に楽しみとしてすることができます!このハンマーから良い打撃は豚の健康状態の3分の1をオフに剃るし、それらを地下に突入します。攻撃:アクティブ
+04:49=あなたの友人を復活させる!しかし、これはまたあなたの敵を復活させること注意してください。攻撃:ゆっくりと復活させるために押された攻撃に注意してください。復活を加速
+04:50=誰かが地下に隠れている?ドリルのストライキでそれらを掘る!タイマーは、それを掘る方法をはるかに制御します。
+04:51=泥のボールを投げつけることによって自由なショットで取得します。刺されは、ビット、豚をバックノックする。
+04:52=UNUSED
+04:53=あなたの仲間が単独で戦うために残しながら、時間と空間を介して冒険に出る。いつでも返すように準備する、または突然死の場合、または、それらはすべて敗北しています。免責事項。あなたは一人である場合は、突然死で機能するか、キングである場合ではありません。
+04:54=INCOMPLETE
+04:55=スティッキーフレークのストリームをスプレー。トンネルを封鎖、敵を埋める、ブリッジを構築します。あなたが上の任意のを取得しないように注意してください!
+
+; Game goal strings
+05:00=ゲームモード
+05:01=次の規則が適用されます
+05:02=砦:あなたの要塞を守り、敵を打ち負かす!
+05:03=低重力:足元に気をつけて
+05:04=不死身:豚は不死身(ほぼ)です。
+05:05=吸血鬼:豚は、ダメージのために癒される
+05:06=カルマ:豚は、ダメージのために破損します。
+05:07=キングを保護する:あなたの王が死んではいけない|場所キング:あなたの王のために保護された出発点をピック
+05:08=場所のハリネズミ:ゲームが起動する前に、豚を置きます
+05:09=砲兵:豚の位置を変更するには、歩くことができない
+05:10=不滅の地形:ほとんどの武器は地形を破壊することはありません
+05:11=共有弾薬:同じ色のすべてのチームが彼らの弾薬を共有する
+05:12=鉱山タイマー:鉱山は、%1秒後()を爆発します。
+05:13=鉱山タイマ:鉱山は即座に爆発します。
+05:14=鉱山タイマ:鉱山は0の後に爆発します。 0- 5秒
+05:15=ダメージ修正:すべての武器は、%1%のダメージを行います
+05:16=すべての豚の健康状態はターン終了時にリセットされます。
+05:17=死の豚のリスポーン
+05:18=無限の攻撃
+05:19=武器はターン終了時にリセットされます。
+05:20=武器は豚の間で共有されていません
+05:21=タグチーム:一族のチームは、連続ターンを取る|共有時間:一族の株のターン時間内にチーム
diff --git a/share/hedgewars/Data/Locale/ko.lua b/share/hedgewars/Data/Locale/ko.lua
index d097a12..6e243f6 100644
--- a/share/hedgewars/Data/Locale/ko.lua
+++ b/share/hedgewars/Data/Locale/ko.lua
@@ -2,158 +2,642 @@ locale = {
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Accuracy Bonus!"] = "",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
 --      ["Aiming Practice"] = "", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 --      ["Bat balls at your enemies and|push them into the sea!"] = "",
 --      ["Bat your opponents through the|baskets and out of the map!"] = "",
 --      ["Bazooka Training"] = "",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 --      ["Best laps per team: "] = "",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 --      ["Bloody Rookies"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 --      ["Boom!"] = "",
 --      ["BOOM!"] = "",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["CAPTURE THE FLAG"] = "",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 --      ["Codename: Teamwork"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
 --      ["Congratulations!"] = "",
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 --      ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 --      ["Control pillars to score points."] = "",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Cybernetic Empire"] = "",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 --      ["DAMMIT, ROOKIE!"] = "",
 --      ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "",
 --      ["Dangerous Ducklings"] = "",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 --      ["Eliminate all enemies"] = "",
 --      ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 --      ["Eliminate Poison before the time runs out"] = "",
 --      ["Eliminate the Blue Team"] = "",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
 --      ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 --      ["Enjoy the swim..."] = "",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 --      ["Fastest lap: "] = "",
 --      ["Feeble Resistance"] = "",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Flag captured!"] = "",
 --      ["Flag respawned!"] = "",
 --      ["Flag returned!"] = "",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
 --      ["GAME OVER!"] = "",
 --      ["Game Started!"] = "",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 --      ["Get on over there and take him out!"] = "",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
 --      ["GO! GO! GO!"] = "",
 --      ["Good birdy......"] = "",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 --      ["Good luck out there!"] = "",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 --      ["Hedgewars-Basketball"] = "",
 --      ["Hedgewars-Knockball"] = "",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
 --      ["Hmmm..."] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["Hooray!"] = "",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 --      ["Hunter"] = "", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 --      ["Instructor"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 --      ["Listen up, maggot!!"] = "",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 --      ["|- Mines Time:"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION FAILED"] = "", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
 --      ["MISSION SUCCESSFUL"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
 --      ["NEW fastest lap: "] = "",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Not So Friendly Match"] = "", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Oh no! Just try again!"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["Oh no! Time's up! Just try again."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Operation Diver"] = "",
 --      ["Opposing Team: "] = "",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 --      ["Pathetic Hog #%d"] = "",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 --      ["Poison"] = "",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 --      [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 --      ["RULES OF THE GAME [Press ESC to view]"] = "",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 --      ["See ya!"] = "",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -162,59 +646,338 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 --      ["Shotgun Team"] = "",
 --      ["Shotgun Training"] = "",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["%s is out and Team %d|scored a penalty!| |Score:"] = "", -- Basketball, Knockball
 --      ["%s is out and Team %d|scored a point!| |Score:"] = "", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 --      ["Sniper Training"] = "",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 --      ["Spooky Tree"] = "",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Team %d: "] = "",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["That was pointless."] = "",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 --      ["The enemy is hiding out on yonder ducky!"] = "",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 --      ["The flag will respawn next round."] = "",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["TIME: "] = "",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 --      ["Toxic Team"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 --      ["TrophyRace"] = "",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 --      ["T_T"] = "",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 --      ["Unit 3378"] = "",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Use your rope to get from start to finish as fast as you can!"] = "",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 --      ["Victory for the "] = "", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You have SCORED!!"] = "",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You've failed. Try again."] = "",
 --      ["You've reached the goal!| |Time: "] = "",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/lt.lua b/share/hedgewars/Data/Locale/lt.lua
index a31fffc..46fca6c 100644
--- a/share/hedgewars/Data/Locale/lt.lua
+++ b/share/hedgewars/Data/Locale/lt.lua
@@ -2,156 +2,640 @@ locale = {
    [":("] = ":(",
    ["!!!"] = "!!!",
    ["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
    ["Accuracy Bonus!"] = "Taiklumo Bonusas!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
    ["a Hedgewars mini-game"] = "Eþiu karu mini þaidimas", -- Space_Invasion, The_Specialists
    ["Aiming Practice"] = "Taiklumo Treniruotë", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
    ["Ammo Depleted!"] = "Nusodrintojo Kulkos!",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
    ["Ammo"] = "Kulkos",
    ["Ammo Maniac!"] = "Kulku Maniakas!",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
    ["Available points remaining: "] = "Pajamumu taðku liko: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
    ["Bat balls at your enemies and|push them into the sea!"] = "Dauþk is kamuoliu i savo prieðus|ir nustumk juos i jûra!",
    ["Bat your opponents through the|baskets and out of the map!"] = "Dauþk savo obonentus pro kaðes|ir ið þemëlapio!",
    ["Bazooka Training"] = "Bazukos Treniruotë",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
    ["Best laps per team: "] = "Geriausi ratai per komanda: ",
    ["Best Team Times: "] = "Geriausios komandos laikai: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
    ["Bloody Rookies"] = "Prakeikti Eiliniai", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
    ["Boom!"] = "Boom!",
    ["BOOM!"] = "BOOM!",
    ["Boss defeated!"] = "Bosas Nugalëtas!",
    ["Boss Slayer!"] = "Bosu Þudikas!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
    ["CAPTURE THE FLAG"] = "Pagriebk Vëliava",
    ["Careless"] = "Neatsargus",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
    ["Clumsy"] = "Durnelis",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
    ["Codename: Teamwork"] = "Kodas: Komandinis Darbas",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
    ["Complete the track as fast as you can!"] = "Apvaryk trasa taip greitai kaip gali!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
    ["Congratulations!"] = "Sveikinu!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
    ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Sveikinu! Tu pradanginai visus taikinius|per leista laika.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
    ["Control pillars to score points."] = "Valdyk stulpus ir gausi taðku.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
    ["Cybernetic Empire"] = "Kibernetinë Karalystë",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
    ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "PO VELNIU EILINI NULIPK MAN NUO GALVOS!",
    ["DAMMIT, ROOKIE!"] = "PO VELNIU EILINI!",
    ["Dangerous Ducklings"] = "Pavojingos Antis",
    ["Deadweight"] = "Dedveitas",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
    ["Depleted Kamikaze!"] = "Nusodrintojo Kamikaze!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
    ["Destroy invaders to score points."] = "Sunaikink Isiverþëjus Ir Gauk Taðku.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
    ["Drone Hunter!"] = "Drone Medþiotojas!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
    ["Drowner"] = "Skendëjas",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
    ["Each turn you get 1-3 random weapons"] = "Kekviena Eile Gausi 1-3 Atsitiktiniu Ginklu",
    ["Each turn you get one random weapon"] = "Kekviena Eile Gausi Po Viena Atsitiktini Ginkla",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
    ["Eliminate all enemies"] = "Nugalëk Visus Prieðus",
    ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Sunaikink Visus taikinius kol neiðseko laikas.|Ðitai misijai gausi nesibaigianèiu kulku.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
    ["Eliminate Poison before the time runs out"] = "Sunaikink Nuodus kol nepasibaigë laikas",
    ["Eliminate the Blue Team"] = "Sunaikink Mëlyna komanda",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
    ["Eliminate the enemy specialists."] = "Sunaikink prieðus specialistus.",
    ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Sunaikink Tipa 3378 |- Silpnaus atsparumo tvirtovë turi iðlikti",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
    ["Enjoy the swim..."] = "Pasimëgauk Rlaukimu...",
    ["[Enter]"] = "[ENTER"],
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
    ["Fastest lap: "] = "Greièiausias Ratas: ",
    ["Feeble Resistance"] = "Silpnaus Atsparumo Tvirtovë",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
    ["Fire"] = "Ugnis",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
    ["Flag captured!"] = "Vëliava Pagrobta!",
    ["Flag respawned!"] = "Vëliava Atsigavo!",
    ["Flag returned!"] = "Vëliava Sugraþinta!",
    ["Flags, and their home base will be placed where each team ends their first turn."] = "Vëliavos, Ir Ju Bazës Bus Padëtos Kur Kekviena Komanda Pabaigs Ëjima.",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
    ["GAME BEGUN!!!"] = "Þaidimas Prasidëjo!!!",
    ["Game Modifiers: "] = "Þaidimo Modifikatoriai: ",
    ["GAME OVER!"] = "Þaidimas Baigtas!",
    ["Game Started!"] = "Þaidimas Prasidëjo!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
    ["Get on over there and take him out!"] = "Nueik Ten Ir Nudauþk Ji!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
    ["Goal"] = "Ðaunu!",
    ["GO! GO! GO!"] = "Bëk! Bëk! Bëk!",
    ["Good birdy......"] = "Geras Paukðtelis......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
    ["Good luck out there!"] = "Sëkmës Tau Ten!",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
    ["GOTCHA!"] = "Prigavau!",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
    ["Hahahaha!"] = "Hahahaha!",
    ["Haha, now THAT would be something!"] = "Haha, na tai jau butu kaþkas!",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
    [" Hapless Hogs left!"] = " Nelaimingu Eþiu Liko!",
    ["Hapless Hogs"] = "Nelaimingi Eþiai",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
    ["Heavy"] = "Sunku",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
    ["Hedgewars-Basketball"] = "Eþiukaru-Krepðinis",
    ["Hedgewars-Knockball"] = "Eþiukaru-Trenktaskamuolys",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
    ["Heh, it's not that bad."] = "Heh,nëra taip blogai.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
    ["Hit Combo!"] = "Pataikimo Bonusas!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
    ["Hmmm..."] = "Hmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
    ["Hooray!"] = "Hurah!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
    ["Hunter"] = "Medþiotojas", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
    ["Instructor"] = "Instruktorius", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
    ["invaders destroyed"] = "isiverþëjai sunaikinti",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
    ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Geras dalykas kad MARAS dar po 99 eiliu...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
    ["Jumping is disabled"] = "Ðokimas ira iðjungtas",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
    ["Kamikaze Expert!"] = "Kamikazes Ekspertas!",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
    ["KILLS"] = "Nuþudymai",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
    ["[Left Shift]"] = "[Kairis Shiftas"],
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
    ["Listen up, maggot!!"] = "Paklausyk eilini!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
    ["|- Mines Time:"] = "|- Minu Laikas:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
    ["MISSION FAILED"] = "Misija Nepavyko", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
    ["MISSION SUCCESSFUL"] = "Misija Buvo Ivykdita", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
    ["MISSION SUCCESS"] = "Misija Pavyko",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
    ["Movement: [Up], [Down], [Left], [Right]"] = "Judëjimas: [I Virðu, [I Apaèia], [I Kaire], [I Deðine]"],
    ["Multi-shot!"] = "Dvigubas-Ðuvis!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
    ["Nameless Heroes"] = "Bevardþiai Herojiai",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
    ["NEW CLAN RECORD: "] = "Naujas Klano Rekordas: ",
    ["NEW fastest lap: "] = "Naujas Greièiausias Ratas: ",
 --      ["New Mines Per Turn"] = "",
    ["NEW RACE RECORD: "] = "Naujas Lenktyniu Rekordas: ",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
    ["NOT ENOUGH WAYPOINTS"] = "Neuþtenka Kelio Taðku",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
    ["Not So Friendly Match"] = "Ne Toks Jau Ir Draugiðkas Turnyras", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
    ["Oh no! Just try again!"] = "O NE! Tiesiog Bandyk Vël", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
    ["Oh no! Time's up! Just try again."] = "O NE! Baigësi Laikas! Tiesiog Bandyk Vël.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
    ["Operation Diver"] = "Operacijos Vairuotojas",
    ["Opposing Team: "] = "Pasiprieðinanti Komanda: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
    ["Pathetic Hog #%d"] = "Niekam Tikes Eþys #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
    ["Per-Hog Ammo"] = "Kulkos Per-Eþy",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
    ["Place more waypoints using [ENTER]"] = "Padëk Daugiau Kelio Taðku Su [ENTER"],
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
    ["points"] = "taðkai", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
    ["Poison"] = "Nuodai",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
    ["Power Remaining"] = "Jëgos Liko",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
    ["Press [Precise] to skip intro"] = "Spausk [TaikluNusitaikima kad baigtum iëjima"],
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
    ["Race complexity limit reached."] = "Lenktyniu Sudëtingumo Limitas Pasiektas.",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
    [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Graþink prieðu vëliava i savo baze ir gausi taðku | - Pirma komanda su 3 vëliavom laimi | - Taðkus gausi tik tada kaip tavo vëliava bazëje | - Eþiai pames vëliava jeigu mirs, arba paskes | - Pamestos vëliavos gali buti graþintos arba pavogtos | - Eþiai atsikelia kaip nuþudyti",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
    ["Round Limit"] = "Raundu Limitas",
 --      ["Rounds Complete: "] = "",
    ["Rounds Complete"] = "Raundai Ivykditi",
    ["RULES OF THE GAME [Press ESC to view]"] = "ÞAIDIMO TAISYKLES [Spausk ESC Kad Parodytu"],
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
    ["Save as many hapless hogs as possible!"] = "Iðgelbëk kuo daugiau nelaimingu eþiu!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
    ["SCORE"] = "Taðkai",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
    ["sec"] = "sek", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
    ["See ya!"] = "Iki!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
    ["Shield boosted! +30 power"] = "Skydas Pagerintas! +30 jëga",
    ["Shield Depleted"] = "Skydas Nusodrintas",
    ["Shield is fully recharged!"] = "Skydas Pilnai Pakrautas!",
@@ -160,61 +644,340 @@ locale = {
    ["Shield OFF:"] = "Skydas Iðjungtas:",
    ["Shield ON:"] = "Skydas Ijungtas:",
    ["Shield Seeker!"] = "Skydo Ieðkotojas!",
+--      ["Shotgun"] = "", -- Continental_supplies
    ["Shotgun Team"] = "Ðratinio Ðautuvo Komanda",
    ["Shotgun Training"] = "Ðratinio Ðautuvo Treniruotë",
 --      ["shots remaining."] = "",
    ["Silly"] = "Durnelis",
    ["Sinky"] = "Paskenduolis",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
    ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s Iðkrito ir komanda %d|gavo bausme!| |Score:", -- Basketball, Knockball
    ["%s is out and Team %d|scored a point!| |Score:"] = "%s Iðkrito ir komanda %d|gavo taðka!| |Score:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
    ["Sniper Training"] = "Snaiperio Treniruotë",
    ["Sniperz"] = "Snaiperiai",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
    ["Sponge"] = "Kempinë",
    ["Spooky Tree"] = "Baisusis Medis",
    ["s|"] = "s|",
    ["s"] = "s", -- GaudyRacer, Space_Invasion
    ["STATUS UPDATE"] = "Bûsenos Atnaujinimas", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
    ["Switched to "] = "Pakeistas i ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
    ["Team %d: "] = "Komanda %d: ",
    ["Team Scores"] = "Komandos Taðkai", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
    ["That Sinking Feeling"] = "Tas Skendimo Jausmas",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
    ["That was pointless."] = "Tai Buvo Beprasmiðka.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
    ["The enemy is hiding out on yonder ducky!"] = "Prieðas pasislëpes ant kitos anties!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
    ["The flag will respawn next round."] = "Vëliava atsigaus kita raunda.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
    ["The Nameless One"] = "Bevardis",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
    ["THE SPECIALISTS"] = "Specialistai",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
    ["This rain is really something..."] = "Ðis lietus tikrai kaþkas...",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
    ["Timed Kamikaze!"] = "Laikina Kamikaze!",
    ["Time Extended!"] = "Laikas Prailgintas!",
 --      ["Time Extension"] = "",
    ["TIME: "] = "Laikas: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
    ["Toggle Shield"] = "Perjungti i skyda",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
    ["Toxic Team"] = "Toksinë Komanda", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
    ["TRACK COMPLETED"] = "Trasa Ivykdita",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
    ["TrophyRace"] = "Trophëju Trasa",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
    ["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
    ["Turn Time"] = "Eilës Laikas",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
    ["Unit 3378"] = "Tipas 3378",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
    ["Unlimited Attacks"] = "Nesibaigianèios Atakos",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
    ["User Challenge"] = "Vartotojo Iðukis",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
    ["Use your rope to get from start to finish as fast as you can!"] = "Naudok virve kad nusigautum nuo starto iki finiðo taip greitai kaip gali!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
    ["Victory for the "] = "Pergalë ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
    ["Waypoint placed."] = "Kelio Taðkas Pasiektas.",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
    ["Weapons Reset"] = "Ginklai Atgaivinti",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
    ["WINNING TIME: "] = "Laimëjimo Laikas: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
    ["You'd almost swear the water was rising!"] = "Galima pamanyti kad vanduo tikrai kyla!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
    ["You have SCORED!!"] = "Tu gavai TAÐKU!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
    ["You saved"] = "Tu uþsisavinai",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
    ["You've failed. Try again."] = "Tau nepavyko. Bandyk vël.",
    ["You've reached the goal!| |Time: "] = "Tu pasiekiai taikini!| |Laikas: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
    ["'Zooka Team"] = "'Zukos Komanda",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/missions_da.txt b/share/hedgewars/Data/Locale/missions_da.txt
new file mode 100644
index 0000000..93aa3bb
--- /dev/null
+++ b/share/hedgewars/Data/Locale/missions_da.txt
@@ -0,0 +1,32 @@
+Basic_Training_-_Bazooka.name=Grundliggende Træning med Bazooka
+Basic_Training_-_Bazooka.desc="Nøglen er et bruge vinden til din fordel!"
+
+Basic_Training_-_Grenade.name=Grundliggende Træning med Granater
+Basic_Training_-_Grenade.desc="Husk, FØRST hiver du splitten ud OG SÅ kaster du!"
+
+Basic_Training_-_Shotgun.name=Grundliggende Træning med Haglgevær
+Basic_Training_-_Shotgun.desc="Skyd først, spørg bagefter!"
+
+Basic_Training_-_Sniper_Rifle.name=Grundliggende Træning med Sniperriffel
+Basic_Training_-_Sniper_Rifle.desc="Bum, Lige i Hovedet!"
+
+User_Mission_-_Dangerous_Ducklings.name=Mission: Farlige Ællinger
+User_Mission_-_Dangerous_Ducklings.desc="Udmærket, rekrut! Nu skal vi se om du kan huske hvad du har lært!"
+
+User_Mission_-_Diver.name=Mission: Dykker
+User_Mission_-_Diver.desc="Det der 'amfibieangreb' er sværere end det ser ud..."
+
+User_Mission_-_Teamwork.name=Mission: Samarbejde
+User_Mission_-_Teamwork.desc="Kærlighed gør ondt en gang imellem."
+
+User_Mission_-_Spooky_Tree.name=Mission: Uhyggeligt Træ
+User_Mission_-_Spooky_Tree.desc="Der er masser af kasser derude. Men jeg håber virkelig ikke den fugl er sulten."
+
+User_Mission_-_Bamboo_Thicket.name=Mission: Bambusbuskads
+User_Mission_-_Bamboo_Thicket.desc="Døden kommer oppefra."
+
+User_Mission_-_That_Sinking_Feeling.name=Mission: Følelsen af at Synke
+User_Mission_-_That_Sinking_Feeling.desc="Vandet stiger hurtigt og tiden er knap. Mange har prøvet, men få sejret. Kan du redde dem alle sammen?"
+
+User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton og Hængekøjen
+User_Mission_-_Newton_and_the_Hammock.desc="Husk, grislinger: Et legemes hastighed forbliver uændret med mindre legemet bliver påvirket af krafter udefra."
\ No newline at end of file
diff --git a/share/hedgewars/Data/Locale/missions_en.txt b/share/hedgewars/Data/Locale/missions_en.txt
index b2d2f52..64898bc 100644
--- a/share/hedgewars/Data/Locale/missions_en.txt
+++ b/share/hedgewars/Data/Locale/missions_en.txt
@@ -1,32 +1,50 @@
-Basic_Training_-_Bazooka.name=Basic Bazooka Training
-Basic_Training_-_Bazooka.desc="Using the wind to your advantage is key!"
-
-Basic_Training_-_Grenade.name=Basic Grenade Training
-Basic_Training_-_Grenade.desc="Remember, you pull the pin out AND throw!"
-
-Basic_Training_-_Shotgun.name=Basic Shotgun Training
-Basic_Training_-_Shotgun.desc="Shoot first, ask questions later!"
-
-Basic_Training_-_Sniper_Rifle.name=Basic Sniper Rifle Training
-Basic_Training_-_Sniper_Rifle.desc="Boom, headshot!"
-
-User_Mission_-_Dangerous_Ducklings.name=Mission: Dangerous Ducklings
-User_Mission_-_Dangerous_Ducklings.desc="Alright, rookie! Time to put what we learned in Basic Training into practice!"
-
-User_Mission_-_Diver.name=Mission: Diver
-User_Mission_-_Diver.desc="This 'amphibious assault' thing is harder than it looks..."
-
-User_Mission_-_Teamwork.name=Mission: Teamwork
-User_Mission_-_Teamwork.desc="Sometimes, love hurts."
-
-User_Mission_-_Spooky_Tree.name=Mission: Spooky Tree
-User_Mission_-_Spooky_Tree.desc="Lots of crates out here. I sure hope that bird ain't feeling hungry."
-
-User_Mission_-_Bamboo_Thicket.name=Mission: Bamboo Thicket
-User_Mission_-_Bamboo_Thicket.desc="Death comes from above."
-
-User_Mission_-_That_Sinking_Feeling.name=Mission: That Sinking Feeling
-User_Mission_-_That_Sinking_Feeling.desc="The water is rising rapidly and time is limited. Many have tried and failed. Can you save them all?"
-
-User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton and the Hammock
-User_Mission_-_Newton_and_the_Hammock.desc="Remember hoglets: The velocity of a body remains constant unless the body is acted upon by an external force!"
+Basic_Training_-_Bazooka.name=Basic Bazooka Training
+Basic_Training_-_Bazooka.desc="Using the wind to your advantage is key!"
+
+Basic_Training_-_Grenade.name=Basic Grenade Training
+Basic_Training_-_Grenade.desc="Remember, you pull the pin out AND throw!"
+
+Basic_Training_-_Cluster_Bomb.name=Basic Cluster Bomb Training
+Basic_Training_-_Cluster_Bomb.desc="Someone needs hot shower!"
+
+Basic_Training_-_Shotgun.name=Basic Shotgun Training
+Basic_Training_-_Shotgun.desc="Shoot first, ask questions later!"
+
+Basic_Training_-_Sniper_Rifle.name=Basic Sniper Rifle Training
+Basic_Training_-_Sniper_Rifle.desc="Boom, headshot!"
+
+Basic_Training_-_Rope.name=Basic Rope Training
+Basic_Training_-_Rope.desc="Get out there and swing!"
+
+User_Mission_-_Dangerous_Ducklings.name=Mission: Dangerous Ducklings
+User_Mission_-_Dangerous_Ducklings.desc="Alright, rookie! Time to put what we learned in Basic Training into practice!"
+
+User_Mission_-_Diver.name=Mission: Diver
+User_Mission_-_Diver.desc="This 'amphibious assault' thing is harder than it looks..."
+
+User_Mission_-_Teamwork.name=Mission: Teamwork
+User_Mission_-_Teamwork.desc="Sometimes, love hurts."
+
+User_Mission_-_Spooky_Tree.name=Mission: Spooky Tree
+User_Mission_-_Spooky_Tree.desc="Lots of crates out here. I sure hope that bird ain't feeling hungry."
+
+User_Mission_-_Bamboo_Thicket.name=Mission: Bamboo Thicket
+User_Mission_-_Bamboo_Thicket.desc="Death comes from above."
+
+User_Mission_-_That_Sinking_Feeling.name=Mission: That Sinking Feeling
+User_Mission_-_That_Sinking_Feeling.desc="The water is rising rapidly and time is limited. Many have tried and failed. Can you save them all?"
+
+User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton and the Hammock
+User_Mission_-_Newton_and_the_Hammock.desc="Remember hoglets: The velocity of a body remains constant unless the body is acted upon by an external force!"
+
+User_Mission_-_The_Great_Escape.name=Mission: The Great Escape
+User_Mission_-_The_Great_Escape.desc="You think you can cage me!?"
+
+User_Mission_-_Rope_Knock_Challenge.name=Challenge: Rope Knocking
+User_Mission_-_Rope_Knock_Challenge.desc="Look behind you!"
+
+User_Mission_-_RCPlane_Challenge.name=Challenge: RC Plane
+User_Mission_-_RCPlane_Challenge.desc="Feeling pretty confident, eh, flyboy?"
+
+portal.name= Mission: Portal training mission
+portal.desc="Use the portal to move fast and far, use it to kill, use it with caution!"
diff --git a/share/hedgewars/Data/Locale/missions_fr.txt b/share/hedgewars/Data/Locale/missions_fr.txt
new file mode 100644
index 0000000..244c653
--- /dev/null
+++ b/share/hedgewars/Data/Locale/missions_fr.txt
@@ -0,0 +1,47 @@
+Basic_Training_-_Bazooka.name=Initiation au Bazooka
+Basic_Training_-_Bazooka.desc="Pour gagner, utiliser le vent à votre avantage !" 
+
+Basic_Training_-_Grenade.name=Entrainement au lancer de Grenade
+Basic_Training_-_Grenade.desc="Souvenez vous, retirez la goupille et lancez !"
+
+Basic_Training_-_Cluster_Bomb.name=Entrainement au lancer de grenade à fragmentation
+Basic_Training_-_Cluster_Bomb.desc="Quelqu'un à besoin d'une bonne douche !"
+
+Basic_Training_-_Shotgun.name=Initiation au Fusil
+Basic_Training_-_Shotgun.desc="On tire d'abord, on pose les questions après !"
+
+Basic_Training_-_Sniper_Rifle.name=Initiation au Sniper
+Basic_Training_-_Sniper_Rifle.desc="Pan ! En pleine tête !"
+
+Basic_Training_-_Rope.name=Initiation à la Corde Ninja
+Basic_Training_-_Rope.desc="Bouge de là et Balance toi !"
+
+User_Mission_-_Dangerous_Ducklings.name=Mission: Canards dangereux 
+User_Mission_-_Dangerous_Ducklings.desc="Très bien le bleu, il est temps de mettre en pratique ce que tu as appris aux entraînements !" 
+
+User_Mission_-_Diver.name=Mission: Diver
+User_Mission_-_Diver.desc="Cet assault 'sous-marin' est plus dur que cela n'y paraît...." 
+
+User_Mission_-_Teamwork.name=Mission: Travail en équipe
+User_Mission_-_Teamwork.desc="Parfois, l'amour blesse."
+
+User_Mission_-_Spooky_Tree.name=Mission: L'arbre qui parle
+User_Mission_-_Spooky_Tree.desc="Beaucoup de caisses par ici. J'espère vraiment que cet oiseau n'a pas faim."
+
+User_Mission_-_Bamboo_Thicket.name=Mission: Forêt de Bamboo 
+User_Mission_-_Bamboo_Thicket.desc="La mort vient d'en haut."
+
+User_Mission_-_That_Sinking_Feeling.name=Mission: Cette impression de naufrage
+User_Mission_-_That_Sinking_Feeling.desc="L'eau monte rapidement et le temps est compté. Beaucoup ont essayé, sans succès.Pouvez vous tous les sauvez ?"
+
+User_Mission_-_Newton_and_the_Hammock.name=Mission: Newton et le Hammac
+User_Mission_-_Newton_and_the_Hammock.desc="Souvenez vous petits hérissons : La vitesse d'un corps reste constante à moins que ce corps ne soit attiré par une force extérieure!"
+
+User_Mission_-_The_Great_Escape.name=Mission: La grande évasion
+User_Mission_-_The_Great_Escape.desc="Tu pense que tu peux me capturer ?!"
+
+User_Mission_-_Rope_Knock_Challenge.name=Challenge: A coup de Corde Ninja
+User_Mission_-_Rope_Knock_Challenge.desc="Regarde derrière toi !"
+
+User_Mission_-_RCPlane_Challenge.name=Challenge: Avion télécommandé
+User_Mission_-_RCPlane_Challenge.desc="Plutôt confiant, hein, aviateur ?" 
\ No newline at end of file
diff --git a/share/hedgewars/Data/Locale/missions_it.txt b/share/hedgewars/Data/Locale/missions_it.txt
new file mode 100644
index 0000000..20c1e50
--- /dev/null
+++ b/share/hedgewars/Data/Locale/missions_it.txt
@@ -0,0 +1,47 @@
+Basic_Training_-_Bazooka.name=Addestramento base sull'utilizzo del Bazooka
+Basic_Training_-_Bazooka.desc="Utilizzare il vento a proprio vantaggio costituisce la soluzione ad ogni problema!"
+
+Basic_Training_-_Grenade.name=Addestramento base sull'utilizzo delle Granate
+Basic_Training_-_Grenade.desc="Ricorda, toglierai PRIMA la sicura e POI lancerai la granata!"
+
+Basic_Training_-_Cluster_Bomb.name=ddestramento base sull'utilizzo delle Granate a Grappolo
+Basic_Training_-_Cluster_Bomb.desc="Qualcuno ha bisogno di una doccia (molto) calda!"
+
+Basic_Training_-_Shotgun.name=Addestramento base sull'utilizzo del Fucile a Pompa
+Basic_Training_-_Shotgun.desc="Prima spara, poi poniti delle domande!"
+
+Basic_Training_-_Sniper_Rifle.name=Addestramento base sull'utilizzo del Fucile di Precisione
+Basic_Training_-_Sniper_Rifle.desc="Sii preciso come non mai con il fucile di precisione! E attenzione a non sbagliare troppi colpi!"
+
+Basic_Training_-_Rope.name=Addestramento base sull'utilizzo della Corda
+Basic_Training_-_Rope.desc="Preparati ad arrivare ovunque grazie alla migliore delle corde esistenti sul mercato!"
+
+User_Mission_-_Dangerous_Ducklings.name=Missione: Anatroccoli Pericolosi
+User_Mission_-_Dangerous_Ducklings.desc="Sii pronto, recluta! E' tempo di mettere a frutto quanto imparato durante l'addestramento base!"
+
+User_Mission_-_Diver.name=Missione: Operazione Sub
+User_Mission_-_Diver.desc="Questo 'assalto anfibio' è più difficile di quanto sembri..."
+
+User_Mission_-_Teamwork.name=Missione: Lavoro di Squadra
+User_Mission_-_Teamwork.desc="Talvolta, l'amore fa male!"
+
+User_Mission_-_Spooky_Tree.name=Missione: Albero Stregato
+User_Mission_-_Spooky_Tree.desc="Ci sono tantissimi barili qui! Speriamo vivamente che quegli uccellacci non siano affamati!"
+
+User_Mission_-_Bamboo_Thicket.name=Missione: Boschetto di Bambù
+User_Mission_-_Bamboo_Thicket.desc="La morte arriva dall'alto."
+
+User_Mission_-_That_Sinking_Feeling.name=Missione: Quella Sensazione di Affogare...
+User_Mission_-_That_Sinking_Feeling.desc="L'acqua sale molto rapidamente ed il tempo è fortemente limitato. Molti hanno provato e hanno fallito. Riuscirai a salvare tutti i ricci sfortunati?"
+
+User_Mission_-_Newton_and_the_Hammock.name=Missione: Newton e l'Amaca
+User_Mission_-_Newton_and_the_Hammock.desc="Ricordate ricci: la velocità di un corpo rimane costante a meno che non intervenga una forza esterna ad esso!"
+
+User_Mission_-_The_Great_Escape.name=Missione: La Grande Fuga
+User_Mission_-_The_Great_Escape.desc="Pensi ancora di potermi imprigionare!?"
+
+User_Mission_-_Rope_Knock_Challenge.name=Sfida: A Colpi di Corda
+User_Mission_-_Rope_Knock_Challenge.desc="Guarda sempre dietro di te!"
+
+User_Mission_-_RCPlane_Challenge.name=Sfida: Aereo Radiocomandato
+User_Mission_-_RCPlane_Challenge.desc="Ti senti abbastanza sicuro, eh, aviatore?"
\ No newline at end of file
diff --git a/share/hedgewars/Data/Locale/missions_pl.txt b/share/hedgewars/Data/Locale/missions_pl.txt
index a80158c..7b4f2f5 100644
--- a/share/hedgewars/Data/Locale/missions_pl.txt
+++ b/share/hedgewars/Data/Locale/missions_pl.txt
@@ -4,6 +4,9 @@ Basic_Training_-_Bazooka.desc="Pamiętaj o tym, że wiatr może działać na two
 Basic_Training_-_Grenade.name=Podstawy rzucania granatami
 Basic_Training_-_Grenade.desc="Najpierw wyciÄ…gasz zawleczkÄ™, POTEM rzucasz!"
 
+Basic_Training_-_Cluster_Bomb.name=Podstawy rzucania bomb kasetowych
+Basic_Training_-_Cluster_Bomb.desc="KtoÅ› tutaj czeka na gorÄ…cy prysznic..."
+
 Basic_Training_-_Shotgun.name=Podstawy strzelania ze strzelby
 Basic_Training_-_Shotgun.desc="Wpierw strzelaj. Pytania zadasz później."
 
diff --git a/share/hedgewars/Data/Locale/pl.lua b/share/hedgewars/Data/Locale/pl.lua
index 40f6158..92aadce 100644
--- a/share/hedgewars/Data/Locale/pl.lua
+++ b/share/hedgewars/Data/Locale/pl.lua
@@ -2,156 +2,640 @@ locale = {
     [":("] = ":(",
     ["!!!"] = "!!!",
     ["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
     ["Accuracy Bonus!"] = "Bonus za celność",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
     ["Achievement Unlocked"] = "Zdobyłeś Osiągnięcie!", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
     ["a Hedgewars mini-game"] = "Mini gra", -- Space_Invasion, The_Specialists
     ["Aiming Practice"] = "Potrenuj celność",
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
     ["Ammo"] = "Amunicja",
     ["Ammo Depleted!"] = "Koniec amunicji!",
 --      ["ammo extended!"] = "",
     ["Ammo is reset at the end of your turn."] = "Amunicja jest resetowana przy końcu tury.",
     ["Ammo Maniac!"] = "Nabojowy Maniak!",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
     ["Available points remaining: "] = "Pozostały następujące punkty: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
     ["Barrel Eater!"] = "Pożeracz Beczek!",
     ["Barrel Launcher"] = "Wyrzutnia Beczek",
+--      ["Baseballbat"] = "", -- Continental_supplies
     ["Bat balls at your enemies and|push them into the sea!"] = "Uderzaj piłkami w swoich przeciwników|i strącaj ich do wody!",
     ["Bat your opponents through the|baskets and out of the map!"] = "Uderzaj swoich przeciwników|wyrzucając przez kosz, poza mapę!",
     ["Bazooka Training"] = "Trening bazooki",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
     ["Best laps per team: "] = "Najszybsze okrążenie drużyny: ",
     ["Best Team Times: "] = "Najlepszy czas zespołów",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
     ["Bloody Rookies"] = "Żółtodzioby",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
     ["Boom!"] = "BUM!",
     ["BOOM!"] = "BUM!",
     ["Boss defeated!"] = "Boss pokonany!",
     ["Boss Slayer!"] = "Pogromca bossów",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
     ["Build a track and race."] = "Zbuduj trasę i ścigaj się.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
     ["CAPTURE THE FLAG"] = "PRZECHWYĆ FLAGĘ",
     ["Careless"] = "Nieostrożny",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
     ["Change Weapon"] = "Zmień broń",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
     ["Clumsy"] = "Fajtłapa",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
     ["Codename: Teamwork"] = "Kryptonim: Praca zespołowa",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
     ["Complete the track as fast as you can!"] = "Ukończ trasę tak szybko jak tylko potrafisz!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
     ["Congratulations!"] = "Gratulacje",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
     ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Gratulacje! Zniszczyłeś wszystkie cele przed upłynięciem czasu.",  
+--      ["Continental supplies"] = "", -- Continental_supplies
     ["Control pillars to score points."] = "Kontroluj filary by zdobyć punkty",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
     ["Cybernetic Empire"] = "Cybernetyczne Imperium",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
     ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "Młody!!! Złaź z mojej głowy!!!",
     ["DAMMIT, ROOKIE!"] = "Żółtodziobie!",
     ["Dangerous Ducklings"] = "Niebezpieczne Kaczory",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
     ["Demolition is fun!"] = "Rozwałka jest fajna!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
     ["Destroy invaders to score points."] = "Zabijaj najeźdźców by zdobyć punkty.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
+--      ["DOUBLE KILL"] = "", -- Mutant
     ["Double Kill!"] = "Podwójna śmierć!",
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
     ["Drone Hunter!"] = "Łowca dronów",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
     ["Each turn you get 1-3 random weapons"] = "Z każdą turą dostaniesz 1-3 bronie",
     ["Each turn you get one random weapon"] = "Z każdą turą dostaniesz losową broń",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
     ["Eliminate all enemies"] = "Wyeliminuj wszystkich przeciwników",
     ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Zniszcz wszystkie cele zanim upłynie czas.|W tej misji masz nieskończoną ilość amunicji.", 
+    ["Eliminate enemy hogs and take their weapons."] = "Ukatrup jeże przeciwnika i przejmij ich bronie.", -- Highlander
     ["Eliminate Poison before the time runs out"] = "Zabij Truciciela zanim skończy się czas",
     ["Eliminate the Blue Team"] = "Zniszcz niebieską drużynę",
     ["Eliminate the enemy before the time runs out"] = "Wyeliminuj przeciwnika przed upłynięciem czasu.", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
     ["Eliminate the enemy hogs to win."] = "Wybij jeże przeciwnika by wygrać.",
     ["Eliminate the enemy specialists."] = "Zabij specjalistów wroga.",
     ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Rozwal Jednostkę 3378 |- Twoja drużyna musi przetrwać",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     ["Energetic Engineer"] = "Energetyczny Inżynier",
     ["Enjoy the swim..."] = "Popływaj trochę...",
     ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
     ["Fastest lap: "] = "Najszybsze okrążenie: ",
     ["Feeble Resistance"] = "Ruch Oporu",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
     ["Fire"] = "Ogień",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
     ["Flag captured!"] = "Flaga przechwycona!",
     ["Flag respawned!"] = "Flaga przywrócona!",
     ["Flag returned!"] = "Flaga odzyskana!",
     ["Flags, and their home base will be placed where each team ends their first turn."] = "Flagi i baza zostaną umieszczone tam gdzie zespół zakończy swą pierwszą turę.",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
     ["fuel extended!"] = "zdobyto paliwo",
     ["GAME BEGUN!!!"] = "GRA ROZPOCZĘTA!!!",
     ["Game Modifiers: "] = "Modyfikatory: ",
     ["GAME OVER!"] = "KONIEC GRY!",
     ["Game Started!"] = "Gra Rozpoczęta",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
     ["Get on over there and take him out!"] = "Dostań się tam i go wykończ!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
     ["Goal"] = "Gol",
     ["GO! GO! GO!"] = "RUCHY! RUCHY! RUCHY!",
     ["Good birdy......"] = "Dooobry ptaszek...",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
     ["Good luck out there!"] = "Powodzenia!",
     ["Good so far!"] = "Jak dotÄ…d idzie dobrze!",
     ["Good to go!"] = "Gotowi do akcji!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
     ["GOTCHA!"] = "MAM CIĘ!",
     ["Grab Mines/Explosives"] = "Chwyć miny/beczki",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
     ["Hahahaha!"] = "Hahahaha!",
     ["Haha, now THAT would be something!"] = "Haha, to było by COŚ",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
     [" Hapless Hogs left!"] = " Nieszczęsne Jeże pozostały",
     ["Hapless Hogs"] = "Nieszczęsne Jeże",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
     ["Health crates extend your time."] = "Apteczki dodajÄ… czas.",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
     ["Hedgewars-Basketball"] = "Hedgewars-Koszykówka",
     ["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
     ["Heh, it's not that bad."] = "Heh, nie jest aż tak źle.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
     ["Hit Combo!"] = "Combo!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
     ["Hmmm..."] = "Hmmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
     ["Hooray!"] = "Hurraaa!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
     ["Hunter"] = "Strzelec",  
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
     ["Instructor"] = "Instruktor",  
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
     ["invaders destroyed"] = "najeźdźców zniszczonych",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
     ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Jak to dobrze, że Nagła Śmierć jest dopiero za 99 tur...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
     ["Jumping is disabled"] = "Skakanie jest niemożliwe",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
     ["Keep it up!"] = "Tak trzymaj!",
+--      ["Kerguelen"] = "", -- Continental_supplies
     ["Killing spree!"] = "Masakra!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
     ["KILLS"] = "Zabicia",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
     ["Last Target!"] = "Ostatni cel!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     ["[Left Shift]"] = "[Lewy Shift]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
     ["Listen up, maggot!!"] = "SÅ‚uchaj mnie, gnido!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
     ["Lively Lifeguard"] = "Ratownik!",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
     ["Mine Eater!"] = "Pożeracz min!",
     ["|- Mines Time:"] = "|- Czas detonacji min:",
     ["MISSION FAILED"] = "MISJA ZAKOŃCZONA NIEPOWODZENIEM", 
     ["MISSION SUCCESSFUL"] = "MISJA POWIODŁA SIĘ",  
     ["MISSION SUCCESS"] = "MISJA ZAKOŃCZONA SUKCESEM",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
     ["Movement: [Up], [Down], [Left], [Right]"] = "Poruszanie się: [Góra], [Dół], [Lewo], [Prawo]",
     ["Multi-shot!"] = "Wielokrotny strzał",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
     ["Nameless Heroes"] = "Bezimienni Bohaterowie",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
     ["New Barrels Per Turn"] = "Ilość beczek dodanych co turę",
     ["NEW CLAN RECORD: "] = "NOWY REKORD ZESPOŁU: ",
     ["NEW fastest lap: "] = "NOWE najszybsze okrążenie: ",
     ["New Mines Per Turn"] = "Ilość min dodanych co turę",
     ["NEW RACE RECORD: "] = "NOWY REKORD WYÅšCIGU: ",
     ["Newton's Hammock"] = "Hamak Newtona",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+    ["Not all hogs are born equal."] = "Nie wszystkie jeże rodzą się równe.", -- Highlander
     ["NOT ENOUGH WAYPOINTS"] = "ZA MAŁO PUNKTÓW KONTROLNYCH",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
     ["Not So Friendly Match"] = "Mecz Nie-Do-Końca Towarzyski",  
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
     ["Oh no! Just try again!"] = "Ojojoj! Spróbuj jeszcze raz!", 
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
     ["Oh no! Time's up! Just try again."] = "Ajajaj! Koniec czasu! Spróbuj jeszcze raz.",  
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
     ["Operation Diver"] = "Operacja Nurek",
     ["Opposing Team: "] = "Przeciwna drużyna",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
     ["Pathetic Hog #%d"] = "Żałosny Jeż #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
     ["Per-Hog Ammo"] = "Oddzielna amunicja dla jeży",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
     ["Place more waypoints using [ENTER]"] = "Postaw więcej punktów orientacyjnych za pomocą [Enteru]",
     ["Place more waypoints using the 'Air Attack' weapon."] = "Postaw więcej punktów orientacyjnych używając [Nalotu]",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
     ["points"] = "punkty", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
     ["Poison"] = "Truciciel",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
     ["Power Remaining"] = "pkt. energii pozostało",
     ["Prepare yourself"] = "Przygotuj siÄ™",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
     ["Press [Precise] to skip intro"] = "Naciśnij [Precyzyjne celowanie] by pominąć intro",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
     ["Race complexity limit reached."] = "Osiągnięto limit złożoności trasy.",
     ["RACER"] = "WYÅšCIG",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
     [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Przynieś flagę wroga do swojej bazy by zdobyć punkt | - Pierwszy kto zrobi to 3 razy, wygrywa | - Punkt zdobywasz tylko gdy twoja flaga znajduje się w bazie | - Jeże upuszczą flagę gdy zostaną zabite bądź utopione | - Upuszczona flaga może być przywrócona lub przechwycona ponownie | - Jeże odradzają się po śmierci",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
     ["Round Limit:"] = "Ilość rund:",
     ["Round Limit"] = "Ilość rund",
-    ["Rounds Complete: "] = "Ukończono rund: ",
     ["Rounds Complete"] = "Koniec",
+    ["Rounds Complete: "] = "Ukończono rund: ",
     ["RULES OF THE GAME [Press ESC to view]"] = "ZASADY GRY [Naciśnij ESC by zobaczyć]",        
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
     ["Save as many hapless hogs as possible!"] = "Uratuj jak najwięcej nieszczęsnych jeży",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
     ["SCORE"] = "PUNKTY",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
     ["sec"] = "sek",
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
     ["See ya!"] = "Do zobaczenia!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
     ["selected!"] = "wybrany!",
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
     ["Shield boosted! +30 power"] = "Osłona ulepszona: +30 energii",
     ["Shield Depleted"] = "Straciłeś Osłonę",
     ["Shield is fully recharged!"] = "Osłona całkowicie naładowana",
@@ -160,61 +644,340 @@ locale = {
     ["Shield OFF:"] = "Osłona WYŁĄCZONA:",
     ["Shield ON:"] = "Osłona WŁĄCZONA:",
     ["Shield Seeker!"] = "Zdobywca osłon!",
+--      ["Shotgun"] = "", -- Continental_supplies
     ["Shotgun Team"] = "Strzelcy",
     ["Shotgun Training"] = "Trening strzelecki",
     ["shots remaining."] = "strzałów pozostało.",
     ["Silly"] = "GÅ‚uptas",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
     ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s utonął i drużyna %d|dostała punkt karny!| |Punktacja:", 
     ["%s is out and Team %d|scored a point!| |Score:"] = "%s utonął i drużyna %d|zdobyła punkt!| |Punktacja:",  
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
     ["Sniper Training"] = "Trening Snajperski",
     ["Sniperz"] = "Snajperzy",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
     ["Sponge"] = "GÄ…bka",
     ["Spooky Tree"] = "Straszne drzewo",
     ["s|"] = "s|",
     ["s"] = "s", -- GaudyRacer, Space_Invasion
     ["STATUS UPDATE"] = "WYNIKI", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
     ["Switched to "] = "Przełączono na ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
     ["Team %d: "] = "Drużyna %d: ",
     ["Team Scores"] = "Punktacja(?)", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
     ["That was pointless."] = "To było bezcelowe",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
     ["The enemy is hiding out on yonder ducky!"] = "Na tamtej kaczce ukrywa siÄ™ nasz przeciwnik!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
     ["The flag will respawn next round."] = "Flaga pojawi się ponownie przy następnej rundzie.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
     ["The Nameless One"] = "Bezimienny",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
     ["THE SPECIALISTS"] = "SPECJALIÅšCI",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
     ["TIME: "] = "CZAS: ",
 --      ["Timed Kamikaze!"] = "",
     ["Time Extended!"] = "Więcej Czasu!",
     ["Time Extension"] = "Dodatkowy Czas!",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
     ["Toggle Shield"] = "Wł/Wył Osłonę",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
     ["Toxic Team"] = "Toksyczny zespół", 
     ["TRACK COMPLETED"] = "UKOŃCZONO TRASĘ",
     ["TRACK FAILED!"] = "TRASA NIEUKOŃCZONA!",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
     ["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
     ["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
     ["Turn Time"] = "Długość Tury",
-    ["Unit"] = "Jednostka",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
     ["Unit 3378"] = "Jednostka 3378",
     ["Unit 835"] = "Jednostka 835",
---      ["Unlimited Attacks"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+    ["Unit"] = "Jednostka",
+    ["Unlimited Attacks"] = "Nieograniczone ataki",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
     ["Unstoppable!"] = "Nie do zatrzymania!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
     ["Use your rope to get from start to finish as fast as you can!"] = "Użyj liny by jak najszybciej dotrzeć od startu do mety",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
     ["Victory for the "] = "Zwycięstwo przypadło",
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
     ["Waypoint placed."] = "Postawiono punkt kontrolny",
     ["Way-Points Remaining"] = "Pozostało punktów: ",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
     ["Weapons Reset"] = "Bronie odnawiajÄ… siÄ™",
+    ["Weapons reset."] = "Bronie odnawiajÄ… siÄ™.", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
     ["Well done."] = "Dobra robota",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
     ["Will this ever end?"] = "Co to się kiedyś skończy?",
+--      ["WINNER IS "] = "", -- Mutant
     ["WINNING TIME: "] = "ZWYCIĘSKI CZAS: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
     ["You'd almost swear the water was rising!"] = "Przysiągłbym, że woda zdaje się podnosić!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
     ["You have SCORED!!"] = "Zdobyłeś PUNKT",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
     ["You saved"] = "Uratowałeś",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
     ["You've failed. Try again."] = "Przegrałeś. Spróbuj jeszcze raz",
     ["You've reached the goal!| |Time: "] = "Dotarłeś do celu!| |Czas: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
     ["'Zooka Team"] = "Bazookinierzy",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/pl.txt b/share/hedgewars/Data/Locale/pl.txt
index 9a85b21..3cee9d7 100644
--- a/share/hedgewars/Data/Locale/pl.txt
+++ b/share/hedgewars/Data/Locale/pl.txt
@@ -56,6 +56,8 @@
 00:53=TARDIS
 00:54=Budynek
 00:55=Miotacz błota
+00:56=Zamrażarka
+00:57=Tasak
 
 01:00=Walczmy!
 01:01=Remis
@@ -78,6 +80,7 @@
 01:18=Duże
 01:19=Ekstremalne
 01:20=%1 odbicie
+01:21=Dźwięk wyciszony
 
 ; Event messages
 ; Hog (%1) died
diff --git a/share/hedgewars/Data/Locale/pt_BR.lua b/share/hedgewars/Data/Locale/pt_BR.lua
index 1f7180e..42f06ba 100644
--- a/share/hedgewars/Data/Locale/pt_BR.lua
+++ b/share/hedgewars/Data/Locale/pt_BR.lua
@@ -2,158 +2,642 @@ locale = {
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Accuracy Bonus!"] = "",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Pratique a sua pontaria", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "Rebata as bolas em direção ao seus|e derrube-os no mar!",
 	["Bat your opponents through the|baskets and out of the map!"] = "Rebata seus oponentes para|fora do mapa através dos cestos!",
 	["Bazooka Training"] = "Treino com a Bazuca",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Melhor volta por equipe: ",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 --      ["Bloody Rookies"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 --      ["Boom!"] = "",
 --      ["BOOM!"] = "",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["CAPTURE THE FLAG"] = "",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 --      ["Codename: Teamwork"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
 --      ["Congratulations!"] = "",
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Parabéns! Você eliminou todos os alvos|dentro do tempo limite.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 --      ["Control pillars to score points."] = "",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Cybernetic Empire"] = "",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 --      ["DAMMIT, ROOKIE!"] = "",
 --      ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "",
 --      ["Dangerous Ducklings"] = "",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 --      ["Eliminate all enemies"] = "",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Destrua todos os alvos antes que o tempo acabe.|Você tem munição infinita para esta missão.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 --      ["Eliminate Poison before the time runs out"] = "",
 --      ["Eliminate the Blue Team"] = "",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
 --      ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 --      ["Enjoy the swim..."] = "",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Volta mais rápida: ",
 --      ["Feeble Resistance"] = "",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Flag captured!"] = "",
 --      ["Flag respawned!"] = "",
 --      ["Flag returned!"] = "",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
 --      ["GAME OVER!"] = "",
 --      ["Game Started!"] = "",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 --      ["Get on over there and take him out!"] = "",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
 --      ["GO! GO! GO!"] = "",
 --      ["Good birdy......"] = "",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 --      ["Good luck out there!"] = "",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Basketball",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
 --      ["Hmmm..."] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["Hooray!"] = "",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Artilheiro", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 --      ["Instructor"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 --      ["Listen up, maggot!!"] = "",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 --      ["|- Mines Time:"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION FAILED"] = "", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
 --      ["MISSION SUCCESSFUL"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
 	["NEW fastest lap: "] = "NOVA volta mais rápida: ",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "Partida não muito amigável", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Oh no! Just try again!"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Oh não! O tempo acabou! Tente novamente.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Operation Diver"] = "",
 --      ["Opposing Team: "] = "",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 --      ["Pathetic Hog #%d"] = "",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 --      ["Poison"] = "",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 --      [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 --      ["RULES OF THE GAME [Press ESC to view]"] = "",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 --      ["See ya!"] = "",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -162,59 +646,338 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Carabineiros",
 	["Shotgun Training"] = "Treino com a Escopeta",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s está fora e a Equipe %d|sofreu uma penalidade!| |Pontuação:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s está fora e a Equipe %d|marcou um ponto!| |Pontuação:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Treino com o Rifle Sniper",
 	["Sniperz"] = "Franco-Atiradores",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 --      ["Spooky Tree"] = "",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Equipe %d: ",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["That was pointless."] = "",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 --      ["The enemy is hiding out on yonder ducky!"] = "",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 --      ["The flag will respawn next round."] = "",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["TIME: "] = "",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 --      ["Toxic Team"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 	["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 --      ["T_T"] = "",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 --      ["Unit 3378"] = "",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Use sua corda para ir do início ao fim o mais rápido que você puder!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 --      ["Victory for the "] = "", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You have SCORED!!"] = "",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You've failed. Try again."] = "",
 	["You've reached the goal!| |Time: "] = "Você alcançou o objetivo!| |Tempo: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Bazuqueiros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/pt_PT.lua b/share/hedgewars/Data/Locale/pt_PT.lua
index 4510329..332f276 100644
--- a/share/hedgewars/Data/Locale/pt_PT.lua
+++ b/share/hedgewars/Data/Locale/pt_PT.lua
@@ -2,157 +2,641 @@ locale = {
 	[":("] = ":(",
 	["!!!"] = "!!!",
 	["..."] = "...",
+	["011101000"] = "011101000", -- A_Classic_Fairytale:dragon
+	["011101001"] = "011101001", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+	["30 minutes later..."] = "30 minutos depois...", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "ácerca de um mês atrás, um cyborg veio e disse-nos que voces é que eram os cabinais!", -- A_Classic_Fairytale:enemy
 	["Accuracy Bonus!"] = "Bónus de precisão!",
---      ["Achievement Unlocked"] = "Desbloqueado", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+	["Ace"] = "Ás", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+	["Achievement Unlocked"] = "Proeza Desbloqueada", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+	["???"] = "???", -- A_Classic_Fairytale:backstab
+--      ["A Classic Fairytale"] = "Um Classico Conto de Fadas", -- A_Classic_Fairytale:first_blood
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 	["a Hedgewars mini-game"] = "um mini-jogo Hedgewars", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Pratica a tua pontaria", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
 	["Ammo"] = "Munições",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 	["[Backspace]"] = "[Retrocesso (backspace)]",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "Bate bolas contra os teus|enimigos e empurra-os ao mar!",
 	["Bat your opponents through the|baskets and out of the map!"] = "Bate os teus adversarios|fora do mapa acertando com eles no cesto!",
 	["Bazooka Training"] = "Treino com Bazuca",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Melhores voltas por equipa: ",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 --      ["Bloody Rookies"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 	["Boom!"] = "Boom!",
 	["BOOM!"] = "BOOM!",
 	["Boss defeated!"] = "Boss derrotado!",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["CAPTURE THE FLAG"] = "CAPTURAR A BANDEIRA",
 	["Careless"] = "Descuidado",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "DESAFIO COMPLETO", -- User_Mission_-_RCPlane_Challenge
 	["Change Weapon"] = "Trocar Arma",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 --      ["Codename: Teamwork"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Complete the track as fast as you can!"] = "Completa a pista o mais rápido que conseguires!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "Configuração aceite", -- WxW
 	["Congratulations!"] = "Parabéns!",
+--      ["Congratulations"] = "Parabéns", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Parabéns! Eliminaste todos os alvos|dentro do tempo limite.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 --      ["Control pillars to score points."] = "",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Cybernetic Empire"] = "Império Cibernético",
+--      ["Cyborg. It's what the aliens call themselves."] = "Cyborg. É o que os extra terrestres se chamam a eles mesmos(errrr)", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 --      ["DAMMIT, ROOKIE!"] = "",
 --      ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "",
 	["Dangerous Ducklings"] = "Patinhos perigosos",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 	["Eliminate all enemies"] = "Elimina todos os inimigos",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Destrói todos os alvos antes do tempo terminar.|Tens munições infinitas para esta missão.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 	["Eliminate Poison before the time runs out"] = "Elimina o Poison antes do tempo terminar.",
 	["Eliminate the Blue Team"] = "Elimina a equipa azul",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "Elimina os ouriços inimigos para ganhar.",
 --      ["Eliminate the enemy specialists."] = "Elimina os especialistas inimigos.",
 --      ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 	["Enjoy the swim..."] = "Aproveita o mergulho",
       ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Volta mais rápida: ",
 --      ["Feeble Resistance"] = "",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 	["Flag captured!"] = "Bandeira capturada!",
 	["Flag respawned!"] = "Bandeira reiniciada!",
 	["Flag returned!"] = "Bandeira devolvida!",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 	["Game Modifiers: "] = "Modificadores de Jogo: ",
 	["GAME OVER!"] = "GAME OVER!",
 --      ["Game Started!"] = "",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 	["Get on over there and take him out!"] = "Chega-te aqui e acaba com ele!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
 	["GO! GO! GO!"] = "GO! GO! GO!",
 --  ["Good birdy......"] = "Lindo\Bom passarito......" (needs ingame confirmation),
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 	["Good luck out there!"] = "Boa sorte aí fora!",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+	["HAHA!"] = "HAHA!", -- A_Classic_Fairytale:enemy
+	["Haha!"] = "Haha!", -- A_Classic_Fairytale:united
 	["Hahahaha!"] = "Hahahaha!",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Basketball",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "Olá novamente\outra vez, ", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = ",pessoal!", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "pessoal!", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Hmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 	["Hooray!"] = "Hurra!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Comando", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 	["Instructor"] = "Instrutor", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 	["invaders destroyed"] = "invasores destruidos",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 	["Kamikaze Expert!"] = "Kamikaze profissional!",
 --      ["Keep it up!"] = "Continua assim!",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 	["[Left Shift]"] = "[Shift Esquerdo]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Listen up, maggot!!"] = "Oiçam bem suas larvas!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 	["|- Mines Time:"] = "|- Tempo das minas:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION FAILED"] = "MISSÃO FALHADA", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESSFUL"] = "MISSÃO COMPLETA", -- User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION SUCCESS"] = "MISSÃO COMPLETA", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 	["Movement: [Up], [Down], [Left], [Right]"] = "Movimento: [Cima], [Baixo], [Esquerda], [Direita]",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
 	["NEW fastest lap: "] = "NOVA volta recorde: ",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "Partida não muito amigável", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 	["Oh no! Just try again!"] = "Oh não! Tenta novamente!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Oh não! Terminou o tempo! Tenta novamente.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 	["Operation Diver"] = "Operação Mergulho",
 	["Opposing Team: "] = "Equipa adversária",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 	["Pathetic Hog #%d"] = "Ouriço patético #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, Space_Invasion
 	["Poison"] = "Poison",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 	["Power Remaining"] = "Energia Restante",
 	["Prepare yourself"] = "Prepara-te!",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 	[" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Traz a bandeira inimiga para tua base | - A primeira equipa a captura-la 3 vezes ganha | - Apenas podes marcar quando a tua bandeira está na tua base | - Os ouriços largam a bandeira se morrerem ou se afogarem | - As bandeiras abandonadas podem ser devolvidas ou recapturadas | - Os ouriços mortos ressuscitam",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 	["RULES OF THE GAME [Press ESC to view]"] = "REGRAS DE JOGO [Pressiona ESC para as visualizar]",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
 	["SCORE"] = "RESULTADOS",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 	["sec"] = "seg", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 	["See ya!"] = "Chau!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 	["selected!"] = "seleccionado!",
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "Escudo melhorado! +30 energia (-unconfirmed)",
 	["Shield Depleted"] = "Escudo Esgotado",
 	["Shield is fully recharged!"] = "Escudo completamente recarregado!",
@@ -161,61 +645,340 @@ locale = {
 	["Shield OFF:"] = "Escudo DESLIGADO:",
 	["Shield ON:"] = "Escudo LIGADO:",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Caçadores",
 	["Shotgun Training"] = "Treino com Caçadeira",
 --      ["shots remaining."] = "tiros restantes.",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s está fora e a equipa %d|perde um ponto!| |Pontuação:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s está fora e a equipa %d|soma um ponto!| |Pontuação:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Treino com Sniper",
 	["Sniperz"] = "Sniperz",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 --      ["Spooky Tree"] = "",
 	["s"] = "s", -- GaudyRacer, Space_Invasion
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Equipa %d: ",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["That was pointless."] = "Isso foi completamente desnecessario.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 	["The enemy is hiding out on yonder ducky!"] = "O inimigo está escondido ali a diante ao pé do patinho!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 	["The flag will respawn next round."] = "A bandeira ira reaparecer no próximo turno.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 	["THE SPECIALISTS"] = "OS ESPECIALISTAS",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
 	["TIME: "] = "TEMPO: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 	["Toggle Shield"] = "Ligar\Desligar Escudo",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 --      ["Toxic Team"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "PISTA COMPLETA",
 --      ["TRACK FAILED!"] = "PISTA",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 	["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 	["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
-	["Unit"] = "Unidade",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 	["Unit 3378"] = "Unidade 3378",
 	["Unit 835"] = "Unidade 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+	["Unit"] = "Unidade",
 	["Unlimited Attacks"] = "Ataques Ilimitados",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Unstoppable!"] = "Imparável!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Utilizando a corda, percorre o percurso do inicio ao fim o mais rápido que conseguires!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 --      ["Victory for the "] = "", -- CTF_Blizzard, Capture_the_Flag
 	["Victory for the"] = "Vitória para a",
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 	["Well done."] = "Bom trabalho.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 	["WINNING TIME: "] = "TEMPO VENCEDOR: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 	["You'd almost swear the water was rising!"] = "Quase eras capaz jurar que a água estava a subir!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 	["You have SCORED!!"] = "Marcaste!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 	["You've failed. Try again."] = "Falhaste. Tenta novamente.",
 	["You've reached the goal!| |Time: "] = "Chegaste ao fim!| |Tempo: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Bazuqueiros",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/pt_PT.txt b/share/hedgewars/Data/Locale/pt_PT.txt
index 6053c09..4090842 100644
--- a/share/hedgewars/Data/Locale/pt_PT.txt
+++ b/share/hedgewars/Data/Locale/pt_PT.txt
@@ -56,6 +56,8 @@
 00:53=Caixote do Tempo
 00:54=Estrutura
 00:55=Terreno-instantâneo
+00:56=Congelador
+00:57=Cutelo
 
 01:00=Vamos lutar!
 01:01=Ronda empatada
@@ -78,6 +80,7 @@
 01:18=Muito
 01:19=Excessivo
 01:20=Ressalto: %1
+01:21=Áudio Silenciado
 
 ; Event messages
 ; Hog (%1) died
diff --git a/share/hedgewars/Data/Locale/ro.txt b/share/hedgewars/Data/Locale/ro.txt
new file mode 100644
index 0000000..741b3cd
--- /dev/null
+++ b/share/hedgewars/Data/Locale/ro.txt
@@ -0,0 +1,533 @@
+; English locale
+
+00:00=Grenadă
+00:01=Bombă cu dispersie
+00:02=Bazooka
+00:03=Albina bumerang
+00:04=Shotgun
+00:05=Ciocanul târnăcop
+00:06=Frânghie
+00:07=Rope
+00:08=Mină
+00:09=Desert Eagle
+00:10=Dinamita
+00:11=Bâtă de baseball
+00:12=Shoryuken
+00:13=sec
+00:14=Parașută
+00:15=Atack aerian
+00:16=Lovitură de mină
+00:17=Lovitura de torță
+00:18=Constructie
+00:19=Teleportare
+00:20=Schimbă ariciuș	
+00:21=Mortar
+00:22=Bici
+00:23=Kamikaze
+00:24=Prăjitură
+00:25=Seducere
+00:26=Pepene bombă
+00:27=Grenadă de mână infernală
+00:28=Racheta burghiu	
+00:29=Pistol cu bile
+00:30=Napalm
+00:31=Avion RC
+00:32=Gravitate redusa
+00:33=Extra daună
+00:34=Invulnerabilitate
+00:35=Extra timp
+00:36=Lumina laser
+00:37=Vampirism
+00:38=Lunetist
+00:39=Farfurie zburătoare
+00:40=Molotov Cocktail
+00:41=Birdy
+00:42=Dispozitiv portabil portal
+00:43=Lovitură de pian
+00:44=Limburger vechi
+00:45=Tun sinus ( beta)
+00:46=Aruncător de flăcări
+00:47=Mina lipicioasă
+00:48=Ciocan
+00:49=Reînviător
+00:50=Lovitură de burghiu
+00:51=Bila de noroi
+00:52=Nici o armă selectată
+00:53=Cutia timpului
+00:54=Structură
+00:55=Spray de teren
+
+01:00=Hai să ne batem!
+01:01=Remizăr
+01:02=%1 a câștigat!
+01:03=Volumul %1%
+01:04=Pauză
+01:05=Sigur ieșiți (Y/Esc)?
+01:06=Moarte subita!
+01:07=%1 rămas
+01:08=combustibil
+01:09=Sincronizare...
+01:10=Folosind această utilitate tura nu se va termina!
+01:11=Această armă sau utilitate nu sunt valabile momentan!
+01:12=Ultima tură înainte de moartea subită!
+01:13=%1 ture înainte de moartea subită!
+01:14=Fiți gata, %1!
+01:15=Ușor
+01:16=Scăzut
+01:17=Normal
+01:18=Ridicat
+01:19=Extrem
+01:20=%1 sare
+
+; Event messages
+; Hog (%1) died
+02:00=%1 a spălat putina!
+02:00=%1 a văzut lumina!
+02:00=%1 nu a văzut aia venind!
+02:00=%1 face la revedere!
+02:00=%1 a mers într-un loc mai bun!
+02:00=%1 și-a întâlnit creatorul!
+02:00=%1 nu mai poate sta!
+02:00=%1 și-a terminat datoria!
+02:00=%1 face ultimul sacrificiu!
+02:00=%1 departs this mortal coil!
+02:00=%1 face ca un copac și frunze!
+02:00=%1 has timed out!
+02:00=%1 spune pace vouă!
+02:00=%1 will be fondly remembered!
+02:00=%1 a avut un anevrism!
+02:00=%1 lasă în urmă nevasta și copii
+02:00=%1 a lansat ultima bazookă
+02:00=%1 a aruncat ultima grenadă
+02:00=%1 a copt ultima prăjitură
+02:00=%1 a legănat ultima frânghie
+02:00=%1 a chemat ultimul avion
+02:00=%1 și-a pompat ultimul shotgun
+02:00=%1 a aruncat ultimul pepene
+02:00=%1 has drawn his last deagle
+02:00=%1 took one shot too many
+02:00=%1 could really have used a health crate
+02:00=%1 has gone to play a better game
+02:00=%1 has ragequit life
+02:00=%1 fails
+02:00=Poor poor %1...
+02:00=%1 prefers wormux
+02:00=%1 has been blocking shots with his face
+02:00=%1 is a hero amongst me...err...hogs
+02:00=%1 finds his place in Valhalla
+02:00=%1 has left the building
+02:00=%1 goes the way of the dinosaurs
+02:00=%1 brings hedgehogs one step closer to extinction
+02:00=%1 brings a tear to my eye
+02:00=%1 is an ex-hog
+02:00=%1 is pushing up the daisies
+02:00=%1 has ceased to be
+02:00=Say goodbye to %1
+02:00=No hope left for %1
+02:00=%1 faces the final curtain
+02:00=Smoke 'em if you got 'em, %1
+02:00=%1 suffers a Spontaneous Massive Existence Failure
+02:00=%1 has passed on
+02:00=%1 is stone dead
+02:00=%1 is no more
+02:00=%1 has expired
+02:00=Bereft of life, %1 rests in peace
+02:00=%1 joins the choir invisible
+02:00=Farewell %1, we hardly knew ye!
+02:00=%1 had a low tolerance for being shot
+02:00=%1 could have used an extra life
+02:00=Is there a doctor in the house?
+
+; Hog (%1) drowned
+02:01=%1 plays submarine!
+02:01=%1 mimează Titanicul!
+02:01=%1 înnoată ca o piatră!
+02:01=%1 plutește ca o cărămidă!
+02:01=%1 checks out the deep end
+02:01=%1 goes glug glug glug
+02:01=%1 goes splash
+02:01=%1 forgot his armbands
+02:01=%1 really should have taken swimming lessons
+02:01=%1 left his surfboard at home
+02:01=%1 is washed up
+02:01=%1 is one soggy hog
+02:01=%1 forgot to bring his life jacket
+02:01=%1 goes splish splash splish
+02:01=%1 is sleeping with the fishes
+02:01=%1 thinks the water physics suck in this game
+02:01=%1 looks thirsty
+02:01=The sea claims %1
+02:01=%1 is lost at sea
+02:01=%1 should have brought his scuba gear
+02:01=%1 gets a burial at sea
+02:01=%1 has that sinking feeling
+02:01=%1 is practicing his backstroke
+02:01=%1 goes in search of the Titanic
+02:01=%1 is not Jesus
+02:01=%1 is finding Nemo
+02:01=%1 springs a leak
+02:01=You've gotta wonder how many hogs are down there
+02:01=%1 makes the ocean slightly higher
+02:01=%1 didn't enlist in the Navy
+02:01=%1 is doing his impersonation of a dead fish
+02:01=At least you didn't go down the toilet, %1
+02:01=Sonic couldn't swim and neither can %1
+02:01=%1 wants to play Ecco the dolphin
+02:01=%1 has gone to visit Aquaria
+02:01=%1 has found the lost city of Atlantis
+02:01=%1 aims for the lead role in Bioshock 3
+02:01=Your doggy paddle could use a little work, %1
+02:01=%1 should have brought a jet ski
+02:01=%1 doesn't like watersports
+02:01=%1 is forever blowing bubbles
+02:01=%1 is short of a raft
+02:01=%1 thinks salt water is good for the skin
+02:01=%1 gets salt water in his wounds
+02:01=%1 has walked the plank
+02:01=%1 has a bath
+02:01=%1 is wet wet wet
+02:01=%1 gets his quills wet
+02:01=It's Davy Jones' locker for %1
+
+; Round starts
+02:02=Let's fight!
+02:02=Armed and ready!
+02:02=Let's get ready to rumble!
+02:02=Let's get it on!
+02:02=Let's get this party started
+02:02=Last hog standing wins
+02:02=Let's go!
+02:02=Let's rock!
+02:02=Let's jam!
+02:02=It's beginning...
+02:02=This is the start of something big
+02:02=Welcome to Hedgewars
+02:02=Welcome to the front lines
+02:02=Crush your enemies!
+02:02=May the best hog win
+02:02=Victory or death
+02:02=To the victor goes the spoils
+02:02=Losing is not an option
+02:02=Cry havoc! Let loose the hogs of war!
+02:02=Hedgewars, brought to you by Hedgewars.org
+02:02=GL HF
+02:02=Just count yourself lucky you're not up against Tiyuri
+02:02=Just count yourself lucky you're not up against unC0Rr
+02:02=Just count yourself lucky you're not up against Nemo
+02:02=Just count yourself lucky you're not up against Smaxx
+02:02=Just count yourself lucky you're not up against Jessor
+02:02=Give it your all!
+02:02=The losers do the cleaning up!
+02:02=Let the fight of the millenium begin
+02:02=Let the fight of the century begin
+02:02=Let the fight of the decade begin
+02:02=Let the fight of the year begin
+02:02=Let the fight of the month begin
+02:02=Let the fight of the week begin
+02:02=Let the fight of the day begin
+02:02=Let the fight of the hour begin
+02:02=Do your best!
+02:02=Destroy the enemy!
+02:02=Good luck
+02:02=Have fun
+02:02=Fight the good fight
+02:02=Fight dirty
+02:02=Fight with honour
+02:02=Don't give up
+02:02=Never surrender
+02:02=Rock 'em and sock 'em!
+02:02=Let the fragfest begin!
+02:02=I hope you're ready for a tussle!
+02:02=Go Go Go!
+02:02=Hedgehogs advance!
+02:02=Bring it to them!
+02:02=Have no fear!
+02:02=Be brave and conquer
+
+; Round ends (win; unused atm)
+02:03=...
+
+; Round ends (draw; unused atm)
+02:04=...
+
+; New health crate
+02:05=Incoming aid!
+02:05=Medic!
+02:05=First aid from the skies!
+02:05=A health pack for you
+02:05=Good health... in box form!
+02:05=The doctor calls
+02:05=Fresh band-aids!
+02:05=This will make you feel better
+02:05=A Hi-Potion! Whoops wrong game
+02:05=A pick-me-up!
+02:05=Grab it
+02:05=A healthy snack
+02:05=A remedy to pain
+02:05=Correct Dosage: as many as you can find!
+02:05=Urgent delivery
+02:05=Supplies!
+
+; New ammo crate
+02:06=More weapons!
+02:06=Reinforcements!
+02:06=Lock and load!
+02:06=I wonder what weapon is in there?
+02:06=Supplies!
+02:06=What could be inside?
+02:06=Christmas comes early in Hedgewars
+02:06=A present!
+02:06=Special delivery!
+02:06=It was a nightmare getting this through customs
+02:06=Destructive toys from the heavens
+02:06=Warning! Contents Volatile
+02:06=Pick it up or blow it up, choice is yours
+02:06=Goodies!
+02:06=Mmmmm Ammo
+02:06=A box of destructive power
+02:06=Airmail!
+02:06=Whatever's in that box, it ain't pizza
+02:06=Get it!
+02:06=Weapon drop incoming
+02:06=Don't let the enemy grab that!
+02:06=Shiny new toys!
+02:06=A mysterious box!
+
+; New utility crate
+02:07=Tooltime!
+02:07=This could come in handy...
+02:07=Utilities!
+02:07=Utilise this box
+02:07=Watch out below
+02:07=More utilities!
+02:07=Tools for you!
+02:07=This should be good!
+02:07=Use this wisely
+02:07=Ooo this box is heavy
+02:07=You might need this
+
+; Hog (%1) skips his turn
+02:08=%1 is sooo boring...
+02:08=%1 couldn't be bothered
+02:08=%1 is one lazy hog
+02:08=%1 is thoughtless
+02:08=%1 gave up
+02:08=You snooze you lose, %1
+02:08=%1 shamelessly skips
+02:08=%1 is really lazy
+02:08=%1 needs a little more motivation
+02:08=%1 is a pacifist
+02:08=%1 has a breather
+02:08=%1 has a rest
+02:08=%1 chills out
+02:08=%1 has no faith in his own abilities
+02:08=%1 decides to do nothing at all
+02:08=%1 lets the enemy destroy itself
+02:08=%1 would be terrible at parties
+02:08=%1 hides out
+02:08=%1 has decided to pass on this opportunity
+02:08=%1 decides the best thing he can do is...nothing
+02:08=%1 is a big wuss
+02:08=Buck Buck Buck, %1 is a chicken
+02:08=%1 is looking a little yellow
+02:08=%1 is a coward!
+02:08=%1 is waiting for sudden death
+02:08=%1 is not the fighting type
+02:08=%1 is reconsidering his purpose in life
+02:08=%1 was never much of a good shot anyway
+02:08=%1 didn't want to join the army in the first place
+02:08=Stop wasting our time, %1
+02:08=I'm dissapointed in you, %1
+02:08=Come on, you can do better than that %1
+02:08=%1's will has broken
+02:08=%1 apparently has better things to do
+02:08=%1 is scared stiff
+02:08=%1 has fallen asleep
+
+; Hog (%1) hurts himself only
+02:09=%1 should practice aiming!
+02:09=%1 seems to hate himself
+02:09=%1 is standing on the wrong side!
+02:09=%1 makes like an emo
+02:09=%1 was holding his weapon the wrong way around
+02:09=%1 is a little sadistic
+02:09=%1 is a masochist
+02:09=%1 has no instinct of self-preservation
+02:09=%1 messed up
+02:09=%1 screwed up
+02:09=That was a poor shot, %1
+02:09=%1 is a little too careless with dangerous weapons
+02:09=%1 should consider a change of career
+02:09=Worst. Shot. Ever!
+02:09=No no no %1, you shoot at the ENEMY!
+02:09=%1 should only be destroying the enemy
+02:09=%1 moves one step closer to suicide
+02:09=%1 aids the enemy
+02:09=That was stupid %1
+02:09=%1 lives by the mantra of "no pain, no gain"
+02:09=%1 is confused
+02:09=%1 hurt itself in its confusion
+02:09=%1 has a knack for embarrassing himself
+02:09=%1 is a klutz!
+02:09=%1 is clumsy
+02:09=%1 shows the enemy what he's capable of
+02:09=%1 can't be expected to be perfect all the time
+02:09=Don't worry %1, pobody's nerfect
+02:09=%1 totally did that on purpose
+02:09=I won't tell anyone if you don't, %1
+02:09=How embarrassing!
+02:09=I'm sure nobody saw that %1
+02:09=%1 needs to review his field manual
+02:09=%1's weapon clearly malfunctioned
+
+; Hog shot an home run (using the bat and another hog)
+02:10=Home Run!
+02:10=A bird, a plane, ...
+02:10=That one is out!
+
+; Hog (%1) has to leave (team is gone)
+02:11=%1 has to go to bed!
+02:11=%1 seems too busy to play
+02:11=Beam him up, Scotty!
+02:11=%1 has to go
+
+; Weapon Categories
+03:00=Timed Grenade
+03:01=Timed Grenade
+03:02=Ballistic Weapon
+03:03=Guided Weapon
+03:04=Gun (multiple shots)
+03:05=Digging Tool
+03:06=Action
+03:07=Transport Utility
+03:08=Proximity Bomb
+03:09=Gun (multiple shots)
+03:10=BOOM!
+03:11=Bonk!
+03:12=Martial Arts
+03:13=UNUSED
+03:14=Transport Utility
+03:15=Airborne Attack
+03:16=Airborne Attack
+03:17=Digging Tool
+03:18=Utility
+03:19=Transport Utility
+03:20=Action
+03:21=Ballistic Weapon
+03:22=Call me Indiana!
+03:23=(Really) Martial Arts
+03:24=The cake is NOT a lie!
+03:25=Costume Kit
+03:26=Juicy Grenade
+03:27=Fiery Grenade
+03:28=Ballistic Weapon
+03:29=Ballistic Weapon
+03:30=Airborne Attack
+03:31=Remote Controlled Bomb
+03:32=Temporary Effect
+03:33=Temporary Effect
+03:34=Temporary Effect
+03:35=Temporary Effect
+03:36=Temporary Effect
+03:37=Temporary Effect
+03:38=Gun (multiple shots)
+03:39=Transport Utility
+03:40=Incinerating Grenade
+03:41=Huge fan of Squawks
+03:42=I'm making a note here...
+; the misspelled "Beethoven" is intentional (-> to beat)
+03:43=Performing Beathoven's deadly sonata
+03:44=Best before: 1923
+03:45=The power of science
+03:46=Hot Hot Hot!
+03:47=Stick these somewhere useful!
+03:48=It's Hammer time!
+03:49=Does what you guess
+03:50=Moles fan
+03:51=Found on the ground
+03:52=UNUSED
+03:53=Type 40
+03:54=Build something
+03:55=Utility
+
+; Weapon Descriptions (use | as line breaks)
+04:00=Attack your enemies using a simple grenade.|It will explode once its timer reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:01=Attack your enemies using a cluster bomb.|It will split into smaller bombs once its timer|reaches zero.|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:02=Attack your enemies using a ballistic projectile|that might be influenced by wind.|Attack: Hold to shoot with more power
+04:03=Launch an explosive bee that will lock on|the selected target. Don't shoot with full power|to improve its precision.|Cursor: Pick target|Attack: Hold to shoot with more power
+04:04=Attack your enemy using a shotgun with two shots.|Thanks to its spread you don't need direct hits|to harm your opponents.|Attack: Shoot (multiple times)
+04:05=Move underground! Use the pickhammer to drill|a hole into the ground and reach other areas.|Attack: Start or stop digging
+04:06=Bored? No way to attack? Save your ammo?|No problem! Just skip your turn, coward!|Attack: Skip your turn without fighting
+04:07=Bridge huge distances using timed shots with the|rope. Use your momentum to slide into other hogs|or drop grenades and other weapons on them.|Attack: Shoot or release the rope|Long Jump: Drop grenades or similar weapons
+04:08=Keep your enemies away by dropping a mine in|narrow passages or right below their feet. Be|sure to retreat before you trigger it yourself!|Attack: Drop mine next to your feet
+04:09=Not sure about your aiming? Use the Desert|Eagle to attack using up to four shots.|Attack: Shoot (multiple times)
+04:10=Brute force is always an option. Drop this classic|explosive next to your enemies and retreat.|Attack: Drop dynamite next to your feet
+04:11=Get rid of enemy hogs by batting them over|the map borders or into water. Or how about|knocking some mines to your friends?|Attack: Bat everything in front of you
+04:12=Get close and personal to unleash the power of|this almost deadly martial arts technique.|Attack: Perform the amazing Shoryuken.
+04:13=UNUSED
+04:14=Fear of heights? Better grab a parachute.|It will unfold once|you fall too far and|save your hog from taking fall damage.|Attack: Unfold the parachute|Long Jump: Drop grenades or similar weapons
+04:15=Call in an airplane to attack your enemies|using a bombing run.|Left/Right: Determine attack direction|Cursor: Select target region
+04:16=Call in an airplane to drop several mines|in the target area.|Left/Right: Determine attack direction|Cursor: Select target region
+04:17=Need shelter? Use the blow torch to dig|a tunnel into solid ground granting you|cover.|Attack: Start or stop digging
+04:18=Need additional protection or want to pass|unpassable ground? Place some girders as you|like.|Left/Right: Select girder to place|Cursor: Place girder in a valid position
+04:19=Used at the right moment teleportation can|be more powerful than almost all weapons as|it allows you to save hogs from dangerous|situations within seconds.|Cursor: Select target region
+04:20=Allows you to play the current turn with|a different hog.|Attack: Enable switching hogs
+04:21=Shoot a grenade-like projectile that will|release multiple bombs upon impact.|Attack: Shoot at full power
+04:22=Not just for Indiana Jones! The whip is a|useful weapon in many situations. Especially|when you'd like to shove someone off a cliff.|Attack: Strike everything in front of you
+04:23=If you have nothing to lose, this might be|quite handy. Sacrifice your hog by launching|him into a specific direction hurting everything|on his way and exploding at the end.|Attack: Launch the devastating and deadly attack
+04:24=Happy Birthday! Launch this cake, let it walk right|next to your enemies and let them have an explosive|party. The cake is able to pass almost all terrain|but he might detonate earlier this way.|Attack: Start the cake or let it stop and explode
+04:25=Use this disguise kit to get your enemies to jump|towards your hog (and into some gap or hole).|Attack: Use the kit and try to seduce another hog
+04:26=Throw this juicy watermelon at your enemies. Once|the timer expires, it will split into several|explosive pieces.|1-5: Set watermelon's timer|Attack: Hold to shoot with more power
+04:27=Let hellfire rain onto your opponents by using|this fiendish explosive. Don't get too close to|the explosion as smaller fires might last longer.|Attack: Hold to shoot with more power
+04:28=Short time after launching this rocket, it will|start drilling through solid ground and explode|once its fuse is triggered or it resurfaces again.|Attack: Hold to shoot with more power
+04:29=This is nothing for small kids! The ball gun fires|tons of small colored balls filled with explosives.|Attack: Shoot at full power|Up/Down: Continue aiming
+04:30=Call in an airplane to launch a powerful napalm|strike. With proper aiming this attack can eradicate|huge parts of landscape including unlucky hogs|sitting there.|Left/Right: Determine attack direction|Cursor: Select target region
+04:31=The RC plane is the ideal weapon to collect crates or|attack far away hogs. Either steer it into enemies or|drop some bombs first.|Attack: Launch the plane or drop bombs|Long Jump: Let the valkyries ride into battle|Left/Right: Steer the plane
+04:32=Low gravity is more effective than any diet! Jump|higher and over greater distances or let your enemies|fly even further.|Attack: Activate
+04:33=Sometimes you just need that little extra boost to|deal some more damage.|Attack: Activate
+04:34=Can't touch me!|Attack: Activate
+04:35=Sometimes time's running too fast. Grab some extra|seconds to finish your attack.|Attack: Activate
+04:36=Well, sometimes you're just too bad in aiming. Get|some assistance using modern day technology.|Attack: Activate
+04:37=Don't fear the daylight. It will just last one turn|but will enable you to absorb the damage you do to|other hogs.|Attack: Activate
+04:38=The sniper rifle can be the most devastating weapon|in your whole arsenal, however it's very ineffective|at close quarters. The damage dealt increases with|the distance to its target.|Attack: Shoot (twice)
+04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility is able to|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force in one direction|Long Jump: Drop grenades or similar weapons
+04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Attack: Hold to shoot with more power
+04:41=The evidence nature might even top the flying|saucer. Birdy can carry your hog around and|drop eggs on your enemies!|Be quick, as using Birdy eats into your turn|time!|Attack: Activate and drop eggs|Up/Left/Right: Flap in one direction
+04:42=This portable portal device is capable|of instantly transporting you, your enemies,|or your weaponry between two points on the|terrain.|Use it wisely and your campaign will be a...|HUGE SUCCESS!|Attack: Shoot a portal|Switch: Cycle portal colours
+04:43=Make your musical debut an explosive success!|Drop a piano from the heavens, but beware...|someone needs to play it, and that may cost you|your life!|Cursor: Select target region|F1-F9: Play the piano
+04:44=This isn't just cheese, it's biological warfare!|It won't cause an huge amount of damage once|the timer reaches zero but it will definitely|poison anyone unlucky to touch the smell!|1-5: Set grenade's timer|Attack: Hold to throw with more power
+04:45=All those physics classes have finally|paid off, launch a devastating Sine|wave at your foes.|Watch out, this weapon packs quite a kick. (This weapon is incomplete)|Attack: Shoot
+04:46=Cover your foes with sizzling liquid flame.|Heartwarming!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power
+04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice)
+04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate
+04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection
+04:50=Is someone hiding underground?|Dig them out with a drill strike!|Timer controls how far it will dig.
+04:51=Get in a free shot by hurling a ball of mud.|Stings a bit, and knocks hogs back.
+04:52=UNUSED
+04:53=Go on an adventure through time and space,|while leaving your comrades to fight on alone.|Be prepared to return at any time,|or for Sudden Death or if they are all defeated.|Disclaimer. Does not function in Sudden Death,|if you are alone, or if you are a King.
+04:54=INCOMPLETE                                                                                                                                     
+04:55=Spray a stream of sticky flakes.|Build bridges, bury enemies, seal off tunnels.|Be careful you don't get any on you!
+
+; Game goal strings
+05:00=Game Modes
+05:01=The following rules apply
+05:02=Forts: Defend your fortress; vanquish your enemies!
+05:03=Low Gravity: Watch your step
+05:04=Invulnerability: Hogs are (almost) invulnerable
+05:05=Vampirism: Hogs will be healed for the damage dealt
+05:06=Karma: Hogs will be damaged for the damage dealt
+05:07=Protect the King: Don't let your king die!|Place the King: Pick a protected starting point for your King
+05:08=Place Hedgehogs: Place your hogs before the game starts
+05:09=Artillery: Hogs can't walk to change position
+05:10=Indestructible Terrain: Most weapons won't destroy terrain
+05:11=Shared Ammo: All teams of the same color share their ammunition
+05:12=Mine Timers: Mines will detonate after %1 second(s)
+05:13=Mine Timers: Mines will detonate instantly
+05:14=Mine Timers: Mines will detonate after 0 - 5 seconds
+05:15=Damage Modifier: All weapons will do %1% damage
+05:16=Health of all hogs is reset on end of turn
+05:17=AI hogs respawn on death
+05:18=Unlimited Attacks
+05:19=Weapons are reset on end of turn
+05:20=Weapons are not shared between hogs
+05:21=Tag Team: Teams in a clan takes successive turns|Shared Time: Teams within a clan share turn time
diff --git a/share/hedgewars/Data/Locale/ru.lua b/share/hedgewars/Data/Locale/ru.lua
index 00f5ccb..6c96cf2 100644
--- a/share/hedgewars/Data/Locale/ru.lua
+++ b/share/hedgewars/Data/Locale/ru.lua
@@ -2,158 +2,642 @@ locale = {
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
       ["Accuracy Bonus!"] = "Бонус за аккуратность!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
       ["a Hedgewars mini-game"] = "Мини-игра в Hedgewars", -- Space_Invasion, The_Specialists
       ["Aiming Practice"] = "Упражнение на точность", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 --      ["Bat balls at your enemies and|push them into the sea!"] = "",
 --      ["Bat your opponents through the|baskets and out of the map!"] = "",
       ["Bazooka Training"] = "Упражнение с базукой",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 --      ["Best laps per team: "] = "",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 --      ["Bloody Rookies"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
-      ["Boom!"] = "Бум!",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
       ["BOOM!"] = "БАБАХ!",
+      ["Boom!"] = "Бум!",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
       ["CAPTURE THE FLAG"] = "ЗАХВАТ ФЛАГА",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
       ["Change Weapon"] = "Сменить оружие",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 --      ["Codename: Teamwork"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
-      ["Congratulations!"] = "Поздравления!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 --      ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "", --Bazooka, Shotgun, SniperRifle
+      ["Congratulations!"] = "Поздравления!",
+--      ["Continental supplies"] = "", -- Continental_supplies
 --      ["Control pillars to score points."] = "",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+      ["Crates Left:"] = "Осталось ящиков:", -- User_Mission_-_RCPlane_Challenge
 --      ["Cybernetic Empire"] = "",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 --      ["DAMMIT, ROOKIE!"] = "",
 --      ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "",
 --      ["Dangerous Ducklings"] = "",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
+--      ["DOUBLE KILL"] = "", -- Mutant
       ["Double Kill!"] = "Двойное убийство!",
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 --      ["Eliminate all enemies"] = "",
 --      ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 --      ["Eliminate Poison before the time runs out"] = "",
 --      ["Eliminate the Blue Team"] = "",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
 --      ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
       ["Enjoy the swim..."] = "Приятного плавания...",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 --      ["Fastest lap: "] = "",
 --      ["Feeble Resistance"] = "",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Flag captured!"] = "",
 --      ["Flag respawned!"] = "",
 --      ["Flag returned!"] = "",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
       ["GAME OVER!"] = "ИГРА ОКОНЧЕНА!",
 --      ["Game Started!"] = "",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 --      ["Get on over there and take him out!"] = "",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
       ["Goal"] = "Цель",
 --      ["GO! GO! GO!"] = "",
 --      ["Good birdy......"] = "",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 --      ["Good luck out there!"] = "",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
       ["GOTCHA!"] = "ПОПАЛСЯ!",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 --      ["Hedgewars-Basketball"] = "",
 --      ["Hedgewars-Knockball"] = "",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+      ["HIGHLANDER"] = "Царь горы", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
       ["Hmmm..."] = "Хммм...",
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
       ["Hooray!"] = "Ура!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
       ["Hunter"] = "Охотник", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
       ["Instructor"] = "Инструктор", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
       ["Jumping is disabled"] = "Прыжки отключены",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
       ["Last Target!"] = "Последняя цель!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 --      ["Listen up, maggot!!"] = "",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 --      ["|- Mines Time:"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
       ["MISSION FAILED"] = "МИССИЯ ПРОВАЛЕНА", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
       ["MISSION SUCCESSFUL"] = "МИССИЯ УСПЕШНА", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
       ["Nameless Heroes"] = "Безымянные герои",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
       ["NEW CLAN RECORD: "] = "НОВЫЙ РЕКОРД КЛАНА: ",
 --      ["NEW fastest lap: "] = "",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
       ["Newton's Hammock"] = "Гамак Ньютона",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Not So Friendly Match"] = "", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Oh no! Just try again!"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["Oh no! Time's up! Just try again."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Operation Diver"] = "",
 --      ["Opposing Team: "] = "",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 --      ["Pathetic Hog #%d"] = "",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
       ["Poison"] = "Яд",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 --      [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 --      ["RULES OF THE GAME [Press ESC to view]"] = "",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
       ["sec"] = "сек", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
       ["See ya!"] = "Увидимся!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -162,59 +646,338 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 --      ["Shotgun Team"] = "",
 --      ["Shotgun Training"] = "",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["%s is out and Team %d|scored a penalty!| |Score:"] = "", -- Basketball, Knockball
 --      ["%s is out and Team %d|scored a point!| |Score:"] = "", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
       ["Sniper Training"] = "Тренировка снайпера",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 --      ["Spooky Tree"] = "",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
       ["Team %d: "] = "Команда %d: ",
       ["Team Scores"] = "Очки команды", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["That was pointless."] = "",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 --      ["The enemy is hiding out on yonder ducky!"] = "",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 --      ["The flag will respawn next round."] = "",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
-      ["TIME: "] = "ВРЕМЯ: ",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+      ["TIME: "] = "ВРЕМЯ: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 --      ["Toxic Team"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 --      ["TrophyRace"] = "",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 --      ["T_T"] = "",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 --      ["Unit 3378"] = "",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Use your rope to get from start to finish as fast as you can!"] = "",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 --      ["Victory for the "] = "", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You have SCORED!!"] = "",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You've failed. Try again."] = "",
 --      ["You've reached the goal!| |Time: "] = "",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/ru.txt b/share/hedgewars/Data/Locale/ru.txt
index c957f69..3618280 100644
--- a/share/hedgewars/Data/Locale/ru.txt
+++ b/share/hedgewars/Data/Locale/ru.txt
@@ -56,6 +56,8 @@
 00:53=Будка времени
 00:54=Структура
 00:55=Распылитель земли
+00:56=Замораживатель
+00:57=Секач
 
 01:00=Вперёд к победе!
 01:01=Ничья
diff --git a/share/hedgewars/Data/Locale/sk.lua b/share/hedgewars/Data/Locale/sk.lua
index 77bc779..46fb2c1 100644
--- a/share/hedgewars/Data/Locale/sk.lua
+++ b/share/hedgewars/Data/Locale/sk.lua
@@ -2,175 +2,986 @@ locale = {
         [":("] = ":(",
         ["!!!"] = "!!!",
         ["..."] = "...",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
         ["Accuracy Bonus!"] = "Bonus za presnosť!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
+--      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
         ["a Hedgewars mini-game"] = "minihra Hedgewars", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Tréning presnosti", --Bazooka, Shotgun, SniperRifle
-        ["Ammo"] = "Výzbroj",
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
         ["Ammo Depleted!"] = "Výzbroj vyčerpaná!",
---      ["Ammo Maniac!"] = "",
+        ["ammo extended!"] = "výzbroj doplnená!",
+        ["Ammo is reset at the end of your turn."] = "Výzbroj je na konci každého kola resetovaná.",
+        ["Ammo Maniac!"] = "Muničný maniak!",
+        ["Ammo"] = "Výzbroj",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
         ["Available points remaining: "] = "Zostávajúci počet bodov: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
+        ["[Backspace]"] = "[Backspace]",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
+        ["Bamboo Thicket"] = "Bambusové krovie",
+        ["Barrel Eater!"] = "Sudový labužník!",
+        ["Barrel Launcher"] = "Vystreľovač sudov",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "Loptami triafajte vašich nepriateľov|a zhoďte ich tak do mora!",
 	["Bat your opponents through the|baskets and out of the map!"] = "Odpálkujte vašich súperov do koša|a von z mapy!",
 	["Bazooka Training"] = "Tréning s bazukou",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Najrýchlejšie kolá podľa tímov: ",
         ["Best Team Times: "] = "Najrýchlejšie tímové časy: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
         ["Bloody Rookies"] = "Mizerní zelenáči", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
-        ["BOOM!"] = "BUM!",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
         ["Boom!"] = "Bum!",
+        ["BOOM!"] = "BUM!",
         ["Boss defeated!"] = "Vodca bol porazený!",
---      ["Boss Slayer!"] = "",
+        ["Boss Slayer!"] = "Vodca zabitý!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
+        ["Build a track and race."] = "Vybudujte trasu a pretekajte.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
         ["CAPTURE THE FLAG"] = "ZMOCNITE SA VLAJKY",
         ["Careless"] = "Bezstarostný",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
+        ["Change Weapon"] = "Zmeniť zbraň",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
         ["Clumsy"] = "Nešikovný",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
         ["Codename: Teamwork"] = "Kódové meno: Tímová práca",
---      ["Complete the track as fast as you can!"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
+        ["Complete the track as fast as you can!"] = "Prejdite trasu tak rýchlo, ako len viete!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
         ["Congratulations!"] = "Gratulujem!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Gratulujem! Zneškodnili ste všetky ciele|v stanovenom čase.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
         ["Control pillars to score points."] = "Ovládnite piliere, aby ste skórovali",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
         ["Cybernetic Empire"] = "Kybertnetické impérium",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
         ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "Do kelu s tebou, zelenáč! Okamžite mi zlez z hlavy!",
         ["DAMMIT, ROOKIE!"] = "Prekliaty zelenáč!",
         ["Dangerous Ducklings"] = "Nebezpečné kačiatka",
---      ["Deadweight"] = "",
---      ["Depleted Kamikaze!"] = "",
---      ["Destroy invaders to score points."] = "",
---      ["Drone Hunter!"] = "",
---      ["Drowner"] = "",
---      ["Each turn you get 1-3 random weapons"] = "",
+        ["Deadweight"] = "Mŕtva váha",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
+        ["Demolition is fun!"] = "Demolícia je super!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
+        ["Depleted Kamikaze!"] = "Vyčerpané kamikadze!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Destroy invaders to score points."] = "Ničte votrelcov a zbierajte tak body.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
+        ["Double Kill!"] = "Dvojitý zásah!",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
+        ["Drone Hunter!"] = "Lovec špionážnych lietadiel!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
+        ["Drowner"] = "Utopenec",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
+        ["Each turn you get 1-3 random weapons"] = "V každom ťahu dostanete 1-3 náhodné zbrane",
         ["Each turn you get one random weapon"] = "Každé koho dostanete jednu náhodnú zbraň",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
         ["Eliminate all enemies"] = "Zneškodnite všetkých nepriateľov",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Zneškodnite všetky ciele pred vypršaním času.|Na túto misiu máte neobmedzené množstvo streliva.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
         ["Eliminate Poison before the time runs out"] = "Zneškodnite Poisona pred tým, ako vyprší čas",
         ["Eliminate the Blue Team"] = "Zneškodnite modrý tím",
---      ["Eliminate the enemy specialists."] = "",
+        ["Eliminate the enemy before the time runs out"] = "Zneškodnite nepriateľa skôr ako vyprší čas", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+        ["Eliminate the enemy hogs to win."] = "Výhru si zaslúžite, ked zneškodníte  nepriateľských ježkov.",
+        ["Eliminate the enemy specialists."] = "Zneškodnite nepriateľských špecialistov.",
         ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Zneškodnite Jednotku 3378|- Slabý odpor musí prežiť",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Energetic Engineer"] = "", -- User_Mission_-_Bamboo_Thicket
         ["Enjoy the swim..."] = "Užite si plávanie...",
---      ["[Enter]"] = "",
+        ["[Enter]"] = "[Enter]",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Najrýchlejšie kolo: ",
         ["Feeble Resistance"] = "Slabý odpor",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
         ["Flag captured!"] = "Získaná vlajka!",
         ["Flag respawned!"] = "Vlajka obnovená!",
         ["Flag returned!"] = "Vlajka vrátená!",
---      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
+        ["Flags, and their home base will be placed where each team ends their first turn."] = "Vlajky a domovské základňe budú umiestnené tam, kde každý tím skončí svoj ťah.",
+        ["Flamer"] = "Plameňomet",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
+--      ["Friendly Fire!"] = "",
+        ["fuel extended!"] = "palivo doplnené!",
         ["GAME BEGUN!!!"] = "HRA ZAÄŒALA!!!",
         ["Game Modifiers: "] = "Modifikátory hry: ",
         ["GAME OVER!"] = "KONIEC HRY!",
         ["Game Started!"] = "Hra začala!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
         ["Get on over there and take him out!"] = "Okamžite sa tam presuň a zneškodni ho!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
         ["Goal"] = "Cieľ",
         ["GO! GO! GO!"] = "POHYB! POHYB! POHYB!",
         ["Good birdy......"] = "Dobrý vtáčik......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
         ["Good luck out there!"] = "Veľa šťastia!",
+--      ["Good so far!"] = "", -- Basic_Training_-_Sniper_Rifle
+--      ["Good to go!"] = "", -- Racer, Tumbler
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
         ["GOTCHA!"] = "A MÁM ŤA!",
+--      ["Grab Mines/Explosives"] = "", -- Tumbler
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
         ["Hahahaha!"] = "Hehehehe!",
         ["Haha, now THAT would be something!"] = "Haha, tak TO by bolo niečo!",
---      ["Hapless Hogs"] = "",
---      [" Hapless Hogs left!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
+        ["Hapless Hogs"] = "Bezmocní ježkovia",
+        [" Hapless Hogs left!"] = " Bezmocných ježkov ostalo!",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
+        ["Health crates extend your time."] = "Lekárničky vám dávajú čas naviac.",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
         ["Heavy"] = "Ťažký",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Basketbal",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
         ["Heh, it's not that bad."] = "Heh, to nie je také zlé.",
---      ["Hit Combo!"] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Hit Combo!"] = "Opakovaný zásah!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
         ["Hmmm..."] = "Hmm..",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
         ["Hooray!"] = "Hurá!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Lovec", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
         ["Instructor"] = "Inštruktor", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
---      ["invaders destroyed"] = "",
---      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
---      ["Jumping is disabled"] = "",
---      ["Kamikaze Expert!"] = "",
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
+        ["invaders destroyed"] = "votrelci zničení",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
+        ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Je dobre, že NÁHLA SMRŤ je tu až za 99 ťahov...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
+        ["Jumping is disabled"] = "Skákanie je vypnuté",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
+        ["Kamikaze Expert!"] = "Expert na samovraždy!",
+--      ["Keep it up!"] = "", -- Basic_Training_-_Sniper_Rifle
+--      ["Kerguelen"] = "", -- Continental_supplies
+--      ["Killing spree!"] = "", -- Tumbler
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
         ["KILLS"] = "ZABITÍ:",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Last Target!"] = "", -- Basic_Training_-_Sniper_Rifle
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
         ["[Left Shift]"] = "[Ľavý Shift]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
         ["Listen up, maggot!!"] = "Počúvaj, ty biedny červ!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Lively Lifeguard"] = "", -- User_Mission_-_That_Sinking_Feeling
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
+--      ["Mine Deployer"] = "", -- Space_Invasion, Tumbler
+--      ["Mine Eater!"] = "", -- Tumbler
         ["|- Mines Time:"] = "|- Časovač pre míny:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
         ["MISSION FAILED"] = "MISIA NEÚSPEŠNÁ", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
---      ["MISSION SUCCESS"] = "",
         ["MISSION SUCCESSFUL"] = "MISIA ÚSPEŠNÁ", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["MISSION SUCCESS"] = "MISIA ÚSPEŠNÁ",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
         ["Movement: [Up], [Down], [Left], [Right]"] = "Pohyb: [Hore], [Dole], [Vľavo], [Vpravo]",
---      ["Multi-shot!"] = "",
+        ["Multi-shot!"] = "Viacnásobná rana!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
         ["Nameless Heroes"] = "Hrdinovia bez mena",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["New Barrels Per Turn"] = "", -- Tumbler
         ["NEW CLAN RECORD: "] = "NOVÝ KLANOVÝ REKORD: ",
 	["NEW fastest lap: "] = "NOVÉ najrýchlejšie kolo: ",
---      ["NEW RACE RECORD: "] = "",
---      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["New Mines Per Turn"] = "", -- Tumbler
+        ["NEW RACE RECORD: "] = "NOVÝ REKORD ZÁVODU: ",
+--      ["Newton's Hammock"] = "", -- User_Mission_-_Newton_and_the_Hammock
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
+        ["NOT ENOUGH WAYPOINTS"] = "NEDOSTATOK NAVIGAČNÝCH BODOV",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "Nie tak celkom priateľský zápas", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
         ["Oh no! Just try again!"] = "Áále nie! Tak to skúste znovu!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Áále nie! Čas vypršal! Tak to skúste znovu.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
         ["Operation Diver"] = "Operácia Potápač",
         ["Opposing Team: "] = "Nepriateľský tím",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
         ["Pathetic Hog #%d"] = "Žalostný ježko #%d",
+--      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
         ["Per-Hog Ammo"] = "Samostatná munícia pre ježkov",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
         ["Place more waypoints using [ENTER]"] = "Umiesnite viac bodov pomocou [ENTER]u",
+--      ["Place more waypoints using the 'Air Attack' weapon."] = "", -- Racer
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
         ["points"] = "body", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
         ["Poison"] = "Poison",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
         ["Power Remaining"] = "Zostáva energie",
+--      ["Prepare yourself"] = "", -- The_Specialists
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
         ["Press [Precise] to skip intro"] = "Stlačte [Presnejšie mierenie] pre preskočenie intra",
---      ["Race complexity limit reached."] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+        ["Race complexity limit reached."] = "Bol dosiahnutý limit zložitosti závodu.",
+--      ["RACER"] = "", -- Racer
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
         [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Skórujete prinesením nepriateľskej vlajky do vašej základne | -  Prvý tím, ktorý dosiahne 3 body, vyhráva | - Skórujete len vtedy, keď je máte svoju vlajku v základni | - Spadnuté vlajky môžu byť vrátené na základňu alebo sa ich môže zmocniť súpere | - Ježkovia po smrti ožiujú",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
         ["Round Limit"] = "Limit na kolo",
+--      ["Round Limit:"] = "", -- Racer
         ["Rounds Complete"] = "Dokončených kôl",
+--      ["Rounds Complete: "] = "", -- Racer
         ["RULES OF THE GAME [Press ESC to view]"] = "PRAVIDLÁ HRY [Stlačte Esc pre ich zobrazenie]",
---      ["s|"] = "",
---      ["Save as many hapless hogs as possible!"] = "",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
+        ["Save as many hapless hogs as possible!"] = "Zachráňte toľko bezmocných ježkov, koľko len viete!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
         ["SCORE"] = "SKÓRE",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
         ["sec"] = "sek", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
         ["See ya!"] = "Tak zatiaľ!",
-        ["s"] = "s", -- GaudyRacer, Space_Invasion
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
+--      ["selected!"] = "", -- Space_Invasion, Tumbler
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
         ["Shield boosted! +30 power"] = "Štít posilnený! Energia +30",
         ["Shield Depleted"] = "Štít vyčerpaný",
         ["Shield is fully recharged!"] = "Štít je plne nabitý!",
---      ["Shield Master!"] = "",
---      ["Shield Miser!"] = "",
+        ["Shield Master!"] = "Odborník na štíty!",
+        ["Shield Miser!"] = "Amatér na štíty!",
         ["Shield OFF:"] = "Štít VYPNUTÝ:",
         ["Shield ON:"] = "Štít ZAPNUTÝ:",
         ["Shield Seeker!"] = "Hľadač štítov!",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Shotgun tím",
 	["Shotgun Training"] = "Tréning s brokovnicou",
         ["Shots Left: "] = "Zostáva striel: ", -- GaudyRacer, Tumbler
---      ["Silly"] = "",
---      ["Sinky"] = "",
+        ["shots remaining."] = "striel ostáva.",
+        ["Silly"] = "Hlúpy",
+        ["Sinky"] = "Prepadnutý",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s je mimo hru a tím %d|dostal trestný bod!| |Skóre:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s je mimo hru a tím %d|získal bod!| |Skóre:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Tréning pre ostreľovačov",
 	["Sniperz"] = "Ostreľovači",
---      ["Sponge"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
+        ["Sponge"] = "Å pongia",
         ["Spooky Tree"] = "Strašidelný strom",
---      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+        ["s|"] = "s|",
+        ["s"] = "s", -- GaudyRacer, Space_Invasion
+        ["STATUS UPDATE"] = "AKTUALIZÁCIA STAVU", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
         ["Switched to "] = "Prepnuté na ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Tím %d: ",
---      ["Team Scores"] = "", -- Control, Space_Invasion
---      ["That Sinking Feeling"] = "",
+        ["Team Scores"] = "Tímové skóre", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
+        ["That Sinking Feeling"] = "Potopené pocity",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
         ["That was pointless."] = "To bolo zbytočné.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
         ["The enemy is hiding out on yonder ducky!"] = "Nepriateľ sa schováva na tamtej kačičke!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
         ["The flag will respawn next round."] = "V ďalšom kole sa obnoví vlajka.",
---      ["The Nameless One"] = "",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
+        ["The Nameless One"] = "Bez mena",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
         ["THE SPECIALISTS"] = "Å PECIALISTI",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
+--      ["This one's tricky."] = "", -- Basic_Training_-_Sniper_Rifle
         ["This rain is really something..."] = "Ten dážď naozaj stojí za to...",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
         ["TIME: "] = "ÄŒAS: ",
---      ["Timed Kamikaze!"] = "",
+        ["Timed Kamikaze!"] = "Časovaná samovražda!",
         ["Time Extended!"] = "Predĺžený čas!",
+        ["Time Extension"] = "Predĺženie času",
         ["Time Left: "] = "Zostávajúci čas: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
         ["Toggle Shield"] = "Prepnúť štít",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
         ["Toxic Team"] = "Toxic tím", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
---      ["TRACK COMPLETED"] = "",
+        ["TRACK COMPLETED"] = "TRAŤ DOKONČENÁ",
+        ["TRACK FAILED!"] = "NEDOKONČILI STE TRAŤ!",
         ["Track Time: "] = "ÄŒas: ",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 	["TrophyRace"] = "Preteky o trofej",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
         ["T_T"] = "T_T",
+--      ["Tumbling Time Extended!"] = "", -- Tumbler
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
         ["Turn Time"] = "Čas na ťah",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
         ["Unit 3378"] = "Jednotka 3378",
+        ["Unit 835"] = "Jednotka 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+        ["Unit"] = "Jednotka",
         ["Unlimited Attacks"] = "Neobmedzené útoky",
---      ["User Challenge"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
+        ["Unstoppable!"] = "Nezastaviteľný!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
+        ["User Challenge"] = "Výzva",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Použite lano na presun zo štartovnej pozície do cieľa tak rýchlo, ako to len viete!",
         ["v.06"] = "v.06",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
         ["Victory for the "] = "Víťazstvo pre", -- CTF_Blizzard, Capture_the_Flag
---      ["Waypoint placed."] = "",
---      ["Weapons Reset"] = "",
-        ["WINNING TIME: "] = "ČAS PRE VÍŤAZSTVO: ",
---      ["You'd almost swear the water was rising!"] = "",
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
+        ["Waypoint placed."] = "Navigačný bod umiestnený.",
+        ["Way-Points Remaining"] = "Ostáva navigačných bodov",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Weapons reset."] = "", -- Highlander
+        ["Weapons Reset"] = "Reset zbraní",
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+        ["Well done."] = "Výborne.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
+        ["Will this ever end?"] = "Skončí to vôbec niekedy?",
+--      ["WINNER IS "] = "", -- Mutant
+        ["WINNING TIME: "] = "VÍŤAZNÝ ČAS: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
+        ["You'd almost swear the water was rising!"] = "Prisahal by si, že voda stúpa!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
         ["You have SCORED!!"] = "SKÓROVALI ste!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
         ["You saved"] = "Zachránili ste",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
         ["You've failed. Try again."] = "Neuspeli ste. Skúste to znova.",
 	["You've reached the goal!| |Time: "] = "Dosiahli ste cieľ!| |Čas: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Bazuka tím",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/stub.lua b/share/hedgewars/Data/Locale/stub.lua
index d097a12..6e243f6 100644
--- a/share/hedgewars/Data/Locale/stub.lua
+++ b/share/hedgewars/Data/Locale/stub.lua
@@ -2,158 +2,642 @@ locale = {
 --      [":("] = "",
 --      ["!!!"] = "",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Accuracy Bonus!"] = "",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
 --      ["Aiming Practice"] = "", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 --      ["Bat balls at your enemies and|push them into the sea!"] = "",
 --      ["Bat your opponents through the|baskets and out of the map!"] = "",
 --      ["Bazooka Training"] = "",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 --      ["Best laps per team: "] = "",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 --      ["Bloody Rookies"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 --      ["Boom!"] = "",
 --      ["BOOM!"] = "",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["CAPTURE THE FLAG"] = "",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 --      ["Codename: Teamwork"] = "",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
 --      ["Congratulations!"] = "",
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 --      ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 --      ["Control pillars to score points."] = "",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Cybernetic Empire"] = "",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 --      ["DAMMIT, ROOKIE!"] = "",
 --      ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "",
 --      ["Dangerous Ducklings"] = "",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 --      ["Eliminate all enemies"] = "",
 --      ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 --      ["Eliminate Poison before the time runs out"] = "",
 --      ["Eliminate the Blue Team"] = "",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
 --      ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 --      ["Enjoy the swim..."] = "",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 --      ["Fastest lap: "] = "",
 --      ["Feeble Resistance"] = "",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Flag captured!"] = "",
 --      ["Flag respawned!"] = "",
 --      ["Flag returned!"] = "",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
 --      ["GAME OVER!"] = "",
 --      ["Game Started!"] = "",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 --      ["Get on over there and take him out!"] = "",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
 --      ["GO! GO! GO!"] = "",
 --      ["Good birdy......"] = "",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 --      ["Good luck out there!"] = "",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 --      ["Hedgewars-Basketball"] = "",
 --      ["Hedgewars-Knockball"] = "",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
 --      ["Hmmm..."] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["Hooray!"] = "",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 --      ["Hunter"] = "", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 --      ["Instructor"] = "", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 --      ["Listen up, maggot!!"] = "",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 --      ["|- Mines Time:"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION FAILED"] = "", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
 --      ["MISSION SUCCESSFUL"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
 --      ["NEW fastest lap: "] = "",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Not So Friendly Match"] = "", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Oh no! Just try again!"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["Oh no! Time's up! Just try again."] = "", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Operation Diver"] = "",
 --      ["Opposing Team: "] = "",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 --      ["Pathetic Hog #%d"] = "",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 --      ["Poison"] = "",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 --      [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 --      ["RULES OF THE GAME [Press ESC to view]"] = "",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] = "", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 --      ["See ya!"] = "",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -162,59 +646,338 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 --      ["Shotgun Team"] = "",
 --      ["Shotgun Training"] = "",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 --      ["%s is out and Team %d|scored a penalty!| |Score:"] = "", -- Basketball, Knockball
 --      ["%s is out and Team %d|scored a point!| |Score:"] = "", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 --      ["Sniper Training"] = "",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 --      ["Spooky Tree"] = "",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Team %d: "] = "",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["That was pointless."] = "",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 --      ["The enemy is hiding out on yonder ducky!"] = "",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 --      ["The flag will respawn next round."] = "",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["TIME: "] = "",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 --      ["Toxic Team"] = "", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 --      ["TrophyRace"] = "",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 --      ["T_T"] = "",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 --      ["Unit 3378"] = "",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Use your rope to get from start to finish as fast as you can!"] = "",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 --      ["Victory for the "] = "", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You have SCORED!!"] = "",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 --      ["You've failed. Try again."] = "",
 --      ["You've reached the goal!| |Time: "] = "",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 --      ["'Zooka Team"] = "",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/sv.lua b/share/hedgewars/Data/Locale/sv.lua
index c97cb43..a8ea9eb 100644
--- a/share/hedgewars/Data/Locale/sv.lua
+++ b/share/hedgewars/Data/Locale/sv.lua
@@ -2,158 +2,642 @@ locale = {
 --      ["..."] = "",
 	[":("] = ":(",
 	["!!!"] = "!!!",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Accuracy Bonus!"] = "",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
 	["Aiming Practice"] = "Siktesövning", --Bazooka, Shotgun, SniperRifle
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
 	["Bat balls at your enemies and|push them into the sea!"] = "Slå bollar mot dina fiender|och slå ner dem i havet",
 	["Bat your opponents through the|baskets and out of the map!"] = "Slå ner dina motståndare i|korgarna och ut ur kartan!",
 	["Bazooka Training"] = "Bazookaträning",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
 	["Best laps per team: "] = "Bästa varv per lag: ",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
 	["Bloody Rookies"] = "Blodiga gröngölingar", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 --      ["BOOM!"] = "",
     ["Boom!"] = "Bom!",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 	["CAPTURE THE FLAG"] = "CAPTURE THE FLAG",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
 	["Codename: Teamwork"] = "Kodnamn: Lagarbete",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
 	["Congratulations!"] = "Grattis!",
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
 	["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Grattis! Du har förstört alla målen inom den|tillåtna tidsramen.", --Bazooka, Shotgun, SniperRifle
+--      ["Continental supplies"] = "", -- Continental_supplies
 	["Control pillars to score points."] = "Kontrollera pelare för att ta poäng",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
 	["Cybernetic Empire"] = "Robotriket",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
 	["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "SATAN, GRÖNGÖLING! SLUTA TJATA!",
 	["DAMMIT, ROOKIE!"] = "SATAN, GRÖNGÖLING!",
 	["Dangerous Ducklings"] = "Farliga ankungar",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
 	["Eliminate all enemies"] = "Förgör alla fiender",
 	["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Förstör alla målen innan din tid tar slut.|Du har obegränsad ammunition för deta uppdrag", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
 	["Eliminate Poison before the time runs out"] = "Förgör Gift innan tiden tar slut",
 	["Eliminate the Blue Team"] = "Förgör det Blå laget",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
 	["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Förgör Enhet 3378 |- Klent motstånd måste överleva",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
 	["Enjoy the swim..."] = "Ha en trevlig simtur...",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
 	["Fastest lap: "] = "Snabbast varv: ",
 	["Feeble Resistance"] = "Klent motstånd",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
 	["Flag captured!"] = "Flagga tagen!",
 	["Flag respawned!"] = "Flagga återställd!",
 	["Flag returned!"] = "Flagga återvänd!",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
 	["GAME OVER!"] = "SPELET ÄR SLUT!",
 	["Game Started!"] = "Spel startat!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
 	["Get on over there and take him out!"] = "Ta dig bort där och gör dig av med honom!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
 	["GO! GO! GO!"] = "Kör! Kör! Kör!",
 	["Good birdy......"] = "Fin fågel......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
 	["Good luck out there!"] = "Lycka till där ute!",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
 	["Hedgewars-Basketball"] = "Hedgewars-Basket",
 	["Hedgewars-Knockball"] = "Hedgewars-Knockball",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
 	["Hmmm..."] = "Hmmm...",
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
 	["Hooray!"] = "Hurra!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
 	["Hunter"] = "Jägare", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
 	["Instructor"] = "Instruktör", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
 	["Listen up, maggot!!"] = "Hör här, ynkrygg!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
     ["|- Mines Time:"] = "|- Mintid:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 	["MISSION FAILED"] = "UPPDRAG MISSLYCKADES", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
 	["MISSION SUCCESSFUL"] = "UPPDRAG SLUTFÖRT", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
 	["NEW fastest lap: "] = "NYTT snabbast varv: ",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
 	["Not So Friendly Match"] = "En inte så vänlig match", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
 	["Oh no! Just try again!"] = "Å nej! Bara att försöka igen!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 	["Oh no! Time's up! Just try again."] = "Åh nej! Tiden är ute! Pröva igen.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
 	["Operation Diver"] = "Operationens dykare",
 	["Opposing Team: "] = "Motståndarlag: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
 	["Pathetic Hog #%d"] = "Patetisk kott #%d",
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] = "", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
 	["Poison"] = "Gift",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 	[" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Återvänd med fiendens flagga till din bas för att ta poäng | - Första laget till tre vinner | - Du kan bara ta poäng när din egen flagga är i basen | - Kottar tappar flaggan när de dödas eller drunknar | - Tappade flaggor kan tas tillbaka eller fångas | - Kottar kommer tillbaka när de dör",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
 	["RULES OF THE GAME [Press ESC to view]"] = "SPELREGLER [Tryck ESC för att se]",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
     ["sec"] = "sec", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
 	["See ya!"] = "Ses!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -162,59 +646,338 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
 	["Shotgun Team"] = "Hagelgevärslaget",
 	["Shotgun Training"] = "Hagelgevärsträning",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
 	["%s is out and Team %d|scored a penalty!| |Score:"] = "%s är ute och lag %d|fick ett straff!| |Poängställning:", -- Basketball, Knockball
 	["%s is out and Team %d|scored a point!| |Score:"] = "%s är ute och lag %d|fick ett poäng!| |Poängställning:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
 	["Sniper Training"] = "Prickskyttesträning",
 	["Sniperz"] = "Prickskyttarna",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
 	["Spooky Tree"] = "Kusligt träd",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
 	["Team %d: "] = "Lag %d: ",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
     ["That was pointless."] = "Det där var meningslöst.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
 	["The enemy is hiding out on yonder ducky!"] = "Fienden gömmer sig på andra ankan!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
     ["The flag will respawn next round."] = "Flaggan kommer tillbaka nästa runda.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["TIME: "] = "",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
 	["Toxic Team"] = "Förgiftade laget", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
 	["TrophyRace"] = "TrophyRace",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
 	["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
 	["Unit 3378"] = "Enhet 3378",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
 	["Use your rope to get from start to finish as fast as you can!"] = "Använd ditt rep för att ta dig från start till mål så fort som möjligt!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
 	["Victory for the "] = "Vinst för", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
 	["You have SCORED!!"] = "Du har tagit poäng!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
 	["You've failed. Try again."] = "Du har misslyckats. Försök igen.",
 	["You've reached the goal!| |Time: "] = "Du har nått målet!| |Tid: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
 	["'Zooka Team"] = "Bazookalaget",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
     }
diff --git a/share/hedgewars/Data/Locale/uk.lua b/share/hedgewars/Data/Locale/uk.lua
index 2c39ee8..2cff31b 100644
--- a/share/hedgewars/Data/Locale/uk.lua
+++ b/share/hedgewars/Data/Locale/uk.lua
@@ -1,159 +1,640 @@
 locale = {
 --      [":("] = "",
-        ["!!!"] = "Я!",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
         ["Accuracy Bonus!"] = "Бонус Точності!",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
         ["Achievement Unlocked"] = "Досягнення Розблоковано", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
         ["a Hedgewars mini-game"] = "Міні-гра Hedgewars", -- Space_Invasion, The_Specialists
         ["Aiming Practice"] = "Практика прицілювання", --Bazooka, Shotgun, SniperRifle
-        ["Ammo"] = "Боєприпаси",
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
         ["Ammo Depleted!"] = "Боєприпаси Скінчились!",
         ["ammo extended!"] = "Боєприпаси поповнені!",
         ["Ammo is reset at the end of your turn."] = "Боєприпаси обнуляються в кінці вашого ходу.",
         ["Ammo Maniac!"] = "Маніяк Боєприпасів!",
+        ["Ammo"] = "Боєприпаси",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
         ["Available points remaining: "] = "Залишилось доступних очків: ",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
         ["Bamboo Thicket"] = "Бамбукові Хащі",
         ["Barrel Eater!"] = "Поїдач Бочок!",
         ["Barrel Launcher"] = "Катапульта для бочок",
+--      ["Baseballbat"] = "", -- Continental_supplies
         ["Bat balls at your enemies and|push them into the sea!"] = "Закидайте ворогів м'ячами щоб|зіштовути їх у море!",
         ["Bat your opponents through the|baskets and out of the map!"] = "Дубасьте опонентів битою через|кошики та за межі карти!",
         ["Bazooka Training"] = "Тренування з базукою",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
         ["Best laps per team: "] = "Кращі партії на команду: ",
         ["Best Team Times: "] = "Кращий Командний Час: ",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
         ["Bloody Rookies"] = "Криваві Салаги", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
-        ["BOOM!"] = "БАБАХ!",
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
         ["Boom!"] = "Бабах!",
+        ["BOOM!"] = "БАБАХ!",
         ["Boss defeated!"] = "Боса переможено!",
         ["Boss Slayer!"] = "Вбивця Боса!",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
         ["Build a track and race."] = "Створіть трасу та женіть.",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
         ["CAPTURE THE FLAG"] = "ЗАХОПЛЕННЯ ПРАПОРА",
         ["Careless"] = "Безтурботний",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
         ["Change Weapon"] = "Змінити Зброю",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
         ["Clumsy"] = "Незграбний",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
         ["Codename: Teamwork"] = "Кодова назва: Командна гра",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
         ["Complete the track as fast as you can!"] = "Подолайте трасу так швидко, як тільки зможете!",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
         ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "Вітаємо! Ви знищили всі цілі|в межах дозволеного часу.", --Bazooka, Shotgun, SniperRifle
         ["Congratulations!"] = "Вітаємо!",
+--      ["Continental supplies"] = "", -- Continental_supplies
         ["Control pillars to score points."] = "Контрольюй стовпи щоб набрати очки.",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
         ["Cybernetic Empire"] = "Кібернетична Імперія",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
         ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "ЧОРТ ЗАБИРАЙ, САЛАГА! ЗЛІЗЬ З МОЄЇ ГОЛОВИ!",
         ["DAMMIT, ROOKIE!"] = "ЧОРТ ЗАБИРАЙ, САЛАГА!",
         ["Dangerous Ducklings"] = "Небезпечні Каченята",
         ["Deadweight"] = "Власна вага",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
         ["Demolition is fun!"] = "Руйнування це весело!",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
         ["Depleted Kamikaze!"] = "Виснажений Камікадзе!",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
         ["Destroy invaders to score points."] = "Знищіть загарбників, щоб набрати очки.",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
+--      ["DOUBLE KILL"] = "", -- Mutant
         ["Double Kill!"] = "Подвійне Вбивство!",
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
         ["Drone Hunter!"] = "Мисливець за Джмелями!",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
         ["Drowner"] = "Потопаючий",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
         ["Each turn you get 1-3 random weapons"] = "Кожного ходу ви отримуєте 1-3 випадкової зброї",
         ["Each turn you get one random weapon"] = "Кожного ходу ви отримуєте одну випадкову зброю",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
         ["Eliminate all enemies"] = "Ліквідуйте всіх ворогів",
         ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "Знищіть всі цілі до закінчення часу.|У вас безмежні боєприпаси.", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
         ["Eliminate Poison before the time runs out"] = "Знешкодьте Смердюка до закінчення часу",
         ["Eliminate the Blue Team"] = "Знищіть Синю Команду",
         ["Eliminate the enemy before the time runs out"] = "Знешкодьте ворога до закінчення часу", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
         ["Eliminate the enemy hogs to win."] = "Знешкодьте ворожих їжаків щоб перемогти.",
         ["Eliminate the enemy specialists."] = "Знешкодьте ворожих спеціалістів.",
         ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- Знищіть Об'єкт 3378 |- Жалюгідні Повстанці повинні вижити",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
         ["Energetic Engineer"] = "Енергетичний Інженер",
         ["Enjoy the swim..."] = "Насолоджуйся плаванням...",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
         ["Fastest lap: "] = "Найшвидша партія: ",
         ["Feeble Resistance"] = "Жалюгідні Повстанці",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
         ["Fire"] = "Вогонь",
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
         ["Flag captured!"] = "Прапор захоплено!",
         ["Flag respawned!"] = "Прапор відновлено!",
         ["Flag returned!"] = "Прапор повернено!",
         ["Flags, and their home base will be placed where each team ends their first turn."] = "Прапори і їх базування будуть розміщені там, де кожна команда закінчить її перший хід.",
         ["Flamer"] = "Вогнемет",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
         ["Friendly Fire!"] = "Дружній Вогонь!",
         ["fuel extended!"] = "пальне поповнене!",
         ["GAME BEGUN!!!"] = "ГРА ПОЧАЛАСЬ!!!",
         ["Game Modifiers: "] = "Модифікатори Гри: ",
         ["GAME OVER!"] = "КІНЕЦЬ ГРИ!",
         ["Game Started!"] = "Гра почалась!",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
         ["Get on over there and take him out!"] = "Залізь туди і прикінчи його!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
         ["Goal"] = "Мета",
         ["GO! GO! GO!"] = "ДАВАЙ! ДАВАЙ! РУХАЙСЯ!",
         ["Good birdy......"] = "Гарна пташка......",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
         ["Good luck out there!"] = "Удачі!",
         ["Good so far!"] = "Покищо добре!",
         ["Good to go!"] = "Так тримати!",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
         ["GOTCHA!"] = "ПОПАВСЯ!",
         ["Grab Mines/Explosives"] = "Схопити Міни/Вибухівку",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
         ["Hahahaha!"] = "Хахахаха!",
         ["Haha, now THAT would be something!"] = "Хаха, от ЦЕ буде щось!",
-        ["Hapless Hogs"] = "Нещасні Їжаки",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
         [" Hapless Hogs left!"] = " Нещасних Їжаків лишилось!",
+        ["Hapless Hogs"] = "Нещасні Їжаки",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
         ["Health crates extend your time."] = "Ящики зі здоров'ям продовжують ваш час.",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
         ["Heavy"] = "В'ялий",
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
         ["Hedgewars-Basketball"] = "Баскетбол Їжаками",
         ["Hedgewars-Knockball"] = "Бейсбол Їжаками",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
         ["Heh, it's not that bad."] = "хех, це не так вже й погано.",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
         ["Hit Combo!"] = "Зробив Комбо!",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
         ["Hmmm..."] = "Хмм...",
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
         ["Hooray!"] = "Урааа!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
         ["Hunter"] = "Мисливець", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
         ["Instructor"] = "Інструктор", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
         ["invaders destroyed"] = "Загарбників знищено",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
         ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "Це чудово що РАПТОВА СМЕРТЬ віддалилась на 99 ходів...",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
         ["Jumping is disabled"] = "Стрибання вимкнене",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
         ["Kamikaze Expert!"] = "Камікадзе Експерт!",
         ["Keep it up!"] = "Так тримати!",
+--      ["Kerguelen"] = "", -- Continental_supplies
         ["Killing spree!"] = "Череда вбивств!",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
         ["KILLS"] = "ВБИВСТВ",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
         ["Last Target!"] = "Остання Ціль!",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
         ["[Left Shift]"] = "[Лівий Shift]",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
         ["Listen up, maggot!!"] = "Слухай, хробак!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
         ["Lively Lifeguard"] = "Жвавий Рятівник",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
         ["Mine Deployer"] = "Мінер",
         ["Mine Eater!"] = "Поїдач Мін!",
         ["|- Mines Time:"] = "|- Час детонування мін:", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
         ["MISSION FAILED"] = "МІСІЮ ПРОВАЛЕНО", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
-        ["MISSION SUCCESS"] = "УСПІХ МІСІЇ",
         ["MISSION SUCCESSFUL"] = "МІСІЮ ВИКОНАНО", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+        ["MISSION SUCCESS"] = "УСПІХ МІСІЇ",
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
         ["Movement: [Up], [Down], [Left], [Right]"] = "Керування: [Вверх], [Вниз], [Вліво], [Вправо]",
         ["Multi-shot!"] = "Мультипостріл!",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
         ["Nameless Heroes"] = "Безіменні Герої",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
         ["New Barrels Per Turn"] = "Нових Бочок на Хід",
         ["NEW CLAN RECORD: "] = "НОВИЙ РЕКОРД КЛАНУ: ",
         ["NEW fastest lap: "] = "НОВА найшвидша партія: ",
         ["New Mines Per Turn"] = "Нових Мін на Хід",
         ["NEW RACE RECORD: "] = "НОВИЙ РЕКОРД ГОНКИ: ",
         ["Newton's Hammock"] = "Гамак Ньютона",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
         ["NOT ENOUGH WAYPOINTS"] = "НЕДОСТАТНЬО ТОЧОК ШЛЯХУ",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
         ["Not So Friendly Match"] = "Не дуже товариський матч", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
         ["Oh no! Just try again!"] = "О, ні! Давай, спробуй ще раз!", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
         ["Oh no! Time's up! Just try again."] = "О, ні! Час йде! Спробуй ще раз.", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
         ["Operation Diver"] = "Операція Водолаз",
         ["Opposing Team: "] = "Команда-Противник: ",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
         ["Pathetic Hog #%d"] = "Жалюгідний Їжак #%d",
         ["Pathetic Resistance"] = "Жалюгідний Опір", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
         ["Per-Hog Ammo"] = "Боєприпаси на їжака",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
         ["Place more waypoints using [ENTER]"] = "Розмістіть більше точок шляху за допомогою [Enter]",
         ["Place more waypoints using the 'Air Attack' weapon."] = "Розмістіть більше точок шляху використавши зброю 'Повітряна Атака'.",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
         ["points"] = "очок", -- Control, CTF_Blizzard, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle
         ["Poison"] = "Смердюк",
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
         ["Power Remaining"] = "Залишилось Енергії",
         ["Prepare yourself"] = "Приготуйся",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
         ["Press [Precise] to skip intro"] = "Натисніть [Приціл] щоб пропустити вступ",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
         ["Race complexity limit reached."] = "Досягнута межа складності гонки.",
         ["RACER"] = "ГОНЩИК",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
         [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = " - Поверніть ворожий прапор на свою базу щоб заробити очко | - Виграє команда з трьома очками | - Ви можете заробити очко лише коли ваш прапор на вашій базі | - Їжак покине прапор якщо потоне чи буде вбитий | - Покинутий прапор можна повернути або захопити знов | - Їжаки відновлюються після смерті",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
         ["Round Limit:"] = "Межа Раунду:",
         ["Round Limit"] = "Межа Раунду",
         ["Rounds Complete: "] = "Раундів Завершено: ",
         ["Rounds Complete"] = "Раундів Завершено",
         ["RULES OF THE GAME [Press ESC to view]"] = "ПРАВИЛА ГРИ [Натисніть ESC для перегляду]",
-        ["s|"] = "с|",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
         ["Save as many hapless hogs as possible!"] = "Врятуйте якнайбільше нещасних їжаків!",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
+--      ["Score"] = "", -- Mutant
         ["SCORE"] = "РАХУНОК",
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
         ["sec"] = "сек", -- CTF_Blizzard, TrophyRace, Basic_Training_-_Bazooka, Basic_Training_-_Shotgun, Basic_Training_-_Sniper_Rifle, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork, Capture_the_Flag
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
         ["See ya!"] = "Побачимося!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
         ["selected!"] = "вибрано!",
-        ["s"] = "с", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
         ["Shield boosted! +30 power"] = "Щит підсилено! +30 сили",
         ["Shield Depleted"] = "Щит Вичерпаний",
         ["Shield is fully recharged!"] = "Щит повністю заряджений!",
@@ -162,59 +643,341 @@ locale = {
         ["Shield OFF:"] = "Щит Вимкнено:",
         ["Shield ON:"] = "Щит Ввімкнено:",
         ["Shield Seeker!"] = "Шукач Щита!",
+--      ["Shotgun"] = "", -- Continental_supplies
         ["Shotgun Team"] = "Команда Рушниць",
         ["Shotgun Training"] = "Тренування з рушницею",
         ["shots remaining."] = "пострілів залишилось.",
         ["Silly"] = "Дурник",
         ["Sinky"] = "Любимчик",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
         ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s вибув і Команда %d|отримала штраф!| |Рахунок:", -- Basketball, Knockball
         ["%s is out and Team %d|scored a point!| |Score:"] = "%s вибув і Команда %d|заробила очко!| |Рахунок:", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
         ["Sniper Training"] = "Снайперське тренування",
 --      ["Sniperz"] = "",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
         ["Sponge"] = "Губка",
         ["Spooky Tree"] = "Примарне Дерево",
         ["STATUS UPDATE"] = "ОНОВЛЕННЯ СТАНУ", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
         ["Switched to "] = "Перейшов до ",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+        ["s|"] = "с|",
+        ["s"] = "с", -- GaudyRacer, Space_Invasion
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
         ["Team %d: "] = "Команда %d: ",
         ["Team Scores"] = "Очки Команди", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
         ["That Sinking Feeling"] = "Ця раптова слабкість",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
         ["That was pointless."] = "Це було безглуздо.",
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
         ["The enemy is hiding out on yonder ducky!"] = "Ворог ховається на он тій качечці!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
         ["The flag will respawn next round."] = "Прапор відновиться в наступному раунді.",
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
         ["The Nameless One"] = "Безіменний",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
         ["THE SPECIALISTS"] = "СПЕЦІАЛІСТИ",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
         ["This one's tricky."] = "Хитро придумано.",
         ["This rain is really something..."] = "Цей дощ дійсно дещо...",
-        ["TIME: "] = "ЧАС: ",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
         ["Timed Kamikaze!"] = "Часовий Камікадзе!",
         ["Time Extended!"] = "Час Продовжено!",
         ["Time Extension"] = "Збільшення Часу",
+        ["TIME: "] = "ЧАС: ",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
         ["Toggle Shield"] = "Перемкнути Щит",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
         ["Toxic Team"] = "Токсична Команда", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
         ["TRACK COMPLETED"] = "ТРАСУ ПРОЙДЕНО",
         ["TRACK FAILED!"] = "ТРАСУ НЕ ПРОЙДЕНО!",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
         ["TrophyRace"] = "Погоня за Трофеєм",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
         ["T_T"] = "Ааааа!!!",
         ["Tumbling Time Extended!"] = "Час Падіння Збільшений!",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
         ["Turn Time"] = "Час Ходу",
-        ["Unit"] = "Модуль",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
         ["Unit 3378"] = "Об'єкт 3378",
         ["Unit 835"] = "Об'єкт 835",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
+        ["Unit"] = "Модуль",
         ["Unlimited Attacks"] = "Необмежені Атаки",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
         ["Unstoppable!"] = "Невпинний!",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
         ["User Challenge"] = "Дуель між користувачами",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
         ["Use your rope to get from start to finish as fast as you can!"] = "Скористайся мотузкою щоб якнайшвидше досягнути фінішу!",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
         ["Victory for the "] = "Перемога для ", -- CTF_Blizzard, Capture_the_Flag
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
         ["Waypoint placed."] = "Точка шляху розміщена.",
         ["Way-Points Remaining"] = "Залишилось Точок",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Weapons reset."] = "", -- Highlander
         ["Weapons Reset"] = "Скидання Зброї",
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
         ["Well done."] = "Чудова робота.",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
         ["Will this ever end?"] = "Це коли-небудь закінчиться?",
+--      ["WINNER IS "] = "", -- Mutant
         ["WINNING TIME: "] = "ЧАС ВИГРАШУ: ",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
         ["You'd almost swear the water was rising!"] = "Ти ледь не присягався, що вода піднімається!",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
         ["You have SCORED!!"] = "Ви заробили ОЧКО!!",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
         ["You saved"] = "Ви врятували",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
         ["You've failed. Try again."] = "Спроба не вдалась. Спробуйте знов.",
         ["You've reached the goal!| |Time: "] = "Ви досягли мети!| |Час: ",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
         ["'Zooka Team"] = "Команда 'Zooka",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+        ["!!!"] = "Я!",
     }
diff --git a/share/hedgewars/Data/Locale/zh_CN.lua b/share/hedgewars/Data/Locale/zh_CN.lua
index 89f85d9..467107e 100644
--- a/share/hedgewars/Data/Locale/zh_CN.lua
+++ b/share/hedgewars/Data/Locale/zh_CN.lua
@@ -1,162 +1,646 @@
 locale = {
       ["!!!"] = "!!!",
 --      ["..."] = "",
+--      ["011101000"] = "", -- A_Classic_Fairytale:dragon
+--      ["011101001"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["30 minutes later..."] = "", -- A_Classic_Fairytale:shadow
+--      ["About a month ago, a cyborg came and told us that you're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
 --      ["Accuracy Bonus!"] = "",
+--      ["Ace"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["Achievement Unlocked"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_That_Sinking_Feeling, Tumbler
+--      ["A Classic Fairytale"] = "", -- A_Classic_Fairytale:first_blood
+--      ["???"] = "", -- A_Classic_Fairytale:backstab
+--      ["Actually, you aren't worthy of life! Take this..."] = "", -- A_Classic_Fairytale:shadow
+--      ["A cy-what?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Adventurous"] = "", -- A_Classic_Fairytale:journey
+--      ["Africa"] = "", -- Continental_supplies
+--      ["After Leaks A Lot betrayed his tribe, he joined the cannibals..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."] = "", -- A_Classic_Fairytale:shadow
+--      ["Again with the 'cannibals' thing!"] = "", -- A_Classic_Fairytale:enemy
+--      ["a Hedgewars challenge"] = "", -- User_Mission_-_RCPlane_Challenge, User_Mission_-_Rope_Knock_Challenge
 --      ["a Hedgewars mini-game"] = "", -- Space_Invasion, The_Specialists
       ["Aiming Practice"] = "瞄准练习", --火箭筒、霰弹枪、狙击枪
+--      ["A leap in a leap"] = "", -- A_Classic_Fairytale:first_blood
+--      ["A little gift from the cyborgs"] = "", -- A_Classic_Fairytale:shadow
+--      ["All gone...everything!"] = "", -- A_Classic_Fairytale:enemy
+--      ["All right, we just need to get to the other side of the island!"] = "", -- A_Classic_Fairytale:journey
+--      ["All walls touched!"] = "", -- WxW
 --      ["Ammo"] = "",
 --      ["Ammo Depleted!"] = "",
 --      ["ammo extended!"] = "",
 --      ["Ammo is reset at the end of your turn."] = "",
 --      ["Ammo Maniac!"] = "",
+--      ["And how am I alive?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["And so it began..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["...and so the cyborgs took over the world..."] = "", -- A_Classic_Fairytale:shadow
+--      ["And so they discovered that cyborgs weren't invulnerable..."] = "", -- A_Classic_Fairytale:journey
+--      ["And where's all the weed?"] = "", -- A_Classic_Fairytale:dragon
+--      ["And you believed me? Oh, god, that's cute!"] = "", -- A_Classic_Fairytale:journey
+--      ["Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"] = "", -- Continental_supplies
+--      ["Antarctica"] = "", -- Continental_supplies
+--      ["Are we there yet?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Are you accusing me of something?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Are you saying that many of us have died for your entertainment?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Artur Detour"] = "", -- A_Classic_Fairytale:queen
+--      ["As a reward for your performance, here's some new technology!"] = "", -- A_Classic_Fairytale:dragon
+--      ["a shoppa minigame"] = "", -- WxW
+--      ["Asia"] = "", -- Continental_supplies
+--      ["Assault Team"] = "", -- A_Classic_Fairytale:backstab
+--      ["As the ammo is sparse, you might want to reuse ropes while mid-air.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["As the challenge was completed, Leaks A Lot set foot on the ground..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["As you can see, there is no way to get on the other side!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Attack From Rope"] = "", -- WxW
+--      ["Australia"] = "", -- Continental_supplies
 --      ["Available points remaining: "] = "",
+--      ["Back Breaker"] = "", -- A_Classic_Fairytale:backstab
+--      ["Back in the village, after telling the villagers about the threat..."] = "", -- A_Classic_Fairytale:united
 --      ["[Backspace]"] = "",
+--      ["Backstab"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bad Team"] = "", -- User_Mission_-_The_Great_Escape
 --      ["Bamboo Thicket"] = "",
 --      ["Barrel Eater!"] = "",
 --      ["Barrel Launcher"] = "",
+--      ["Baseballbat"] = "", -- Continental_supplies
       ["Bat balls at your enemies and|push them into the sea!"] = "发射棒球将敌人击打入水",
       ["Bat your opponents through the|baskets and out of the map!"] = "把敌人击出场地——对准栏框",
       ["Bazooka Training"] = "火箭筒训练",
+--      ["Beep Loopers"] = "", -- A_Classic_Fairytale:queen
       ["Best laps per team: "] = "每一队最佳速度:",
 --      ["Best Team Times: "] = "",
+--      ["Beware, though! If you are slow, you die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Biomechanic Team"] = "", -- A_Classic_Fairytale:family
+--      ["Blender"] = "", -- A_Classic_Fairytale:family
+--      ["Bloodpie"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bloodrocutor"] = "", -- A_Classic_Fairytale:shadow
+--      ["Bloodsucker"] = "", -- A_Classic_Fairytale:shadow
       ["Bloody Rookies"] = "雉儿飞", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree
+--      ["Bone Jackson"] = "", -- A_Classic_Fairytale:backstab
+--      ["Bonely"] = "", -- A_Classic_Fairytale:shadow
 --      ["Boom!"] =
 --      ["BOOM!"] = "",
 --      ["Boss defeated!"] = "",
 --      ["Boss Slayer!"] = "",
+--      ["Brain Blower"] = "", -- A_Classic_Fairytale:journey
+--      ["Brainiac"] = "", -- A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:shadow
+--      ["Brainila"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Stu"] = "", -- A_Classic_Fairytale:united
+--      ["Brain Teaser"] = "", -- A_Classic_Fairytale:backstab
+--      ["Brutal Lily"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil
+--      ["Brutus"] = "", -- A_Classic_Fairytale:backstab
 --      ["Build a track and race."] = "",
+--      ["Bullseye"] = "", -- A_Classic_Fairytale:dragon
+--      ["But it proved to be no easy task!"] = "", -- A_Classic_Fairytale:dragon
+--      ["But that's impossible!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But the ones alive are stronger in their heart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["But...we died!"] = "", -- A_Classic_Fairytale:backstab
+--      ["But where can we go?"] = "", -- A_Classic_Fairytale:united
+--      ["But why would they help us?"] = "", -- A_Classic_Fairytale:backstab
+--      ["But you're cannibals. It's what you do."] = "", -- A_Classic_Fairytale:enemy
+--      ["But you said you'd let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["Call me Beep! Well, 'cause I'm such a nice...person!"] = "", -- A_Classic_Fairytale:family
+--      ["Cannibals"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:first_blood
+--      ["Cannibal Sentry"] = "", -- A_Classic_Fairytale:journey
+--      ["Cannibals?! You're the cannibals!"] = "", -- A_Classic_Fairytale:enemy
       ["CAPTURE THE FLAG"] = "抢旗子",
 --      ["Careless"] = "",
+--      ["Carol"] = "", -- A_Classic_Fairytale:family
+--      ["CHALLENGE COMPLETE"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Change Weapon"] = "",
+--      ["Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Clumsy"] = "",
+--      ["Cluster Bomb MASTER!"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Cluster Bomb Training"] = "", -- Basic_Training_-_Cluster_Bomb
       ["Codename: Teamwork"] = "代号:团队行动",
+--      ["Collateral Damage"] = "", -- A_Classic_Fairytale:journey
+--      ["Collateral Damage II"] = "", -- A_Classic_Fairytale:journey
+--      ["Collect all the crates, but remember, our time in this life is limited!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect or destroy all the health crates."] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Collect the crates within the time limit!|If you fail, you'll have to try again."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Come closer, so that your training may continue!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Compete to use as few planes as possible!"] = "", -- User_Mission_-_RCPlane_Challenge
 --      ["Complete the track as fast as you can!"] = "",
+--      ["COMPLETION TIME"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Configuration accepted."] = "", -- WxW
+--      ["Congratulations"] = "", -- Basic_Training_-_Rope
+--      ["Congratulations! You needed only half of time|to eliminate all targets."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"] = "", -- Basic_Training_-_Rope
       ["Congratulations! You've eliminated all targets|within the allowed time frame."] = "恭喜!你在规定时限内清零全部目标。", --Bazooka, Shotgun, SniperRifle
       ["Congratulations!"] = "恭喜",
+--      ["Continental supplies"] = "", -- Continental_supplies
       ["Control pillars to score points."] = "控制支柱得分",
+--      ["Corporationals"] = "", -- A_Classic_Fairytale:queen
+--      ["Corpsemonger"] = "", -- A_Classic_Fairytale:shadow
+--      ["Corpse Thrower"] = "", -- A_Classic_Fairytale:epil
+--      ["Crates Left:"] = "", -- User_Mission_-_RCPlane_Challenge
       ["Cybernetic Empire"] = "自动化帝国",
+--      ["Cyborg. It's what the aliens call themselves."] = "", -- A_Classic_Fairytale:enemy
+--      ["Dahmer"] = "", -- A_Classic_Fairytale:backstab
       ["DAMMIT, ROOKIE! GET OFF MY HEAD!"] = "新人,别让我看到",
       ["DAMMIT, ROOKIE!"] = "新人",
       ["Dangerous Ducklings"] = "危险的小鸭子",
 --      ["Deadweight"] = "",
+--      ["Defeat the cannibals"] = "", -- A_Classic_Fairytale:backstab
+--      ["Defeat the cannibals!|"] = "", -- A_Classic_Fairytale:united
+--      ["Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
+--      ["Defeat the cyborgs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"] = "", -- A_Classic_Fairytale:shadow
 --      ["Demolition is fun!"] = "",
+--      ["Dense Cloud"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Dense Cloud must have already told them everything..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Depleted Kamikaze!"] = "",
+--      ["Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Destroy invaders to score points."] = "",
+--      ["Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Did anyone follow you?"] = "", -- A_Classic_Fairytale:united
+--      ["Did you see him coming?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Did you warn the village?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Die, die, die!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"] = "", -- Continental_supplies
+--      ["Dist: "] = "", -- Space_Invasion
+--      ["Do not laugh, inexperienced one, for he speaks the truth!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Do the deed"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Double Kill!"] = "",
+--      ["DOUBLE KILL"] = "", -- Mutant
+--      ["Do you have any idea how valuable grass is?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Do you think you're some kind of god?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Dragon's Lair"] = "", -- A_Classic_Fairytale:dragon
+--      ["Drills"] = "", -- A_Classic_Fairytale:backstab
 --      ["Drone Hunter!"] = "",
+--      ["Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"] = "", -- Continental_supplies
 --      ["Drowner"] = "",
+--      ["Dude, all the plants are gone!"] = "", -- A_Classic_Fairytale:family
+--      ["Dude, can you see Ramon and Spiky?"] = "", -- A_Classic_Fairytale:journey
+--      ["Dude, that's so cool!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, we really need a new shaman..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Dude, what's this place?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Dude, where are we?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Dude, wow! I just had the weirdest high!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Duration"] = "", -- Continental_supplies
+--      ["Dust storm: [Deals 20 damage to all enemies in the circle]"] = "", -- Continental_supplies
 --      ["Each turn you get 1-3 random weapons"] = "",
 --      ["Each turn you get one random weapon"] = "",
+--      ["Eagle Eye"] = "", -- A_Classic_Fairytale:backstab
+--      ["Eagle Eye: [Blink to the impact ~ one shot]"] = "", -- Continental_supplies
+--      ["Ear Sniffer"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:epil
+--      ["Elderbot"] = "", -- A_Classic_Fairytale:family
+--      ["Elimate your captor."] = "", -- User_Mission_-_The_Great_Escape
       ["Eliminate all enemies"] = "解决全部对手",
       ["Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."] = "时间限制内清除全部目标。弹药无限。", --Bazooka, Shotgun, SniperRifle
+--      ["Eliminate enemy hogs and take their weapons."] = "", -- Highlander
       ["Eliminate Poison before the time runs out"] = "时间限制内清除毒素。",
       ["Eliminate the Blue Team"] = "解决蓝色队伍",
 --      ["Eliminate the enemy before the time runs out"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
 --      ["Eliminate the enemy hogs to win."] = "",
 --      ["Eliminate the enemy specialists."] = "",
       ["- Eliminate Unit 3378 |- Feeble Resistance must survive"] = "- 打倒 3378 |-反抗者必须存活",
+--      ["Elmo"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["Energetic Engineer"] = "",
       ["Enjoy the swim..."] = "游水愉快",
 --      ["[Enter]"] = "",
+--      ["Europe"] = "", -- Continental_supplies
+--      [" ever done to you?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Everyone knows this."] = "", -- A_Classic_Fairytale:enemy
+--      ["Every single time!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Everything looks OK..."] = "", -- A_Classic_Fairytale:enemy
+--      ["Exactly, man! That was my dream."] = "", -- A_Classic_Fairytale:backstab
+--      ["Eye Chewer"] = "", -- A_Classic_Fairytale:journey
+--      ["FAG"] = "", -- Mutant
+--      ["Family Reunion"] = "", -- A_Classic_Fairytale:family
       ["Fastest lap: "] = "最快记录:",
       ["Feeble Resistance"] = "反抗者",
+--      ["Fell From Grace"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Fell From Heaven"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen
+--      ["Fell From Heaven is the best! Fell From Heaven is the greatest!"] = "", -- A_Classic_Fairytale:family
+--      ["Femur Lover"] = "", -- A_Classic_Fairytale:shadow
+--      ["Fierce Competition!"] = "", -- Space_Invasion
+--      ["Fiery Water"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Find your tribe!|Cross the lake!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Finish your training|Hint: Animations can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Fire"] = "",
+--      ["Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"] = "", -- Continental_supplies
+--      ["First aid kits?!"] = "", -- A_Classic_Fairytale:united
+--      ["First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["FIRST BLOOD MUTATES"] = "", -- Mutant
+--      ["First Steps"] = "", -- A_Classic_Fairytale:first_blood
       ["Flag captured!"] = "夺旗得分!",
       ["Flag respawned!"] = "旗帜重生!",
       ["Flag returned!"] = "旗帜归还!",
 --      ["Flags, and their home base will be placed where each team ends their first turn."] = "",
 --      ["Flamer"] = "",
+--      ["Flaming Worm"] = "", -- A_Classic_Fairytale:backstab
+--      ["Flare: [fire up some bombs depending on hogs depending on hogs in the circle"] = "", -- Continental_supplies
+--      ["Flesh for Brainz"] = "", -- A_Classic_Fairytale:journey
+--      ["For improved features/stability, play 0.9.18+"] = "", -- WxW
+--      ["Free Dense Cloud and continue the mission!"] = "", -- A_Classic_Fairytale:journey
 --      ["Friendly Fire!"] = "",
 --      ["fuel extended!"] = "",
 --      ["GAME BEGUN!!!"] = "",
 --      ["Game Modifiers: "] = "",
       ["GAME OVER!"] = "结束了!",
       ["Game Started!"] = "开始",
+--      ["Game? Was this a game to you?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["GasBomb"] = "", -- Continental_supplies
+--      ["Gas Gargler"] = "", -- A_Classic_Fairytale:queen
+--      ["Get Dense Cloud out of the pit!"] = "", -- A_Classic_Fairytale:journey
       ["Get on over there and take him out!"] = "上去把它拉下来!",
+--      ["Get on the head of the mole"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get out of there!"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Get that crate!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Get the crate on the other side of the island!|"] = "", -- A_Classic_Fairytale:journey
+--      ["Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"] = "", -- Basic_Training_-_Rope
+--      ["Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"] = "", -- A_Classic_Fairytale:family
+--      ["GG!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Gimme Bones"] = "", -- A_Classic_Fairytale:backstab
+--      ["Glark"] = "", -- A_Classic_Fairytale:shadow
 --      ["Goal"] = "",
       ["GO! GO! GO!"] = "上!",
       ["Good birdy......"] = "乖鸟儿",
+--      ["Good Dude"] = "", -- User_Mission_-_The_Great_Escape
+--      ["Good idea, they'll never find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["Good luck...or else!"] = "", -- A_Classic_Fairytale:journey
       ["Good luck out there!"] = "祝好运",
 --      ["Good so far!"] = "",
 --      ["Good to go!"] = "",
+--      ["Go on top of the flower"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Go, quick!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Gorkij"] = "", -- A_Classic_Fairytale:journey
+--      ["Go surf!"] = "", -- WxW
 --      ["GOTCHA!"] = "",
 --      ["Grab Mines/Explosives"] = "",
+--      ["Great choice, Steve! Mind if I call you that?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"] = "", -- Basic_Training_-_Rope
+--      ["Great! You will be contacted soon for assistance."] = "", -- A_Classic_Fairytale:shadow
+--      ["Green lipstick bullet: [Is poisonous]"] = "", -- Continental_supplies
+--      ["Greetings, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Greetings, cloudy one!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Grenade Training"] = "", -- Basic_Training_-_Grenade
+--      ["Grenadiers"] = "", -- Basic_Training_-_Grenade
+--      ["Guys, do you think there's more of them?"] = "", -- A_Classic_Fairytale:backstab
+--      ["HAHA!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Haha!"] = "", -- A_Classic_Fairytale:united
 --      ["Hahahaha!"] = "",
 --      ["Haha, now THAT would be something!"] = "",
+--      ["Hannibal"] = "", -- A_Classic_Fairytale:epil
 --      ["Hapless Hogs"] = "",
 --      [" Hapless Hogs left!"] = "",
+--      [" HAS MUTATED\" )"] = "", -- 
+--      ["Hatless Jerry"] = "", -- A_Classic_Fairytale:queen
+--      ["Have no illusions, your tribe is dead, indifferent of your choice."] = "", -- A_Classic_Fairytale:shadow
+--      ["Have we ever attacked you first?"] = "", -- A_Classic_Fairytale:enemy
 --      ["Health crates extend your time."] = "",
 --      ["Heavy"] = "",
+--      ["Heavy Cannfantry"] = "", -- A_Classic_Fairytale:united
+--      ["Hedge-cogs"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hedgehog projectile: [fire your hog like a Sticky Bomb]"] = "", -- Continental_supplies
       ["Hedgewars-Basketball"] = "刺猬大作战-篮球计划",
       ["Hedgewars-Knockball"] = "刺猬大作战-击球计划",
+--      ["Hedgibal Lecter"] = "", -- A_Classic_Fairytale:backstab
 --      ["Heh, it's not that bad."] = "",
+--      ["Hello again, "] = "", -- A_Classic_Fairytale:family
+--      ["Help me, Leaks!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!!!"] = "", -- A_Classic_Fairytale:journey
+--      ["Help me, please!"] = "", -- A_Classic_Fairytale:journey
+--      ["He moves like an eagle in the sky."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He must be in the village already."] = "", -- A_Classic_Fairytale:journey
+--      ["Here, let me help you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Here, let me help you save her!"] = "", -- A_Classic_Fairytale:family
+--      ["Here...pick your weapon!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hero Team"] = "", -- User_Mission_-_The_Great_Escape
+--      ["He's so brave..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["He won't be selling us out anymore!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey, guys!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Hey guys!"] = "", -- A_Classic_Fairytale:united
+--      ["Hey! This is cheating!"] = "", -- A_Classic_Fairytale:journey
+--      ["HIGHLANDER"] = "", -- Highlander
+--      ["Hightime"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Double Jump - Press [Backspace] twice"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: Select the LowGravity and press [Fire]."] = "", -- A_Classic_Fairytale:journey
+--      ["Hint: you might want to stay out of sight and take all the crates...|"] = "", -- A_Classic_Fairytale:journey
+--      ["His arms are so strong!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Hit Combo!"] = "",
+--      ["Hmmm...actually...I didn't either."] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm, I'll have to find some way of moving him off this anti-portal surface..."] = "", -- portal
+--      ["Hmmm...it's a draw. How unfortunate!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Hmmm...perhaps a little more time will help."] = "", -- A_Classic_Fairytale:first_blood
       ["Hmmm..."] = "呃...",
+--      ["Hogminator"] = "", -- A_Classic_Fairytale:family
+--      ["Hogs in sight!"] = "", -- Continental_supplies
+--      ["HOLY SHIT!"] = "", -- Mutant
+--      ["Honest Lee"] = "", -- A_Classic_Fairytale:enemy
       ["Hooray!"] = "呼!",
+--      ["Hostage Situation"] = "", -- A_Classic_Fairytale:family
+--      ["How can I ever repay you for saving my life?"] = "", -- A_Classic_Fairytale:journey
+--      ["How come in a village full of warriors, it's up to me to save it?"] = "", -- A_Classic_Fairytale:dragon
+--      ["How difficult would you like it to be?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["HOW DO THEY KNOW WHERE WE ARE???"] = "", -- A_Classic_Fairytale:united
+--      ["However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, if you fail to do so, she dies a most violent death! Muahahaha!"] = "", -- A_Classic_Fairytale:journey
+--      ["However, my mates don't agree with me on letting you go..."] = "", -- A_Classic_Fairytale:dragon
+--      [" HP"] = "", -- Mutant
       ["Hunter"] = "猎人", --Bazooka, Shotgun, SniperRifle
+--      ["I believe there's more of them."] = "", -- A_Classic_Fairytale:backstab
+--      ["I can see you have been training diligently."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I can't believe it worked!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I can't believe this!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I can't believe what I'm hearing!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I can't wait any more, I have to save myself!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I could just teleport myself there..."] = "", -- A_Classic_Fairytale:family
+--      ["I'd better get going myself."] = "", -- A_Classic_Fairytale:journey
+--      ["I didn't until about a month ago."] = "", -- A_Classic_Fairytale:enemy
+--      ["I don't know how you did that.. But good work! |The next one should be easy as cake for you!"] = "", -- Basic_Training_-_Rope
+--      ["I feel something...a place! They will arrive near the circles!"] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I had a way..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If only I were given a chance to explain my being here..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I forgot that she's the daughter of the chief, too..."] = "", -- A_Classic_Fairytale:backstab
+--      ["If they try coming here, they can have a taste of my delicious knuckles!"] = "", -- A_Classic_Fairytale:united
+--      ["If you agree to provide the information we need, you will be spared!"] = "", -- A_Classic_Fairytale:shadow
+--      ["If you can get that crate fast enough, your beloved \"princess\" may go free."] = "", -- A_Classic_Fairytale:journey
+--      ["If you decide to help us, though, we will no longer need to find a new governor for the island."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you get stuck, use your Desert Eagle or restart the mission!|"] = "", -- A_Classic_Fairytale:journey
+--      ["If you know what I mean..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you say so..."] = "", -- A_Classic_Fairytale:shadow
+--      ["If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)"] = "", -- 
+--      ["I guess you'll have to kill them."] = "", -- A_Classic_Fairytale:dragon
+--      ["I have come to make you an offering..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I have no idea where that mole disappeared...Can you see it?"] = "", -- A_Classic_Fairytale:shadow
+--      ["I have to follow that alien."] = "", -- A_Classic_Fairytale:backstab
+--      ["I have to get back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I hope you are prepared for a small challenge, young one."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I just don't want to sink to your level."] = "", -- A_Classic_Fairytale:backstab
+--      ["I just found out that they have captured your princess!"] = "", -- A_Classic_Fairytale:family
+--      ["I just wonder where Ramon and Spiky disappeared..."] = "", -- A_Classic_Fairytale:journey
+--      ["I'll hold them off while you return to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Imagine those targets are the wolves that killed your parents! Take your anger out on them!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm...alive? How? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm a ninja."] = "", -- A_Classic_Fairytale:dragon
+--      ["I marked the place of their arrival. You're welcome!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I'm certain that this is a misunderstanding, fellow hedgehogs!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["I mean, none of you ceased to live."] = "", -- A_Classic_Fairytale:enemy
+--      ["I'm getting old for this!"] = "", -- A_Classic_Fairytale:family
+--      ["I'm getting thirsty..."] = "", -- A_Classic_Fairytale:family
+--      ["I'm here to help you rescue her."] = "", -- A_Classic_Fairytale:family
+--      ["I'm not sure about that!"] = "", -- A_Classic_Fairytale:united
+--      ["Impressive...you are still dry as the corpse of a hawk after a week in the desert..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I'm so scared!"] = "", -- A_Classic_Fairytale:united
+--      ["Incredible..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I need to find the others!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to get to the other side of this island, fast!"] = "", -- A_Classic_Fairytale:journey
+--      ["I need to move the tribe!"] = "", -- A_Classic_Fairytale:united
+--      ["I need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I need to warn the others."] = "", -- A_Classic_Fairytale:backstab
+--      ["In fact, you are the only one that's been acting strangely."] = "", -- A_Classic_Fairytale:backstab
+--      ["In order to get to the other side, you need to collect the crates first.|"] = "", -- A_Classic_Fairytale:dragon
       ["Instructor"] = "引导员", -- 01#Boot_Camp, User_Mission_-_Dangerous_Ducklings
+--      ["Interesting idea, haha!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Interesting! Last time you said you killed a cannibal!"] = "", -- A_Classic_Fairytale:backstab
+--      ["In the meantime, take these and return to your \"friend\"!"] = "", -- A_Classic_Fairytale:shadow
 --      ["invaders destroyed"] = "",
+--      ["Invasion"] = "", -- A_Classic_Fairytale:united
+--      ["I saw it with my own eyes!"] = "", -- A_Classic_Fairytale:shadow
+--      ["I see..."] = "", -- A_Classic_Fairytale:shadow
+--      ["I see you have already taken the leap of faith."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I see you would like his punishment to be more...personal..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["I sense another wave of cannibals heading my way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I sense another wave of cannibals heading our way!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I shouldn't have drunk that last pint."] = "", -- A_Classic_Fairytale:dragon
+--      ["Is this place in my head?"] = "", -- A_Classic_Fairytale:dragon
+--      ["It doesn't matter. I won't let that alien hurt my daughter!"] = "", -- A_Classic_Fairytale:dragon
+--      ["I think we are safe here."] = "", -- A_Classic_Fairytale:backstab
+--      ["I thought their shaman died when he tried our medicine!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It is called 'Hogs of Steel'."] = "", -- A_Classic_Fairytale:enemy
+--      ["It is time to practice your fighting skills."] = "", -- A_Classic_Fairytale:first_blood
+--      ["It must be a childhood trauma..."] = "", -- A_Classic_Fairytale:family
+--      ["It must be the aliens!"] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the aliens' deed."] = "", -- A_Classic_Fairytale:backstab
+--      ["It must be the cyborgs again!"] = "", -- A_Classic_Fairytale:enemy
+--      ["I told you, I just found them."] = "", -- A_Classic_Fairytale:backstab
 --      ["It's a good thing SUDDEN DEATH is 99 turns away..."] = "",
+--      ["It's always up to women to clear up the mess men created!"] = "", -- A_Classic_Fairytale:dragon
+--      ["It's a shame, I forgot how to do that!"] = "", -- A_Classic_Fairytale:family
+--      ["It's impossible to communicate with the spirits without a shaman."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's over..."] = "", -- A_Classic_Fairytale:shadow
+--      ["It's time you learned that your actions have consequences!"] = "", -- A_Classic_Fairytale:journey
+--      ["It's worth more than wood!"] = "", -- A_Classic_Fairytale:enemy
+--      ["It wants our brains!"] = "", -- A_Classic_Fairytale:shadow
+--      ["It was not a dream, unwise one!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I've seen this before. They just appear out of thin air."] = "", -- A_Classic_Fairytale:united
+--      ["I want to play a game..."] = "", -- A_Classic_Fairytale:journey
+--      ["I want to see how it handles this!"] = "", -- A_Classic_Fairytale:backstab
+--      ["I wish to help you, "] = "", -- A_Classic_Fairytale:dragon
+--      ["I wonder where Dense Cloud is..."] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["I wonder why I'm so angry all the time..."] = "", -- A_Classic_Fairytale:family
+--      ["I won't let you kill her!"] = "", -- A_Classic_Fairytale:journey
+--      ["Jack"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Jeremiah"] = "", -- A_Classic_Fairytale:dragon
+--      ["John"] = "", -- A_Classic_Fairytale:journey
+--      ["Judas"] = "", -- A_Classic_Fairytale:backstab
 --      ["Jumping is disabled"] = "",
+--      ["Just kidding, none of you have died!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Just on a walk."] = "", -- A_Classic_Fairytale:united
+--      ["Just wait till I get my hands on that trauma! ARGH!"] = "", -- A_Classic_Fairytale:family
 --      ["Kamikaze Expert!"] = "",
 --      ["Keep it up!"] = "",
+--      ["Kerguelen"] = "", -- Continental_supplies
 --      ["Killing spree!"] = "",
+--      ["KILL IT!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["KILLS"] = "",
+--      ["Kill the aliens!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Kill the cannibal!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Kill the traitor...or spare his life!|Kill him or press [Precise]!"] = "", -- A_Classic_Fairytale:backstab
 --      ["Last Target!"] = "",
+--      ["Leader"] = "", -- A_Classic_Fairytale:enemy
+--      ["Leaderbot"] = "", -- A_Classic_Fairytale:queen
+--      ["Leaks A Lot"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
+--      ["Leaks A Lot, depressed for killing his loved one, failed to save the village..."] = "", -- A_Classic_Fairytale:journey
+--      ["Leaks A Lot gave his life for his tribe! He should have survived!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Leaks A Lot must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Led Heart"] = "", -- A_Classic_Fairytale:queen
+--      ["Lee"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
 --      ["[Left Shift]"] = "",
+--      ["Let a Continent provide your weapons!"] = "", -- Continental_supplies
+--      ["Let me test your skills a little, will you?"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's go home!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's head back to the village!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Let's see what your comrade does now!"] = "", -- A_Classic_Fairytale:journey
+--      ["Let's show those cannibals what we're made of!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let them have a taste of my fury!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Let us help, too!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Light Cannfantry"] = "", -- A_Classic_Fairytale:united
       ["Listen up, maggot!!"] = "听好,小子!!",
+--      ["Little did they know that this hunt will mark them forever..."] = "", -- A_Classic_Fairytale:shadow
 --      ["Lively Lifeguard"] = "",
+--      ["Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"] = "", -- Continental_supplies
+--      ["Look, I had no choice!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! There's more of them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Look out! We're surrounded by cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Looks like the whole world is falling apart!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Luckily, I've managed to snatch some of them."] = "", -- A_Classic_Fairytale:united
+--      ["LUDICROUS KILL"] = "", -- Mutant
+--      ["May the spirits aid you in all your quests!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"] = "", -- Continental_supplies
+--      ["MEGA KILL"] = "", -- Mutant
+--      ["Meiwes"] = "", -- A_Classic_Fairytale:backstab
+--      ["Mindy"] = "", -- A_Classic_Fairytale:united
 --      ["Mine Deployer"] = "",
 --      ["Mine Eater!"] = "",
 --      ["|- Mines Time:"] =
       ["MISSION FAILED"] = "任务失败", -- User_Mission_-_Dangerous_Ducklings, User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["MISSION SUCCESS"] = "",
       ["MISSION SUCCESSFUL"] = "任务成功", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Molotov"] = "", -- Continental_supplies
+--      ["MONSTER KILL"] = "", -- Mutant
+--      ["More Natives"] = "", -- A_Classic_Fairytale:epil
 --      ["Movement: [Up], [Down], [Left], [Right]"] = "",
 --      ["Multi-shot!"] = "",
+--      ["Muriel"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Muscle Dissolver"] = "", -- A_Classic_Fairytale:shadow
+--      ["-------"] = "", -- Mutant
+--      ["Nade Boy"] = "", -- Basic_Training_-_Grenade
+--      ["Name"] = "", -- A_Classic_Fairytale:queen
 --      ["Nameless Heroes"] = "",
+--      ["Nancy Screw"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:queen
+--      ["Napalm rocket: [Fire a bomb with napalm!]"] = "", -- Continental_supplies
+--      ["Natives"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:journey, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow, A_Classic_Fairytale:united
 --      ["New Barrels Per Turn"] = "",
 --      ["NEW CLAN RECORD: "] = "",
       ["NEW fastest lap: "] = "新记录",
 --      ["New Mines Per Turn"] = "",
 --      ["NEW RACE RECORD: "] = "",
 --      ["Newton's Hammock"] = "",
+--      ["Nicely done, meatbags!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nice work, "] = "", -- A_Classic_Fairytale:dragon
+--      ["Nice work!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Nilarian"] = "", -- A_Classic_Fairytale:queen
+--      ["No, I came back to help you out..."] = "", -- A_Classic_Fairytale:shadow
+--      ["No...I wonder where they disappeared?!"] = "", -- A_Classic_Fairytale:journey
+--      ["Nom-Nom"] = "", -- A_Classic_Fairytale:journey
+--      ["NomNom"] = "", -- A_Classic_Fairytale:united
+--      ["Nope. It was one fast mole, that's for sure."] = "", -- A_Classic_Fairytale:shadow
+--      ["No! Please, help me!"] = "", -- A_Classic_Fairytale:journey
+--      ["NORMAL"] = "", -- Continental_supplies
+--      ["North America"] = "", -- Continental_supplies
+--      ["Not all hogs are born equal."] = "", -- Highlander
 --      ["NOT ENOUGH WAYPOINTS"] = "",
+--      ["Not now, Fiery Water!"] = "", -- A_Classic_Fairytale:backstab
       ["Not So Friendly Match"] = "非友善对抗", -- Basketball, Knockball
+--      ["Not you again! My head still hurts from last time!"] = "", -- A_Classic_Fairytale:shadow
+--      ["No, we made sure of that!"] = "", -- A_Classic_Fairytale:united
+--      ["Now find the next target! |Tip: Normally you lose health by falling down, so be careful!"] = "", -- Basic_Training_-_Rope
+--      ["No! What have I done?! What have YOU done?!"] = "", -- A_Classic_Fairytale:journey
+--      ["No. Where did he come from?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Now how do I get on the other side?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["No. You and the rest of the tribe are safer there!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Obliterate them!|Hint: You might want to take cover..."] = "", -- A_Classic_Fairytale:shadow
+--      ["Obstacle course"] = "", -- A_Classic_Fairytale:dragon
+--      ["Of course I have to save her. What did I expect?!"] = "", -- A_Classic_Fairytale:family
+--      ["OH, COME ON!"] = "", -- A_Classic_Fairytale:journey
+--      ["Oh, my!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oh, my! This is even more entertaining than I've expected!"] = "", -- A_Classic_Fairytale:backstab
       ["Oh no! Just try again!"] = "不!重新再来。", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
+--      ["Oh no, not "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
       ["Oh no! Time's up! Just try again."] = "不!到点了,需要重新来。", --Bazooka, Shotgun, SniperRifle
+--      ["Oh no! You failed! Just try again."] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Oh, silly me! I forgot that I'm the shaman."] = "", -- A_Classic_Fairytale:backstab
+--      ["Olive"] = "", -- A_Classic_Fairytale:united
+--      ["Omnivore"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["ONE HOG PER TEAM! KILLING EXCESS HEDGES"] = "", -- Mutant
+--      ["One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Oops...I dropped them."] = "", -- A_Classic_Fairytale:united
+--      ["Open that crate and we will continue!"] = "", -- A_Classic_Fairytale:first_blood
       ["Operation Diver"] = "水下行动",
 --      ["Opposing Team: "] =
       ["Opposing Team:"] = "对方队伍",
+--      ["Orlando Boom!"] = "", -- A_Classic_Fairytale:queen
+--      ["Ouch!"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Our tribe, our beautiful island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Parachute"] = "", -- Continental_supplies
       ["Pathetic Hog #1"] = "可怜刺猬一号",
       ["Pathetic Hog #2"] = "可怜刺猬二号",
 --      ["Pathetic Hog #%d"] =
 --      ["Pathetic Resistance"] = "", -- User_Mission_-_Bamboo_Thicket, User_Mission_-_Newton_and_the_Hammock
+--      ["Perfect! Now try to get the next crate without hurting yourself!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Per-Hog Ammo"] = "",
+--      ["- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease)"] = "", -- 
+--      ["Pfew! That was close!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Piñata bullet: [Contains some sweet candy!]"] = "", -- Continental_supplies
+--      ["Pings left:"] = "", -- Space_Invasion
 --      ["Place more waypoints using [ENTER]"] = "",
 --      ["Place more waypoints using the 'Air Attack' weapon."] = "",
+--      ["Planes Used:"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Planes Used"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Play with me!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Please place the way-point further from the waterline."] = "", -- Racer
+--      ["Please place the way-point in the open, within the map boundaries."] = "", -- Racer
+--      ["Please, stop releasing your \"smoke signals\"!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Point Blank Combo!"] = "", -- Space_Invasion
 --      ["points"] =
 --      ["Poison"] =
+--      ["Portal hint: one goes to the destination, and one is the entrance.|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Portal mission"] = "", -- portal
 --      ["Power Remaining"] = "",
 --      ["Prepare yourself"] = "",
+--      ["Press [Enter] to accept this configuration."] = "", -- WxW
+--      ["Press [Left] or [Right] to move around, [Enter] to jump"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Press [Precise] to skip intro"] = "",
+--      ["Private Novak"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"] = "", -- A_Classic_Fairytale:shadow
 --      ["Race complexity limit reached."] = "",
 --      ["RACER"] = "",
+--      ["Rachel"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Radar Ping"] = "", -- Space_Invasion
+--      ["Raging Buffalo"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["Ramon"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["RC PLANE TRAINING"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Really?! You thought you could harm me with your little toys?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Regurgitator"] = "", -- A_Classic_Fairytale:backstab
+--      ["Reinforcements"] = "", -- A_Classic_Fairytale:backstab
+--      ["Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"] = "", -- Basic_Training_-_Rope
+--      ["Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"] = "", -- A_Classic_Fairytale:shadow
 --      [" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] =
       ["- Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"] = "-带回敌人旗帜得分| -第一支3次夺旗队伍获胜| - 只有旗帜在己方基地才算| -带旗刺猬消逝则旗帜落下| -落下的旗帜使用方式不变| -损失的刺猬瞬间还原",
+--      ["Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Righteous Beard"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:first_blood, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
+--      ["ROPE-KNOCKING"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Rope Training"] = "", -- Basic_Training_-_Rope
+--      ["Rot Molester"] = "", -- A_Classic_Fairytale:shadow
 --      ["Round Limit:"] = "",
 --      ["Round Limit"] = "",
 --      ["Rounds Complete: "] = "",
 --      ["Rounds Complete"] = "",
       ["RULES OF THE GAME [Press ESC to view]"] = "游戏规则 [按下 ESC键 查看]",
+--      ["Rusty Joe"] = "", -- A_Classic_Fairytale:queen
 --      ["s|"] = "",
+--      ["Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]"] = "", -- Continental_supplies
+--      ["Salivaslurper"] = "", -- A_Classic_Fairytale:united
+--      ["Salvation"] = "", -- A_Classic_Fairytale:family
+--      ["Salvation was one step closer now..."] = "", -- A_Classic_Fairytale:dragon
 --      ["Save as many hapless hogs as possible!"] = "",
+--      ["Save Fell From Heaven!"] = "", -- A_Classic_Fairytale:journey
+--      ["Save Leaks A Lot!|Hint: The Switch utility might be of help to you."] = "", -- A_Classic_Fairytale:shadow
+--      ["Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"] = "", -- A_Classic_Fairytale:family
+--      ["Save the princess by collecting the crate in under 12 turns!"] = "", -- A_Classic_Fairytale:journey
+--      ["Scalp Muncher"] = "", -- A_Classic_Fairytale:backstab
 --      ["SCORE"] = "",
+--      ["Score"] = "", -- Mutant
+--      ["Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"] = "", -- Continental_supplies
 --      ["sec"] =
+--      ["Seduction"] = "", -- Continental_supplies
+--      ["Seems like every time you take a \"walk\", the enemy find us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["See that crate farther on the right?"] = "", -- A_Classic_Fairytale:first_blood
       ["See ya!"] = "再见!",
+--      ["Segmentation Paul"] = "", -- A_Classic_Fairytale:dragon
+--      ["Select continent!"] = "", -- Continental_supplies
+--      ["Select difficulty: [Left] - easier or [Right] - harder"] = "", -- A_Classic_Fairytale:first_blood
 --      ["selected!"] = "",
 --      ["s"] = "", -- GaudyRacer, Space_Invasion
+--      ["... share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["She's behind that tall thingy."] = "", -- A_Classic_Fairytale:family
 --      ["Shield boosted! +30 power"] = "",
 --      ["Shield Depleted"] = "",
 --      ["Shield is fully recharged!"] = "",
@@ -165,60 +649,339 @@ locale = {
 --      ["Shield OFF:"] = "",
 --      ["Shield ON:"] = "",
 --      ["Shield Seeker!"] = "",
+--      ["Shotgun"] = "", -- Continental_supplies
       ["Shotgun Team"] = "霰弹枪队",
       ["Shotgun Training"] = "霰弹枪训练",
 --      ["shots remaining."] = "",
 --      ["Silly"] = "",
 --      ["Sinky"] = "",
+--      ["Sirius Lee"] = "", -- A_Classic_Fairytale:enemy
       ["%s is out and Team %d|scored a penalty!| |Score:"] = "%s 出局, %d 惩罚分数!", -- Basketball, Knockball
       ["%s is out and Team %d|scored a point!| |Score:"] = "%s 出局, %d 得分!", -- Basketball, Knockball
+--      ["Slippery"] = "", -- A_Classic_Fairytale:journey
+--      ["Smith 0.97"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.98"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99a"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99b"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 0.99f"] = "", -- A_Classic_Fairytale:enemy
+--      ["Smith 1.0"] = "", -- A_Classic_Fairytale:enemy
+--      ["Sniper Rifle"] = "", -- Continental_supplies
+--      ["Sniper!"] = "", -- Space_Invasion
       ["Sniper Training"] = "狙击训练",
       ["Sniperz"] = "狙击手",
+--      ["So humiliating..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["South America"] = "", -- Continental_supplies
+--      ["So? What will it be?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Spawn the crate, and attack!"] = "", -- WxW
+--      ["Special Weapons:"] = "", -- Continental_supplies
+--      ["Spiky Cheese"] = "", -- A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:shadow
+--      ["Spleenlover"] = "", -- A_Classic_Fairytale:united
 --      ["Sponge"] = "",
       ["Spooky Tree"] = "怪树",
 --      ["STATUS UPDATE"] = "", -- GaudyRacer, Space_Invasion
+--      ["Steel Eye"] = "", -- A_Classic_Fairytale:queen
+--      ["Step By Step"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Steve"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["Sticky Mine"] = "", -- Continental_supplies
+--      ["Stronglings"] = "", -- A_Classic_Fairytale:shadow
+--      ["Structure"] = "", -- Continental_supplies
+--      ["Super Weapons"] = "", -- WxW
+--      ["Surf Before Crate"] = "", -- WxW
+--      ["Surfer! +15 points!"] = "", -- Space_Invasion
+--      ["Surfer!"] = "", -- WxW
+--      ["Survive!|Hint: Cinematics can be skipped with the [Precise] key."] = "", -- A_Classic_Fairytale:shadow
+--      ["Swing, Leaks A Lot, on the wings of the wind!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Switched to "] = "",
+--      ["Syntax Errol"] = "", -- A_Classic_Fairytale:dragon
+--      ["Talk about mixed signals..."] = "", -- A_Classic_Fairytale:dragon
       ["Team %d: "] = "队伍 %d",
 --      ["Team Scores"] = "", -- Control, Space_Invasion
+--      ["Teleport hint: just use the mouse to select the destination!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Thanks!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, my hero!"] = "", -- A_Classic_Fairytale:family
+--      ["Thank you, oh, thank you, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
+--      ["Thank you, oh, thank you, my heroes!"] = "", -- A_Classic_Fairytale:journey
+--      ["That is, indeed, very weird..."] = "", -- A_Classic_Fairytale:united
+--      ["That makes it almost invaluable!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That ought to show them!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That's for my father!"] = "", -- A_Classic_Fairytale:backstab
+--      ["That shaman sure knows what he's doing!"] = "", -- A_Classic_Fairytale:shadow
 --      ["That Sinking Feeling"] = "",
+--      ["That's not our problem!"] = "", -- A_Classic_Fairytale:enemy
+--      ["That's typical of you!"] = "", -- A_Classic_Fairytale:family
+--      ["That was just mean!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
 --      ["That was pointless."] =
+--      ["The answer is...entertaintment. You'll see what I mean."] = "", -- A_Classic_Fairytale:backstab
+--      ["The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."] = "", -- portal
+--      ["The Bull's Eye"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The caves are well hidden, they won't find us there!"] = "", -- A_Classic_Fairytale:united
+--      ["The Crate Frenzy"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Dilemma"] = "", -- A_Classic_Fairytale:shadow
+--      ["The enemy can't move but it might be a good idea to stay out of sight!|"] = "", -- A_Classic_Fairytale:dragon
       ["The enemy is hiding out on yonder ducky!"] = "敌人藏在那边!",
+--      ["The Enemy Of My Enemy"] = "", -- A_Classic_Fairytale:enemy
+--      ["The First Blood"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The First Encounter"] = "", -- A_Classic_Fairytale:shadow
 --      ["The flag will respawn next round."] =
+--      ["The food bites back"] = "", -- A_Classic_Fairytale:backstab
+--      ["The giant umbrella from the last crate should help break the fall."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Great Escape"] = "", -- User_Mission_-_The_Great_Escape
+--      ["The guardian"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Individualist"] = "", -- A_Classic_Fairytale:shadow
+--      ["Their buildings were very primitive back then, even for an uncivilised island."] = "", -- A_Classic_Fairytale:united
+--      ["The Journey Back"] = "", -- A_Classic_Fairytale:journey
+--      ["The Leap of Faith"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Moonwalk"] = "", -- A_Classic_Fairytale:journey
 --      ["The Nameless One"] = "",
+--      ["The next one is pretty hard! |Tip: You have to do multiple swings!"] = "", -- Basic_Training_-_Rope
+--      ["Then how do they keep appearing?"] = "", -- A_Classic_Fairytale:shadow
+--      ["The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["There must be a spy among us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["There's more of them? When did they become so hungry?"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty..."] = "", -- A_Classic_Fairytale:journey
+--      ["There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"] = "", -- A_Classic_Fairytale:journey
+--      ["The Rising"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Savior"] = "", -- A_Classic_Fairytale:journey
+--      ["These primitive people are so funny!"] = "", -- A_Classic_Fairytale:backstab
+--      ["The Shadow Falls"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Showdown"] = "", -- A_Classic_Fairytale:shadow
+--      ["The Slaughter"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:first_blood
 --      ["THE SPECIALISTS"] = "",
+--      ["The spirits of the ancerstors are surely pleased, Leaks A Lot."] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Torment"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Tunnel Maker"] = "", -- A_Classic_Fairytale:journey
+--      ["The Ultimate Weapon"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The Union"] = "", -- A_Classic_Fairytale:enemy
+--      ["The village, unprepared, was destroyed by the cyborgs..."] = "", -- A_Classic_Fairytale:journey
+--      ["The walk of Fame"] = "", -- A_Classic_Fairytale:shadow
+--      ["The wasted youth"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The weapon in that last crate was bestowed upon us by the ancients!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["The what?!"] = "", -- A_Classic_Fairytale:dragon
+--      ["The wind whispers that you are ready to become familiar with tools, now..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["They are all waiting back in the village, haha."] = "", -- A_Classic_Fairytale:enemy
+--      ["They Call Me Bullseye!"] = "", -- Space_Invasion
+--      ["They have weapons we've never seen before!"] = "", -- A_Classic_Fairytale:united
+--      ["They keep appearing like this. It's weird!"] = "", -- A_Classic_Fairytale:united
+--      ["They killed "] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["They must be trying to weaken us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["They never learn"] = "", -- A_Classic_Fairytale:journey
+--      ["They told us to wear these clothes. They said that this is the newest trend."] = "", -- A_Classic_Fairytale:enemy
+--      ["They've been manipulating us all this time!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Thighlicker"] = "", -- A_Classic_Fairytale:united
+--      ["This is it! It's time to make Fell From Heaven fall for me..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["This island is the only place left on Earth with grass on it!"] = "", -- A_Classic_Fairytale:enemy
+--      ["This is typical!"] = "", -- A_Classic_Fairytale:dragon
+--      ["This must be some kind of sorcery!"] = "", -- A_Classic_Fairytale:shadow
+--      ["This must be the caves!"] = "", -- A_Classic_Fairytale:backstab
 --      ["This one's tricky."] = "",
 --      ["This rain is really something..."] = "",
+--      ["This will be fun!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Those aliens are destroying the island!"] = "", -- A_Classic_Fairytale:family
 --      ["TIME: "] = "",
 --      ["Timed Kamikaze!"] = "",
 --      ["Time Extended!"] = "",
 --      ["Time Extension"] = "",
+--      ["Tip: The rope physics are different than in the real world, |use it to your advantage!"] = "", -- Basic_Training_-_Rope
 --      ["Toggle Shield"] = "",
+--      ["To help you, of course!"] = "", -- A_Classic_Fairytale:journey
+--      ["To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"] = "", -- A_Classic_Fairytale:shadow
+--      ["Torn Muscle"] = "", -- A_Classic_Fairytale:journey
+--      [" to save the village."] = "", -- A_Classic_Fairytale:dragon
+--      ["To the caves..."] = "", -- A_Classic_Fairytale:united
       ["Toxic Team"] = "腐坏的队伍", -- User_Mission_-_Diver, User_Mission_-_Spooky_Tree, User_Mission_-_Teamwork
 --      ["TRACK COMPLETED"] = "",
 --      ["TRACK FAILED!"] = "",
+--      ["training"] = "", -- portal
+--      ["Traitors"] = "", -- A_Classic_Fairytale:epil
+--      ["Tribe"] = "", -- A_Classic_Fairytale:backstab
       ["TrophyRace"] = "竞速",
+--      ["Try to protect the chief! You won't lose if he dies, but it is advised that he survives."] = "", -- A_Classic_Fairytale:united
       ["T_T"] = "T_T",
 --      ["Tumbling Time Extended!"] = "",
+--      ["Turns until Sudden Death: "] = "", -- A_Classic_Fairytale:dragon
+--      [" turns until Sudden Death! Better hurry!"] = "", -- A_Classic_Fairytale:dragon
 --      ["Turn Time"] = "",
+--      ["Two little hogs cooperating, getting past obstacles..."] = "", -- A_Classic_Fairytale:journey
+--      ["Uhm...I met one of them and took his weapons."] = "", -- A_Classic_Fairytale:shadow
+--      ["Uhmm...ok no."] = "", -- A_Classic_Fairytale:enemy
+--      ["ULTRA KILL"] = "", -- Mutant
+--      ["Under Construction"] = "", -- A_Classic_Fairytale:shadow
+--      ["Unexpected Igor"] = "", -- A_Classic_Fairytale:dragon
 --      ["Unit"] = "",
+--      ["Unit 0x0007"] = "", -- A_Classic_Fairytale:family
+--      ["Unit 334a$7%;.*"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:family, A_Classic_Fairytale:queen, A_Classic_Fairytale:united
       ["Unit 3378"] = "3378",
 --      ["Unit 835"] = "",
+--      ["United We Stand"] = "", -- A_Classic_Fairytale:united
 --      ["Unlimited Attacks"] = "",
+--      ["Unlucky Sods"] = "", -- User_Mission_-_Rope_Knock_Challenge
 --      ["Unstoppable!"] = "",
+--      ["Unsuspecting Louts"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["[Up], [Down] to aim, [Space] to shoot!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use it wisely!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use it with precaution!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["User Challenge"] = "",
+--      ["Use the parachute ([Space] while in air)"] = "", -- 
+--      ["Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|"] = "", -- A_Classic_Fairytale:dragon
+--      ["Use the rope to get on the head of the mole, young one!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Use the rope to knock your enemies to their doom."] = "", -- User_Mission_-_Rope_Knock_Challenge
       ["Use your rope to get from start to finish as fast as you can!"] = "抓起绳子飞向目的地,越快越好。",
+--      ["Vedgies"] = "", -- A_Classic_Fairytale:journey
+--      ["Vegan Jack"] = "", -- A_Classic_Fairytale:enemy
+--      ["Victory!"] = "", -- Basic_Training_-_Rope
       ["Victory for the "] = "胜利属于",
+--      ["Violence is not the answer to your problems!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Walls Left"] = "", -- WxW
+--      ["Walls Required"] = "", -- WxW
+--      ["WALL TO WALL"] = "", -- WxW
+--      ["Wannabe Flyboys"] = "", -- User_Mission_-_RCPlane_Challenge
+--      ["Wannabe Shoppsta"] = "", -- User_Mission_-_Rope_Knock_Challenge
+--      ["Watch your steps, young one!"] = "", -- A_Classic_Fairytale:first_blood
 --      ["Waypoint placed."] = "",
 --      ["Way-Points Remaining"] = "",
+--      ["Weaklings"] = "", -- A_Classic_Fairytale:shadow
+--      ["We all know what happens when you get frightened..."] = "", -- A_Classic_Fairytale:first_blood
 --      ["Weapons Reset"] = "",
+--      ["Weapons reset."] = "", -- Highlander
+--      ["We are indeed."] = "", -- A_Classic_Fairytale:backstab
+--      ["We can't defeat them!"] = "", -- A_Classic_Fairytale:shadow
+--      ["We can't hold them up much longer!"] = "", -- A_Classic_Fairytale:united
+--      ["We can't let them take over our little island!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have no time to waste..."] = "", -- A_Classic_Fairytale:journey
+--      ["We have nowhere else to live!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We have to protect the village!"] = "", -- A_Classic_Fairytale:united
+--      ["We have to unite and defeat those cylergs!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Welcome, Leaks A Lot!"] = "", -- A_Classic_Fairytale:journey
 --      ["Well done."] = "",
+--      ["We'll give you a problem then!"] = "", -- A_Classic_Fairytale:enemy
+--      ["We'll spare your life for now!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Well, that was a waste of time."] = "", -- A_Classic_Fairytale:dragon
+--      ["Well, well! Isn't that the cutest thing you've ever seen?"] = "", -- A_Classic_Fairytale:journey
+--      ["Well, yes. This was a cyborg television show."] = "", -- A_Classic_Fairytale:enemy
+--      ["We made sure noone followed us!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to move!"] = "", -- A_Classic_Fairytale:united
+--      ["We need to prevent their arrival!"] = "", -- A_Classic_Fairytale:backstab
+--      ["We need to warn the village."] = "", -- A_Classic_Fairytale:shadow
+--      ["We should head back to the village now."] = "", -- A_Classic_Fairytale:shadow
+--      ["We were trying to save her and we got lost."] = "", -- A_Classic_Fairytale:family
+--      ["We won't let you hurt her!"] = "", -- A_Classic_Fairytale:journey
+--      ["What?! A cannibal? Here? There is no time to waste! Come, you are prepared."] = "", -- A_Classic_Fairytale:first_blood
+--      ["What a douche!"] = "", -- A_Classic_Fairytale:enemy
+--      ["What am I gonna...eat, yo?"] = "", -- A_Classic_Fairytale:family
+--      ["What are you doing at a distance so great, young one?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["What are you doing? Let her go!"] = "", -- A_Classic_Fairytale:journey
+--      ["What a ride!"] = "", -- A_Classic_Fairytale:shadow
+--      ["What a strange cave!"] = "", -- A_Classic_Fairytale:dragon
+--      ["What a strange feeling!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What do my faulty eyes observe? A spy!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Whatever floats your boat..."] = "", -- A_Classic_Fairytale:shadow
+--      [" What !! For all of this struggle i just win some ... TIME o0"] = "", -- portal
+--      ["What has "] = "", -- A_Classic_Fairytale:backstab
+--      ["What? Here? How did they find us?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["What is this place?"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy
+--      ["What shall we do with the traitor?"] = "", -- A_Classic_Fairytale:backstab
+--      ["WHAT?! You're the ones attacking us!"] = "", -- A_Classic_Fairytale:enemy
+--      ["When?"] = "", -- A_Classic_Fairytale:enemy
+--      ["When I find it..."] = "", -- A_Classic_Fairytale:dragon
+--      ["Where are all these crates coming from?!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where are they?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where did that alien run?"] = "", -- A_Classic_Fairytale:dragon
+--      ["Where did you get the exploding apples?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the exploding apples and the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the magic bow that shoots many arrows?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Where did you get the weapons in the forest, Dense Cloud?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where do you get that?!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Where have you been?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Where have you been?"] = "", -- A_Classic_Fairytale:united
+--      ["? Why?"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why "] = "", -- A_Classic_Fairytale:backstab
+--      ["! Why?!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["Why are you doing this?"] = "", -- A_Classic_Fairytale:journey
+--      ["Why are you helping us, uhm...?"] = "", -- A_Classic_Fairytale:family
+--      ["Why can't he just let her go?!"] = "", -- A_Classic_Fairytale:family
+--      ["Why do men keep hurting me?"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Why do you not like me?"] = "", -- A_Classic_Fairytale:shadow
+--      ["Why do you want to take over our island?"] = "", -- A_Classic_Fairytale:enemy
+--      ["Why me?!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Why would they do this?"] = "", -- A_Classic_Fairytale:backstab
+--      ["- Will Get 1-3 random weapons"] = "", -- Continental_supplies
+--      ["- Will refresh Parachute each turn."] = "", -- Continental_supplies
+--      ["- Will refresh portalgun each turn."] = "", -- Continental_supplies
 --      ["Will this ever end?"] = "",
+--      ["WINNER IS "] = "", -- Mutant
 --      ["WINNING TIME: "] = "",
+--      ["Wise Oak"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:dragon, A_Classic_Fairytale:enemy, A_Classic_Fairytale:epil, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
+--      ["With Dense Cloud on the land of shadows, I'm the village's only hope..."] = "", -- A_Classic_Fairytale:journey
+--      ["With the rest of the tribe gone, it was up to "] = "", -- A_Classic_Fairytale:dragon
+--      ["Worry not, for it is a peaceful animal! There is no reason to be afraid..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Wow, what a dream!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Y3K1337"] = "", -- A_Classic_Fairytale:journey, A_Classic_Fairytale:shadow
+--      ["Yay, we won!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Y Chwiliad"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah...I think it's a 'he', lol."] = "", -- A_Classic_Fairytale:shadow
+--      ["Yeah, sure! I died. Hillarious!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yeah, take that!"] = "", -- A_Classic_Fairytale:dragon
+--      ["Yeah? Watcha gonna do? Cry?"] = "", -- A_Classic_Fairytale:journey
+--      ["Yes!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Yes, yeees! You are now ready to enter the real world!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["Yo, dude, we're here, too!"] = "", -- A_Classic_Fairytale:family
+--      ["You are given the chance to turn your life around..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You are playing with our lives here!"] = "", -- A_Classic_Fairytale:enemy
+--      ["! You bastards!"] = "", -- A_Classic_Fairytale:backstab, A_Classic_Fairytale:united
+--      ["You bear impressive skills, "] = "", -- A_Classic_Fairytale:dragon
+--      ["You can't fire a portal on the blue surface"] = "", -- portal
+--      ["You couldn't possibly believe that after refusing my offer I'd just let you go!"] = "", -- A_Classic_Fairytale:journey
 --      ["You'd almost swear the water was rising!"] = "",
+--      ["You'd better watch your steps..."] = "", -- A_Classic_Fairytale:journey
+--      ["You did not make it in time, try again!"] = "", -- Basic_Training_-_Rope
+--      ["You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You have "] = "", -- A_Classic_Fairytale:dragon
+--      ["You have been giving us out to the enemy, haven't you!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have been respawned, at your last checkpoint!"] = "", -- Basic_Training_-_Rope
+--      ["You have been respawned, be more carefull next time!"] = "", -- Basic_Training_-_Rope
+--      ["You have chosen the perfect moment to leave."] = "", -- A_Classic_Fairytale:united
+--      ["You have failed to complete your task, young one!"] = "", -- A_Classic_Fairytale:journey
+--      ["You have failed to save the tribe!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have finally figured it out!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have kidnapped our whole tribe!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You have killed an innocent hedgehog!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You have proven yourself worthy to see our most ancient secret!"] = "", -- A_Classic_Fairytale:first_blood
+--      ["You have proven yourselves worthy!"] = "", -- A_Classic_Fairytale:enemy
       ["You have SCORED!!"] = "得分",
+--      ["You have to destroy 12 targets in 180 seconds"] = "", -- Basic_Training_-_Cluster_Bomb
+--      ["You have won the game by proving true cooperative skills!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You just appeared out of thin air!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You just committed suicide..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You killed my father, you monster!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You know...taking a stroll."] = "", -- A_Classic_Fairytale:backstab
+--      ["You know what? I don't even regret anything!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You'll see what I mean!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You may only attack from a rope!"] = "", -- WxW
+--      ["You meatbags are pretty slow, you know!"] = "", -- A_Classic_Fairytale:enemy
+--      ["You might want to find a way to instantly kill arriving cannibals!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Young one, you are telling us that they can instantly change location without a shaman?"] = "", -- A_Classic_Fairytale:united
+--      ["You probably know what to do next..."] = "", -- A_Classic_Fairytale:first_blood
+--      ["Your deaths will be avenged, cannibals!"] = "", -- A_Classic_Fairytale:enemy
+--      ["Your death will not be in vain, Dense Cloud!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You're...alive!? But we saw you die!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're a pathetic liar!"] = "", -- A_Classic_Fairytale:backstab
+--      ["You're funny!"] = "", -- A_Classic_Fairytale:journey
+--      ["You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower"] = "", -- Basic_Training_-_Rope
+--      ["You're pathetic! You are not worthy of my attention..."] = "", -- A_Classic_Fairytale:shadow
+--      ["You're probably wondering why I bought you back..."] = "", -- A_Classic_Fairytale:backstab
+--      ["You're terrorizing the forest...We won't catch anything like this!"] = "", -- A_Classic_Fairytale:shadow
+--      ["Your hogs must survive!"] = "", -- A_Classic_Fairytale:journey
+--      ["Your movement skills will be evaluated now."] = "", -- A_Classic_Fairytale:first_blood
 --      ["You saved"] = "",
+--      ["You've been assaulting us, we have been just defending ourselves!"] = "", -- A_Classic_Fairytale:enemy
       ["You've failed. Try again."] = "失败了。再尝试吧。",
       ["You've reached the goal!| |Time: "] = "目标达成| |时间:",
+--      ["You will be avenged!"] = "", -- A_Classic_Fairytale:shadow
+--      ["You won't believe what happened to me!"] = "", -- A_Classic_Fairytale:backstab
+--      ["Yuck! I bet they'll keep worshipping her even after I save the village!"] = "", -- A_Classic_Fairytale:family
+--      ["Zealandia"] = "", -- Continental_supplies
       ["'Zooka Team"] = "火箭队",
+--      ["Zork"] = "", -- A_Classic_Fairytale:dragon, A_Classic_Fairytale:family, A_Classic_Fairytale:queen
       [":("] = "囧",
     }
diff --git a/share/hedgewars/Data/Locale/zh_CN.txt b/share/hedgewars/Data/Locale/zh_CN.txt
index ae6df81..4391f34 100644
--- a/share/hedgewars/Data/Locale/zh_CN.txt
+++ b/share/hedgewars/Data/Locale/zh_CN.txt
@@ -1,824 +1,47 @@
 ; Simplified Chinese locale
 
 00:00=手榴弹
-00:01=集束炸弹
-00:02=火箭筒
-00:03=归巢的蜜蜂
-00:04=霰弹枪
-00:05=大锤
-00:06=跳过回合
+00:01=子母炸弹
+00:02=火箭炮
+00:03=UFO
+00:04=散弹枪
+00:05=气锤
+00:06=掠过
 00:07=绳索
 00:08=地雷
 00:09=沙漠之鹰
 00:10=炸药
 00:11=球棒
-00:12=Shoryuken
+00:12=升龙拳
 00:13=秒
 00:14=降落伞
 00:15=空袭
-00:16=地雷空袭
+00:16=地雷袭击
 00:17=喷灯
-00:18=钢梁
+00:18=钢板
 00:19=传送
-00:20=切换刺猬
+00:20=切换
 00:21=迫击炮
 00:22=鞭子
 00:23=神风特工队
 00:24=蛋糕
-00:25=引诱
+00:25=吸引
 00:26=西瓜炸弹
 00:27=地狱礼花
-00:28=钻头火箭
+00:28=钻地火箭
 00:29=弹珠炮
-00:30=汽油弹空袭
-00:31=遥控轰炸机
+00:30=燃烧弹
+00:31=轰炸机
 00:32=低重力
-00:33=增强伤害
-00:34=无敌
+00:33=附加伤害
+00:34=刀枪不入
 00:35=加时
 00:36=激光瞄准
-00:37=吸血
-00:38=狙击枪
-00:39=UFO
-00:40=燃烧瓶
-00:41=鸟儿
-00:42=传送器
-00:43=飞来的钢琴
-00:44=毒奶酪
-00:45=正弦能量炮
-00:46=火焰喷射器
-00:47=固定地雷
-00:48=大锤
-00:49=复苏
-00:50=电钻空袭
-00:51=土块
 
-01:00=开战!
-01:01=平局
-01:02= %1 胜利!
+01:00=战斗啦!
+01:01=平手
+01:02= %1 胜!
 01:03=音量 %1%
 01:04=暂停
-01:05=确定要退出? (是Y/否Esc)
-01:06=死亡模式!
-01:07=%1 剩余
-01:08=燃料
-01:09=同步中...
-01:10=使用本工具不会结束回合!
-01:11=您还不能用它!
-01:12=死亡模式前最后一回合!
-01:13=%1 回合倒计时!
-01:14=预备上, %1!
-
-; Event messages
-; Hog (%1) died
-; 02:00=%1 has kicked the bucket!
-02:00=%1 离去!
-; 02:00=%1 has seen the light!
-02:00=%1 目睹圣光降临!
-; 02:00=%1 never saw that coming!
-02:00=%1 无法瞑目
-; 02:00=%1 waves goodbye!
-02:00=%1 向大家挥手道别。
-; 02:00=%1 has gone to a better place!
-02:00=%1 去了极乐世界!
-; 02:00=%1 meets his maker!
-02:00=%1 去见造物主了!
-; 02:00=%1 can hang on no longer!
-02:00=%1 再也受不了了!
-; 02:00=%1 has done his duty!
-02:00=%1 完成了他的使命!
-; 02:00=%1 makes the ultimate sacrifice!
-02:00=%1 做了最大的牺牲!
-; 02:00=%1 departs this mortal coil!
-02:00=%1 摆脱了躯壳的束缚!
-; 02:00=%1 makes like a tree and leaves!
-02:00=%1 叶落归根。
-; 02:00=%1 has timed out!
-02:00=%1 大限已至。
-; 02:00=%1 says peace out!
-02:00=%1 悄然离场了。
-; 02:00=%1 will be fondly remembered!
-02:00=%1 永远活在我们心中!
-; 02:00=%1 has an aneurysm!
-02:00=%1 不治而亡。
-; 02:00=%1 leaves behind a wife and child
-02:00=%1 留下一家孤儿寡母。
-; 02:00=%1 has launched his last bazooka
-02:00=%1 发射了最后一发火箭弹
-; 02:00=%1 has tossed his last grenade
-02:00=%1 扔出了最后一枚手榴弹
-; 02:00=%1 has baked his last cake
-02:00=%1 烘烤了最后一块蛋糕
-; 02:00=%1 has swung on his last rope
-02:00=%1 最后一次甩出了绳索
-; 02:00=%1 has called his last airstrike
-02:00=%1 最后一次呼叫空袭
-; 02:00=%1 has pumped his last shotgun
-02:00=%1 最后一次抽出了霰弹枪
-; 02:00=%1 has thrown his last melon
-02:00=%1 最后一次扔出了西瓜炸弹
-; 02:00=%1 has drawn his last deagle
-02:00=%1 最后一次拔出了沙鹰
-; 02:00=%1 took one shot too many
-02:00=%1 挨了太多枪了
-; 02:00=%1 could really have used a health crate
-02:00=%1 真该用下医疗包的
-; 02:00=%1 has gone to play a better game
-02:00=%1 去玩更有意思的游戏去了
-; 02:00=%1 has ragequit life
-02:00=%1 拔网线了!
-; 02:00=%1 fails
-02:00=%1 失败了
-; 02:00=Poor poor %1...
-02:00=可怜的 %1...
-; 02:00=%1 prefers wormux
-02:00=%1 更喜欢 Warmux
-; 02:00=%1 has been blocking shots with his face
-02:00=%1 勇于面对,结果相当惨烈
-; 02:00=%1 is a hero amongst me...err..hogs
-02:00=%1 是我的英雄!
-; 02:00=%1 finds his place in Valhalla
-02:00=%1 在勇者纪念碑上找到了位置
-; 02:00=%1 has left the building
-02:00=%1 离开了这间屋子
-; 02:00=%1 goes the way of the dinosaurs
-02:00=%1 步上了恐龙的道路
-; 02:00=%1 brings hedgehogs one step closer to extinction
-02:00=%1 让刺猬物种灭绝更近了一步
-; 02:00=%1 brings a tear to my eye
-02:00=%1 带走了我一滴眼泪
-; 02:00=%1 is an ex-hog
-02:00=%1 生前是一只刺猬
-; 02:00=%1 is pushing up the daisies
-02:00=%1 被菊花簇拥
-; 02:00=%1 has ceased to be
-02:00=%1 被删除了
-; 02:00=Say goodbye to %1
-02:00=对 %1 说再见
-; 02:00=No hope left for %1
-02:00=%1 没有希望了
-; 02:00=%1 faces the final curtain
-02:00=%1 面容被落下的帷幕遮住了
-; 02:00=Smoke 'em if you got 'em, %1
-02:00=%1 抓紧时间实现你最后的愿望吧
-; 02:00=%1 suffers a Spontaneous Massive Existence Failure
-02:00=%1 遭遇了自发性大规模故障
-; 02:00=%1 has passed on
-02:00=%1 走了
-; 02:00=%1 is stone dead
-02:00=%1 永垂不朽
-; 02:00=%1 is no more
-02:00=%1 不在了
-; 02:00=%1 has expired
-02:00=%1 已故
-; 02:00=Bereft of life, %1 rests in peace
-02:00=%1 安详地躺着
-; 02:00=%1 joins the choir invisible
-02:00=%1 加入了隐形唱诗班
-; 02:00=Farewell %1, we hardly knew ye!
-02:00=%1, 永别了,我们还没熟悉你呢!
-; 02:00=%1 had a low tolerance for being shot
-02:00=%1 抗打击能力不足
-; 02:00=%1 could have used an extra life
-02:00=%1 本该用另一条命的
-; 02:00=Is there a doctor in the house?
-02:00=有医生吗?
-
-; Hog (%1) drowned
-; 02:01=%1 plays submarine!
-02:01=%1 以为自己是潜水艇!
-; 02:01=%1 mimics the Titanic!
-02:01=%1 学泰坦尼克去了!
-; 02:01=%1 swims like a stone!
-02:01=%1 石沉大海!
-;02:01=%1 checks out the deep end
-02:01=%1 说要去检查深水区
-;02:01=%1 goes glug glug glug
-02:01=%1 :“咕噜咕噜咕噜……”
-;02:01=%1 goes splash
-02:01=%1 栽入水花里
-;02:01=%1 forgot his armbands
-02:01=%1 忘记了戴臂章
-;02:01=%1 really should have taken swimming lessons
-02:01=%1 真的该去学游泳的
-;02:01=%1 left his surfboard at home
-02:01=%1 把救生圈忘家了
-;02:01=%1 is washed up
-02:01=%1 冲走了
-;02:01=%1 is one soggy hog
-02:01=%1 湿掉了
-;02:01=%1 forgot to bring his life jacket
-02:01=%1 忘记带救生衣了
-;02:01=%1 goes splish splash splish
-02:01=%1 实现了水上飘,身后一片水花荡漾
-;02:01=%1 is sleeping with the fishes
-02:01=%1 将会和鱼睡在一起
-;02:01=%1 thinks the water physics suck in this game
-02:01=%1 认为这游戏的设定糟糕透了
-;02:01=%1 looks thirsty
-02:01=%1 好像很渴
-;02:01=the sea claims %1
-02:01=大海吞没了 %1
-;02:01=%1 is lost at sea
-02:01=%1 在海上迷失了
-;02:01=%1 should have brought his scuba gear
-02:01=%1 应该要带潜水工具的
-;02:01=%1 gets a burial at sea
-02:01=%1 享受到了海葬待遇
-;02:01=%1 has that sinking feeling
-02:01=%1 觉得自己在下沉
-;02:01=%1 is practicing his backstroke
-02:01=%1 终于能实践自己的游泳理论了
-;02:01=%1 goes in search of the Titanic
-02:01=%1 去泰坦尼克号寻宝了
-;02:01=%1 is not Jesus
-02:01=很遗憾 %1 不是耶稣
-;02:01=%1 is finding Nemo
-02:01=%1 正在寻找Nemo
-;02:01=%1 springs a leak
-02:01=%1 钻入了一个水洼
-;02:01=You've gotta wonder how many hogs are down there
-02:01=你会知道海底还会有多少同伴的
-;02:01=%1 makes the ocean slightly higher
-02:01=%1 让海平面高了那么一点, 就一点
-;02:01=%1 didn't enlist in the Navy
-02:01=很明显 %1 没在海军服役过
-;02:01=%1 is doing his impersonation of a dead fish
-02:01=%1 其实是在模仿死鱼啦
-;02:01=At least you didn't go down the toilet, %1
-02:01=还好 %1 你不是掉进了厕所
-;02:01=Sonic couldn't swim and neither can %1
-02:01=索尼克不能游泳, %1 也一样
-;02:01=%1 wants to play Ecco the dolphin
-02:01=%1 想玩海底漫步
-;02:01=%1 has gone to visit Aquaria
-02:01=%1 去水族馆报到了
-;02:01=%1 has found the lost city of Atlantis
-02:01=%1 找到了传说中的亚特兰蒂斯城
-;02:01=%1 aims for the lead role in Bioshock 3
-02:01=%1 的目的是为了在生化奇兵3中起带头作用
-;02:01=Your doggy paddle could use a little work, %1
-02:01=狗爬式会有用的, %1
-;02:01=%1 should have brought a jet ski
-02:01=%1 竟然没带摩托艇
-;02:01=%1 doesn't like watersports
-02:01=%1 不喜欢水上运动
-;02:01=%1 is forever blowing bubbles
-02:01=%1 学会了绝技: 神风吹泡泡
-;02:01=%1 is short of a raft
-02:01=%1 腿太短了
-;02:01=%1 thinks salt water is good for the skin
-02:01=%1 认为盐水对皮肤有好处
-;02:01=%1 gets salt water in his wounds
-02:01=%1 的伤口沾上了盐水
-;02:01=%1 has walked the plank
-02:01=%1 错过了那块木板
-;02:01=%1 has a bath
-02:01=%1 洗澡去了
-;02:01=%1 is wet wet wet
-02:01=%1 全身是水
-;02:01=%1 gets his quills wet
-02:01=%1 把刚毛弄湿了
-;02:01=It's Davy Jones' locker for %1
-02:01=深海阎王正在等待 %1
-
-; Round starts
-; 02:02=Let's fight!
-02:02=开战!
-; 02:02=Armed and ready!
-02:02=准备!
-;02:02=Let's get ready to rumble!
-02:02=准备对轰!
-;02:02=Let's get it on!
-02:02=让我们得到胜利!
-;02:02=Let's get this party started
-02:02=这个Party要开始了
-;02:02=Last hog standing wins
-02:02=胜利属于最后一个生还者
-;02:02=Let's go!
-02:02=出发吧!
-;02:02=Let's rock!
-02:02=起点
-;02:02=Let's jam!
-;02:02=It's beginning...
-02:02=开始了
-;02:02=This is the start of something big
-02:02=这是一个伟大的开始
-;02:02=Welcome to Hedgewars
-02:02=欢迎来到刺猬大作战
-;02:02=Welcome to the front lines
-02:02=欢迎来到前线
-;02:02=Crush your enemies!
-02:02=目标:粉碎你的敌人!
-;02:02=May the best hog win
-02:02=祝愿胜利属于最厉害的刺猬!
-;02:02=Victory or death
-02:02=胜利或死亡
-;02:02=To the victor goes the spoils
-02:02=战利品只属于胜利者
-;02:02=Losing is not an option
-02:02=字典里面应该没有"输"这个字的
-;02:02=Cry havoc! Let loose the hogs of war!
-02:02=放声哭吧! 这是刺猬的战争!
-;02:02=Hedgewars, brought to you by Hedgewars.org
-02:02=欢迎来到刺猬大作战, Hedgewars.org 为你呈现
-02:02=GL HF
-;02:02=Just count yourself lucky you're not up against Tiyuri
-02:02=你看你多幸运不是在对战 Tiyuri
-;02:02=Just count yourself lucky you're not up against unC0Rr
-02:02=你看你多幸运不是在对战 unC0Rr
-;02:02=Just count yourself lucky you're not up against Nemo
-02:02=你看你多幸运不是在对战 Nemo
-;02:02=Just count yourself lucky you're not up against Smaxx
-02:02=你看你多幸运不是在对战 Smaxx
-;02:02=Just count yourself lucky you're not up against Jessor
-02:02=你看你多幸运不是在对战 Jessor
-;02:02=Give it your all!
-02:02=展现你的一切吧!
-;02:02=The losers do the cleaning up!
-02:02=输的要罚扫厕所!
-;02:02=Let the fight of the millenium begin
-02:02=宇宙之战开始了
-;02:02=Let the fight of the century begin
-02:02=世纪之战开始了
-;02:02=Let the fight of the decade begin
-02:02=正义之战开始了
-;02:02=Let the fight of the year begin
-02:02=年度争霸战开始了
-;02:02=Let the fight of the month begin
-02:02=本月之星争霸战开始了
-;02:02=Let the fight of the week begin
-02:02=每周擂主争霸战开始了
-;02:02=Let the fight of the day begin
-02:02=本日最强入围赛开始了
-;02:02=Let the fight of the hour begin
-02:02=我们能战一小时!
-;02:02=Do your best!
-02:02=诸君努力!
-;02:02=Destroy the enemy!
-02:02=目标: 摧毁敌人
-;02:02=Good luck
-02:02=祝你好运
-;02:02=Have fun~
-02:02=开心玩~
-;02:02=Fight the good fight
-02:02=漂亮的战斗
-;02:02=Fight dirty
-02:02=不择手段
-;02:02=Fight with honour
-02:02=满载荣誉而战
-;02:02=Don't give up
-02:02=教练告诉你: 别放弃
-;02:02=Never surrender
-02:02=永不屈服!
-;02:02=Rock 'em and sock 'em!
-02:02=蹂虐对手
-;02:02=Let the fragfest begin!
-02:02=积分赛开始!
-;02:02=I hope you're ready for a tussle!
-02:02=你准备好恶战了么?
-;02:02=Go Go Go!
-02:02=上!
-;02:02=Hedgehogs advance!
-02:02=刺猬向前冲!
-;02:02=Bring it to them!
-02:02=炸飞他们!
-;02:02=Have no fear!
-02:02=无所畏惧!
-;02:02=Be brave and conquer
-02:02=敢于征服!
-
-; Round ends (win; unused atm)
-02:03=回合结束(胜利)
-
-; Round ends (draw; unused atm)
-02:04=回合结束(平局)
-
-; New health crate
-;02:05=Incoming aid!
-02:05=医疗包!
-;02:05=Medic!
-02:05=急救包!
-;02:05=First aid from the skies!
-02:05=救援物资空运来了!
-;02:05=A health pack for you
-02:05=你的医疗包到了
-;02:05=Good health.. in box form!
-02:05=生命就在那箱子里!
-;02:05=The doctor calls
-02:05=医生的紧急呼叫
-;02:05=Fresh band-aids!
-02:05=新鲜创可贴!
-;02:05=This will make you feel better
-02:05=吃了这个感觉会好些的...
-;02:05=A Hi-Potion! Whoops wrong game
-02:05=兴奋剂!呃。。。走错地方了
-;02:05=A pick-me-up!
-02:05=万金油!
-;02:05=Grab it
-02:05=捉住它
-;02:05=A healthy snack
-02:05=健康食品
-;02:05=A remedy to pain
-02:05=止痛饼来了
-;02:05=Correct Dosage: as many as you can find!
-02:05=使用方法: 吃得越多越好
-;02:05=Urgent delivery
-02:05=紧急物资
-;02:05=Supplies!
-02:05=补给!
-
-; New ammo crate
-; 02:06=More weapons!
-02:06=武器!
-;02:06=Reinforcements!
-02:06=增援!
-;02:06=Lock and load!
-02:06=准备!
-;02:06=I wonder what weapon is in there?
-02:06=我要的那个会在的吧...
-;02:06=Supplies!
-02:06=补给!
-;02:06=What could be inside?
-02:06=里面会有啥呢?
-;02:06=Christmas comes early in Hedgewars
-02:06=刺猬大作战每天都是圣诞节
-;02:06=A present!
-02:06=礼物送到!
-;02:06=Special delivery!
-02:06=特快专递!
-;02:06=It was a nightmare getting this through customs
-02:06=本局的噩梦来了
-;02:06=Destructive toys from the heavens
-02:06=玩具从天堂掉下来了
-;02:06=Warning! Contents Volatile
-02:06=警告! 内含危险物品
-;02:06=Pick it up or blow it up, choice is yours
-02:06=拿走或打爆, 随你
-;02:06=Goodies!
-02:06=好玩意儿!
-;02:06=Mmmmm Ammo
-02:06=弹药!!!!
-;02:06=A box of destructive power
-02:06=潘朵拉之盒
-;02:06=Airmail!
-02:06=天降之物!
-;02:06=Whatever's in that box, it ain't pizza
-02:06=无论里面是啥, 那肯定不会是软妹子
-;02:06=Get it!
-02:06=拿走它!
-;02:06=Weapon drop incoming
-02:06=武器掉下来了!
-;02:06=Don't let the enemy grab that!
-02:06=别让敌人拿了!
-;02:06=Shiny new toys!
-02:06=新玩具!
-;02:06=A mysterious box!
-02:06=神秘的箱子!
-
-; New utility crate
-; 02:07=Tooltime!
-02:07=工具箱!
-;02:07=This could come in handy...
-02:07=这可能派上用场
-;02:07=Utilities!
-02:07=工具!
-;02:07=Utilise this box
-02:07=工具在这里!
-;02:07=Watch out below
-02:07=快看这里!
-;02:07=More utilities!
-02:07=更多选择更多欢笑, 尽在工具包
-;02:07=Tools for you!
-02:07=一堆工具, 送给你!
-;02:07=This should be good!
-02:07=这看见起来蛮好...
-;02:07=Use this wisely
-02:07=使用这个才是明智的选择
-;02:07=Ooo this box is heavy
-02:07=好重...好重...
-;02:07=You might need this
-02:07=会有用的
-
-; Hog (%1) skips his turn
-; 02:08=%1 is sooo boring...
-02:08=%1 太无聊了...
-;02:08=%1 couldn't be bothered
-02:08=%1 不想被打扰!
-;02:08=%1 is one lazy hog
-02:08=%1 太懒了
-;02:08=%1 is thoughtless
-02:08=%1 太轻率了
-;02:08=%1 gave up
-02:08=%1 放弃了
-;02:08=You snooze you lose, %1
-02:08=不认真你就输了, %1
-;02:08=%1 shamelessly skips
-02:08=%1 无耻的跳过了本回合
-;02:08=%1 is really lazy
-02:08=%1 真的太懒了
-;02:08=%1 needs a little more motivation
-02:08=%1 没有动力了
-;02:08=%1 is a pacifist
-02:08=%1 是和平主义者
-;02:08=%1 has a breather
-02:08=%1 需要喘息一下
-;02:08=%1 has a rest
-02:08=%1 需要休息
-;02:08=%1 chills out
-02:08=%1 发冷了
-;02:08=%1 has no faith in his own abilities
-02:08=%1 做啥都没信心了
-;02:08=%1 decides to do nothing at all
-02:08=%1 决定啥都不做
-;02:08=%1 lets the enemy destroy itself
-02:08=%1 认为敌人会自杀的
-;02:08=%1 would be terrible at parties
-02:08=%1 将会陷入可怕的事件中
-;02:08=%1 hides out
-02:08=%1 说:“你看不到我,你看不到我……”
-;02:08=%1 has decided to pass on this opportunity
-02:08=%1 已经决定放弃这个机会
-;02:08=%1 decides the best thing he can do is...nothing
-02:08=%1 决定他现在最应该做的是......坐着不动
-;02:08=%1 is a big wuss
-02:08=%1 大笨蛋!
-;02:08=Buck Buck Buck, %1 is a chicken
-02:08=%1 是小鸡鸡
-;02:08=%1 is looking a little yellow
-02:08=%1 看来有点印堂发黑
-;02:08=%1 is a coward!
-02:08=%1 是懦夫!
-;02:08=%1 is waiting for sudden death
-02:08=%1 在等待突然死亡模式
-;02:08=%1 is not the fighting type
-02:08=%1 不是战斗系的
-;02:08=%1 is reconsidering his purpose in life
-02:08=%1 正在重新寻找他的人生
-;02:08=%1 was never much of a good shot anyway
-02:08=%1 从来没一次打准的
-;02:08=%1 didn't want to join the army in the first place
-02:08=%1 不想参军
-;02:08=Stop wasting our time, %1
-02:08=别浪费时间了! %1
-;02:08=I'm dissapointed in you, %1
-02:08=我对你失望了, %1
-;02:08=Come on, you can do better than that %1
-02:08=%1 明明就能做的更好的
-;02:08=%1's will has broken
-02:08=%1 会被打飞的
-;02:08=%1 apparently has better things to do
-02:08=%1 显然有更好的事情等着做
-;02:08=%1 is scared stiff
-02:08=%1 怕刺激
-;02:08=%1 has fallen asleep
-02:08=%1 睡着了
-
-; Hog (%1) hurts himself only
-; 02:09=%1 should practice aiming!
-02:09=%1 该练练瞄准了!
-; 02:09=%1 seems to hate himself.
-02:09=%1 似乎看自己很不爽。
-; 02:09=%1 is standing on the wrong side!
-02:09=%1 在表演乌龙!
-; 02:09=%1 makes like an emo
-02:09=%1 以为自己无敌
-; 02:09=%1 was holding his weapon the wrong way around
-02:09=%1 好像把武器拿错方向了
-;02:09=%1 is a little sadistic
-02:09=%1 有点施虐狂
-;02:09=%1 is a masochist
-02:09=%1 是受虐狂
-;02:09=%1 has no instinct of self-preservation
-02:09=%1 根本不会自我保护
-;02:09=%1 messed up
-02:09=%1 乱套了
-;02:09=%1 screwed up
-02:09=%1 搞砸了
-;02:09=That was a poor shot, %1
-02:09=%1 这一发真渣
-;02:09=%1 is a little too careless with dangerous weapons
-02:09=%1 太不小心用那些危险的玩意了
-;02:09=%1 should consider a change of career
-02:09=%1 正在考虑转职
-;02:09=Worst. Shot. Ever!
-02:09=更差! 最差! 非常差!
-;02:09=No no no %1, you shoot at the ENEMY!
-02:09=No no no %1, 你要打敌人!
-;02:09=%1 should only be destroying the enemy
-02:09=%1 应该消灭敌人才对
-;02:09=%1 moves one step closer to suicide
-02:09=%1 正在走向自杀
-;02:09=%1 aids the enemy
-02:09=%1 帮助敌人
-;02:09=That was stupid %1
-02:09= %1 是笨蛋
-;02:09=%1 lives by the mantra of "no pain, no gain"
-02:09=%1 贯彻“不付出,何收获“的原则
-;02:09=%1 is confused
-02:09=%1 思维混乱了
-;02:09=%1 hurt itself in its confusion
-02:09=%1 在混乱中攻击自己
-;02:09=%1 has a knack for embarrassing himself
-02:09=%1 正在为自己尴尬
-;02:09=%1 is a klutz!
-02:09=%1 就是一个笨蛋!
-;02:09=%1 is clumsy
-02:09=%1 笨手笨脚的
-;02:09=%1 shows the enemy what he's capable of
-02:09=%1 展示了自己的能力
-;02:09=%1 can't be expected to be perfect all the time
-02:09=%1 不能每次都完美
-;02:09=Don't worry %1, pobody's nerfect
-02:09=不用担心 %1 , 人都不是完美的
-;02:09=%1 totally did that on purpose
-02:09=%1 这么做真的是有目的
-;02:09=I won't tell anyone if you don't, %1
-02:09=我不会把 %1 的事情到处说的
-;02:09=How embarrassing!
-02:09=何等的失态!
-;02:09=I'm sure nobody saw that %1
-02:09=保证,决没人看到 %1 做什么
-;02:09=%1 needs to review his field manual
-02:09=%1 需要复习说明书
-;02:09=%1's weapon clearly malfunctioned
-02:09=%1 的武器很明显坏了
-
-; Hog shot an home run (using the bat and another hog)
-; 02:10=Home Run!
-02:10=全垒打!
-; 02:10=A bird, a plane, ...
-02:10=一只鸟,一架飞机,...
-; 02:10=That one is out!
-02:10=那一位出界了!
-
-; Hog (%1) has to leave (team is gone)
-02:11=%1 必须上床了
-02:11=%1 玩的过火了,休息一下
-02:11=发射!这位已经被送出去
-02:11=%1 必须走了
-
-; Weapon Categories
-03:00=定时手雷
-03:01=定时手雷
-03:02=弹道武器
-03:03=制导武器
-03:04=枪 (多发子弹)
-03:05=钻孔工具
-03:06=动作
-03:07=移动工具
-03:08=接近式炸弹
-03:09=枪 (多发子弹)
-03:10=BOOM!
-03:11=å’š!
-03:12=武术
-03:13=未使用
-03:14=移动工具
-03:15=空投打击
-03:16=空投打击
-03:17=打洞工具
-03:18=工具
-03:19=移动工具
-03:20=动作
-03:21=弹道武器
-03:22=叫我主人!
-03:23=武术 (真的!)
-03:24=蛋糕不是谎言!
-03:25=化妆的诱惑
-03:26=果汁手雷
-03:27=烫手手雷
-03:28=弹道武器
-03:29=弹道武器
-03:30=空投打击
-03:31=遥控飞机(不是玩具!)
-03:32=临时效果
-03:33=临时效果
-03:34=临时效果
-03:35=临时效果
-03:36=临时效果
-03:37=临时效果
-03:38=枪 (多发子弹)
-03:39=移动工具
-03:40=燃烧弹
-;03:41=Huge fan of Squawks
-03:41=粉丝的呼喊
-;03:42=I'm making a note here...
-03:42=我将在此记录...
-; the misspelled "Beethoven" is intentional (-> to beat)
-;03:43=Performing Beathoven's deadly sonata
-03:43=特殊的圣诞表演
-;03:44=Best before: 1923
-03:44=此日期前最佳:1923
-;03:45=The power of science
-03:45=科学的力量
-;03:46=Hot Hot Hot!
-03:46=好烫烫烫!
-;03:47=Stick these somewhere useful!
-03:47= 呆在有利的地方!
-;03:48=It's Hammer time!
-03:48=大锤威武!
-;03:49=Does what you guess
-03:49=尽情猜想
-;03:50=Moles fan
-03:50=地道战
-
-; Weapon Descriptions (use | as line breaks)
-04:00=使用简单的手榴弹攻击敌人.|定时器倒数到0就会爆炸.|1-5: 设定定时器|攻击键: 按住蓄力.
-04:01=使用集束手雷攻击敌人.|定时器倒数到0就会爆炸并裂开成几块.|1-5: 设定定时器|攻击键: 按住蓄力.
-04:02=使用弹道导弹攻击敌人.|受风力影响.|攻击键: 按住蓄力.
-04:03=发射一个制导导弹攻击所选目标.|如果要精确打击就不要使用全力发射.|光标: 选定目标|攻击键: 按住蓄力.
-04:04=霰弹枪有两排子弹.|因为是霰弹枪所以不一定要对准敌人.|攻击键: 开枪 (两发)
-04:05=向地底出发! 使用他就能在地面|打个洞, 就能去其他地方.|攻击键: 开始/停止打洞
-04:06=闷了? 没法打? 保存体力? 没问题!|跳过这回合就可以了, 懦夫!|攻击键: 跳过回合
-04:07=用绳索就可以去很远的地方.|还能空降到别的刺猬身上丢手榴弹呢.|攻击键: 发射/收回绳索|长跳键: 发射手榴弹或其他武器
-04:08=你能用地雷阻止敌人靠近.|还能静悄悄的放在敌人脚下.|一定要在爆炸前逃离到安全的地方!|攻击键: 把地雷放在你的脚下
-04:09=自我感觉准头不行? |沙漠之鹰有4颗子弹呢.|攻击键: 开枪 (四发)
-04:10=使用强力炸药就是一个明智的选择.|这是最经典的轰炸方式.|攻击键: 把炸药放在你的脚下
-04:11=把敌人打飞, 飞出地图或者飞进水里.|或者把地雷打过去?|攻击键: 敲打你面前的所有东西
-04:12=这就是武术的威力!|致命的气功!|攻击键: 使用升龙拳
-04:13=UNUSED
-04:14=有恐高症? 拿降落伞吧.|他能慢慢的安全的把你带到地面.|攻击键: 展开降落伞
-04:15=呼叫一架飞机轰炸你的敌人.|左/右方向键: 决定攻击方向|光标: 选定目标
-04:16=呼叫一架飞机投下大量地雷.|左/右方向键: 决定攻击方向|光标: 选定目标
-04:17=需要个安全的地方? 使用喷灯为你挖掘一条安全的隧道!|攻击键: 开始/停止挖掘
-04:18=喷灯还不够?还要个更安全的地方?|建造若干条大梁挡住吧.|左/右方向键: 选择梁的方向|光标: 建造
-04:19=适当的时候撤退是比所有的攻击|更安全的选择|光标: 选择传送目标
-04:20=可以让你更换当前使用的刺猬.|攻击键: 启动切换功能
-04:21=用炮弹发射器发射一个手榴弹样|的东西. 在爆炸之后会裂开成小块|攻击键: 全力发射
-04:22=这不只是女王才用的东西!|这鞭子能解决很多问题, 比如说那些|喜欢站在悬崖边上的小屁孩.|攻击键: 鞭打你面前的一切东西
-04:23=自杀式炸弹袭击向来好用!|用你的一条命攻击直线上的一切东西并爆炸.|攻击键: 启动自杀性攻击
-04:24=生日快乐! 嗱, 放下这个蛋糕, 他|就会走到敌人身边然后爆炸.| 而且能贴着地形走.|攻击键: 让蛋糕开始/结束走路
-04:25=使用美人计让敌人向着你这个方向跳|(比如跳进海里).|攻击键: 使用本工具诱惑敌人
-04:26=把这个多汁的西瓜扔向敌人!| 一旦定时器倒数完, 就会|炸成几块更强力的炸弹.|攻击键: 按住蓄力.
-04:27=让地狱的礼花在敌人头上绽放!|这真的是危险品, 使用时候记得原理|爆炸之后还会燃烧好一阵子|攻击键: 按住蓄力.
-04:28=本火箭在发射后将会钻到地里|一旦燃料用完或者打穿地面就会爆炸.|攻击键: 按住蓄力.
-04:29=还记得小时候玩的玻璃球么?|不过这个是炸弹版. 发射大量的小玻|璃球然后爆炸|攻击键: 全力发射|上/下方向键: 发射过程中更换方向
-04:30=呼叫一架飞机空投燃烧弹.|用得好的话会造成巨大伤害.|左/右方向键: 决定攻击方向|光标: 选定目标
-04:31=啊哈, 遥控飞机除了能帮你|收集物品之外. 还能空投炸弹.|攻击键: 飞机起飞/投放炸弹|长跳键: 战场之神|上/下方向键: 控制方向
-04:32=低重力装置能影响更多东西!| 除了跳得更远之外还能让|敌人飞得更远.|攻击键: 激活
-04:33=有时候致命打击还是不够过瘾.|攻击键: 激活
-04:34=你打不到我!|攻击键: 激活
-04:35=时间流逝得很快, 你也知道|刺猬腿短.|攻击键: 激活
-04:36=好吧, 你最后还是承认自己眼神不好.|高科技还是能帮你不少的.|攻击键: 激活
-04:37=不用害怕白天.|这只能本回合有效, 可以把造成的伤害变|成自己的血量 .|攻击键: 激活
-04:38=你也知道狙击枪的威力,|能打比较远的地方.|攻击键: 射击 (2发子弹)
-04:39=驾驶飞碟可以飞到地图上的任何角落.|不过这个东西连发明者都认为很难用.|攻击键: 激活|上/左/右方向键: 向某方向飞|前跳:攻击敌人
-04:40=把地面填满汽油然后....|攻击键: 按住蓄力.
-;04:41=自然的力量要盖过飞盘。|带着刺猬的鸟竟然毫不犹豫的空中下蛋!|攻击键: 激活和放蛋|上/左/右方向键: 向某方向飞
-;04:42=This portable portal device is capable|of instantly transporting you, your enemies,|or your weaponry between two points on the|terrain.|Use it wisely and your campaign will be a...|HUGE SUCCESS!|Attack: Shoot a portal|Switch: Cycle portal colours
-04:42=移动传送装置|迅速传输自己或者敌人或者|你的武器,直接连接|地表的两个不同位置。|用的聪明那么。。。|攻击键: 发射一个传送点|切换键: 改变颜色
-;04:43=Make your musical debut an explosive success!|Drop a piano from the heavens, but beware...|someone needs to play it, and that may cost you|your life!|Cursor: Select target region|F1-F9: Play the piano
-04:43=音乐细胞的迸发!|钢琴从天堂降落,带|着演奏者最终回归天堂|光标: 选择目标区域|F1-F9:演奏钢琴
-04:44=这不是奶酪!而是生化武器!|爆炸只有一次,带来的毒害是深远的!|1-5: 设定定时器|攻击键: 按住蓄力
-;04:45=All those physics classes have finally |paid off, launch a devastating Sine |wave at your foes. |Watch out, this weapon packs quite a kick. (This weapon is incomplete)|Attack: Shoot
-04:45=全部物理阶级最终|转化为正弦波动|留心,力是相对的|攻击键: 发射
-;04:46=Cover your foes with sizzling liquid flame.|Heartwarming!|Attack: Activate|Up/Down: Continue aiming|Left/Right: Modify spitting power
-04:46= 用满腔的火焰虐待你的对手吧。|攻击键: 激活|上/下方向键: 改变攻击方向|左/右方向键: 调整喷射距离
-;04:47=Double the fun with two spiky, sneaky, sticky mines.|Set up a chain reaction or defend yourself (or both!)|Attack: Hold to shoot with more power (twice)
-04:47=两次机会双重乐趣,隐蔽且黏着的地雷。|利用脑力造成连锁反应!|攻击键: 按住蓄力(两发)
-;04:48=Why should the moles get all the abuse?|Wacking a hog can be just as fun! A good|blow from this hammer will shave off one|third of a hog's health and plunge them|underground.|Attack: Activate
-04:48=痛扁刺猬:用力一锤|将使中者镶入地表,削减它健康的1/3.|攻击键: 打
-;04:49=Resurrect your friends!|But beware that this also resurrects your foes.|Attack: Keep attack pressed to resurrect slowly|Up: Accelerate resurrection
-04:49=复苏|注意,一视同仁|使用: 按住使用键|上: 提高速率
-
-; Game goal strings
-;05:01=The following rules apply
-05:01= 将应用以下规则
-;05:02=Forts: Defend your fortress; vanquish your enemies!
-05:02= 城堡: 守住你的城堡; 削平你的敌人!
-;05:03=Low Gravity: Watch your step
-05:03= 低重力: 注意脚步
-;05:04=Invulnerability: Hogs are (almost) invulnerable
-05:04=无敌: 刺猬不受伤害
-;05:05=Vampirism: Hogs will be healed for the damage dealt
-05:05=吸血: 敌人失去的就是我的
-;05:06=Karma: Hogs will be damaged for the damage dealt
-05:06=因果效应: 伤害有多少,自己都知道
-;05:07=Protect the King: Don't let your king die!|Place the King: Pick a protected starting point for your King
-05:07=保护国王: 国王不能死!|放置国王: 为国王选择安全的起始地点
-;05:08=Place Hedgehogs: Place your hogs before the game starts
-05:08=选择起始点: 游戏开始前手动放置刺猬
-;05:09=Artillery: Hogs can't walk to change position
-05:09=远程打击: 不许动!
-;05:10=Indestructible Terrain: Most weapons won't destroy terrain
-05:10=无损地表: 多数武器无法改变地形
-;05:11=Shared Ammo: All teams of the same color share their ammunition
-05:11=共享装备: 同色的刺猬共享它们的装备
-;05:12=Mine Timers: Mines will detonate after %1 second(s)
-05:12=地雷定时器: %1 秒起爆
-;05:13=Mine Timers: Mines will detonate instantly
-05:13=地雷定时器: 立即起爆
-;05:14=Mine Timers: Mines will detonate after 0 - 3 seconds
-05:14=地雷定时器: 0-3 秒起爆
-;05:15=Damage Modifier: All weapons will do %1% damage
-05:15=伤害修正: 武器伤害使用 %1% 修正值
-;05:16=Health of all hogs is reset on end of turn
-05:16=所有活着的刺猬回合结尾时彻底恢复健康
-;05:17=AI hogs respawn on death
-05:17=AI刺猬即时复活
-;05:18=Unlimited Attacks
-05:18=无限攻击法则
-;05:19=Weapons are reset on end of turn
-05:19=武器在回合结束时重置
-;05:20=Weapons are not shared between hogs
-05:20=刺猬的武器无法分享
+01:05=退出 (Y/Esc)?
+01:06=出现紧急情况!
diff --git a/share/hedgewars/Data/Maps/CMakeLists.txt b/share/hedgewars/Data/Maps/CMakeLists.txt
index d002ccd..1967ca7 100644
--- a/share/hedgewars/Data/Maps/CMakeLists.txt
+++ b/share/hedgewars/Data/Maps/CMakeLists.txt
@@ -30,6 +30,7 @@ foreach(dir
 	Octorama
 	PirateFlag
 	Plane
+	portal
 	Ropes
 	Ruler
 	Sheep
diff --git a/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua b/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
index 064272c..7193d29 100644
--- a/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
+++ b/share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
@@ -238,7 +238,7 @@ function CheckScore(teamID)
 	if fCaptures[teamID] == 3 then
 		for i = 0, (numhhs-1) do
 			if GetHogClan(hhs[i]) == alt then
-				SetEffect(hhs[i], heResurrectable, false)
+				SetEffect(hhs[i], heResurrectable, 0)
 				SetHealth(hhs[i],0)
 			end
 		end
@@ -784,7 +784,7 @@ function onGearAdd(gear)
 
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 	end
 
diff --git a/share/hedgewars/Data/Maps/Control/map.lua b/share/hedgewars/Data/Maps/Control/map.lua
index d37a899..61e091e 100644
--- a/share/hedgewars/Data/Maps/Control/map.lua
+++ b/share/hedgewars/Data/Maps/Control/map.lua
@@ -400,7 +400,7 @@ function onNewTurn()
 			for i = 0, (numhhs-1) do
 				if hhs[i] ~= nil then				
 					if GetHogClan(hhs[i]) ~= winnerClan then
-						SetEffect(hhs[i], heResurrectable, false)
+						SetEffect(hhs[i], heResurrectable, 0)
 						SetHealth(hhs[i],0)
 					end
 				end			
@@ -501,7 +501,7 @@ function onGearAdd(gear)
 	if GetGearType(gear) == gtHedgehog then
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 	end
 
 end
diff --git a/share/hedgewars/Data/Maps/Eyes/preview.png b/share/hedgewars/Data/Maps/Eyes/preview.png
index f407aa3..2c0539a 100644
Binary files a/share/hedgewars/Data/Maps/Eyes/preview.png and b/share/hedgewars/Data/Maps/Eyes/preview.png differ
diff --git a/share/hedgewars/Data/Maps/Islands/map.png b/share/hedgewars/Data/Maps/Islands/map.png
index e027b2b..437ea2b 100644
Binary files a/share/hedgewars/Data/Maps/Islands/map.png and b/share/hedgewars/Data/Maps/Islands/map.png differ
diff --git a/share/hedgewars/Data/Maps/Knockball/map.lua b/share/hedgewars/Data/Maps/Knockball/map.lua
index 596fbfa..4b586a2 100644
--- a/share/hedgewars/Data/Maps/Knockball/map.lua
+++ b/share/hedgewars/Data/Maps/Knockball/map.lua
@@ -34,7 +34,7 @@ end
 
 function onGearAdd(gear)
 	if GetGearType(gear) == gtShover then
-		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
+		ball = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtBall, 0, 0, 0, 0)
 		if ball ~= nil then
 			local dx, dy = GetGearVelocity(gear)
 			SetGearVelocity(ball, dx * 2, dy * 2)
diff --git a/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt b/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt
index 6537ccc..34fbd65 100644
--- a/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt
+++ b/share/hedgewars/Data/Maps/Mushrooms/CMakeLists.txt
@@ -1,5 +1,6 @@
 install(FILES
 	map.png
+	mask.png
 	map.cfg
 	preview.png
 	DESTINATION ${SHAREPATH}Data/Maps/Mushrooms)
diff --git a/share/hedgewars/Data/Maps/Mushrooms/mask.png b/share/hedgewars/Data/Maps/Mushrooms/mask.png
new file mode 100644
index 0000000..170c746
Binary files /dev/null and b/share/hedgewars/Data/Maps/Mushrooms/mask.png differ
diff --git a/share/hedgewars/Data/Maps/Plane/preview.png b/share/hedgewars/Data/Maps/Plane/preview.png
index 4093e09..8b49450 100644
Binary files a/share/hedgewars/Data/Maps/Plane/preview.png and b/share/hedgewars/Data/Maps/Plane/preview.png differ
diff --git a/share/hedgewars/Data/Maps/Ruler/map.cfg b/share/hedgewars/Data/Maps/Ruler/map.cfg
index 0c785f1..00a322d 100644
--- a/share/hedgewars/Data/Maps/Ruler/map.cfg
+++ b/share/hedgewars/Data/Maps/Ruler/map.cfg
@@ -1 +1,2 @@
 Nature
+12
diff --git a/share/hedgewars/Data/Maps/Trash/map.cfg b/share/hedgewars/Data/Maps/Trash/map.cfg
index 4e60294..eb46162 100644
--- a/share/hedgewars/Data/Maps/Trash/map.cfg
+++ b/share/hedgewars/Data/Maps/Trash/map.cfg
@@ -1 +1 @@
-Nature
\ No newline at end of file
+Compost
diff --git a/share/hedgewars/Data/Maps/TrophyRace/map.lua b/share/hedgewars/Data/Maps/TrophyRace/map.lua
index 4bfd2e7..26f1b1f 100644
--- a/share/hedgewars/Data/Maps/TrophyRace/map.lua
+++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua
@@ -70,19 +70,22 @@ function onAmmoStoreInit()
 	SetAmmo(amRope, 9, 2, 0)
 end
 
-function onGameTick()
-	if TurnTimeLeft == 1 and CurrentHedgehog ~= nil then
+function onGameTick20()
+	if CurrentHedgehog ~= nil and TurnTimeLeft <= 20 and TurnTimeLeft > 0 then
 		SetHealth(CurrentHedgehog, 0)
 		x, y = GetGearPosition(CurrentHedgehog)
-		AddGear(x, y, gtAmmo_Grenade, 0, 0, 0, 0)
+		AddGear(x, y, gtShell, 0, 0, 0, 0)
 		worsttime = 99999
 		worsthog = nil
-	elseif TurnTimeLeft == maxtime - 1 and CurrentHedgehog ~= nil then
+	elseif TurnTimeLeft > maxtime - 25 and CurrentHedgehog ~= nil then
 		if lasthog ~= nil then 
 		SetGearPosition(lasthog, p , 0)
 		end
 		reached = false
+        SetGearVelocity(CurrentHedgehog, 1, 0)
 		SetGearPosition(CurrentHedgehog, start_area[1] + start_area[3] / 2, start_area[2] + start_area[4] / 2)
+        ParseCommand("setweap " .. string.char(amRope))
+		lasthog = CurrentHedgehog
 	elseif CurrentHedgehog ~= nil then
 		x, y = GetGearPosition(CurrentHedgehog)
 		if not reached and x > goal_area[1] and x < goal_area[1] + goal_area[3] and y > goal_area[2] and y < goal_area[2] + goal_area[4] then -- hog is within goal rectangle
@@ -148,15 +151,14 @@ function onGearAdd(gear)
 		hhs[numhhs] = gear
 		times[numhhs] = 0
 		numhhs = numhhs + 1
-	elseif GetGearType(gear) == gtRope then -- rope is shot
-		
 	end
+--	elseif GetGearType(gear) == gtRope then -- rope is shot
 end
 
-function onGearDelete(gear)
-	if GetGearType(gear) == gtRope then -- rope deletion - hog didn't manage to rerope
-		--TurnTimeLeft = 0 -- end turn or not? hm...
-		lasthog = CurrentHedgehog
-		
-	end
-end
+--function onGearDelete(gear)
+--	if GetGearType(gear) == gtRope then -- rope deletion - hog didn't manage to rerope
+--		--TurnTimeLeft = 0 -- end turn or not? hm...
+--		lasthog = CurrentHedgehog
+--		
+--	end
+--end
diff --git a/share/hedgewars/Data/Maps/portal/CMakeLists.txt b/share/hedgewars/Data/Maps/portal/CMakeLists.txt
new file mode 100644
index 0000000..08a3313
--- /dev/null
+++ b/share/hedgewars/Data/Maps/portal/CMakeLists.txt
@@ -0,0 +1,6 @@
+install(FILES
+	map.png
+	mask.png
+	map.cfg
+	preview.png
+	DESTINATION ${SHAREPATH}Data/Maps/portal)
diff --git a/share/hedgewars/Data/Maps/Ropes/map.cfg b/share/hedgewars/Data/Maps/portal/map.cfg
similarity index 100%
copy from share/hedgewars/Data/Maps/Ropes/map.cfg
copy to share/hedgewars/Data/Maps/portal/map.cfg
diff --git a/share/hedgewars/Data/Maps/portal/map.png b/share/hedgewars/Data/Maps/portal/map.png
new file mode 100644
index 0000000..fdaff2b
Binary files /dev/null and b/share/hedgewars/Data/Maps/portal/map.png differ
diff --git a/share/hedgewars/Data/Maps/portal/mask.png b/share/hedgewars/Data/Maps/portal/mask.png
new file mode 100644
index 0000000..ddb4cff
Binary files /dev/null and b/share/hedgewars/Data/Maps/portal/mask.png differ
diff --git a/share/hedgewars/Data/Maps/portal/preview.png b/share/hedgewars/Data/Maps/portal/preview.png
new file mode 100644
index 0000000..c14c27b
Binary files /dev/null and b/share/hedgewars/Data/Maps/portal/preview.png differ
diff --git a/share/hedgewars/Data/Missions/CMakeLists.txt b/share/hedgewars/Data/Missions/CMakeLists.txt
index 73ea96e..9e668b2 100644
--- a/share/hedgewars/Data/Missions/CMakeLists.txt
+++ b/share/hedgewars/Data/Missions/CMakeLists.txt
@@ -1,2 +1,2 @@
 add_subdirectory(Training)
-add_subdirectory(Campaign)
\ No newline at end of file
+add_subdirectory(Campaign)
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt
new file mode 100644
index 0000000..e65af6a
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/CMakeLists.txt	
@@ -0,0 +1,7 @@
+file(GLOB Config *.ini)
+file(GLOB Missions *.lua)
+
+install(FILES
+	${Config}
+	${Missions}
+	DESTINATION "${SHAREPATH}Data/Missions/Campaign/A Classic Fairytale")
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
new file mode 100644
index 0000000..89f9d48
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua	
@@ -0,0 +1,1098 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Constants---------------------------------
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+choiceEliminate = 1
+choiceSpare = 2
+
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+
+spyKillStage = 1
+platformStage = 2
+wave3Stage = 3
+
+tmpVar = 0
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak"), loc("Eagle Eye"), loc("Flaming Worm")}
+
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku", "None", "None"}
+
+nativePos = {{887, 329}, {1050, 288}, {1731, 707},
+             {830, 342}, {1001, 290}, {773, 340},
+             {953, 305}, {347, 648}, {314, 647}}
+
+nativeDir = {"Right", "Left", "Left", 
+             "Right", "Left", "Right", 
+             "Left", "Right", "Right"}
+
+cannibalNames = {loc("Brain Teaser"), loc("Bone Jackson"), loc("Gimme Bones"), 
+                 loc("Hedgibal Lecter"), loc("Bloodpie"), loc("Scalp Muncher"),
+                 loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
+                 loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
+
+cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
+               {3507, 195},  {3612, 1487}, {840, 1757}, 
+               {3056, 1231}, {2981, 1222}, {2785, 1258}}
+
+cannibalDir = {"Left", "Left", "Left",
+               "Left", "Right", "Right",
+               "Left", "Left", "Left"}
+
+cyborgPos = {1369, 574}
+cyborgPos2 = {1308, 148}
+
+deployedPos = {2522, 1365}
+-----------------------------Variables---------------------------------
+natives = {}
+nativeDead = {}
+nativeHidden = {}
+nativeRevived = {}
+nativesNum = 0
+
+cannibals = {}
+cannibalDead = {}
+cannibalHidden = {}
+
+speakerHog = nil
+spyHog = nil
+deployedHog = nil
+deployedDead = false
+
+cyborgHidden = false
+needToAct = 0
+
+m2Choice = 0
+m2DenseDead = 0
+m4DenseDead = 0
+m4BuffaloDead = 0
+m4WaterDead = 0
+m4ChiefDead = 0
+m4LeaksDead = 0
+
+needRevival = false
+gearr = nil
+startElimination = 0
+stage = 0
+choice = 0
+highJumped = false
+TurnsLeft = 0
+startNativesNum = 0
+
+startAnim = {}
+afterChoiceAnim = {}
+wave2Anim = {}
+wave2DeadAnim = {}
+wave3DeadAnim = {}
+
+vCircs = {}
+-----------------------------Animations--------------------------------
+function Wave2Reaction()
+  local i = 1
+  local gearr = nil
+  while nativeDead[i] == true do
+    i = i + 1
+  end
+  gearr = natives[i]
+  if nativeDead[denseNum] ~= true and band(GetState(natives[denseNum]), gstDrowning) == 0 then
+    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
+    AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
+  end
+  if nativeDead[buffaloNum] ~= true and band(GetState(natives[buffaloNum]), gstDrowning) == 0 then
+    AnimInsertStepNext({func = AnimSay, args = {natives[buffaloNum], loc("Let them have a taste of my fury!"), SAY_SHOUT, 6000}}) 
+  end
+  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
+end
+
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {natives[denseNum], 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {natives[denseNum], 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[denseNum], GetX(natives[denseNum]) + dif, GetY(natives[denseNum]) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function SaySafe()
+  local i = 1
+  while gearr == nil do
+    if nativeDead[i] ~= true and nativeHidden[i] ~= true then
+      gearr = natives[i]
+    end
+    i = i + 1
+  end
+  AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("We are indeed."), SAY_SAY, 2500}})
+  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("I think we are safe here."), SAY_SAY, 4000}})
+end
+
+function ReviveNatives()
+  for i = 1, 7 do
+    if nativeHidden[i] == true and nativeDead[i] ~= true then
+      RestoreHog(natives[i])
+      nativeHidden[i] = false
+      nativeRevived[i] = true
+      AnimInsertStepNext({func = AnimOutOfNowhere, args = {natives[i], unpack(nativePos[i])}})
+    end
+  end
+end
+
+function WonderAlive()
+  if nativeRevived[waterNum] == true then
+    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("I'm...alive? How? Why?"), SAY_THINK, 3500}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[waterNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Left"}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[waterNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Right"}})
+  end
+  if nativeRevived[leaksNum] == true and nativeRevived[denseNum] == true then
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("But why would they help us?"), SAY_SAY, 4000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("It must be the aliens!"), SAY_SAY, 3500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("You just appeared out of thin air!"), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("But...we died!"), SAY_SAY, 2500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("This must be the caves!"), SAY_SAY, 3500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Dude, where are we?"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Right"}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Left"}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Right"}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Right"}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Left"}})
+    AnimInsertStepNext({func = AnimWait, args = {natives[leaksNum], 800}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[leaksNum], "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {natives[denseNum], "Right"}})
+    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], natives[girlNum]}}})
+    if nativeDead[chiefNum] ~= true then
+      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
+    end
+  elseif nativeRevived[leaksNum] == true then
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Why would they do this?"), SAY_SAY, 6000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("It must be the aliens' deed."), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("Do not laugh, inexperienced one, for he speaks the truth!"), SAY_SAY, 10000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Yeah, sure! I died. Hillarious!"), SAY_SAY, 6000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("You're...alive!? But we saw you die!"), SAY_SAY, 6000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("???"), SAY_SAY, 2000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Wow, what a dream!"), SAY_SAY, 3000}})
+    if nativeDead[chiefNum] ~= true then
+      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
+    end
+    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], natives[wiseNum]}}})
+    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {natives[leaksNum], gearr}}})
+  elseif nativeRevived[denseNum] == true then
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Dude, that's so cool!"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("It must be the aliens' deed."), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("But that's impossible!"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("It was not a dream, unwise one!"), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Exactly, man! That was my dream."), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("You're...alive!? But we saw you die!"), SAY_SAY,  6000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("???"), SAY_SAY, 2000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Dude, wow! I just had the weirdest high!"), SAY_SAY, 6000}})
+    if nativeDead[chiefNum] ~= true then
+      AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
+    end
+    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[denseNum], CondNeedToTurn, {natives[denseNum], natives[wiseNum]}}})
+    AnimInsertStepNext({func = AnimCustomFunction, swh = false, args = {natives[denseNum], CondNeedToTurn, {natives[denseNum], gearr}}})
+  end
+end
+
+function ExplainAlive()
+  if needRevival == true and m4WaterDead == 1 then
+    RestoreCyborg()
+    AnimSetGearPosition(cyborg, unpack(cyborgPos))
+    AnimInsertStepNext({func = AnimCustomFunction, args = {water, HideCyborg, {}}})
+    AnimInsertStepNext({func = AnimSwitchHog, args = {water}})
+    AnimInsertStepNext({func = AnimSay, args = {cyborg, loc("The answer is...entertaintment. You'll see what I mean."), SAY_SAY, 8000}})
+    AnimInsertStepNext({func = AnimSay, args = {cyborg, loc("You're probably wondering why I bought you back..."), SAY_SAY, 8000}})
+  end
+end
+
+function SpyDebate()
+  if m2Choice == choiceAccepted then
+    spyHog = natives[denseNum]
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 6000}})
+    AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[denseNum], 26}})
+    AnimInsertStepNext({func = AnimVisualGear, args = {natives[wiseNum], GetGearPosition(natives[denseNum]), vgtExplosion, 0, true}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("Here, let me help you!"), SAY_SAY, 3000}})
+    if nativeDead[chiefNum] == true then
+      AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("I forgot that she's the daughter of the chief, too..."), SAY_THINK, 7000}})
+      AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("You killed my father, you monster!"), SAY_SAY, 5000}})
+    end
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Look, I had no choice!"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("You have been giving us out to the enemy, haven't you!"), SAY_SAY, 7000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("You're a pathetic liar!"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Interesting! Last time you said you killed a cannibal!"), SAY_SAY, 7000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("I told you, I just found them."), SAY_SAY, 4500}})
+    AnimInsertStepNext({func = AnimCustomFunction, args = {natives[denseNum], EmitDenseClouds, {"Left"}}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Where did you get the weapons in the forest, Dense Cloud?"), SAY_SAY, 8000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Not now, Fiery Water!"), SAY_SAY, 3000}})
+  else
+    spyHog = natives[waterNum]
+    AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 5000}})
+    AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[waterNum], 26}})
+    AnimInsertStepNext({func = AnimVisualGear, args = {natives[wiseNum], nativePos[denseNum][1] + 50, nativePos[denseNum][2], vgtExplosion, 0, true}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("I can't believe what I'm hearing!"), SAY_SAY, 5500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know what? I don't even regret anything!"), SAY_SAY, 7000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("In fact, you are the only one that's been acting strangely."), SAY_SAY, 8000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("Are you accusing me of something?"), SAY_SAY, 3500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Seems like every time you take a \"walk\", the enemy find us!"), SAY_SAY, 8000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know...taking a stroll."), SAY_SAY, 3500}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Where have you been?!"), SAY_SAY, 3000}})
+  end
+  if nativeRevived[waterNum] == true then
+    AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You won't believe what happened to me!"), SAY_SAY, 5500}})
+  end
+  AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("Hey, guys!"), SAY_SAY, 2000}})
+  AnimInsertStepNext({func = AnimMove, args = {natives[waterNum], "Left", nativePos[denseNum][1] + 50, nativePos[denseNum][2]}})
+  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "back"}})
+  AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Right"}})
+  AnimInsertStepNext({func = AnimMove, args = {natives[waterNum], "Left", 1228, 412}})
+  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
+  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
+  AnimInsertStepNext({func = AnimJump, args = {natives[waterNum], "long"}})
+  AnimInsertStepNext({func = AnimTurn, args = {natives[waterNum], "Left"}})
+  AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("There must be a spy among us!"), SAY_SAY, 4000}})
+  AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("We made sure noone followed us!"), SAY_SAY, 4000}})
+  AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("What? Here? How did they find us?!"), SAY_SAY, 5000}})
+end
+
+function AnimationSetup()
+  table.insert(startAnim, {func = AnimWait, swh = false, args = {natives[leaksNum], 3000}})
+  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], SaySafe, {}}})
+  if needRevival == true then
+    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, ReviveNatives, {}}})
+    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], WonderAlive, {}}})
+    table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, ExplainAlive, {}}})
+  end
+  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], RestoreWave, {1}}})
+  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[1], unpack(cannibalPos[1])}})
+  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[2], unpack(cannibalPos[2])}})
+  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[3], unpack(cannibalPos[3])}})
+  table.insert(startAnim, {func = AnimWait, args = {natives[leaksNum], 1000}})
+  table.insert(startAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], SpyDebate, {}}})
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+end
+
+function SetupWave2Anim()
+  for i = 7, 1, -1 do
+    if nativeDead[i] ~= true then
+      speakerHog = natives[i]
+    end
+  end
+  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[4], unpack(cannibalPos[4])}})
+  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[5], unpack(cannibalPos[5])}})
+  table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[6], unpack(cannibalPos[6])}})
+  table.insert(wave2Anim, {func = AnimSay, args = {speakerHog, loc("Look out! There's more of them!"), SAY_SHOUT, 5000}})
+  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
+end
+
+function PutCircles()
+  if circlesPut then
+    return
+  end
+  vCircs[1] = AddVisualGear(0,0,vgtCircle,0,true)
+  vCircs[2] = AddVisualGear(0,0,vgtCircle,0,true)
+  vCircs[3] = AddVisualGear(0,0,vgtCircle,0,true)
+  SetVisualGearValues(vCircs[1], cannibalPos[7][1], cannibalPos[7][2], 100, 255, 1, 10, 0, 120, 3, 0xff00ffff)
+  SetVisualGearValues(vCircs[2], cannibalPos[8][1], cannibalPos[8][2], 100, 255, 1, 10, 0, 120, 3, 0xff00ffff)
+  SetVisualGearValues(vCircs[3], cannibalPos[9][1], cannibalPos[9][2], 100, 255, 1, 10, 0, 120, 3, 0xff00ffff)
+  circlesPut = true
+end
+
+function SetupWave2DeadAnim()
+  for i = 7, 1, -1 do
+    if nativeDead[i] ~= true then
+      deployedHog = natives[i]
+    end
+  end
+  if nativeDead[wiseNum] ~= true and band(GetState(natives[wiseNum]), gstDrowning) == 0 then
+    if nativesNum > 1 then
+      table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("What a strange feeling!"), SAY_THINK, 3000}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I need to warn the others."), SAY_THINK, 3000}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("If only I had a way..."), SAY_THINK, 3000}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TeleportNatives, {}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TurnNatives, {natives[wiseNum]}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], CondNeedToTurn, {natives[wiseNum], deployedHog}}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading our way!"), SAY_SAY, 6500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I feel something...a place! They will arrive near the circles!"), SAY_SAY, 7500}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], PutCircles, {}}})
+      table.insert(wave2DeadAnim, {func = AnimFollowGear, swh = false, args = {vCircs[1]}})
+      table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("We need to prevent their arrival!"), SAY_SAY, 4500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Go, quick!"), SAY_SAY, 2500}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], DeployHog, {}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
+      table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
+      table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
+      table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
+      table.insert(wave2DeadAnim, {func = AnimDisappear, args = {cyborg, 0, 0}})
+--      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, DeployHog, {}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
+    else
+      table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("What a strange feeling!"), SAY_THINK, 3000}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading my way!"), SAY_THINK, 6500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I feel something...a place! They will arrive near the circles!"), SAY_SAY, 7500}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], PutCircles, {}}})
+      table.insert(wave2DeadAnim, {func = AnimFollowGear, swh = false, args = {vCircs[1]}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I need to prevent their arrival!"), SAY_THINK, 4500}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("If only I had a way..."), SAY_THINK, 3000}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
+    end
+  else
+    table.insert(wave2DeadAnim, {func = AnimWait, args = {cyborg, 1500}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, RestoreCyborg, {}}})
+    table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
+    table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TeleportNatives, {}}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TurnNatives, {cyborg}}})
+    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("Oh, my! This is even more entertaining than I've expected!"), SAY_SAY, 7500}})
+    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("You might want to find a way to instantly kill arriving cannibals!"), SAY_SAY, 8000}})
+    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I believe there's more of them."), SAY_SAY, 4000}})
+    table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I marked the place of their arrival. You're welcome!"), SAY_SAY, 6000}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], PutCircles, {}}})
+    table.insert(wave2DeadAnim, {func = AnimFollowGear, swh = false, args = {vCircs[1]}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {deployedHog, DeployHog, {}}})
+    if nativesNum > 1 then
+--      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
+--      table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
+--      table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
+      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
+      table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
+    end
+    table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
+    table.insert(wave2DeadAnim, {func = AnimDisappear, swh = false, args = {cyborg, 0, 0}})
+    table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
+  end
+  AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
+end
+
+function IsolateNatives()
+  PlaceGirder(710, 299, 6)
+  PlaceGirder(690, 299, 6)
+  PlaceGirder(761, 209, 4)
+  PlaceGirder(921, 209, 4)
+  PlaceGirder(1081, 209, 4)
+  PlaceGirder(761, 189, 4)
+  PlaceGirder(921, 189, 4)
+  PlaceGirder(1081, 189, 4)
+  PlaceGirder(761, 169, 4)
+  PlaceGirder(921, 169, 4)
+  PlaceGirder(1081, 169, 4)
+  PlaceGirder(761, 149, 4)
+  PlaceGirder(921, 149, 4)
+  PlaceGirder(1081, 149, 4)
+  PlaceGirder(761, 129, 4)
+  PlaceGirder(921, 129, 4)
+  PlaceGirder(1081, 129, 4)
+  PlaceGirder(1120, 261, 2)
+  PlaceGirder(1140, 261, 2)
+  PlaceGirder(1160, 261, 2)
+  AddAmmo(deployedHog, amDEagle, 0)
+  AddAmmo(deployedHog, amFirePunch, 0)
+end
+
+function PutCGI()
+  AddVisualGear(710, 299, vgtExplosion, 0, true)
+  AddVisualGear(690, 299, vgtExplosion, 0, true)
+  AddVisualGear(761, 209, vgtExplosion, 0, true)
+  AddVisualGear(921, 209, vgtExplosion, 0, true)
+  AddVisualGear(1081, 209, vgtExplosion, 0, true)
+  AddVisualGear(761, 189, vgtExplosion, 0, true)
+  AddVisualGear(921, 189, vgtExplosion, 0, true)
+  AddVisualGear(1081, 189, vgtExplosion, 0, true)
+  AddVisualGear(761, 169, vgtExplosion, 0, true)
+  AddVisualGear(921, 169, vgtExplosion, 0, true)
+  AddVisualGear(1081, 169, vgtExplosion, 0, true)
+  AddVisualGear(761, 149, vgtExplosion, 0, true)
+  AddVisualGear(921, 149, vgtExplosion, 0, true)
+  AddVisualGear(1081, 149, vgtExplosion, 0, true)
+  AddVisualGear(761, 129, vgtExplosion, 0, true)
+  AddVisualGear(921, 129, vgtExplosion, 0, true)
+  AddVisualGear(1081, 129, vgtExplosion, 0, true)
+  AddVisualGear(1120, 261, vgtExplosion, 0, true)
+  AddVisualGear(1140, 261, vgtExplosion, 0, true)
+  AddVisualGear(1160, 261, vgtExplosion, 0, true)
+end
+
+function TeleportNatives()
+  nativePos[waterNum] = {1100, 288}
+  for i = 1, 7 do
+    if nativeDead[i] ~= true then 
+      AnimTeleportGear(natives[i], unpack(nativePos[i]))
+    end
+  end
+end
+
+function TurnNatives(hog)
+  for i = 1, 7 do
+    if nativeDead[i] == false then
+      if GetX(natives[i]) < GetX(hog) then
+        AnimTurn(natives[i], "Right")
+      else
+        AnimTurn(natives[i], "Left")
+      end
+    end
+  end
+end
+
+function DeployHog()
+  AnimSwitchHog(deployedHog)
+  AnimTeleportGear(deployedHog, unpack(deployedPos))
+  if deployedHog ~= natives[wiseNum] then
+    AnimSay(deployedHog, loc("Why me?!"), SAY_THINK, 2000)
+  end
+end
+
+function SetupAfterChoiceAnim()
+  for i = 7, 1, -1 do
+    if nativeDead[i] ~= true then
+      if natives[i] ~= spyHog then
+        speakerHog = natives[i]
+      end
+    end
+  end
+  if choice == choiceEliminate then
+    table.insert(afterChoiceAnim, {func = AnimWait, args = {speakerHog, 1500}})
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("He won't be selling us out anymore!"), SAY_SAY, 6000}})
+    if nativeDead[girlNum] ~= true and m4ChiefDead == 1 then
+      table.insert(afterChoiceAnim, {func = AnimSay, args = {natives[girlNum], loc("That's for my father!"), SAY_SAY, 3500}})
+    end
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("Let's show those cannibals what we're made of!"), SAY_SAY, 7000}})
+  else
+    table.insert(afterChoiceAnim, {func = AnimCustomFunction, swh = false, args = {natives[leaksNum], CondNeedToTurn, {speakerHog, spyHog}}})
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("We'll spare your life for now!"), SAY_SAY, 4500}})
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {spyHog, loc("May the spirits aid you in all your quests!"), SAY_SAY, 7000}})
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("I just don't want to sink to your level."), SAY_SAY, 6000}})
+    table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("Let's show those cannibals what we're made of!"), SAY_SAY, 7000}})
+  end
+  table.insert(afterChoiceAnim, {func = AnimSay, args = {natives[8], loc("Let us help, too!"), SAY_SAY, 3000}})
+  table.insert(afterChoiceAnim, {func = AnimTurn, args = {speakerHog, "Left", SAY_SAY, 7000}})
+  table.insert(afterChoiceAnim, {func = AnimSay, args = {speakerHog, loc("No. You and the rest of the tribe are safer there!"), SAY_SAY, 7000}})
+  AddSkipFunction(afterChoiceAnim, SkipAfterChoiceAnim, {})
+end
+
+function SetupHogDeadAnim(gear)
+  hogDeadAnim = {}
+  if nativesNum == 0 then
+    return
+  end
+  local hogDeadStrings = {loc("They killed ") .. gear .. loc("! You bastards!"), 
+                          gear .. loc("! Why?!"), 
+                          loc("That was just mean!"), 
+                          loc("Oh no, not ") .. gear .. "!",
+                          loc("Why ") .. gear .. loc("? Why?"),
+                          loc("What has ") .. gear .. loc(" ever done to you?!")}
+  table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[7 - nativesNum], SAY_SHOUT, 4000}})
+end
+
+function AfterHogDeadAnim()
+  freshDead = nil
+  TurnTimeLeft = TurnTime
+end
+
+--------------------------Anim skip functions--------------------------
+
+function AfterAfterChoiceAnim()
+  stage = 0
+  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
+  AddAmmo(speakerHog, amSwitch, 100)
+  SetGearMessage(speakerHog, 0)
+  SetState(speakerHog, 0)
+  TurnTimeLeft = -1
+  ShowMission(loc("Backstab"), loc("The food bites back"), loc("Defeat the cannibals"), 1, 4000)
+  SpawnCrates()
+end
+
+function SkipAfterChoiceAnim()
+  SetGearMessage(CurrentHedgehog, 0)
+  AnimSwitchHog(speakerHog)
+end
+
+function AfterWave2Anim()
+  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
+  SetGearMessage(CurrentHedgehog, 0)
+  SetState(CurrentHedgehog, 0)
+  SpawnCrates()
+  TurnTimeLeft = TurnTime
+end
+
+function SkipWave2DeadAnim()
+  TeleportNatives()
+  IsolateNatives()
+  DeployHog()
+  HideCyborg()
+  PutCircles()
+end
+
+function SpawnPlatformCrates()
+  SpawnAmmoCrate(2494, 1262, amMine)
+  SpawnAmmoCrate(2574, 1279, amSMine)
+  SpawnAmmoCrate(2575, 1267, amMine)
+  SpawnAmmoCrate(2617, 1259, amSMine)
+  SpawnUtilityCrate(2579, 1254, amMine)
+  SpawnUtilityCrate(2478, 1243, amMine)
+end
+
+function AfterWave2DeadAnim()
+  TurnsLeft = 7
+  stage = platformStage
+  SpawnPlatformCrates()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
+  AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
+  AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
+  TurnTimeLeft = 0
+  ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."), 1, 12000)
+end
+
+function DoTurnsOver()
+  stage = wave3Stage
+  RestoreWave(3)
+end
+
+function SkipWave2Anim()
+  AnimSwitchHog(speakerHog)
+end
+
+function SkipStartAnim()
+  AnimSetGearPosition(natives[waterNum], nativePos[denseNum][1] + 50, nativePos[denseNum][2])
+  RestoreWave(1)
+  ReviveNatives()
+  SetGearMessage(CurrentHedgehog, 0)
+  SetState(CurrentHedgehog, 0)
+  if m2Choice == choiceAccepted then
+    spyHog = natives[denseNum]
+  else
+    spyHog = natives[waterNum]
+  end
+  SetHealth(spyHog, 26)
+end
+
+function AfterStartAnim()
+  AnimSwitchHog(natives[leaksNum])
+  TurnTimeLeft = 0
+  stage = spyKillStage
+  AddEvent(CheckChoice, {}, DoChoice, {}, 0)
+  AddEvent(CheckKilledOther, {}, DoKilledOther, {}, 0)
+  AddEvent(CheckChoiceRefuse, {}, DoChoiceRefuse, {}, 0)
+  ShowMission(loc("Backstab"), loc("Judas"), loc("Kill the traitor...or spare his life!|Kill him or press [Precise]!"), 1, 8000)
+end
+
+-----------------------------Events------------------------------------
+function CheckTurnsOver()
+  return TurnsLeft == 0
+end
+
+function CheckDeployedDead()
+  return deployedDead
+end
+
+function DoDeployedDead()
+  ShowMission(loc("Backstab"), loc("Brutus"), loc("You have failed to save the tribe!"), 0, 6000)
+  ParseCommand("teamgone " .. loc("Natives"))
+  ParseCommand("teamgone " .. loc("Tribe"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckChoice()
+  return choice ~= 0 and tmpVar == 0
+end
+
+function CheckDeaths()
+  for i = 1, 7 do
+    if natives[i] ~= spyHog and band(GetState(natives[i]), gstAttacked) ~= 0 then
+      return true
+    end
+  end
+  return false
+end
+
+function DoChoice()
+  RemoveEventFunc(CheckChoiceRefuse)
+  SetGearMessage(CurrentHedgehog, 0)
+  SetupAfterChoiceAnim()
+  AddAnim(afterChoiceAnim)
+  AddFunction({func = AfterAfterChoiceAnim, args = {}})
+end
+
+function CheckChoiceRefuse()
+  return highJumped == true and StoppedGear(CurrentHedgehog)
+end
+
+function DoChoiceRefuse()
+  choice = choiceSpare
+end
+
+function CheckKilledOther()
+  if stage ~= spyKillStage then
+    return false
+  end
+  return (nativesNum < startNativesNum and choice ~= choiceEliminate) or
+          (nativesNum < startNativesNum - 1 and choice == choiceEliminate)
+end
+
+function DoKilledOther()
+  ShowMission(loc("Backstab"), loc("Brutus"), loc("You have killed an innocent hedgehog!"), 0, 6000)
+  ParseCommand("teamgone " .. loc("Natives"))
+  ParseCommand("teamgone " .. loc("Tribe"))
+  TurnTimeLeft = 0
+end
+
+function CheckWaveDead(index)
+  for i = (index - 1) * 3 + 1, index * 3 do
+    if cannibalDead[i] ~= true or CurrentHedgehog == cannibals[i] then
+      return false
+    end
+  end
+  return true
+end
+
+function DoWaveDead(index)
+  TurnTimeLeft = 0
+  needToAct = index
+end
+
+function AddWave3DeadAnim()
+  AnimSwitchHog(deployedHog)
+  AnimWait(deployedHog, 1)
+  AddFunction({func = HideNatives, args = {}})
+  AddFunction({func = SetupWave3DeadAnim, args = {}})
+  AddFunction({func = AddAnim, args = {wave3DeadAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterWave3DeadAnim, args = {}}}})
+end
+
+function HideNatives()
+  for i = 1, 9 do
+    if nativeDead[i] ~= true and natives[i] ~= deployedHog then
+      if nativeHidden[i] ~= true then
+        HideHog(natives[i])
+        nativeHidden[i] = true
+      end
+    end
+  end
+end
+
+function SetupWave3DeadAnim()
+  table.insert(wave3DeadAnim, {func = AnimTurn, args = {deployedHog, "Left"}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("That ought to show them!"), SAY_SAY, 4000}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("Guys, do you think there's more of them?"), SAY_SHOUT, 7000}})
+  table.insert(wave3DeadAnim, {func = AnimVisualGear, args = {deployedHog, unpack(nativePos[wiseNum]), vgtFeather, 0, true, true}})
+  table.insert(wave3DeadAnim, {func = AnimWait, args = {deployedHog, 1000}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("Where are they?!"), SAY_THINK, 3000}})
+  table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, RestoreCyborg, {}}})
+  table.insert(wave3DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, 4040, 782}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {cyborg, loc("These primitive people are so funny!"), SAY_THINK, 6500}})
+  table.insert(wave3DeadAnim, {func = AnimMove, args = {cyborg, "Right", 4060, 0}})
+  table.insert(wave3DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
+  table.insert(wave3DeadAnim, {func = AnimWait, args = {deployedHog, 1}})
+  table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, HideCyborg, {}}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I need to find the others!"), SAY_THINK, 4500}})
+  table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I have to follow that alien."), SAY_THINK, 4500}})
+end
+
+function SkipWave3DeadAnim()
+  AnimSwitchHog(deployedHog)
+end
+
+function AfterWave3DeadAnim()
+  if nativeDead[leaksNum] == true then
+    SaveCampaignVar("M5LeaksDead", "1")
+  else
+    SaveCampaignVar("M5LeaksDead", "0")
+  end
+  if nativeDead[denseNum] == true then
+    SaveCampaignVar("M5DenseDead", "1")
+  else
+    SaveCampaignVar("M5DenseDead", "0")
+  end
+  if nativeDead[waterNum] == true then
+    SaveCampaignVar("M5WaterDead", "1")
+  else
+    SaveCampaignVar("M5WaterDead", "0")
+  end
+  if nativeDead[buffaloNum] == true then
+    SaveCampaignVar("M5BuffaloDead", "1")
+  else
+    SaveCampaignVar("M5BuffaloDead", "0")
+  end
+  if nativeDead[girlNum] == true then
+    SaveCampaignVar("M5GirlDead", "1")
+  else
+    SaveCampaignVar("M5GirlDead", "0")
+  end
+  if nativeDead[wiseNum] == true then
+    SaveCampaignVar("M5WiseDead", "1")
+  else
+    SaveCampaignVar("M5WiseDead", "0")
+  end
+  if nativeDead[chiefNum] == true then
+    SaveCampaignVar("M5ChiefDead", "1")
+  else
+    SaveCampaignVar("M5ChiefDead", "0")
+  end
+  SaveCampaignVar("M5Choice", "" .. choice)
+  SaveCampaignVar("Progress", "5")
+
+  for i = 1, 7 do 
+    if natives[i] == deployedHog then
+      SaveCampaignVar("M5DeployedNum", "" .. i)
+    end
+  end
+
+  ParseCommand("teamgone " .. loc("Tribe"))
+  ParseCommand("teamgone " .. loc("Assault Team"))
+  ParseCommand("teamgone " .. loc("Reinforcements"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+-----------------------------Misc--------------------------------------
+
+function SpawnCrates()
+  SpawnAmmoCrate(0, 0, amDrill)
+  SpawnAmmoCrate(0, 0, amGrenade)
+  SpawnAmmoCrate(0, 0, amBazooka)
+  SpawnAmmoCrate(0, 0, amDynamite)
+  SpawnAmmoCrate(0, 0, amGrenade)
+  SpawnAmmoCrate(0, 0, amMine)
+  SpawnAmmoCrate(0, 0, amShotgun)
+  SpawnAmmoCrate(0, 0, amFlamethrower)
+  SpawnAmmoCrate(0, 0, amMolotov)
+  SpawnAmmoCrate(0, 0, amSMine)
+  SpawnAmmoCrate(0, 0, amMortar)
+  SpawnUtilityCrate(0, 0, amRope)
+  SpawnUtilityCrate(0, 0, amRope)
+  SpawnUtilityCrate(0, 0, amParachute)
+  SpawnUtilityCrate(0, 0, amParachute)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+end
+
+
+function RestoreWave(index)
+  for i = (index - 1) * 3 + 1, index * 3 do
+    if cannibalHidden[i] == true then
+      RestoreHog(cannibals[i])
+      AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+      FollowGear(cannibals[i])
+      cannibalHidden[i] = false
+    end
+  end
+end
+
+function GetVariables()
+  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+  m4DenseDead = tonumber(GetCampaignVar("M4DenseDead"))
+  m4LeaksDead = tonumber(GetCampaignVar("M4LeaksDead"))
+  m4ChiefDead = tonumber(GetCampaignVar("M4ChiefDead"))
+  m4WaterDead = tonumber(GetCampaignVar("M4WaterDead"))
+  m4BuffaloDead = tonumber(GetCampaignVar("M4BuffaloDead"))
+end
+
+function HideCyborg()
+  if cyborgHidden == false then
+    HideHog(cyborg)
+    cyborgHidden = true
+  end
+end
+
+function RestoreCyborg()
+  if cyborgHidden == true then
+    RestoreHog(cyborg)
+    cyborgHidden = false
+  end
+end
+
+function SetupPlace()
+  startNativesNum = nativesNum
+  HideHog(cyborg)
+  cyborgHidden = true
+  for i = 1, 9 do
+    HideHog(cannibals[i])
+    cannibalHidden[i] = true
+  end
+  if m4LeaksDead == 1 then
+    HideHog(natives[leaksNum])
+    nativeHidden[leaksNum] = true
+    needRevival = true
+  end
+  if m4DenseDead == 1 then
+    if m2Choice ~= choiceAccepted then
+      DeleteGear(natives[denseNum])
+      startNativesNum = startNativesNum - 1
+      nativeDead[denseNum] = true
+    else
+      HideHog(natives[denseNum])
+      nativeHidden[denseNum] = true
+      needRevival = true
+    end
+  end
+  if m4WaterDead == 1 then
+    HideHog(natives[waterNum])
+    nativeHidden[waterNum] = true
+    needRevival = true
+  end
+  if m4ChiefDead == 1 then
+    DeleteGear(natives[chiefNum])
+    startNativesNum = startNativesNum - 1
+    nativeDead[chiefNum] = true
+    AnimSetGearPosition(natives[girlNum], unpack(nativePos[buffaloNum]))
+    nativePos[girlNum] = nativePos[buffaloNum]
+  end
+  if m4BuffaloDead == 1 then
+    startNativesNum = startNativesNum - 1
+    nativeDead[buffaloNum] = true
+    DeleteGear(natives[buffaloNum])
+  end
+  PlaceGirder(3568, 1461, 1)
+  PlaceGirder(440, 523, 5)
+  PlaceGirder(350, 441, 1)
+  PlaceGirder(405, 553, 5)
+  PlaceGirder(316, 468, 1)
+  PlaceGirder(1319, 168, 0)
+end
+
+function SetupAmmo()
+  AddAmmo(natives[girlNum], amSwitch, 0)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 1, 7 do
+    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+  end
+  nativesNum = 7
+
+  AddTeam(loc("Tribe"), 29438, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 8, 9 do
+    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+  end
+
+
+  AddTeam(loc("Assault Team"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
+  for i = 1, 6 do
+    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
+  end
+
+  AddTeam(loc("Reinforcements"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
+  for i = 7, 9 do
+    cannibals[i] = AddHog(cannibalNames[i], 1, 50, "vampirichog")
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+
+  for i = 1, 9 do
+    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
+    AnimTurn(natives[i], nativeDir[i])
+  end
+
+  AnimSetGearPosition(cyborg, 0, 0)
+
+  for i = 1, 9 do
+    AnimSetGearPosition(cannibals[i], cannibalPos[i][1], cannibalPos[i][2] + 40)
+    AnimTurn(cannibals[i], cannibalDir[i])
+  end
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 2
+	GameFlags = gfSolidLand
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+  Map = "Cave"
+	Theme = "Nature"
+  SuddenDeathTurns = 3000
+
+  AddHogs()
+  AnimInit()
+end
+
+function onGameStart()
+  GetVariables()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  for i = 1, 7 do
+    if gear == natives[i] then
+      if nativeDead[i] ~= true then
+        freshDead = nativeNames[i]
+      end
+      nativeDead[i] = true
+      nativesNum = nativesNum - 1
+    end
+  end
+
+  for i = 1, 9 do
+    if gear == cannibals[i] then
+      cannibalDead[i] = true
+    end
+  end
+
+  if gear == spyHog and stage == spyKillStage then
+    freshDead = nil
+    choice = choiceEliminate
+    tmpVar = 1
+  end
+
+  if gear == deployedHog then
+    deployedDead = true
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amSniperRifle, 4, 0, 0, 0)
+  SetAmmo(amFirePunch, 9, 0, 0, 0)
+  SetAmmo(amWhip, 9, 0, 0, 0)
+  SetAmmo(amBaseballBat, 9, 0, 0, 0)
+  SetAmmo(amHammer, 9, 0, 0, 0)
+  SetAmmo(amLandGun, 9, 0, 0, 0)
+  SetAmmo(amSnowball, 8, 0, 0, 0)
+  SetAmmo(amGirder, 4, 0, 0, 2)
+  SetAmmo(amParachute, 4, 0, 0, 2)
+  SetAmmo(amSwitch, 8, 0, 0, 2)
+  SetAmmo(amSkip, 8, 0, 0, 0)
+  SetAmmo(amRope, 5, 0, 0, 3)
+  SetAmmo(amBlowTorch, 3, 0, 0, 3)
+  SetAmmo(amPickHammer, 0, 0, 0, 3)
+  SetAmmo(amLowGravity, 0, 0, 0, 2)
+  SetAmmo(amDynamite, 0, 0, 0, 3)
+  SetAmmo(amBazooka, 4, 0, 0, 4)
+  SetAmmo(amGrenade, 4, 0, 0, 4)
+  SetAmmo(amMine, 2, 0, 0, 2)
+  SetAmmo(amSMine, 2, 0, 0, 2)
+  SetAmmo(amMolotov, 2, 0, 0, 3)
+  SetAmmo(amFlamethrower, 2, 0, 0, 3)
+  SetAmmo(amShotgun, 4, 0, 0, 4)
+  SetAmmo(amTeleport, 0, 0, 0, 2)
+  SetAmmo(amDrill, 0, 0, 0, 4)
+  SetAmmo(amMortar, 0, 0, 0, 4)
+end
+
+j = 0
+
+function onNewTurn()
+  tmpVar = 0
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+
+  if GetHogTeamName(CurrentHedgehog) == loc("Tribe") then
+    TurnTimeLeft = 0
+    return
+  end
+  TurnsLeft = TurnsLeft - 1
+  
+  if stage == platformStage then
+    AddCaption(TurnsLeft .. " turns until arrival!")
+  end
+
+  if stage == spyKillStage then
+    if CurrentHedgehog == spyHog or GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
+      TurnTimeLeft = 0
+    else
+      SetGearMessage(CurrentHedgehog, 0)
+      --AnimSwitchHog(natives[leaksNum])
+      TurnTimeLeft = -1
+    end
+  else
+    if freshDead ~= nil and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+      SetupHogDeadAnim(freshDead)
+      AddAnim(hogDeadAnim)
+      AddFunction({func = AfterHogDeadAnim, args = {}})
+    end
+  end
+  if needToAct > 0 then
+    if needToAct == 1 then
+      RestoreWave(2)
+      SetupWave2Anim()
+      AddAnim(wave2Anim)
+      AddFunction({func = AfterWave2Anim, args = {}})
+    elseif needToAct == 2 then
+      SetupWave2DeadAnim()
+      AddAnim(wave2DeadAnim)
+      AddFunction({func = AfterWave2DeadAnim, args = {}})
+    elseif needToAct == 3 then
+      AnimSwitchHog(deployedHog)
+      AddFunction({func = AddWave3DeadAnim, args = {}})
+    end
+    needToAct = 0
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+    return
+  end
+  if stage == spyKillStage then
+    highJumped = true
+  end
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/campaign.ini b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/campaign.ini
new file mode 100644
index 0000000..c86c7b9
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/campaign.ini	
@@ -0,0 +1,42 @@
+MissionNum=10
+ResetRetry=1
+
+[Mission 1]
+Name=First Blood
+Script=first_blood.lua
+
+[Mission 2]
+Name=The Shadow Falls
+Script=shadow.lua
+
+[Mission 3]
+Name=The Journey Back
+Script=journey.lua
+
+[Mission 4]
+Name=United We Stand
+Script=united.lua
+
+[Mission 5]
+Name=Backstab
+Script=backstab.lua
+
+[Mission 6]
+Name=Dragon's Lair
+Script=dragon.lua
+
+[Mission 7]
+Name=Family Reunion
+Script=family.lua
+
+[Mission 8]
+Name=Long Live The Queen
+Script=queen.lua
+
+[Mission 9]
+Name=The Enemy Of My Enemy
+Script=enemy.lua
+
+[Mission 10]
+Name=Epilogue
+Script=epil.lua
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua
new file mode 100644
index 0000000..f4944d0
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/dragon.lua	
@@ -0,0 +1,648 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Map--------------------------------------
+local map = 
+{
+	"\0\91\4\253\131\0\88\0\46\0\0\91\0\49\131\15\196\0\53\0\15\196\0\53\131\15\196\4\250\0\255\242\7\179\131\1\128\7\214\0",
+	"\1\113\7\207\131\3\182\7\157\0\3\175\7\143\131\6\58\7\200\0\6\76\7\193\131\6\188\7\129\0\6\188\7\129\131\6\248\6\216\0",
+	"\6\248\6\216\131\7\52\8\14\0\10\206\8\0\131\11\203\6\65\0\11\203\6\65\131\12\18\7\66\0\12\18\7\69\131\16\0\7\69\0",
+	"\0\109\1\1\131\2\111\0\49\0\2\111\0\49\131\3\133\1\18\0\3\140\1\18\131\4\162\0\165\0\4\162\0\165\131\5\135\1\29\0",
+	"\5\145\1\22\131\8\84\0\232\0\8\84\0\232\131\9\26\0\70\0\9\26\0\70\131\10\5\1\4\0\10\48\0\243\131\10\2\1\8\0",
+	"\10\58\0\243\131\10\118\1\15\0\10\118\1\15\131\10\234\1\173\0\11\10\1\177\131\12\11\1\22\0\12\39\1\40\131\12\243\2\9\0",
+	"\12\243\2\9\131\13\106\0\165\0\13\131\0\176\131\15\186\1\78\0\1\244\0\81\136\0\120\0\84\0\1\99\0\123\137\0\130\0\215\0",
+	"\0\158\0\130\143\0\158\0\130\0\2\216\0\88\138\4\165\0\102\0\4\91\0\127\142\3\129\0\197\0\3\69\0\134\142\3\69\0\134\0",
+	"\4\215\0\120\143\8\88\0\134\0\8\187\0\84\139\8\187\0\84\0\8\239\0\70\135\8\239\0\70\0\8\60\0\187\138\5\99\0\222\0",
+	"\5\61\0\197\138\5\61\0\197\0\9\99\0\81\137\10\23\0\218\0\9\187\0\77\137\11\31\1\117\0\10\30\0\88\137\15\161\0\109\0",
+	"\15\126\0\225\144\13\177\0\116\0\15\150\0\144\139\15\157\1\26\0\10\202\0\169\152\12\246\0\169\0\10\72\0\144\145\11\122\1\36\0",
+	"\11\17\1\121\141\11\17\1\121\0\12\229\1\194\138\12\229\1\194\0\12\208\1\85\150\12\208\1\85\0\12\148\1\15\147\12\148\1\15\0",
+	"\13\145\0\208\147\13\145\0\208\0\6\238\7\45\135\7\10\7\238\0\6\220\7\150\135\6\206\7\242\0\6\174\7\175\135\6\135\8\7\0",
+	"\6\118\7\214\135\6\62\7\238\0\6\30\7\245\140\3\217\7\210\0\3\161\7\221\138\255\252\7\231\0\15\242\7\165\148\11\115\7\175\0",
+	"\11\196\6\164\138\11\10\8\4\0\11\210\7\31\141\11\210\7\31\0\14\216\2\72\166\14\216\2\72\0\14\213\4\4\166\14\213\4\4\0",
+	"\13\216\1\159\148\13\216\1\159\0\13\159\2\143\148\13\159\2\143\0\13\230\3\69\145\13\230\3\69\0\13\163\4\11\145\13\166\4\11\0",
+	"\13\237\4\208\145\13\237\4\208\0\14\195\5\61\145\14\195\5\61\0\13\78\1\254\136\13\78\1\254\0\12\239\2\93\136\12\239\2\93\0",
+	"\12\250\2\227\136\12\250\2\227\0\13\71\3\59\136\13\71\3\59\0\13\1\3\168\136\13\1\3\168\0\12\243\4\32\136\12\246\4\32\0",
+	"\13\40\4\130\136\13\43\4\134\0\13\92\4\243\136\13\92\4\243\0\13\142\5\135\136\13\142\5\135\0\14\33\5\106\136\14\33\5\106\0",
+	"\14\111\5\208\136\14\121\5\216\0\15\13\5\237\136\15\13\5\237\0\15\73\5\128\136\15\73\5\128\0\15\84\4\243\136\15\84\4\243\0",
+	"\14\199\6\33\133\14\199\6\33\0\14\97\6\44\133\14\83\6\44\0\14\9\5\240\133\14\9\5\240\0\13\226\5\163\133\13\226\5\163\0",
+	"\13\170\5\233\133\13\170\5\233\0\13\71\5\205\133\13\71\5\205\0\13\61\5\117\133\13\61\5\117\0\13\22\5\40\133\13\22\5\40\0",
+	"\12\253\4\211\133\12\253\4\211\0\12\197\4\169\133\12\197\4\169\0\12\204\4\106\133\12\204\4\106\0\12\162\4\46\133\12\162\4\42\0",
+	"\12\194\3\200\133\12\194\3\196\0\12\201\3\84\133\12\201\3\84\0\12\253\3\62\133\12\253\3\62\0\12\169\2\241\133\12\169\2\241\0",
+	"\12\187\2\167\133\12\187\2\167\0\12\158\2\93\133\12\158\2\93\0\12\162\2\9\133\12\162\2\9\0\12\123\1\205\132\12\123\1\205\0",
+	"\12\84\1\251\132\12\84\1\251\0\12\91\2\55\132\12\95\2\55\0\12\63\2\139\132\12\63\2\139\0\12\120\2\164\132\12\120\2\164\0",
+	"\12\81\2\206\132\12\81\2\206\0\12\106\3\17\132\12\109\3\20\0\12\137\3\73\132\12\137\3\73\0\12\84\3\122\132\12\84\3\122\0",
+	"\12\137\3\150\132\12\137\3\150\0\12\95\3\217\132\12\95\3\217\0\12\134\3\231\132\12\134\3\231\0\12\106\4\63\132\12\106\4\63\0",
+	"\12\137\4\120\132\12\141\4\120\0\12\88\4\179\132\12\88\4\183\0\12\134\4\190\132\12\134\4\190\0\12\158\4\232\132\12\165\4\232\0",
+	"\12\215\5\15\132\12\215\5\15\0\12\91\4\243\130\12\91\4\243\0\12\144\5\26\130\12\144\5\26\0\12\176\5\54\130\12\176\5\54\0",
+	"\12\225\5\82\130\12\225\5\82\0\13\4\5\117\130\13\1\5\117\0\12\239\5\166\130\12\239\5\166\0\13\8\5\184\130\13\11\5\184\0",
+	"\13\8\5\226\130\13\8\5\226\0\13\54\6\12\130\13\57\6\12\0\13\106\6\2\130\13\106\5\254\0\13\138\6\12\130\13\138\6\12\0",
+	"\13\184\6\30\130\13\187\6\30\0\13\223\5\254\130\13\223\5\254\0\13\149\6\69\130\13\145\6\69\0\13\128\6\33\130\13\128\6\33\0",
+	"\13\85\6\40\130\13\85\6\40\0\12\232\6\2\130\12\232\6\2\0\12\204\5\205\130\12\204\5\201\0\12\183\5\159\130\12\183\5\156\0",
+	"\12\211\5\128\130\12\211\5\128\0\12\165\5\103\130\12\165\5\103\0\12\123\5\64\130\12\120\5\64\0\12\81\5\71\130\12\81\5\71\0",
+	"\12\84\5\18\130\12\84\5\18\0\12\39\4\243\130\12\39\4\243\0\12\35\4\194\130\12\35\4\194\0\12\63\4\127\130\12\63\4\127\0",
+	"\12\91\4\106\130\12\91\4\106\0\12\53\4\60\130\12\53\4\60\0\12\74\4\25\130\12\84\4\21\0\12\120\4\4\130\12\120\4\4\0",
+	"\12\42\3\231\130\12\42\3\231\0\12\39\3\189\130\12\42\3\186\0\12\60\3\175\130\12\60\3\175\0\12\39\3\133\130\12\39\3\133\0",
+	"\12\70\3\73\130\12\70\3\73\0\12\25\3\77\130\12\25\3\77\0\12\42\3\13\130\12\46\3\13\0\12\81\3\31\130\12\81\3\31\0",
+	"\12\32\2\213\130\12\32\2\213\0\12\14\2\178\130\12\14\2\178\0\12\42\2\181\130\12\46\2\181\0\12\14\2\128\130\12\14\2\128\0",
+	"\12\39\2\100\130\12\42\2\100\0\12\74\2\104\130\12\77\2\104\0\12\106\2\135\130\12\109\2\135\0\12\39\2\72\130\12\39\2\69\0",
+	"\12\35\2\37\130\12\35\2\37\0\12\32\2\2\130\12\32\2\2\0\12\28\1\226\130\12\28\1\223\0\12\63\1\208\130\12\63\1\208\0",
+	"\12\84\1\173\130\12\84\1\170\0\12\63\1\159\130\12\60\1\159\0\12\39\1\113\130\12\39\1\113\0\12\14\1\96\130\12\11\1\96\0",
+	"\11\228\1\131\130\11\228\1\135\0\12\7\1\149\130\12\7\1\149\0\12\21\1\177\130\12\25\1\177\0\11\242\1\201\130\11\242\1\201\0",
+	"\13\226\6\58\130\13\226\6\58\0\14\16\6\40\130\14\16\6\40\0\13\208\6\86\130\13\208\6\86\0\13\247\6\111\130\13\247\6\114\0",
+	"\13\184\6\121\130\13\184\6\121\0\13\198\6\146\130\13\201\6\146\0\13\244\6\139\130\13\244\6\139\0\13\223\6\185\130\13\223\6\185\0",
+	"\13\173\6\199\130\13\173\6\199\0\13\159\6\171\130\13\159\6\171\0\13\138\6\220\130\13\138\6\220\0\13\184\6\238\130\13\184\6\238\0",
+	"\13\208\6\223\130\13\208\6\223\0\13\216\7\10\130\13\216\7\10\0\13\184\7\10\130\13\180\7\10\0\13\142\7\38\130\13\142\7\41\0",
+	"\13\128\7\6\130\13\128\7\6\0\13\85\7\34\130\13\89\7\34\0\13\89\7\3\130\13\89\7\3\0\13\117\6\220\130\13\121\6\220\0",
+	"\13\75\6\195\130\13\75\6\195\0\13\110\6\164\130\13\110\6\164\0\13\156\6\125\130\13\156\6\125\0\13\106\6\135\130\13\106\6\135\0",
+	"\13\103\6\100\130\13\103\6\100\0\13\64\6\143\130\13\64\6\143\0\13\47\6\104\130\13\47\6\104\0\13\71\6\79\130\13\71\6\79\0",
+	"\13\40\6\65\130\13\36\6\65\0\13\8\6\44\130\13\1\6\44\0\13\8\6\76\130\13\8\6\76\0\13\1\6\132\130\13\1\6\132\0",
+	"\13\33\6\135\130\13\33\6\135\0\13\26\6\178\130\13\22\6\178\0\13\47\6\202\130\13\50\6\202\0\13\54\6\245\130\13\54\6\245\0",
+	"\13\22\7\3\130\13\22\7\3\0\13\43\7\27\130\13\43\7\27\0\12\253\6\248\130\12\250\6\248\0\12\253\6\220\130\12\253\6\220\0",
+	"\12\215\6\174\130\12\225\6\174\0\12\253\6\174\130\12\253\6\174\0\12\215\6\121\130\12\215\6\121\0\12\229\6\76\130\12\229\6\76\0",
+	"\12\201\6\51\130\12\201\6\51\0\12\190\6\19\130\12\190\6\19\0\12\151\5\223\130\12\151\5\223\0\12\148\5\194\130\12\151\5\194\0",
+	"\12\155\5\159\130\12\155\5\156\0\12\144\5\121\130\12\144\5\121\0\12\95\5\110\130\12\95\5\110\0\12\102\5\156\130\12\102\5\159\0",
+	"\12\99\5\216\130\12\106\5\219\0\12\148\6\40\130\12\148\6\40\0\12\127\6\19\130\12\127\6\19\0\12\176\6\104\130\12\176\6\104\0",
+	"\12\141\6\72\130\12\141\6\72\0\12\162\6\139\130\12\162\6\143\0\12\172\6\181\130\12\172\6\181\0\12\204\6\216\130\12\208\6\216\0",
+	"\12\201\7\3\130\12\201\7\3\0\12\236\7\24\130\12\236\7\24\0\12\120\6\146\130\12\120\6\146\0\12\123\6\104\130\12\123\6\104\0",
+	"\12\123\6\185\130\12\123\6\185\0\12\162\6\227\130\12\162\6\227\0\12\134\6\241\130\12\134\6\241\0\12\155\7\10\130\12\155\7\10\0",
+	"\12\190\7\41\130\12\190\7\41\0\11\228\1\96\129\11\228\1\96\0\11\200\1\121\129\11\200\1\121\0\11\193\1\156\129\11\196\1\156\0",
+	"\11\221\1\170\129\11\221\1\170\0\11\217\1\208\129\11\217\1\208\0\11\245\1\230\129\11\245\1\230\0\11\245\2\16\129\11\245\2\16\0",
+	"\12\14\2\62\129\12\18\2\62\0\11\242\2\93\129\11\242\2\93\0\11\235\2\178\129\11\235\2\178\0\11\231\2\238\129\11\235\2\238\0",
+	"\12\4\2\252\129\12\4\2\252\0\11\252\3\34\129\11\252\3\34\0\11\235\3\87\129\11\238\3\87\0\12\11\3\119\129\12\11\3\119\0",
+	"\12\4\3\168\129\12\4\3\168\0\11\245\3\200\129\11\245\3\200\0\11\252\3\238\129\11\252\3\242\0\12\11\4\7\129\12\11\4\7\0",
+	"\11\245\4\60\129\11\238\4\60\0\11\224\4\74\129\11\221\4\74\0\11\210\4\137\129\11\210\4\137\0\11\228\4\151\129\11\231\4\151\0",
+	"\11\242\4\130\129\11\242\4\130\0\12\4\4\113\129\12\7\4\113\0\12\28\4\102\129\12\28\4\102\0\12\11\4\141\129\12\11\4\141\0",
+	"\11\249\4\162\129\11\249\4\162\0\11\221\4\116\129\11\221\4\116\0\11\214\4\106\129\11\217\4\102\0\12\4\4\211\129\12\4\4\211\0",
+	"\11\249\5\8\129\11\252\5\8\0\12\39\5\11\129\12\42\5\11\0\12\56\5\50\129\12\60\5\47\0\12\46\5\96\129\12\49\5\96\0",
+	"\12\70\5\113\129\12\70\5\113\0\12\56\5\166\129\12\63\5\166\0\12\70\5\145\129\12\74\5\145\0\12\70\5\194\129\12\77\5\194\0",
+	"\12\70\5\237\129\12\74\5\237\0\12\106\5\240\129\12\109\5\240\0\12\99\6\33\129\12\99\6\33\0\12\88\6\72\129\12\88\6\72\0",
+	"\12\91\6\107\129\12\95\6\107\0\12\77\6\146\129\12\81\6\146\0\12\88\6\181\129\12\91\6\181\0\12\91\6\220\129\12\99\6\220\0",
+	"\12\113\7\10\129\12\116\7\10\0\8\116\4\18\179\8\116\4\18\0\9\205\3\73\156\9\205\3\73\0\10\83\2\146\144\10\83\2\146\0",
+	"\10\153\2\44\136\10\153\2\44\0\10\181\1\240\132\10\181\1\240\0\10\199\1\205\131\10\199\1\205\0\10\209\1\184\129\10\209\1\184\0",
+	"\8\42\2\167\150\8\42\2\167\0\8\53\1\240\141\8\53\1\237\0\8\67\1\135\134\8\67\1\135\0\11\224\5\8\129\11\224\5\8\0",
+	"\11\200\5\8\129\11\200\5\8\0\11\182\5\8\129\11\182\5\8\0\11\154\5\4\129\11\154\5\4\0\11\129\5\8\129\11\129\5\8\0",
+	"\11\119\3\84\129\11\119\3\84\0\11\140\3\87\129\11\140\3\87\0\11\165\3\87\129\11\165\3\87\0\11\182\3\87\129\11\182\3\87\0",
+	"\11\203\3\87\129\11\203\3\87\0\9\33\6\223\132\9\33\8\11\0\9\33\6\188\129\9\33\6\188\0\0\123\1\26\136\0\211\2\223\0",
+	"\0\211\2\223\136\0\120\3\84\0\0\130\3\101\136\0\211\4\53\0\0\204\4\53\136\0\120\4\151\0\0\130\3\193\136\0\127\4\63\0",
+	"\0\130\3\31\136\0\130\1\201\0\0\91\4\253\130\0\91\6\76\0\7\94\3\136\138\7\94\3\136\0\7\24\3\77\135\7\24\3\77\0",
+	"\6\238\3\24\132\6\241\3\24\0\6\223\2\238\131\6\223\2\238\0\6\220\2\209\129\6\220\2\209\0\7\87\4\14\133\7\87\4\14\0",
+	"\7\38\4\0\131\7\38\4\0\0\7\6\3\242\130\7\6\3\242\0\6\241\3\228\129\6\241\3\228\0\6\227\3\217\128\6\227\3\217\0",
+	"\0\109\4\197\135\0\162\5\99\0\0\144\5\121\135\0\123\6\9\0\0\127\5\92\135\0\127\5\92\0\0\127\5\54\135\0\127\5\54\0",
+	"\0\134\6\23\132\0\236\6\97\0\0\236\6\97\132\1\106\6\135\0\1\117\6\135\132\1\177\6\143\0\2\234\7\80\130\3\69\7\80\0",
+	"\3\69\7\80\130\3\84\7\101\0\3\84\7\101\130\3\87\7\129\0\3\87\7\129\130\3\84\7\150\0\0\183\5\103\130\1\92\5\159\0",
+	"\1\11\5\138\130\0\253\5\180\0\0\253\5\180\130\0\158\5\166\0\0\239\4\60\131\1\166\4\95\0\2\104\3\133\131\3\84\3\129\0",
+	"\4\162\2\181\131\4\162\3\147\0\3\115\2\26\131\4\74\2\30\0\2\23\1\54\131\2\230\1\54\0\0\204\2\5\131\1\194\2\5\0",
+	"\4\74\2\33\131\5\226\1\223\0\0\225\5\121\197\1\135\5\163\0\0\204\5\173\197\1\1\5\173\0\0\179\5\152\131\1\57\5\163\0",
+	"\1\57\5\159\131\1\106\5\219\0\0\165\5\226\130\0\253\5\230\0\0\253\5\230\130\1\8\5\159\0\1\254\6\86\131\1\254\6\86\0",
+	"\1\254\6\33\131\1\254\6\33\0\1\254\5\230\131\1\254\5\230\0\1\254\5\170\131\1\254\5\170\0\1\254\5\113\131\1\254\5\113\0",
+	"\1\251\6\5\129\1\251\6\5\0\1\254\5\201\129\1\254\5\201\0\1\254\5\138\129\1\254\5\138\0\1\254\6\58\129\1\254\6\58\0",
+	"\1\254\5\78\129\1\254\5\78\0\2\2\5\40\131\2\2\5\40\0\2\2\4\246\131\2\2\4\246\0\1\237\4\204\131\1\237\4\204\0",
+	"\2\40\4\190\131\2\40\4\190\0\6\160\7\52\223\7\27\7\126\0\1\219\4\172\204\1\219\4\172\0\2\37\4\183\197\2\37\4\183\0",
+	"\3\98\3\122\131\3\126\3\84\0\3\126\3\84\131\3\126\3\52\0\3\126\3\41\131\3\80\3\24\0\3\80\3\24\131\3\112\2\248\0",
+	"\3\112\2\248\131\3\98\2\188\0",
+}
+
+
+-----------------------------Constants---------------------------------
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+choiceEliminate = 1
+choiceSpare = 2
+
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak")}
+
+nativeUnNames = {loc("Zork"), loc("Steve"), loc("Jack"),
+                 loc("Lee"), loc("Elmo"), loc("Rachel"),
+                 loc("Muriel")}
+
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku"}
+
+nativePos = {257, 1950}
+
+cyborgNames = {loc("Syntax Errol"), loc("Segmentation Paul"), loc("Unexpected Igor"), loc("Jeremiah")}
+cyborgPos = {745, 1847}
+cyborgsPos = {{2937, 831}, {2945, 1264}, {2335, 1701}, {448, 484}}
+cyborgsDir = {"Left", "Left", "Left", "Right"}
+
+cratePos = {
+            {788, 1919, amGirder, 2}, {412, 1615, amGirder, 1},
+            {209, 1474, amSniperRifle, 1}, {1178, 637, amDEagle, 1},
+            {633, 268, amDEagle, 1}, {3016, 1545, amDEagle, 1},
+            {249, 1377, amRope, 3}, {330, 1018, amGirder, 1},
+            {888, 647, amRope, 3}, {2116, 337, amRope, 3},
+            {1779, 948, amRope, 3}, {3090, 1066, amRope, 3},
+            {947, 480, amBazooka, 3}, {1097, 480, amMortar, 3},
+            {1139, 451, amSnowball, 3}, {1207, 468, amShotgun, 3},
+            {1024, 393, amSniperRifle, 2}, {998, 391, amDynamite, 2},
+            {1024, 343, amRope, 2}, {998, 341, amRope, 2}
+           }
+reactions = {loc("Yeah, take that!"), loc("Bullseye"), loc("Die, die, die!")}
+
+secondPos = {{1010, 510}, {1067, 510}}
+-----------------------------Variables---------------------------------
+natives = {}
+native = nil
+
+cyborgs = {}
+cyborg = {}
+cyborgsLeft = 0
+
+gearDead = {}
+hedgeHidden = {}
+
+startAnim = {}
+killAnim = {}
+killedAnim = {}
+
+freshDead = nil
+crates = {}
+cratesNum = 0
+jetCrate = nil
+-----------------------------Animations--------------------------------
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {native, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {native, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function AnimationSetup()
+  startAnim = {}
+  local m = m5DeployedNum
+  table.insert(startAnim, {func = AnimWait, args = {native, 3000}})
+  table.insert(startAnim, {func = AnimCaption, args = {native, loc("With the rest of the tribe gone, it was up to ") .. nativeNames[m5DeployedNum] .. loc(" to save the village."), 5000}})
+  table.insert(startAnim, {func = AnimCaption, args = {native, loc("But it proved to be no easy task!"), 2000}})
+  for i = 1, 4 do
+    table.insert(startAnim, {func = FollowGear, swh = false, args = {cyborgs[i]}})
+    table.insert(startAnim, {func = AnimWait, args = {native, 1000}})
+  end
+  table.insert(startAnim, {func = FollowGear, swh = false, args = {native}})
+  if m == leaksNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("What a strange cave!"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("Now how do I get on the other side?!"), SAY_THINK, 5500}})
+  elseif m == denseNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("Dude, what's this place?!"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimCustomFunction, args = {native, EmitDenseClouds, {"Right"}}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("And where's all the weed?"), SAY_THINK, 4000}})
+  elseif m == waterNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("Is this place in my head?"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("I shouldn't have drunk that last pint."), SAY_THINK, 6000}})
+  elseif m == buffaloNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("Where did that alien run?"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("When I find it..."), SAY_THINK, 3000}})
+  elseif m == girlNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("This is typical!"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("It's always up to women to clear up the mess men created!"), SAY_THINK, 8500}})
+  elseif m == chiefNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("What is this place?"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("It doesn't matter. I won't let that alien hurt my daughter!"), SAY_THINK, 8500}})
+  elseif m == wiseNum then
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 50, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("Every single time!"), SAY_THINK, 0}})
+    table.insert(startAnim, {func = AnimMove, args = {native, "Right", nativePos[1] + 200, 0}})
+    table.insert(startAnim, {func = AnimSay, args = {native, loc("How come in a village full of warriors, it's up to me to save it?"), SAY_THINK, 8500}})
+  end
+
+  table.insert(startAnim, {func = AnimCustomFunction, args = {native, RestoreHedge, {cyborg, unpack(cyborgPos)}}})
+  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Greetings, ") .. nativeUnNames[m] .. "!", SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("As you can see, there is no way to get on the other side!"), SAY_SAY, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I wish to help you, ") .. nativeUnNames[m] .. "!", SAY_SAY, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Beware, though! If you are slow, you die!"), SAY_SAY, 7000}})
+  table.insert(startAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(startAnim, {func = AnimSwitchHog, args = {native}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {native, HideHedge, {cyborg}}})
+  table.insert(startAnim, {func = AnimSay, args = {native, loc("Talk about mixed signals..."), SAY_SAY, 4000}})
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+end
+
+function SetupKillAnim()
+  table.insert(killAnim, {func = AnimSay, args = {native, loc("Well, that was a waste of time."), SAY_THINK, 5000}})
+  table.insert(killAnim, {func = AnimCustomFunction, args = {native, RestoreHedge, {cyborg, unpack(cyborgPos)}}})
+  table.insert(killAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(killAnim, {func = AnimCustomFunction, args = {cyborg, CondNeedToTurn, {cyborg, native}}})
+  table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("You bear impressive skills, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SHOUT, 4000}})
+  table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("However, my mates don't agree with me on letting you go..."), SAY_SHOUT, 7000}})
+  table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("I guess you'll have to kill them."), SAY_SHOUT, 4000}})
+  table.insert(killAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(killAnim, {func = AnimSwitchHog, args = {native}})
+  table.insert(killAnim, {func = AnimWait, args = {native, 1}})
+  table.insert(killAnim, {func = AnimCustomFunction, args = {native, HideHedge, {cyborg}}})
+  AddSkipFunction(killAnim, SkipKillAnim, {})
+end
+
+function SetupKilledAnim()
+  table.insert(killedAnim, {func = AnimWait, args = {cyborg, 500}})
+  table.insert(killedAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(secondPos[2])}})
+  table.insert(killedAnim, {func = AnimOutOfNowhere, args = {native, unpack(secondPos[1])}})
+  table.insert(killedAnim, {func = AnimCustomFunction, args = {cyborg, CondNeedToTurn, {cyborg, native}}})
+  table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("Nice work, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SHOUT, 4000}})
+  table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("As a reward for your performance, here's some new technology!"), SAY_SHOUT, 8000}})
+  table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("Use it wisely!"), SAY_SHOUT, 3000}})
+  table.insert(killedAnim, {func = AnimDisappear, args = {cyborg, unpack(secondPos[2])}})
+  table.insert(killedAnim, {func = AnimSwitchHog, args = {native}})
+  AddSkipFunction(killedAnim, SkipKilledAnim, {})
+end
+--------------------------Anim skip functions--------------------------
+function SkipStartAnim()
+  AnimSwitchHog(native)
+  AnimWait(native, 1)
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function AfterStartAnim()
+  SetGearMessage(native, 0)
+  cratesNum = 0
+  for i = 1, 6 do
+    crates[i] = SpawnAmmoCrate(unpack(cratePos[i]))
+    cratesNum = cratesNum + 1
+  end
+  FollowGear(native)
+  AddNewEvent(CheckGearsDead, {{crates[1], crates[2]}}, PutCrates, {2}, 0) 
+  TurnTimeLeft = TurnTime
+  ShowMission(loc("Dragon's Lair"), loc("Obstacle course"), loc("In order to get to the other side, you need to collect the crates first.|") ..
+                                                  loc("As the ammo is sparse, you might want to reuse ropes while mid-air.|") ..
+                                                  loc("If you wish to restart the course, hold [Precise] while your turn ends (e.g with Skip)!|") ..
+                                                  loc("The enemy can't move but it might be a good idea to stay out of sight!|") ..
+                                                  loc("You have ") .. SuddenDeathTurns .. loc(" turns until Sudden Death! Better hurry!"), 1, 0)
+end
+
+function SkipKillAnim()
+  AnimSwitchHog(native)
+  AnimWait(native, 1)
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function AfterKillAnim()
+  PutWeaponCrates()
+  TurnTimeLeft = TurnTime
+  AddEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
+  ShowMission(loc("Dragon's Lair"), loc("The Slaughter"), loc("Kill the aliens!"), 1, 2000)
+end
+
+function SkipKilledAnim()
+  AnimSetGearPosition(native, unpack(secondPos[1]))
+  AnimSwitchHog(native)
+  AnimWait(native, 1)
+end
+
+function AfterKilledAnim()
+  HideHedge(cyborg)
+  TurnTimeLeft = TurnTime
+  SetGearMessage(native, 0)
+  AddAmmo(native, amPortalGun, 100)
+  SpawnUtilityCrate(2259, 755, amTeleport, 2)
+  SpawnHealthCrate(secondPos[1][1] + 30, secondPos[1][2])
+  ShowMission(loc("Dragon's Lair"), loc("The what?!"), loc("Use the portal gun to get to the next crate, then use the new gun to get to the final destination!|")..
+                                             loc("Portal hint: one goes to the destination, and one is the entrance.|")..
+                                             loc("Teleport hint: just use the mouse to select the destination!"), 1, 0)
+end
+-----------------------------Events------------------------------------
+
+function CheckCyborgsDead()
+  return cyborgsLeft == 0
+end
+
+function NullifyAmmo()
+  AddAmmo(native, amRope, 0)
+  AddAmmo(native, amGirder, 0)
+  AddAmmo(native, amLowGravity, 0)
+  AddAmmo(native, amBazooka, 0)
+  AddAmmo(native, amSniperRifle, 0)
+  AddAmmo(native, amDEagle, 0)
+  AddAmmo(native, amDynamite, 0)
+  AddAmmo(native, amFirePunch, 0)
+  AddAmmo(native, amBaseballBat, 0)
+  AddAmmo(native, amMortar, 0)
+  AddAmmo(native, amSnowball, 0)
+  AddAmmo(native, amShotgun, 0)
+end
+
+function DoCyborgsDead()
+  NullifyAmmo()
+  RestoreHedge(cyborg)
+  SetupKilledAnim()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(killedAnim)
+  AddFunction({func = AfterKilledAnim, args = {}})
+end
+
+
+function PutWeaponCrates()
+  for i = 1, 8 do
+    cratesNum = cratesNum + 1
+    crates[cratesNum] = SpawnAmmoCrate(unpack(cratePos[cratesNum]))
+  end
+  FollowGear(native)
+end
+
+function DoCratesTaken()
+  SetupKillAnim()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(killAnim)
+  AddFunction({func = AfterKillAnim, args = {}})
+end
+
+function PutCrates(index)
+  if index <= 7 then
+    cratesNum = cratesNum + 1
+    crates[cratesNum] = SpawnUtilityCrate(unpack(cratePos[cratesNum]))
+    AddNewEvent(CheckGearDead, {crates[cratesNum]}, PutCrates, {index + 1}, 0)
+    FollowGear(native)
+  else
+    AddEvent(StoppedGear, {native}, DoCratesTaken, {}, 0)
+  end
+  if index == 4 then
+    AnimSay(native, loc("I'm a ninja."), SAY_THINK, 0)
+  end
+end
+
+function CheckMissionFinished()
+  return gearDead[jetCrate] == true
+end
+
+function DoMissionFinished()
+  AddCaption(loc("Salvation was one step closer now..."))
+  SaveCampaignVar("Progress", "6")
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckGearsDead(gearList)
+  for i = 1, # gearList do
+    if gearDead[gearList[i]] ~= true then
+      return false
+    end
+  end
+  return true
+end
+
+
+function CheckGearDead(gear)
+  return gearDead[gear]
+end
+
+function EndMission()
+  ParseCommand("teamgone " .. loc("Natives"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckFreshDead()
+  return freshDead ~= nil
+end
+
+function CyborgDeadReact()
+  freshDead = nil
+  if cyborgsLeft == 0 then
+    return
+  end
+  AnimSay(native, reactions[cyborgsLeft])
+end
+-----------------------------Misc--------------------------------------
+function HideHedge(hedge)
+  if hedgeHidden[hedge] ~= true then
+    HideHog(hedge)
+    hedgeHidden[hedge] = true
+  end
+end
+
+function RestoreHedge(hedge)
+  if hedgeHidden[hedge] == true then
+    RestoreHog(hedge)
+    hedgeHidden[hedge] = false
+  end
+end
+
+function GetVariables()
+  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum"))
+end
+
+function SetupPlace()
+  for i = 1, 7 do
+    if i ~= m5DeployedNum then 
+      DeleteGear(natives[i])
+    else
+      native = natives[i]
+    end
+  end
+  HideHedge(cyborg)
+  jetCrate = SpawnUtilityCrate(3915, 1723, amJetpack)
+
+  SetTimer(AddGear(1071, 1913, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1098, 1919, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1136, 1923, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1170, 1930, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1203, 1924, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1228, 1939, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1264, 1931, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1309, 1938, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1352, 1936, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1386, 1939, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1432, 1942, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1483, 1950, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1530, 1954, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1579, 1959, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1000, 1903, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(957, 1903, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(909, 1910, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(889, 1917, gtMine, 0, 0, 0, 0), 5000)
+  ------ STICKY MINE LIST ------
+  tempG = AddGear(1199, 733, gtSMine, 0, 0, 0, 0)
+  tempG = AddGear(1195, 793, gtSMine, 0, 0, 0, 0)
+  tempG = AddGear(1201, 861, gtSMine, 0, 0, 0, 0)
+  tempG = AddGear(682, 878, gtSMine, 0, 0, 0, 0)
+  tempG = AddGear(789, 876, gtSMine, 0, 0, 0, 0)
+end
+
+function SetupEvents()
+  AddNewEvent(CheckMissionFinished, {}, DoMissionFinished, {}, 0)
+  AddNewEvent(CheckGearDead, {native}, EndMission, {}, 0)
+  AddNewEvent(CheckFreshDead, {}, CyborgDeadReact, {}, 1)
+end
+
+function SetupAmmo()
+  AddAmmo(cyborgs[1], amBazooka, 100)
+--  AddAmmo(cyborgs[1], amSniperRifle, 100)
+  AddAmmo(cyborgs[1], amShotgun, 100)
+  AddAmmo(cyborgs[1], amSwitch, 100)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 1, 7 do
+    natives[i] = AddHog(nativeNames[i], 0, 200, nativeHats[i])
+    gearDead[natives[i]] = false
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+  gearDead[cyborg] = false
+
+  AddTeam(loc("011101000"), 14483455, "ring", "UFO", "Robot", "cm_star")
+  for i = 1, 4 do
+    cyborgs[i] = AddHog(cyborgNames[i], 2, 100, "cyborg2")
+    gearDead[cyborgs[i]] = false
+  end
+  cyborgsLeft = 4
+
+  for i = 1, 7 do
+    AnimSetGearPosition(natives[i], unpack(nativePos))
+  end
+
+  AnimSetGearPosition(cyborg, unpack(cyborgPos))
+
+  for i = 1, 4 do
+    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
+    AnimTurn(cyborgs[i], cyborgsDir[i])
+  end
+
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfSolidLand + gfDisableLandObjects + gfDisableWind + gfDisableGirders
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 20
+	MinesTime = 3000
+	Explosives = 6
+	Delay = 10 
+  MapGen = 2
+	Theme = "City"
+  SuddenDeathTurns = 25
+
+	for i = 1, #map do
+		ParseCommand('draw ' .. map[i])
+	end
+
+  AddHogs()
+  AnimInit()
+end
+
+function onGameStart()
+  GetVariables()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  SetupEvents()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+  ShowMission(loc("Dragon's Lair"), loc("Y Chwiliad"), loc("Find your tribe!|Cross the lake!"), 1, 0)
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  gearDead[gear] = true
+  if GetGearType(gear) == gtHedgehog then
+    if GetHogTeamName(gear) == loc("011101000") then
+      freshDead = GetHogName(gear)
+      cyborgsLeft = cyborgsLeft - 1
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amFirePunch, 3, 0, 0, 0)
+  SetAmmo(amBaseballBat, 2, 0, 0, 0)
+  SetAmmo(amGirder, 0, 0, 0, 2)
+  SetAmmo(amLowGravity, 0, 0, 0, 1)
+  SetAmmo(amSkip, 9, 0, 0, 0)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if GetHogTeamName(CurrentHedgehog) == loc("011101000") then
+    SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
+    for i = 1, 4 do
+      if gearDead[CurrentHedgehog] ~= true and gearDead[native] ~= true then
+        if gearDead[cyborgs[i]] ~= true and GetX(cyborgs[i]) < GetX(native) then
+          HogTurnLeft(cyborgs[i], false)
+        else
+          HogTurnLeft(cyborgs[i], true)
+        end
+      end
+    end
+    if TotalRounds % 6 == 0 then
+      AddAmmo(CurrentHedgehog, amSniperRifle, 1)
+      AddAmmo(CurrentHedgehog, amDEagle, 1)
+    end
+    TurnTimeLeft = 30000
+  elseif GetHogTeamName(CurrentHedgehog) == loc("011101001") then
+    TurnTimeLeft = 0
+  else
+    SetInputMask(0xFFFFFFFF)
+    AddCaption(loc("Turns until Sudden Death: ") .. SuddenDeathTurns - TotalRounds)
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+  end
+  if AnimInProgress() == false then
+  end
+end
+
+function onPreciseUp()
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua
new file mode 100644
index 0000000..18e3dd2
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/enemy.lua	
@@ -0,0 +1,663 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+
+--------------------------------------------Constants------------------------------------
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+choiceEliminate = 1
+choiceSpare = 2
+
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+ramonNum = 8
+spikyNum = 9
+
+denseScene = 1
+princessScene = 2
+waterScene = 3
+cyborgScene = 4
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese")
+              }
+
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku", "rasta", "hair_yellow"}
+
+nativePos = {{1259, 120}, {2378, 796}, {424, 1299}, {3322, 260}, {1022, 1550}}
+nativeDir = {"Right", "Left", "Right", "Left", "Right"}
+
+cannibalNames = {loc("Honest Lee"), loc("Vegan Jack"), loc("Sirius Lee"),
+                 loc("Brutal Lily")}
+cannibalPos = {{162, 266}, {2159, 1517}, {3311, 1621}, {1180, 1560}}
+cannibalDir = {"Right", "Left", "Left", "Right"}
+cannibalsNum = 4
+
+playersDir = {"Right", "Left", "Right", "Left", "Right", "Right", "Left", "Left", "Right"}
+playersAntiDir = {"Left", "Right", "Left", "Right", "Left", "Left", "Right", "Right", "Left"}
+
+cyborgNames = {loc("Smith 0.97"), loc("Smith 0.98"), loc("Smith 0.99a"),
+               loc("Smith 0.99b"), loc("Smith 0.99f"), loc("Smith 1.0")}
+cyborgPos = {{2162, 20}, {2458, 564}, {542, 1133}, {3334, 1427}}
+cyborgDir = "Right"
+cyborgsNum = 6
+cyborgsPos = {{1490, 330}, {1737, 1005}, {2972, 922}, {1341, 1571},
+              {751, 543}, {3889, 907}}
+cyborgsDir = {"Right", "Right", "Left", "Right", "Right", "Left"}
+
+leaderPos = {3474, 151}
+leaderDir = "Left"
+
+-----------------------------Variables---------------------------------
+natives = {}
+origNatives = {}
+
+cyborgs = {}
+cyborg = nil
+
+cannibals = {}
+players = {}
+leader = nil
+
+gearDead = {}
+hedgeHidden = {}
+
+startAnim = {}
+finalAnim = {}
+-----------------------------Animations--------------------------------
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+function CondNeedToTurn2(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimTurn(hog1, "Left")
+    AnimTurn(hog2, "Right")
+  elseif xl < xd then
+    AnimTurn(hog2, "Left")
+    AnimTurn(hog1, "Right")
+  end
+end
+
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  if dir == nil then
+    dx, dy = GetGearVelocity(dense)
+    if dx < 0 then 
+      dif = 10
+    else 
+      dif = -10
+    end
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function RestoreNatives(cgi)
+  for i = 1, playersNum do
+    RestoreHedge(players[i])
+    AnimOutOfNowhere(players[i], GetGearPosition(players[i]))
+  end
+end
+
+function AnimationSetup()
+  SetupCyborgStartAnim()
+  SetupPeopleStartAnim()
+  SetupEnemyStartAnim()
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+end
+
+function SetupCyborgStartAnim()
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 3000}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[2])}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[3])}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 1800}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {cyborg, unpack(cyborgPos[4])}})
+  table.insert(startAnim, {func = AnimWait, args = {cyborg, 800}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Everything looks OK..."), SAY_THINK, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("This will be fun!"), SAY_THINK, 2500}})
+  table.insert(startAnim, {func = AnimJump, args = {cyborg, "high"}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {cyborg, RestoreNatives, {true}}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("HAHA!"), SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSwitchHog, args = {players[1]}})
+  table.insert(startAnim, {func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}})
+  table.insert(startAnim, {func = HideHedge, swh = false, args = {cyborg}})
+end
+
+function SetupPeopleStartAnim()
+  for i = 1, playersNum do
+    table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersAntiDir[i]}})
+  end
+  table.insert(startAnim, {func = AnimWait, args = {players[1], 800}})
+  for i = 1, playersNum do
+    table.insert(startAnim, {func = AnimTurn, swh = false, args = {players[i], playersDir[i]}})
+  end
+  table.insert(startAnim, {func = AnimWait, args = {players[1], 800}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("What is this place?"), SAY_SHOUT, 2500}})
+  if m5LeaksDead == 1 then
+    table.insert(startAnim, {func = AnimSay, args = {players[1], loc("And how am I alive?!"), SAY_SAY, 3000}})
+  end
+  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], players[2]}}})
+  table.insert(startAnim, {func = AnimSay, args = {players[2], loc("It must be the cyborgs again!"), SAY_SAY, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[3], loc("Looks like the whole world is falling apart!"), SAY_SAY, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Look out! We're surrounded by cannibals!"), SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {players[4], CondNeedToTurn, {players[4], cannibals[1]}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {players[4], CondNeedToTurn, {players[1], cannibals[1]}}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("Cannibals?! You're the cannibals!"), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("WHAT?! You're the ones attacking us!"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("You have kidnapped our whole tribe!"), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("You've been assaulting us, we have been just defending ourselves!"), SAY_SHOUT, 8000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("I can't believe this!"), SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Have we ever attacked you first?"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("Yes!"), SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("When?"), SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("Uhmm...ok no."), SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("But you're cannibals. It's what you do."), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Again with the 'cannibals' thing!"), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Where do you get that?!"), SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("Everyone knows this."), SAY_SHOUT, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("I didn't until about a month ago."), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[4], loc("Hmmm...actually...I didn't either."), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("About a month ago, a cyborg came and told us that you're the cannibals!"), SAY_SHOUT, 8000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("A cy-what?"), SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("Cyborg. It's what the aliens call themselves."), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They told us to wear these clothes. They said that this is the newest trend."), SAY_SHOUT, 8000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("They've been manipulating us all this time!"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("They must be trying to weaken us!"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have to unite and defeat those cylergs!"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {cannibals[1], loc("We can't let them take over our little island!"), SAY_SHOUT, 5000}})
+end
+
+function RestoreCyborgs(cgi)
+  if cyborgsRestored == true then
+    return
+  end
+  for i = 1, cyborgsNum do
+    RestoreHedge(cyborgs[i])
+    if cgi == true then
+      AnimOutOfNowhere(cyborgs[i], unpack(cyborgsPos[i]))
+    end
+  end
+  RestoreHedge(leader)
+  AnimOutOfNowhere(leader, unpack(leaderPos))
+  cyborgsRestored = true
+end
+
+function SetupEnemyStartAnim()
+  local gear
+  table.insert(startAnim, {func = AnimCustomFunction, args = {cannibals[1], RestoreCyborgs, {true}}})
+  if m8EnemyFled == 1 then
+    gear = leader
+  else
+    gear = cyborgs[2]
+  end
+  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[4], gear}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {players[1], CondNeedToTurn, {players[1], gear}}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("You have finally figured it out!"), SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("You meatbags are pretty slow, you know!"), SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("Why do you want to take over our island?"), SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("Do you have any idea how valuable grass is?"), SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("This island is the only place left on Earth with grass on it!"), SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("It's worth more than wood!"), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("That makes it almost invaluable!"), SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We have nowhere else to live!"), SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {gear, loc("That's not our problem!"), SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {players[1], loc("We'll give you a problem then!"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSwitchHog, args = {gear}})
+end
+
+function SetupFinalAnim()
+  finalAnim = {
+    {func = AnimGearWait, args = {cyborg, 1000}},
+    {func = AnimSay, args = {cyborg, loc("Nicely done, meatbags!"), SAY_SAY, 3000}},
+    {func = AnimSay, args = {cyborg, loc("You have won the game by proving true cooperative skills!"), SAY_SAY, 7000}},
+    {func = AnimSay, args = {cyborg, loc("You have proven yourselves worthy!"), SAY_SAY, 4000}},
+    {func = AnimSay, args = {players[1], loc("Game? Was this a game to you?!"), SAY_SAY, 4000}},
+    {func = AnimSay, args = {cyborg, loc("Well, yes. This was a cyborg television show."), SAY_SAY, 5500}},
+    {func = AnimSay, args = {cyborg, loc("It is called 'Hogs of Steel'."), SAY_SAY, 4000}},
+    {func = AnimSay, args = {players[1], loc("Are you saying that many of us have died for your entertainment?"), SAY_SAY, 8000}},
+    {func = AnimSay, args = {players[1], loc("Our tribe, our beautiful island!"), SAY_SAY, 4000}},
+    {func = AnimSay, args = {players[1], loc("All gone...everything!"), SAY_SAY, 3000}},
+    {func = AnimSay, args = {cyborg, loc("But the ones alive are stronger in their heart!"), SAY_SAY, 6000}},
+    {func = AnimSay, args = {cyborg, loc("Just kidding, none of you have died!"), SAY_SAY, 5000}},
+    {func = AnimSay, args = {cyborg, loc("I mean, none of you ceased to live."), SAY_SAY, 5000}},
+    {func = AnimSay, args = {cyborg, loc("You'll see what I mean!"), SAY_SAY, 4000}},
+    {func = AnimSay, args = {cyborg, loc("They are all waiting back in the village, haha."), SAY_SAY, 7000}},
+    {func = AnimSay, args = {players[1], loc("You are playing with our lives here!"), SAY_SAY, 6000}},
+    {func = AnimSay, args = {players[1], loc("Do you think you're some kind of god?"), SAY_SAY, 6000}},
+    {func = AnimSay, args = {cyborg, loc("Interesting idea, haha!"), SAY_SAY, 2000}},
+    {func = AnimSwitchHog, args = {players[1]}},
+    {func = AnimWait, args = {players[1], 1}},
+    {func = AnimDisappear, swh = false, args = {cyborg, unpack(cyborgPos[4])}},
+    {func = HideHedge, swh = false, args = {cyborg}},
+    {func = AnimSay, args = {players[1], loc("What a douche!"), SAY_SAY, 2000}},
+  }
+end
+--------------------------Anim skip functions--------------------------
+function SkipStartAnim()
+  RestoreNatives()
+  RestoreCyborgs()
+  SetGearMessage(CurrentHedgehog, 0)
+  AnimSwitchHog(cyborgs[1])
+  AnimWait(cyborg, 1)
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function AfterStartAnim()
+  ShowMission(loc("The Enemy Of My Enemy"), loc("The Union"), loc("Defeat the cyborgs!"), 1, 0)
+  PutWeaponCrates()
+  PutHealthCrates()
+  TurnTimeLeft = 0
+end
+
+function PutHealthCrates()
+  for i = 1, 10 do
+    SpawnHealthCrate(0, 0)
+  end
+end
+
+function PutWeaponCrates()
+  SpawnAmmoCrate(2399, 622, amNapalm, 2)
+  SpawnAmmoCrate(2199, -18, amBee, 2)
+  SpawnAmmoCrate(2088, 430, amBee, 2)
+  SpawnAmmoCrate(237, 20, amMortar, 4)
+  SpawnAmmoCrate(312, 1107, amMolotov, 3)
+  SpawnAmmoCrate(531, 1123, amWatermelon, 2)
+  SpawnAmmoCrate(1253, 1444, amFlamethrower, 5)
+  SpawnAmmoCrate(994, 1364, amBaseballBat, 3)
+  SpawnAmmoCrate(1104, 1553, amMine, 6)
+  SpawnAmmoCrate(2277, 803, amDynamite, 2)
+  SpawnAmmoCrate(1106, 184, amRCPlane, 3)
+  SpawnAmmoCrate(1333, 28, amSMine, 4)
+  SpawnAmmoCrate(90, 279, amAirAttack, 2)
+  SpawnAmmoCrate(288, 269, amBee, 2)
+  SpawnAmmoCrate(818, 1633, amBaseballBat, 2)
+end
+-----------------------------Events------------------------------------
+function CheckNativesDead()
+  return nativesLeft == 0
+end
+
+function CheckCannibalsDead()
+  return cannibalsLeft == 0
+end
+
+function CheckPlayersDead()
+  return playersLeft == 0
+end
+
+function CheckCyborgsDead()
+  return (cyborgsLeft == 0 and (leader == nil or gearDead[leader] == true))
+end
+
+function DoNativesDead()
+  nativesDeadFresh = true
+  TurnTimeLeft = 0
+end
+
+function DoCannibalsDead()
+  cannibalsDeadFresh = true
+  TurnTimeLeft = 0
+end
+
+function DoPlayersDead()
+  RemoveEventFunc(CheckNativesDead)
+  RemoveEventFunc(CheckCannibalsDead)
+  RemoveEventFunc(CheckCyborgsDead)
+  playersDeadFresh = true
+  TurnTimeLeft = 0
+end
+
+function DoCyborgsDead()
+--  RemoveEventFunc(CheckNativesDead)
+--  RemoveEventFunc(CheckCannibalsDead)
+  cyborgsDeadFresh= true
+  TurnTimeLeft = 0
+end
+
+function CheckGearsDead(gearList)
+  for i = 1, # gearList do
+    if gearDead[gearList[i]] ~= true then
+      return false
+    end
+  end
+  return true
+end
+
+function CheckGearDead(gear)
+  return gearDead[gear]
+end
+
+function FailedMission()
+  RestoreHedge(cyborg)
+  AnimOutOfNowhere(cyborg, unpack(cyborgPos[1]))
+  if CheckCyborgsDead() then
+    AnimSay(cyborg, loc("Hmmm...it's a draw. How unfortunate!"), SAY_THINK, 6000)
+  elseif leader ~= nil then
+    CondNeedToTurn2(cyborg, leader)
+    AddAnim({{func = AnimSay, args = {leader, loc("Yay, we won!"), SAY_SAY, 2000}},
+             {func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}})
+  else
+    CondNeedToTurn2(cyborg, cyborgs[1])
+    AddAnim({{func = AnimSay, args = {cyborgs[1], loc("Yay, we won!"), SAY_SAY, 2000}},
+             {func = AnimSay, args = {cyborg, loc("Nice work!"), SAY_SAY, 2000}}})
+  end
+  AddFunction({func = LoseMission, args = {}})
+end
+
+function LoseMission()
+  ParseCommand("teamgone " .. loc("Natives"))
+  ParseCommand("teamgone " .. loc("Cannibals"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function WonMission()
+  RestoreHedge(cyborg)
+  CondNeedToTurn2(cyborg, players[1])
+  SetupFinalAnim()
+  AddAnim(finalAnim)
+  AddFunction({func = WinMission, args = {}})
+end
+
+function WinMission()
+  SaveCampaignVar("Progress", "9")
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+-----------------------------Misc--------------------------------------
+function HideHedge(hedge)
+  if hedgeHidden[hedge] ~= true then
+    HideHog(hedge)
+    hedgeHidden[hedge] = true
+  end
+end
+
+function RestoreHedge(hedge)
+  if hedgeHidden[hedge] == true then
+    RestoreHog(hedge)
+    hedgeHidden[hedge] = false
+  end
+end
+
+function GetVariables()
+  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum"))
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+  m5Choice = tonumber(GetCampaignVar("M5Choice"))
+  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
+  m4DenseDead = tonumber(GetCampaignVar("M4DenseDead"))
+  m5DenseDead = tonumber(GetCampaignVar("M5DenseDead"))
+  m4LeaksDead = tonumber(GetCampaignVar("M4LeaksDead"))
+  m5LeaksDead = tonumber(GetCampaignVar("M5LeaksDead"))
+  m4ChiefDead = tonumber(GetCampaignVar("M4ChiefDead"))
+  m5ChiefDead = tonumber(GetCampaignVar("M5ChiefDead"))
+  m4WaterDead = tonumber(GetCampaignVar("M4WaterDead"))
+  m5WaterDead = tonumber(GetCampaignVar("M5WaterDead"))
+  m4BuffaloDead = tonumber(GetCampaignVar("M4BuffaloDead"))
+  m5BuffaloDead = tonumber(GetCampaignVar("M5BuffaloDead"))
+  m5WiseDead = tonumber(GetCampaignVar("M5WiseDead"))
+  m5GirlDead = tonumber(GetCampaignVar("M5GirlDead"))
+  m8DeployedDead = tonumber(GetCampaignVar("M8DeployedDead"))
+  m8PrincessDead = tonumber(GetCampaignVar("M8PrincessDead"))
+  m8RamonDead = tonumber(GetCampaignVar("M8RamonDead"))
+  m8SpikyDead = tonumber(GetCampaignVar("M8SpikyDead"))
+  m8DeployedLeader = tonumber(GetCampaignVar("M8DeployedLeader"))
+  m8PrincessLeader = tonumber(GetCampaignVar("M8PrincessLeader"))
+  m8EnemyFled = tonumber(GetCampaignVar("M8EnemyFled"))
+  m8Scene = tonumber(GetCampaignVar("M8Scene"))
+end
+
+function SetupPlace()
+  for i = 1, playersNum do
+    HideHedge(players[i])
+  end
+  for i = 1, cyborgsNum do
+    HideHedge(cyborgs[i])
+  end
+  if leader ~= nil then
+    HideHedge(leader)
+  end
+end
+
+function SetupEvents()
+  AddNewEvent(CheckPlayersDead, {}, DoPlayersDead, {}, 0)
+  AddNewEvent(CheckNativesDead, {}, DoNativesDead, {}, 0)
+  AddNewEvent(CheckCannibalsDead, {}, DoCannibalsDead, {}, 0)
+  AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
+end
+
+function SetupAmmo()
+  AddAmmo(cyborgs[1], amClusterBomb, 100)
+  AddAmmo(cyborgs[1], amMortar, 100)
+  AddAmmo(cyborgs[1], amDynamite, 2)
+  AddAmmo(cyborgs[1], amAirAttack, 2)
+  AddAmmo(cyborgs[1], amTeleport, 100)
+
+  if leader ~= nil then
+    AddAmmo(leader, amClusterBomb, 100)
+    AddAmmo(leader, amMortar, 100)
+    AddAmmo(leader, amDynamite, 100)
+    AddAmmo(leader, amAirAttack, 3)
+    AddAmmo(leader, amTeleport, 100)
+  end
+end
+
+function AddHogs()
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  natives[1] = AddHog(nativeNames[leaksNum], 0, 100, nativeHats[leaksNum])
+  if m5DeployedNum ~= leaksNum and m8DeployedLeader == 0 then
+    natives[2] = AddHog(nativeNames[m5DeployedNum], 0, 100, nativeHats[m5DeployedNum])
+  end
+  table.insert(natives, AddHog(nativeNames[ramonNum], 0, 100, nativeHats[ramonNum]))
+  table.insert(natives, AddHog(nativeNames[spikyNum], 0, 100, nativeHats[spikyNum]))
+  if m8PrincessLeader == 0 then
+    table.insert(natives, AddHog(loc("Fell From Heaven"), 0, 100, "tiara"))
+  end
+  nativesNum = #natives
+  nativesLeft = nativesNum
+  cannibalsLeft = cannibalsNum
+  for i = 1, nativesNum do
+    table.insert(players, natives[i])
+  end
+
+	AddTeam(loc("Cannibals"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 1, cannibalsNum do
+    cannibals[i] = AddHog(cannibalNames[i], 0, 100, "Zombi")
+    table.insert(players, cannibals[i])
+  end
+  playersNum = #players
+  playersLeft = playersNum
+
+  AddTeam(loc("Hedge-cogs"), 14483455, "ring", "UFO", "Robot", "cm_star")
+  for i = 1, cyborgsNum do
+    cyborgs[i] = AddHog(cyborgNames[i], 2, 80, "cyborg2")
+  end
+
+  if m8EnemyFled == 1 then
+    AddTeam(loc("Leader"), 14483455, "ring", "UFO", "Robot", "cm_star")
+    if m8Scene == denseScene then
+      leader = AddHog(loc("Dense Cloud"), 2, 200, nativeHats[denseNum])
+    elseif m8Scene == waterScene then
+      leader = AddHog(loc("Fiery Water"), 2, 200, nativeHats[waterNum])
+    elseif m8Scene == princessScene then
+      leader = AddHog(loc("Fell From Heaven"), 2, 200, "tiara")
+    else
+      leader = AddHog(loc("Nancy Screw"), 2, 200, "cyborg2")
+    end
+  end
+
+  cyborgsLeft = cyborgsNum
+
+  for i = 1, nativesNum do
+    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
+    AnimTurn(natives[i], nativeDir[i])
+  end
+  for i = 1, cannibalsNum do
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+    AnimTurn(cannibals[i], cannibalDir[i])
+  end
+  for i = 1, cyborgsNum do
+    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
+    AnimTurn(cyborgs[i], cyborgsDir[i])
+  end
+  AnimSetGearPosition(cyborg, unpack(cyborgPos[1]))
+  AnimTurn(cyborg, cyborgDir)
+  if leader ~= nil then
+    AnimSetGearPosition(leader, unpack(leaderPos))
+    AnimTurn(leader, leaderDir[i])
+  end
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfSolidLand
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+  Map = "Islands"
+	Theme = "EarthRise"
+  SuddenDeathTurns = 20
+
+  GetVariables()
+  AnimInit()
+  AddHogs()
+end
+
+function onGameStart()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  SetupEvents()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  gearDead[gear] = true
+  if GetGearType(gear) == gtHedgehog then
+    if GetHogTeamName(gear) == loc("Natives") then
+      for i = 1, nativesLeft do
+        if natives[i] == gear then
+          table.remove(natives, i)
+          table.remove(players, i)
+          nativesLeft = nativesLeft - 1
+          playersLeft = playersLeft - 1
+        end
+      end
+    elseif GetHogTeamName(gear) == loc("Cannibals") then
+      for i = 1, cannibalsLeft do
+        if cannibals[i] == gear then
+          table.remove(cannibals, i)
+          table.remove(players, nativesLeft + i)
+          cannibalsLeft = cannibalsLeft - 1
+          playersLeft = playersLeft - 1
+        end
+      end
+    elseif GetHogTeamName(gear) == loc("Hedge-cogs") then
+      for i = 1, cyborgsLeft do
+        if cyborgs[i] == gear then
+          table.remove(cyborgs, i)
+        end
+      end
+      cyborgsLeft = cyborgsLeft - 1
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amSkip, 9, 0, 0, 0)
+  SetAmmo(amSwitch, 9, 0, 0, 0)
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amSniperRifle, 9, 0, 0, 0)
+  SetAmmo(amBazooka, 8, 0, 0, 0)
+  SetAmmo(amGrenade, 7, 0, 0, 0)
+  SetAmmo(amFirePunch, 9, 0, 0, 0)
+  SetAmmo(amShotgun, 9, 0, 0, 0)
+
+  SetAmmo(amParachute, 9, 0, 0, 0)
+  SetAmmo(amRope, 9, 0, 0, 0)
+  SetAmmo(amPickHammer, 9, 0, 0, 0)
+  SetAmmo(amBlowTorch, 9, 0, 0, 0)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if playersDeadFresh then
+    playersDeadFresh = false
+    FailedMission()
+  elseif cyborgsDeadFresh then
+    cyborgsDeadFresh = false
+    WonMission()
+  elseif nativesDeadFresh and GetHogTeamName(CurrentHedgehog) == loc("Cannibals") then
+    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, cannibals!"), SAY_SHOUT, 0)
+    nativesDeadFresh = false
+  elseif cannibalsDeadFresh and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, cannibals!"), SAY_SHOUT, 0)
+    cannibalsDeadFresh = false
+  end
+end
+
+function onPrecise()
+  if GameTime > 3000 and AnimInProgress() then
+    SetAnimSkip(true)
+  end
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua
new file mode 100644
index 0000000..ec0e144
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/epil.lua	
@@ -0,0 +1,433 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Constants---------------------------------
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+ramonNum = 8
+spikyNum = 9
+princessNum = 10
+
+denseScene = 1
+princessScene = 2
+waterScene = 3
+cyborgScene = 4
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese"),
+               loc("Fell From Heaven")
+              }
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku", "rasta", "hair_yellow", "tiara"}
+
+nativePosCyborg = {{1900, 508}, {480, 1321}, {2927, 873},
+             {1325, 905}, {3190, 1424}, {1442, 857},
+             {1134, 1278}, {2881, 853}, {2974, 897},
+             {2033, 511}}
+nativeDirCyborg = {"Right", "Right", "Left", "Right", "Right", "Left", "Right", "Right", "Left", "Left"}
+
+nativePosPrincess = {{1930, 508}, {480, 1321}, {2927, 873},
+             {1325, 905}, {3190, 1424}, {2033, 511},
+             {1134, 1278}, {2881, 853}, {2974, 897},
+             {1900, 508}}
+nativeDirPrincess = {"Right", "Right", "Left", "Right", "Right", "Left", "Right", "Right", "Left", "Right"}
+
+nativePosDense = {{1930, 508}, {2285, 772}, {2927, 873},
+             {1325, 905}, {3190, 1424}, {1442, 857},
+             {1134, 1278}, {480, 1321}, {2974, 897},
+             {2033, 511}}
+nativeDirDense = {"Right", "Left", "Left", "Right", "Right", "Left", "Right", "Right", "Left", "Left"}
+
+nativePosWater = {{1900, 508}, {2033, 511}, {2285, 772},
+             {1325, 905}, {3190, 1424}, {1442, 857},
+             {1134, 1278}, {480, 1321}, {2974, 897},
+             {1980, 511}}
+nativeDirWater = {"Right", "Left", "Left", "Right", "Right", "Left", "Right", "Right", "Left", "Left"}
+
+prisonPos = {2285, 772}
+
+brainNum = 1
+corpseNum = 2
+brutalNum = 3
+earNum = 4
+hanniNum = 5
+
+cannibalNames = {loc("Brainiac"), loc("Corpse Thrower"), loc("Brutal Lily"), loc("Ear Sniffer"), loc("Hannibal")}
+cannibalHats = {"Zombi", "AkuAku", "Zombi", "Zombi", "IndianChief"}
+cannibalPos = {{533, 1304}, {1184, 1282}, {1386, 883}, {2854, 834}, {3243, 1415}}
+cannibalDir = {"Left", "Left", "Left", "Right", "Left"}
+-----------------------------Variables---------------------------------
+natives = {}
+cannibals = {}
+traitor = nil
+crate = nil
+
+startAnim = {}
+
+gearDead = {}
+--------------------------Anim skip functions--------------------------
+function SkipStartAnim()
+  SetGearMessage(CurrentHedgehog, 0)
+  AnimSwitchHog(natives[1])
+end
+
+function AfterStartAnim()
+  crate = SpawnHealthCrate(0, 0)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddNewEvent(CheckCrateTaken, {}, DoCrateTaken, {}, 1)
+  TurnTimeLeft = 0
+  ShowMission("Epilogue", "That's all folks!", "You have successfully finished the campaign!|If you wish to replay, there are other possible endings, too!|You can practice moving around and using utilities in this mission.|However, it will never end!", 1, 0)
+end
+
+---------------------------Events-------------------------------------
+function CheckCrateTaken()
+  return gearDead[crate]
+end
+
+function DoCrateTaken()
+  crate = SpawnHealthCrate(0, 0)
+end
+-----------------------------Animations--------------------------------
+function AnimationSetup()
+  if m8Scene == cyborgScene then 
+    SetupAnimCyborg()
+  elseif m8Scene == princessScene then
+    SetupAnimPrincess()
+  elseif m8Scene == waterScene then
+    SetupAnimWater()
+  else
+    SetupAnimDense()
+  end
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+end
+
+function SetupAnimWater()
+  startAnim = {
+    {func = AnimWait, args = {natives[1], 3000}},
+    {func = AnimCaption, args = {natives[ramonNum], "Back in the village, the two tribes finally started to live in harmony.", 5000}},
+    {func = AnimSay, args = {natives[ramonNum], "You got a killer mask there, amigo!", SAY_SAY, 5500}},
+    {func = AnimSay, args = {cannibals[brainNum], "Thanks, man! It really means a lot to me.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[wiseNum], "So, uhmm, how did you manage to teleport them so far?", SAY_SAY, 8000}},
+    {func = AnimSay, args = {cannibals[corpseNum], "It's all about the right carrots, you know.", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[wiseNum], "Of course! It's all obvious now!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "I can't believe how blind we were...", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "Fighting instead of cultivating a beautiful friendship.", SAY_SAY, 8500}},
+    {func = AnimSay, args = {cannibals[hanniNum], "One shall not judge one by one's appearance!", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[chiefNum], "You speak great truth, Hannibal. Here, take a sip!", SAY_SAY, 7500}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimSay, args = {natives[leaksNum], "It's amazing how quickly our lives can change...", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[waterNum], "Aye! Fellow! Let me exit this chamber of doom!", SAY_SAY, 7000}},
+    {func = AnimTurn, args = {natives[princessNum], "Right"}},
+    {func = AnimSay, args = {natives[princessNum], "It's your fault you're there!", SAY_SAY, 5000}},
+    {func = AnimTurn, args = {natives[princessNum], "Left"}},
+    {func = AnimSay, args = {natives[leaksNum], "I always suspected him!", SAY_SAY, 3000}},
+    {func = AnimSay, args = {natives[leaksNum], "Nobody takes walks every day!", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[princessNum], "I don't know who I can trust anymore.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[princessNum], "Everywhere I look, I see hogs walking around...", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[princessNum], "...and I think they are up to something. Something bad!", SAY_SAY, 8000}},
+    {func = AnimMove, args = {natives[leaksNum], "Right", nativePosWater[princessNum][1] - 30, nativePosWater[princessNum][2]}},
+    {func = AnimSay, args = {natives[leaksNum], "You can always trust me! I love you!", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[princessNum], "I know and I'm terribly sorry!", SAY_SAY, 5000}},
+    {func = AnimSay, args = {natives[princessNum], "I love Dense Cloud now!", SAY_SAY, 4000}},
+    {func = AnimTurn, args = {natives[princessNum], "Right"}},
+    {func = AnimMove, args = {natives[denseNum], "Left", nativePosWater[princessNum][1] + 20, nativePosWater[princessNum][2]}},
+    {func = AnimSay, args = {natives[denseNum], "Problems, dude? Chillax!", SAY_SAY, 4000}},
+    {func = AnimTurn, args = {natives[leaksNum], "Left"}},
+    {func = AnimSay, args = {natives[leaksNum], "(T_T)", SAY_SAY, 6000}},
+    {func = AnimSwitchHog, args = {natives[leaksNum]}},
+  }
+end
+
+function SetupAnimDense()
+  startAnim = {
+    {func = AnimWait, args = {natives[1], 3000}},
+    {func = AnimCaption, args = {natives[ramonNum], "Back in the village, the two tribes finally started to live in harmony.", 5000}},
+    {func = AnimSay, args = {natives[ramonNum], "You got a killer mask there, amigo!", SAY_SAY, 5500}},
+    {func = AnimSay, args = {cannibals[brainNum], "Thanks, man! It really means a lot to me.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[wiseNum], "So, uhmm, how did you manage to teleport them so far?", SAY_SAY, 8000}},
+    {func = AnimSay, args = {cannibals[corpseNum], "It's all about the right carrots, you know.", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[wiseNum], "Of course! It's all obvious now!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "I can't believe how blind we were...", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "Fighting instead of cultivating a beautiful friendship.", SAY_SAY, 8500}},
+    {func = AnimSay, args = {cannibals[hanniNum], "One shall not judge one by one's appearance!", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[chiefNum], "You speak great truth, Hannibal. Here, take a sip!", SAY_SAY, 7500}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimSay, args = {natives[waterNum], "...And then I took a stroll...", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[leaksNum], "It's amazing how quickly our lives can change...", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[denseNum], "Dude, let me out!", SAY_SAY, 3000}},
+    {func = AnimSay, args = {natives[denseNum], "I already said I'm sorry!", SAY_SAY, 4000}},
+    {func = AnimTurn, args = {natives[princessNum], "Right"}},
+    {func = AnimSay, args = {natives[princessNum], "Traitors don't get to shout around here!", SAY_SAY, 7000}},
+    {func = AnimTurn, args = {natives[princessNum], "Left"}},
+    {func = AnimSay, args = {natives[leaksNum], "I still can't believe he sold us out like that.", SAY_SAY, 8000}},
+    {func = AnimSay, args = {natives[princessNum], "I don't know who I can trust anymore.", SAY_SAY, 6000}},
+    {func = AnimMove, args = {natives[leaksNum], "Right", nativePosDense[princessNum][1] - 30, nativePosDense[princessNum][2]}},
+    {func = AnimSay, args = {natives[leaksNum], "You can always trust me!", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[princessNum], "I know, my hero!", SAY_SAY, 3000}},
+    {func = AnimSay, args = {natives[princessNum], "...xoxo...", SAY_SAY, 2000}},
+    {func = AnimSwitchHog, args = {natives[leaksNum]}},
+  }
+end
+
+function SetupAnimCyborg()
+  startAnim = {
+    {func = AnimWait, args = {natives[1], 3000}},
+    {func = AnimCaption, args = {natives[denseNum], "Back in the village, the two tribes finally started to live in harmony.", 5000}},
+    {func = AnimSay, args = {natives[denseNum], "Dude, that outfit is so kool!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {cannibals[brainNum], "Thanks, dude! It really means a lot to me.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[wiseNum], "So, uhmm, how did you manage to teleport them so far?", SAY_SAY, 8000}},
+    {func = AnimSay, args = {cannibals[corpseNum], "It's all about the right carrots, you know.", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[wiseNum], "Of course! It's all obvious now!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "I can't believe how blind we were...", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "Fighting instead of cultivating a beautiful friendship.", SAY_SAY, 8500}},
+    {func = AnimSay, args = {cannibals[hanniNum], "One shall not judge one by one's appearance!", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[chiefNum], "You speak great truth, Hannibal. Here, take a sip!", SAY_SAY, 7500}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimSay, args = {natives[waterNum], "...And then I took a stroll...", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[leaksNum], "I'm glad this is over!", SAY_SAY, 4000}},
+    {func = AnimMove, args = {natives[princessNum], "Right", nativePosCyborg[princessNum][1] + 30, nativePosCyborg[princessNum][2]}},
+    {func = AnimSay, args = {natives[princessNum], "I was so scared.", SAY_SAY, 2500}},
+    {func = AnimMove, args = {natives[leaksNum], "Right", nativePosCyborg[princessNum][1], nativePosCyborg[princessNum][2]}},
+    {func = AnimSay, args = {natives[leaksNum], "You have nothing to be afraid of now.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[leaksNum], "I'll protect you!", SAY_SAY, 3000}},
+    {func = AnimTurn, args = {natives[princessNum], "Left"}},
+    {func = AnimSay, args = {natives[princessNum], "You're so brave...I feel safe with you.", SAY_SAY, 6500}},
+    {func = AnimSay, args = {natives[princessNum], "I think I love you!", SAY_SAY, 3500}},
+    {func = AnimSay, args = {natives[leaksNum], "I...like being with you too.", SAY_SAY, 4500}},
+  }
+end
+
+function SetupAnimPrincess()
+  startAnim = {
+    {func = AnimWait, args = {natives[1], 3000}},
+    {func = AnimCaption, args = {natives[denseNum], "Back in the village, the two tribes finally started to live in harmony.", 5000}},
+    {func = AnimSay, args = {natives[denseNum], "Dude, that outfit is so kool!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {cannibals[brainNum], "Thanks, dude! It really means a lot to me.", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[wiseNum], "So, uhmm, how did you manage to teleport them so far?", SAY_SAY, 8000}},
+    {func = AnimSay, args = {cannibals[corpseNum], "It's all about the right carrots, you know.", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[wiseNum], "Of course! It's all obvious now!", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "I can't believe how blind we were...", SAY_SAY, 4500}},
+    {func = AnimSay, args = {natives[chiefNum], "Fighting instead of cultivating a beautiful friendship.", SAY_SAY, 8500}},
+    {func = AnimSay, args = {cannibals[hanniNum], "One shall not judge one by one's appearance!", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[chiefNum], "You speak great truth, Hannibal. Here, take a sip!", SAY_SAY, 7500}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimVisualGear, args = {cannibals[hanniNum], cannibalPos[hanniNum][1], cannibalPos[hanniNum][2], vgtSmoke, 0, true}},
+    {func = AnimWait, args = {natives[1], 1000}},
+    {func = AnimSay, args = {natives[buffaloNum], "So I shook my fist in the air!", SAY_SAY, 5000}},
+    {func = AnimSay, args = {cannibals[brutalNum], "Well that was an unnecessary act of violence.", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[waterNum], "...And then I took a stroll...", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[leaksNum], "I'm glad this is over!", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[girlNum], "I still can't believe you forgave her!", SAY_SAY, 6000}},
+    {func = AnimSay, args = {natives[girlNum], "She endangered the whole tribe!", SAY_SAY, 5000}},
+    {func = AnimSay, args = {natives[leaksNum], "It wasn't her fault!", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[leaksNum], "We oppressed her, the only woman in the tribe!", SAY_SAY, 7000}},
+    {func = AnimSay, args = {natives[girlNum], "The only woman, huh?", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[girlNum], "Then what am I?", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[leaksNum], "Of course, but you're...special.", SAY_SAY, 5000}},
+    {func = AnimSay, args = {natives[girlNum], "Sure!", SAY_SAY, 2000}},
+    {func = AnimTurn, args = {natives[leaksNum], "Left"}},
+    {func = AnimSay, args = {natives[leaksNum], "We're terribly sorry!", SAY_SAY, 4000}},
+    {func = AnimSay, args = {natives[princessNum], "I don't know if I can forget what you've done!", SAY_SAY, 7000}},
+    {func = AnimTurn, args = {natives[princessNum], "Left"}},
+    {func = AnimMove, args = {natives[princessNum], "Left", nativePosPrincess[princessNum][1] - 10, nativePosPrincess[princessNum][2]}},
+    {func = AnimSwitchHog, args = {natives[leaksNum]}}
+  }
+end
+-----------------------------Misc--------------------------------------
+function GetVariables()
+  m8Scene = tonumber(GetCampaignVar("M8Scene"))
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 1, 5 do
+    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+  end
+
+	AddTeam(loc("More Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 6, 10 do
+    natives[i] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+  end
+
+	AddTeam(loc("Cannibals"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 1, 5 do
+    cannibals[i] = AddHog(cannibalNames[i], 0, 100, cannibalHats[i])
+  end
+
+  if m8Scene == denseScene or m8Scene == waterScene then
+    AddTeam(loc("Traitors"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+    if m8Scene == denseScene then
+      DeleteGear(natives[2])
+      natives[2] = AddHog(nativeNames[2], 0, 100, nativeHats[2])
+    else
+      DeleteGear(natives[3])
+      natives[3] = AddHog(nativeNames[3], 0, 100, nativeHats[3])
+    end
+  end
+
+  SetGearPositions()
+end
+
+function SetGearPositions()
+  if m8Scene == cyborgScene then
+    for i = 1, 10 do
+      AnimSetGearPosition(natives[i], unpack(nativePosCyborg[i]))
+      AnimTurn(natives[i], nativeDirCyborg[i])
+    end
+  elseif m8Scene == waterScene then
+    for i = 1, 10 do
+      AnimSetGearPosition(natives[i], unpack(nativePosWater[i]))
+      AnimTurn(natives[i], nativeDirWater[i])
+    end
+  elseif m8Scene == denseScene then
+    for i = 1, 10 do
+      AnimSetGearPosition(natives[i], unpack(nativePosDense[i]))
+      AnimTurn(natives[i], nativeDirDense[i])
+    end
+  else
+    for i = 1, 10 do
+      AnimSetGearPosition(natives[i], unpack(nativePosPrincess[i]))
+      AnimTurn(natives[i], nativeDirPrincess[i])
+    end
+  end
+
+  for i = 1, 5 do
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+    AnimTurn(cannibals[i], cannibalDir[i])
+  end
+end
+
+function SetupPlace()
+  if m8Scene == denseScene or m8Scene == waterScene then
+    PlaceGirder(2296, 798, 4)
+    PlaceGirder(2296, 700, 4)
+    PlaceGirder(2225, 750, 2)
+    PlaceGirder(2245, 750, 2)
+    PlaceGirder(2265, 750, 2)
+    PlaceGirder(2305, 750, 2)
+    PlaceGirder(2345, 750, 2)
+    PlaceGirder(2365, 750, 2)
+  end
+  if m8Scene == denseScene then
+    traitor = natives[denseNum]
+  elseif m8Scene == waterScene then
+    traitor = natives[waterNum]
+  end
+end
+-----------------------------Main Functions----------------------------
+function onGameInit()
+	Seed = 1
+	GameFlags = gfOneClanMode
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+  Map = "Hogville"
+	Theme = "Nature"
+  SuddenDeathTurns = 3000
+
+  GetVariables()
+  AddHogs()
+  AnimInit()
+end
+
+function onGameStart()
+  SetupPlace()
+  AnimationSetup()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  gearDead[gear] = true
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amAirStrike, 9, 0, 0, 0)
+  SetAmmo(amBaseballBat, 9, 0, 0, 0)
+  SetAmmo(amBazooka, 9, 0, 0, 0)
+  SetAmmo(amBlowTorch, 9, 0, 0, 0)
+	SetAmmo(amClusterBomb,9, 0, 0, 0)
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amDrill, 9, 0, 0, 4)
+  SetAmmo(amDynamite, 9, 0, 0, 3)
+  SetAmmo(amFirePunch, 9, 0, 0, 0)
+  SetAmmo(amFlamethrower, 9, 0, 0, 3)
+  SetAmmo(amGirder, 9, 0, 0, 0)
+  SetAmmo(amGrenade, 9, 0, 0, 0)
+  SetAmmo(amHammer, 9, 0, 0, 0)
+  SetAmmo(amJetpack, 9, 0, 0, 0)
+  SetAmmo(amLandGun, 9, 0, 0, 0)
+  SetAmmo(amLowGravity, 9, 0, 0, 2)
+  SetAmmo(amMine, 9, 0, 0, 2)
+  SetAmmo(amMolotov, 9, 0, 0, 3)
+  SetAmmo(amMortar, 9, 0, 0, 4)
+  SetAmmo(amNapalm, 9, 0, 0, 4)
+  SetAmmo(amParachute, 9, 0, 0, 0)
+  SetAmmo(amPickHammer, 9, 0, 0, 0)
+  SetAmmo(amPortalGun, 9, 0, 0, 0)
+  SetAmmo(amRope, 9, 0, 0, 0)
+  SetAmmo(amRCPlane, 9, 0, 0, 0)
+  SetAmmo(amSkip, 9, 0, 0, 0)
+  SetAmmo(amShotgun, 9, 0, 0, 0)
+  SetAmmo(amSMine, 9, 0, 0, 2)
+  SetAmmo(amSniperRifle, 9, 0, 0, 0)
+  SetAmmo(amSnowball, 9, 0, 0, 0)
+  SetAmmo(amSwitch, 9, 0, 0, 0)
+  SetAmmo(amTeleport, 9, 0, 0, 0)
+	SetAmmo(amWatermelon, 9, 0, 0, 0)
+  SetAmmo(amWhip, 9, 0, 0, 0)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if CurrentHedgehog == traitor then
+    TurnTimeLeft = 0
+  else
+    TurnTimeLeft = -1
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 then
+    SetAnimSkip(true)
+  end
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua
new file mode 100644
index 0000000..c3e6265
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua	
@@ -0,0 +1,566 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Map--------------------------------------
+local map = 
+{
+	"\255\242\4\218\132\0\53\4\253\0\0\53\4\253\132\0\102\5\92\0\0\102\5\92\132\0\106\5\205\0\0\106\5\205\132\1\1\6\37\0",
+	"\1\1\6\37\132\1\124\6\160\0\1\113\6\160\132\2\157\6\111\0\2\164\6\107\132\2\252\6\178\0\2\252\6\178\132\3\224\4\179\0",
+	"\3\224\4\179\132\3\38\2\209\0\3\38\2\209\132\4\109\3\179\0\4\109\3\179\132\5\124\3\172\0\5\128\3\172\132\6\69\4\239\0",
+	"\6\69\4\239\132\7\175\4\32\0\7\172\4\46\132\8\116\5\18\0\3\38\2\213\132\3\41\1\244\0\3\41\1\244\132\3\94\2\245\0",
+	"\8\127\5\8\132\8\127\0\14\0\8\127\0\14\132\8\194\5\29\0\8\194\5\29\132\9\36\5\82\0\9\29\5\75\132\9\180\5\103\0",
+	"\9\194\5\92\132\10\51\6\5\0\10\51\6\5\132\10\216\5\152\0\10\227\5\145\132\11\189\5\212\0\11\189\5\212\132\12\91\5\131\0",
+	"\12\91\5\131\132\12\253\5\191\0\12\253\5\191\132\13\149\5\106\0\13\149\5\106\132\16\11\5\106\0\14\19\5\110\132\14\16\4\236\0",
+	"\14\16\4\236\132\15\66\4\236\0\15\66\4\236\132\15\66\5\110\0\14\79\4\194\132\15\6\4\194\0\14\255\4\176\132\14\255\4\49\0",
+	"\14\255\4\49\132\14\76\4\53\0\14\76\4\53\132\14\76\4\201\0\14\125\4\74\128\14\128\4\187\0\14\188\4\77\128\14\185\4\179\0",
+	"\14\111\4\39\129\14\76\3\252\0\14\72\3\249\129\14\72\3\147\0\14\72\3\147\129\14\97\3\235\0\14\97\3\235\129\14\146\4\28\0",
+	"\14\202\4\28\129\14\248\3\238\0\14\248\3\238\129\15\17\3\133\0\15\17\3\133\129\15\27\3\235\0\15\27\3\235\129\14\230\4\49\0",
+	"\1\124\6\220\130\1\244\7\13\0\1\244\7\13\130\2\104\6\206\0\2\100\6\206\130\2\30\6\178\0\2\12\6\181\130\1\135\6\213\0",
+	"\3\172\7\136\130\15\41\7\136\0\15\41\7\136\130\15\41\7\62\0\15\41\7\62\130\3\175\7\52\0\3\175\7\52\130\3\126\6\206\0",
+	"\3\126\6\206\130\3\122\7\133\0\3\122\7\133\130\3\186\7\136\0\8\123\7\94\136\9\173\7\101\0\8\88\7\66\130\8\88\7\119\0",
+	"\9\212\7\69\130\9\212\7\126\0\8\155\0\14\133\8\151\5\11\0\8\190\2\160\131\8\194\5\1\0\14\83\3\235\131\14\114\4\21\0",
+	"\15\10\3\196\131\15\10\3\235\0\15\10\3\235\131\14\220\4\32\0\14\65\5\47\137\15\20\5\36\0\15\41\5\82\132\15\41\5\82\0",
+	"\3\94\3\17\138\4\137\5\124\0\3\221\3\119\138\5\57\4\250\0\4\102\4\67\160\5\26\4\74\0\4\113\5\36\161\5\142\4\222\0",
+	"\4\42\5\216\169\9\89\6\26\0\6\100\5\22\145\8\134\5\64\0\6\255\4\197\140\7\161\4\120\0\7\214\4\204\146\7\214\4\204\0",
+	"\10\55\6\97\147\11\13\5\247\0\11\59\6\26\146\11\224\6\30\0\12\95\6\16\153\14\55\6\90\0\13\173\5\226\153\15\196\5\212\0",
+	"\15\172\7\91\152\15\165\5\230\0\15\235\7\221\142\255\238\7\207\0\14\248\6\188\152\3\217\6\178\0\3\112\6\83\143\3\31\7\101\0",
+	"\3\73\7\143\140\3\73\7\143\0\15\62\7\13\140\15\62\7\13\0\15\101\7\157\140\15\101\7\157\0\2\181\6\220\141\1\205\7\108\0",
+	"\2\86\6\160\137\2\150\6\128\0\2\26\6\153\134\1\96\6\195\0\1\82\6\241\136\1\226\7\59\0\2\157\7\98\155\2\157\7\98\0",
+	"\1\64\7\80\149\255\249\7\27\0\1\4\6\174\148\0\25\6\86\0\0\211\6\58\139\0\7\5\219\0\0\35\5\159\142\0\4\5\47\0",
+	"\8\123\0\14\199\8\187\0\11\0\16\14\5\99\199\16\14\7\245\0\255\235\4\218\199\255\238\8\25\0\8\67\2\72\202\8\208\2\72\0",
+	"\8\141\1\251\202\8\141\0\74\0\8\201\2\143\195\8\204\4\49\0\8\84\2\185\205\8\204\2\188\0\8\99\2\230\205\8\187\2\230\0",
+	"\8\165\3\41\131\8\144\3\3\0\8\144\3\3\131\8\60\2\248\0\8\60\2\248\131\7\252\3\59\0\7\252\3\59\131\8\137\3\31\0",
+	"\8\56\3\20\131\8\102\3\20\0\8\60\3\13\194\8\60\3\13\0\8\60\3\3\128\8\60\3\31\0\7\238\3\66\128\7\214\3\84\0",
+	"\7\217\3\87\128\7\217\3\98\0\7\217\3\87\128\7\200\3\91\0\6\209\4\70\208\8\18\4\95\0\0\11\4\225\131\0\0\8\21\0",
+	"\15\224\5\99\131\15\245\7\252\0\15\242\5\191\192\15\196\6\33\0\15\196\6\33\192\15\245\6\209\0\15\245\6\209\192\15\193\7\115\0",
+	"\15\193\7\115\192\15\235\8\18\0\15\249\5\223\196\15\217\6\40\0\15\217\6\40\196\16\4\6\188\0\15\245\6\16\196\16\21\7\77\0",
+	"\16\0\6\245\196\15\214\7\112\0\15\207\7\129\196\16\0\8\4\0\15\245\7\80\196\16\4\7\207\0\15\221\5\85\196\16\11\5\184\0",
+}
+--------------------------------------------Constants------------------------------------
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+choiceEliminate = 1
+choiceSpare = 2
+
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese")
+              }
+
+nativeUnNames = {loc("Zork"), loc("Steve"), loc("Jack"),
+                 loc("Lee"), loc("Elmo"), loc("Rachel"),
+                 loc("Muriel")}
+
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku", "rasta", "hair_yellow"}
+
+nativePos = {{110, 1310}, {984, 1907}, {1040, 1907}}
+nativePos2 = {196, 1499}
+
+cyborgNames = {loc("Unit 0x0007"), loc("Hogminator"), loc("Carol"), 
+               loc("Blender"), loc("Elderbot"), loc("Fiery Water")}
+cyborgsDif = {2, 2, 2, 2, 2, 1}
+cyborgsHealth = {45, 45, 45, 40, 40, 20}
+cyborgPos = {945, 1216}
+cyborgsNum = 6
+cyborgsPos = {{2243, 1043}, {3588, 1227}, {2781, 1388},
+              {3749, 1040}, {2475, 1338}, {3853, 881}}
+cyborgsDir = {"Left", "Left", "Left", "Left", "Left", "Right"}
+
+princessPos = {3737, 1181}
+crateConsts = {}
+reactions = {}
+
+nativeMidPos = {1991, 841}
+cyborgMidPos = {2109, 726}
+nativeMidPos2 = {2250, 1071}
+-----------------------------Variables---------------------------------
+natives = {}
+native = nil
+
+cyborgs = {}
+cyborg = nil
+
+gearDead = {}
+hedgeHidden = {}
+
+startAnim = {}
+midAnim = {}
+
+freshDead = nil
+crates = {}
+cratesNum = 0
+-----------------------------Animations--------------------------------
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function AnimationSetup()
+  table.insert(startAnim, {func = AnimWait, args = {natives[1], 4000}})
+  table.insert(startAnim, {func = AnimMove, args = {natives[1], "Right", unpack(nativePos2)}})
+  if m5DeployedNum == leaksNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Those aliens are destroying the island!"), SAY_THINK, 5000}})
+  elseif m5DeployedNum == denseNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Dude, all the plants are gone!"), SAY_THINK, 3500}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("What am I gonna...eat, yo?"), SAY_THINK, 3500}})
+  elseif m5DeployedNum == girlNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Fell From Heaven is the best! Fell From Heaven is the greatest!"), SAY_THINK, 7000}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Yuck! I bet they'll keep worshipping her even after I save the village!"), SAY_THINK, 7500}})
+  elseif m5DeployedNum == chiefNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I'm getting old for this!"), SAY_THINK, 4000}})
+  elseif m5DeployedNum == waterNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I'm getting thirsty..."), SAY_THINK, 3000}})
+  elseif m5DeployedNum == buffaloNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I wonder why I'm so angry all the time..."), SAY_THINK, 6000}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("It must be a childhood trauma..."), SAY_THINK, 4000}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Just wait till I get my hands on that trauma! ARGH!"), SAY_THINK, 6500}})
+  elseif m5DeployedNum == wiseNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("I could just teleport myself there..."), SAY_THINK, 4500}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("It's a shame, I forgot how to do that!"), SAY_THINK, 4500}})
+  end
+  table.insert(startAnim, {func = AnimCustomFunction, args = {natives[1], RestoreHedge, {cyborg}}})
+  table.insert(startAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(startAnim, {func = AnimTurn, args = {natives[2], "Left"}})
+  table.insert(startAnim, {func = AnimTurn, args = {natives[3], "Left"}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Hello again, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I just found out that they have captured your princess!"), SAY_SAY, 7000}})
+  if m5DeployedNum == girlNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Of course I have to save her. What did I expect?!"), SAY_SAY, 7000}})
+  elseif m5DeployedNum == denseNum then
+    table.insert(startAnim, {func = AnimCustomFunction, args = {natives[1], EmitDenseClouds, {"Right"}}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("She's behind that tall thingy."), SAY_SAY, 5000}})
+  table.insert(startAnim, {func = FollowGear, swh = false, args = {princess}})
+  table.insert(startAnim, {func = AnimWait, swh = false, args = {princess, 1000}})
+  table.insert(startAnim, {func = FollowGear, swh = false, args = {cyborg}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I'm here to help you rescue her."), SAY_SAY, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[2], loc("Yo, dude, we're here, too!"), SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[3], loc("We were trying to save her and we got lost."), SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("That's typical of you!"), SAY_SAY, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Why are you helping us, uhm...?"), SAY_SAY, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Call me Beep! Well, 'cause I'm such a nice...person!"), SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(startAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(startAnim, {func = AnimWait, args = {natives[1], 1}})
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+
+  table.insert(midAnim, {func = AnimCustomFunction, args = {natives[1], RestoreHedge, {cyborg}}})
+  table.insert(midAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgMidPos)}}) 
+  table.insert(midAnim, {func = AnimTurn, args = {cyborg, "Left"}})
+  table.insert(midAnim, {func = AnimTeleportGear, args = {natives[1], unpack(nativeMidPos)}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Here, let me help you save her!"), SAY_SAY, 5000}})
+  table.insert(midAnim, {func = AnimSay, args = {natives[1], loc("Thanks!"), SAY_SAY, 2000}})
+  table.insert(midAnim, {func = AnimTeleportGear, args = {natives[1], unpack(nativeMidPos2)}})
+  table.insert(midAnim, {func = AnimSay, args = {natives[1], loc("Why can't he just let her go?!"), SAY_THINK, 5000}})
+  AddSkipFunction(midAnim, SkipMidAnim, {})
+end
+
+--------------------------Anim skip functions--------------------------
+function AfterMidAnim()
+  HideHedge(cyborg)
+  SetupPlace3()
+  SetGearMessage(natives[1], 0)
+  AddNewEvent(CheckPrincessFreed, {}, DoPrincessFreed, {}, 0)
+  TurnTimeLeft = 0
+  ShowMission(loc("Family Reunion"), loc("Salvation"), loc("Get your teammates out of their natural prison and save the princess!|Hint: Drilling holes should solve everything.|Hint: It might be a good idea to place a girder before starting to drill. Just saying.|Hint: All your hedgehogs need to be above the marked height!|Hint: Leaks A Lot needs to get really close to the princess!"), 1, 7000)
+  vCirc = AddVisualGear(0,0,vgtCircle,0,true)
+  SetVisualGearValues(vCirc, 2625, 1500, 100, 255, 1, 10, 0, 120, 3, 0xff00ffff)
+end
+  
+function SkipMidAnim()
+  AnimTeleportGear(natives[1], unpack(nativeMidPos2))
+  SkipStartAnim()
+end
+
+function SetupPlace3()
+  SpawnUtilityCrate(2086, 1887, amRope, 1)
+  SpawnUtilityCrate(2147, 728, amBlowTorch, 2)
+  SpawnUtilityCrate(2778, 1372, amPickHammer, 3)
+  SpawnUtilityCrate(2579, 1886, amPickHammer, 3)
+  SpawnUtilityCrate(2622, 1893, amGirder, 1)
+  SpawnUtilityCrate(2671, 1883, amPortalGun, 3)
+  SpawnUtilityCrate(2831, 1384, amGirder, 3)
+
+  SetTimer(AddGear(2725, 1387, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2760, 1351, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2805, 1287, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2831, 1376, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2684, 1409, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2637, 1428, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2278, 1280, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2311, 1160, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2339, 1162, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2362, 1184, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2407, 1117, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2437, 1143, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2472, 1309, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2495, 1331, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2536, 1340, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2569, 1360, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2619, 1379, gtMine, 0, 0, 0, 0), 5000)
+	SetTimer(AddGear(2596, 1246, gtMine, 0, 0, 0, 0), 5000)
+end
+
+function SkipStartAnim()
+  AnimSwitchHog(natives[1])
+  AnimWait(natives[1], 1)
+end
+
+function AfterStartAnim()
+  HideHedge(cyborg)
+  SetupPlace2()
+  SetGearMessage(natives[1], 0)
+  AddNewEvent(CheckGearDead, {natives[1]}, EndMission, {}, 0)
+  AddNewEvent(CheckGearDead, {natives[2]}, EndMission, {}, 0)
+  AddNewEvent(CheckGearDead, {natives[3]}, EndMission, {}, 0)
+  AddNewEvent(CheckGearDead, {princess}, EndMission, {}, 0)
+  AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
+  for i = 1, cyborgsNum do
+    AddNewEvent(CheckGearDead, {cyborgs[i]}, DoCyborgDead, {i}, 0)
+  end
+  AddNewEvent(CheckOutOfCluster, {}, DoOutOfCluster, {}, 1)
+  AddNewEvent(CheckOutOfGrenade, {}, DoOutOfGrenade, {}, 1)
+--  AddNewEvent(CheckNeedToHide, {}, DoNeedToHide, {}, 1)
+  TurnTimeLeft = TurnTime
+  ShowMission(loc("Family Reunion"), loc("Hostage Situation"), loc("Save the princess! All your hogs must survive!|Hint: Kill the cyborgs first! Use the ammo very carefully!|Hint: You might want to spare a girder for cover!"), 1, 7000)
+end
+
+function SetupPlace2()
+	PlaceGirder(709, 564, 7)
+	PlaceGirder(591, 677, 7)
+	PlaceGirder(473, 794, 7)
+	PlaceGirder(433, 933, 5)
+	PlaceGirder(553, 1052, 5)
+	PlaceGirder(674, 1170, 5)
+	PlaceGirder(710, 1310, 7)
+	PlaceGirder(648, 1427, 5)
+  PlaceGirder(2110, 980, 0)
+
+	SpawnAmmoCrate(814, 407, amBazooka, 4)
+	clusterCrate = SpawnAmmoCrate(862, 494, amClusterBomb, 4)
+	SpawnAmmoCrate(855, 486, amBee, 3)
+	grenadeCrate1 = SpawnAmmoCrate(849, 459, amGrenade, 4)
+	SpawnAmmoCrate(2077, 847, amWatermelon, 3)
+	grenadeCrate2 = SpawnAmmoCrate(2122, 847, amGrenade, 3)
+
+	SpawnUtilityCrate(747, 1577, amPickHammer, 1)
+	SpawnUtilityCrate(496, 1757, amGirder, 2)
+  SpawnUtilityCrate(1809, 1880, amGirder, 1)
+	SpawnUtilityCrate(530, 1747, amPortalGun, 1)
+end
+
+-----------------------------Events------------------------------------
+function CheckPrincessFreed()
+  if GetX(natives[1]) == nil or GetX(natives[2]) == nil or GetX(natives[3]) == nil or GetX(princess) == nil then
+    return false
+  end
+  return math.abs(GetX(natives[1]) - GetX(princess)) <= 15 and math.abs(GetY(natives[1]) - GetY(princess)) <= 15 and StoppedGear(natives[1]) 
+        and GetY(natives[2]) < 1500 and GetY(natives[3]) < 1500 and StoppedGear(natives[2]) and StoppedGear(natives[3])
+end
+
+function DoPrincessFreed()
+  AnimSay(princess, loc("Thank you, my hero!"), SAY_SAY, 0)
+  SaveCampaignVar("Progress", "7")
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckCyborgsDead()
+  return cyborgsLeft == 0
+end
+
+function DoCyborgsDead()
+  SetGearMessage(CurrentHedgehog, 0)
+  RestoreHedge(princess)
+--  RemoveEventFunc(CheckNeedToHide)
+  AddAnim(midAnim)
+  AddFunction({func = AfterMidAnim, args = {}})
+end
+
+function DoCyborgDead(index)
+  if cyborgsLeft == 0 then
+    return
+  end
+  if index == 1 then
+    SpawnAmmoCrate(1700, 407, amBazooka, 3)
+  elseif index == 2 then
+    SpawnAmmoCrate(1862, 494, amClusterBomb, 3)
+  elseif index == 3 then
+  	SpawnAmmoCrate(1855, 486, amBee, 1)
+  elseif index == 4 then
+    SpawnAmmoCrate(1849, 459, amGrenade, 3)
+  elseif index == 5 then
+    SpawnAmmoCrate(2122, 847, amGrenade, 3)
+  elseif index == 6 then
+    SpawnAmmoCrate(2077, 847, amWatermelon, 1)
+  end
+end
+
+function CheckGearsDead(gearList)
+  for i = 1, # gearList do
+    if gearDead[gearList[i]] ~= true then
+      return false
+    end
+  end
+  return true
+end
+
+
+function CheckGearDead(gear)
+  return gearDead[gear]
+end
+
+function EndMission()
+  RemoveEventFunc(CheckPrincessFreed)
+  AddCaption("So the princess was never heard of again...")
+  ParseCommand("teamgone " .. loc("Natives"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckOutOfCluster()
+  return CheckGearDead(clusterCrate) and GetAmmoCount(natives[1], amClusterBomb) == 0
+end
+
+function CheckOutOfGrenade()
+  return CheckGearDead(grenadeCrate1) and CheckGearDead(grenadeCrate2) and GetAmmoCount(natives[1], amGrenade) == 0
+end
+
+function DoOutOfCluster()
+  if (GetX(natives[1]) == nil) then
+    return
+  end
+  clusterCrate = SpawnAmmoCrate(GetX(natives[1]) - 50, GetY(natives[1]) - 50, amClusterBomb, 3)
+end
+
+function DoOutOfGrenade()
+  if (GetX(natives[1]) == nil) then
+    return
+  end
+  grenadeCrate2 = SpawnAmmoCrate(GetX(natives[1]) - 50, GetY(natives[1]) - 50, amGrenade, 3)
+end
+
+function CheckNeedToHide()
+  if gearDead[princess] == true then
+    return false
+  end
+  return TurnTimeLeft == 0
+end
+
+function DoNeedToHide()
+  HideHedge(princess)
+end
+-----------------------------Misc--------------------------------------
+function HideHedge(hedge)
+  if hedgeHidden[hedge] ~= true then
+    HideHog(hedge)
+    hedgeHidden[hedge] = true
+  end
+end
+
+function RestoreHedge(hedge)
+  if hedgeHidden[hedge] == true then
+    RestoreHog(hedge)
+    hedgeHidden[hedge] = false
+  end
+end
+
+function GetVariables()
+  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum"))
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+  m5Choice = tonumber(GetCampaignVar("M5Choice"))
+end
+
+function SetupPlace()
+  SetHogHat(natives[1], nativeHats[m5DeployedNum])
+  SetHogName(natives[1], nativeNames[m5DeployedNum])
+  if m2Choice ~= choiceAccepted or m5Choice ~= choiceEliminate then
+    DeleteGear(cyborgs[cyborgsNum])
+    cyborgsNum = cyborgsNum - 1
+  end
+  HideHedge(cyborg)
+end
+
+function SetupAmmo()
+  AddAmmo(cyborgs[1], amBazooka, 100)
+  AddAmmo(cyborgs[1], amGrenade, 100)
+  AddAmmo(cyborgs[1], amClusterBomb, 100)
+  AddAmmo(cyborgs[1], amSniperRifle, 1)
+  AddAmmo(cyborgs[1], amDynamite, 100)
+  AddAmmo(cyborgs[1], amBaseballBat, 100)
+  AddAmmo(cyborgs[1], amMolotov, 100)
+  AddAmmo(cyborgs[1], amWatermelon, 1)
+  AddAmmo(cyborgs[1], amAirStrike, 2)
+  AddAmmo(cyborgs[1], amDrillStrike, 1)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 7, 9 do
+    natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+    gearDead[natives[i-6]] = false
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+  princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
+  gearDead[cyborg] = false
+  gearDead[princess] = false
+
+  AddTeam(loc("Biomechanic Team"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  for i = 1, cyborgsNum do
+    cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
+    gearDead[cyborgs[i]] = false
+  end
+  cyborgsLeft = cyborgsNum
+
+  for i = 1, 3 do
+    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
+  end
+
+  AnimSetGearPosition(cyborg, unpack(cyborgPos))
+  AnimSetGearPosition(princess, unpack(princessPos))
+  AnimTurn(princess, "Left")
+
+  for i = 1, cyborgsNum do
+    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
+    AnimTurn(cyborgs[i], cyborgsDir[i])
+  end
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl == nil or xd == nil then
+    return
+  end
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfSolidLand + gfDisableLandObjects + gfDisableGirders
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+  MapGen = 2
+	Theme = "Hell"
+  SuddenDeathTurns = 35
+
+	for i = 1, #map do
+		ParseCommand('draw ' .. map[i])
+	end
+
+  AddHogs()
+  AnimInit()
+end
+
+function onGameStart()
+  GetVariables()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  gearDead[gear] = true
+  if GetGearType(gear) == gtHedgehog then
+    if GetHogTeamName(gear) == loc("Biomechanic Team") then
+      cyborgsLeft = cyborgsLeft - 1
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amSkip, 9, 0, 0, 0)
+  SetAmmo(amSwitch, 9, 0, 0, 0)
+	SetAmmo(amBazooka, 0, 0, 0, 8)
+	SetAmmo(amClusterBomb,0, 0, 0, 8)
+	SetAmmo(amBee, 0, 0, 0, 3)
+	SetAmmo(amGrenade, 0, 0, 0, 8)
+	SetAmmo(amWatermelon, 0, 0, 0, 2)
+	SetAmmo(amSniperRifle, 0, 0, 0, 3)
+	SetAmmo(amPickHammer, 0, 0, 0, 1)
+	SetAmmo(amGirder, 0, 0, 0, 3)
+	SetAmmo(amPortalGun, 0, 0, 0, 1)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if GetHogTeamName(CurrentHedgehog) == loc("011101001") then
+    if CheckCyborgsDead() ~= true then
+      for i = 1, 3 do
+        if gearDead[natives[i]] ~= true then
+          HideHedge(natives[i])
+        end
+      end
+    end
+    TurnTimeLeft = 0
+  else
+    for i = 1, 3 do
+      if gearDead[natives[i]] ~= true then
+        RestoreHedge(natives[i])
+      end
+    end
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+    return
+  end
+--  HideHedge(princess)
+--  for i = 1, 5 do
+--    DeleteGear(cyborgs[i])
+--  end
+--  AddAmmo(natives[1], amTeleport, 100)
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua
new file mode 100644
index 0000000..af3737e
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua	
@@ -0,0 +1,742 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Variables---------------------------------
+startDialogue = {}
+damageAnim = {}
+onShroomAnim = {}
+onFlowerAnim = {}
+tookParaAnim = {}
+tookPunchAnim = {}
+onMoleHeadAnim = {}
+tookRope2Anim = {}
+challengeAnim = {}
+challengeFailedAnim = {}
+challengeCompletedAnim = {}
+beforeKillAnim = {}
+closeCannim = {}
+cannKilledAnim = {}
+cannKilledEarlyAnim = {}
+princessDamagedAnim = {}
+elderDamagedAnim = {}
+pastMoleHeadAnim = {}
+
+
+targets = {}
+crates = {}
+targXdif2 = {2755, 2638, 2921, 2973, 3162, 3067, 3062, 1300}
+targYdif2 = {1197, 1537, 1646, 1857, 1804, 1173, 1167, 1183}
+targXdif1 = {2749, 2909, 2770, 2836, 1558, 1305}
+targYdif1 = {1179, 1313, 1734, 1441, 1152, 1259}
+targetPosX = {{821, 866, 789}, {614, 656, 638}, {1238, 1237, 1200}}
+targetPosY = {{1342, 1347, 1326}, {1112, 1121, 1061}, {1152, 1111, 1111}}
+crateNum = {6, 8}
+
+
+stage = 1
+cratesCollected = 0
+chalTries = 0
+targetsDestroyed = 0
+targsWave = 1
+tTime = -1
+difficulty = 0
+
+cannibalVisible = false
+cannibalKilles = false
+youngdamaged = false
+youngKilled = false
+elderDamaged = false
+princessDamaged = false
+elderKilled = false
+princessKilled = false
+rope1Taken = false
+paraTaken = false
+rope2Taken = false
+punchTaken = false
+canKilled = false
+desertTaken = false
+challengeFailed = false
+difficultyChoice = false
+princessFace = "Left"
+elderFace = "Left"
+
+goals = {
+  [startDialogue] = {loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000},
+  [onShroomAnim] = {loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower"), 1, 4000},
+  [onFlowerAnim] = {loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"), 1, 7000},
+  [tookParaAnim] = {loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole"), 1, 4000},
+  [onMoleHeadAnim] = {loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute ([Space] while in air) to get the next crate"), 1, 4000},
+  [tookRope2Anim] = {loc("First Blood"), loc("The Rising"), loc("Do the deed"), 1, 4000},
+  [tookPunchAnim] = {loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."), 1, 5000},
+  [challengeAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
+  [challengeFailedAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
+  [challengeCompletedAnim] = {loc("First Blood"), loc("The Ultimate Weapon"), loc("Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"), 1, 5000},
+  [beforeKillAnim] = {loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000},
+  [closeCannim] = {loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}
+}
+-----------------------------Animations--------------------------------
+function Skipanim(anim)
+  AnimSwitchHog(youngh)
+  if goals[anim] ~= nil then
+    ShowMission(unpack(goals[anim]))
+  end
+  if anim == startDialogue then
+    HogTurnLeft(princess, false)
+  end
+end
+
+function SkipDamageAnim(anim)
+  SwitchHog(youngh)
+  SetInputMask(0xFFFFFFFF)
+end
+
+function SkipOnShroom()
+  Skipanim(onShroomAnim)
+  AnimSetGearPosition(elderh, 2700, 1278)
+end
+
+function AnimationSetup()
+  AddSkipFunction(damageAnim, SkipDamageAnim, {damageAnim})
+  table.insert(damageAnim, {func = AnimWait, args = {youngh, 500}, skipFunc = Skipanim, skipArgs = damageAnim})
+  table.insert(damageAnim, {func = AnimSay, args = {elderh, loc("Watch your steps, young one!"), SAY_SAY, 2000}})
+  table.insert(damageAnim, {func = AnimGearWait, args = {youngh, 500}})
+
+  AddSkipFunction(princessDamagedAnim, SkipDamageAnim, {princessDamagedAnim})
+  table.insert(princessDamagedAnim, {func = AnimWait, args = {princess, 500}, skipFunc = Skipanim, skipArgs = princessDamagedAnim})
+  table.insert(princessDamagedAnim, {func = AnimSay, args = {princess, loc("Why do men keep hurting me?"), SAY_THINK, 3000}})
+  table.insert(princessDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
+
+  AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
+  table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
+  table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
+  table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
+  
+  AddSkipFunction(startDialogue, Skipanim, {startDialogue})
+  table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
+  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."),  5000}})
+  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."), 5000}})
+  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."), 5000}})
+  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
+  table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
+  table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("Come closer, so that your training may continue!"), SAY_SHOUT, 6000}})
+  table.insert(startDialogue, {func = AnimSay, args = {youngh, loc("This is it! It's time to make Fell From Heaven fall for me..."), SAY_THINK, 6000}})
+  table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
+  table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
+  table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
+  table.insert(startDialogue, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000}}) 
+
+  AddSkipFunction(onShroomAnim, SkipOnShroom, {onShroomAnim})
+  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("I can see you have been training diligently."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onShroomAnim})
+  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("The wind whispers that you are ready to become familiar with tools, now..."), SAY_SAY, 4000}})
+  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
+  table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
+  table.insert(onShroomAnim, {func = AnimTurn, args = {elderh, "Left"}})
+  table.insert(onShroomAnim, {func = AnimSay, args = {princess, loc("He moves like an eagle in the sky."), SAY_THINK, 4000}})
+  table.insert(onShroomAnim, {func = AnimSwitchHog, args = {youngh}})
+  table.insert(onShroomAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower"), 1, 4000}}) 
+
+  AddSkipFunction(onFlowerAnim, Skipanim, {onFlowerAnim})
+  table.insert(onFlowerAnim, {func = AnimSay, args = {elderh, loc("See that crate farther on the right?"), SAY_SAY, 4000}})
+  table.insert(onFlowerAnim, {func = AnimSay, args = {elderh, loc("Swing, Leaks A Lot, on the wings of the wind!"), SAY_SAY, 6000}})
+  table.insert(onFlowerAnim, {func = AnimSay, args = {princess, loc("His arms are so strong!"), SAY_THINK, 4000}})
+  table.insert(onFlowerAnim, {func = AnimSwitchHog, args = {youngh}})
+  table.insert(onFlowerAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"), 1, 7000}}) 
+  
+  AddSkipFunction(tookParaAnim, Skipanim, {tookParaAnim})
+  table.insert(tookParaAnim, {func = AnimGearWait, args = {youngh, 1000}, skipFunc = Skipanim, skipArgs = tookParaAnim})
+  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("Use the rope to get on the head of the mole, young one!"), SAY_SHOUT, 4000}})
+  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("Worry not, for it is a peaceful animal! There is no reason to be afraid..."), SAY_SHOUT, 5000}})
+  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("We all know what happens when you get frightened..."), SAY_SAY, 4000}})
+  table.insert(tookParaAnim, {func = AnimSay, args = {youngh, loc("So humiliating..."), SAY_SAY, 4000}})
+  table.insert(tookParaAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole"), 1, 4000}}) 
+  table.insert(tookParaAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(onMoleHeadAnim, Skipanim, {onMoleHeadAnim})
+  table.insert(onMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Perfect! Now try to get the next crate without hurting yourself!"), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onMoleHeadAnim})
+  table.insert(onMoleHeadAnim, {func = AnimSay, args = {elderh, loc("The giant umbrella from the last crate should help break the fall."), SAY_SAY, 4000}})
+  table.insert(onMoleHeadAnim, {func = AnimSay, args = {princess, loc("He's so brave..."), SAY_THINK, 4000}})
+  table.insert(onMoleHeadAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute ([Space] while in air) to get the next crate"), 1, 4000}}) 
+  table.insert(onMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(pastMoleHeadAnim, Skipanim, {pastMoleHeadAnim})
+  table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("I see you have already taken the leap of faith."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = pastMoleHeadAnim})
+  table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Get that crate!"), SAY_SAY, 4000}})
+  table.insert(pastMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(tookRope2Anim, Skipanim, {tookRope2Anim})
+  table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("Impressive...you are still dry as the corpse of a hawk after a week in the desert..."), SAY_SAY, 5000}, skipFunc = Skipanim, skipArgs = tookRope2Anim})
+  table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("You probably know what to do next..."), SAY_SAY, 4000}})
+  table.insert(tookRope2Anim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Rising"), loc("Do the deed"), 1, 4000}}) 
+  table.insert(tookRope2Anim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(tookPunchAnim, Skipanim, {tookPunchAnim})
+  table.insert(tookPunchAnim, {func = AnimSay, args = {elderh, loc("It is time to practice your fighting skills."), SAY_SAY, 4000}})
+  table.insert(tookPunchAnim, {func = AnimSay, args = {elderh, loc("Imagine those targets are the wolves that killed your parents! Take your anger out on them!"), SAY_SAY, 5000}})
+  table.insert(tookPunchAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."), 1, 5000}}) 
+  table.insert(tookPunchAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(challengeAnim, Skipanim, {challengeAnim})
+  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("I hope you are prepared for a small challenge, young one."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeAnim})
+  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("Your movement skills will be evaluated now."), SAY_SAY, 4000}})
+  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("Collect all the crates, but remember, our time in this life is limited!"), SAY_SAY, 4000}})
+  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("How difficult would you like it to be?")}})
+  table.insert(challengeAnim, {func = AnimSwitchHog, args = {youngh}})
+  table.insert(challengeAnim, {func = AnimWait, args = {youngh, 500}})
+
+  AddSkipFunction(challengeFailedAnim, Skipanim, {challengeFailedAnim})
+  table.insert(challengeFailedAnim, {func = AnimSay, args = {elderh, loc("Hmmm...perhaps a little more time will help."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeFailedAnim})
+  table.insert(challengeFailedAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000}}) 
+  table.insert(challengeFailedAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(challengeCompletedAnim, Skipanim, {challengeCompletedAnim})
+  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("The spirits of the ancerstors are surely pleased, Leaks A Lot."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeCompletedAnim})
+  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("You have proven yourself worthy to see our most ancient secret!"), SAY_SAY, 4000}})
+  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("The weapon in that last crate was bestowed upon us by the ancients!"), SAY_SAY, 4000}})
+  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("Use it with precaution!"), SAY_SAY, 4000}})
+  table.insert(challengeCompletedAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Ultimate Weapon"), loc("Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"), 1, 5000}}) 
+  table.insert(challengeCompletedAnim, {func = AnimSwitchHog, args = {youngh}})
+
+  AddSkipFunction(beforeKillAnim, Skipanim, {beforeKillAnim})
+  table.insert(beforeKillAnim, {func = AnimSay, args = {elderh, loc("What do my faulty eyes observe? A spy!"), SAY_SHOUT, 4000}, skipFunc = Skipanim, skipArgs = beforeKillAnim})
+  table.insert(beforeKillAnim, {func = AnimFollowGear, args = {cannibal}})
+  table.insert(beforeKillAnim, {func = AnimWait, args = {cannibal, 1000}})
+  table.insert(beforeKillAnim, {func = AnimSay, args = {elderh, loc("Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"), SAY_SHOUT, 4000}})
+  table.insert(beforeKillAnim, {func = AnimSay, args = {cannibal, loc("Oh, my!"), SAY_THINK, 4000}})
+  table.insert(beforeKillAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000}}) 
+  table.insert(beforeKillAnim, {func = AnimSwitchHog, args = {youngh}})
+  
+  AddSkipFunction(closeCannim, Skipanim, {closeCannim})
+  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("I see you would like his punishment to be more...personal..."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = closeCannim})
+  table.insert(closeCannim, {func = AnimSay, args = {cannibal, loc("I'm certain that this is a misunderstanding, fellow hedgehogs!"), SAY_SAY, 4000}})
+  table.insert(closeCannim, {func = AnimSay, args = {cannibal, loc("If only I were given a chance to explain my being here..."), SAY_SAY, 4000}})
+  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"), SAY_SAY, 6000}})
+  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("Here...pick your weapon!"), SAY_SAY, 5000}})
+  table.insert(closeCannim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}}) 
+  table.insert(closeCannim, {func = AnimSwitchHog, args = {youngh}})
+
+  table.insert(cannKilledAnim, {func = AnimSay, args = {elderh, loc("Yes, yeees! You are now ready to enter the real world!"), SAY_SHOUT, 6000}})
+
+  table.insert(cannKilledEarlyAnim, {func = AnimSay, args = {elderh, loc("What?! A cannibal? Here? There is no time to waste! Come, you are prepared."), SAY_SHOUT, 4000}})
+end
+-----------------------------Events------------------------------------
+function CheckNeedToTurn(gear)
+  if gear == princess then
+    if princessKilled ~= true then
+      if (GetX(princess) > GetX(youngh) and princessFace == "Right")
+        or (GetX(princess) < GetX(youngh) and princessFace == "Left") then
+      --if (GetX(princess) > GetX(youngh))
+       -- or (GetX(princess) < GetX(youngh)) then
+        return true
+      end
+    end
+  else
+    if elderKilled ~= true then
+      if (GetX(elderh) > GetX(youngh) and elderFace == "Right")
+        or (GetX(elderh) < GetX(youngh) and elderFace == "Left") then
+        return true
+      end
+    end
+  end
+  return false
+end
+
+function DoNeedToTurn(gear)
+  if gear == princess then
+    if GetX(princess) > GetX(youngh) then
+      HogTurnLeft(princess, true)
+      princessFace = "Left"
+    elseif GetX(princess) < GetX(youngh) then
+      HogTurnLeft(princess, false)
+      princessFace = "Right"
+    end
+  else
+    if GetX(elderh) > GetX(youngh) then
+      HogTurnLeft(elderh, true)
+      elderFace = "Left"
+    elseif GetX(elderh) < GetX(youngh) then
+      HogTurnLeft(elderh, false)
+      elderFace = "Right"
+    end
+  end
+end
+
+function CheckDamage()
+  return youngdamaged and StoppedGear(youngh) 
+end
+
+function DoOnDamage()
+  AddAnim(damageAnim)
+  youngdamaged = false
+  AddFunction({func = ResetTurnTime, args = {}})
+end
+
+function CheckDeath()
+  return youngKilled
+end
+
+function DoDeath()
+  RemoveEventFunc(CheckKilledOthers)
+  RemoveEventFunc(CheckDamage)
+  RemoveEventFunc(CheckDamagedOthers)
+  FinishThem()
+  ShowMission(loc("First Blood"), loc("The wasted youth"), loc("Leaks A Lot gave his life for his tribe! He should have survived!"), 2, 4000)
+end
+
+function CheckDamagedOthers()
+  return (princessDamaged and StoppedGear(princess)) or (elderDamaged and StoppedGear(elderh))
+end
+
+function CheckKilledOthers()
+  return princessKilled or elderKilled
+end
+
+function DoOnDamagedOthers()
+  if princessDamaged then
+    AddAnim(princessDamagedAnim)
+  end
+  if elderDamaged then
+    AddAnim(elderDamagedAnim)
+  end
+  elderDamaged = false
+  princessDamaged = false
+  AddFunction({func = ResetTurnTime, args = {}})
+end
+
+function DoKilledOthers()
+  AddCaption(loc("After Leaks A Lot betrayed his tribe, he joined the cannibals..."))
+  FinishThem()
+end
+
+function CheckMovedUntilJump()
+   return GetX(youngh) >= 2343
+end
+
+function DoMovedUntilJump()
+  ShowMission(loc("First Blood"), loc("Step By Step"), loc("Hint: Double Jump - Press [Backspace] twice"), -amSkip, 0)
+  AddEvent(CheckOnShroom, {}, DoOnShroom, {}, 0)
+end
+
+function CheckOnShroom()
+  return GetX(youngh) >= 2461 and StoppedGear(youngh)
+end
+
+function DoOnShroom()
+  ropeCrate1 = SpawnUtilityCrate(2751, 1194, amRope)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(onShroomAnim)
+  AddEvent(CheckOnFlower, {}, DoOnFlower, {}, 0)
+end
+
+function CheckOnFlower()
+  return rope1Taken and StoppedGear(youngh)
+end
+
+function DoOnFlower()
+  AddAmmo(youngh, amRope, 100)
+  paraCrate = SpawnUtilityCrate(3245, 1758, amParachute)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(onFlowerAnim)
+  AddEvent(CheckTookParaCrate, {}, DoTookParaCrate, {}, 0)
+end
+
+function CheckTookParaCrate()
+  return paraTaken and StoppedGear(youngh)
+end
+
+function DoTookParaCrate()
+  AddAmmo(youngh, amParachute, 100)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(tookParaAnim)
+  AddEvent(CheckOnMoleHead, {}, DoOnMoleHead, {}, 0)
+  AddEvent(CheckPastMoleHead, {}, DoPastMoleHead, {}, 0)
+end
+
+function CheckOnMoleHead()
+  x = GetX(youngh)
+  return x >= 3005 and x <= 3126 and StoppedGear(youngh)
+end
+
+function CheckPastMoleHead()
+  x = GetX(youngh)
+  y = GetY(youngh)
+  return x < 3005 and y > 1500 and StoppedGear(youngh) 
+end
+
+function DoPastMoleHead()
+  RemoveEventFunc(CheckOnMoleHead)
+  ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope)
+  AddAmmo(youngh, amRope, 0)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(pastMoleHeadAnim)
+  AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
+end
+
+function DoOnMoleHead()
+  RemoveEventFunc(CheckPastMoleHead)
+  ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope)
+  AddAmmo(youngh, amRope, 0)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(onMoleHeadAnim)
+  AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
+end
+
+function CheckTookRope2()
+  return rope2Taken and StoppedGear(youngh)
+end
+
+function DoTookRope2()
+  AddAmmo(youngh, amRope, 100)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(tookRope2Anim)
+  punchCrate = SpawnAmmoCrate(2460, 1321, amFirePunch)
+  AddEvent(CheckTookPunch, {}, DoTookPunch, {})
+end
+
+function CheckTookPunch()
+  return punchTaken and StoppedGear(youngh)
+end
+
+function DoTookPunch()
+  AddAmmo(youngh, amFirePunch, 100)
+  AddAmmo(youngh, amRope, 0)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(tookPunchAnim)
+  targets[1] = AddGear(1594, 1185, gtTarget, 0, 0, 0, 0)
+  targets[2] = AddGear(2188, 1314, gtTarget, 0, 0, 0, 0)
+  targets[3] = AddGear(1961, 1318, gtTarget, 0, 0, 0, 0)
+  targets[4] = AddGear(1961, 1200, gtTarget, 0, 0, 0, 0)
+  targets[5] = AddGear(1800, 900, gtTarget, 0, 0, 0, 0)
+  AddEvent(CheckTargDestroyed, {}, DoTargDestroyed, {}, 0)
+end
+
+function CheckTargDestroyed()
+  return targetsDestroyed == 5 and StoppedGear(youngh)
+end
+
+function DoTargDestroyed()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(challengeAnim)
+  targetsDestroyed = 0
+  AddFunction({func = SetChoice, args = {}})
+  ropeCrate3 = SpawnAmmoCrate(2000, 1200, amRope)
+  AddEvent(CheckTookRope3, {}, AddAmmo, {youngh, amRope, 100}, 0)
+  AddEvent(CheckCratesColled, {}, DoCratesColled, {}, 0)
+  AddEvent(CheckChallengeWon, {}, DoChallengeWon, {}, 0)
+  AddEvent(CheckTimesUp, {}, DoTimesUp, {}, 1)
+end
+
+function CheckChoice()
+  return difficulty ~= 0
+end
+
+function DoChoice()
+  difficultyChoice = false
+  SetInputMask(0xFFFFFFFF)
+  StartChallenge(120000 + chalTries * 20000)
+end
+
+function CheckCratesColled()
+  return cratesCollected == crateNum[difficulty]
+end
+
+function DoCratesColled()
+  RemoveEventFunc(CheckTimesUp)
+  TurnTimeLeft = -1
+  AddCaption(loc("As the challenge was completed, Leaks A Lot set foot on the ground..."))
+end
+
+function CheckChallengeWon()
+  return cratesCollected == crateNum[difficulty] and StoppedGear(youngh)
+end
+
+function DoChallengeWon()
+  desertCrate = SpawnAmmoCrate(1240, 1212, amDEagle)
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(challengeCompletedAnim)
+  AddEvent(CheckDesertColled, {}, DoDesertColled, {}, 0)
+end
+
+function CheckTookRope3()
+  return rope3Taken
+end
+
+function CheckTimesUp()
+  return TurnTimeLeft == 100
+end
+
+function DoTimesUp()
+  challengeFailed = true
+  DeleteGear(crates[1])
+  TurnTimeLeft = -1
+  AddCaption(loc("And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."))
+  AddEvent(CheckChallengeFailed, {}, DoChallengeFailed, {}, 0)
+end
+
+function CheckChallengeFailed()
+  return challengeFailed and StoppedGear(youngh)
+end
+
+function DoChallengeFailed()
+  challengeFailed = false
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(challengeFailedAnim)
+  chalTries = chalTries + 1
+  difficulty = 0
+  AddFunction({func = SetChoice, args = {}})
+end
+
+function CheckDesertColled()
+  return desertTaken and StoppedGear(youngh)
+end
+
+function DoDesertColled()
+  AddAmmo(youngh, amDEagle, 100)
+  PutTargets(1)
+  AddEvent(CheckTargetsKilled, {}, DoTargetsKilled, {}, 1)
+  AddEvent(CheckCannibalKilled, {}, DoCannibalKilledEarly, {}, 0)
+  ShowMission(loc("First Blood"), loc("The Bull's Eye"), loc("[Up], [Down] to aim, [Space] to shoot!"), 1, 5000)
+end
+
+function CheckTargetsKilled()
+  return targetsDestroyed == 3 and StoppedGear(youngh)
+end
+
+function DoTargetsKilled()
+  targetsDestroyed = 0
+  targsWave = targsWave + 1
+  if targsWave > 3 then
+    RemoveEventFunc(CheckTargetsKilled)
+    SetState(cannibal, gstVisible)
+    cannibalVisible = true
+    SetGearMessage(CurrentHedgehog, 0)
+    AddAnim(beforeKillAnim)
+    AddEvent(CheckCloseToCannibal, {}, DoCloseToCannibal, {}, 0)
+    AddEvent(CheckCannibalKilled, {}, DoCannibalKilled, {}, 0)
+  else
+    PutTargets(targsWave)
+  end
+end
+
+function CheckCloseToCannibal()
+  if CheckCannibalKilled() then
+    return false
+  end
+  return math.abs(GetX(cannibal) - GetX(youngh)) <= 400 and StoppedGear(youngh)
+end
+
+function DoCloseToCannibal()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(closeCannim)
+  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][1], targetPosY[1][1], amWhip}})
+  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][2], targetPosY[1][2], amBaseballBat}})
+  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][3], targetPosY[1][3], amHammer}})
+end
+
+function CheckCannibalKilled()
+  return cannibalKilled and StoppedGear(youngh)
+end
+
+function DoCannibalKilled()
+  AddAnim(cannKilledAnim)
+  SaveCampaignVar("Progress", "1")
+end
+
+function DoCannibalKilledEarly()
+  AddAnim(cannKilledEarlyAnim)
+  DoCannibalKilled()
+end
+
+-----------------------------Misc--------------------------------------
+function StartChallenge(time)
+  cratesCollected = 0
+  PutCrate(1)
+  TurnTimeLeft = time
+  ShowMission(loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000) 
+end
+
+function SetChoice()
+  SetInputMask(band(0xFFFFFFFF, bnot(gmAnimate+gmAttack+gmDown+gmHJump+gmLJump+gmSlot+gmSwitch+gmTimer+gmUp+gmWeapon)))
+  difficultyChoice = true
+  ShowMission(loc("First Blood"), loc("The Torment"), loc("Select difficulty: [Left] - easier or [Right] - harder"), 0, 4000)
+  AddEvent(CheckChoice, {}, DoChoice, {}, 0) 
+end
+
+function SetTime(time)
+  TurnTimeLeft = time
+end
+
+function ResetTurnTime()
+  TurnTimeLeft = tTime
+  tTime = -1
+end
+
+function PutCrate(i)
+  if i > crateNum[difficulty] then
+    return
+  end
+  if difficulty == 1 then
+    crates[1] = SpawnAmmoCrate(targXdif1[i], targYdif1[i], amRope)
+  else
+    crates[1] = SpawnAmmoCrate(targXdif2[i], targYdif2[i], amRope)
+  end
+end
+
+function PutTargets(i)
+  targets[1] = AddGear(targetPosX[i][1], targetPosY[i][1], gtTarget, 0, 0, 0, 0)
+  targets[2] = AddGear(targetPosX[i][2], targetPosY[i][2], gtTarget, 0, 0, 0, 0)
+  targets[3] = AddGear(targetPosX[i][3], targetPosY[i][3], gtTarget, 0, 0, 0, 0)
+end
+
+function FinishThem()
+  SetHealth(elderh, 0)
+  SetHealth(youngh, 0)
+  SetHealth(princess, 0)
+end
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 69 
+	GameFlags = gfInfAttack + gfSolidLand + gfDisableWind 
+	TurnTime = 100000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+	MapGen = 0
+  TemplateFilter = 6
+  TemplateNumber = 33
+	Theme = "Nature"
+
+
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+	youngh = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
+  elderh = AddHog(loc("Righteous Beard"), 0, 99, "IndianChief")
+  princess = AddHog(loc("Fell From Heaven"), 0, 300, "tiara")
+  AnimSetGearPosition(princess, 1911, 1361)
+  HogTurnLeft(princess, true)
+  AnimSetGearPosition(elderh, 2667, 1208)
+  HogTurnLeft(elderh, true)
+  AnimSetGearPosition(youngh, 1862, 1362)
+  HogTurnLeft(youngh, false)
+
+  AddTeam(loc("Cannibals"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
+  cannibal = AddHog(loc("Brainiac"), 0, 5, "Zombi")
+  AnimSetGearPosition(cannibal, 525, 1256)
+  HogTurnLeft(cannibal, false)
+  
+  AnimInit()
+  AnimationSetup()
+end
+
+function onGameStart()
+  TurnTimeLeft = -1
+  FollowGear(youngh)
+	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
+  SetState(cannibal, gstInvisible)
+
+  AddAnim(startDialogue)
+  princessFace = "Right"
+  AddEvent(CheckNeedToTurn, {princess}, DoNeedToTurn, {princess}, 1)
+  AddEvent(CheckNeedToTurn, {elderh}, DoNeedToTurn, {elderh}, 1)
+  AddEvent(CheckDamage, {}, DoOnDamage, {}, 1)
+  AddEvent(CheckDeath, {}, DoDeath, {}, 0)
+  AddEvent(CheckDamagedOthers, {}, DoOnDamagedOthers, {}, 1)
+  AddEvent(CheckKilledOthers, {}, DoKilledOthers, {}, 0)
+  AddEvent(CheckMovedUntilJump, {}, DoMovedUntilJump, {}, 0)
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  if gear == ropeCrate1 then
+    rope1Taken = true
+  elseif gear == paraCrate then
+    paraTaken = true
+  elseif gear == ropeCrate2 then
+    rope2Taken = true
+  elseif gear == ropeCrate3 then
+    rope3Taken = true
+  elseif gear == crates[1] and challengeFailed == false then
+    crates[1] = nil
+    cratesCollected = cratesCollected + 1
+    PutCrate(cratesCollected + 1)
+  elseif gear == punchCrate then
+    punchTaken = true
+  elseif gear == desertCrate then
+    desertTaken = true
+  elseif GetGearType(gear) == gtTarget then
+    i = 1
+    while targets[i] ~= gear do
+      i = i + 1
+    end
+    targets[i] = nil
+    targetsDestroyed = targetsDestroyed + 1 
+  elseif gear == cannibal then
+    cannibalKilled = true
+  elseif gear == princess then
+    princessKilled = true
+  elseif gear == elderh then
+    elderKilled = true
+  elseif gear == youngh then
+    youngKilled = true
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amWhip, 0, 0, 0, 8)
+  SetAmmo(amBaseballBat, 0, 0, 0, 8)
+  SetAmmo(amHammer, 0, 0, 0, 8)
+end
+
+function onNewTurn()
+  if CurrentHedgehog == cannibal and cannibalVisible == false then
+    SetState(cannibal, gstInvisible)
+  end
+  SwitchHog(youngh)
+  FollowGear(youngh)
+  TurnTimeLeft = -1
+end
+
+function onGearDamage(gear, damage)
+  if gear == youngh then
+    youngdamaged = true
+    tTime = TurnTimeLeft
+  elseif gear == princess then
+    princessDamaged = true
+    tTime = TurnTimeLeft
+  elseif gear == elderh then
+    elderDamaged = true
+    tTime = TurnTimeLeft
+  elseif gear == cannibal then
+    cannibalVisible = true
+    cannibalDamaged = true
+    SetState(cannibal, 0)
+  end
+end
+
+function onPrecise()
+  if GameTime > 2000 then
+    SetAnimSkip(true)
+  end
+end
+
+function onLeft()
+  if difficultyChoice == true then
+    difficulty = 1
+  end
+end
+
+function onRight()
+  if difficultyChoice == true then
+    difficulty = 2
+  end
+end
+
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua
new file mode 100644
index 0000000..6104ff6
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua	
@@ -0,0 +1,1075 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+--///////////////////////////////CONSTANTS///////////////////////////
+
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+endStage = 1
+
+cannibalNum = 8
+cannibalNames = {loc("John"), loc("Flesh for Brainz"), loc("Eye Chewer"), loc("Torn Muscle"),
+                 loc("Nom-Nom"), loc("Vedgies"), loc("Brain Blower"), loc("Gorkij")}
+cannibalPos = {{2471, 1174}, {939, 1019}, {1953, 902}, {3055, 1041},
+               {1121, 729}, {1150, 718}, {1149, 680}, {1161, 773}}
+
+startLeaksPosDuo = {3572, 1426}
+startEventXDuo = 3300
+startDensePosDuo = {3454, 1471}
+startCyborgPosDuo = {3202, 1307}
+midDensePosDuo = {1464, 1410}
+midCyborgPosDuo = {1264, 1390}
+
+--///////////////////////////////VARIABLES///////////////////////////
+
+m2Choice = 0
+m2DenseDead = 0
+m2RamonDead = 0
+m2SpikyDead = 0
+
+TurnsLeft = 0
+stage = 0
+
+--cyborgHidden = false
+--princessHidden = false
+blowTaken = false
+fireTaken = false
+gravityTaken = false
+sniperTaken = false
+girderTaken = false
+girder1Taken = false
+girder2Taken = false
+leaksDead = false
+denseDead = false
+princessDead = false
+cyborgDead = false
+cannibalDead = {}
+hedgeHidden = {}
+
+startAnim = {}
+startAnimAD = {}
+startAnimAL = {}
+startAnimRL = {}
+
+pastFlowerAnimAL = {}
+pastFlowerAnimRL = {}
+pastFlowerAnim = {}
+
+outPitAnimAL = {}
+outPitAnimRL = {}
+outPitAnim = {}
+
+midAnim = {}
+midAnimAD = {}
+
+failAnim = {}
+failAnimAD = {}
+
+endAnim = {}
+endAnimAD = {}
+endAnimAL = {}
+endAnimRL = {}
+
+endFailAnim = {}
+endFailAnimAD = {}
+
+winAnim = {}
+winAnimAD = {}
+
+--/////////////////////////Animation Functions///////////////////////
+function AfterMidFailAnim()
+  ParseCommand("teamgone " .. loc("Natives"))
+  TurnTimeLeft = 0
+end
+
+function AfterMidAnimAlone()
+  SetupCourse()
+  for i = 5, 8 do
+    RestoreHedge(cannibals[i])
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+  end
+
+  AddAmmo(cannibals[5], amDEagle, 0)
+
+  AddEvent(CheckGirderTaken, {}, DoGirderTaken, {}, 0)
+  AddEvent(CheckOnFirstGirder, {}, DoOnFirstGirder, {}, 0)
+  AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
+  AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
+  SetGearMessage(leaks, 0)
+  TurnsLeft = 12
+  TurnTimeLeft = TurnTime
+  ShowMission(loc("The Journey Back"), loc("Collateral Damage"), loc("Save the princess by collecting the crate in under 12 turns!"), 0, 6000)
+  -----------------------///////////////------------
+  --AnimSetGearPosition(leaks, 417, 1800)
+end
+
+function SkipEndAnimAlone()
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimSetGearPosition(cyborg, 437, 1700)
+  AnimSetGearPosition(princess, 519, 1722)
+end
+
+function SkipEndAnimDuo()
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  if princessHidden then
+    RestoreHog(princess)
+    princessHidden = false
+  end
+  AnimSetGearPosition(cyborg, 437, 1700)
+  AnimSetGearPosition(princess, 519, 1722)
+  AnimSetGearPosition(leaks, 763, 1760)
+  AnimSetGearPosition(dense, 835, 1519)
+  HogTurnLeft(leaks, true)
+  HogTurnLeft(dense, true)
+end
+
+function AfterEndAnimAlone()
+  stage = endStage
+  SwitchHog(leaks)
+  SetGearMessage(leaks, 0)
+  TurnTimeLeft = -1
+  ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
+  AddEvent(CheckLost, {}, DoLost, {}, 0)
+  AddEvent(CheckWon, {}, DoWon, {}, 0)
+  RemoveEventFunc(CheckFailedCourse)
+end
+
+function AfterEndAnimDuo()
+  stage = endStage
+  SwitchHog(leaks)
+  SetGearMessage(leaks, 0)
+  SetGearMessage(dense, 0)
+  TurnTimeLeft = -1
+  ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
+  AddEvent(CheckLost, {}, DoLost, {}, 0)
+  AddEvent(CheckWon, {}, DoWon, {}, 0)
+end
+
+function SkipMidAnimAlone()
+  AnimSetGearPosition(leaks, 2656, 1842)
+  AnimSwitchHog(leaks)
+  SetInputMask(0xFFFFFFFF)
+  AnimWait(dense, 1)
+  AddFunction({func = HideHedge, args = {princess}})
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function AfterStartAnim()
+  SetGearMessage(leaks, 0)
+  TurnTimeLeft = TurnTime
+  local goal = loc("Get the crate on the other side of the island!|")
+  local hint = loc("Hint: you might want to stay out of sight and take all the crates...|")
+  local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!|")
+  local conds = loc("Leaks A Lot must survive!")
+  if m2DenseDead == 0 then
+    conds = loc("Your hogs must survive!")
+  end
+  ShowMission(loc("The Journey Back"), loc("Adventurous"), goal .. hint .. stuck .. conds, 0, 7000)
+end
+
+function SkipStartAnim()
+  AnimSwitchHog(leaks)
+end
+
+function PlaceCratesDuo()
+  SpawnAmmoCrate(3090, 827, amBaseballBat)
+  girderCrate1 = SpawnUtilityCrate(2466, 1814, amGirder)
+  girderCrate2 = SpawnUtilityCrate(2630, 1278, amGirder)
+  SpawnUtilityCrate(2422, 1810, amParachute)
+  SpawnUtilityCrate(3157, 1009, amLowGravity)
+  sniperCrate = SpawnAmmoCrate(784, 1715, amSniperRifle)
+end
+
+function PlaceMinesDuo()
+  SetTimer(AddGear(2920, 1448, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2985, 1338, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(3005, 1302, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(3030, 1270, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(3046, 1257, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2954, 1400, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2967, 1385, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2849, 1449, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2811, 1436, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2773, 1411, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2732, 1390, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2700, 1362, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2642, 1321, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2172, 1417, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2190, 1363, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2219, 1332, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1201, 1207, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1247, 1205, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1295, 1212, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1356, 1209, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1416, 1201, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1466, 1201, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1678, 1198, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1738, 1198, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1796, 1198, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1637, 1217, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1519, 1213, gtMine, 0, 0, 0, 0), 5000)
+end
+
+function AfterPastFlowerAnim()
+  PlaceMinesDuo()
+  AddEvent(CheckDensePit, {}, DoDensePit, {}, 0)
+  AddEvent(CheckTookGirder1, {}, DoTookGirder1, {}, 0)
+  AddEvent(CheckTookGirder2, {}, DoTookGirder2, {}, 0)
+  SetGearMessage(leaks, 0)
+  SetGearMessage(dense, 0)
+  TurnTimeLeft = 0
+  ShowMission(loc("The Journey Back"), loc("The Savior"), loc("Get Dense Cloud out of the pit!"), 1, 5000)
+end
+
+function SkipPastFlowerAnim()
+  AnimSetGearPosition(dense, 2656, 1842)
+  AnimSwitchHog(dense)
+  AnimWait(dense, 1)
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function AfterOutPitAnim()
+  SetupCourseDuo()
+  RestoreHedge(cannibals[5])
+  AddAmmo(cannibals[5], amDEagle, 0)
+  HideHedge(cannibals[5])
+  AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
+  SetGearMessage(leaks, 0)
+  SetGearMessage(dense, 0)
+  TurnTimeLeft = 0
+  ShowMission(loc("The Journey Back"), loc("They never learn"), loc("Free Dense Cloud and continue the mission!"), 1, 5000)
+end
+
+function SkipOutPitAnim()
+  AnimSetGearPosition(dense, unpack(midDensePosDuo))
+  AnimSwitchHog(dense)
+  AnimWait(dense, 1)
+  AddFunction({func = HideHedge, args = {cyborg}})
+end
+
+function RestoreCyborg(x, y, xx, yy)
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimOutOfNowhere(cyborg, x, y)
+  AnimOutOfNowhere(princess, xx, yy)
+  HogTurnLeft(princess, false)
+  return true
+end
+
+function RestoreCyborgOnly(x, y)
+  RestoreHedge(cyborg)
+  SetState(cyborg, 0)
+  AnimOutOfNowhere(cyborg, x, y)
+  return true
+end
+
+function TargetPrincess()
+  ParseCommand("setweap " .. string.char(amDEagle))
+  SetGearMessage(cyborg, gmUp)
+  return true
+end
+
+function HideCyborg()
+  HideHedge(cyborg)
+  HideHedge(princess)
+end
+
+function HideCyborgOnly()
+  HideHedge(cyborg)
+end
+
+function SetupKillRoom()
+  PlaceGirder(2342, 1814, 2)
+  PlaceGirder(2294, 1783, 0)
+  PlaceGirder(2245, 1814, 2)
+end
+
+function SetupCourseDuo()
+  PlaceGirder(1083, 1152, 6)
+  PlaceGirder(1087, 1150, 6)
+  PlaceGirder(1133, 1155, 0)
+  PlaceGirder(1135, 1152, 0)
+  PlaceGirder(1135, 1078, 0)
+  PlaceGirder(1087, 1016, 2)
+  PlaceGirder(1018, 921, 5)
+  PlaceGirder(1016, 921, 5)
+  PlaceGirder(962, 782, 6)
+  PlaceGirder(962, 662, 2)
+  PlaceGirder(962, 661, 2)
+  PlaceGirder(962, 650, 2)
+  PlaceGirder(962, 630, 2)
+  PlaceGirder(1033, 649, 0)
+  PlaceGirder(952, 650, 0)
+
+  fireCrate = SpawnAmmoCrate(1846, 1100, amFirePunch)
+  SpawnUtilityCrate(1900, 1100, amPickHammer)
+  SpawnAmmoCrate(950, 674, amDynamite)
+  SpawnUtilityCrate(994, 825, amRope)
+  SpawnUtilityCrate(570, 1357, amLowGravity)
+end
+
+function DumpMines()
+  SetTimer(AddGear(2261, 1835, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2280, 1831, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2272, 1809, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2290, 1815, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2278, 1815, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2307, 1811, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2286, 1820, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2309, 1813, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2303, 1822, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2317, 1827, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2312, 1816, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2316, 1812, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2307, 1802, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2276, 1818, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2284, 1816, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2292, 1811, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2295, 1814, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2306, 1811, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2292, 1815, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2314, 1815, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2286, 1813, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2275, 1813, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2269, 1814, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2273, 1812, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2300, 1808, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2322, 1812, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2323, 1813, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2311, 1811, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2303, 1809, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2287, 1808, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2282, 1808, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2277, 1809, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2296, 1809, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(2314, 1818, gtMine, 0, 0, 0, 0), 5000)
+end
+
+function SetupAnimRefusedDied()
+  SetupAnimAcceptedDied()
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I just wonder where Ramon and Spiky disappeared..."), SAY_THINK, 6000}})
+end
+
+function SetupAnimAttacked()
+  SetupAnimAcceptedDied()
+  startAnim = {}
+  table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
+  table.insert(startAnim, {func = AnimTurn, args = {leaks, "Left"}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I wonder where Dense Cloud is..."), SAY_THINK, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("He must be in the village already."), SAY_THINK, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'd better get going myself."), SAY_THINK, 4000}})
+
+  midAnim = {}
+  table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
+  table.insert(midAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
+  table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
+  table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
+  table.insert(midAnim, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death! Muahahaha!"), SAY_SAY, 8000}})
+  table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
+  table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
+  table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
+  table.insert(midAnim, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
+  AddSkipFunction(midAnim, SkipMidAnimAlone, {})
+end
+
+function SetupAnimAcceptedDied()
+  table.insert(startAnimAD, {func = AnimWait, args = {leaks, 3000}})
+  table.insert(startAnimAD, {func = AnimTurn, args = {leaks, "Left"}})
+  table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("I need to get to the other side of this island, fast!"), SAY_THINK, 5000}})
+  table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("With Dense Cloud on the land of shadows, I'm the village's only hope..."), SAY_THINK, 7000}})
+
+  table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
+  table.insert(midAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
+  table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
+  table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
+  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
+  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
+  table.insert(midAnimAD, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
+  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
+  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"), SAY_SAY, 8000}})
+  table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
+  table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
+  table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
+  table.insert(midAnimAD, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
+  AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
+
+  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {2299, 1687, 2294, 1841}}})
+  table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
+  table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
+  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
+  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
+  table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
+  table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 1000}})
+  table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("You have failed to complete your task, young one!"), SAY_SAY, 6000}})
+  table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("It's time you learned that your actions have consequences!"), SAY_SAY, 7000}})
+  table.insert(failAnimAD, {func = AnimSay, args = {princess, loc("No! Please, help me!"), SAY_SAY, 4000}})
+  table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
+  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
+  table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, KillPrincess, {}}})
+  table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 12000}})
+  table.insert(failAnimAD, {func = AnimSay, args = {leaks, loc("No! What have I done?! What have YOU done?!"), SAY_SHOUT, 6000}})
+
+  table.insert(endAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
+  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
+  table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {princess, "Right"}})
+  table.insert(endAnimAD, {func = AnimSay, args = {princess, loc("Help me, Leaks!"), SAY_SHOUT, 3000}})
+  table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("But you said you'd let her go!"), SAY_SHOUT, 5000}})
+  table.insert(endAnimAD, {func = AnimSay, args = {cyborg, loc("And you believed me? Oh, god, that's cute!"), SAY_SHOUT, 7000}})
+  table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("I won't let you kill her!"), SAY_SHOUT, 4000}})
+  AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
+  
+  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
+
+  table.insert(winAnimAD, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
+  table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, Leaks A Lot!"), SAY_SAY, 5000}})
+  table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
+  table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
+  table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
+  table.insert(winAnimAD, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
+
+  startAnim = startAnimAD
+  midAnim = midAnimAD
+  failAnim = failAnimAD
+  endAnim = endAnimAD
+  endFailAnim = endFailAnimAD
+  winAnim = winAnimAD
+end
+
+function SetupAnimAcceptedLived()
+  table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
+  table.insert(startAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
+  table.insert(startAnimAL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 8000}})
+  table.insert(startAnimAL, {func = AnimSay, args = {dense, loc("We have no time to waste..."), SAY_SAY, 4000}})
+  table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
+  AddSkipFunction(startAnimAL, SkipStartAnim, {})
+
+  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
+  table.insert(pastFlowerAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
+  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
+  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
+  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
+  table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
+  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
+  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
+  table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("To help you, of course!"), SAY_SAY, 4000}})
+  table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
+  table.insert(pastFlowerAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
+  table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
+  AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
+
+  table.insert(outPitAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
+  table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(outPitAnimAL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
+  table.insert(outPitAnimAL, {func = AnimTurn, args = {dense, "Left"}})
+  table.insert(outPitAnimAL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
+  table.insert(outPitAnimAL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
+  table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
+  table.insert(outPitAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
+  table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
+  AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
+
+  table.insert(endAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
+  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
+  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
+  table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
+  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
+  table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
+  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
+  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
+  
+  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
+
+  table.insert(winAnim, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
+  table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
+  table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
+  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty..."), SAY_SAY, 7000}})
+  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("... share your beauty with the world every morning, my princess!"), SAY_SAY, 7000}})
+  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
+  table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
+
+  startAnim = startAnimAL
+  pastFlowerAnim = pastFlowerAnimAL
+  outPitAnim = outPitAnimAL
+end
+
+function SetupAnimRefusedLived()
+  table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
+  table.insert(startAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
+  table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 7000}})
+  table.insert(startAnimRL, {func = AnimSay, args = {dense, loc("Dude, can you see Ramon and Spiky?"), SAY_SAY, 5000}})
+  table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("No...I wonder where they disappeared?!"), SAY_SAY, 5000}})
+  AddSkipFunction(startAnimRL, SkipStartAnim, {})
+
+  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
+  table.insert(pastFlowerAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
+  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
+  table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
+  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You couldn't possibly believe that after refusing my offer I'd just let you go!"), SAY_SAY, 9000}})
+  table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You're funny!"), SAY_SAY, 4000}})
+  table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
+  table.insert(pastFlowerAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
+  table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
+  AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
+
+  table.insert(outPitAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
+  table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
+  table.insert(outPitAnimRL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
+  table.insert(outPitAnimRL, {func = AnimTurn, args = {dense, "Left"}})
+  table.insert(outPitAnimRL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
+  table.insert(outPitAnimRL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
+  table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
+  table.insert(outPitAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
+  table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
+  AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
+
+  table.insert(endAnim, {func = AnimCustomFunction, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
+  table.insert(endAnim, {func = AnimTeleportGear, args = {leaks, 763, 1760}})
+  table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
+  table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
+  table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
+  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
+  table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
+  table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
+  AddSkipFunction(endAnim, SkipEndAnimDuo, {})
+  
+  table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
+
+  table.insert(winAnim, {func = AnimCustomFunction, args = {princess, CondNeedToTurn, {leaks, princess}}})
+  table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
+  table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
+  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
+  table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
+  table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
+
+  startAnim = startAnimRL
+  pastFlowerAnim = pastFlowerAnimRL
+  outPitAnim = outPitAnimRL
+end
+
+function KillPrincess()
+  ParseCommand("teamgone " .. loc("Cannibal Sentry"))
+  TurnTimeLeft = 0
+end
+--/////////////////////////////Misc Functions////////////////////////
+
+function HideHedge(hedge)
+  if hedgeHidden[hedge] ~= true then
+    HideHog(hedge)
+    hedgeHidden[hedge] = true
+  end
+end
+
+function RestoreHedge(hedge)
+  if hedgeHidden[hedge] == true then
+    RestoreHog(hedge)
+    hedgeHidden[hedge] = false
+  end
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+function SetupPlaceAlone()
+  ------ AMMO CRATE LIST ------
+  --SpawnAmmoCrate(3122, 994, amShotgun)
+  SpawnAmmoCrate(3124, 952, amBaseballBat)
+  SpawnAmmoCrate(2508, 1110, amFirePunch)
+  ------ UTILITY CRATE LIST ------
+  blowCrate = SpawnUtilityCrate(3675, 1480, amBlowTorch)
+  gravityCrate = SpawnUtilityCrate(3448, 1349, amLowGravity)
+  SpawnUtilityCrate(3212, 1256, amGirder)
+  SpawnUtilityCrate(3113, 911, amParachute)
+  sniperCrate = SpawnAmmoCrate(784, 1715, amSniperRifle)
+  ------ MINE LIST ------
+  SetTimer(AddGear(3328, 1399, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(3028, 1262, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2994, 1274, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2956, 1277, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2925, 1282, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2838, 1276, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2822, 1278, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2786, 1283, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2766, 1270, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2749, 1231, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2717, 1354, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2167, 1330, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2201, 1321, gtMine, 0, 0, 0, 0), 3000)
+  SetTimer(AddGear(2239, 1295, gtMine, 0, 0, 0, 0), 3000)
+
+  AnimSetGearPosition(leaks, 3781, 1583)
+  --AnimSetGearPosition(leaks, 1650, 1583)
+  AddAmmo(cannibals[1], amShotgun, 100)
+  AddAmmo(leaks, amSwitch, 0)
+end
+
+function SetupPlaceDuo()
+  PlaceCratesDuo()
+  AnimSetGearPosition(leaks, unpack(startLeaksPosDuo))
+  AnimSetGearPosition(dense, unpack(startDensePosDuo))
+end
+
+function SetupEventsDuo()
+  AddEvent(CheckPastFlower, {}, DoPastFlower, {}, 0)
+  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
+  AddEvent(CheckDenseDead, {}, DoDenseDead, {}, 0)
+  AddEvent(CheckTookSniper2, {}, DoTookSniper2, {}, 0)
+end
+
+function SetupEventsAlone()
+  AddEvent(CheckLeaksDead, {}, DoLeaksDead, {}, 0)
+  AddEvent(CheckTookBlowTorch, {}, DoTookBlowTorch, {}, 0)
+  AddEvent(CheckTookLowGravity, {}, DoTookLowGravity, {}, 0)
+  AddEvent(CheckOnBridge, {}, DoOnBridge, {}, 0)
+end
+
+function StartMission()
+  if m2DenseDead == 1 then
+    DeleteGear(dense)
+    if m2Choice == choiceAccepted then
+      SetupAnimAcceptedDied()
+    elseif m2Choice == choiceRefused then
+      SetupAnimRefusedDied()
+    else
+      SetupAnimAttacked()
+    end
+    SetupPlaceAlone()
+    SetupEventsAlone()
+    AddAnim(startAnim)
+    AddFunction({func = AfterStartAnim, args = {}})
+  else
+    if m2Choice == choiceAccepted then
+      SetupAnimAcceptedLived()
+    else
+      SetupAnimRefusedLived()
+    end
+    SetupPlaceDuo()
+    SetupEventsDuo()
+    AddAnim(startAnim)
+    AddFunction({func = AfterStartAnim, args = {}})
+  end
+  HideHedge(cyborg)
+  HideHedge(princess)
+  for i = 5, 8 do
+    HideHedge(cannibals[i])
+  end
+
+end
+  
+function SetupCourse()
+
+  ------ GIRDER LIST ------
+  PlaceGirder(1091, 1150, 6)
+  PlaceGirder(1091, 989, 6)
+  PlaceGirder(1091, 829, 6)
+  PlaceGirder(1091, 669, 6)
+  PlaceGirder(1091, 668, 6)
+  PlaceGirder(1091, 669, 6)
+  PlaceGirder(1088, 667, 6)
+  PlaceGirder(1091, 658, 6)
+  PlaceGirder(1091, 646, 6)
+  PlaceGirder(1091, 607, 6)
+  PlaceGirder(1091, 571, 6)
+  PlaceGirder(1376, 821, 6)
+  PlaceGirder(1145, 1192, 1)
+  PlaceGirder(1169, 1076, 3)
+  PlaceGirder(1351, 1082, 4)
+  PlaceGirder(1469, 987, 3)
+  PlaceGirder(1386, 951, 0)
+  PlaceGirder(1465, 852, 3)
+  PlaceGirder(1630, 913, 0)
+  PlaceGirder(1733, 856, 7)
+  PlaceGirder(1688, 713, 5)
+  PlaceGirder(1556, 696, 2)
+  PlaceGirder(1525, 696, 2)
+  PlaceGirder(1457, 697, 2)
+  PlaceGirder(1413, 700, 3)
+  PlaceGirder(1270, 783, 2)
+  PlaceGirder(1207, 825, 2)
+  PlaceGirder(1135, 775, 1)
+
+  ------ UTILITY CRATE LIST ------
+  SpawnUtilityCrate(1590, 628, amParachute)
+  SpawnAmmoCrate(1540, 100, amDynamite)
+  SpawnUtilityCrate(2175, 1815, amLowGravity)
+  SpawnUtilityCrate(2210, 1499, amFirePunch)
+  girderCrate = SpawnUtilityCrate(2300, 1663, amGirder)
+  SpawnUtilityCrate(610, 1394, amPickHammer)
+  
+  ------ BARREL LIST ------
+  SetHealth(AddGear(1148, 736, gtExplosives, 0, 0, 0, 0), 20)
+
+end
+
+function PlaceCourseMines()
+  SetTimer(AddGear(1215, 1193, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1259, 1199, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1310, 1198, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1346, 1196, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1383, 1192, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1436, 1196, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1487, 1199, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1651, 1209, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1708, 1209, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1759, 1190, gtMine, 0, 0, 0, 0), 5000)
+  SetTimer(AddGear(1815, 1184, gtMine, 0, 0, 0, 0), 5000)
+end
+
+
+--////////////////////////////Event Functions////////////////////////
+function CheckTookFire()
+  return fireTaken
+end
+
+function DoTookFire()
+  AddAmmo(leaks, amFirePunch, 100)
+end
+
+function CheckTookGirder1()
+  return girder1Taken
+end
+
+function CheckTookGirder2()
+  return girder2Taken
+end
+
+function DoTookGirder1()
+  AddAmmo(dense, amGirder, 2)
+end
+
+function DoTookGirder2()
+  AddAmmo(dense, amGirder, 3)
+end
+
+function CheckDensePit()
+  return GetY(dense) < 1250 and StoppedGear(dense)
+end
+
+function DoDensePit()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {outPitAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterOutPitAnim, args = {}}}})
+end
+
+function CheckPastFlower()
+  if denseDead == true or leaksDead == true then
+    return false
+  end
+  return (GetX(dense) < startEventXDuo and StoppedGear(dense))
+      or (GetX(leaks) < startEventXDuo and StoppedGear(leaks))
+end
+
+function DoPastFlower()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {pastFlowerAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterPastFlowerAnim, args = {}}}})
+end
+
+
+function CheckLeaksDead()
+  return leaksDead
+end
+
+function DoLeaksDead()
+  AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
+  ParseCommand("teamgone " .. loc("Natives"))
+end
+
+function CheckDenseDead()
+  return denseDead
+end
+
+function DoDenseDead()
+  AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
+  ParseCommand("teamgone " .. loc("Natives"))
+end
+
+function CheckTookBlowTorch()
+  return blowTaken
+end
+
+function DoTookBlowTorch()
+  ShowMission(loc("The Journey Back"), loc("The Tunnel Maker"), loc("Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."), 0, 6000)
+end
+
+function CheckTookLowGravity()
+  return gravityTaken
+end
+
+function DoTookLowGravity()
+  ShowMission(loc("The Journey Back"), loc("The Moonwalk"), loc("Hint: Select the LowGravity and press [Fire]."), 0, 6000)
+end
+
+function CheckOnBridge()
+  return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
+end
+
+function DoOnBridge()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {midAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterMidAnimAlone, args = {}}}})
+end
+
+function CheckGirderTaken()
+  return girderTaken
+end
+
+function DoGirderTaken()
+  AddAmmo(leaks, amGirder, 2)
+--  AddAmmo(leaks, amGirder, 3)
+end
+
+function CheckOnFirstGirder()
+  return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
+end
+
+function DoOnFirstGirder()
+  PlaceCourseMines()
+  ShowMission(loc("The Journey Back"), loc("Slippery"), loc("You'd better watch your steps..."), 0, 4000)
+end
+
+function CheckTookSniper()
+  return sniperTaken and StoppedGear(leaks)
+end
+
+function DoTookSniper()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {endAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterEndAnimAlone, args = {}}}})
+end
+
+function CheckTookSniper2()
+  return sniperTaken and StoppedGear(leaks) and StoppedGear(dense)
+end
+
+function DoTookSniper2()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {endAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterEndAnimDuo, args = {}}}})
+end
+
+function CheckLost()
+  return princessDead
+end
+
+function DoLost()
+  AddAnim(endFailAnim)
+  AddFunction({func = ParseCommand, args = {'teamgone ' .. loc('Natives')}})
+end
+
+function CheckWon()
+  return cyborgDead and not princessDead
+end
+
+function DoWon()
+  SaveCampaignVar("Progress", "3")
+  AddAnim(winAnim)
+  AddFunction({func = FinishWon, args = {}})
+end
+
+function FinishWon()
+  SwitchHog(leaks)
+  ParseCommand("teamgone " .. loc("Cannibal Sentry"))
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function CheckFailedCourse()
+  return TurnsLeft == 0
+end
+
+function DoFailedCourse()
+  TurnTimeLeft = 0
+  RestoreHedge(cyborg)
+  RestoreHedge(princess)
+  AnimWait(cyborg, 1)
+  AddFunction({func = AddAnim, args = {failAnim}})
+  AddFunction({func = AddFunction, args = {{func = AfterMidFailAnim, args = {}}}})
+end
+
+--////////////////////////////Main Functions/////////////////////////
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfSolidLand + gfDisableWind
+	TurnTime = 40000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 5
+	MapGen = 0
+  TemplateFilter = 6
+  TemplateNumber = 27
+	Theme = "Nature"
+  SuddenDeathTurns = 3000
+
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
+  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
+
+  AddTeam(loc("Cannibal Sentry"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
+  cannibals = {}
+  for i = 1, 4 do
+    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+  end
+
+  for i = 5, 8 do
+    cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
+    AnimSetGearPosition(cannibals[i], 0, 0)
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
+  princess = AddHog(loc("Fell From Heaven"), 0, 200, "tiara")
+
+  AnimSetGearPosition(dense, 0, 0)
+  AnimSetGearPosition(leaks, 0, 0)
+  AnimSetGearPosition(cyborg, 0, 0)
+  AnimSetGearPosition(princess, 0, 0)
+  
+  AnimInit()
+end
+
+function onGameStart()
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
+  m2RamonDead = tonumber(GetCampaignVar("M2RamonDead"))
+  m2SpikyDead = tonumber(GetCampaignVar("M2SpikyDead"))
+  StartMission()
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  if gear == blowCrate then
+    blowTaken = true
+  elseif gear == fireCrate then
+    fireTaken = true
+  elseif gear == gravityCrate then
+    gravityTaken = true
+  elseif gear == leaks then
+    leaksDead = true
+  elseif gear == dense then
+    denseDead = true
+  elseif gear == cyborg then
+    cyborgDead = true
+  elseif gear == princess then
+    princessDead = true
+  elseif gear == girderCrate then
+    girderTaken = true
+  elseif gear == girderCrate1 then
+    girder1Taken = true
+  elseif gear == girderCrate2 then
+    girder2Taken = true
+  elseif gear == sniperCrate then
+    sniperTaken = true
+  else
+    for i = 1, 4 do
+      if gear == cannibals[i] then
+        cannibalDead[i] = true
+      end
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amBlowTorch, 0, 0, 0, 1)
+  SetAmmo(amParachute, 0, 0, 0, 1)
+  SetAmmo(amGirder, 0, 0, 0, 3)
+  SetAmmo(amLowGravity, 0, 0, 0, 1)
+  SetAmmo(amBaseballBat, 0, 0, 0, 1)
+  SetAmmo(amFirePunch, 1, 0, 0, 1)
+  SetAmmo(amSkip, 9, 0, 0, 0)
+  SetAmmo(amSwitch, 9, 0, 0, 0)
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amRope, 0, 0, 0, 1)
+  SetAmmo(amSniperRifle, 0, 0, 0, 1)
+  SetAmmo(amDynamite, 0, 0, 0, 1)
+  SetAmmo(amPickHammer, 0, 0, 0, 1)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+  elseif stage == endStage and CurrentHedgehog ~= leaks then
+    AnimSwitchHog(leaks)
+    SetGearMessage(leaks, 0)
+    TurnTimeLeft = -1
+  elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
+    for i = 1, 4 do
+      if cannibalDead[i] ~= true then
+        if GetX(cannibals[i]) < GetX(leaks) then
+          HogTurnLeft(cannibals[i], false)
+        else
+          HogTurnLeft(cannibals[i], true)
+        end
+      end
+    end
+    SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
+    TurnTimeLeft = 20000
+  else
+    SetInputMask(0xFFFFFFFF)
+    TurnsLeft = TurnsLeft - 1
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+    return
+  end
+--  AddAmmo(leaks, amRope, 100)
+--  RemoveEventFunc(CheckPastFlower)
+--  DeleteGear(sniperCrate)
+end
+
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua
new file mode 100644
index 0000000..901b67a
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/queen.lua	
@@ -0,0 +1,825 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+
+-----------------------------Map--------------------------------------
+local map =
+{
+	"\16\7\0\225\132\15\200\1\40\0\15\200\1\40\132\15\105\8\81\0\16\14\1\64\143\15\200\7\249\0\13\50\7\252\132\12\243\7\172\0",
+	"\12\236\7\168\132\12\127\6\192\0\12\127\6\192\132\11\52\6\223\0\11\52\6\223\132\10\62\8\35\0\8\201\8\4\132\8\63\7\126\0",
+	"\8\63\7\126\132\8\4\6\58\0\8\0\6\65\132\7\147\6\241\0\7\133\6\195\132\7\20\4\151\0\7\143\6\195\132\7\140\6\234\0",
+	"\7\17\4\151\132\5\191\4\222\0\5\191\4\222\132\3\136\3\252\0\3\136\3\252\132\2\12\4\151\0\2\12\4\151\132\1\138\5\15\0",
+	"\1\138\5\15\132\1\54\5\156\0\1\54\5\156\132\0\130\5\64\0\0\130\5\64\132\255\214\5\135\0\8\141\1\85\179\8\141\1\85\0",
+	"\10\30\2\220\139\10\30\2\220\0\11\77\1\142\131\11\77\1\142\0\10\188\0\113\129\10\188\0\113\0\255\235\0\162\132\0\130\0\225\0",
+	"\0\130\0\229\0\0\127\0\236\132\255\231\0\250\0\0\28\0\215\136\0\4\0\211\0\0\95\5\212\154\0\95\7\238\0\0\246\6\2\154",
+	"\1\71\8\0\0\1\205\5\145\154\2\132\4\239\0\3\98\4\141\154\1\135\5\216\0\3\179\4\151\154\6\213\5\247\0\6\223\5\124\151",
+	"\6\185\5\22\0\6\181\5\29\151\6\37\5\64\0\0\179\5\198\148\0\179\5\198\0\6\216\4\253\148\6\216\4\253\0\1\230\7\147\153",
+	"\8\32\8\18\0\1\187\6\174\153\7\179\7\108\0\2\199\5\177\179\6\128\6\167\0\7\231\7\10\143\7\231\6\202\0\12\148\8\4\156",
+	"\10\241\8\11\0\11\112\7\101\156\12\56\7\91\0\1\89\5\223\199\4\11\5\208\0\4\67\5\212\200\4\172\6\58\0\4\172\6\58\200",
+	"\5\36\5\212\0\5\40\5\194\200\4\169\5\57\0\4\169\5\57\200\4\42\5\205\0\4\130\5\142\200\4\218\5\205\0\4\137\5\194\200",
+	"\4\179\5\251\0\255\245\1\198\133\0\77\1\198\0\0\77\1\198\133\0\102\1\226\0\0\102\1\230\133\255\221\1\244\0\255\245\0\148\195",
+	"\255\231\1\11\0\0\32\0\162\195\255\231\0\169\0\0\60\0\158\195\0\32\0\172\0\0\21\0\176\195\255\242\0\222\0\255\245\0\215\195",
+	"\0\7\0\246\0\255\245\0\243\195\0\11\1\33\0\0\4\1\4\195\0\56\1\36\0\255\245\1\173\195\0\35\1\110\0\255\242\1\180\195",
+	"\255\224\2\9\0\255\238\1\240\195\0\28\2\30\0\0\21\2\19\195\0\102\2\23\0\16\18\1\1\195\16\35\0\222\0\16\14\1\11\195",
+	"\16\7\2\9\0\16\0\2\16\195\16\35\3\34\0\16\11\2\252\195\16\11\4\208\0\16\11\4\208\195\16\0\6\55\0\16\0\6\55\195",
+	"\16\14\8\25\0",
+}
+
+--------------------------------------------Constants------------------------------------
+choiceAccepted = 1
+choiceRefused = 2
+choiceAttacked = 3
+
+choiceEliminate = 1
+choiceSpare = 2
+
+leaksNum = 1
+denseNum = 2
+waterNum = 3
+buffaloNum = 4
+chiefNum = 5
+girlNum = 6
+wiseNum = 7
+
+denseScene = 1
+princessScene = 2
+waterScene = 3
+cyborgScene = 4
+
+nativeNames = {loc("Leaks A Lot"), loc("Dense Cloud"), loc("Fiery Water"), 
+               loc("Raging Buffalo"), loc("Righteous Beard"), loc("Fell From Grace"),
+               loc("Wise Oak"), loc("Ramon"), loc("Spiky Cheese")
+              }
+nativeSaveNames = {"M8DeployedDead", "M8RamonDead", "M8SpikyDead", "M8PrincessDead"}
+
+nativeUnNames = {loc("Zork"), loc("Steve"), loc("Jack"),
+                 loc("Lee"), loc("Elmo"), loc("Rachel"),
+                 loc("Muriel")}
+
+nativeHats = {"Rambo", "RobinHood", "pirate_jack", "zoo_Bunny", "IndianChief",
+              "tiara", "AkuAku", "rasta", "hair_yellow"}
+
+nativePos = {{1474, 1188}, {923, 986}, {564, 1120}, {128, 1315}}
+nativesNum = 4
+nativesLeft = 4
+
+cyborgNames = {loc("Artur Detour"), loc("Led Heart"), loc("Orlando Boom!"), loc("Nilarian"), 
+               loc("Steel Eye"), loc("Rusty Joe"), loc("Hatless Jerry"), loc("Gas Gargler")}
+
+cyborgsDif = {2, 2, 2, 2, 2, 2, 2, 2}
+cyborgsHealth = {100, 100, 100, 100, 100, 100, 100, 100}
+cyborgPos = {1765, 1145}
+cyborgsTeamNum = {4, 3}
+cyborgsNum = 7
+cyborgsPos = {{2893, 1717}, {2958, 1701}, {3027, 1696}, {3096, 1698},
+              {2584, 655},  {2047, 1534}, {115, 179}, {2162, 1916}}
+cyborgsDir = {"Left", "Left", "Left", "Left", "Left", "Left", "Right", "Left"}
+
+crateConsts = {}
+reactions = {}
+
+enemyPos = {4078, 195}
+
+-----------------------------Variables---------------------------------
+natives = {}
+origNatives = {}
+
+cyborgs = {}
+cyborg = nil
+
+gearDead = {}
+hedgeHidden = {}
+
+scene = 0
+enemyFled = "0"
+
+deployedLeader = "0"
+princessLeader = "0"
+
+startAnim = {}
+fleeAnim = {}
+finalAnim = {}
+leaderDeadAnim = {}
+-----------------------------Animations--------------------------------
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  if dir == nil then
+    dx, dy = GetGearVelocity(dense)
+    if dx < 0 then 
+      dif = 10
+    else 
+      dif = -10
+    end
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function AnimationSetup()
+  table.insert(startAnim, {func = AnimWait, args = {enemy, 3000}})
+  table.insert(startAnim, {func = AnimCaption, swh = false, args = {natives[1], "The team continued their quest of finding the rest of the tribe.", 4000}})
+  table.insert(startAnim, {func = AnimCaption, swh = false, args = {natives[1], "They stumbled upon a pile of weapons, they seemed to be getting closer.", 4500}})
+  if scene == denseScene then
+    if m5DeployedNum == denseNum then
+      deployedLeader = "1"
+      SetupDenseAnimDeployed()
+    else
+      SetupDenseAnim()
+    end
+  elseif scene == waterScene then
+    if m5DeployedNum == waterNum then
+      deployedLeader = "1"
+      SetupWaterAnimDeployed()
+    else
+      SetupWaterAnim()
+    end
+  elseif scene == princessScene then
+    princessLeader = "1"
+    SetupPrincessAnim()
+  else
+    SetupCyborgAnim()
+  end
+
+  AddSkipFunction(startAnim, SkipAnim, {startAnim})
+  AddSkipFunction(fleeAnim, SkipAnim, {fleeAnim})
+  AddSkipFunction(leaderDeadAnim, SkipAnim, {leaderDeadAnim})
+end
+
+function SetupLeaderDeadAnim()
+  local gear = nil
+  if CheckCyborgsDead() then
+    return
+  end
+  for i = nativesLeft, 1, -1 do
+    if band(GetState(natives[i]), gstDrowning) == 0 then
+      gear = natives[i]
+    end
+  end
+  if gear == nil then
+    return
+  end
+  table.insert(leaderDeadAnim, {func = AnimFollowGear, args = {gear}})
+  table.insert(leaderDeadAnim, {func = AnimSay, args = {gear, "That traitor won't be killing us anymore!", SAY_THINK, 6000}})
+end
+
+function SetupDenseAnim()
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Yo, dude! Get away from our weapons!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Dense Cloud?! What are you doing?!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "What does it look like?", SAY_SHOUT, 3500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Are you helping the aliens?!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Lolz, I love the look on your face!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Did you really think that I'd changed?", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "But why did you betray us?!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Yo, the aliens gave me plants...medicinal plants...lots of it.", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You never give me plants!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Besides, why would I choose certain death?", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Do you have any idea how bad an exploding arrow hurts?", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Dude, it's unbearable!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You're a coward!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You endangered your whole tribe, you bastard!", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Yeah, well, for some dude to be happy, some other dude has to suffer.", SAY_SHOUT, 11000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "That's just the way it works, you know.", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You're some piece of hypocrite junkie!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Why do you always have to call me names?", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, EmitDenseClouds, {}}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Make fun of me when I fart...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "IT'S A SERIOUS MEDICAL CONDITION!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You don't deserve my sacrifice!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "I won't let you kill the tribe!", SAY_SHOUT, 5000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Dude, this is boring!", SAY_SAY, 3000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "I ain't gonna sit around no more!", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Yo, escort my buttocks!", SAY_SHOUT, 3500}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupDenseAnimDeployed()
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, EmitDenseClouds, {}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[3], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[2], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I'm afraid I can't let you proceed!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "???", SAY_THINK, 0}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[2], "???", SAY_THINK, 0}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[3], "???", SAY_THINK, 1000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Dude, wow, you're so cute!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Did you really think I'd change?", SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I'm still with the aliens.", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {enemy, unpack(enemyPos)}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "WHAT?!", SAY_THINK, 1000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[3], "But you saved me!", SAY_THINK, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Haha, that was just a coincidence!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I was heading home, you see!", SAY_SHOUT, 3500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We were your home! Your family...", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "How could you betray us?!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Yo, the aliens gave me plants...medicinal plants...lots of it.", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You never give me plants!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Besides, why would I choose certain death?", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Do you have any idea how bad an exploding arrow hurts?", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Dude, it's unbearable!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You're a coward!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You endangered your whole tribe, you bastard!", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Yeah, well, for some dude to be happy, some other dude has to suffer.", SAY_SHOUT, 11000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "That's just the way it works, you know.", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You're some piece of hypocrite junkie!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Why do you always have to call me names?", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, EmitDenseClouds, {}}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Make fun of me when I fart...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "IT'S A SERIOUS MEDICAL CONDITION!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You don't deserve my sacrifice!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "I won't let you kill the tribe!", SAY_SHOUT, 5000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Dude, this is boring!", SAY_SAY, 3000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "I ain't gonna sit around no more!", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Yo, escort my buttocks!", SAY_SHOUT, 3500}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupWaterAnim()
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Stay there, comrades!", SAY_SHOUT, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Come closer and die...burp!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Fiery Water?! Are you drunk again?", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Drunk with power, perhappss!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The power of love! No, wait, the power of the aliens!", SAY_SHOUT, 7500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We trusted you, you fool!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Why do you keep betraying us?", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Why, why, why, why!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I grew sick of the oppression! I brock free!", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "What oppression?! You were the most unoppressed member of the tribe!", SAY_SHOUT, 10000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The opression of the elders, of course!", SAY_SHOUT, 6500}})
+  if m5DeployedNum == leaksNum then
+    table.insert(startAnim, {func = AnimSay, args = {enemy, "You should know this more than anyone, Leaks!", SAY_SHOUT, 7000}})
+  elseif m5LeaksDead == 1 then
+    table.insert(startAnim, {func = AnimSay, args = {enemy, "Just look at Leaks, may he rest in peace!", SAY_SHOUT, 6500}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We, the youth, have to constantly prove our value...", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We work and work until we sweat blood...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We risk our lives going through challenges...", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All this to please our beloved 'elders'...hick...", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "And what do they do in the meantime? NOTHING!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All they do is sit around and judge us!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You have never worked a bit in your life!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "All *you* do is take long walks when everyone else works.", SAY_SHOUT, 9000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Anyway, the aliens accept me for who I am.", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We won't accept you destroying our village!", SAY_SHOUT, 7000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Argh, the borrdommm!", SAY_SAY, 3000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "I have more important things to do!", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Comrades! Sail me away!", SAY_SHOUT, 3500}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupWaterAnimDeployed()
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[3], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[2], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Stop, comrades!", SAY_SHOUT, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I cannot let you go any farther...burp!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Fiery Water?! Are you drunk again?", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Drunk with power, perhappss!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The power of love! No, wait, the power of the aliens!", SAY_SHOUT, 7500}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {enemy, unpack(enemyPos)}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[3], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[2], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We trusted you, you fool!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Why do you keep betraying us?", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Why, why, why, why!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I grew sick of the oppression! I brock free!", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "What oppression?! You were the most unoppressed member of the tribe!", SAY_SHOUT, 10000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The opression of the elders, of course!", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Just look at Leaks, may he rest in peace!", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We, the youth, have to constantly prove our value...", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We work and work until we sweat blood...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We risk our lives going through challenges...", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All this to please our beloved 'elders'...hick...", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "And what do they do in the meantime? NOTHING!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All they do is sit around and judge us!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "You have never worked a bit in your life!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "All *you* do is take long walks when everyone else works.", SAY_SHOUT, 9000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Anyway, the aliens accept me for who I am.", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We won't accept you destroying our village!", SAY_SHOUT, 7000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Argh, the borrdommm!", SAY_SAY, 3000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "I have more important things to do!", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Comrades! Sail me away!", SAY_SHOUT, 3500}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupPrincessAnim()
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[3], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[2], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Oh, my! I forgot something!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "We need to go back!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "What could you possibly forget in that cage?", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I don't like your tone! You're hurting me!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "I'm terribly sorry!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "What is it that you forgot?", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Uhmm, it's...uhm...my ring!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "It's precious to me!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We don't have time for that now!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We have to find our folk!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "But I want my sandals!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Sandals?! I thought you left your ring!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All right, you got me...", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Got you? You're acting weird...", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You just can't let it go, can you!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "All right, I'll admit it!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Admit what?", SAY_SHOUT, 2000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You give me no choice!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I can't let you go further because...", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I'm the spy! I've been giving you out!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimTeleportGear, args = {enemy, unpack(enemyPos)}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[3], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[2], enemy}}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {enemy, CondNeedToTurn, {natives[1], enemy}}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "But...they kidnapped you!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Oh, that. We were just having fun!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "It's an ancient ritual of theirs.", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Why did you do this?", SAY_SHOUT, 4000}})
+  if m5ChiefDead == 1 then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], "Why did you kill your father?", SAY_SHOUT, 5000}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Do you have any idea what it's like in the village for a woman?", SAY_SHOUT, 10000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "How would you like being discriminated against?", SAY_SHOUT, 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Not being able to fight, hunt...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Gathering fruits all day long...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Doing stuff a monkey could do...", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Always being considered weak and fragile...", SAY_SHOUT, 6000}})
+  if m5DeployedNum == girlNum then
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], "In case you haven't noticed, I'm a woman, too!", SAY_SHOUT, 8000}})
+    table.insert(startAnim, {func = AnimSay, args = {enemy, "Yes, but you're...different!", SAY_SHOUT, 6000}})
+    table.insert(startAnim, {func = AnimSay, args = {natives[1], "Of course I am...", SAY_SHOUT, 3000}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The aliens respect me, even worship me!", SAY_SHOUT, 6000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I'm living a dream!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Well, you're about to wake up!", SAY_SHOUT, 5000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Hmm...it's going slower than expected.", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "I am going to leave the kids play by themselves.", SAY_SAY, 6000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Alien! I wish to be moved!", SAY_SHOUT, 4000}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupCyborgAnim()
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Stop right there, puny worms!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Stay away from our weapons!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We come in peace! Just let our friends go!", SAY_SHOUT, 5500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I'm afraid we cannot afford that...", SAY_SHOUT, 4500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You see, hedgehog spikes are very very valuable.", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Very valuable, haha!", SAY_SHOUT, 3500}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Don't you dare harm our tribe!", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "It's a shame, really!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "I regret to end your little odyssey.", SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "It was fun to watch...", SAY_SHOUT, 3500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "The way you handled your little internal conflicts...", SAY_SHOUT, 6500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "Did you really think that we needed the help of one of you?", SAY_SHOUT, 7500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "You should have known that we don't rely on meatbags!", SAY_SHOUT, 7500}})
+  table.insert(startAnim, {func = AnimSay, args = {enemy, "It was fun to watch though...", SAY_SHOUT, 3500}})
+  if m5Choice == choiceEliminate then
+    table.insert(startAnim, {func = AnimSay, args = {enemy, "Heck, you even executed one of your own!", SAY_SHOUT, 6000}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "It was all a trick?!", SAY_SHOUT, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "Some sick game of yours?!", SAY_SHOUT, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {natives[1], "We won't let you hurt any more of us!", SAY_SHOUT, 6000}})
+
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Entered boredom phase! Discrepancies detected...", SAY_SAY, 5000}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Initiate escape wish!", SAY_SAY, 6000}})
+  table.insert(fleeAnim, {func = AnimTurn, args = {enemy, "Right"}})
+  table.insert(fleeAnim, {func = AnimSay, args = {enemy, "Running displacement algorithm...", SAY_SHOUT, 4000}})
+  table.insert(fleeAnim, {func = AnimSwitchHog, args = {natives[1]}})
+  table.insert(fleeAnim, {func = AnimWait, args = {natives[1], 1}})
+  table.insert(fleeAnim, {func = AnimDisappear, swh = false, args = {enemy, 0, 0}})
+end
+
+function SetupFinalAnim()
+  local found = 0
+  local gears = {}
+  for i = nativesLeft, 1, -1 do
+    if band(GetState(natives[i]), gstDrowning) == 0 then
+      found = found + 1
+      gears[found] = natives[i]
+    end
+  end
+  if found == 0 then
+    return
+  else
+    for i = 1, found do
+      table.insert(finalAnim, {func = AnimCustomFunction, args = {gears[1], CondNeedToTurn, {cyborg, gears[i]}}})
+    end
+    table.insert(finalAnim, {func = AnimSay, args = {cyborg, "Nice work, meatbags!", SAY_SAY, 3000}})
+    table.insert(finalAnim, {func = AnimSay, args = {cyborg, "You're on your way to freeing your tribe!", SAY_SAY, 5500}})
+    table.insert(finalAnim, {func = AnimSay, args = {gears[1], "Do you know where they are?", SAY_SAY, 4000}})
+    table.insert(finalAnim, {func = AnimSay, args = {gears[found], "We need to hurry!", SAY_SAY, 3000}})
+    table.insert(finalAnim, {func = AnimSay, args = {cyborg, "Haha! Come!", SAY_SAY, 2000}})
+    table.insert(finalAnim, {func = AnimJump, args = {cyborg, "high"}})
+    table.insert(finalAnim, {func = AnimDisappear, args = {cyborg, GetGearPosition(cyborg)}})
+    for i = 1, found do
+      table.insert(finalAnim, {func = HideHedge, swh = false, args = {gears[i]}})
+    end
+    table.insert(finalAnim, {func = SetState, swh = false, args = {cyborg, gstInvisible}})
+  end
+end
+
+
+--------------------------Anim skip functions--------------------------
+function AfterStartAnim()
+  SetGearMessage(natives[1], 0)
+  ShowMission("Long Live The Queen", "Closing in", "Defeat the enemy!|The leader seems scared, he will probably flee.", 1, 0)
+  SetHealth(SpawnHealthCrate(2207, 44), 25)
+  SetHealth(SpawnHealthCrate(519, 1519), 25)
+  SetHealth(SpawnHealthCrate(826, 895), 25)
+  SpawnUtilityCrate(701, 1046, amGirder, 3)
+  TurnTimeLeft = TurnTime
+end
+
+function SkipAnim(anim)
+  if anim == startAnim then
+    SetGearPosition(enemy, unpack(enemyPos))
+  end
+  if GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
+    TurnTimeLeft = 0
+  end
+  AnimWait(enemy, 1)
+end
+
+function AfterFleeAnim()
+  SetHealth(SpawnHealthCrate(130, 455), 25)
+  SetHealth(SpawnHealthCrate(2087, 50), 25)
+  SetHealth(SpawnHealthCrate(2143, 54), 25)
+  SetHealth(SpawnHealthCrate(70, 1308), 25)
+  SetGearMessage(CurrentHedgehog, 0)
+  HideHedge(enemy)
+  ShowMission("Long Live The Queen", "Coward", "The leader escaped. Defeat the rest of the aliens!", 1, 0)
+  TurnTimeLeft = TurnTime
+end
+
+function AfterLeaderDeadAnim()
+  SetHealth(SpawnHealthCrate(130, 455), 25)
+  SetHealth(SpawnHealthCrate(2087, 50), 25)
+  SetHealth(SpawnHealthCrate(2143, 54), 25)
+  SetHealth(SpawnHealthCrate(70, 1308), 25)
+  ShowMission("Long Live The Queen", "Bullseye", "Good Job! Defeat the rest of the aliens!", 1, 0)
+  TurnTimeLeft = 0
+end
+-----------------------------Events------------------------------------
+function CheckTurnsOver()
+  return TotalRounds > 6
+end
+
+function DoTurnsOver()
+  SetGearMessage(CurrentHedgehog, 0)
+  enemyFled = "1"
+  AddAnim(fleeAnim)
+  AddFunction({func = AfterFleeAnim, args = {}})
+  RemoveEventFunc(CheckGearDead, {enemy})
+end
+
+function CheckNativesDead()
+  return nativesLeft == 0
+end
+
+function DoNativesDead()
+  RemoveEventFunc(CheckTurnsOver)
+  RemoveEventFunc(CheckGearDead)
+  RemoveEventFunc(CheckCyborgsDead)
+  AddCaption("...and the cyborgs took over the island.")
+  TurnTimeLeft = 0
+end
+
+function CheckCyborgsDead()
+  return (cyborgsLeft == 0 and (gearDead[enemy] == true or enemyFled == "1"))
+end
+
+function KillEnemy()
+  if enemyFled == "1" then
+    ParseCommand("teamgone " .. loc("Leaderbot"))
+  end
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+
+function DoCyborgsDead()
+  SaveCampaignVariables()
+  RestoreHedge(cyborg)
+  PlaceGirder(3292, 922, 4)
+  SetGearPosition(cyborg, 3290, 902)
+  SetupFinalAnim()
+  AddAnim(finalAnim)
+  AddFunction({func = KillEnemy, args = {}})
+end
+
+function DoLeaderDead()
+  leaderDead = true
+  SetGearMessage(CurrentHedgehog, 0)
+  SetupLeaderDeadAnim()
+  AddAnim(leaderDeadAnim)
+  AddFunction({func = AfterLeaderDeadAnim, args = {}})
+  RemoveEventFunc(CheckTurnsOver)
+end
+
+function CheckGearsDead(gearList)
+  for i = 1, # gearList do
+    if gearDead[gearList[i]] ~= true then
+      return false
+    end
+  end
+  return true
+end
+
+function CheckGearDead(gear)
+  return gearDead[gear]
+end
+
+-----------------------------Misc--------------------------------------
+function HideHedge(hedge)
+  if hedgeHidden[hedge] ~= true then
+    HideHog(hedge)
+    hedgeHidden[hedge] = true
+  end
+end
+
+function RestoreHedge(hedge)
+  if hedgeHidden[hedge] == true then
+    RestoreHog(hedge)
+    hedgeHidden[hedge] = false
+  end
+end
+
+function GetVariables()
+  m5DeployedNum = tonumber(GetCampaignVar("M5DeployedNum"))
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+  m5Choice = tonumber(GetCampaignVar("M5Choice"))
+  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
+  m4DenseDead = tonumber(GetCampaignVar("M4DenseDead"))
+  m5DenseDead = tonumber(GetCampaignVar("M5DenseDead"))
+  m4LeaksDead = tonumber(GetCampaignVar("M4LeaksDead"))
+  m5LeaksDead = tonumber(GetCampaignVar("M5LeaksDead"))
+  m4ChiefDead = tonumber(GetCampaignVar("M4ChiefDead"))
+  m5ChiefDead = tonumber(GetCampaignVar("M5ChiefDead"))
+  m4WaterDead = tonumber(GetCampaignVar("M4WaterDead"))
+  m5WaterDead = tonumber(GetCampaignVar("M5WaterDead"))
+  m4BuffaloDead = tonumber(GetCampaignVar("M4BuffaloDead"))
+  m5BuffaloDead = tonumber(GetCampaignVar("M5BuffaloDead"))
+  m5WiseDead = tonumber(GetCampaignVar("M5WiseDead"))
+  m5GirlDead = tonumber(GetCampaignVar("M5GirlDead"))
+end
+
+function SaveCampaignVariables()
+  for i = 1, 4 do
+    if gearDead[origNatives[i]] ~= true then
+      SaveCampaignVar(nativeSaveNames[i], "0")
+    else
+      SaveCampaignVar(nativeSaveNames[i], "1")
+    end
+  end
+
+  SaveCampaignVar("M8DeployedLeader", deployedLeader)
+  SaveCampaignVar("M8PrincessLeader", princessLeader)
+  SaveCampaignVar("M8EnemyFled", enemyFled)
+  SaveCampaignVar("M8Scene", "" .. scene)
+  SaveCampaignVar("Progress", "8")
+end
+
+function SetupPlace()
+  HideHedge(cyborg)
+  SetHogHat(natives[1], nativeHats[m5DeployedNum])
+  SetHogName(natives[1], nativeNames[m5DeployedNum])
+
+  if m5DeployedNum == denseNum then
+    dense = natives[1]
+  else
+    dense = enemy
+  end
+
+  if m2Choice == choiceAccepted and m5Choice ~= choiceEliminate then
+    scene = denseScene
+    SetHogHat(enemy, nativeHats[denseNum])
+    SetHogName(enemy, nativeNames[denseNum])
+    dense = enemy
+  elseif m2Choice == choiceAccepted then
+    scene = cyborgScene
+    SetHogHat(enemy, "cyborg2")
+    SetHogName(enemy, loc("Nancy Screw"))
+  elseif m5Choice == choiceEliminate then
+    scene = princessScene
+    SetHogHat(enemy, "tiara")
+    SetHogName(enemy, loc("Fell From Heaven"))
+  else
+    scene = waterScene
+    SetHogHat(enemy, nativeHats[waterNum])
+    SetHogName(enemy, nativeNames[waterNum])
+  end
+  for i = 1, 4 do 
+    if GetHogName(natives[i]) == GetHogName(enemy) then
+      AnimSetGearPosition(enemy, GetGearPosition(natives[i]))
+      DeleteGear(natives[i])
+      DeleteGear(cyborgs[cyborgsLeft])
+    end
+  end
+
+  SpawnAmmoCrate(34, 395, amBee, 2)
+  SpawnAmmoCrate(33, 374, amRCPlane, 1)
+  SpawnAmmoCrate(74, 393, amAirAttack, 3)
+  SpawnAmmoCrate(1313, 1481, amBazooka, 8)
+  SpawnAmmoCrate(80, 360, amSniperRifle, 4)
+  SpawnAmmoCrate(1037, 1494, amShotgun, 7)
+  SpawnAmmoCrate(1037, 1472, amMolotov, 3)
+  SpawnAmmoCrate(1146, 1503, amMortar, 8)
+
+  SpawnUtilityCrate(1147, 1431, amPortalGun, 2)
+  SpawnUtilityCrate(1219, 1542, amRope, 5)
+  SpawnUtilityCrate(1259, 1501, amJetpack, 2)
+end
+
+function SetupEvents()
+  AddNewEvent(CheckNativesDead, {}, DoNativesDead, {}, 0)
+  AddNewEvent(CheckGearDead, {enemy}, DoLeaderDead, {}, 0)
+  AddNewEvent(CheckTurnsOver, {}, DoTurnsOver, {}, 0)
+  AddNewEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
+end
+
+function SetupAmmo()
+  AddAmmo(natives[1], amPickHammer, 2)
+  AddAmmo(natives[1], amBazooka, 0)
+  AddAmmo(natives[1], amGrenade, 0)
+  AddAmmo(natives[1], amShotgun, 0)
+  AddAmmo(natives[1], amAirStrike, 0)
+  AddAmmo(natives[1], amMolotov, 0)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  for i = 7, 9 do
+    natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
+    origNatives[i-6] = natives[i-6]
+  end
+  natives[4] = AddHog(loc("Fell From Heaven"), 0, 133, "tiara")
+  origNatives[4] = natives[4]
+  nativesLeft = nativesNum
+
+  AddTeam(loc("Beep Loopers"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  for i = 1, cyborgsTeamNum[1] do
+    cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
+  end
+
+  AddTeam(loc("Corporationals"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  for i = cyborgsTeamNum[1] + 1, cyborgsNum do
+    cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
+  end
+  cyborgsLeft = cyborgsTeamNum[1] + cyborgsTeamNum[2]
+
+  AddTeam(loc("Leaderbot"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  enemy = AddHog(loc("Name"), 2, 200, "cyborg1")
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+
+  SetGearPosition(cyborg, 0, 0)
+
+  for i = 1, nativesNum do
+    AnimSetGearPosition(natives[i], unpack(nativePos[i]))
+  end
+
+  AnimSetGearPosition(enemy, unpack(enemyPos))
+  AnimTurn(enemy, "Left")
+
+  for i = 1, cyborgsNum do
+    AnimSetGearPosition(cyborgs[i], unpack(cyborgsPos[i]))
+    AnimTurn(cyborgs[i], cyborgsDir[i])
+  end
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfDisableGirders + gfDisableLandObjects
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+  MapGen = 2
+	Theme = "Hell"
+  SuddenDeathTurns = 20
+
+	for i = 1, #map do
+		ParseCommand('draw ' .. map[i])
+	end
+
+  GetVariables()
+  AnimInit()
+  AddHogs()
+end
+
+function onGameStart()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  SetupEvents()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  local toRemove = nil
+  gearDead[gear] = true
+  if GetGearType(gear) == gtHedgehog then
+    if GetHogTeamName(gear) == loc("Beep Loopers") or GetHogTeamName(gear) == loc("Corporationals") then
+      cyborgsLeft = cyborgsLeft - 1
+    elseif GetHogTeamName(gear) == loc("Natives") then
+      for i = 1, nativesLeft do
+        if natives[i] == gear then
+          toRemove = i
+        end
+      end
+      table.remove(natives, toRemove)
+      nativesLeft = nativesLeft - 1
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amBaseballBat, 9, 0, 0, 0)
+  SetAmmo(amFirePunch, 9, 0, 0, 0)
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amSkip, 9, 0, 0, 0)
+  SetAmmo(amSwitch, 9, 0, 0, 0)
+  SetAmmo(amBazooka, 9, 0, 0, 0)
+  SetAmmo(amGrenade, 9, 0, 0, 0)
+  SetAmmo(amAirStrike, 1, 0, 0, 0)
+  SetAmmo(amMolotov, 5, 0, 0, 0)
+  SetAmmo(amShotgun, 9, 0, 0, 0)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if GetHogTeamName(CurrentHedgehog) == loc("011101001") then
+    TurnTimeLeft = 0
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+--  else
+--    DeleteGear(cyborgs[1])
+--    table.remove(cyborgs, 1)
+--    if cyborgsLeft == 0 then
+--      DeleteGear(enemy)
+--    end
+  end
+end
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua
new file mode 100644
index 0000000..b618727
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua	
@@ -0,0 +1,964 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Constants---------------------------------
+startStage = 0
+spyStage = 1
+wave1Stage = 2
+wave2Stage = 3
+cyborgStage = 4
+ramonStage = 5
+aloneStage = 6
+duoStage = 7
+interSpyStage = 8
+interWeakStage = 9
+acceptedReturnStage = 10
+refusedReturnStage = 11
+attackedReturnStage = 12
+loseStage = 13
+
+ourTeam = 0
+weakTeam = 1
+strongTeam = 2
+cyborgTeam = 3
+
+leaksNr = 0
+denseNr = 1
+
+choiceAccept = 1
+choiceRefuse = 2
+choiceAttack = 3
+
+HogNames = {loc("Brainiac"), loc("Corpsemonger"), loc("Femur Lover"), loc("Glark"), loc("Bonely"), loc("Rot Molester"), loc("Bloodrocutor"), loc("Muscle Dissolver"), loc("Bloodsucker")}
+
+---POSITIONS---
+
+cannibalPos = {{3108, 1127}, 
+               {2559, 1080}, {3598, 1270}, {3293, 1177}, {2623, 1336}, 
+               {3418, 1336}, {3447, 1335}, {3481, 1340}, {3507, 1324}} 
+densePos = {2776, 1177}
+leaksPos = {2941, 1172}
+cyborgPos = {1113, 1818}
+
+---Animations
+
+startDialogue = {}
+weaklingsAnim = {}
+stronglingsAnim = {}
+acceptedAnim = {}
+acceptedSurvivedFinalAnim = {}
+acceptedDiedFinalAnim = {}
+refusedAnim = {}
+refusedFinalAnim = {}
+attackedAnim = {}
+attackedFinalAnim = {}
+
+-----------------------------Variables---------------------------------
+lastHogTeam = ourTeam
+lastOurHog = leaksNr
+lastEnemyHog = 0
+stage = 0
+choice = 0
+
+brainiacDead = false
+cyborgHidden = false
+leaksHidden = false
+denseHidden = false
+cyborgAttacked = false
+retryReturn = false
+shotgunTaken = false
+grenadeTaken = false
+spikyDead = false
+ramonDead = false
+denseDead = false
+leaksDead = false
+ramonHidden = false
+spikyHidden = false
+grenadeUsed = false
+shotgunUsed = false
+
+
+hogNr = {}
+cannibalDead = {}
+isHidden = {}
+
+
+--------------------------Anim skip functions--------------------------
+function AfterRefusedAnim()
+  SpawnUtilityCrate(2045, 1575, amSwitch)
+  SpawnUtilityCrate(2365, 1495, amShotgun)
+  SpawnUtilityCrate(2495, 1519, amGrenade)
+  SpawnUtilityCrate(2620, 1524, amRope)
+  ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The Switch utility might be of help to you."), 1, 6000)
+  RemoveEventFunc(CheckDenseDead)
+  AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadRefused, {}, 0)
+  AddAmmo(cannibals[6], amGrenade, 1)
+  AddAmmo(cannibals[7], amGrenade, 1)
+  AddAmmo(cannibals[8], amGrenade, 1)
+  AddAmmo(cannibals[9], amGrenade, 1)
+  stage = ramonStage
+  SwitchHog(cannibals[9])
+  FollowGear(ramon)
+  TurnTimeLeft = 0
+  SetGearMessage(ramon, 0)
+  SetGearMessage(leaks, 0)
+  AnimWait(ramon, 1)
+  AddFunction({func = HideHog, args = {cyborg}})
+end
+
+function SkipRefusedAnim()
+  RefusedStart()
+  AnimSetGearPosition(dense, 2645, 1146)
+  AnimSetGearPosition(ramon, 2218, 1675)
+  AnimSetGearPosition(spiky, 2400, 1675)
+end
+
+function AfterStartDialogue()
+  stage = spyStage
+  ShowMission(loc("The Shadow Falls"), loc("Play with me!"), loc("Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"), 1, 6000)
+  TurnTimeLeft = TurnTime
+end
+
+
+function StartSkipFunc()
+  SetState(cannibals[1], 0)
+  AnimTurn(leaks, "Right")
+  AnimSwitchHog(leaks)
+  SetInputMask(0xFFFFFFFF)
+end
+
+function AfterWeaklingsAnim()
+  AddAmmo(cannibals[2], amShotgun, 1)
+  AddAmmo(cannibals[2], amGrenade, 1)
+  AddAmmo(cannibals[3], amShotgun, 1)
+  AddAmmo(cannibals[3], amGrenade, 1)
+  AddAmmo(cannibals[4], amShotgun, 1)
+  AddAmmo(cannibals[4], amGrenade, 1)
+  AddAmmo(cannibals[5], amShotgun, 1)
+  AddAmmo(cannibals[5], amGrenade, 1)
+  AddAmmo(leaks, amSkip, 4)
+  AddAmmo(dense, amSkip, 4)
+  AddEvent(CheckWeaklingsKilled, {}, DoWeaklingsKilled, {}, 0)
+  SetHealth(SpawnHealthCrate(2757, 1030), 50)
+  SetHealth(SpawnHealthCrate(2899, 1009), 50)
+  stage = wave1Stage
+  SwitchHog(dense)
+  SetGearMessage(dense, 0)
+  SetGearMessage(leaks, 0)
+  TurnTimeLeft = TurnTime
+  ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover..."), 1, 6000)
+end
+
+function SkipWeaklingsAnim()
+  for i = 2, 5 do
+    if isHidden[cannibals[i]] == true then
+      RestoreHog(cannibals[i])
+      isHidden[cannibals[i]] = false
+    end
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+    SetState(cannibals[i], 0)
+  end
+  SetInputMask(0xFFFFFFFF)
+end
+
+function AfterStronglingsAnim()
+  stage = cyborgStage
+  ShowMission(loc("The Shadow Falls"), loc("The Dilemma"), loc("Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."), 1, 8000)
+  AddEvent(CheckChoice, {}, DoChoice, {}, 0)
+  AddEvent(CheckRefuse, {}, DoRefuse, {}, 0)
+  AddEvent(CheckAccept, {}, DoAccept, {}, 0)
+  AddEvent(CheckConfront, {}, DoConfront, {}, 0)
+  AddAmmo(dense, amSwitch, 0)
+  AddAmmo(dense, amSkip, 0)
+  AddAmmo(leaks, amSwitch, 0)
+  AddAmmo(leaks, amSkip, 0)
+  SetHealth(SpawnHealthCrate(2557, 1030), 50)
+  SetHealth(SpawnHealthCrate(3599, 1009), 50)
+  TurnTimeLeft = 0
+end
+
+function SkipStronglingsAnim()
+  for i = 6, 9 do
+    if isHidden[cannibals[i]] == true then
+      RestoreHog(cannibals[i])
+      isHidden[cannibals[i]] = false
+    end
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+    SetState(cannibals[i], 0)
+  end
+  if cyborgHidden == true then
+    RestoreHog(cyborg)
+    cyborgHidden = false
+  end
+  SetState(cyborg, 0)
+  SetState(dense, 0)
+  AnimSetGearPosition(dense, 1350, 1315)
+  FollowGear(dense)
+  HogTurnLeft(dense, true)
+  AnimSetGearPosition(cyborg, 1250, 1315)
+  SwitchHog(dense)
+  SetInputMask(0xFFFFFFFF)
+end
+
+function RestartReturnAccepted()
+  retryReturn = false
+  AnimSetGearPosition(dense, 1350, 1310)
+  AddAmmo(dense, amGirder, 2)
+  AddAmmo(dense, amParachute, 2)
+  ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
+  RemoveEventFunc(CheckNeedGirder)
+  RemoveEventFunc(CheckNeedWeapons)
+  AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
+  AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
+end
+
+
+function AfterAcceptedAnim()
+  stage = acceptedReturnStage
+  SpawnAmmoCrate(1370, 810, amGirder)
+  SpawnAmmoCrate(1300, 810, amParachute)
+  ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
+  AddEvent(CheckTookWeapons, {}, DoTookWeapons, {}, 0)
+  AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
+  AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
+  AddEvent(CheckRestartReturnAccepted, {}, RestartReturnAccepted, {}, 1)
+  RemoveEventFunc(CheckDenseDead)
+  SwitchHog(dense)
+  AnimWait(dense, 1)
+  AddFunction({func = HideHog, args = {cyborg}})
+end
+
+function SkipAcceptedAnim()
+  AnimSetGearPosition(cyborg, unpack(cyborgPos))
+  SetState(cyborg, gstInvisible)
+  AnimSwitchHog(dense)
+  SetInputMask(0xFFFFFFFF)
+end
+
+function AfterAttackedAnim()
+  stage = aloneStage
+  ShowMission(loc("The Shadow Falls"), loc("The Individualist"), loc("Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
+  AddAmmo(cannibals[6], amGrenade, 1)
+  AddAmmo(cannibals[6], amFirePunch, 0)
+  AddAmmo(cannibals[6], amBaseballBat, 0)
+  AddAmmo(cannibals[7], amGrenade, 1)
+  AddAmmo(cannibals[7], amFirePunch, 0)
+  AddAmmo(cannibals[7], amBaseballBat, 0)
+  AddAmmo(cannibals[8], amGrenade, 1)
+  AddAmmo(cannibals[8], amFirePunch, 0)
+  AddAmmo(cannibals[8], amBaseballBat, 0)
+  AddAmmo(cannibals[9], amGrenade, 1)
+  AddAmmo(cannibals[9], amFirePunch, 0)
+  AddAmmo(cannibals[9], amBaseballBat, 0)
+  SetGearMessage(leaks, 0)
+  TurnTimeLeft = TurnTime
+  AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadAttacked, {}, 0)
+  SwitchHog(leaks)
+  AnimWait(dense, 1)
+  AddFunction({func = HideHog, args = {cyborg}})
+end
+
+function SkipAttackedAnim()
+  if denseDead == false then
+    DeleteGear(dense)
+  end
+  SpawnAmmoCrate(2551, 994, amGrenade)
+  SpawnAmmoCrate(3551, 994, amGrenade)
+  SpawnAmmoCrate(3392, 1101, amShotgun)
+  SpawnAmmoCrate(3192, 1101, amShotgun)
+  AnimSetGearPosition(cyborg, unpack(cyborgPos))
+  SetState(cyborg, gstInvisible)
+  AnimSwitchHog(leaks)
+  SetInputMask(0xFFFFFFFF)
+end
+
+  
+-----------------------------Animations--------------------------------
+
+function SpawnCrates()
+  SpawnAmmoCrate(2551, 994, amGrenade)
+  SpawnAmmoCrate(3551, 994, amGrenade)
+  SpawnAmmoCrate(3392, 1101, amShotgun)
+  SpawnAmmoCrate(3192, 1101, amShotgun)
+  return true
+end
+
+function EmitDenseClouds(anim, dir)
+  local dif
+  if dir == "Left" then 
+    dif = 10
+  else
+    dif = -10
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function BlowDenseCloud()
+  AnimInsertStepNext({func = DeleteGear, args = {dense}, swh = false}) 
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense), GetY(dense), vgtBigExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 1200}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + 10, GetY(dense), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) - 10, GetY(dense), vgtExplosion, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 100}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) - 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
+end
+
+function SetupAcceptedSurvivedFinalAnim()
+  table.insert(acceptedSurvivedFinalAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
+  table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Pfew! That was close!"), SAY_SAY, 3000}})
+  if grenadeUsed and shotgunUsed then
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the exploding apples and the magic bow that shoots many arrows?"), SAY_SAY, 9000}})
+  elseif grenadeUsed then
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the exploding apples?"), SAY_SAY, 6000}})
+  elseif shotgunUsed then
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the magic bow that shoots many arrows?"), SAY_SAY, 8000}})
+  else
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Did you warn the village?"), SAY_SAY, 4000}})
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("No, I came back to help you out..."), SAY_SAY, 5000}})
+  end
+  if grenadeUsed or shotgunUsed then
+    table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("Uhm...I met one of them and took his weapons."), SAY_SAY, 5000}})
+  end
+  table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("We should head back to the village now."), SAY_SAY, 5000}})
+end
+
+function AnimationSetup()
+  table.insert(startDialogue, {func = AnimWait, args = {dense, 4000}})
+  table.insert(startDialogue, {func = AnimCaption, args = {leaks, loc("After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."), 6000}})
+  table.insert(startDialogue, {func = AnimCaption, args = {leaks, loc("Little did they know that this hunt will mark them forever..."), 4000}})
+  table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("I have no idea where that mole disappeared...Can you see it?"), SAY_SAY, 9000}})
+  table.insert(startDialogue, {func = AnimSay, args = {dense, loc("Nope. It was one fast mole, that's for sure."), SAY_SAY, 5000}}) 
+  table.insert(startDialogue, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {startDialogue, "Right"}}})
+  table.insert(startDialogue, {func = AnimWait, args = {dense, 2000}})
+  table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("Please, stop releasing your \"smoke signals\"!"), SAY_SAY, 5000}})
+  table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("You're terrorizing the forest...We won't catch anything like this!"), SAY_SAY, 6000}})
+  table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("..."), SAY_THINK, 1000}})
+  table.insert(startDialogue, {func = AnimGiveState, args = {cannibals[1], 0}, swh = false})
+  table.insert(startDialogue, {func = AnimOutOfNowhere, args = {cannibals[1], unpack(cannibalPos[1])}, swh = false})
+  table.insert(startDialogue, {func = AnimTurn, args = {leaks, "Right"}})
+  table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
+  table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
+  table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
+  table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
+  table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
+  table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("I can't believe it worked!"), SAY_THINK, 3500}})
+  table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("That shaman sure knows what he's doing!"), SAY_THINK, 6000}})
+  table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("Yeah...I think it's a 'he', lol."), SAY_THINK, 5000}})
+  table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("It wants our brains!"), SAY_SHOUT, 3000}})
+  table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
+  table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("Not you again! My head still hurts from last time!"), SAY_SHOUT, 6000}})
+  table.insert(startDialogue, {func = AnimSwitchHog, args = {leaks}})
+  AddSkipFunction(startDialogue, StartSkipFunc, {})
+
+  table.insert(weaklingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
+  table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
+  table.insert(weaklingsAnim, {func = AnimSay, args = {leaks, loc("Did you see him coming?"), SAY_SAY, 3500}})
+  table.insert(weaklingsAnim, {func = AnimSay, args = {dense, loc("No. Where did he come from?"), SAY_SAY, 3500}})
+  table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideWeaklings, {}}})
+  table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[2], unpack(cannibalPos[2])}})
+  table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[2], 0}})
+  table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[3], 0}})
+  table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[3], unpack(cannibalPos[3])}})
+  table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[4], 0}})
+  table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[4], unpack(cannibalPos[4])}})
+  table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[5], 0}})
+  table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[5], unpack(cannibalPos[5])}})
+  table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(weaklingsAnim, {func = AnimSay, args = {cannibals[3], loc("Are we there yet?"), SAY_SAY, 4000}}) 
+  table.insert(weaklingsAnim, {func = AnimSay, args = {dense, loc("This must be some kind of sorcery!"), SAY_SHOUT, 3500}})
+  table.insert(weaklingsAnim, {func = AnimSwitchHog, args = {leaks}})
+  AddSkipFunction(weaklingsAnim, SkipWeaklingsAnim, {})
+
+  table.insert(stronglingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
+  table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideStronglings, {}}})
+  table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {leaks, 0}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {dense, 0}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("I thought their shaman died when he tried our medicine!"), SAY_SAY, 7000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {dense, loc("I saw it with my own eyes!"), SAY_SAY, 4000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("Then how do they keep appearing?"), SAY_SAY, 4000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("It's impossible to communicate with the spirits without a shaman."), SAY_SAY, 7000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {dense, loc("We need to warn the village."), SAY_SAY, 3500}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[6], 0}})
+  table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[6], unpack(cannibalPos[6])}})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[7], 0}})
+  table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[7], unpack(cannibalPos[7])}})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[8], 0}})
+  table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[8], unpack(cannibalPos[8])}})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[9], 0}})
+  table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[9], unpack(cannibalPos[9])}})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cannibals[7], loc("What a ride!"), SAY_SHOUT, 2000}})
+  table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Right"}})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 700}})
+  table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Left"}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("We can't defeat them!"), SAY_THINK, 3000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("I'll hold them off while you return to the village!"), SAY_SAY, 6000}})
+  table.insert(stronglingsAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
+  table.insert(stronglingsAnim, {func = AnimCaption, args = {cyborg, loc("30 minutes later...")}, swh = false})
+  table.insert(stronglingsAnim, {func = AnimWait, args = {cyborg, 2000}})
+  table.insert(stronglingsAnim, {func = AnimSetGearPosition, args = {dense, 1420, 1315}})
+  table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "Left", 1400, 0}})
+  table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {stronglingsAnim, "Left"}}})
+  table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "Left", 1350, 0}})
+  table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cyborg, 1250, 1320}})
+  table.insert(stronglingsAnim, {func = AnimRemoveState, args = {cyborg, gstInvisible}})
+  table.insert(stronglingsAnim, {func = AnimGearWait, args = {cyborg, 2000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("Greetings, cloudy one!"), SAY_SAY, 3000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("I have come to make you an offering..."), SAY_SAY, 6000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("You are given the chance to turn your life around..."), SAY_SAY, 6000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you agree to provide the information we need, you will be spared!"), SAY_SAY, 7000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("Have no illusions, your tribe is dead, indifferent of your choice."), SAY_SAY, 7000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you decide to help us, though, we will no longer need to find a new governor for the island."), SAY_SAY, 8000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you know what I mean..."), SAY_SAY, 3000}})
+  table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("So? What will it be?"), SAY_SAY, 3000}})
+  table.insert(stronglingsAnim, {func = AnimSwitchHog, args = {dense}})
+  AddSkipFunction(stronglingsAnim, SkipStronglingsAnim, {})
+
+  table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("Great choice, Steve! Mind if I call you that?"), SAY_SAY, 7000}})
+  table.insert(acceptedAnim, {func = AnimSay, args = {dense, loc("Whatever floats your boat..."), SAY_SAY, 4500}})
+  table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("Great! You will be contacted soon for assistance."), SAY_SAY, 6000}})
+  table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("In the meantime, take these and return to your \"friend\"!"), SAY_SAY, 6000}})
+  table.insert(acceptedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
+  table.insert(acceptedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(acceptedAnim, {func = AnimSwitchHog, args = {dense}})
+  AddSkipFunction(acceptedAnim, SkipAcceptedAnim, {}) 
+
+  table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, loc("Pfew! That was close!"), SAY_THINK, 3000}})
+  table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, loc("Your death will not be in vain, Dense Cloud!"), SAY_THINK, 5000}})
+  table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {dense, loc("You will be avenged!"), SAY_SAY, 3000}})
+
+  table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("I see..."), SAY_SAY, 2000}})
+  table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"), SAY_SAY, 8000}})
+  table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("You just committed suicide..."), SAY_SAY, 5000}})
+  table.insert(refusedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(refusedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
+  table.insert(refusedAnim, {func = AnimSay, args = {dense, loc("If you say so..."), SAY_THINK, 3000}})
+  table.insert(refusedAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
+  table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 700}})
+  table.insert(refusedAnim, {func = AnimCustomFunction, args = {dense, RefusedStart, {}}})
+  table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {dense, 2645, 1146}})
+  table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {ramon, 2218, 1675}})
+  table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {spiky, 2400, 1675}})
+  table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "Left"}})
+  table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
+  table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "Right"}})
+  table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
+  table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "Left"}})
+  table.insert(refusedAnim, {func = AnimSay, args = {spiky, loc("Dude, we really need a new shaman..."), SAY_SAY, 4000}})
+  AddSkipFunction(refusedAnim, SkipRefusedAnim, {})
+
+  table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, loc("It's over..."), SAY_SAY, 2000}})
+  table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, loc("Let's head back to the village!"), SAY_SAY, 4000}})
+
+  table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
+  table.insert(attackedAnim, {func = AnimCustomFunction, args = {cyborg, SetHealth, {cyborg, 200}}})
+  table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
+  table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Really?! You thought you could harm me with your little toys?"), SAY_SAY, 7000}})
+  table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("You're pathetic! You are not worthy of my attention..."), SAY_SAY, 6000}})
+  table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Actually, you aren't worthy of life! Take this..."), SAY_SAY, 5000}})
+  table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, BlowDenseCloud, {}}, swh = false})
+  table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
+  table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Incredible..."), SAY_SAY, 3000}})
+  table.insert(attackedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
+  table.insert(attackedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
+  table.insert(attackedAnim, {func = AnimSwitchHog, args = {leaks}})
+  table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("I wonder where Dense Cloud is..."), SAY_THINK, 4000}})
+  table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("I can't wait any more, I have to save myself!"), SAY_THINK, 5000}})
+  table.insert(attackedAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {}}})
+  table.insert(attackedAnim, {func = AnimWait, args = {leaks, 1500}})
+  table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("Where are all these crates coming from?!"), SAY_THINK, 5500}})
+  AddSkipFunction(attackedAnim, SkipAttackedAnim, {})
+  
+  table.insert(attackedFinalAnim, {func = AnimWait, args = {leaks, 2000}})
+  table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, loc("I have to get back to the village!"), SAY_THINK, 5000}})
+  table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, loc("Dense Cloud must have already told them everything..."), SAY_THINK, 7000}})
+
+end
+
+
+-----------------------------Misc--------------------------------------
+
+
+function RefusedStart()
+  if ramonHidden == true then
+    RestoreHog(ramon)
+    ramonHidden = false
+  end
+  if spikyHidden == true then
+    RestoreHog(spiky)
+    spikyHidden = false
+  end
+  SetState(ramon, 0)
+  SetState(spiky, 0)
+  SetGearMessage(dense, 0)
+  SetGearMessage(ramon, 0)
+  SetGearMessage(spiky, 0)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+  ramon = AddHog(loc("Ramon"), 0, 100, "rasta")
+	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
+  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
+  spiky = AddHog(loc("Spiky Cheese"), 0, 100, "hair_yellow")
+
+  AddTeam(loc("Weaklings"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
+  cannibals = {}
+  cannibals[1] = AddHog(loc("Brainiac"), 5, 20, "Zombi")
+
+  for i = 2, 5 do
+    cannibals[i] = AddHog(HogNames[i], 1, 20, "Zombi")
+    hogNr[cannibals[i]] = i - 2
+  end
+
+  AddTeam(loc("Stronglings"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
+
+  for i = 6, 9 do
+    cannibals[i] = AddHog(HogNames[i], 2, 30, "vampirichog")
+    hogNr[cannibals[i]] = i - 2
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
+end
+
+function PlaceHogs()
+  HogTurnLeft(leaks, true)
+
+  for i = 2, 9 do
+    AnimSetGearPosition(cannibals[i], unpack(cyborgPos))
+    AnimTurn(cannibals[i], "Left")
+    cannibalDead[i] = false
+  end
+
+  AnimSetGearPosition(cannibals[1], cannibalPos[1][1], cannibalPos[1][2])
+  AnimTurn(cannibals[1], "Left")
+
+  AnimSetGearPosition(cyborg, cyborgPos[1], cyborgPos[2])
+  AnimSetGearPosition(ramon, 2218, 1675)
+  AnimSetGearPosition(skiky, 2400, 1675)
+  AnimSetGearPosition(dense, densePos[1], densePos[2])
+  AnimSetGearPosition(leaks, leaksPos[1], leaksPos[2]) 
+end
+
+function VisiblizeHogs()
+  for i = 1, 9 do
+    SetState(cannibals[i], gstInvisible)
+  end
+  SetState(cyborg, gstInvisible)
+  SetState(ramon, gstInvisible)
+  SetState(spiky, gstInvisible)
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+function HideHogs()
+  for i = 2, 9 do
+    HideHog(cannibals[i])
+    isHidden[cannibals[i]] = true
+  end
+  HideHog(cyborg)
+  cyborgHidden = true
+  HideHog(ramon)
+  HideHog(spiky)
+  ramonHidden = true
+  spikyHidden = true
+end
+
+function HideStronglings()
+  for i = 6, 9 do
+    HideHog(cannibals[i])
+    isHidden[cannibals[i]] = true
+  end
+end
+
+function UnHideWeaklings()
+  for i = 2, 5 do
+    RestoreHog(cannibals[i])
+    isHidden[cannibals[i]] = false
+    SetState(cannibals[i], gstInvisible)
+  end
+end
+
+function UnHideStronglings()
+  for i = 6, 9 do
+    RestoreHog(cannibals[i])
+    isHidden[cannibals[i]] = false
+    SetState(cannibals[i], gstInvisible)
+  end
+  RestoreHog(cyborg)
+  cyborgHidden = false
+  SetState(cyborg, gstInvisible)
+end
+
+function ChoiceTaken()
+  SetGearMessage(CurrentHedgehog, 0)
+  if choice == choiceAccept then
+    AddAnim(acceptedAnim)
+    AddFunction({func = AfterAcceptedAnim, args = {}})
+  elseif choice == choiceRefuse then
+    AddAnim(refusedAnim)
+    AddFunction({func = AfterRefusedAnim, args = {}})
+  else
+    AddAnim(attackedAnim)
+    AddFunction({func = AfterAttackedAnim, args = {}})
+  end
+end
+
+function KillCyborg()
+  RestoreHog(cyborg)
+  DeleteGear(cyborg)
+  TurnTimeLeft = 0
+end
+-----------------------------Events------------------------------------
+
+function CheckBrainiacDead()
+  return brainiacDead
+end
+
+function DoBrainiacDead()
+  TurnTimeLeft = 0
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(weaklingsAnim)
+  AddFunction({func = AfterWeaklingsAnim, args = {}})
+  stage = interSpyStage
+end
+  
+function CheckWeaklingsKilled()
+  for i = 2, 5 do
+    if cannibalDead[i] == false then
+      return false
+    end
+  end
+  return true
+end
+
+function DoWeaklingsKilled()
+  SetGearMessage(CurrentHedgehog, 0)
+  AddAnim(stronglingsAnim)
+  AddFunction({func = AfterStronglingsAnim, args = {}})
+  stage = interWeakStage
+  ParseCommand("teamgone " .. loc("Weaklings"))
+end
+
+function CheckRefuse()
+  return GetX(dense) > 1400 and StoppedGear(dense)
+end
+
+function DoRefuse()
+  choice = choiceRefuse
+end
+
+function CheckAccept()
+  return GetX(dense) < 1300 and StoppedGear(dense)
+end
+
+function DoAccept()
+  choice = choiceAccept
+end
+
+function CheckConfront()
+  return cyborgAttacked and StoppedGear(dense)
+end
+
+function DoConfront()
+  choice = choiceAttack
+end
+
+function CheckChoice()
+  return choice ~= 0
+end
+
+function DoChoice()
+  RemoveEventFunc(CheckConfront)
+  RemoveEventFunc(CheckAccept)
+  RemoveEventFunc(CheckRefuse)
+  ChoiceTaken()
+end
+
+function CheckNeedGirder()
+  return GetX(dense) > 1640 and StoppedGear(dense)
+end
+
+function DoNeedGirder()
+  ShowMission(loc("The Shadow Falls"), loc("Under Construction"), loc("To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"), 1, 6000)
+end
+
+function CheckNeedWeapons()
+  return GetX(dense) > 2522 and StoppedGear(dense)
+end
+
+function DoNeedWeapons()
+  grenadeCrate = SpawnAmmoCrate(2550, 800, amGrenade)
+  shotgunCrate = SpawnAmmoCrate(2610, 850, amShotgun)
+  AddCaption(loc("A little gift from the cyborgs"))
+end
+
+function CheckTookWeapons()
+  return shotgunTaken and grenadeTaken
+end
+
+function DoTookWeapons()
+  ShowMission(loc("The Shadow Falls"), loc("The guardian"), loc("Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
+  AddAmmo(dense, amSkip, 100)
+  AddAmmo(dense, amSwitch, 100)
+  AddAmmo(leaks, amSkip, 100)
+  AddAmmo(leaks, amSwitch, 100)
+  stage = duoStage
+  RemoveEventFunc(CheckNeedGirder)
+  RemoveEventFunc(CheckNeedWeapons)
+  RemoveEventFunc(CheckRestartReturnAccepted)
+  AddEvent(CheckStronglingsDead, {}, DoStronglingsDead, {}, 0)
+  AddAmmo(cannibals[6], amGrenade, 2)
+  AddAmmo(cannibals[6], amShotgun, 2)
+  AddAmmo(cannibals[7], amGrenade, 2)
+  AddAmmo(cannibals[7], amShotgun, 2)
+  AddAmmo(cannibals[8], amGrenade, 2)
+  AddAmmo(cannibals[8], amShotgun, 2)
+  AddAmmo(cannibals[9], amGrenade, 2)
+  AddAmmo(cannibals[9], amShotgun, 2)
+  SetGearMessage(leaks, 0)
+  SetGearMessage(dense, 0)
+  TurnTimeLeft = TurnTime
+end
+
+function DoStronglingsDead()
+  SetGearMessage(CurrentHedgehog, 0)
+  if denseDead == true then
+    AddAnim(acceptedDiedFinalAnim)
+    SaveCampaignVar("M2DenseDead", "1")
+  else
+    SetupAcceptedSurvivedFinalAnim()
+    AddAnim(acceptedSurvivedFinalAnim)
+    SaveCampaignVar("M2DenseDead", "0")
+  end
+  SaveCampaignVar("M2RamonDead", "0")
+  SaveCampaignVar("M2SpikyDead", "0")
+  AddFunction({func = KillCyborg, args = {}})
+  SaveCampaignVar("Progress", "2")
+  SaveCampaignVar("M2Choice", "" .. choice)
+end
+
+function DoStronglingsDeadRefused()
+  if denseDead == true then
+    SaveCampaignVar("M2DenseDead", "1")
+  else
+    SaveCampaignVar("M2DenseDead", "0")
+  end
+  if ramonDead == true then
+    SaveCampaignVar("M2RamonDead", "1")
+  else
+    SaveCampaignVar("M2RamonDead", "0")
+  end
+  if spikyDead == true then
+    SaveCampaignVar("M2SpikyDead", "1")
+  else
+    SaveCampaignVar("M2SpikyDead", "0")
+  end
+  AddAnim(refusedFinalAnim)
+  AddFunction({func = KillCyborg, args = {}})
+  SaveCampaignVar("Progress", "2")
+  SaveCampaignVar("M2Choice", "" .. choice)
+end
+
+function DoStronglingsDeadAttacked()
+  SaveCampaignVar("M2DenseDead", "1")
+  SaveCampaignVar("M2RamonDead", "0")
+  SaveCampaignVar("M2SpikyDead", "0")
+  SaveCampaignVar("Progress", "2")
+  SaveCampaignVar("M2Choice", "" .. choice)
+  AddAnim(attackedFinalAnim)
+  AddFunction({func = KillCyborg, args = {}})
+end
+
+function CheckStronglingsDead()
+  if leaksDead == true then
+    return false
+  end
+  for i = 6, 9 do
+    if cannibalDead[i] == false then
+      return false
+    end
+  end
+  return true
+end
+
+function CheckLeaksDead()
+  return leaksDead
+end
+
+function DoDead()
+  AddCaption(loc("...and so the cyborgs took over the world..."))
+  stage = loseStage
+  TurnTimeLeft = 0
+  ParseCommand("teamgone " .. loc("Natives"))
+end
+
+function CheckDenseDead()
+  return denseDead and choice ~= choiceAttack 
+end
+
+function CheckRestartReturnAccepted()
+  return retryReturn
+end
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 334 
+	GameFlags = gfSolidLand + gfDisableWind + gfPerHogAmmo
+	TurnTime = 50000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 0
+	Delay = 10 
+	MapGen = 0
+  TemplateFilter = 6
+  TemplateNumber = 22
+	Theme = "Nature"
+  SuddenDeathTurns = 3000
+
+  AddHogs()
+  PlaceHogs()
+  VisiblizeHogs()
+  
+  AnimInit()
+  AnimationSetup()
+end
+
+function onGameStart()
+  HideHogs()
+  AddAmmo(leaks, amSwitch, 100)
+  AddAmmo(dense, amSwitch, 100)
+  AddEvent(CheckLeaksDead, {}, DoDead, {}, 0)
+  AddEvent(CheckDenseDead, {}, DoDead, {}, 0)
+  AddAnim(startDialogue)
+  AddFunction({func = AfterStartDialogue, args = {}})
+  AddEvent(CheckBrainiacDead, {}, DoBrainiacDead, {}, 0)
+  ShowMission(loc("The Shadow Falls"), loc("The First Encounter"), loc("Survive!|Hint: Cinematics can be skipped with the [Precise] key."), 1, 0)
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  if gear == cannibals[1] then
+    brainiacDead = true
+  elseif gear == grenadeCrate then
+    grenadeTaken = true
+  elseif gear == shotgunCrate then
+    shotgunTaken = true
+  elseif gear == dense then
+    denseDead = true
+  elseif gear == leaks then
+    leaksDead = true
+  elseif gear == ramon then
+    ramonDead = true
+  elseif gear == spiky then
+    spikyDead = true
+  else
+    for i = 2, 9 do
+      if gear == cannibals[i] then
+        cannibalDead[i] = true
+      end
+    end
+  end
+end
+
+function onGearAdd(gear)
+  if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+    grenadeUsed = true
+  elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+    shotgunUsed = true
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amSniperRifle, 6, 0, 0, 0)
+  SetAmmo(amFirePunch, 3, 0, 0, 0)
+  SetAmmo(amWhip, 4, 0, 0, 0)
+  SetAmmo(amBaseballBat, 4, 0, 0, 0)
+  SetAmmo(amHammer, 2, 0, 0, 0)
+  SetAmmo(amLandGun, 1, 0, 0, 0)
+  SetAmmo(amSnowball, 7, 0, 0, 0)
+  SetAmmo(amGirder, 0, 0, 0, 2)
+  SetAmmo(amParachute, 0, 0, 0, 2)
+  SetAmmo(amGrenade, 0, 0, 0, 3)
+  SetAmmo(amShotgun, 0, 0, 0, 3)
+  SetAmmo(amSwitch, 0, 0, 0, 8)
+  SetAmmo(amRope, 0, 0, 0, 6)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+--  elseif stage == interSpyStage and GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
+--    TurnTimeLeft = 0
+--    SetState(CurrentHedgehog, gstInvisible)
+  elseif stage == cyborgStage then
+    if CurrentHedgehog ~= dense then
+      TurnTimeLeft = 0
+    else
+      TurnTimeLeft = -1
+    end
+  elseif stage == acceptedReturnStage then
+    SwitchHog(dense)
+    FollowGear(dense)
+    TurnTimeLeft = -1
+  end
+end
+
+function onGearDamage(gear, damage)
+  if gear == cyborg and stage == cyborgStage then
+    cyborgAttacked = true
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 and AnimInProgress() then
+    SetAnimSkip(true)
+    return
+  end
+  if stage == acceptedReturnStage then
+    retryReturn = true
+--  else
+--    for i = 1, 9 do
+--      DeleteGear(cannibals[i])
+--    end
+  end
+end
+
diff --git a/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua
new file mode 100644
index 0000000..37355dc
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/united.lua	
@@ -0,0 +1,521 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Animate.lua")()
+
+-----------------------------Constants---------------------------------
+choiceAccept = 1
+choiceRefuse = 2
+choiceAttack = 3
+
+leaksPos = {2067, 509}
+densePos = {1882, 503}
+waterPos = {3100, 930}
+buffaloPos = {2609, 494}
+chiefPos = {2538, 617}
+cannibalPos = {{2219, 1339}, {2322, 1357}, {805, 784}, {3876, 1048},
+              {1101, 916}, {2854, 1408}, {1974, 486}, {1103, 961}}
+
+HogNames = {loc("Olive"), loc("Brain Stu"), loc("Brainila"), loc("Salivaslurper"),
+            loc("Spleenlover"), loc("Thighlicker"), loc("NomNom"), loc("Mindy")}
+
+natives = {}
+-----------------------------Variables---------------------------------
+cannibals = {}
+cannibalDead = {}
+cannibalHidden = {}
+cratesSpawned = {}
+healthCratesSpawned = {}
+
+sdrmv = 0
+denseDead = false
+leaksDead = false
+waterDead = false
+buffaloDead = false
+chiefDead = false
+nativesDead = {}
+
+m2Choice = 0
+m2DenseDead = 0
+
+startAnim = {}
+wave2Anim = {}
+finalAnim = {}
+--------------------------Anim skip functions--------------------------
+function AfterHogDeadAnim()
+  freshDead = nil
+  TurnTimeLeft = TurnTime
+end
+
+function AfterStartAnim()
+  local goal = loc("Defeat the cannibals!|")
+  local chiefgoal = loc("Try to protect the chief! You won't lose if he dies, but it is advised that he survives.")
+  TurnTimeLeft = TurnTime
+  ShowMission(loc("United We Stand"), loc("Invasion"), goal .. chiefgoal, 1, 6000)
+end
+
+function SkipStartAnim()
+  AnimSetGearPosition(water, 2467, 754)
+  if cratesSpawned[1] ~= true then
+    SpawnCrates(1)
+  end
+  if healthCratesSpawned[1] ~= true then
+    SpawnHealthCrates(1)
+  end
+  if cannibalHidden[1] == true then
+    RestoreWave(1)
+  end
+  AnimSwitchHog(leaks)
+end
+
+function SkipWave2Anim()
+  if cratesSpawned[2] ~= true then
+    SpawnCrates(2)
+  end
+  if healthCratesSpawned[2] ~= true then
+    SpawnHealthCrates(2)
+  end
+  if cannibalHidden[5] == true then
+    RestoreWave(2)
+  end
+  AnimSwitchHog(cannibals[5])
+end
+
+function AfterWave2Anim()
+  TurnTimeLeft = 0
+end
+
+function AfterFinalAnim()
+  if leaksDead == true then
+    SaveCampaignVar("M4LeaksDead", "1")
+  else
+    SaveCampaignVar("M4LeaksDead", "0")
+  end
+  if chiefDead == true then
+    SaveCampaignVar("M4ChiefDead", "1")
+  else
+    SaveCampaignVar("M4ChiefDead", "0")
+  end
+  if buffaloDead == true then
+    SaveCampaignVar("M4BuffaloDead", "1")
+  else
+    SaveCampaignVar("M4BuffaloDead", "0")
+  end
+  if waterDead == true then
+    SaveCampaignVar("M4WaterDead", "1")
+  else
+    SaveCampaignVar("M4WaterDead", "0")
+  end
+  if denseDead == true then
+    SaveCampaignVar("M4DenseDead", "1")
+  else
+    SaveCampaignVar("M4DenseDead", "0")
+  end
+  SaveCampaignVar("Progress", "4")
+  ParseCommand("teamgone " .. loc("011101001"))
+  TurnTimeLeft = 0
+end
+-----------------------------Animations--------------------------------
+function Wave2Reaction()
+  local i = 1
+  local gearr = nil
+  while nativesDead[i] == true do
+    i = i + 1
+  end
+  gearr = natives[i]
+  if denseDead ~= true and band(GetState(dense), gstDrowning) == 0 then
+    AnimInsertStepNext({func = AnimSay, args = {dense, loc("I'm so scared!"), SAY_SAY, 3000}})
+    AnimInsertStepNext({func = AnimCustomFunction, args = {dense, EmitDenseClouds, {"Left"}}})
+    AnimInsertStepNext({func = AnimTurn, args = {dense, "Left"}})
+  end
+  AnimInsertStepNext({func = AnimSay, args = {gearr, loc("There's more of them? When did they become so hungry?"), SAY_SHOUT, 8000}}) 
+end
+
+function EmitDenseClouds(dir)
+  local dif
+  if dir == "Left" then
+    dif = 10
+  else
+    dif = -10
+  end
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+  AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
+  AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
+end
+
+function AnimationSetup()
+  table.insert(startAnim, {func = AnimWait, args = {leaks, 4000}})
+  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Back in the village, after telling the villagers about the threat..."), 5000}})
+  table.insert(startAnim, {func = AnimCaption, args = {leaks, loc("Their buildings were very primitive back then, even for an uncivilised island."), 7000}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Young one, you are telling us that they can instantly change location without a shaman?"), SAY_SAY, 8000}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("That is, indeed, very weird..."), SAY_SAY, 3500}})
+  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("If they try coming here, they can have a taste of my delicious knuckles!"), SAY_SHOUT, 8000}})
+  table.insert(startAnim, {func = AnimSay, args = {buffalo, loc("Haha!"), SAY_SHOUT, 2000}})
+  if denseDead == false then
+    table.insert(startAnim, {func = AnimSay, args = {dense, loc("I'm not sure about that!"), SAY_SAY, 3400}})
+    table.insert(startAnim, {func = AnimSay, args = {dense, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
+    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Luckily, I've managed to snatch some of them."), SAY_SAY, 5000}})
+    table.insert(startAnim, {func = AnimCustomFunction, args = {dense, SpawnCrates, {1}}})
+    table.insert(startAnim, {func = AnimSay, args = {dense, loc("Oops...I dropped them."), SAY_SAY, 3000}})
+  else
+    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'm not sure about that!"), SAY_SAY, 3400}})
+    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They have weapons we've never seen before!"), SAY_SAY, 5000}})
+    table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {1}}})
+    table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
+    table.insert(startAnim, {func = AnimSay, args = {leaks, loc("They keep appearing like this. It's weird!"), SAY_SAY, 5000}})
+  end
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Did anyone follow you?"), SAY_SAY, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("No, we made sure of that!"), SAY_SAY, 3500}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {1}}})
+  table.insert(startAnim, {func = AnimWait, args = {leaks, 1000}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("First aid kits?!"), SAY_SAY, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I've seen this before. They just appear out of thin air."), SAY_SAY, 7000}})
+  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 3000, 0}})
+  table.insert(startAnim, {func = AnimJump, args = {water, "long"}})
+  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2655, 0}})
+  table.insert(startAnim, {func = AnimTurn, args = {water, "Right"}})
+  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
+  table.insert(startAnim, {func = AnimJump, args = {water, "back"}})
+  table.insert(startAnim, {func = AnimTurn, args = {water, "Left"}})
+  table.insert(startAnim, {func = AnimMove, args = {water, "Left", 2467, 754}})
+  table.insert(startAnim, {func = AnimSay, args = {water, loc("Hey guys!"), SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("..."), SAY_THINK, 1500}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("Where have you been?"), SAY_SAY, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {water, loc("Just on a walk."), SAY_SAY, 3000}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("You have chosen the perfect moment to leave."), SAY_SAY, 6000}})
+  table.insert(startAnim, {func = AnimCustomFunction, args = {chief, RestoreWave, {1}}})
+  for i = 1, 4 do
+    table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
+  end
+  table.insert(startAnim, {func = AnimWait, args = {chief, 1500}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("HOW DO THEY KNOW WHERE WE ARE???"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {chief, loc("We have to protect the village!"), SAY_SAY, 5000}})
+  table.insert(startAnim, {func = AnimSwitchHog, args = {leaks}})
+  AddSkipFunction(startAnim, SkipStartAnim, {})
+
+  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, RestoreWave, {2}}, swh = false})
+  for i = 5, 8 do
+    table.insert(wave2Anim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
+  end
+  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, Wave2Reaction, {}}, swh = false})
+  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {2}}, swh = false})
+  table.insert(wave2Anim, {func = AnimCustomFunction, args = {leaks, SpawnHealthCrates, {2}}, swh = false})
+  table.insert(wave2Anim, {func = AnimSwitchHog, args = {cannibals[5]}})
+  AddSkipFunction(wave2Anim, SkipWave2Anim, {})
+end
+
+function SetupHogDeadAnim(gear)
+  hogDeadAnim = {}
+  if nativesNum == 0 then
+    return
+  end
+  local hogDeadStrings = {loc("They killed ") .. gear ..loc("! You bastards!"), 
+                          gear .. loc("! Why?!"), 
+                          loc("That was just mean!"), 
+                          loc("Oh no, not ") .. gear .. "!"}
+  table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[nativesNum], SAY_SHOUT, 4000}})
+end
+
+function SetupFinalAnim()
+  local found = 0
+  local hogs = {}
+  local i = 1
+  if nativesNum >= 2 then
+    while found < 2 do
+      if  nativesDead[i] ~= true then
+        found = found + 1
+        hogs[found] = natives[i]
+      end
+      i = i + 1
+    end
+    if chiefDead ~= true then
+      hogs[2] = chief
+    end
+    table.insert(finalAnim, {func = AnimCustomFunction, args = {hogs[1], CondNeedToTurn, {hogs[1], hogs[2]}}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We can't hold them up much longer!"), SAY_SAY, 5000}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("We need to move!"), SAY_SAY, 3000}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("But where can we go?"), SAY_SAY, 3000}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("To the caves..."), SAY_SAY, 2500}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[2], loc("Good idea, they'll never find us there!"), SAY_SAY, 5000}})
+  else
+    for i = 1, 5 do
+      if nativesDead[i] ~= true then
+        hogs[1] = natives[i]
+      end
+    end
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("I need to move the tribe!"), SAY_THINK, 4000}})
+    table.insert(finalAnim, {func = AnimSay, args = {hogs[1], loc("The caves are well hidden, they won't find us there!"), SAY_THINK, 7000}})
+  end
+end
+-----------------------------Misc--------------------------------------
+function RestoreWave(index)
+  for i = (index - 1) * 4 + 1, index * 4 do
+    RestoreHog(cannibals[i])
+    cannibalHidden[i] = false
+  end
+end
+
+function GetVariables()
+  m2DenseDead = tonumber(GetCampaignVar("M2DenseDead"))
+  if m2DenseDead == 1 then
+    denseDead = true
+  end
+  m2Choice = tonumber(GetCampaignVar("M2Choice"))
+end
+
+function SetupPlace()
+  if m2DenseDead == 1 then
+    sdrmv = 1
+    DeleteGear(dense)
+  end
+  for i = 1, 8 do
+    HideHog(cannibals[i])
+    cannibalHidden[i] = true
+  end
+  HideHog(cyborg)
+end
+
+function SetupEvents()
+  AddEvent(CheckWaveDead, {1}, DoWaveDead, {1}, 0)
+  AddEvent(CheckWaveDead, {2}, DoWaveDead, {2}, 0)
+end
+
+function SetupAmmo()
+  AddAmmo(cannibals[1], amGrenade, 4)
+  AddAmmo(cannibals[1], amBazooka, 4)
+  AddAmmo(cannibals[1], amShotgun, 4)
+  AddAmmo(cannibals[1], amMine, 2)
+  AddAmmo(cannibals[5], amGrenade, 4)
+  AddAmmo(cannibals[5], amBazooka, 4)
+  AddAmmo(cannibals[5], amShotgun, 4)
+  AddAmmo(cannibals[5], amMine, 2)
+  AddAmmo(cannibals[5], amMolotov, 2)
+  AddAmmo(cannibals[5], amFlamethrower, 3)
+end
+
+function AddHogs()
+	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
+	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
+  dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
+  water = AddHog(loc("Fiery Water"), 0, 100, "pirate_jack")
+  buffalo = AddHog(loc("Raging Buffalo"), 0, 100, "zoo_Bunny")
+  chief = AddHog(loc("Righteous Beard"), 0, 100, "IndianChief")
+  natives = {leaks, dense, water, buffalo, chief}
+  nativesNum = 5
+
+  AddTeam(loc("Light Cannfantry"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
+  for i = 1, 4 do
+    cannibals[i] = AddHog(HogNames[i], 2, 40, "Zombi")
+  end
+
+  AddTeam(loc("Heavy Cannfantry"), 14483456, "Skull", "Island", "Pirate", "cm_vampire")
+  for i = 5, 8 do
+    cannibals[i] = AddHog(HogNames[i], 2, 55, "vampirichog")
+  end
+
+  AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
+  cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
+
+  AnimSetGearPosition(leaks,   unpack(leaksPos))
+  AnimSetGearPosition(dense,   unpack(densePos))
+  AnimSetGearPosition(water,   unpack(waterPos))
+  HogTurnLeft(water, true)
+  AnimSetGearPosition(buffalo, unpack(buffaloPos))
+  HogTurnLeft(buffalo, true)
+  AnimSetGearPosition(chief,   unpack(chiefPos))
+  HogTurnLeft(chief, true)
+  AnimSetGearPosition(cyborg, 0, 0)
+  for i = 1, 8 do
+    AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+  end
+end
+
+function CondNeedToTurn(hog1, hog2)
+  xl, xd = GetX(hog1), GetX(hog2)
+  if xl > xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
+  elseif xl < xd then
+    AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
+    AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
+  end
+end
+
+function SpawnHealthCrates(index)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  SetHealth(SpawnHealthCrate(0, 0), 25)
+  healthCratesSpawned[index] = true
+end
+
+function SpawnCrates(index)
+  if index == 1 then
+    SpawnAmmoCrate(1943, 408, amBazooka)
+    SpawnAmmoCrate(1981, 464, amGrenade)
+    SpawnAmmoCrate(1957, 459, amShotgun)
+    SpawnAmmoCrate(1902, 450, amDynamite)
+    SpawnUtilityCrate(1982, 405, amPickHammer)
+    SpawnUtilityCrate(2028, 455, amRope)
+    SpawnUtilityCrate(2025, 464, amTeleport)
+  else
+    SpawnUtilityCrate(1982, 405, amBlowTorch)
+    SpawnAmmoCrate(2171, 428, amMolotov)
+    SpawnAmmoCrate(2364, 346, amFlamethrower)
+    SpawnAmmoCrate(2521, 303, amBazooka)
+    SpawnAmmoCrate(2223, 967, amGrenade)
+    SpawnAmmoCrate(1437, 371, amShotgun)
+ end
+  cratesSpawned[index] = true
+end
+
+-----------------------------Events------------------------------------
+
+function CheckWaveDead(index)
+  for i = (index - 1) * 4 + 1, index * 4 do
+    if cannibalDead[i] ~= true then
+      return false
+    end
+  end
+  return true
+end
+
+function DoWaveDead(index)
+  SetGearMessage(CurrentHedgehog, 0)
+  SetState(CurrentHedgehog, 0)
+  if index == 1 then
+    AddAnim(wave2Anim)
+    AddFunction({func = AfterWave2Anim, args = {}})
+  elseif index == 2 then
+    SetupFinalAnim()
+    AddAnim(finalAnim)
+    AddFunction({func = AfterFinalAnim, args = {}})
+  end
+end
+
+
+-----------------------------Main Functions----------------------------
+
+function onGameInit()
+	Seed = 1
+	GameFlags = 0
+	TurnTime = 60000 
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 3000
+	Explosives = 2
+	Delay = 10 
+  Map = "Hogville"
+	Theme = "Nature"
+  SuddenDeathTurns = 3000
+
+  AddHogs()
+  AnimInit()
+end
+
+function onGameStart()
+  GetVariables()
+  SetupAmmo()
+  SetupPlace()
+  AnimationSetup()
+  SetupEvents()
+  AddAnim(startAnim)
+  AddFunction({func = AfterStartAnim, args = {}})
+end
+
+function onGameTick()
+  AnimUnWait()
+  if ShowAnimation() == false then
+    return
+  end
+  ExecuteAfterAnimations()
+  CheckEvents()
+end
+
+function onGearDelete(gear)
+  if gear == dense then
+    denseDead = true
+    nativesNum = nativesNum - 1
+    nativesDead[2] = true
+    if sdrmv == 1 then
+      freshDead = nil
+    else
+      freshDead = loc("Dense Cloud")
+    end
+  elseif gear == leaks then
+    leaksDead = true
+    nativesNum = nativesNum - 1
+    nativesDead[1] = true
+    freshDead = loc("Leaks A Lot")
+  elseif gear == chief then
+    chiefDead = true
+    nativesNum = nativesNum - 1
+    nativesDead[5] = true
+    freshDead = loc("Righteous Beard")
+  elseif gear == water then
+    waterDead = true
+    nativesNum = nativesNum - 1
+    nativesDead[3] = true
+    freshDead = loc("Fiery Water")
+  elseif gear == buffalo then
+    buffaloDead = true
+    nativesNum = nativesNum - 1
+    nativesDead[4] = true
+    freshDead = loc("Raging Buffalo")
+  else
+    for i = 1, 8 do
+      if gear == cannibals[i] then
+        cannibalDead[i] = true
+      end
+    end
+  end
+end
+
+function onAmmoStoreInit()
+  SetAmmo(amDEagle, 9, 0, 0, 0)
+  SetAmmo(amSniperRifle, 4, 0, 0, 0)
+  SetAmmo(amFirePunch, 9, 0, 0, 0)
+  SetAmmo(amWhip, 9, 0, 0, 0)
+  SetAmmo(amBaseballBat, 9, 0, 0, 0)
+  SetAmmo(amHammer, 9, 0, 0, 0)
+  SetAmmo(amLandGun, 9, 0, 0, 0)
+  SetAmmo(amSnowball, 8, 0, 0, 0)
+  SetAmmo(amGirder, 4, 0, 0, 2)
+  SetAmmo(amParachute, 4, 0, 0, 2)
+  SetAmmo(amSwitch, 8, 0, 0, 2)
+  SetAmmo(amSkip, 8, 0, 0, 0)
+  SetAmmo(amRope, 5, 0, 0, 3)
+  SetAmmo(amBlowTorch, 3, 0, 0, 3)
+  SetAmmo(amPickHammer, 0, 0, 0, 3)
+  SetAmmo(amLowGravity, 0, 0, 0, 2)
+  SetAmmo(amDynamite, 0, 0, 0, 3)
+  SetAmmo(amBazooka, 0, 0, 0, 4)
+  SetAmmo(amGrenade, 0, 0, 0, 5)
+  SetAmmo(amMine, 0, 0, 0, 2)
+  SetAmmo(amMolotov, 0, 0, 0, 3)
+  SetAmmo(amFlamethrower, 0, 0, 0, 3)
+  SetAmmo(amShotgun, 0, 0, 0, 3)
+  SetAmmo(amTeleport, 0, 0, 0, 2)
+  SetAmmo(amFlamethrower, 0, 0, 0, 3)
+end
+
+function onNewTurn()
+  if AnimInProgress() then
+    TurnTimeLeft = -1
+    return
+  end
+  if freshDead ~= nil and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+    SetupHogDeadAnim(freshDead)
+    AddAnim(hogDeadAnim)
+    AddFunction({func = AfterHogDeadAnim, args = {}})
+  end
+end
+
+function onPrecise()
+  if GameTime > 2500 then
+    SetAnimSkip(true)
+  end
+end
+
diff --git a/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt b/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt
index 5a6b157..921f5f7 100644
--- a/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt
+++ b/share/hedgewars/Data/Missions/Campaign/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_subdirectory("A Classic Fairytale")
+
 file(GLOB Scripts *.lua)
 
 install(FILES
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua
index 4333112..eaef38b 100644
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua
@@ -46,7 +46,7 @@ function spawnTarget()
 	-- move the target to a higher vertical position
 	-- to ensure it's not somewhere down below
 	x, y = GetGearPosition(gear)
-	SetGearPosition(gear, x, 500)
+	SetGearPosition(gear, x, 0)
 end
 
 -- This function is called before the game loads its
@@ -84,7 +84,7 @@ function onGameInit()
 	AddTeam(loc("'Zooka Team"), 14483456, "Simple", "Island", "Default")
 	-- And add a hog to it
 	player = AddHog(loc("Hunter"), 0, 1, "NoHat")
-	SetGearPosition(player, 1960, 1160)
+	SetGearPosition(player, 936, 136)
 end
 
 -- This function is called when the round starts
@@ -111,11 +111,11 @@ end
 -- Note that there are 1000 ticks within one second.
 -- You shouldn't try to calculate too complicated
 -- code here as this might slow down your game.
-function onGameTick()
+function onGameTick20()
 	-- If time's up, set the game to be lost.
 	-- We actually check the time to be "1 ms" as it
 	-- will be at "0 ms" right at the start of the game.
-	if TurnTimeLeft == 1 and score < score_goal then
+	if TurnTimeLeft < 40 and TurnTimeLeft > 0 and score < score_goal then
 		game_lost = true
 		-- ... and show a short message.
 		ShowMission(loc("Bazooka Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
@@ -133,7 +133,7 @@ function onGameTick()
 			EndGame()
 		else
 			-- ... or just lower the timer by 1.
-			end_timer = end_timer - 1
+			end_timer = end_timer - 20
 			-- Reset the time left to stop the timer
 			TurnTimeLeft = time_goal
 		end
@@ -150,8 +150,8 @@ end
 -- This function is called when a new gear is added.
 -- We don't need it for this training, so we can
 -- keep it empty.
-function onGearAdd(gear)
-end
+-- function onGearAdd(gear)
+-- end
 
 -- This function is called before a gear is destroyed.
 -- We use it to count the number of targets destroyed.
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua
new file mode 100644
index 0000000..d3e2651
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Cluster_Bomb.lua
@@ -0,0 +1,123 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+
+local player = nil
+local scored = 0
+local end_timer = 5000
+local game_lost = false
+local time_goal = 0
+
+function spawnTarget()
+
+	gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0)
+	
+	if scored == 0 then x = 628 end
+	if scored == 1 then x = 891 end
+	if scored == 2 then x = 1309 end
+	if scored == 3 then x = 1128 end
+	if scored == 4 then x = 410 end
+	if scored == 5 then x = 1564 end
+	if scored == 6 then x = 1348 end
+	if scored == 7 then x = 169 end
+	if scored == 8 then x = 1720 end
+	if scored == 9 then x = 1441 end
+	if scored == 10 then x = 599 end
+	if scored == 11 then x = 1638 end
+
+	if scored == 6 then
+		SetGearPosition(gear, 1248, 476)
+	else
+		SetGearPosition(gear, x, 0)
+	end
+
+end
+
+function onGameInit()
+
+	Seed = 1
+	GameFlags = gfDisableWind + gfInfAttack + gfOneClanMode
+	TurnTime = 180 * 1000
+	Map = "Trash"
+	Theme = "Golf"
+	Goals = "Take down all the targets|Achieve it using only Cluster Bomb"
+	CaseFreq = 0
+	MinesNum = 0
+	Explosives = 0
+
+	AddTeam("The Hogies", 2850005, "Statue", "Island", "Hog Islands")
+
+	player = AddHog(loc("Private Novak"), 0, 1, "war_desertGrenadier1")
+	SetGearPosition(player, 756, 370)
+
+end
+
+function onAmmoStoreInit()
+
+	SetAmmo(amClusterBomb, 9, 0, 0, 0)
+
+end
+
+function onGameStart()
+
+	ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("You have to destroy 12 targets in 180 seconds"), -amClusterBomb, 5000)
+	spawnTarget()
+
+end
+
+function onGameTick20()
+
+	if TurnTimeLeft < 40 and TurnTimeLeft > 0 and scored < 12 and game_lost == false then
+		game_lost = true
+		ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
+		SetHealth(player, 0)
+		time_goal = 1
+	end
+
+	if scored == 12 or game_lost then
+		if end_timer == 0 then
+			EndGame()
+		else
+			end_timer = end_timer - 20
+			TurnTimeLeft = time_goal
+		end
+	end
+
+end
+
+function onNewTurn()
+	ParseCommand("setweap " .. string.char(amClusterBomb))
+end
+
+--function onGearAdd(gear)
+--end
+
+function onGearDamage(gear, damage)
+
+	if GetGearType(gear) == gtTarget then
+		scored = scored + 1
+		if scored < 12 then
+			spawnTarget()
+		else
+			if not game_lost then
+
+				if TurnTimeLeft > 90 * 10 then
+					ShowMission(loc("Cluster Bomb MASTER!"), loc("Aiming Practice"), loc("Congratulations! You needed only half of time|to eliminate all targets."), 4, 0)
+				else
+					ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("Congratulations! You've eliminated all targets|within the allowed time frame."), 0, 0)
+				end
+				PlaySound(sndVictory)
+				time_goal = TurnTimeLeft
+			end
+		end
+	end
+
+	if GetGearType(gear) == gtHedgehog then
+		game_lost = true
+		ShowMission(loc("Cluster Bomb Training"), loc("Aiming Practice"), loc("Oh no! You failed! Just try again."), -amSkip, 0)
+		SetHealth(player, 0)
+		time_goal = 1
+	end
+
+end
+
+function onGearDelete(gear)
+end
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
new file mode 100644
index 0000000..2e4728e
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
@@ -0,0 +1,190 @@
+-- Hedgewars Grenade Training
+-- Scripting Example
+
+-- Lines such as this one are comments - they are ignored
+-- by the game, no matter what kind of text is in there.
+-- It's also possible to place a comment after some real
+-- instruction as you see below. In short, everything
+-- following "--" is ignored.
+
+---------------------------------------------------------------
+-- At first we implement the localization library using loadfile.
+-- This allows us to localize strings without needing to think
+-- about translations.
+-- We can use the function loc(text) to localize a string.
+
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+
+-- This variable will hold the number of destroyed targets.
+local score = 0
+-- This variable represents the number of targets to destroy.
+local score_goal = 5
+-- This variable controls how many milliseconds/ticks we'd
+-- like to wait before we end the round once all targets
+-- have been destroyed.
+local end_timer = 4000 -- 5000 ms = 5 s
+-- This variable is set to true if the game is lost (i.e.
+-- time runs out).
+local game_lost = false
+-- This variable ensures that the death function isn't called
+-- repeatedly when game is over.
+local team_death = false
+-- This variable will point to the hog's gear
+local player = nil
+-- This variable will grab the time left at the end of the round
+local time_goal = 0
+
+-- This is a custom function to make it easier to
+-- spawn more targets with just one line of code
+-- You may define as many custom functions as you
+-- like.
+function spawnTarget()
+	-- add a new target gear
+	gear = AddGear(0, 0, gtTarget, 0, 0, 0, 0)
+	
+	-- move it to a random position within 0 and
+	-- LAND_WIDTH - the width of the map
+	FindPlace(gear, true, 0, LAND_WIDTH-326)
+	
+	-- move the target to a higher vertical position
+	-- to ensure it's not somewhere down below
+	x, y = GetGearPosition(gear)
+	SetGearPosition(gear, x, 0)
+end
+
+-- This function is called before the game loads its
+-- resources.
+-- It's one of the predefined function names that will
+-- be called by the game. They give you entry points
+-- where you're able to call your own code using either
+-- provided instructions or custom functions.
+function onGameInit()
+	-- At first we have to overwrite/set some global variables
+	-- that define the map, the game has to load, as well as
+	-- other things such as the game rules to use, etc.
+	-- Things we don't modify here will use their default values.
+
+	-- The base number for the random number generator
+	Seed = 1
+	-- Game settings and rules
+	GameFlags = gfInfAttack + gfOneClanMode 
+	-- The time the player has to move each round (in ms)
+	TurnTime = 60000
+	-- The frequency of crate drops
+	CaseFreq = 0
+	-- The number of mines being placed
+	MinesNum = 0
+	-- The number of explosives being placed
+	Explosives = 0
+	-- The delay between each round
+	Delay = 1
+	-- The map to be played
+	Map = "Battlefield"
+	-- The theme to be used
+	Theme = "Castle"
+
+	-- Create the player team
+	AddTeam(loc("Grenadiers"), 14483456, "Simple", "Island", "Default")
+	-- And add a hog to it
+	player = AddHog(loc("Nade Boy"), 0, 1, "war_grenadier1")
+	SetGearPosition(player, 506, 76)
+end
+
+-- This function is called when the round starts
+-- it spawns the first target that has to be destroyed.
+-- In addition it shows the scenario goal(s).
+function onGameStart()
+	-- Spawn the first target.
+	spawnTarget()
+	
+	-- Show some nice mission goals.
+	-- Parameters are: caption, sub caption, description,
+	-- extra text, icon and time to show.
+	-- A negative icon parameter (-n) represents the n-th weapon icon
+	-- A positive icon paramter (n) represents the (n+1)-th mission icon
+	-- A timeframe of 0 is replaced with the default time to show.
+	ShowMission(loc("Grenade Training"), loc("Aiming Practice"), loc("Eliminate all targets before your time runs out.|You have unlimited ammo for this mission."), -amGrenade, 0)
+end
+
+function onNewTurn()
+	ParseCommand("setweap " .. string.char(amGrenade))
+end
+
+-- This function is called every game tick.
+-- Note that there are 1000 ticks within one second.
+-- You shouldn't try to calculate too complicated
+-- code here as this might slow down your game.
+function onGameTick20()
+	-- If time's up, set the game to be lost.
+	-- We actually check the time to be "1 ms" as it
+	-- will be at "0 ms" right at the start of the game.
+	if TurnTimeLeft < 40 and TurnTimeLeft > 0 and score < score_goal then
+		game_lost = true
+		-- ... and show a short message.
+		ShowMission(loc("Grenade Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
+		-- How about killing our poor hog due to his poor performance?
+		SetHealth(player, 0)
+		-- Just to be sure set the goal time to 1 ms
+		time_goal = 1
+	end
+	-- If the goal is reached or we've lost ...
+	if score == score_goal or game_lost then
+		-- ... check to see if the time we'd like to
+		-- wait has passed and then ...
+		if end_timer == 0 then
+			-- Override the 'Draw' message with the appropriate message.
+			if game_lost then
+				AddCaption("Mission lost!", 0xffba00ff,capgrpGameState)
+			else
+				AddCaption("Mission won!", 0xffba00ff,capgrpGameState)
+			end
+			-- Remove the team to end the game. Only do this once.
+			if team_death == false then
+				team_death = true
+				ParseCommand("teamgone " .. "Grenadiers")
+			end
+		else
+			-- ... or just lower the timer by 1.
+			end_timer = end_timer - 20
+			-- Reset the time left to stop the timer
+			TurnTimeLeft = time_goal
+		end
+	end
+end
+
+-- This function is called when the game is initialized
+-- to request the available ammo and probabilities
+function onAmmoStoreInit()
+	-- add an unlimited supply of bazooka ammo
+	SetAmmo(amGrenade, 9, 0, 0, 0)
+end
+
+-- This function is called when a new gear is added.
+-- We don't need it for this training, so we can
+-- keep it empty.
+-- function onGearAdd(gear)
+-- end
+
+-- This function is called before a gear is destroyed.
+-- We use it to count the number of targets destroyed.
+function onGearDelete(gear)
+	-- We're only interested in target gears.
+	if GetGearType(gear) == gtTarget then
+		-- Add one point to our score/counter
+		score = score + 1
+		-- If we haven't reached the goal ...
+		if score < score_goal then
+			-- ... spawn another target.
+			spawnTarget()
+		else
+			if not game_lost then
+			-- Otherwise show that the goal was accomplished
+			ShowMission(loc("Grenade Training"), loc("Aiming Practice"), loc("Congratulations! You've eliminated all targets|within the allowed time frame."), 0, 0)
+			-- Also let the hogs shout "victory!"
+			PlaySound(sndVictory)
+			-- Save the time left so we may keep it.
+			time_goal = TurnTimeLeft
+			end
+		end
+	end
+end
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
new file mode 100644
index 0000000..0de69b4
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
@@ -0,0 +1,199 @@
+--Created by Patrick Nielsen
+--It's been so fun to create this, your welcome to contact me at Trivkz at gmail.com
+--
+--I've tried to keep the code as clear as possible and with comments.
+--But as English is not my first language there may be spelling / grammar mistakes.
+--
+--I know there need to be more "tutorial" specefic messages, but I had a hard timer figuring out what to type / what would be the best technical description.
+
+
+loadfile( GetDataPath() .. "Scripts/Locale.lua" )()
+loadfile( GetDataPath() .. "Scripts/Utils.lua" )() -- For the gearIsInBox function, wrote my own, but decided it was a waste to include it
+
+local Player = nil -- Pointer to hog created in: onGameInit
+local Target = nil -- Pointer to target hog
+local GameLost = false -- You lost the game
+local Objective = false -- Get to the target
+
+local WaitTime = 10000 -- Wait 10sec before quit
+local FollowTime = 1500 -- For use with FollowGear
+local FollowingGear = false
+local BaseballIntro = false -- Fail safe for ticker
+local TargetNumber = 0 -- The current target number
+
+local TargetPos = {} -- Tabel of targets
+local Timers = {}
+local GetTime = 0
+
+TargetPos[ 1 ] = { X = 1100, Y = 1100, Message = loc("Now find the next target! |Tip: Normally you lose health by falling down, so be careful!") }
+TargetPos[ 2 ] = { X = 1500, Y = 1490, Message = loc("You're getting pretty good! |Tip: When you shorten you rope you move faster! |and when you lengthen it you move slower") }
+TargetPos[ 3 ] = { X = 2200, Y = 800, Message = loc("The next one is pretty hard! |Tip: You have to do multiple swings!") }
+TargetPos[ 4 ] = { X = 2870, Y = 400, Message = loc("I don't know how you did that.. But good work! |The next one should be easy as cake for you!") }
+TargetPos[ 5 ] = { X = 4000, Y = 1750, Message = "" }
+TargetPos[ 6 ] = { Modifier = true, Func = function() -- Last target is ALWAYS the "winning" target!
+	Info( loc("Congratulations"), loc("Congratulations! You've completed the Rope tutorial! |- Tutorial ends in 10 seconds!"), 0 ) -- Congrats
+	HogSay( Player, loc("Victory!"), SAY_SHOUT) -- You win!
+	PlaySound( sndVictory )
+
+	if TurnTimeLeft >= 250000 then -- If you very fast, unlock the ahievement "Rope Master!"
+		AddCaption( loc( "Achievement Unlocked" ) .. ": " .. loc( "Rope Master!" ),0xffba00ff,capgrpAmmoinfo )
+		PlaySound( sndHomerun )
+	end
+
+	Objective = true
+end }
+
+function Info( Title, Text, Icon ) -- I made a small wrapper to ease the process
+	ShowMission( loc("Rope Training"), Title, Text, Icon, 0 )
+end
+
+function NewFollowGear( Gear )
+	FollowingGear = true
+	FollowGear( Gear )
+end
+
+function SpawnTarget( PosX, PosY )
+	Target = AddGear( 0, 0, gtTarget, 0, 0, 0, 0 ) -- Create a new target
+	SetGearPosition( Target, PosX, PosY ) -- Set the position of the target
+	NewFollowGear( Target )
+end
+
+function AutoSpawn() -- Auto spawn the next target after you've killed the current target!
+	TargetNumber = TargetNumber + 1
+
+	if TargetPos[ TargetNumber ].Modifier then -- If there is a modifier, run the function, only used in the winning target!
+		TargetPos[ TargetNumber ].Func()
+		return true
+	end
+
+	if TargetNumber > 1 then
+		Info(loc("Aiming Practice"), TargetPos[ TargetNumber - 1 ].Message, -amRope )
+	end
+
+	SpawnTarget( TargetPos[ TargetNumber ].X, TargetPos[ TargetNumber ].Y ) -- Spawn target on the next position
+end
+
+function InRange( Gear, PosX, PosY, Distance ) -- Fix as the default function didn't do quite what I needed
+	GearX, GearY = GetGearPosition( Gear )
+
+    return GearX >= PosX - Distance and GearX <= PosX + Distance and GearY >= PosY and GearY - Distance <= PosY + Distance
+end
+
+function CheckPosition( Hog, Distance ) -- Show a message when you get close to the current target!
+	if (not BaseballIntro and not Objective) and (CurrentHedgehog ~= nil) then --Fail safe check
+		if InRange( Hog, 1100, 1100, Distance ) then -- Check if the player is within predefined position of the first target
+			BaseballIntro = true
+			Info(loc("Aiming Practice"), loc("Great work! Now hit it with your Baseball Bat! |Tip: You can change weapon with 'Right Click'!"), -amRope ) -- Guide them
+			Timer( 10000, loc("Remember: The rope only bend around objects, |if it doesn't hit anything it's always stright!"))
+		end
+	end
+end
+
+function Timer( Delay, Message )
+	local Timer = {}
+	Timer.End = GetTime + Delay
+	Timer.Message = Message
+
+	table.insert( Timers, Timer )
+end
+
+function onGameInit() -- Called when the game loads
+	Seed = 1 -- The base number for the random number generator
+	GameFlags = gfInfAttack + gfOneClanMode + gfSolidLand + gfInvulnerable + gfBorder -- Game settings and rules, going with a border to make it easier
+	TurnTime = 300000 -- Player can move for 5min each round
+	CaseFreq = 0 -- No random crate drops
+	MinesNum = 0 -- Never place any mines on the map
+	Explosives = 0 -- Never place any explosives
+	Delay = 1 -- We don't wont to wait between each round ( as the only is one )
+	Map = "Ropes" -- Map name
+	Theme = "Nature" -- Map theme
+
+	AddTeam( loc( "Rope Team" ), 14483456, "Simple", "Island", "Default" ) -- Lets make the team
+	Player = AddHog( loc( "Hunter" ), 0, 1, "StrawHat" ) -- Add a hog for it, and name it "Hunter"
+	SetGearPosition( Player, 420, 1750 ) -- Set player position
+
+	SetEffect( Player, heResurrectable, 1 ) -- By Suggestion :)
+end
+
+function onGameStart() -- Called when the game starts
+	AutoSpawn() -- Spawn our 1st target using the wrapper function
+
+	SetHealth( Player, 100 ) -- Give the player 100 Health points
+
+	Info(loc("Aiming Practice"), loc("Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"), -amRope ) -- Short intro to tell the player what to do
+	Timer( 10000, loc("Tip: The rope physics are different than in the real world, |use it to your advantage!") ) -- After 15 sec, give them more help
+end
+
+function onNewTurn()
+	ParseCommand( "setweap " .. string.char( amRope ) ) -- Set the default weapon to Rope
+end
+
+function onGameTick20()
+	if TurnTimeLeft < 40 and TurnTimeLeft > 0 then -- Round starts at 0, so we check if the round is finished by using 1
+		GameLost = true -- You lost the game
+		Info(loc("Aiming Practice"), loc("You did not make it in time, try again!"), -amSkip )
+		SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
+
+		SetEffect( Player, heResurrectable, 0 )
+
+	end
+
+	-- If the player gets to the last target, they win OR
+	-- If round is finished and your not at the target you lose
+	-- in either case, end the game
+	if (Objective == true) or (GameLost == true) then
+		if (WaitTime == 0) then
+			ParseCommand("teamgone " .. loc( "Rope Team" ))
+
+			--SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
+			--SetEffect( Player, heResurrectable, 0 )
+			TurnTimeLeft = 1
+
+			WaitTime = -1
+		else
+			WaitTime = WaitTime - 20
+		end
+	end
+
+	if FollowingGear == true then
+		if FollowTime == 0 then
+			FollowingGear = false
+			FollowTime = 1500
+			FollowGear( Player )
+		else
+			FollowTime = FollowTime - 20
+		end
+	end
+
+	for k, v in pairs( Timers ) do
+		if v.End <= GetTime then
+			Info(loc("Aiming Practice"), v.Message, -amRope )
+			Timers[ k ] = nil
+		end
+	end
+
+	GetTime = GetTime + 20
+
+	CheckPosition( Player, 70 ) -- Run the CheckPosition function to check if the player is close to a target
+end
+
+function onAmmoStoreInit()
+	SetAmmo( amRope, 9, 2, 0, 0 ) -- Player ammo, Rope
+	SetAmmo( amBaseballBat, 9, 2, 0, 0 ) --Baseball bat
+end
+
+function onGearResurrect( Gear )
+	if TargetNumber > 1 then
+		SetGearPosition( Player, TargetPos[ TargetNumber - 1 ].X, TargetPos[ TargetNumber - 1 ].Y ) -- If the player dies spawn him where he last killed a target
+		Info(loc("Aiming Practice"), loc("You have been respawned, at your last checkpoint!"), -amRope )
+	else
+		SetGearPosition( Player, 420, 1750 ) -- If the player dies and didn't kill a target just spawn him at the default spawn
+		Info(loc("Aiming Practice"), loc("You have been respawned, be more carefull next time!"), -amRope )
+	end
+end
+
+function onGearDelete( Gear )
+	if GetGearType( Gear ) == gtTarget then
+		AutoSpawn() -- When a target is deleted / destroyed, spawn a new one!
+	end
+end
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua
index 29e5030..656b73f 100644
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Shotgun.lua
@@ -46,7 +46,7 @@ function spawnTarget()
 	-- move the target to a higher vertical position
 	-- to ensure it's not somewhere down below
 	x, y = GetGearPosition(gear)
-	SetGearPosition(gear, x, 500)
+	SetGearPosition(gear, x, 0)
 end
 
 function onNewTurn()
@@ -88,7 +88,7 @@ function onGameInit()
 	AddTeam(loc("Shotgun Team"), 14483456, "Simple", "Island", "Default")
 	-- And add a hog to it
 	player = AddHog(loc("Hunter"), 0, 1, "NoHat")
-	SetGearPosition(player, 2334, 1254)
+	SetGearPosition(player, 1210, 230)
 end
 
 -- This function is called when the round starts
@@ -111,11 +111,11 @@ end
 -- Note that there are 1000 ticks within one second.
 -- You shouldn't try to calculate too complicated
 -- code here as this might slow down your game.
-function onGameTick()
+function onGameTick20()
 	-- If time's up, set the game to be lost.
 	-- We actually check the time to be "1 ms" as it
 	-- will be at "0 ms" right at the start of the game.
-	if TurnTimeLeft == 1 and score < score_goal then
+	if TurnTimeLeft < 40 and TurnTimeLeft > 20 and score < score_goal then
 		game_lost = true
 		-- ... and show a short message.
 		ShowMission(loc("Shotgun Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
@@ -133,7 +133,7 @@ function onGameTick()
 			EndGame()
 		else
 			-- ... or just lower the timer by 1.
-			end_timer = end_timer - 1
+			end_timer = end_timer - 20
 			-- Reset the time left to stop the timer
 			TurnTimeLeft = time_goal
 		end
@@ -150,8 +150,8 @@ end
 -- This function is called when a new gear is added.
 -- We don't need it for this training, so we can
 -- keep it empty.
-function onGearAdd(gear)
-end
+-- function onGearAdd(gear)
+-- end
 
 -- This function is called before a gear is destroyed.
 -- We use it to count the number of targets destroyed.
diff --git a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua
index 894f114..d9207a5 100644
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Sniper_Rifle.lua
@@ -112,7 +112,7 @@ end
 -- Note that there are 1000 ticks within one second.
 -- You shouldn't try to calculate too complicated
 -- code here as this might slow down your game.
-function onGameTick()
+function onGameTick20()
 	if game_lost then
 		return
 	end
@@ -127,7 +127,7 @@ function onGameTick()
 	-- If time's up, set the game to be lost.
 	-- We actually check the time to be "1 ms" as it
 	-- will be at "0 ms" right at the start of the game.
-	if TurnTimeLeft == 1 and score < score_goal then
+	if TurnTimeLeft < 40 and TurnTimeLeft > 0 and score < score_goal then
 		game_lost = true
 		-- ... and show a short message.
 		ShowMission(loc("Sniper Training"), loc("Aiming Practice"), loc("Oh no! Time's up! Just try again."), -amSkip, 0)
@@ -145,7 +145,7 @@ function onGameTick()
 			EndGame()
 		else
 			-- ... or just lower the timer by 1.
-			end_timer = end_timer - 1
+			end_timer = end_timer - 20
 			-- Reset the time left to stop the timer
 			TurnTimeLeft = time_goal
 		end
@@ -162,8 +162,8 @@ end
 -- This function is called when a new gear is added.
 -- We don't need it for this training, so we can
 -- keep it empty.
-function onGearAdd(gear)
-end
+-- function onGearAdd(gear)
+-- end
 
 -- This function is called before a gear is destroyed.
 -- We use it to count the number of targets destroyed.
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
index 0a21490..fc806dd 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Bamboo_Thicket.lua
@@ -26,8 +26,8 @@ function onGameInit()
 	AddTeam(loc("Cybernetic Empire"), 	1175851, "Simple", "Island", "Default")
 	enemy = AddHog(loc("Unit 835"), 1, 10, "cyborg1")
 
-	SetGearPosition(player,1166,1680)
-	SetGearPosition(enemy,2848,1443)
+	SetGearPosition(player,142,656)
+	SetGearPosition(enemy,1824,419)
 
 end
 
@@ -37,10 +37,10 @@ function onGameStart()
 	ShowMission(loc("Bamboo Thicket"), loc("User Challenge"), loc("Eliminate the enemy before the time runs out"), -amBazooka, 0)
 
 	--WEAPON CRATE LIST. WCRATES: 1
-	SpawnAmmoCrate(1915,1876,amBazooka)
+	SpawnAmmoCrate(891,852,amBazooka)
 	--UTILITY CRATE LIST. UCRATES: 2
-	SpawnUtilityCrate(1986,1141,amBlowTorch)
-	SpawnUtilityCrate(1427,1527,amParachute)
+	SpawnUtilityCrate(962,117,amBlowTorch)
+	SpawnUtilityCrate(403,503,amParachute)
 
 	AddAmmo(enemy, amGrenade, 100)
 		
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua
index f86a1ed..a470212 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Dangerous_Ducklings.lua
@@ -40,9 +40,9 @@ function onGameInit()
 	AddTeam("Blue Team", 29439, "Simple", "Island", "Default")
 	enemy = AddHog("Filthy Blue", 1, 100, "Skull")
 
-	SetGearPosition(player, 1170, 1926)
-	SetGearPosition(instructor, 1341, 1926)
-	SetGearPosition(enemy, 2942, 1861)
+	SetGearPosition(player,146,902)
+	SetGearPosition(instructor,317,902)
+	SetGearPosition(enemy,1918,837)
 
 
 	HogSay(player, ".............................", SAY_THINK)
@@ -54,8 +54,8 @@ end
 
 function onGameStart()
 
-	SpawnAmmoCrate(1499,1500,amRope)
-	SpawnAmmoCrate(2753,1500,amFirePunch)
+	SpawnAmmoCrate(475,476,amRope)
+	SpawnAmmoCrate(1729,476,amFirePunch)
 
 	FollowGear(player)
 
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua
index 9702955..65575c2 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Diver.lua
@@ -28,8 +28,8 @@ function onGameInit()
 	AddTeam(loc("Toxic Team"), 	1175851, "Simple", "Island", "Default")
 	enemy = AddHog(loc("Poison"), 1, 100, "Skull")
 
-	SetGearPosition(player, 1454, 1540)
-	SetGearPosition(enemy, 2488, 1960)
+	SetGearPosition(player,430,516)
+	SetGearPosition(enemy,1464,936)
 
 end
 
@@ -37,12 +37,12 @@ end
 function onGameStart()
 
 
-	SpawnAmmoCrate(1450,1910,amJetpack)
-	SpawnAmmoCrate(2568,1714,amFirePunch)
-	SpawnAmmoCrate(1974,1875,amBlowTorch)
-	SpawnAmmoCrate(2056,1877,amParachute)
+	SpawnAmmoCrate(426,886,amJetpack)
+	SpawnAmmoCrate(1544,690,amFirePunch)
+	SpawnAmmoCrate(950,851,amBlowTorch)
+	SpawnAmmoCrate(1032,853,amParachute)
 
-	AddGear(1603, 1320, gtMine, 0, 0, 0, 0)
+	AddGear(579, 296, gtMine, 0, 0, 0, 0)
 
 	ShowMission(loc("Operation Diver"), "", loc("Eliminate Poison before the time runs out") .. loc("|- Mines Time:") .. " " .. 1 .. " " .. loc("sec"), -amFirePunch, 0);
 	--SetTag(AddGear(0, 0, gtATSmoothWindCh, 0, 0, 0, 1), -70)
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua
index 3e6a681..e983f60 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Newton_and_the_Hammock.lua
@@ -27,8 +27,8 @@ function onGameInit()
 	AddTeam(loc("Cybernetic Empire"), 	1175851, "Simple", "Island", "Default")
 	enemy = AddHog(loc("Unit") .. " 811", 1, 100, "cyborg1")
 
-	SetGearPosition(player, 1454, 1540)
-	SetGearPosition(enemy, 2488, 1960)
+	SetGearPosition(player,430,1540)
+	SetGearPosition(enemy,1464,1960)
 
 end
 
@@ -39,57 +39,57 @@ function onGameStart()
 	AddAmmo(enemy, amFirePunch, 100)
 
 	--GIRDER LIST. 
-	PlaceGirder(2097,2009,0)
-	PlaceGirder(1548,1487,3)
-	PlaceGirder(1662,1453,4)
-	PlaceGirder(1785,1453,0)
-	PlaceGirder(1864,1421,3)
-	PlaceGirder(1326,1388,6)
-	PlaceGirder(1351,1506,1)
-	PlaceGirder(2693,1832,3)
+	PlaceGirder(1073,2009,0)
+	PlaceGirder(524,1487,3)
+	PlaceGirder(638,1453,4)
+	PlaceGirder(761,1453,0)
+	PlaceGirder(840,1421,3)
+	PlaceGirder(302,1388,6)
+	PlaceGirder(327,1506,1)
+	PlaceGirder(1669,1832,3)
 	--MINE LIST. 
-	AddGear(2080,1987,gtMine, 0, 0, 0, 0)
-	AddGear(2110,1988,gtMine, 0, 0, 0, 0)
+	AddGear(1056,1987,gtMine, 0, 0, 0, 0)
+	AddGear(1086,1988,gtMine, 0, 0, 0, 0)
 	--STICKY MINE LIST. 
-	AddGear(2113,965,gtSMine, 0, 0, 0, 0)
-	AddGear(2157,945,gtSMine, 0, 0, 0, 0)	
-	AddGear(2034,1081,gtSMine, 0, 0, 0, 0)
-	AddGear(2060,1049,gtSMine, 0, 0, 0, 0)
-	AddGear(2081,1004,gtSMine, 0, 0, 0, 0)
-	AddGear(1808,1252,gtSMine, 0, 0, 0, 0)
-	AddGear(1865,1257,gtSMine, 0, 0, 0, 0)
-	AddGear(1926,1263,gtSMine, 0, 0, 0, 0)
-	AddGear(1976,1281,gtSMine, 0, 0, 0, 0)
-	AddGear(1541,1546,gtSMine, 0, 0, 0, 0)
-	AddGear(1583,1597,gtSMine, 0, 0, 0, 0)
-	AddGear(1637,1650,gtSMine, 0, 0, 0, 0)
-	AddGear(1698,1705,gtSMine, 0, 0, 0, 0)
-	AddGear(1770,1692,gtSMine, 0, 0, 0, 0)
-	AddGear(1834,1692,gtSMine, 0, 0, 0, 0)
-	AddGear(1896,1673,gtSMine, 0, 0, 0, 0)
-	AddGear(1957,1666,gtSMine, 0, 0, 0, 0)
-	AddGear(2005,1662,gtSMine, 0, 0, 0, 0)
-	AddGear(2040,1634,gtSMine, 0, 0, 0, 0)
-	AddGear(2087,1595,gtSMine, 0, 0, 0, 0)
-	AddGear(2124,1574,gtSMine, 0, 0, 0, 0)
-	AddGear(2026,1461,gtSMine, 0, 0, 0, 0)
-	AddGear(2076,1438,gtSMine, 0, 0, 0, 0)
-	AddGear(2126,1464,gtSMine, 0, 0, 0, 0)
+	AddGear(1089,965,gtSMine, 0, 0, 0, 0)
+	AddGear(1133,945,gtSMine, 0, 0, 0, 0)	
+	AddGear(1010,1081,gtSMine, 0, 0, 0, 0)
+	AddGear(1036,1049,gtSMine, 0, 0, 0, 0)
+	AddGear(1057,1004,gtSMine, 0, 0, 0, 0)
+	AddGear(784,1252,gtSMine, 0, 0, 0, 0)
+	AddGear(841,1257,gtSMine, 0, 0, 0, 0)
+	AddGear(902,1263,gtSMine, 0, 0, 0, 0)
+	AddGear(952,1281,gtSMine, 0, 0, 0, 0)
+	AddGear(517,1546,gtSMine, 0, 0, 0, 0)
+	AddGear(559,1597,gtSMine, 0, 0, 0, 0)
+	AddGear(613,1650,gtSMine, 0, 0, 0, 0)
+	AddGear(674,1705,gtSMine, 0, 0, 0, 0)
+	AddGear(746,1692,gtSMine, 0, 0, 0, 0)
+	AddGear(810,1692,gtSMine, 0, 0, 0, 0)
+	AddGear(872,1673,gtSMine, 0, 0, 0, 0)
+	AddGear(933,1666,gtSMine, 0, 0, 0, 0)
+	AddGear(981,1662,gtSMine, 0, 0, 0, 0)
+	AddGear(1016,1634,gtSMine, 0, 0, 0, 0)
+	AddGear(1063,1595,gtSMine, 0, 0, 0, 0)
+	AddGear(1100,1574,gtSMine, 0, 0, 0, 0)
+	AddGear(1002,1461,gtSMine, 0, 0, 0, 0)
+	AddGear(1052,1438,gtSMine, 0, 0, 0, 0)
+	AddGear(1102,1464,gtSMine, 0, 0, 0, 0)
 	--WEAPON CRATE LIST. 
-	SpawnAmmoCrate(2589,642,amSineGun)
-	SpawnAmmoCrate(1572,858,amBazooka)
+	SpawnAmmoCrate(1565,642,amSineGun)
+	SpawnAmmoCrate(548,858,amBazooka)
 	--UTILITY CRATE LIST.
-	SpawnUtilityCrate(1503,847,amJetpack)
-	SpawnUtilityCrate(2574,1715,amBlowTorch)
-	SpawnUtilityCrate(2251,1941,amJetpack)
-	SpawnUtilityCrate(2094,1964,amInvulnerable)
-	SpawnUtilityCrate(2094,1875,amTeleport)
+	SpawnUtilityCrate(479,847,amJetpack)
+	SpawnUtilityCrate(1550,1715,amBlowTorch)
+	SpawnUtilityCrate(1227,1941,amJetpack)
+	SpawnUtilityCrate(1070,1964,amInvulnerable)
+	SpawnUtilityCrate(1070,1875,amTeleport)
 	--HOG POSITION LIST.
 	if hhs[0] ~= nil then
-       		 SetGearPosition(hhs[0],1421,865)
+       		 SetGearPosition(hhs[0],397,865)
 	end
 		if hhs[1] ~= nil then
-        	SetGearPosition(hhs[1],1585,1365)
+        	SetGearPosition(hhs[1],561,1365)
 	end
 
 	ShowMission(loc("Newton's Hammock"), loc("User Challenge"), loc("Eliminate the enemy before the time runs out"), -amParachute, 0)
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua
new file mode 100644
index 0000000..770abff
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_RCPlane_Challenge.lua
@@ -0,0 +1,338 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+
+local player = nil
+local RCGear = nil
+local planesUsed = 0
+local cratesLeft = 0
+
+function onGameInit()
+
+	Seed = 1
+	GameFlags = gfInfAttack + gfInvulnerable + gfOneClanMode + gfSolidLand
+
+	TurnTime = 90 * 1000
+
+	Map = "Ropes"
+	Theme = "Eyes"
+
+	CaseFreq = 0
+	MinesNum = 0
+	Explosives = 0
+
+	AddTeam(loc("Wannabe Flyboys"), 14483456, "Simple", "Island", "Default", "Hedgewars")
+	player = AddHog(loc("Ace"), 0, 80, "Gasmask") --NoHat
+	SetGearPosition(player, 1380, 1500)
+
+end
+
+
+
+function onGameStart()
+
+	ShowMission     (
+                                loc("RC PLANE TRAINING"),
+                                loc("a Hedgewars challenge"),
+
+                                loc("Collect or destroy all the health crates.") .. "|" ..
+                                loc("Compete to use as few planes as possible!") .. "|" ..
+								"", -amRCPlane, 4000
+                                )
+
+	PlaceGirder(2192, 508, 6)
+	PlaceGirder(2192, 670, 6)
+	PlaceGirder(2193, 792, 2)
+	PlaceGirder(2100, 825, 4)
+	PlaceGirder(2009, 899, 6)
+	PlaceGirder(2084, 992, 4)
+	PlaceGirder(2145, 1087, 6)
+	PlaceGirder(2199, 1235, 5)
+	PlaceGirder(2308, 1296, 0)
+	PlaceGirder(2424, 1234, 7)
+	PlaceGirder(2473, 1129, 2)
+	PlaceGirder(2437, 1046, 1)
+	PlaceGirder(2409, 927, 6)
+	PlaceGirder(2408, 763, 6)
+	PlaceGirder(2404, 540, 6)
+	PlaceGirder(2426, 423, 3)
+	PlaceGirder(2550, 400, 4)
+	PlaceGirder(2668, 425, 1)
+	PlaceGirder(2707, 541, 6)
+	PlaceGirder(2706, 703, 6)
+	PlaceGirder(2705, 867, 6)
+	PlaceGirder(2779, 962, 4)
+	PlaceGirder(2894, 924, 3)
+	PlaceGirder(2908, 802, 6)
+	PlaceGirder(2907, 639, 6)
+	PlaceGirder(3052, 566, 4)
+	PlaceGirder(2971, 394, 4)
+	PlaceGirder(3103, 448, 7)
+	PlaceGirder(3047, 654, 0)
+	PlaceGirder(3043, 746, 6)
+	PlaceGirder(3265, 1583, 6)
+	PlaceGirder(3256, 1491, 4)
+	PlaceGirder(3187, 1401, 6)
+	PlaceGirder(3326, 1400, 6)
+	PlaceGirder(774, 530, 5)
+	PlaceGirder(922, 595, 4)
+	PlaceGirder(1079, 533, 7)
+	PlaceGirder(1139, 386, 6)
+	PlaceGirder(1074, 237, 5)
+	PlaceGirder(723, 381, 6)
+	PlaceGirder(781, 229, 7)
+	PlaceGirder(927, 746, 6)
+	PlaceGirder(874, 736, 0)
+	PlaceGirder(982, 737, 0)
+	PlaceGirder(2430, 1730, 4)
+
+	PlaceGirder(1613, 1104, 7)
+	PlaceGirder(1564, 1256, 6)
+	PlaceGirder(1643, 1341, 5)
+	PlaceGirder(1780, 1372, 4)
+	PlaceGirder(1869, 1296, 7)
+	PlaceGirder(1858, 1163, 5)
+	PlaceGirder(1739, 1044, 5)
+	PlaceGirder(1621, 926, 5)
+	PlaceGirder(1597, 985, 5)
+	PlaceGirder(1449, 939, 4)
+	PlaceGirder(1473, 874, 4)
+	PlaceGirder(2092, 1352, 7)
+	PlaceGirder(2145, 1444, 7)
+	PlaceGirder(2004, 1443, 3)
+	PlaceGirder(1978, 1523, 2)
+	PlaceGirder(2021, 1596, 1)
+	PlaceGirder(2103, 1625, 0)
+	PlaceGirder(2208, 1551, 7)
+	PlaceGirder(2327, 1431, 7)
+	PlaceGirder(2395, 1478, 6)
+	PlaceGirder(2396, 1600, 2)
+	PlaceGirder(2495, 1285, 6)
+	PlaceGirder(2494, 1408, 2)
+	PlaceGirder(2547, 530, 0)
+
+	PlaceGirder(2451, 1551, 0)
+	PlaceGirder(2551, 706, 6)
+	PlaceGirder(2551, 869, 6)
+	PlaceGirder(2623, 1016, 5)
+	PlaceGirder(2773, 1083, 4)
+	PlaceGirder(2924, 1019, 7)
+	PlaceGirder(2568, 1491, 7)
+	PlaceGirder(2618, 1346, 6)
+	PlaceGirder(2674, 1195, 7)
+	PlaceGirder(2822, 1142, 4)
+	PlaceGirder(2963, 1069, 7)
+	PlaceGirder(3067, 938, 5)
+	PlaceGirder(2803, 1373, 2)
+	PlaceGirder(2811, 1559, 2)
+
+	tempG = SpawnHealthCrate(930, 557)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(979, 692)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(876, 703)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2309, 1260)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1733, 1127)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1738, 1320)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3249, 1460)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3051, 617)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2972, 353)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2548, 358)
+
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2090, 1580)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1752, 1753)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1865, 1758)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1985, 1760)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2429, 1760)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2810, 1480)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2800, 1277)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2806, 1107)
+	SetHealth(tempG, 25)
+
+	PlaceGirder(1897, 903, 6)
+	PlaceGirder(1916, 784, 3)
+	PlaceGirder(2010, 732, 4)
+	PlaceGirder(2082, 639, 6)
+	PlaceGirder(2081, 516, 2)
+	PlaceGirder(1985, 487, 4)
+	PlaceGirder(1862, 407, 5)
+	PlaceGirder(1855, 224, 7)
+	PlaceGirder(2006, 163, 4)
+	PlaceGirder(2128, 187, 1)
+	PlaceGirder(2251, 213, 4)
+	PlaceGirder(2413, 213, 4)
+	PlaceGirder(1952, 618, 0)
+	PlaceGirder(957, 1068, 4)
+	PlaceGirder(794, 1069, 4)
+	PlaceGirder(728, 1163, 6)
+	PlaceGirder(728, 1287, 2)
+	PlaceGirder(802, 1342, 4)
+	PlaceGirder(966, 1342, 4)
+	PlaceGirder(674, 1032, 1)
+	PlaceGirder(554, 1011, 4)
+	PlaceGirder(445, 1056, 3)
+	PlaceGirder(422, 1174, 6)
+	PlaceGirder(369, 1341, 5)
+	PlaceGirder(495, 1313, 5)
+	PlaceGirder(568, 1379, 3)
+	PlaceGirder(577, 1202, 2)
+	PlaceGirder(744, 1490, 5)
+	PlaceGirder(760, 1617, 7)
+	PlaceGirder(622, 1693, 4)
+	PlaceGirder(476, 1623, 5)
+	PlaceGirder(376, 1697, 1)
+	PlaceGirder(955, 1746, 2)
+	PlaceGirder(1025, 1746, 2)
+	PlaceGirder(1090, 1745, 2)
+	PlaceGirder(1156, 1746, 2)
+	PlaceGirder(3806, 1530, 2)
+	PlaceGirder(3880, 1464, 2)
+	PlaceGirder(3738, 1458, 2)
+	PlaceGirder(3806, 1390, 2)
+	PlaceGirder(3805, 1588, 0)
+	PlaceGirder(3676, 1609, 3)
+	PlaceGirder(3930, 1615, 1)
+	PlaceGirder(3719, 1295, 0)
+	PlaceGirder(3888, 1294, 0)
+	PlaceGirder(3661, 1385, 2)
+	PlaceGirder(3955, 1377, 2)
+	PlaceGirder(3982, 1518, 0)
+	PlaceGirder(3378, 440, 2)
+	PlaceGirder(3447, 492, 4)
+	PlaceGirder(3564, 529, 1)
+	PlaceGirder(3596, 647, 6)
+	PlaceGirder(3521, 740, 4)
+	PlaceGirder(3524, 838, 4)
+	PlaceGirder(3644, 819, 3)
+	PlaceGirder(3691, 708, 6)
+	PlaceGirder(3690, 545, 6)
+	PlaceGirder(3612, 433, 5)
+	PlaceGirder(3463, 383, 4)
+	PlaceGirder(2815, 122, 7)
+	PlaceGirder(2960, 72, 4)
+	PlaceGirder(3032, 123, 2)
+	PlaceGirder(3063, 174, 0)
+	PlaceGirder(3095, 124, 2)
+	PlaceGirder(3169, 71, 4)
+	PlaceGirder(3320, 124, 5)
+	PlaceGirder(3210, 179, 2)
+	PlaceGirder(2932, 181, 2)
+
+	tempG = SpawnHealthCrate(3804, 1461)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3269, 1742)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3066, 121)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3207, 104)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2928, 103)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1997, 202)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2253, 159)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2132, 774)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(2549, 490)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3527, 694)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3777, 78)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1124, 1746)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1056, 1740)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(993, 1742)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(799, 1298)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(577, 1126)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(596, 1463)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(3854, 1043)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(1944, 567)
+	SetHealth(tempG, 25)
+	tempG = SpawnHealthCrate(338, 1748)
+	SetHealth(tempG, 25)
+
+
+end
+
+--function onGameTick()
+
+	--if RCGear ~= nil then
+	--	AddCaption(GetTimer(RCGear))
+	--end
+
+--end
+
+function onNewTurn()
+	TurnTimeLeft = -1
+end
+
+function onGearAdd(gear)
+
+	if GetGearType(gear) == gtRCPlane then
+		RCGear = gear
+		planesUsed = planesUsed + 1
+	end
+
+	if GetGearType(gear) == gtCase then
+		cratesLeft = cratesLeft + 1
+	end
+
+end
+
+function onGearDelete(gear)
+
+	if GetGearType(gear) == gtRCPlane then
+
+		RCGear = nil
+		AddCaption(loc("Planes Used:") .. " " .. planesUsed)
+
+	elseif GetGearType(gear) == gtCase then
+
+		AddCaption(loc("Crates Left:") .. " " .. cratesLeft)
+		cratesLeft = cratesLeft - 1
+
+		if cratesLeft == 0 then
+
+			ShowMission     (
+                                loc("CHALLENGE COMPLETE"),
+                                loc("Congratulations!"),
+                                loc("Planes Used") .. ": " .. planesUsed .. "|" ..
+                                "", 0, 0
+                                )
+
+
+			ParseCommand("teamgone Wannabe Flyboys")
+		end
+
+		if RCGear ~= nil then
+			SetTimer(RCGear, GetTimer(RCGear) + 10000)
+		end
+
+	end
+
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amRCPlane, 9, 0, 0, 0)
+end
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua
new file mode 100644
index 0000000..64b1780
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Rope_Knock_Challenge.lua
@@ -0,0 +1,221 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+
+local hhs = {}
+local missionWon = nil
+local endTimer = 1000
+local hogsKilled = 0
+
+local HogData =	{
+					{"Bufon", 			"ShaggyYeti",false},
+					{"burp", 			"lambda",false},
+					{"Blue", 			"cap_blue",false},
+					{"bender", 			"NoHat",false},
+					{"Castell",			"NoHat",false},
+					{"cekoto", 			"NoHat",false},
+					{"CheezeMonkey",	"NoHat",false},
+					{"claymore", 		"NoHat",false},
+					{"CIA-144", 		"cyborg1",false},
+					{"doomy ", 			"NoHat",false},
+					{"Falkenauge", 		"NoHat",false},
+					{"FadeOne", 		"NoHat",false},
+					{"hayaa", 			"NoHat",false},
+					{"Hermes", 			"laurel",false},
+					{"HedgeKing",		"NoHat",false},
+					{"Izack1535", 		"NoHat",false},
+					{"Kiofspa", 		"NoHat",false},
+					{"Komplex", 		"NoHat",false},
+					{"koda", 			"poke_mudkip",false},
+					{"Lalo", 			"NoHat",false},
+					{"Logan", 			"NoHat",false},
+					{"lollkiller", 		"NoHat",false},
+					{"Luelle", 			"NoHat",false},
+					{"mikade", 			"Skull",false},
+					{"Mushi", 			"sm_daisy",false},
+					{"Naboo", 			"NoHat",false},
+					{"nemo", 			"bb_bub",false},
+					{"practice", 		"NoHat",false},
+					{"Prof. Panic",  	"NoHat",false},
+					{"Randy",			"zoo_Sheep",false},
+					{"rhino", 			"NinjaTriangle",false},
+					{"Radissthor",  	"NoHat",false},
+					{"Sami",			"sm_peach",false},
+					{"soreau", 			"NoHat",false},
+					{"sdw195", 			"NoHat",false},
+					{"sphrix", 			"TeamTopHat",false},
+					{"sheepluva",		"zoo_Sheep",false},
+					{"Smaxx", 			"NoHat",false},
+					{"shadowzero", 		"NoHat",false},
+					{"Star and Moon",	"SparkleSuperFun",false},
+					{"The 24",			"NoHat",false},
+					{"TLD",				"NoHat",false},
+					{"Tiyuri", 			"sf_ryu",false},
+					{"unC0Rr", 			"cyborg1",false},
+					{"Waldsau", 		"cyborg1",false},
+					{"wolfmarc", 		"knight",false},
+					{"Xeli", 			"android",false}
+
+				}
+
+function GenericEnd()
+	ParseCommand("teamgone " .. loc("Wannabe Shoppsta"))
+	ParseCommand("teamgone " .. loc("Unsuspecting Louts"))
+	ParseCommand("teamgone " .. loc("Unlucky Sods"))
+end
+
+function GameOverMan()
+	missionWon = false
+	ShowMission(loc("ROPE-KNOCKING"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
+	PlaySound(sndHellish)
+end
+
+function GG()
+	missionWon = true
+	ShowMission(loc("ROPE-KNOCKING"), loc("MISSION SUCCESS"), loc("Congratulations!") .. "|" .. loc("COMPLETION TIME") .. ": " .. (TurnTime - TurnTimeLeft) / 1000, 0, 0)
+	PlaySound(sndHomerun)
+end
+
+function AssignCharacter(p)
+
+	done = false
+	sanityCheck = 0
+
+	while(done == false) do
+
+		i = 1+ GetRandom(#HogData)
+		if HogData[i][3] == false then
+			HogData[i][3] = true
+			done = true
+			SetHogName(hhs[p], HogData[i][1])
+			SetHogHat(hhs[p], HogData[i][2])
+		elseif HogData[i][3] == true then
+			sanityCheck = sanityCheck +1
+			if sanityCheck == 100 then
+				done = true
+				SetHogName(hhs[p], "Newbie")
+				SetHogHat(hhs[p], "NoHat")
+			end
+		end
+
+	end
+
+end
+
+function onGameInit()
+
+	--Seed = 1
+	GameFlags = gfBorder + gfSolidLand
+
+	TurnTime = 180 * 1000
+	Delay = 500
+	Map = "Ropes"
+	Theme = "Eyes"
+
+	CaseFreq = 0
+	MinesNum = 0
+	Explosives = 0
+
+	AddTeam(loc("Wannabe Shoppsta"), 1175851, "Simple", "Island", "Default", "Hedgewars")
+	hhs[0] = AddHog(loc("Ace"), 0, 1, "Gasmask")
+	SetGearPosition(player, 1380, 1500)
+
+	AddTeam(loc("Unsuspecting Louts"), 14483456, "Simple", "Island", "Default", "Hedgewars")
+	for i = 1, 8 do
+		hhs[i] = AddHog("generic", 0, 1, "NoHat")
+	end
+
+	AddTeam(loc("Unlucky Sods"), 14483456, "Simple", "Island", "Default", "Hedgewars")
+	for i = 9, 16 do
+		hhs[i] = AddHog("generic", 0, 1, "NoHat")
+	end
+
+end
+
+
+
+function onGameStart()
+
+	ShowMission     (
+                        loc("ROPE-KNOCKING"),
+                        loc("a Hedgewars challenge"),
+                        loc("Use the rope to knock your enemies to their doom.") .. "|" ..
+
+						"", -amRope, 4000
+					)
+
+	SetGearPosition(hhs[0], 2419, 1769)
+	SetGearPosition(hhs[1], 3350, 570)
+	SetGearPosition(hhs[2], 3039, 1300)
+	SetGearPosition(hhs[3], 2909, 430)
+	SetGearPosition(hhs[4], 2150, 879)
+	SetGearPosition(hhs[5], 1735, 1136)
+	SetGearPosition(hhs[6], 1563, 553)
+	SetGearPosition(hhs[7], 679, 859)
+	SetGearPosition(hhs[8], 1034, 251)
+	SetGearPosition(hhs[9], 255, 67)
+	SetGearPosition(hhs[10], 2671, 7)
+	SetGearPosition(hhs[11], 2929, 244)
+	SetGearPosition(hhs[12], 1946, 221)
+	SetGearPosition(hhs[13], 3849, 1067)
+	SetGearPosition(hhs[14], 3360, 659)
+	SetGearPosition(hhs[15], 3885, 285)
+	SetGearPosition(hhs[16], 935, 1160)
+
+	for i = 1, 16 do
+		AssignCharacter(i)
+	end
+
+end
+
+function onGameTick()
+
+	if (TurnTimeLeft == 1) and (missionWon == nil) then
+		GameOverMan()
+	end
+
+	if missionWon ~= nil then
+
+		endTimer = endTimer - 1
+		if endTimer == 1 then
+			GenericEnd()
+		end
+
+		if missionWon == true then
+			AddCaption(loc("GG!"), 0xffba00ff,capgrpGameState)
+		else
+			AddCaption(loc("Ouch!"), 0xffba00ff,capgrpGameState)
+		end
+
+	end
+
+end
+
+function onGearDamage(gear, damage)
+
+	if gear ~= hhs[0] then
+
+		AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+		DeleteGear(gear)
+		PlaySound(sndExplosion)
+
+		hogsKilled = hogsKilled +1
+		if hogsKilled == 15 then
+			PlaySound(sndRideOfTheValkyries)
+		elseif hogsKilled == 16 then
+			GG()
+		end
+
+	end
+
+end
+
+function onGearDelete(gear)
+
+	if (gear == hhs[0]) and (missionWon == nil) then
+		GameOverMan()
+	end
+
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amRope, 9, 0, 0, 0)
+end
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua
index 7f85ce6..7f09c32 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Spooky_Tree.lua
@@ -34,8 +34,8 @@ function onGameInit()
 	AddTeam(loc("Toxic Team"), 	1175851, "Simple", "Island", "Default")
 	enemy = AddHog(loc("Poison"), 1, 10, "Skull")
 
-	SetGearPosition(player, 1994, 1047)
-	SetGearPosition(enemy, 1522, 1830)
+	SetGearPosition(player,970,23)
+	SetGearPosition(enemy,498,806)
 
 end
 
@@ -43,42 +43,42 @@ end
 function onGameStart()
 
 	--right side mines
-	AddGear(2705, 1383, gtMine, 0, 0, 0, 0)
-	AddGear(2742, 1542, gtMine, 0, 0, 0, 0)
-	AddGear(2672, 1551, gtMine, 0, 0, 0, 0)
-	AddGear(2608, 1546, gtMine, 0, 0, 0, 0)
+	AddGear(1681,359,gtMine, 0, 0, 0, 0)
+	AddGear(1718,518,gtMine, 0, 0, 0, 0)
+	AddGear(1648,527,gtMine, 0, 0, 0, 0)
+	AddGear(1584,522,gtMine, 0, 0, 0, 0)
 
 	--tunnel mines
-	AddGear(1325, 1593, gtSMine, 0, 0, 0, 0)
-	AddGear(1396, 1632, gtSMine, 0, 0, 0, 0)
-	AddGear(1477, 1652, gtSMine, 0, 0, 0, 0)
-	AddGear(1548, 1635, gtSMine, 0, 0, 0, 0)
-	AddGear(1637, 1635, gtSMine, 0, 0, 0, 0)
-
-	AddGear(1332, 1510, gtSMine, 0, 0, 0, 0)
-	AddGear(1396, 1502, gtSMine, 0, 0, 0, 0)
-	AddGear(1477, 1490, gtSMine, 0, 0, 0, 0)
-	AddGear(1548, 1495, gtSMine, 0, 0, 0, 0)
-	AddGear(1637, 1490, gtSMine, 0, 0, 0, 0)
+	AddGear(301,569,gtSMine, 0, 0, 0, 0)
+	AddGear(372,608,gtSMine, 0, 0, 0, 0)
+	AddGear(453,628,gtSMine, 0, 0, 0, 0)
+	AddGear(524,611,gtSMine, 0, 0, 0, 0)
+	AddGear(613,611,gtSMine, 0, 0, 0, 0)
+
+	AddGear(308,486,gtSMine, 0, 0, 0, 0)
+	AddGear(372,478,gtSMine, 0, 0, 0, 0)
+	AddGear(453,466,gtSMine, 0, 0, 0, 0)
+	AddGear(524,471,gtSMine, 0, 0, 0, 0)
+	AddGear(613,466,gtSMine, 0, 0, 0, 0)
 
 	--above the tunnel mines
-	AddGear(1355, 1457, gtMine, 0, 0, 0, 0)
-	AddGear(1428, 1444, gtMine, 0, 0, 0, 0)
-	AddGear(1508, 1448, gtMine, 0, 0, 0, 0)
-	AddGear(1586, 1441, gtMine, 0, 0, 0, 0)
-	AddGear(1664, 1436, gtMine, 0, 0, 0, 0)
+	AddGear(331,433,gtMine, 0, 0, 0, 0)
+	AddGear(404,420,gtMine, 0, 0, 0, 0)
+	AddGear(484,424,gtMine, 0, 0, 0, 0)
+	AddGear(562,417,gtMine, 0, 0, 0, 0)
+	AddGear(640,412,gtMine, 0, 0, 0, 0)
 
 	-- crates crates and more crates
-	SpawnAmmoCrate(2232,1600,amBlowTorch)
-	SpawnAmmoCrate(2491,1400,amPickHammer)
-	SpawnUtilityCrate(1397,1189,amGirder)
-	SpawnUtilityCrate(1728,1647,amJetpack)
-	SpawnUtilityCrate(2670,1773,amLaserSight)
+	SpawnAmmoCrate(1208,576,amBlowTorch)
+	SpawnAmmoCrate(1467,376,amPickHammer)
+	SpawnUtilityCrate(373,165,amGirder)
+	SpawnUtilityCrate(704,623,amJetpack)
+	SpawnUtilityCrate(1646,749,amLaserSight)
 
-	SpawnAmmoCrate(1769,1442,amShotgun) --shotgun1
-	SpawnAmmoCrate(1857,1456,amFirePunch) --fire punch
-	GirderCrate = SpawnAmmoCrate(2813,1538,amShotgun) -- final shotgun
-	SpawnAmmoCrate(2205,1443,amBee)
+	SpawnAmmoCrate(745,418,amShotgun) --shotgun1
+	SpawnAmmoCrate(833,432,amFirePunch) --fire punch
+	GirderCrate = SpawnAmmoCrate(1789,514,amShotgun) -- final shotgun
+	SpawnAmmoCrate(1181,419,amBee)
 
 	ShowMission(loc("Spooky Tree"), "", loc("Eliminate all enemies") .. loc("|- Mines Time:") .. " " .. 0 .. " " .. loc("sec"), -amBee, 0)
 
@@ -92,12 +92,12 @@ function onGameTick()
 
 	if CurrentHedgehog ~= nil then
 
-		if (birdSqualk == false) and (GetX(CurrentHedgehog) == 2126) and (GetY(CurrentHedgehog) == 1157)  then
+		if (birdSqualk == false) and (GetX(CurrentHedgehog) == 1102) and (GetY(CurrentHedgehog) == 133)  then
 			birdSqualk = true
 			PlaySound(sndBirdyLay)
 		end
 
-		if (birdSpeech == false) and (GetX(CurrentHedgehog) == 2092) and (GetY(CurrentHedgehog) == 1186) then
+		if (birdSpeech == false) and (GetX(CurrentHedgehog) == 1068) and (GetY(CurrentHedgehog) == 162) then
 			birdSpeech = true
 			HogSay(player,loc("Good birdy......"),SAY_THINK)
 		end
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua
index 17d581a..cc15dfb 100644
--- a/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_Teamwork.lua
@@ -30,9 +30,9 @@ function onGameInit()
 	AddTeam(loc("Cybernetic Empire"), 	1175851, "Simple", "Island", "Robot", "cm_binary")
 	enemy = AddHog(loc("Unit 3378"), 5, 30, "cyborg1")
 
-	SetGearPosition(player, 2427, 1259)
-	SetGearPosition(p2, 2293, 1263)
-	SetGearPosition(enemy, 1516, 1519)
+	SetGearPosition(player,1403,235)
+	SetGearPosition(p2,1269,239)
+	SetGearPosition(enemy,492,495)
 
 end
 
@@ -40,43 +40,43 @@ end
 function onGameStart()
 
 	--mines
-	AddGear(1300, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1325, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1350, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1375, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1400, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1425, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1450, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1475, 1100, gtMine, 0, 0, 0, 0)
-	AddGear(1500, 1100, gtMine, 0, 0, 0, 0)
-
-	AddGear(1910, 1380, gtMine, 0, 0, 0, 0)
-	AddGear(1925, 1380, gtMine, 0, 0, 0, 0)
-	AddGear(1950, 1380, gtMine, 0, 0, 0, 0)
-	AddGear(1975, 1380, gtMine, 0, 0, 0, 0)
-	AddGear(2000, 1380, gtMine, 0, 0, 0, 0)
-	AddGear(2025, 1380, gtMine, 0, 0, 0, 0)
+	AddGear(276,76,gtMine, 0, 0, 0, 0)
+	AddGear(301,76,gtMine, 0, 0, 0, 0)
+	AddGear(326,76,gtMine, 0, 0, 0, 0)
+	AddGear(351,76,gtMine, 0, 0, 0, 0)
+	AddGear(376,76,gtMine, 0, 0, 0, 0)
+	AddGear(401,76,gtMine, 0, 0, 0, 0)
+	AddGear(426,76,gtMine, 0, 0, 0, 0)
+	AddGear(451,76,gtMine, 0, 0, 0, 0)
+	AddGear(476,76,gtMine, 0, 0, 0, 0)
+
+	AddGear(886,356,gtMine, 0, 0, 0, 0)
+	AddGear(901,356,gtMine, 0, 0, 0, 0)
+	AddGear(926,356,gtMine, 0, 0, 0, 0)
+	AddGear(951,356,gtMine, 0, 0, 0, 0)
+	AddGear(976,356,gtMine, 0, 0, 0, 0)
+	AddGear(1001,356,gtMine, 0, 0, 0, 0)
 
 	-- crates crates and more crates
-	bCrate = SpawnAmmoCrate(2712,1500,amBaseballBat)
-	SpawnUtilityCrate(1596,1167,amGirder)
-	SpawnAmmoCrate(2728,1978,amPickHammer)
-	SpawnAmmoCrate(1728,1647,amBlowTorch)
-	SpawnUtilityCrate(2567,1768,amJetpack)
-	SpawnAmmoCrate(1251,1466,amDrill)
+	bCrate = SpawnAmmoCrate(1688,476,amBaseballBat)
+	SpawnUtilityCrate(572,143,amGirder)
+	SpawnAmmoCrate(1704,954,amPickHammer)
+	SpawnAmmoCrate(704,623,amBlowTorch)
+	SpawnUtilityCrate(1543,744,amJetpack)
+	SpawnAmmoCrate(227,442,amDrill)
 
 	ShowMission(loc("Codename: Teamwork"), "", loc("- Eliminate Unit 3378 |- Feeble Resistance must survive") .. loc("|- Mines Time:") .. " " .. 0 .. " " .. loc("sec"), 0, 0)
 
 end
 
 
-function onGameTick()
+--function onGameTick()
 
 	--if CurrentHedgehog ~= nil then
 	--	AddCaption(GetX(CurrentHedgehog) .. ";" .. GetY(CurrentHedgehog))
 	--end
 
-end
+--end
 
 
 function onAmmoStoreInit()
diff --git a/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua b/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua
new file mode 100644
index 0000000..e43cb0f
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/User_Mission_-_The_Great_Escape.lua
@@ -0,0 +1,122 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+
+local player = nil
+local enemy = nil
+
+function onGameInit()
+
+	Map = "Castle"
+	Theme = "Nature"
+	Seed = 0
+	GameFlags = gfInfAttack
+
+	TurnTime = 45 * 1000
+
+	CaseFreq = 0
+	MinesNum = 0
+	Explosives = 0
+
+	AddTeam(loc("Hero Team"), 14483456, "Simple", "Island", "Default", "Hedgewars")
+	player = AddHog(loc("Good Dude"), 0, 80, "NoHat") --NoHat
+
+	AddTeam(loc("Bad Team"), 	1175851, "Simple", "Island", "Default", "Hedgewars")
+	enemy = AddHog("Bad Guy", 1, 40, "NoHat")
+
+end
+
+function onGameStart()
+
+ShowMission(loc("The Great Escape"), loc("Get out of there!"), loc("Elimate your captor."), -amGrenade, 0)
+
+------ GIRDER LIST ------
+PlaceGirder(1042,564,0)
+PlaceGirder(1028,474,6)
+PlaceGirder(1074,474,6)
+PlaceGirder(1050,385,0)
+PlaceGirder(1175,731,7)
+PlaceGirder(1452,905,2)
+PlaceGirder(1522,855,4)
+PlaceGirder(1496,900,3)
+PlaceGirder(1682,855,4)
+PlaceGirder(1773,887,2)
+PlaceGirder(1647,901,1)
+PlaceGirder(1871,883,6)
+PlaceGirder(1871,723,6)
+PlaceGirder(1774,768,6)
+PlaceGirder(1773,767,6)
+PlaceGirder(1821,904,1)
+PlaceGirder(1822,802,3)
+PlaceGirder(1820,723,1)
+PlaceGirder(1782,678,4)
+PlaceGirder(1822,661,0)
+PlaceGirder(1822,644,0)
+PlaceGirder(1742,644,0)
+PlaceGirder(1742,661,0)
+PlaceGirder(1694,676,2)
+PlaceGirder(1903,635,0)
+------ HEALTH CRATE LIST ------
+SpawnHealthCrate(1476,169)
+SpawnHealthCrate(1551,177)
+SpawnHealthCrate(1586,200)
+SpawnHealthCrate(1439,189)
+SpawnHealthCrate(1401,211)
+SpawnHealthCrate(1633,210)
+------ MINE LIST ------
+tempG = AddGear(1010,680,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(1031,720,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(1039,748,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(1051,777,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(1065,796,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+tempG = AddGear(1094,800,gtMine, 0, 0, 0, 0)
+SetTimer(tempG, 1)
+------ REPOSITION LIST ------
+SetGearPosition(player,1050,534)
+SetGearPosition(enemy,1512,158)
+SetHealth(player, 1)
+SetHealth(enemy, 1)
+------ AMMO CRATE LIST ------
+SpawnAmmoCrate(1632,943,5)
+SpawnAmmoCrate(1723,888,12)
+SpawnAmmoCrate(1915,599,1)
+------ UTILITY CRATE LIST ------
+SpawnUtilityCrate(1519,945,15)
+SpawnUtilityCrate(1227,640,6)
+SpawnUtilityCrate(1416,913,18)
+------ END LOADING DATA ------
+
+end
+
+function onGameTick()
+
+	if TurnTimeLeft == TurnTime-1 then
+		SetWind(100)
+	end
+
+end
+
+function onGearDelete(gear)
+	if (GetGearType(gear) == gtCase) and (CurrentHedgehog == player) then
+		if GetHealth(gear) > 0 then
+			AddGear(GetX(gear), GetY(gear), gtGrenade, 0, 0, 0, 1)
+		end
+	elseif gear == player then
+		ShowMission(loc("The Great Escape"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
+	elseif gear == enemy then
+		ShowMission(loc("The Great Escape"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
+	end
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amGrenade, 1, 0, 0, 1)
+	SetAmmo(amParachute, 1, 0, 0, 1)
+	SetAmmo(amFirePunch, 0, 0, 0, 3)
+	SetAmmo(amPickHammer, 0, 0, 0, 1)
+	SetAmmo(amBlowTorch, 0, 0, 0, 1)
+	SetAmmo(amShotgun, 0, 0, 0, 1)
+	SetAmmo(amSkip, 9, 0, 0, 0)
+end
diff --git a/share/hedgewars/Data/Missions/Training/portal.lua b/share/hedgewars/Data/Missions/Training/portal.lua
new file mode 100644
index 0000000..f6b9276
--- /dev/null
+++ b/share/hedgewars/Data/Missions/Training/portal.lua
@@ -0,0 +1,235 @@
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Utils.lua")()
+
+local MineArray = {}
+local player 
+local adviceGiven = false
+local adviceGiven2 = false
+
+function onGameInit()
+	Seed = 0 -- The base number for the random number generator
+	GameFlags = gfInfAttack +gfBorder +gfDisableWind +gfSolidLand 
+	TurnTime = 1500000 -- The time the player has to move each round (in ms)
+	CaseFreq = 0 -- The frequency of crate drops
+	MinesNum = 0 -- The number of mines being placed
+	Explosives = 0 -- The number of explosives being placed
+	Delay = 10 -- The delay between each round
+	Map = "portal" -- The map to be played
+	Theme = "Hell" -- The theme to be used
+	Goals = "use the portal to move fast and far, use it to kill, use it with caution !"  --the goal ...
+	
+	
+----AddTeam(teamname, color, grave, fort, voicepack, flag)--
+	AddTeam("Subject", 14483406, "Simple", "Island", "Default", "cm_star")
+	player = AddHog("player", 0, 10, "Terminator_Glasses")
+
+	AddTeam("Hell Army", 1170801, "Simple", "Island", "Default", "cm_galaxy")
+	enemy1 = AddHog("Lucifer", 1, 200, "thinkingcap")
+	enemy2 = AddHog("voldemort", 1, 150, "WizardHat")
+	enemy3 = AddHog("zombi", 1, 100, "zombi")
+	enemy4 = AddHog("Predator", 1, 14, "predator")
+	enemy5 = AddHog("oneye", 1, 50, "cyclops")
+	enemy6 = AddHog("razac", 1, 50, "plaguemask")
+	enemy7 = AddHog("C-2", 1, 50, "cyborg1")
+	enemy8 = AddHog("Rider", 1, 50, "scif_SparkssHelmet")
+
+	AddTeam("badmad", 1170801, "Simple", "Island", "Default", "cm_jupiter")
+	enemy9 = AddHog("C-1", 1, 50, "cyborg2")
+	enemy10 = AddHog("hiden", 1, 40, "daftpunkguymanuel")
+	enemy11 = AddHog("ronald", 1, 70, "clown")
+	enemy12 = AddHog("phosphatoglucidique", 1, 50, "chef")
+	enemy13 = AddHog("Lestat", 1, 30, "draculakz")
+
+	SetGearPosition(player, 350, 1820)
+    SetGearPosition(enemy1, 2037, 1313)
+	SetGearPosition(enemy2, 1369, 1605)
+	SetGearPosition(enemy3, 1750, 1937)
+	SetGearPosition(enemy4, 3125, 89)
+	SetGearPosition(enemy5, 743, 900)
+	SetGearPosition(enemy6, 130, 360)
+	SetGearPosition(enemy7, 1333, 640)
+	SetGearPosition(enemy8, 1355, 200)
+	SetGearPosition(enemy9, 2680, 225)
+	SetGearPosition(enemy10, 2970, 800)
+	SetGearPosition(enemy11, 4050, 1964)
+	SetGearPosition(enemy12, 2666, 950)
+	SetGearPosition(enemy13, 3306, 1205)
+
+
+
+end
+
+function onAmmoStoreInit()
+
+	SetAmmo(amFirePunch, 0,0,0,1)
+	SetAmmo(amParachute, 0, 0, 0, 2)
+	SetAmmo(amGirder, 0, 0, 0, 3)
+	SetAmmo(amTeleport, 0, 0, 0, 1)
+	SetAmmo(amLaserSight,0,0,0,1)
+	SetAmmo(amHellishBomb,0,0,0,1)
+	SetAmmo(amGrenade,0,0,0,1)
+	SetAmmo(amRope,0,0,0,1)
+	SetAmmo(amDEagle,0,0,0,1)
+	SetAmmo(amExtraTime,0,0,0,2)
+	SetAmmo(amSkip,9,0,0,0)
+	SetAmmo(amBlowTorch, 0, 0, 0, 1)
+	SetAmmo(amPickHammer, 0, 0, 0, 1)
+	SetAmmo(amSnowball, 0, 0, 0, 1)
+
+end
+
+function onGameStart()
+
+	SetWind(100)-- SetWind(windSpeed) Sets the current wind in the range of -100 to 100. Use together with gfDisableWind for full control.
+                -- -100to0 is to the left, and 0to100 is to the right  (of course more its far from 0, more the speed is high
+				--  -100.............................0..................................+100
+				-- <<<<<<<<--<<--<<<<<<<<<<<<<--<<<<<|||-->>>>>>>>-->>>>>>>>>>>>>>>-->>>>>>          =  wind direction
+
+
+	MineArray[0] = AddGear(840, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[1] = AddGear(900, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[2] = AddGear(1000, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[3] = AddGear(1100, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[4] = AddGear(1140, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[5] = AddGear(1170, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[6] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[7] = AddGear(1200, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[8] = AddGear(1230, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[9] = AddGear(1280, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[10] = AddGear(1302, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[11] = AddGear(1350, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[12] = AddGear(1383, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[13] = AddGear(1400, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[14] = AddGear(1423, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[15] = AddGear(1470, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[16] = AddGear(1480, 1847, gtMine, 0, 0, 0, 0)
+	MineArray[17] = AddGear(1311, 1847, gtMine, 0, 0, 0, 0)
+
+	MineArray[18] = AddGear(840, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[19] = AddGear(900, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[20] = AddGear(1000, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[21] = AddGear(1100, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[22] = AddGear(1140, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[23] = AddGear(1170, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[24] = AddGear(1200, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[25] = AddGear(1230, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[26] = AddGear(1280, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[27] = AddGear(1302, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[28] = AddGear(1350, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[29] = AddGear(1383, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[30] = AddGear(1400, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[31] = AddGear(1423, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[32] = AddGear(1470, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[33] = AddGear(1480, 1785, gtMine, 0, 0, 0, 0)
+	MineArray[34] = AddGear(1311, 1785, gtMine, 0, 0, 0, 0)
+
+	MineArray[35] = AddGear(4029, 89, gtMine, 0, 0, 0, 120)
+	--MineArray[36] = AddGear(3376, 1947, gtMine, 0, 0, 0, 10)
+
+		for i = 0,#MineArray do
+			SetTimer(MineArray[i],050)
+			SetState(MineArray[i],544)
+		end
+				--needed this MineArray cause timer didn't work, its was always 3sec, i wanna instant mines
+
+
+				--UTILITY CRATE--
+	parachute = SpawnUtilityCrate(1670, 1165, amParachute)
+	girder = SpawnUtilityCrate(2101, 1297, amGirder)
+	SpawnUtilityCrate(3965, 625, amBlowTorch)
+	SpawnUtilityCrate(2249, 93, amBlowTorch)
+	SpawnUtilityCrate(2181, 829, amBlowTorch)
+	SpawnUtilityCrate(1820, 567, amBlowTorch)
+	SpawnUtilityCrate(1375, 900, amTeleport)
+	SpawnUtilityCrate(130, 600, amPickHammer)
+	SpawnUtilityCrate(1660,1820, amLaserSight)
+	SpawnUtilityCrate(4070,1840, amLaserSight)
+	
+	
+				--AMMO CRATE--
+	portalgun = SpawnAmmoCrate(505, 1943, amPortalGun, 1000)
+	extratime = SpawnAmmoCrate(4020, 785, amExtraTime, 2)
+	SpawnAmmoCrate(425, 613, amSnowball)
+	SpawnAmmoCrate(861, 633, amHellishBomb)
+	SpawnAmmoCrate(2510, 623, amSnowball)
+	SpawnAmmoCrate(2900, 1600, amGrenade)
+	SpawnAmmoCrate(2680, 320, amGrenade)
+	SpawnAmmoCrate(2650, 80, amDEagle)
+	SpawnAmmoCrate(3000, 100, amDEagle)
+	SpawnAmmoCrate(2900, 1400, amRope)
+	SpawnAmmoCrate(4025, 1117, amFirePunch)
+
+	
+				--HEALTH CRATE--
+	SpawnHealthCrate(2000, 780)
+	
+				--GIRDER--
+	PlaceGirder(3363, 1323, 4)
+
+
+	ShowMission (loc("Portal mission"), loc("training"), "", -amPortalGun, 5000)
+	HogSay(player, "I should get myself a portal gun, maybe this crate has one", SAY_THINK)
+	
+
+
+
+end
+
+function onGameTick()
+
+    if (player ~= nil)  then
+		if (gearIsInBox(player, 1650, 1907, 200, 60) and (adviceGiven == false)) then
+			adviceGiven = true
+				HogSay(player, loc("Hmmm, I'll have to find some way of moving him off this anti-portal surface..."), SAY_THINK)
+		elseif (gearIsInBox(player, 2960, 790, 200, 60) and (adviceGiven2 == false)) then
+			adviceGiven2 = true
+				HogSay(player, loc("The anti-portal zone is all over the floor, and I have nothing to kill him...Droping something could hurt him enough to kill him..."), SAY_THINK)
+ end
+ end
+	
+	end
+	
+
+
+
+
+function onNewturn()
+end
+
+
+function onGearAdd(gear)
+end
+
+function onGearDelete(gear)
+
+	if gear == portalgun then
+		--AddAmmo(player, amPortalGun, 10000)
+		HogSay(player, "GREAT ! Let's kill all this enemies, using portals", SAY_THINK)
+	end
+
+	if gear == girder then 
+		HogSay(player, "Will be useful if I need a new plateform or if I want to rise....", SAY_THINK)
+	end
+	
+	if gear == parachute then
+		HogSay(player, loc("You can't fire a portal on the blue surface"), SAY_THINK)
+	end
+--if you wanted to check for collection only
+--you could probably say
+--if (gear == myParachuteGear) and (band(GetGearMessage(gear), gmDestroy) ~= 0) then
+
+	if gear == extratime then
+		HogSay(player, loc(" What !! For all of this struggle i just win some ... TIME o0"), SAY_SHOUT)
+	end
+
+	
+	if gear == player then
+        player = nil
+    end
+end
+
+
+
+
+
+
diff --git a/share/hedgewars/Data/Music/Golf.ogg b/share/hedgewars/Data/Music/Golf.ogg
index 9f6e9bf..5eab55d 100644
Binary files a/share/hedgewars/Data/Music/Golf.ogg and b/share/hedgewars/Data/Music/Golf.ogg differ
diff --git a/share/hedgewars/Data/Music/Nature.ogg b/share/hedgewars/Data/Music/Nature.ogg
index 5eab55d..9f6e9bf 100644
Binary files a/share/hedgewars/Data/Music/Nature.ogg and b/share/hedgewars/Data/Music/Nature.ogg differ
diff --git a/share/hedgewars/Data/Scripts/Animate.lua b/share/hedgewars/Data/Scripts/Animate.lua
new file mode 100644
index 0000000..c1542a9
--- /dev/null
+++ b/share/hedgewars/Data/Scripts/Animate.lua
@@ -0,0 +1,394 @@
+local animPos, lastx, lasty, jumpTypes, jumpTimes, moveDirs, jumpStarted
+local backJumped, jTimer, awTime, globalWait, stageEvents, seNum, curEvent
+local needtoDecrease
+local AnimList, AnimListNum
+local FunctionList, FunctionListNum
+local skipFuncList
+local skipping
+--------------------------------Animation---------------------------------
+--------------------------(In-game cinematics)----------------------------
+
+function AddSkipFunction(anim, func, args)
+  skipFuncList[anim] = {sfunc = func, sargs = args}
+end
+
+function RemoveSkipFunction(anim)
+  skipFuncList[anim] = nil
+end
+
+function SetAnimSkip(bool)
+  skipping = bool
+end
+
+function AnimInProgress()
+  return AnimListNum ~= 0
+end
+
+function SkipAnimation(anim)
+  if skipFuncList[anim] == nil then
+    return
+  else 
+    skipFuncList[anim].sfunc(unpack(skipFuncList[anim].sargs))
+  end
+end
+
+function AddFunction(element)
+  table.insert(FunctionList, element)
+  FunctionListNum = FunctionListNum + 1
+end
+
+function RemoveFunction()
+  table.remove(FunctionList, 1)
+  FunctionListNum = FunctionListNum - 1
+end
+
+function ExecuteAfterAnimations()
+  if FunctionListNum == 0 then
+    return
+  end
+  FunctionList[1].func(unpack(FunctionList[1].args))
+  RemoveFunction()
+end
+
+function AnimInit()
+  animPos = 1
+  lastx = 0
+  lasty = 0
+  jumpTypes = {long = gmLJump, high = gmHJump, back = gmHJump}
+  jumpTimes = {long = 500, high = 500, back = 300, backback = 500} 
+  moveDirs = {Right = gmRight, Left = gmLeft}
+  jumpStarted = false
+  backJumped = false
+  jTimer = 0
+  awTime = 0
+  globalWait = 0
+  stageEvents = {}
+  seNum = 0
+  curEvent = 0
+  needToDecrease = 0
+  AnimList = {}
+  AnimListNum = 0
+  FunctionList = {}
+  FunctionListNum = 0
+  skipping = false
+  skipFuncList = {}
+end
+
+function AnimSwitchHog(gear)
+  --SetGearMessage(gear, 0)
+  --SetState(gear, 0)
+  SwitchHog(gear)
+  FollowGear(gear)
+  return true
+end
+
+function AnimGiveState(gear, state)
+  SetState(gear, state)
+  return true
+end
+
+function AnimRemoveState(gear, state)
+  SetState(gear, band(GetState(gear), bnot(state)))
+  return true
+end
+
+function AnimGearWait(gear, time)
+  AnimWait(gear, time)
+  return true
+end
+
+function AnimUnWait()
+  if globalWait > 0 then
+    globalWait = globalWait - 1
+  end
+end
+
+function AnimWait(gear, time)   -- gear is for compatibility with Animate
+  globalWait = globalWait + time
+  return true
+end
+
+function AnimWaitLeft()
+  return globalWait
+end
+
+function AnimSay(gear, text, manner, time)
+  HogSay(gear, text, manner, 2)
+  if time ~= nil then
+    AnimWait(gear, time)
+  end
+  return true
+end
+
+function AnimSound(gear, sound, time)
+  PlaySound(sound, gear)
+  AnimWait(gear, time)
+  return true
+end
+
+function AnimTurn(gear, dir)
+  if dir == "Right" then
+    HogTurnLeft(gear, false)
+  else
+    HogTurnLeft(gear, true)
+  end
+  return true
+end
+
+function AnimFollowGear(gear)
+  FollowGear(gear)
+  return true
+end
+
+function AnimMove(gear, dir, posx, posy)
+  dirr = moveDirs[dir]
+  SetGearMessage(gear, dirr)
+  if GetX(gear) == posx or GetY(gear) == posy then
+    SetGearMessage(gear, 0)
+    lastx = GetX(gear)
+    lasty = GetY(gear)
+    return true
+  end
+  return false
+end
+
+function AnimJump(gear, jumpType)
+  if jumpStarted == false then
+    lastx = GetX(gear)
+    lasty = GetY(gear)
+    backJumped = false
+    jumpStarted = true
+    SetGearMessage(gear, jumpTypes[jumpType])
+    AnimGearWait(gear, jumpTimes[jumpType])
+  elseif jumpType == "back" and backJumped == false then
+    backJumped = true
+    SetGearMessage(gear, jumpTypes[jumpType])
+    AnimGearWait(gear, jumpTimes["backback"])
+  else
+    curx = GetX(gear)
+    cury = GetY(gear)
+    if curx == lastx and cury == lasty then
+      jumpStarted = false
+      backJumped = false
+      AnimGearWait(gear, 100)
+      return true
+    else
+      lastx = curx
+      lasty = cury
+      AnimGearWait(gear, 100)
+    end
+  end
+  return false
+end
+
+function AnimSetGearPosition(gear, destX, destY, fall)
+  SetGearPosition(gear, destX, destY)
+  if fall ~= false then
+    SetGearVelocity(gear, 0, 10)
+  end
+  return true
+end
+
+function AnimDisappear(gear, destX, destY)
+	AddVisualGear(GetX(gear)-5, GetY(gear)-5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)+5, GetY(gear)+5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)-5, GetY(gear)+5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)+5, GetY(gear)-5, vgtSmoke, 0, false)
+  PlaySound(sndExplosion)
+	AnimSetGearPosition(gear, destX, destY)
+  return true
+end
+
+function AnimOutOfNowhere(gear, destX, destY)
+  AnimSetGearPosition(gear, destX, destY)
+  AddVisualGear(destX, destY, vgtBigExplosion, 0, false)
+  PlaySound(sndExplosion)
+  AnimGearWait(gear, 50)
+  return true
+end
+
+function AnimTeleportGear(gear, destX, destY)
+	AddVisualGear(GetX(gear)-5, GetY(gear)-5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)+5, GetY(gear)+5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)-5, GetY(gear)+5, vgtSmoke, 0, false)
+	AddVisualGear(GetX(gear)+5, GetY(gear)-5, vgtSmoke, 0, false)
+	AnimSetGearPosition(gear, destX, destY)
+	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+  PlaySound(sndExplosion)
+  FollowGear(gear)
+  AnimGearWait(gear, 50)
+  return true
+end
+
+function AnimVisualGear(gear, x, y, vgType, state, critical, follow)
+  local vgear = AddVisualGear(x, y, vgType, state, critical)
+  if follow == true then 
+    FollowGear(vgear)
+  end
+  return true
+end
+
+function AnimCaption(gear, text, time)
+  AddCaption(text)
+  if time == nil then
+    return true
+  end
+  AnimWait(gear, time)
+  return true
+end
+
+function AnimCustomFunction(gear, func, args)
+  if args == nil then
+    args = {}
+  end
+  retval = func(unpack(args))
+  if retval == false then
+    return false
+  else
+    return true
+  end
+end
+
+function AnimInsertStepNext(step)
+  table.insert(AnimList[1], animPos + 1, step)
+  return true
+end
+
+function AnimShowMission(gear, caption, subcaption, text, icon, time)
+  ShowMission(caption, subcaption, text, icon, time)
+  return true
+end
+
+function RemoveAnim()
+  table.remove(AnimList, 1)
+  AnimListNum = AnimListNum - 1
+end
+
+function AddAnim(animation)
+  table.insert(AnimList, animation)
+  AnimListNum = AnimListNum + 1
+  if AnimListNum == 1 then
+    skipping = false
+  end
+end
+
+function ShowAnimation()
+  if AnimListNum == 0 then
+    skipping = false
+    return true
+  else
+    TurnTimeLeft = -1
+    if Animate(AnimList[1]) == true then
+      RemoveAnim()
+    end
+  end
+  return false
+end
+
+function Animate(steps)
+  if skipping == true then
+    animPos = 1
+    SetInputMask(0xFFFFFFFF)
+    SkipAnimation(steps)
+    return true
+  end
+    
+  if globalWait ~= 0 then
+    return false
+  end
+
+  if steps[animPos] == nil then
+      animPos = 1
+      SetInputMask(0xFFFFFFFF)
+      return true
+  end
+  
+  if steps[animPos].args[1] ~= CurrentHedgehog and steps[animPos].func ~= AnimWait 
+    and (steps[animPos].swh == nil or steps[animPos].swh == true) then
+      AnimSwitchHog(steps[animPos].args[1])
+  end
+
+  SetInputMask(band(0xFFFFFFFF, bnot(gmAnimate+gmAttack+gmDown+gmHJump+gmLeft+gmLJump+gmRight+gmSlot+gmSwitch+gmTimer+gmUp+gmWeapon)))
+  retVal = steps[animPos].func(unpack(steps[animPos].args))
+  if (retVal ~= false) then
+    animPos = animPos + 1
+  end
+
+  return false
+end
+
+------------------------------Event Handling------------------------------
+
+function AddEvent(condFunc, condArgs, doFunc, doArgs, evType)
+  seNum = seNum + 1
+  stageEvents[seNum] = {}
+  stageEvents[seNum].cFunc = condFunc
+  stageEvents[seNum].cArgs = condArgs
+  stageEvents[seNum].dFunc = doFunc
+  stageEvents[seNum].dArgs = doArgs
+  stageEvents[seNum].evType = evType
+end
+
+function AddNewEvent(condFunc, condArgs, doFunc, doArgs, evType)
+  local i
+  for i = 1, seNum do
+    if stageEvents[i].cFunc == condFunc and stageEvents[i].cArgs == condArgs and
+       stageEvents[i].dFunc == doFunc and stageEvents[i].dArgs == doArgs and 
+       stageEvents[seNum].evType == evType then
+       return
+    end
+  end
+  AddEvent(condFunc, condArgs, doFunc, doArgs, evType)
+end
+
+function RemoveEvent(evNum)
+  if stageEvents[evNum] ~= nil then
+    seNum = seNum - 1
+    table.remove(stageEvents, evNum)
+    if evNum < curEvent then
+      return true
+    end
+  end
+  if evNum < curEvent then
+    needToDecrease = needToDecrease + 1
+  end
+end
+
+function RemoveEventFunc(cFunc, cArgs)
+  local i = 1
+  while i <= seNum do
+    if stageEvents[i].cFunc == cFunc and (cArgs == nil or cArgs == stageEvents[i].cArgs) then
+      RemoveEvent(i)
+      i = i - 1
+    end
+    i = i + 1
+  end
+end
+
+
+function CheckEvents()
+  local i = 1
+  while i <= seNum do
+    curEvent = i
+    if stageEvents[i].cFunc(unpack(stageEvents[i].cArgs)) then
+      stageEvents[i].dFunc(unpack(stageEvents[i].dArgs))
+      if needToDecrease > 0 then
+        i = i - needToDecrease
+        needToDecrease = 0
+      end
+      if stageEvents[i].evType ~= 1 then 
+        RemoveEvent(i)
+        i = i - 1
+      end
+    end
+    i = i + 1
+  end
+  curEvent = 0
+end
+
+-------------------------------------Misc---------------------------------
+
+function StoppedGear(gear)
+  dx,dy = GetGearVelocity(gear)
+  return math.abs(dx) <= 1 and math.abs(dy) <= 1
+end
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
index 025ab84..2248d96 100644
--- a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
@@ -144,7 +144,7 @@ function CheckScore(teamID)
 		for i = 0, (numhhs-1) do
 			if hhs[i] ~= nil then
 				if GetHogClan(hhs[i]) == alt then
-					SetEffect(hhs[i], heResurrectable, false)
+					SetEffect(hhs[i], heResurrectable, 0)
 					SetHealth(hhs[i],0)
 				end
 			end
@@ -607,7 +607,7 @@ function onGearAdd(gear)
 	if GetGearType(gear) == gtHedgehog then
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 	elseif GetGearType(gear) == gtPiano then
 
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.cfg b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.cfg
similarity index 100%
copy from share/hedgewars/Data/Scripts/Multiplayer/Balanced_Random_Weapon.cfg
copy to share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.cfg
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
new file mode 100644
index 0000000..c1e6cca
--- /dev/null
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
@@ -0,0 +1,1063 @@
+--[[
+Continental Supplies version 1.1a
+
+Copyright (C) 2012 Vatten
+
+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.
+]]
+
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Utils.lua")()
+loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+
+function int_sqrt(num)
+	temp=num
+	while(temp*temp-div(temp,2)>num)
+	do
+		temp=div((temp+div(num,temp)),2)
+	end
+	return math.abs(temp)
+end
+
+function norm(xx,yy)
+	return int_sqrt((xx^2)+(yy^2))
+end
+
+function positive(num)
+	if(num<0)
+	then
+		return -1
+	else
+		return 1
+	end
+end
+
+local teams_ok = {}
+local wepcode_teams={}
+local swapweps=false
+
+--run when game starts on real
+local australianSpecial=false
+local africanSpecial=0
+local africaspecial2=0
+local asianSpecial=false
+local samericanSpecial=false
+local namericanSpecial=1
+local sniper_s_in_use=false
+local kergulenSpecial=1
+local shotgun_s=false
+local europe_s=0
+
+local austmine=nil
+local inpara=false
+local asianflame=0
+
+local temp_val=0
+
+--för sabotage
+local disallowattack=0
+local disallowleft=true
+local disable_moving={}
+
+--skall bytas till för alla teams
+local continent = {}
+
+local weapontexts = {
+loc("Green lipstick bullet: [Is poisonous]"),
+loc("Piñata bullet: [Contains some sweet candy!]"),
+loc("Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"),
+loc("Dust storm: [Deals 20 damage to all enemies in the circle]"),
+loc("Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"),
+loc("Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"),
+loc("Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"),
+loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"),
+loc("Flare: [fire up some bombs depending on hogs depending on hogs in the circle"),
+loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"),
+loc("Hedgehog projectile: [fire your hog like a Sticky Bomb]"),
+loc("Napalm rocket: [Fire a bomb with napalm!]"),
+loc("Eagle Eye: [Blink to the impact ~ one shot]"),
+loc("Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"),
+loc("Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]")
+}
+
+local weaponsets = 
+{
+{loc("North America"),"Area: 24,709,000 km2, Population: 528,720,588",loc("Special Weapons:").."|"..loc("Shotgun")..": "..weapontexts[13].."|"..loc("Sniper Rifle")..": "..weapontexts[1].."|"..loc("Sniper Rifle")..": "..weapontexts[2],amSniperRifle,
+{{amShotgun,100},{amDEagle,100},{amLaserSight,4},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,6}}},
+
+{loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb,
+{{amBirdy,5},{amHellishBomb,1},{amBee,100},{amWhip,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,1},{amExtraDamage,2}}},
+
+{loc("Europe"),"Area: 10,180,000 km2, Population: 739,165,030",loc("Special Weapons:").."|"..loc("Molotov")..": "..weapontexts[14],amBazooka,
+{{amBazooka,100},{amGrenade,100},{amMortar,100},{amClusterBomb,5},{amMolotov,5},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,2}}},
+
+{loc("Africa"),"Area: 30,221,532 km2, Population: 1,032,532,974",loc("Special Weapons:").."|"..loc("Seduction")..": "..weapontexts[4].."|"..loc("Sticky Mine")..": "..weapontexts[11].."|"..loc("Sticky Mine")..": "..weapontexts[12],amSMine,
+{{amSMine,6},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}},
+
+{loc("Asia"),"Area: 44,579,000 km2, Population: 3,879,000,000",loc("- Will refresh Parachute each turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..weapontexts[6],amRope,
+{{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,4},{amDynamite,1}}},
+
+{loc("Australia"),"Area:  8,468,300 km2, Population: 31,260,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..weapontexts[5],amBaseballBat,
+{{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}},
+
+{loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will refresh portalgun each turn."),amTeleport,
+{{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,100},{amGirder,4},{amPortalGun,1}}},
+
+{loc("Kerguelen"),"Area: 1,100,000 km2, Population: ~70",loc("Special Weapons:").."|"..loc("Structure")..": "..weapontexts[7].."|"..loc("Structure")..": "..weapontexts[8].." ("..loc("Duration")..": 2)|"..loc("Structure")..": "..weapontexts[9].."|"..loc("Structure")..": "..weapontexts[10],amStructure,
+{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100}}},
+--no ,{amIceGun,4} for 0.9.18
+
+{loc("Zealandia"),"Area: 3,500,000 km2, Population: 4,650,000",loc("- Will Get 1-3 random weapons"),amInvulnerable,
+{{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}}
+}
+
+--weapontype,ammo,?,duration,*times your choice,affect on random team (should be placed with 1,0,1,0,1 on the 6th option for better randomness)
+local weapons_dmg = {
+	{amKamikaze, 0, 1, 0, 1, 0},
+	{amSineGun, 0, 1, 0, 1, 1},
+	{amBazooka, 0, 1, 0, 1, 0},
+	{amMineStrike, 0, 1, 5, 1, 2},
+	{amGrenade, 0, 1, 0, 1, 0},
+	{amPiano, 0, 1, 5, 1, 1},
+	{amClusterBomb, 0, 1, 0, 1, 0},
+	{amBee, 0, 1, 0, 1, 0},
+	{amShotgun, 0, 0, 0, 1, 1},
+	{amMine, 0, 1, 0, 1, 0},
+	{amSniperRifle, 0, 1, 0, 1, 1},
+	{amDEagle, 0, 1, 0, 1, 0},
+	{amDynamite, 0, 1, 5, 1, 1},
+	{amFirePunch, 0, 1, 0, 1, 0},
+	{amHellishBomb, 0, 1, 5, 1, 2},
+	{amWhip, 0, 1, 0, 1, 0},
+	{amNapalm, 0, 1, 5, 1, 2},
+	{amPickHammer, 0, 1, 0, 1, 0},
+	{amBaseballBat, 0, 1, 0, 1, 1},
+	{amMortar, 0, 1, 0, 1, 0},
+	{amCake, 0, 1, 4, 1, 2},
+	{amSeduction, 0, 0, 0, 1, 0},
+	{amWatermelon, 0, 1, 5, 1, 2},
+	{amDrill, 0, 1, 0, 1, 0},
+	{amBallgun, 0, 1, 5, 1, 2},
+	{amMolotov, 0, 1, 0, 1, 0},
+	{amBirdy, 0, 1, 1, 1, 1},
+	{amBlowTorch, 0, 1, 0, 1, 0},
+	{amRCPlane, 0, 1, 5, 1, 2},
+	{amGasBomb, 0, 0, 0, 1, 0},
+	{amAirAttack, 0, 1, 4, 1, 1},
+	{amFlamethrower, 0, 1, 0, 1, 0},
+	{amSMine, 0, 1, 0, 1, 1},
+	{amHammer, 0, 1, 0, 1, 0},
+	{amDrillStrike, 0, 1, 4, 1, 2},
+	{amSnowball, 0, 1, 0, 1, 0},
+	{amStructure, 0, 0, 0, 1, 1}
+}
+local weapons_supp = {
+	{amParachute, 0, 1, 0, 1, 0},
+	{amGirder, 0, 1, 0, 1, 0},
+	{amSwitch, 0, 1, 0, 1, 0},
+	{amLowGravity, 0, 1, 0, 1, 0},
+	{amExtraDamage, 0, 1, 2, 1, 0},
+	{amRope, 0, 1, 0, 1, 1},
+	{amInvulnerable, 0, 1, 0, 1, 0},
+	{amExtraTime, 0, 1, 0, 1, 0},
+	{amLaserSight, 0, 1, 0, 1, 0},
+	{amVampiric, 0, 1, 0, 1, 0},
+	{amJetpack, 0, 1, 0, 1, 1},
+	{amPortalGun, 0, 1, 2, 1, 1},
+	{amResurrector, 0, 1, 3, 1, 0},
+	{amTeleport, 0, 1, 0, 1, 0},
+	{amLandGun, 0, 1, 0, 1, 0},
+	{amTardis, 0, 1, 0, 1, 0},
+	{amIceGun, 0, 1, 0, 1, 0},
+	{amKnife, 0, 1, 0, 1, 0}
+}
+	
+function validate_weapon(hog,weapon,amount)
+	if(MapHasBorder() == false or (MapHasBorder() == true and weapon ~= amAirAttack and weapon ~= amMineStrike and weapon ~= amNapalm and weapon ~= amDrillStrike and weapon ~= amPiano))
+	then
+		AddAmmo(hog, weapon,amount)
+	end
+end
+
+--reset all weapons for a team
+function cleanweps(hog)
+
+	local i=1
+	--+1 for skip
+	while(i<=table.getn(weapons_supp)+table.getn(weapons_dmg)+1)
+	do
+		AddAmmo(hog,i,0)
+		i=i+1
+	end
+	
+	AddAmmo(hog,amSkip,100)
+end
+
+function load_weaponset(hog, num)
+	for v,w in pairs(weaponsets[num][5]) 
+	do
+		validate_weapon(hog, w[1],w[2])
+	end
+end
+
+function load_continent_selection(hog)
+	for v,w in pairs(weaponsets) 
+	do
+		validate_weapon(hog, weaponsets[v][4],1)
+	end
+	AddAmmo(hog,amSwitch) --random continent
+end
+
+function show_continent_info(continent,time)
+	local ns=false
+	if(time==-1)
+	then
+		time=0
+		ns=true
+	end
+	ShowMission(weaponsets[continent][1],weaponsets[continent][2],weaponsets[continent][3], -weaponsets[continent][4], time)
+	if(ns)
+	then
+		HideMission()
+	end
+end
+
+function visual_gear_explosion(range,xpos,ypos,gear1,gear2)
+	local degr=0
+	local lap=30
+	while(lap<range)
+	do
+		while(degr < 6.2831)
+		do
+			AddVisualGear(xpos+math.cos(degr+0.1)*(lap+5), ypos+math.sin(degr+0.1)*(lap+5), gear1, 0, false)
+			if(gear2~=false)
+			then
+				AddVisualGear(xpos+math.cos(degr)*lap, ypos+math.sin(degr)*lap, gear2, 0, false)
+			end
+			degr=degr+((3.1415*3)*0.125) --1/8 = 0.125
+		end
+		lap=lap+30
+		degr=degr-6.2831
+	end
+end
+
+--zealandia
+function get_random_weapon(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		local random_weapon = 0
+		local old_rand_weap = 0
+		local rand_weaponset_power = 0
+		
+		if(continent[GetHogTeamName(hog)]==9 and (getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false or getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil))
+		then
+			cleanweps(hog)
+		
+			random_weapon = GetRandom(table.getn(weapons_dmg))+1
+			while(weapons_dmg[random_weapon][4]>TotalRounds)
+			do
+				if(random_weapon>=table.getn(weapons_dmg))
+				then
+					random_weapon=0
+				end
+				random_weapon = random_weapon+1
+			end
+			validate_weapon(hog, weapons_dmg[random_weapon][1],1)
+			rand_weaponset_power=weapons_dmg[random_weapon][6]
+			old_rand_weap = random_weapon
+			
+			if(rand_weaponset_power <2)
+			then
+				random_weapon = GetRandom(table.getn(weapons_supp))+1
+				while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2)
+				do
+					if(random_weapon>=table.getn(weapons_supp))
+					then
+						random_weapon=0
+					end
+					random_weapon = random_weapon+1
+				end
+				validate_weapon(hog, weapons_supp[random_weapon][1],1)
+				rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6]
+			end
+			--check again if  the power is enough
+			if(rand_weaponset_power <1)
+			then
+				random_weapon = GetRandom(table.getn(weapons_dmg))+1
+				while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0)
+				do
+					if(random_weapon>=table.getn(weapons_dmg))
+					then
+						random_weapon=0
+					end
+					random_weapon = random_weapon+1
+				end
+				validate_weapon(hog, weapons_dmg[random_weapon][1],1)
+			end
+				
+			setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
+			
+			if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
+			then
+				temp_val=false
+			end
+		end
+	end
+end
+
+
+function setweapons(skipafter)
+
+	cleanweps(CurrentHedgehog)
+	load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)])
+	if(skipafter==true)
+	then
+		ParseCommand("setweap " .. string.char(amSkip))
+	end
+
+	show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0)
+end
+
+function show_damage_tag(hog,damage)
+	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
+	v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag)
+	SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog)))
+end
+
+function fire_gear(hedgehog,geartype,vx,vy,timer)
+	return AddGear(div((GetGearRadius(hedgehog)*2*vx),norm(vx,vy))+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),norm(vx,vy))+GetY(hedgehog), geartype, 0, vx, vy, timer)
+end
+
+--==========================run throw all hog/gear weapons ==========================
+function weapon_aust_check(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 50, false)==true and hog ~= CurrentHedgehog)
+		then
+			temp_val=1
+		end
+	end
+end
+
+function weapon_duststorm(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		local dmg=20
+		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
+		then
+			if(GetHealth(hog) > dmg)
+			then
+				SetHealth(hog, GetHealth(hog)-dmg)
+			else
+				SetHealth(hog, 0)
+			end
+			show_damage_tag(hog,dmg)
+		end
+	end
+end
+
+function weapon_scream_walrus(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 120, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
+		then
+			if(GetHealth(hog)>(20+GetHealth(CurrentHedgehog)*0.1))
+			then
+				SetHealth(hog, GetHealth(hog)-(20+GetHealth(CurrentHedgehog)*0.1))
+				temp_val=temp_val+10+GetHealth(CurrentHedgehog)*0.05
+			else
+				SetHealth(hog, 0)
+				temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)
+			end
+			show_damage_tag(hog,(20+GetHealth(CurrentHedgehog)*0.1))
+			AddVisualGear(GetX(hog), GetY(hog), vgtExplosion, 0, false)
+			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
+		end
+	end
+end
+
+function weapon_swap_kerg(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(kergulenSpecial ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 450, false))
+		then
+			local thisX=GetX(CurrentHedgehog)
+			local thisY=GetY(CurrentHedgehog)
+			SetGearPosition(CurrentHedgehog, GetX(hog), GetY(hog))
+			SetGearPosition(hog, thisX, thisY)
+			kergulenSpecial=-1
+		end
+	end
+end
+
+function weapon_flare(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 45, false))
+		then
+			if(GetX(hog)<=GetX(CurrentHedgehog))
+			then
+				dirker=1
+			else
+				dirker=-1
+			end
+			AddVisualGear(GetX(hog), GetY(hog), vgtFire, 0, false)
+			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5)
+			SetGearVelocity(CurrentHedgehog, 100000*dirker, -300000)
+			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, -10000*dirker, -1000000, 35)
+			PlaySound(sndHellishImpact2)
+		end
+	end
+end
+
+function weapon_sabotage(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 100, false))
+		then
+			disable_moving[hog]=true
+			AddGear(GetX(hog), GetY(hog), gtCluster, 0, 0, 0, 10)
+			PlaySound(sndNooo,hog)
+		end
+	end
+end
+
+function weapon_anno_south(hog)
+	local power_radius_outer=250
+	local power_radius_inner=40
+	local power_sa=500000
+	if(gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_outer, false) and gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_inner, false)==false)
+	then
+		if(hog == CurrentHedgehog)
+		then
+			SetState(CurrentHedgehog, gstMoving)
+		end
+		SetGearPosition(hog, GetX(hog),GetY(hog)-3)
+		SetGearVelocity(hog, div((power_radius_outer-norm(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*positive(GetX(hog)-GetX(temp_val)),power_radius_outer), div((power_radius_outer-norm(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*positive(GetY(hog)-GetY(temp_val)),power_radius_outer))
+	end
+end
+
+function weapon_cries_a(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
+		then
+			kergulenSpecial=-1
+		end
+	end
+end
+
+function weapon_cries_b(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
+		then
+			SetHealth(hog, GetHealth(hog)-1)
+			show_damage_tag(hog,1)
+			AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
+		end
+	end
+end
+
+function weapon_lipstick(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 20, false))
+		then
+			SetEffect(hog, hePoisoned, 1)
+			PlaySound(sndBump)
+		end
+	end
+end
+
+function weapon_health(hog)
+	if(GetGearType(hog) == gtHedgehog)
+	then
+		if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 100, false))
+		then
+			SetHealth(hog, GetHealth(hog)+25)
+			SetEffect(hog, hePoisoned, false)
+		end
+	end
+end
+--============================================================================
+
+--set each weapons settings
+function onAmmoStoreInit()
+
+	SetAmmo(amSkip, 9, 0, 0, 0)
+	
+	for v,w in pairs(weapons_dmg) 
+	do
+		SetAmmo(w[1], w[2], w[3], w[4], w[5])
+	end
+	
+	for v,w in pairs(weapons_supp) 
+	do
+		SetAmmo(w[1], w[2], w[3], w[4], w[5])
+	end
+end
+
+function onGameStart()
+	--trackTeams()
+
+	ShowMission(loc("Continental supplies").." 1.1a",loc("Let a Continent provide your weapons!"),
+	loc("- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease) on Skip|Some weapons have a second option. Find them with [switch/tab]"), -amLowGravity, 0)
+end
+
+--what happen when a turn starts
+function onNewTurn()
+
+	australianSpecial=true
+	asianSpecial=false
+	austmine=nil
+	africanSpecial=0
+	samericanSpecial=false
+	africaspecial2=0
+	kergulenSpecial=1
+	namericanSpecial=1
+	asianflame=0
+	shotgun_s=false
+	sniper_s_in_use=false
+	europe_s=0
+	
+	temp_val=0
+	
+	disallowattack=0
+	disallowleft=true
+	--when all hogs are "placed"
+	
+	if(GetCurAmmoType()~=amTeleport)
+	then
+		--will run once when the game really starts (after placing hogs and so on
+		if(teams_ok[GetHogTeamName(CurrentHedgehog)] == nil)
+		then
+			disable_moving[CurrentHedgehog]=false
+			AddCaption("["..loc("Select continent!").."]")
+			load_continent_selection(CurrentHedgehog)
+			continent[GetHogTeamName(CurrentHedgehog)]=0
+			swapweps=true
+			teams_ok[GetHogTeamName(CurrentHedgehog)] = 2
+		else
+			swapweps=false
+			if(continent[GetHogTeamName(CurrentHedgehog)]==0)
+			then
+				continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
+				setweapons(false)
+			end
+			show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1)
+		end
+	end
+	
+	if(continent[GetHogTeamName(CurrentHedgehog)]==7)
+	then
+		AddAmmo(CurrentHedgehog,amPortalGun,0)
+		AddAmmo(CurrentHedgehog,amPortalGun,1)
+	elseif(continent[GetHogTeamName(CurrentHedgehog)]==5)
+	then
+		AddAmmo(CurrentHedgehog,amParachute,0)
+		AddAmmo(CurrentHedgehog,amParachute,1)
+	end
+	
+	temp_val=true
+	runOnGears(get_random_weapon)
+	
+	if(temp_val==true and continent[GetHogTeamName(CurrentHedgehog)]==9 and getTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn")==true)
+	then
+		setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
+	end
+
+end
+
+--what happens when you press "tab" (common button)
+function onSwitch()
+	
+	--place mine (australia)
+	if(GetCurAmmoType() == amBaseballBat and australianSpecial==true)
+	then
+		temp_val=0
+		runOnGears(weapon_aust_check)
+		
+		if(temp_val==0)
+		then
+			austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0)
+			SetHealth(austmine, 100)
+			SetTimer(austmine, 1000)
+			australianSpecial=false
+			swapweps=false
+		else
+			PlaySound(sndDenied)
+		end
+	end
+	
+	--Asian special
+	if(asianSpecial==false and inpara~=false)
+	then
+		asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
+		SetGearMessage(asiabomb, 1)
+		asianSpecial=true
+		swapweps=false
+	end
+	
+	--africa
+	if(GetCurAmmoType() == amSeduction)
+	then
+		if(africanSpecial==0)
+		then
+			africanSpecial = 1
+			AddCaption(weapontexts[4])
+		else
+			africanSpecial = 0
+			AddCaption(loc("NORMAL"))
+		end
+	end
+	--south america
+	if(GetCurAmmoType() == amGasBomb)
+	then
+		if(samericanSpecial==false)
+		then
+			samericanSpecial = true
+			AddCaption(weapontexts[3])
+		else
+			samericanSpecial = false
+			AddCaption(loc("NORMAL"))
+		end
+	end
+	--africa
+	if(GetCurAmmoType() == amSMine)
+	then
+		if(africaspecial2==0)
+		then
+			africaspecial2 = 1
+			AddCaption(weapontexts[11])
+		elseif(africaspecial2 == 1)
+		then
+			africaspecial2 = 2
+			AddCaption(weapontexts[12])
+		elseif(africaspecial2 == 2)
+		then
+			africaspecial2 = 0
+			AddCaption(loc("NORMAL"))
+		end
+	end
+	
+	--north america
+	if(GetCurAmmoType() == amSniperRifle and sniper_s_in_use==false)
+	then
+		if(namericanSpecial==3)
+		then
+			namericanSpecial = 1
+			AddCaption(loc("NORMAL"))
+		elseif(namericanSpecial==1)
+		then
+			namericanSpecial = 2
+			AddCaption("#"..weapontexts[1])
+		elseif(namericanSpecial==2)
+		then
+			namericanSpecial = 3
+			AddCaption("##"..weapontexts[2])
+		end
+	end
+	
+	if(GetCurAmmoType() == amShotgun and shotgun_s~=nil)
+	then
+		if(shotgun_s==false)
+		then
+			shotgun_s = true
+			AddCaption(weapontexts[13])
+		else
+			shotgun_s = false
+			AddCaption(loc("NORMAL"))
+		end
+	end
+	
+	if(GetCurAmmoType() == amMolotov)
+	then
+		if(europe_s==0)
+		then
+			europe_s = 1
+			AddCaption(weapontexts[14])
+		else
+			europe_s = 0
+			AddCaption(loc("NORMAL"))
+		end
+	end
+	
+	if(swapweps==true and GetCurAmmoType() == amSkip)
+	then
+		continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]+1
+		
+		if(continent[GetHogTeamName(CurrentHedgehog)]> table.getn(weaponsets))
+		then
+			continent[GetHogTeamName(CurrentHedgehog)]=1
+		end
+		setweapons(true)
+	end
+	
+	if(GetCurAmmoType() == amStructure)
+	then
+		if(kergulenSpecial==5)
+		then
+			kergulenSpecial = 1
+			AddCaption("#"..weapontexts[7])
+		elseif(kergulenSpecial==1 and TotalRounds>=1)
+		then
+			kergulenSpecial = 2
+			AddCaption("##"..weapontexts[8])
+		elseif(kergulenSpecial==2 or (kergulenSpecial==1 and TotalRounds<1))
+		then
+			kergulenSpecial = 3
+			AddCaption("###"..weapontexts[9])
+		elseif(kergulenSpecial==3)
+		then
+			kergulenSpecial = 4
+			AddCaption("####"..weapontexts[10])
+		elseif(kergulenSpecial==4)
+		then
+			kergulenSpecial = 5
+			AddCaption("#####"..weapontexts[15])
+		end
+	end
+end
+
+function onPrecise()
+	if(swapweps==true and GetCurAmmoType() == amSkip)
+	then
+		continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]-1
+		
+		if(continent[GetHogTeamName(CurrentHedgehog)]<=0)
+		then
+			continent[GetHogTeamName(CurrentHedgehog)]=9
+		end
+		setweapons(true)
+	end
+end
+
+function onSlot()
+	if(continent[GetHogTeamName(CurrentHedgehog)]==0) then
+		ParseCommand("setweap " .. string.char(amSkip))
+	end
+end
+
+function onGameTick20()
+
+	if(teams_ok[GetHogTeamName(CurrentHedgehog)] == 2)
+	then
+		if(GetCurAmmoType()~=amTeleport and swapweps==true and TurnTime-TurnTimeLeft>=100)
+		then
+			teams_ok[GetHogTeamName(CurrentHedgehog)] = true
+			ParseCommand("setweap " .. string.char(amSkip))
+		end
+	end
+	
+	if(continent[GetHogTeamName(CurrentHedgehog)]==0)
+	then
+		if(GetCurAmmoType()==amSniperRifle) then
+			continent[GetHogTeamName(CurrentHedgehog)]=1
+			setweapons(false)
+		elseif(GetCurAmmoType()==amGasBomb) then
+			continent[GetHogTeamName(CurrentHedgehog)]=2
+			setweapons(false)
+		elseif(GetCurAmmoType()==amBazooka) then
+			continent[GetHogTeamName(CurrentHedgehog)]=3
+			setweapons(false)
+		elseif(GetCurAmmoType()==amSMine) then
+			continent[GetHogTeamName(CurrentHedgehog)]=4
+			setweapons(false)
+		elseif(GetCurAmmoType()==amRope) then
+			continent[GetHogTeamName(CurrentHedgehog)]=5
+			setweapons(false)
+		elseif(GetCurAmmoType()==amBaseballBat) then
+			continent[GetHogTeamName(CurrentHedgehog)]=6
+			setweapons(false)
+		elseif(GetCurAmmoType()==amTeleport) then
+			continent[GetHogTeamName(CurrentHedgehog)]=7
+			setweapons(false)
+		elseif(GetCurAmmoType()==amStructure) then
+			continent[GetHogTeamName(CurrentHedgehog)]=8
+			setweapons(false)
+		elseif(GetCurAmmoType()==amInvulnerable) then
+			continent[GetHogTeamName(CurrentHedgehog)]=9
+			setweapons(false)
+		elseif(GetCurAmmoType()==amSwitch) then
+			continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
+			setweapons(false)
+		end
+	end
+	
+	if(kergulenSpecial ~= 0 and GetCurAmmoType() == amStructure)
+	then
+		if(kergulenSpecial == 1)
+		then
+			if(visualcircle==nil)
+			then
+				visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 120, false)
+			end
+			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
+		elseif(kergulenSpecial == 2)
+		then
+			if(visualcircle==nil)
+			then
+				visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 450, false)
+			end
+			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 450, 3, 0xffff00ee)
+		elseif(kergulenSpecial == 3)
+		then
+			if(visualcircle==nil)
+			then
+				visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 45, false)
+			end
+			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 45, 6, 0x00ff00ee)
+		elseif(kergulenSpecial == 4)
+		then
+			if(visualcircle==nil)
+			then
+				visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 500, false)
+			end
+			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee)
+		elseif(kergulenSpecial == 5)
+		then
+			if(visualcircle==nil)
+			then
+				visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 100, false)
+			end
+			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 100, 10, 0xeeeeeeee)
+		end
+	
+	elseif(visualcircle~=nil)
+	then
+		DeleteVisualGear(visualcircle)
+		visualcircle=nil
+	end
+	
+	if(disable_moving[CurrentHedgehog]==true)
+	then
+	
+		if(TurnTimeLeft<=150)
+		then
+			disable_moving[CurrentHedgehog]=false
+			SetHogLevel(CurrentHedgehog,0)
+		elseif(disallowattack>=15 and disallowattack >= 20)
+		then
+			disallowattack=0
+			SetHogLevel(CurrentHedgehog,1)
+			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
+		elseif(GetHogLevel(CurrentHedgehog)==1)
+		then
+			SetHogLevel(CurrentHedgehog,0)
+		else
+			disallowattack=disallowattack+1
+		end
+	
+	end
+	
+end
+
+--if you used hogswitch or any similar weapon, dont enable any weaponchange
+function onAttack()
+	swapweps=false
+	local around=false
+	
+	--african special
+	if(africanSpecial == 1 and GetCurAmmoType() == amSeduction)
+	then
+		SetState(CurrentHedgehog, gstAttacked)
+		
+		runOnGears(weapon_duststorm)
+
+		--visual stuff
+		visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
+		PlaySound(sndParachute)
+	end
+	
+	--Kerguelen specials
+	if(GetCurAmmoType() == amStructure)
+	then
+		SetState(CurrentHedgehog, gstAttacked)
+		if(kergulenSpecial == 1)
+		then
+			temp_val=0
+			runOnGears(weapon_scream_walrus)
+			SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
+			PlaySound(sndHellish)
+			
+		elseif(kergulenSpecial == 2 and TotalRounds>=1)
+		then
+			runOnGears(weapon_swap_kerg)
+			PlaySound(sndPiano3)
+		elseif(kergulenSpecial == 3)
+		then
+			runOnGears(weapon_flare)
+			PlaySound(sndThrowRelease)
+			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
+			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 30)
+				
+		elseif(kergulenSpecial == 4)
+		then
+			runOnGears(weapon_cries_a)
+			if(kergulenSpecial~=-1)
+			then
+				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
+				PlaySound(sndWarp)
+				PlaySound(sndMolotov)
+				
+				runOnGears(weapon_cries_b)
+			else
+				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
+			end
+		elseif(kergulenSpecial == 5)
+		then
+			runOnGears(weapon_sabotage)
+		end
+		DeleteVisualGear(visualcircle)
+		visualcircle=nil
+	end
+
+	--Australian special
+	if(GetGearType(austmine) == gtMine and austmine ~= nil)
+	then
+		temp_val=0
+		runOnGears(weapon_aust_check)
+		
+		if(gearIsInCircle(austmine,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 30, false)==false or temp_val==1)
+		then
+			AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false)
+			DeleteGear(austmine)
+			PlaySound(sndDenied)
+		end
+		
+		austmine=nil
+	end
+	
+	if(disable_moving[CurrentHedgehog]==true)
+	then
+		disable_moving[CurrentHedgehog]=false
+		SetHogLevel(CurrentHedgehog,0)
+	end
+	
+	australianSpecial=false
+end
+
+function onGearAdd(gearUid)
+	swapweps=false
+	
+	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) 
+	then
+		trackGear(gearUid)
+	end
+	
+	--remove gasclouds on gasbombspecial
+	if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true)
+	then
+		DeleteGear(gearUid)
+
+	elseif(GetGearType(gearUid)==gtSMine)
+	then
+		vx,vy=GetGearVelocity(gearUid)
+		if(africaspecial2 == 1)
+		then
+			SetState(CurrentHedgehog, gstHHDriven+gstMoving)
+			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
+			SetGearVelocity(CurrentHedgehog, vx, vy)
+			DeleteGear(gearUid)
+			
+		elseif(africaspecial2 == 2)
+		then
+			fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
+			DeleteGear(gearUid)
+		end
+
+	elseif(GetGearType(gearUid)==gtSniperRifleShot)
+	then
+		sniper_s_in_use=true
+		if(namericanSpecial~=1)
+		then
+			SetHealth(gearUid, 1)
+		end
+
+	elseif(GetGearType(gearUid)==gtShotgunShot)
+	then
+		if(shotgun_s==true)
+		then
+			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
+			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
+			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
+			PlaySound(sndBirdyLay)
+		else
+			shotgun_s=nil
+		end
+		
+	elseif(GetGearType(gearUid)==gtMolotov and europe_s==1)
+	then
+		vx,vy=GetGearVelocity(gearUid)
+		e_health=fire_gear(CurrentHedgehog,gtCluster, vx, vy, 1)
+		SetGearMessage(e_health, 2)
+		DeleteGear(gearUid)
+		
+	elseif(GetGearType(gearUid)==gtParachute)
+	then
+		inpara=gearUid
+	end
+end
+
+function onGearDelete(gearUid)
+
+	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) 
+	then
+		trackDeletion(gearUid)
+	end
+	--north american specials
+	if(GetGearType(gearUid)==gtSniperRifleShot )
+	then
+		sniper_s_in_use=false
+		if(namericanSpecial==2)
+		then
+			temp_val=gearUid
+			runOnGears(weapon_lipstick)
+			
+		elseif(namericanSpecial==3)
+		then
+			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
+			
+			pinata=AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 5)
+			SetGearMessage(pinata,1)
+		end
+		
+	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3)
+	then
+		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 20)
+	
+	elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true)
+	then
+		SetState(CurrentHedgehog, gstMoving)
+		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
+		PlaySound(sndWarp)
+
+	--south american special
+	elseif(GetGearType(gearUid)==gtGasBomb and samericanSpecial == true)
+	then
+		temp_val=gearUid
+		runOnGears(weapon_anno_south)
+		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
+
+	elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1)
+	then
+		AddGear(GetX(gearUid), GetY(gearUid)+3, gtCluster, 0, 0, 0, 22)
+		
+	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2)
+	then
+		temp_val=gearUid
+		runOnGears(weapon_health)
+		visual_gear_explosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
+		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
+		PlaySound(sndGraveImpact)
+		
+	elseif(GetGearType(gearUid)==gtParachute)
+	then
+		inpara=false
+	end
+end
\ No newline at end of file
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.cfg
similarity index 100%
copy from share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg
copy to share/hedgewars/Data/Scripts/Multiplayer/Highlander.cfg
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
index 37c25f0..0624f38 100644
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
@@ -1,6 +1,6 @@
 --------------------------------
 -- HIGHLANDER / HOGS OF WAR
--- version 0.3b
+-- version 0.3c
 -- by mikade
 --------------------------------
 
@@ -43,12 +43,39 @@
 -- hammer wep removed
 -- all hogs have kamikaze
 
+-----------
+--0.3c
+-----------
+
+-- restructured some code
+-- added napalm (whoops) to list of possible weapons you can get
+-- hogs no longer recieve airstrike-related weps on border maps
+
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
 
-local wepArray = {}
-local atkArray = {}
-local utilArray = {}
+local airWeapons = 	{amAirAttack, amMineStrike, amNapalm, amDrillStrike --[[,amPiano]]}
+
+local atkArray = 	{
+					amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
+					amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
+					amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
+					amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
+					amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
+					amRCPlane, amSMine,
+					amBirdy
+					}
+
+local utilArray = 	{
+					amBlowTorch, amPickHammer, amGirder, amPortalGun,
+					amRope, amParachute, amTeleport, amJetpack,
+					amInvulnerable, amLaserSight, --[[amVampiric,]]
+					amLowGravity, amExtraDamage, --[[amExtraTime,]]
+					amLandGun
+					--[[,amTardis, amResurrector, amSwitch]]
+					}
+
+local wepArray = 	{}
 
 local currName
 local lastName
@@ -57,7 +84,7 @@ local switchStage = 0
 
 function StartingSetUp(gear)
 
-	for i = 1, #wepArray do	
+	for i = 1, #wepArray do
 		setGearValue(gear,wepArray[i],0)
 	end
 
@@ -85,7 +112,7 @@ end]]
 
 function ConvertValues(gear)
 
-	for i = 1, #wepArray do	
+	for i = 1, #wepArray do
 		AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
 	end
 
@@ -97,7 +124,7 @@ function TransferWeps(gear)
 
 	if CurrentHedgehog ~= nil then
 
-		for i = 1, #wepArray do		
+		for i = 1, #wepArray do
 			val = getGearValue(gear,wepArray[i])
 			if val ~= 0 then
 				setGearValue(CurrentHedgehog, wepArray[i], val)
@@ -109,8 +136,6 @@ function TransferWeps(gear)
 
 end
 
-
-
 function onGameInit()
 	GameFlags = gfInfAttack + gfRandomOrder
 	HealthCaseProb = 100
@@ -130,41 +155,19 @@ function onGameStart()
 				"", 4, 4000
 				)
 
-	atkArray = 	{amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
-			amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
-			amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
-			amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
-			amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
-			amAirAttack, amMineStrike, amDrillStrike, --[[amPiano,]] amRCPlane, amSMine,
-			amBirdy
-
-			} 
-
-	utilArray = 	{amBlowTorch, amPickHammer, amGirder, amPortalGun,
-			amRope, amParachute, amTeleport, amJetpack,
-			amInvulnerable, amLaserSight, --[[amVampiric,]]
-			amLowGravity, amExtraDamage, --[[amExtraTime,]]
-			amLandGun
-			}
-
-	wepArray = 	{amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
-			amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
-			amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
-			amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
-			amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
-			amAirAttack, amMineStrike, amDrillStrike, --[[amPiano,]] amRCPlane, amSMine,
-			amBirdy,
-			
-			amBlowTorch, amPickHammer, amGirder, amPortalGun,
-			amRope, amParachute, amTeleport, amJetpack,
-			amInvulnerable, amLaserSight, --[[amVampiric,]]
-			amLowGravity, amExtraDamage, --[[amExtraTime,]]
-			amLandGun
-
-			}
-
-	-- REMOVED
-	-- amTardis, amResurrector, amSwitch 
+	if MapHasBorder() == false then
+        for i, w in pairs(airWeapons) do
+            table.insert(atkArray, w)
+        end
+    end
+
+	for i, w in pairs(atkArray) do
+        table.insert(wepArray, w)
+	end
+
+	for i, w in pairs(utilArray) do
+        table.insert(wepArray, w)
+	end
 
 	runOnGears(StartingSetUp)
 	runOnGears(ConvertValues)
@@ -172,12 +175,12 @@ function onGameStart()
 
 end
 
-function onNewTurn()
+--function onNewTurn()
 --
-end
+--end
 
 
-function onGameTick()
+function onGameTick20()
 
 	if (CurrentHedgehog ~= nil) then
 
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
new file mode 100644
index 0000000..e20c418
--- /dev/null
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
@@ -0,0 +1,614 @@
+local MUTANT_VERSION = "v0.9.4"
+
+--[[                  ___                   ___
+                    (   )                 (   )
+___ .-. .-. ___  ___ | |_    .---. ___ .-. | |_
+(   )   '   (   )(   (   __) / .-, (   )   (   __)
+|  .-.  .-. | |  | | | |   (__) ; ||  .-. .| |
+| |  | |  | | |  | | | | ___ .'`  || |  | || | ___
+| |  | |  | | |  | | | |(   / .'| || |  | || |(   )
+| |  | |  | | |  | | | | | | /  | || |  | || | | |
+| |  | |  | | |  ; ' | ' | ; |  ; || |  | || ' | |
+| |  | |  | ' `-'  / ' `-' ' `-'  || |  | |' `-' ;
+(___)(___)(___'.__.'   `.__.`.__.'_(___)(___)`.__.
+
+
+----  IMPORTANT!
+----
+----  You should save (press Ctrl+S) this script to:
+----  Program Files\Hedgewars\share\hedgewars\Data\Scripts\Multiplayer\Mutant.lua
+----     or (on Linux):
+----  ~/.hedgewars/Data/Scripts/Multiplayer/Mutant.lua
+----
+----  (or wherever scripts like Highlander.lua, Racer.lua are on your system)
+----
+----  Also, if you didn't have Mutant script yet, you need to restart Hedgewars for it to find the script file.
+----
+
+
+----  GAME RULES
+----
+----  Recommended settings:
+----    * one hedgehog per team
+----    * 'Small' one-island map
+----
+----  First one to kill anyone becomes Mutant. Mutant has super-weapons
+----  and a lot of health, which however depletes if he doesn't frag fast.
+----  Goal of Mutant is to use his weapons to hold his status for as long
+----  as he can.
+----  Goal of others is to hunt the Mutant down. The one who kills Mutant,
+----  becomes Mutant himself.
+----  The player with least points (or most deaths) is Bottom Feeder. He
+----  can gain points by killing anyone. Other normal players only get points
+----  for killing Mutant.
+----
+----  Points:
+----    +2 for becoming a Mutant
+----    +1 to a Mutant for killing anyone
+----    +1 to a Bottom Feeder for killing anyone
+----    -1 to anyone for a suicide
+----   other kills don't give you points.
+----
+
+--]]
+
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+
+--[[
+    MUTANT SCRIPT
+
+    To Do:  -Clean-up this fucking piece of code
+            -Debug
+            -Find a girlfriend
+            -Fix Sheepluva's hat  +[p]
+            -Cookies
+
+-----------------------]]
+
+local hhs = {}
+local numhhs = 0
+
+local gameOver=false
+
+local mutant = nil
+local mutant_base_health = 200
+local mutant_base_disease = 25
+local disease_timer = 2000
+
+local kill_reward = nil
+local mt_hurt=false
+
+local killsCounter = 0
+
+local team_fire_punishment = 3
+local mutant_kill_reward = 2
+
+local hh_weapons = { amBazooka, amGrenade, amShotgun, amMine}
+
+local mt_weapons = {amWatermelon, amHellishBomb, amBallgun, amRCPlane, amTeleport}
+
+local disease=0
+local timer=0
+
+local winScore = 15
+local hogsLimit = 1
+
+local teams = {}
+
+local circles = {}
+local circleFrame = -1
+
+function onGameInit()
+    TurnTime = 20000
+    WaterRise = 0
+    GameFlags = GameFlags + gfResetWeps + gfPerHogAmmo
+    HealthCaseProb=0
+    HealthCaseAmount=0
+    MinesTime=1000
+    CaseFreq = 2
+
+end
+
+
+function limitHogs(gear)
+    cnthhs = cnthhs + 1
+        if cnthhs > 1 then
+            hogLimitHit = true
+            SetEffect(gear, heResurrectable, false)
+            --SetHealth(gear, 0)
+            SetGearPosition(gear, -100,LAND_HEIGHT)
+        end
+end
+
+function onGameStart()
+    trackTeams()
+    teamScan()
+    runOnHogs(saveStuff)
+    --local str = "/say " .. MUTANT_VERSION
+    --ParseCommand(str)
+
+    hogLimitHit = false
+    for i=0 , TeamsCount - 1 do
+        cnthhs = 0
+        runOnHogsInTeam(limitHogs, teams[i])
+    end
+    if hogLimitHit then
+        AddCaption(loc("ONE HOG PER TEAM! KILLING EXCESS HEDGES"))
+    end
+end
+
+
+
+function giveWeapons(gear)
+
+    if gear == mutant then
+        AddAmmo(gear, amRope)
+        for i=1, #mt_weapons do
+            AddAmmo(gear, mt_weapons[i])
+        end
+
+    else
+        for i=1, #hh_weapons do
+            AddAmmo(gear,hh_weapons[i])
+        end
+    end
+end
+
+function onAmmoStoreInit()
+
+    SetAmmo(amSkip, 9, 0, 0, 0)
+    SetAmmo(amRope,0,1,0,5)
+    SetAmmo(amSnowball,0,1,0,1)
+
+    for i=1, #hh_weapons do
+        SetAmmo(hh_weapons[i], 0, 0, 0, 1)
+    end
+
+    for i=1, #mt_weapons do
+        SetAmmo(mt_weapons[i], 0, 3, 0, 1)
+    end
+
+end
+
+function drawCircles()
+    for i = 0, #hhs do
+        if circles[hhs[i]] ~= nil then
+            DeleteVisualGear(circles[hhs[i]])
+            circles[hhs[i]] = nil
+        end
+
+        if hhs[i] ~= CurrentHedgehog then
+            if mutant == nil then
+                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
+                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080)
+            elseif CurrentHedgehog == mutant then
+                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
+                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070)
+            elseif getGearValue(CurrentHedgehog, "Feeder") and hhs[i] ~= mutant then
+                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
+                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 3, 0xaa000070)
+            elseif hhs[i] == mutant then
+                circles[hhs[i]] = AddVisualGear(0, 0, vgtCircle, 0, false)
+                SetVisualGearValues(circles[hhs[i]], 0, 0, 0, 0, 0, 0, 0, 22, 5, 0xff000080)
+            end
+        end
+    end
+    circleFrame = 0
+end
+
+function onNewTurn()
+
+    trackTeams()
+    killsCounter = 0
+
+    if mutant == nil then
+        AddCaption( loc("FIRST BLOOD MUTATES") )
+    end
+
+    checkScore()
+    giveWeapons(CurrentHedgehog)
+    drawCircles()
+    kill_reward= numhhs*10
+
+    if CurrentHedgehog == mutant then
+        mt_hurt=true
+        disease= mutant_base_disease - numhhs
+    else
+        mt_hurt=false
+    end
+
+    setGearValue(CurrentHedgehog, "Alive", true)
+
+end
+
+function countBodies()
+        if killsCounter == 2 then
+            AddCaption(loc("DOUBLE KILL"))
+        elseif killsCounter == 3 then
+            AddCaption(loc("MEGA KILL"))
+            PlaySound(sndRegret)
+        elseif killsCounter == 4 then
+            AddCaption(loc("ULTRA KILL"))
+        elseif killsCounter == 5 then
+            AddCaption(loc("MONSTER KILL"))
+            PlaySound(sndIllGetYou)
+        elseif killsCounter == 6 then
+            AddCaption(loc("LUDICROUS KILL"))
+            PlaySound(sndNutter)
+        elseif killsCounter == 7 then
+            AddCaption(loc("HOLY SHIT!"))
+            PlaySound(sndLaugh)
+        elseif killsCounter > 8 then
+            AddCaption(loc("FAG"))
+        end
+
+end
+
+function onGameTick()
+
+    if circleFrame > -1 then
+        for i = 0, #hhs do
+            if circles[hhs[i]] ~= nil and hhs[i]~= nil then
+                hhx, hhy = GetGearPosition(hhs[i])
+                X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint = GetVisualGearValues(circles[hhs[i]])
+                SetVisualGearValues(circles[hhs[i]], hhx + 1, hhy - 3, 0, 0, 0, 0, 0, 40 - (circleFrame % 25), Timer, Tint)
+            end
+        end
+
+        circleFrame = circleFrame + 0.06
+
+        if circleFrame >= 25 then
+            for i = 0, #hhs do
+                if circles[hhs[i]] ~= nil then
+                    DeleteVisualGear(circles[hhs[i]])
+                    circles[hhs[i]] = nil
+                end
+            end
+        end
+    end
+
+    if TurnTimeLeft==0 and mt_hurt then
+        mt_hurt = false
+    end
+
+    if mt_hurt and mutant~=nil then
+        timer = timer + 1
+            if timer > disease_timer then
+                timer = 0
+                SetHealth(mutant, GetHealth(mutant)-disease )
+                AddVisualGear(GetX(mutant), GetY(mutant)-5, vgtHealthTag, disease, true)
+                    if GetHealth(mutant)<=0 then
+                        SetHealth(mutant,0)
+                        mt_hurt= false
+                        setGearValue(mutant,"SelfDestruct",true)
+                        TurnTimeLeft = 0
+                    end
+            end
+    end
+end
+
+function saveStuff(gear)
+    setGearValue(gear,"Name",GetHogName(gear))
+    setGearValue(gear,"Hat",GetHogHat(gear))
+end
+
+function armageddon(gear)
+    SetState(gear, gstLoser)
+    SetEffect(gear, heResurrectable, false)
+    SetHealth(gear, 0)
+end
+
+function updateScore()
+local showScore = ""
+
+    for i=0, TeamsCount-1 do
+        if teams[i]~= nil then
+
+            local curr_score = getTeamValue(teams[i], "Score")
+            showScore = showScore .. teams[i] .. ": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|"
+
+        end
+    end
+
+    ShowMission(loc("Score"),
+                "-------",
+                showScore, 0, 200)
+
+    HideMission()
+
+end
+
+function checkScore()
+local showScore = ""
+local lowest_score_team = nil
+local min_score=nil
+local winTeam = nil
+
+local only_low_score = true
+
+    for i=0, TeamsCount-1 do
+        if teams[i]~=nil then
+            local curr_score = getTeamValue(teams[i], "Score")
+
+            runOnHogsInTeam(removeFeeder, teams[i])
+
+            showScore = showScore .. teams[i] ..": " .. curr_score .. " (deaths: " .. getTeamValue(teams[i], "DeadHogs") .. ") " .. "|"
+
+            if curr_score >= winScore then
+                gameOver = true
+                winTeam = teams[i]
+            end
+
+            if min_score==nil then
+                min_score= curr_score
+                lowest_score_team = teams[i]
+            else
+                if curr_score <= min_score then
+                    if curr_score == min_score then
+                        if getTeamValue(teams[i], "DeadHogs") == getTeamValue(lowest_score_team, "DeadHogs") then
+                            only_low_score = false
+                        else
+                            if getTeamValue(teams[i], "DeadHogs") > getTeamValue(lowest_score_team, "DeadHogs") then
+                                lowest_score_team = teams[i]
+                            end
+                            only_low_score = true
+                        end
+
+                    else
+                        min_score= curr_score
+                        lowest_score_team = teams[i]
+                        only_low_score = true
+                    end
+                end
+            end
+        end
+    end
+
+    if gameOver then
+        TurnTimeLeft = 0
+        for i=0, #teams do
+            if teams[i]~=winTeam then
+                runOnHogsInTeam(armageddon, teams[i])
+            end
+        end
+
+    ShowMission(    loc("WINNER IS ") .. winTeam,
+                    "~~~~~~~~~~~~~~~~~~~~~~~~~",
+                    showScore, 0, 200)
+    else
+
+    if only_low_score then
+        runOnHogsInTeam(setFeeder, lowest_score_team)
+    end
+
+    ShowMission(    loc("Score"),
+                    loc("-------"),
+                    showScore, 0, 200)
+
+    end
+end
+
+function backToNormal(gear)
+
+    SetHogName(gear, getGearValue(gear,"Name"))
+    SetHogHat(gear, 'NoHat')
+    SetHogHat(gear, getGearValue(gear,"Hat"))
+    setGearValue(mutant,"SelfDestruct",false)
+    mt_hurt=false
+    mutant=nil
+end
+
+function removeFeeder(gear)
+
+    if gear~=nil then
+        setGearValue(gear,"Feeder",false)
+        if gear~= mutant then
+            SetHogName(gear, getGearValue(gear,"Name") )
+            SetHogHat(gear, 'NoHat')
+            SetHogHat(gear, getGearValue(gear,"Hat"))
+        end
+    end
+end
+
+function setFeeder(gear)
+
+    if gear~= mutant and gear~= nil then
+        SetHogName(gear,"BOTTOM FEEDER")
+        SetHogHat(gear, 'poke_slowpoke')
+        setGearValue(gear,"Feeder", true)
+    end
+end
+
+function setMutantStuff(gear)
+    mutant = gear
+
+    SetHogName(gear,"MUTANT")
+    SetHogHat(gear,'WhySoSerious')
+    SetHealth(gear, ( mutant_base_health + numhhs*25) )
+    SetEffect(gear, hePoisoned, 1)
+    setGearValue(mutant,"SelfDestruct",false)
+    setGearValue(gear, "Feeder", false)
+
+    AddCaption(getGearValue(gear, "Name") .. loc(" HAS MUTATED" ))
+
+    TurnTimeLeft=0
+
+    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+    AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+    PlaySound(sndSuddenDeath)
+end
+
+function teamScan()
+
+        for i=0, TeamsCount-1 do --nil filling
+        teams[i]=nil
+        end
+
+        for i=0, #hhs do
+            for j=0, TeamsCount-1 do
+                if teams[j] ==nil and hhs[i]~=nil then
+                teams[j] = GetHogTeamName(hhs[i])
+                setTeamValue(teams[j],"Score",0)
+                setTeamValue(teams[j], "DeadHogs",0)
+                break
+                end
+
+                if teams[j] == GetHogTeamName(hhs[i]) then
+                    break
+                end
+            end
+        end
+
+        ---***---
+end
+
+
+function onGearDamage(gear, dmg)
+
+end
+
+function set_Mutant_and_Score(gear)
+
+local curr_team = GetHogTeamName(CurrentHedgehog)
+
+    if gear == CurrentHedgehog then
+        if CurrentHedgehog == mutant then
+            PlaySound(sndHomerun)
+            if getGearValue(gear, "SelfDestruct")==false then
+                decreaseTeamValue(curr_team,"Score")
+            end
+            backToNormal(gear)
+        else
+            decreaseTeamValue(curr_team,"Score")
+        end
+
+    else
+            if gear == mutant then
+                    backToNormal(mutant)
+                    if curr_team ~=GetHogTeamName(gear) then
+                            if  getGearValue(CurrentHedgehog, "Alive") then
+                            setMutantStuff(CurrentHedgehog)
+                            setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward))
+                            end
+                    else
+                        setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
+                    end
+            else
+                if mutant==nil then
+                        if curr_team ~=GetHogTeamName(gear) then
+                            if getGearValue(CurrentHedgehog, "Alive") then
+                                    setMutantStuff(CurrentHedgehog)
+                                    setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") + mutant_kill_reward))
+                            else
+                                increaseTeamValue(curr_team,"Score")
+                            end
+                        else
+                            setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
+                        end
+                else
+                    if curr_team ~=GetHogTeamName(gear) then
+                        if CurrentHedgehog==mutant and getGearValue(mutant,"SelfDestruct")==false then
+                            SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+kill_reward)
+                            AddCaption("+" .. kill_reward .. loc(" HP") )
+                            increaseTeamValue(curr_team,"Score")
+                        end
+                        if getGearValue(CurrentHedgehog,"Feeder") then
+                            increaseTeamValue(curr_team,"Score")
+                        end
+                    else
+                        setTeamValue(curr_team,"Score",(getTeamValue(curr_team,"Score") - team_fire_punishment))
+                    end
+                end
+            end
+    end
+end
+
+function onGearResurrect(gear)
+if not gameOver then
+    if GetGearType(gear) == gtHedgehog then
+
+        increaseTeamValue(GetHogTeamName(gear), "DeadHogs")
+
+        if gear==CurrentHedgehog then
+            setGearValue(CurrentHedgehog, "Alive", false)
+        end
+        set_Mutant_and_Score(gear)
+        if gear~=CurrentHedgehog then
+            killsCounter = killsCounter + 1
+            countBodies()
+        end
+        AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
+        PlaySound(sndWhack)
+        updateScore()
+    end
+end
+end
+
+function onGearAdd(gear)
+
+    -- Catch hedgehogs for the tracker
+    if GetGearType(gear) == gtHedgehog then
+        trackGear(gear)
+        hhs[numhhs] = gear
+        numhhs = numhhs + 1
+        SetEffect(gear, heResurrectable, 1)
+    end
+end
+
+function checkEmptyTeam (teamName)
+    for i=0 , #hhs do
+        if hhs[i]~=nil then
+            if teamName == GetHogTeamName(hhs[i]) then
+                return false
+            end
+        end
+    end
+    return true
+end
+
+function onGearDelete(gear)
+    -- Remove hogs that are gone
+    if GetGearType(gear) == gtHedgehog then
+        numhhs = numhhs - 1
+
+        local found
+        for i=0, #hhs do
+            if hhs[i] == gear then
+                found = i
+                break
+            end
+        end
+        for i = found, #hhs - 1 do
+            hhs[i] = hhs[i + 1]
+        end
+        hhs[#hhs] = nil
+
+        local t_name = GetHogTeamName(gear)
+        if checkEmptyTeam(t_name) then
+            for i = 0, TeamsCount - 1 do
+                if teams[i] == t_name then
+                    found = i
+                    break
+                end
+            end
+            for i = found, TeamsCount - 2 do
+                teams[i] = teams[i + 1]
+            end
+            teams[TeamsCount - 1] = nil
+            TeamsCount = TeamsCount - 1
+        end
+        AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
+        trackDeletion(gear)
+    end
+end
+
+--[[
+S T A R R I N G
+
+    prof - Coding, implementing and evangelism
+    vos  - Initial idea and script improvements
+--]]
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
index 8fdbb70..ade1d3b 100644
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
@@ -107,7 +107,6 @@ local teamScore = {}
 --------
 
 local cGear = nil
-local gTimer = 0
 
 local bestClan = nil
 local bestTime = nil
@@ -116,7 +115,6 @@ local gameBegun = false
 local gameOver = false
 local racerActive = false
 local trackTime = 0
-local wpCheckCounter = 0
 
 local wpCirc = {}
 local wpX = {}
@@ -353,7 +351,7 @@ function onNewRound()
 	if roundNumber == roundLimit then
 		for i = 0, (numhhs-1) do
 			if GetHogClan(hhs[i]) ~= bestClan then
-				SetEffect(hhs[i], heResurrectable, false)
+				SetEffect(hhs[i], heResurrectable, 0)
 				SetHealth(hhs[i],0)
 			end
 		end
@@ -374,7 +372,7 @@ function CheckForNewRound()
 		if turnN == 2 then
 			for i = 0, (numhhs-1) do
 				if hhs[i] ~= nil then
-					SetEffect(hhs[i], heResurrectable, false)
+					SetEffect(hhs[i], heResurrectable, 0)
 					SetHealth(hhs[i],0)
 				end
 			end
@@ -536,6 +534,7 @@ function onNewTurn()
 			loc("NOT ENOUGH WAYPOINTS"),
 			loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000)
 			AddAmmo(CurrentHedgehog, amAirAttack, 4000)
+            ParseCommand("setweap " .. string.char(amAirAttack))
 		end
 	end
 
@@ -552,28 +551,32 @@ function onNewTurn()
 
 end
 
-function onGameTick()
+function onGameTick20()
 
 	-- airstrike detected, convert this into a potential waypoint spot
 	if cGear ~= nil then
-		x,y = GetGearTarget(cGear)
-
-		DeleteGear(cGear)
-
-		if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
-			AddCaption(loc("Please place the way-point in the open, within the map boundaries."))
-			PlaySound(sndDenied)
-		elseif (y > WaterLine-50) then
-			AddCaption(loc("Please place the way-point further from the waterline."))
-			PlaySound(sndDenied)
-		else
-			PlaceWayPoint(x, y)
-			if wpCount == wpLimit then
-				AddCaption(loc("Race complexity limit reached."))
-				DisableTumbler()
-			end
-		end
-
+		x,y = GetGearPosition(cGear)
+        if x > -9000 then
+            x,y = GetGearTarget(cGear)
+
+
+            if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
+                AddCaption(loc("Please place the way-point in the open, within the map boundaries."))
+                PlaySound(sndDenied)
+            elseif (y > WaterLine-50) then
+                AddCaption(loc("Please place the way-point further from the waterline."))
+                PlaySound(sndDenied)
+            else
+                PlaceWayPoint(x, y)
+                if wpCount == wpLimit then
+                    AddCaption(loc("Race complexity limit reached."))
+                    DisableTumbler()
+                end
+            end
+        else
+            DeleteGear(cGear)
+        end
+        SetGearPosition(cGear, -10000, 0)
 	end
 
 
@@ -613,19 +616,19 @@ function onGameTick()
 		if (racerActive == true) and (gameBegun == true) then
 
 			--ghost
-			gTimer = gTimer + 1
-			if gTimer == 40 then
-				gTimer = 0
+			if GameTime%40 == 0 then
 				HandleGhost()
 			end
 
-			trackTime = trackTime + 1
-
-			wpCheckCounter = wpCheckCounter + 1
-			if (wpCheckCounter == 100) then
+			trackTime = trackTime + 20
 
-				wpCheckCounter = 0
-				AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
+			if GameTime%100 == 0 then
+                
+                if trackTime%1000 == 0 then
+                    AddCaption((trackTime/1000)..'.0',GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
+                else
+                    AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
+                end
 
 				if (CheckWaypoints() == true) then
 					AdjustScores()
@@ -640,7 +643,7 @@ function onGameTick()
 
 
 		-- if the player has expended his tunbling time, stop him tumbling
-		if TurnTimeLeft <= 1 then
+		if TurnTimeLeft <= 20 then
 			DisableTumbler()
 		end
 
@@ -671,7 +674,7 @@ function onGearAdd(gear)
 	if GetGearType(gear) == gtHedgehog then
 		hhs[numhhs] = gear
 		numhhs = numhhs + 1
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 	end
 
 	if GetGearType(gear) == gtAirAttack then
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
index d555be3..1c2a92e 100644
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
@@ -5,7 +5,7 @@ loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
 ---------------------------------------------------
 ---------------------------------------------------
 ---------------------------------------------------
---- Space Invasion Code Follows (1.0)
+--- Space Invasion Code Follows (1.1)
 ---------------------------------------------------
 ---------------------------------------------------
 -- VERSION HISTORY
@@ -125,24 +125,56 @@ loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
 ------------------------
 -- version 1.0
 ------------------------
-
 -- if only version numbers actually worked like this, wouldn't that be awful :D
-
 -- added surfer achievement
 -- increased value of shield miser by 1 point per kill (OP?)
 
+------------------------
+-- version 1.1
+------------------------
+-- fixed radar so that blips dont go past circs when you get very close
+-- added a missing loc for shield depletion
+-- increased delay to 1000 to try stop noobies missing their turn
+-- added sniper achievement for hits from over a 1000000 away
+-- added achievement for 3 "sniper" shots in a round
+-- added achievement for 3 "point blank" shots in a round
+-- added "fierce Competition" achievement for shooting an enemy hog (once per round)
+-- some support for more weapons later
 
 --------------------------
 --notes for later
 --------------------------
--- maybe add a check for a tie, NAH
--- more achievements? (3 kamikazes in a row, long distance shooter, supreme shield expert/miser etc?)
+-- maybe add a check for a tie, IMPOSSIBRU THERE ARE NO TIES
+-- more achievements? (3 kamikazes in a row, supreme shield expert/miser etc?)
+
+-- if more weps are added, replace primshotsfired all over the place
+
+-- look for derp and let invaders shoot again
+
+-- more weps? flamer/machineballgun,
+-- some kind of bomb that just drops straight down
+-- "fire and forget" missile
+-- shockwave
+
+-- some kind of ability-meter that lets you do something awesome when you are
+-- doing really well in a given round.
+-- probably new kind of shield that pops any invaders who come near
+
+-- fix game never ending bug
+-- fix radar
+-- new invader: golden snitch, doesn't show up on your radar
+
+-- maybe replace (48/100*vCircRadius[i])/2 with something better
+
 
 --[[CAPTION CATEGORIES
 -----------------
 capgrpGameState
 -----------------
-
+AddCaption(LOC_NOT("Sniper!") .. " +10 " .. LOC_NOT("points") .. "!",0xffba00ff,capgrpAmmostate)
+--they call me bullsye
+--point blank combo
+--fierce Competition
 -----------------
 capgrpAmmostate
 -----------------
@@ -162,14 +194,14 @@ AddCaption(LOC_NOT("Boom! +25 points!"),0xffba00ff,capgrpVolume)
 AddCaption(LOC_NOT("BOOM! +50 points!"),0xffba00ff,capgrpVolume)
 AddCaption(LOC_NOT("BOOM! BOOM! BOOM! +100 points!"),0xffba00ff,capgrpVolume)
 AddCaption(LOC_NOT("Accuracy Bonus! +15 points!"),0xffba00ff,capgrpVolume)
-AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
+AddCaption(LOC_NOT("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
 
 -----------------
 capgrpMessage
 -----------------
 AddCaption(LOC_NOT("Ammo Depleted!"),0xff0000ff,capgrpMessage)
 AddCaption(LOC_NOT("Ammo: ") .. primShotsLeft)
-AddCaption("Shield Depleted",0xff0000ff,capgrpMessage)
+AddCaption(LOC_NOT("Shield Depleted"),0xff0000ff,capgrpMessage)
 AddCaption( LOC_NOT("Shield ON:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
 AddCaption(LOC_NOT("Shield OFF:") .. " " .. shieldHealth - 80 .. " " .. LOC_NOT("Power Remaining") )
 
@@ -206,6 +238,7 @@ local explosivesID = 0
 local luaGameTicks = 0
 
 -- gaudyRacer
+local boosterOn = false
 local roundLimit = 3	-- no longer set here (see version history)
 local roundNumber = 0
 local firstClan = 10
@@ -252,12 +285,14 @@ local BK = 0
 local OK = 0
 local SK = 0
 local shieldMiser = true
+local fierceComp = false
 local chainCounter = 0
 local chainLength = 0
 local shotsFired = 0
 local shotsHit = 0
 local SurfTime = 0
-
+local sniperHits = 0
+local pointBlankHits = 0
 ---------------------
 -- tumbler goods
 ---------------------
@@ -268,6 +303,18 @@ local rightOn = false
 local upOn = false
 local downOn = false
 
+----------------
+-- TUMBLER
+local wep = {}
+local wepAmmo = {}
+local wepCol = {}
+local wepIndex = 0
+local wepCount = 0
+local fireTimer = 0
+----------------
+
+
+
 local primShotsMax = 5
 local primShotsLeft = 0
 
@@ -280,6 +327,10 @@ local beam = false
 local pShield
 local shieldHealth
 
+local shockwave
+local shockwaveHealth = 0
+local shockwaveRad = 300
+
 local Timer100 = 0
 
 local vTag = {}
@@ -362,7 +413,7 @@ function DrawTag(i)
 		zoomL = 1.1
 		yOffset = 70
 		tCol = 0x00ff00ff
-		tValue = primShotsLeft
+		tValue = wepAmmo[wepIndex] --primShotsLeft
 	elseif i == 2 then
 		zoomL = 1.1
 		xOffset = 40 + 35
@@ -568,7 +619,7 @@ function onNewRound()
 
 		for i = 0, (numhhs-1) do
 			if GetHogClan(hhs[i]) ~= bestClan then
-				SetEffect(hhs[i], heResurrectable, false)
+				SetEffect(hhs[i], heResurrectable, 0)
 				SetHealth(hhs[i],0)
 			end
 		end
@@ -640,11 +691,13 @@ function setNewGearValues(gear)
 		setGearValue(gear,"ID",shellID)
 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this shell")
 	elseif GetGearType(gear) == gtBall then
-		lfs = 70	-- 7s
+		lfs = 5 --70	-- 7s
 	elseif GetGearType(gear) == gtExplosives then
 		lfs = 15	-- 1.5s
 		explosivesID = explosivesID + 1
 		setGearValue(gear,"ID",explosivesID)
+		setGearValue(gear,"XP", GetX(gear))
+		setGearValue(gear,"YP", GetY(gear))
 		--nw WriteLnToConsole("Just assigned ID " .. getGearValue(gear,"ID") .. " to this explosives")
 	elseif GetGearType(gear) == gtFlame then
 		lfs = 5	-- 0.5s
@@ -710,10 +763,93 @@ end
 -- action keys
 -----------------------
 
+function HandleFlameThrower()
+
+	--
+	--flamer
+
+	fireTimer = fireTimer + 1
+	if fireTimer == 6 then	-- 6
+		fireTimer = 0
+
+		if (wep[wepIndex] == loc("Flamer") ) and (preciseOn == true) and (wepAmmo[wepIndex] > 0) and (stopMovement == false) and (tumbleStarted == true) then
+
+			wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
+			AddCaption(
+			loc("Flamer") .. ": " ..
+			(wepAmmo[wepIndex]/800*100) - (wepAmmo[wepIndex]/800*100)%2 .. "%",
+			wepCol[2],
+			capgrpMessage2
+			)
+			DrawTag(3)
+
+			dx, dy = GetGearVelocity(CurrentHedgehog)					--gtFlame -- gtSnowball -- gtAirBomb
+			shell = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtFlame, 0, 0, 0, 0)
+
+			xdev = 1 + GetRandom(35)	--25
+			xdev = xdev / 100
+
+			r = GetRandom(2)
+			if r == 1 then
+				xdev = xdev*-1
+			end
+
+			ydev = 1 + GetRandom(35)	--25
+			ydev = ydev / 100
+
+			r = GetRandom(2)
+			if r == 1 then
+				ydev = ydev*-1
+			end
+
+								--4.5	or 2.5 nonflames				--4.5
+			SetGearVelocity(shell, (dx*4.5)+(xdev*fMod), (dy*4.5)+(ydev*fMod))	--10
+
+		end
+
+	end
+
+
+end
+
+function ChangeWeapon()
+
+	wepIndex = wepIndex + 1
+	if wepIndex == wepCount then
+		wepIndex = 0
+	end
+
+	AddCaption(wep[wepIndex] .. " " .. loc("selected!"), wepCol[wepIndex],capgrpAmmoinfo )
+	AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), wepCol[wepIndex],capgrpMessage2)
+
+end
+
+--function onTimer()
+
+	-- experimental wep
+	--[[SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, 255, 1, 10, 0, 300, 1, 0xff33ffff)
+	AddCaption("boom")
+	PlaySound(sndWarp)
+	shockwaveHealth = 100
+	shockwaveRad = 100]]
+
+
+	--change wep
+	--ChangeWeapon()
+
+	-- booster
+	--[[if boosterOn == false then
+		boosterOn = true
+	else
+		boosterOn = false
+	end]]
+
+--end
+
 -- o rite dis wan iz liek synched n stuff hope full lee
-function onPrecise()
+-- old method
+--[[function onPrecise()
 
-	--WriteLnToConsole("onPrecise event handler at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
 
 	-- Fire Barrel
 	if (primShotsLeft > 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
@@ -734,25 +870,61 @@ function onPrecise()
 
 		CopyPV(CurrentHedgehog, morte) -- new addition
 		x,y = GetGearVelocity(morte)
-		--WriteLnToConsole("I'm going to shoot a barrel so I just got the velocity of currenthedgehog. It is dx: " .. x .. "; dy: " .. y)
-		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
-
-
 
 		x = x*2
 		y = y*2
 		SetGearVelocity(morte, x, y)
 
-		--WriteLnToConsole("I just SET the velocity of a barrel I created. It is now dx: " .. x .. "; dy: " .. y)
-		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
 
+	elseif (primShotsLeft == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
+		AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
+	end
 
 
-	elseif (primShotsLeft == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
+end]]
+
+-- derp tumbler
+function onPrecise()
+
+	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) and (wepAmmo[wepIndex] > 0) then
+
+		wepAmmo[wepIndex] = wepAmmo[wepIndex] - 1
+		--AddCaption(wepAmmo[wepIndex] .. " " .. loc("shots remaining."), wepCol[wepIndex],capgrpMessage2)
+
+		if wep[wepIndex] == loc("Barrel Launcher") then
+			shotsFired = shotsFired +1
+
+			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtExplosives, 0, 0, 0, 1)
+			CopyPV(CurrentHedgehog, morte) -- new addition
+			x,y = GetGearVelocity(morte)
+			x = x*2
+			y = y*2
+			SetGearVelocity(morte, x, y)
+
+			if wepAmmo[wepIndex] == 0 then
+			PlaySound(sndSuddenDeath)
+			AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
+			else
+				--AddCaption(loc("Ammo") .. ": " .. wepAmmo[wepIndex])
+			end
+			DrawTag(1)
+
+		elseif wep[wepIndex] == loc("Mine Deployer") then
+			morte = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtAirBomb, 0, 0, 0, 0)
+			SetTimer(morte, 1000)
+			DrawTag(1)
+		end
+
+	elseif (wepAmmo[wepIndex] == 0) and (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
 		AddCaption(loc("Ammo Depleted!"),0xff0000ff,capgrpMessage)
 	end
 
+	preciseOn = true
+
+end
 
+function onPreciseUp()
+	preciseOn = false
 end
 
 function onLJump()
@@ -760,7 +932,7 @@ function onLJump()
 	if (CurrentHedgehog ~= nil) and (stopMovement == false) and (tumbleStarted == true) then
 		shieldMiser = false
 		if shieldHealth == 80 then
-			AddCaption("Shield Depleted",0xff0000ff,capgrpMessage)
+			AddCaption(loc("Shield Depleted"),0xff0000ff,capgrpMessage)
 			PlaySound(sndMineTick)
 			PlaySound(sndSwitchHog)
 		elseif (beam == false) and (shieldHealth > 80) then
@@ -835,6 +1007,7 @@ function onGameInit()
 	HealthCaseProb = 0
 	MinesNum = 0
 	Explosives = 0
+	Delay = 1000
 
 	for i = 0, 3 do
 		vTag[0] = AddVisualGear(0, 0, vgtHealthTag, 0, false)
@@ -842,6 +1015,16 @@ function onGameInit()
 
 	HideTags()
 
+	wep[0] = loc("Barrel Launcher")
+	wep[1] = loc("Mine Deployer")
+	wep[2] = loc("Flamer")
+
+	wepCol[0] = 0x78818eff
+	wepCol[1] = 0xa12a77ff
+	wepCol[2] = 0xf49318ff
+
+	wepCount = 3
+
 end
 
 function onGameStart()
@@ -898,12 +1081,14 @@ end
 
 function onNewTurn()
 
-	primShotsLeft = primShotsMax
+	--primShotsLeft = primShotsMax
 	radShotsLeft = 2
 	stopMovement = false
 	tumbleStarted = false
+	boosterOn = false
 	beam = false
 	shieldHealth = 30 + 80 -- 50 = 5 secs, roughly
+	shockwaveHealth = 0
 
 	RK = 0
 	GK = 0
@@ -912,8 +1097,11 @@ function onNewTurn()
 	SK = 0
 	roundKills = 0
 	shieldMiser = true
+	fierceComp = false
 	shotsFired = 0
 	shotsHit = 0
+	sniperHits = 0
+	pointBlankHits = 0
 	chainLength = 0
 	chainCounter = 0
 	SurfTime = 12
@@ -937,12 +1125,23 @@ function onNewTurn()
 		SetMyCircles(false)
 	end
 
+
+	-------
+	-- tumbler
+	----
+
+	wepAmmo[0] = 5
+	wepAmmo[1] = 2
+	wepAmmo[2] = 5000
+	wepIndex = 2
+	ChangeWeapon()
+
+
 	HideTags()
 
 	---------------
 	---------------
 	--AddCaption("num g: " .. numGears() )
-
 	--WriteLnToConsole("onNewTurn, I just set a bunch of variables to their necessary states. This was done at:")
 	--WriteLnToConsole("The above occured at Game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
 
@@ -969,6 +1168,13 @@ function onGameTick()
 
 	HandleCircles()
 
+	-- derp
+	--if shockwaveHealth > 0 then
+	--	shockwaveHealth = shockwaveHealth - 1
+	--	shockwaveRad = shockwaveRad + 5
+	--end
+
+
 	Timer100 = Timer100 + 1
 	if Timer100 >= 100 then
 		Timer100 = 0
@@ -985,6 +1191,7 @@ function onGameTick()
 		end
 
 
+
 		--nw WriteLnToConsole("Starting ThingsToBeRunOnGears()")
 
 		runOnGears(ThingsToBeRunOnGears)
@@ -1063,6 +1270,7 @@ function onGameTick()
 		if (TimeLeft == 0) then
 			if (stopMovement == false) then	--time to stop the player
 				stopMovement = true
+				boosterOn = false
 				beam = false
 				upOn = false
 				down = false
@@ -1148,9 +1356,16 @@ function onGameTick()
 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)
 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
 
-
-				dxlimit = 0.4*fMod
-				dylimit = 0.4*fMod
+				if boosterOn == true then
+					tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtDust, 0, false)
+					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
+					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, 1, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
+					dxlimit = 0.8*fMod
+					dylimit = 0.8*fMod
+				else
+					dxlimit = 0.4*fMod
+					dylimit = 0.4*fMod
+				end
 
 				if dx > dxlimit then
 					dx = dxlimit
@@ -1188,6 +1403,10 @@ function onGameTick()
 
 			end
 
+
+			HandleFlameThrower()
+
+
 		end -- new end I put here to check if he's still alive or not
 
 	end
@@ -1196,6 +1415,16 @@ function onGameTick()
 
 end
 
+function onGearDamage(gear, damage)
+	if GetGearType(gear) == gtHedgehog then
+		if (fierceComp == false) and (damage >= 60) and (GetHogClan(gear) ~= GetHogClan(CurrentHedgehog)) then
+			fierceComp = true
+			AddCaption(loc("Fierce Competition!") .. " +8 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
+			AwardPoints(8)
+		end
+	end
+end
+
 function onGearResurrect(gear)
 
 	-- did I fall into the water? well, that was a stupid thing to do
@@ -1203,7 +1432,6 @@ function onGearResurrect(gear)
 		TimeLeft = 0
 		--WriteLnToConsole("Current hedgehog just drowned himself")
 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
-
 	end
 
 end
@@ -1220,7 +1448,7 @@ function onGearAdd(gear)
 	--end
 
 	if GetGearType(gear) == gtHedgehog then
-		SetEffect(gear, heResurrectable, true)
+		SetEffect(gear, heResurrectable, 1)
 
 		-----------
 		-- control
@@ -1233,7 +1461,8 @@ end
 
 function onGearDelete(gear)
 
-	if GetGearType(gear) == gtShell then
+
+	--[[if GetGearType(gear) == gtShell then
 		--nw WriteLnToConsole("on GearDelete call. Shell ID: " .. getGearValue(gear,"ID"))
 		--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
 
@@ -1249,11 +1478,7 @@ function onGearDelete(gear)
 		--end
 	elseif GetGearType(gear) == gtFlame then
 		--WriteLnToConsole("on GearDelete flame")
-	end
-
-
-
-
+	end]]
 
 	if isATrackedGear(gear) then
 		trackDeletion(gear)
@@ -1281,10 +1506,6 @@ end
 
 function DoHorribleThings(cUID)
 
-	-- maybe
-	-- add a check to draw it inside the circ and not past it if
-	-- it is closer than 150 or w/e
-
 	-- work out the distance to the target
 	g1X, g1Y = GetGearPosition(CurrentHedgehog)
 	g2X, g2Y = vCircX[cUID], vCircY[cUID]
@@ -1292,7 +1513,6 @@ function DoHorribleThings(cUID)
 	w = g1Y - g2Y
 	r = math.sqrt( (q*q) + (w*w) )	--alternate
 
-
 	opp = w
 	if opp < 0 then
 		opp = opp*-1
@@ -1307,13 +1527,18 @@ function DoHorribleThings(cUID)
 	NY = math.sin( math.rad(t) ) * NR
 
 	-- displace xy based on where this thing actually is
-	if q > 0 then
+
+	if r < NR then
+		rCircX[cUID] = g2X
+	elseif q > 0 then
 		rCircX[cUID] = g1X - NX
 	else
 		rCircX[cUID] = g1X + NX
 	end
 
-	if w > 0 then
+	if r < NR then
+		rCircY[cUID] = g2Y
+	elseif w > 0 then
 		rCircY[cUID] = g1Y - NY
 	else
 		rCircY[cUID] = g1Y + NY
@@ -1325,6 +1550,12 @@ function PlayerIsFine()
 	return (playerIsFine)
 end
 
+function GetDistFromXYtoXY(a, b, c, d)
+	q = a - c
+	w = b - d
+	return ( (q*q) + (w*w) )
+end
+
 function GetDistFromGearToGear(gear, gear2)
 
 	g1X, g1Y = GetGearPosition(gear)
@@ -1422,6 +1653,8 @@ function CreateMeSomeCircles()
 	--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), 80, 200, 1, 10, 0, 200, 5, 0xff00ffff)
 
 
+	shockwave = AddVisualGear(0,0,vgtCircle,0,true)
+
 end
 
 function IGotMeASafeXYValue(i)
@@ -1473,7 +1706,8 @@ function CircleDamaged(i)
 			AddVisualGear(vCircX[i], vCircY[i], vgtExplosion, 0, false)
 			PlaySound(sndExplosion)
 			PlaySound(sndShotgunReload)
-			primShotsLeft = primShotsLeft + 3
+			wepAmmo[0] = wepAmmo[0] +3
+			--primShotsLeft = primShotsLeft + 3
 			AddCaption("+" .. 3 .. " " .. loc("Ammo"), 0x00ff00ff,capgrpMessage)
 			DrawTag(1)
 
@@ -1702,9 +1936,6 @@ function CheckVarious(gear)
 		--nw WriteLnToConsole("Start of CheckVarious(): Shell ID: " .. getGearValue(gear,"ID"))
 	--end
 
-
-
-
 	targetHit = false
 
 	-- if circle is hit by player fire
@@ -1730,10 +1961,29 @@ function CheckVarious(gear)
 
 				if dist <= NR*NR then
 
-						--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
 
-					--SetGearPosition(gear, vCircX[i], vCircY[i])
-						--WriteLnToConsole("set the gtExplosives to be in the center of circ")
+					--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
+
+					dist = (GetDistFromXYtoXY(vCircX[i], vCircY[i], getGearValue(gear,"XP"), getGearValue(gear,"YP")) - (NR*NR))
+					--AddCaption(loc("Dist: ") .. dist .. "!",0xffba00ff,capgrpGameState)
+					if dist >= 1000000 then
+						sniperHits = sniperHits +1
+						AddCaption(loc("Sniper!") .. " +8 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
+						AwardPoints(8)
+						if sniperHits == 3 then
+							sniperHits = 0
+							AddCaption(loc("They Call Me Bullseye!") .. " +16 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
+							AwardPoints(15)
+						end
+					elseif dist <= 6000 then
+						pointBlankHits = pointBlankHits +1
+						if pointBlankHits == 3 then
+							pointBlankHits = 0
+							AddCaption(loc("Point Blank Combo!") .. " +5 " .. loc("points") .. "!",0xffba00ff,capgrpGameState)
+							AwardPoints(5)
+						end
+					end
+
 					AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 
 					targetHit = true
@@ -1753,6 +2003,8 @@ function CheckVarious(gear)
 
 					shotsHit = shotsHit + 1
 
+
+
 				end
 
 			--end
@@ -1760,7 +2012,7 @@ function CheckVarious(gear)
 		end
 
 	-- if player is hit by circle bazooka
-	elseif (GetGearType(gear) == gtShell) or (GetGearType(gear) == gtBall) then
+	elseif (GetGearType(gear) == gtShell) then --or (GetGearType(gear) == gtBall) then
 
 		dist = GetDistFromGearToGear(gear, CurrentHedgehog)
 
@@ -1848,10 +2100,12 @@ function CheckDistances()
 				WellHeAintGonnaJumpNoMore(GetX(CurrentHedgehog),GetY(CurrentHedgehog))
 
 				if ss == "fatal" then
-					if (primShotsLeft == 0) and (TimeLeft <= 9) then
+
+					if (wepAmmo[0] == 0) and (TimeLeft <= 9) then
+					--if (primShotsLeft == 0) and (TimeLeft <= 9) then
 						AddCaption(loc("Kamikaze Expert!") .. " +15 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
 						AwardPoints(15)
-					elseif (primShotsLeft == 0) then
+					elseif (wepAmmo[0] == 0) then
 						AddCaption(loc("Depleted Kamikaze!") .. " +5 " .. loc("points") .. "!",0xffba00ff,capgrpMessage)
 						AwardPoints(5)
 					elseif TimeLeft <= 9 then
@@ -1907,6 +2161,8 @@ function HandleCircles()
 			SetVisualGearValues(rCirc[i], rCircX[i], rCircY[i], 100, 255, 1, 10, 0, 40, 3, vCircCol[i]-rAlpha)
 		--end
 
+
+
 		vCounter[i] = vCounter[i] + 1
 		if vCounter[i] >= vCounterLim[i] then
 
@@ -2081,6 +2337,18 @@ function HandleCircles()
 
 		end
 
+
+		-- derp
+		if shockwaveHealth > 0 then
+			shockwaveHealth = shockwaveHealth - 1
+			shockwaveRad = shockwaveRad + 80
+
+			--mrm = ((48/100*shockwaveRad)/2)
+			--AddVisualGear(GetX(CurrentHedgehog)-mrm+GetRandom(mrm*2),GetY(CurrentHedgehog)-mrm+GetRandom(mrm*2), vgtSmoke, 0, false)
+		end
+
+
+
 	end
 
 	for i = 0,(vCCount-1) do
@@ -2097,15 +2365,26 @@ function HandleCircles()
 	end
 
 
-	if (CurrentHedgehog ~= nil) and (beam == true) then
-		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(pShield)
-		--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, g10 )
-		SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, 0xa800ffff-0x000000ff - -shieldHealth )
-		DrawTag(2)
-	else
-		SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
+	if (CurrentHedgehog ~= nil) then
+		if beam == true then
+			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(pShield)
+			--SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, g10 )
+			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 200, g9, 0xa800ffff-0x000000ff - -shieldHealth )
+			DrawTag(2)
+		else
+			SetVisualGearValues(pShield, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
+		end
+
+		if shockwaveHealth > 0 then
+			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(shockwave)
+			SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, shockwaveRad, g9, 0xff3300ff-0x000000ff - -shockwaveHealth )
+		else
+			SetVisualGearValues(shockwave, GetX(CurrentHedgehog), GetY(CurrentHedgehog), g3, g4, g5, g6, g7, 0, g9, g10 )
+		end
+
 	end
 
+
 end
 
 function ProjectileTrack(gear)
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.cfg
similarity index 100%
copy from share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg
copy to share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.cfg
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
index 10088cd..0d32392 100644
--- a/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
@@ -1,5 +1,5 @@
 ----------------------------------
--- THE SPECIALISTS MODE 0.6
+-- THE SPECIALISTS MODE 0.7
 -- by mikade
 ----------------------------------
 
@@ -40,13 +40,17 @@
 ----------------
 -- for the meanwhile, don't drop any crates except health crates
 
+----------------
+-- version 0.7
+----------------
+-- perhogadmsdf :D :D :D :D
+
 --------------------
 --TO DO
 --------------------
 
 -- balance hog health, maybe
 -- add proper gameflag checking, maybe (so that we can throw in a .cfg and let the users break everything)
--- set crate drops etc. (super crate for each class? or will this ruin the mode's simplicity?)
 
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
@@ -65,168 +69,128 @@ function CountHog(gear)
 	hogCounter = hogCounter +1
 end
 
-function CreateTeam()
-
-        currTeam = ""
-        lastTeam = ""
-        z = 0
-
-        for i = 0, (numhhs-1) do
-
-                currTeam = GetHogTeamName(hhs[i])
-
-                if currTeam == lastTeam then
-                        z = z + 1
-                else
-                        z = 1
-                end
-
-                if z == 1 then
-
-                        SetHogName(hhs[i],"Soldier")
-                        SetHogHat(hhs[i], "sf_vega")
-                        SetHealth(hhs[i],200)
-
-                elseif z == 2 then
-
-                        SetHogHat(hhs[i], "Glasses")
-                        SetHogName(hhs[i],"Engineer")
-
-                elseif z == 3 then
-
-                        SetHogName(hhs[i],"Ninja")
-                        SetHogHat(hhs[i], "NinjaFull")
-                        SetHealth(hhs[i],80)
+function onNewAmmoStore(groupIndex, hogIndex)
+
+	SetAmmo(amSkip, 9, 0, 0, 0)
+
+	if hogIndex == 0 then
+		SetAmmo(amBazooka, 1, 0, 0, 0)
+		SetAmmo(amGrenade, 1, 0, 0, 0)
+		SetAmmo(amShotgun, 1, 0, 0, 0)
+	elseif hogIndex == 1 then
+		SetAmmo(amGirder, 2, 0, 0, 0)
+		SetAmmo(amBlowTorch, 1, 0, 0, 0)
+		SetAmmo(amPickHammer, 1, 0, 0, 0)
+	elseif hogIndex == 2 then
+		SetAmmo(amRope, 9, 0, 0, 0)
+		SetAmmo(amParachute, 9, 0, 0, 0)
+		SetAmmo(amFirePunch, 1, 0, 0, 0)
+	elseif hogIndex == 3 then
+		SetAmmo(amDynamite, 1, 0, 0, 0)
+		SetAmmo(amMine, 1, 0, 0, 0)
+		SetAmmo(amDrill, 1, 0, 0, 0)
+	elseif hogIndex == 4 then
+		SetAmmo(amSniperRifle, 1, 0, 0, 0)
+		SetAmmo(amDEagle, 1, 0, 0, 0)
+		SetAmmo(amPortalGun, 2, 0, 0, 0)
+	elseif hogIndex == 5 then
+		SetAmmo(amSeduction, 9, 0, 0, 0)
+		SetAmmo(amResurrector, 1, 0, 0, 0)
+		SetAmmo(amInvulnerable, 1, 0, 0, 0)
+	elseif hogIndex == 6 then
+		SetAmmo(amFlamethrower, 1, 0, 0, 0)
+		SetAmmo(amMolotov, 1, 0, 0, 0)
+		SetAmmo(amNapalm, 1, 0, 0, 0)
+	elseif hogIndex == 7 then
+		SetAmmo(amBaseballBat, 1, 0, 0, 0)
+		SetAmmo(amGasBomb, 1, 0, 0, 0)
+		SetAmmo(amKamikaze, 1, 0, 0, 0)
+	end
 
-                elseif z == 4 then
+end
 
-                        SetHogName(hhs[i],"Demo")
-                        SetHogHat(hhs[i], "Skull")
-                        SetHealth(hhs[i],200)
+function CreateTeam()
 
-                elseif z == 5 then
+	currTeam = ""
+	lastTeam = ""
+	z = 0
 
-                        SetHogName(hhs[i],"Sniper")
-                        SetHogHat(hhs[i], "Sniper")
-                        SetHealth(hhs[i],120)
+	for i = 0, (numhhs-1) do
 
-                elseif z == 6 then
+			currTeam = GetHogTeamName(hhs[i])
 
-                        SetHogName(hhs[i],"Saint")
-                        SetHogHat(hhs[i], "angel")
-                        SetHealth(hhs[i],300)
+			if currTeam == lastTeam then
+					z = z + 1
+			else
+					z = 1
+			end
 
-                elseif z == 7 then
+			if z == 1 then
 
-                        SetHogName(hhs[i],"Pyro")
-                        SetHogHat(hhs[i], "Gasmask")
-                        SetHealth(hhs[i],150)
+					SetHogName(hhs[i],"Soldier")
+					SetHogHat(hhs[i], "sf_vega")
+					SetHealth(hhs[i],200)
 
-                elseif z == 8 then
+			elseif z == 2 then
 
-                        SetHogName(hhs[i],"Loon")
-                        SetHogHat(hhs[i], "clown")
-                        SetHealth(hhs[i],100)
+					SetHogHat(hhs[i], "Glasses")
+					SetHogName(hhs[i],"Engineer")
 
-                end
+			elseif z == 3 then
 
-                lastTeam = GetHogTeamName(hhs[i])
+					SetHogName(hhs[i],"Ninja")
+					SetHogHat(hhs[i], "NinjaFull")
+					SetHealth(hhs[i],80)
 
-        end
+			elseif z == 4 then
 
-end
+					SetHogName(hhs[i],"Demo")
+					SetHogHat(hhs[i], "Skull")
+					SetHealth(hhs[i],200)
 
-function ResetAllAmmo()
+			elseif z == 5 then
 
-        AddAmmo(CurrentHedgehog, amBazooka, 0)
-        AddAmmo(CurrentHedgehog, amGrenade, 0)
-        AddAmmo(CurrentHedgehog, amShotgun, 0)
+					SetHogName(hhs[i],"Sniper")
+					SetHogHat(hhs[i], "Sniper")
+					SetHealth(hhs[i],120)
 
-        AddAmmo(CurrentHedgehog, amGirder, 0)
-        AddAmmo(CurrentHedgehog, amBlowTorch, 0)
-        AddAmmo(CurrentHedgehog, amPickHammer, 0)
-        AddAmmo(CurrentHedgehog, amSwitch, 0)
+			elseif z == 6 then
 
-        AddAmmo(CurrentHedgehog, amRope, 0)
-        AddAmmo(CurrentHedgehog, amParachute, 0)
-        AddAmmo(CurrentHedgehog, amFirePunch, 0)
+					SetHogName(hhs[i],"Saint")
+					SetHogHat(hhs[i], "angel")
+					SetHealth(hhs[i],300)
 
-        AddAmmo(CurrentHedgehog, amDynamite, 0)
-        AddAmmo(CurrentHedgehog, amDrill, 0)
-        AddAmmo(CurrentHedgehog, amMine, 0)
+			elseif z == 7 then
 
-        AddAmmo(CurrentHedgehog, amSniperRifle, 0)
-        AddAmmo(CurrentHedgehog, amDEagle, 0)
-        AddAmmo(CurrentHedgehog, amPortalGun, 0)
+					SetHogName(hhs[i],"Pyro")
+					SetHogHat(hhs[i], "Gasmask")
+					SetHealth(hhs[i],150)
 
-        AddAmmo(CurrentHedgehog, amSeduction, 0)
-        AddAmmo(CurrentHedgehog, amResurrector, 0)
-        AddAmmo(CurrentHedgehog, amInvulnerable, 0)
+			elseif z == 8 then
 
-        AddAmmo(CurrentHedgehog, amFlamethrower, 0)
-        AddAmmo(CurrentHedgehog, amMolotov, 0)
-        AddAmmo(CurrentHedgehog, amNapalm, 0)
+					SetHogName(hhs[i],"Loon")
+					SetHogHat(hhs[i], "clown")
+					SetHealth(hhs[i],100)
 
-        AddAmmo(CurrentHedgehog, amBaseballBat, 0)
-        AddAmmo(CurrentHedgehog, amGasBomb, 0)
-        AddAmmo(CurrentHedgehog, amKamikaze, 0)
+			end
 
-end
+			lastTeam = GetHogTeamName(hhs[i])
 
-function AssignAmmo()
-
-        ResetAllAmmo()
-        n = GetHogName(CurrentHedgehog)
-
-        AddAmmo(CurrentHedgehog, amSkip,100)
-
-        if n == "Soldier" then
-                AddAmmo(CurrentHedgehog, amBazooka,1)
-                AddAmmo(CurrentHedgehog, amGrenade,1)
-                AddAmmo(CurrentHedgehog, amShotgun,1)
-        elseif n == "Engineer" then
-                AddAmmo(CurrentHedgehog, amGirder, 2)
-                AddAmmo(CurrentHedgehog, amBlowTorch, 1)
-                AddAmmo(CurrentHedgehog, amPickHammer, 1)
-        elseif n == "Ninja" then
-                AddAmmo(CurrentHedgehog, amRope, 100)
-                AddAmmo(CurrentHedgehog, amParachute, 100)
-                AddAmmo(CurrentHedgehog, amFirePunch, 1)
-        elseif n == "Demo" then
-                AddAmmo(CurrentHedgehog, amDynamite, 1)
-                AddAmmo(CurrentHedgehog, amMine, 1)
-                AddAmmo(CurrentHedgehog, amDrill, 1)
-        elseif n == "Sniper" then
-                AddAmmo(CurrentHedgehog, amSniperRifle, 1)
-                AddAmmo(CurrentHedgehog, amDEagle, 1)
-                AddAmmo(CurrentHedgehog, amPortalGun, 2)
-        elseif n == "Saint" then
-                AddAmmo(CurrentHedgehog, amSeduction, 100)
-                AddAmmo(CurrentHedgehog, amResurrector, 1)
-                AddAmmo(CurrentHedgehog, amInvulnerable, 1)
-        elseif n == "Pyro" then
-                AddAmmo(CurrentHedgehog, amFlamethrower, 1)
-                AddAmmo(CurrentHedgehog, amMolotov, 1)
-                AddAmmo(CurrentHedgehog, amNapalm, 1)
-        elseif n == "Loon" then
-                AddAmmo(CurrentHedgehog, amBaseballBat, 1)
-                AddAmmo(CurrentHedgehog, amGasBomb, 1)
-                AddAmmo(CurrentHedgehog, amKamikaze, 1)
-        end
+	end
 
 end
 
 function onGameInit()
-        GameFlags = gfRandomOrder + gfResetWeps + gfInfAttack + gfPlaceHog
-        Delay = 10
+	GameFlags = gfRandomOrder + gfResetWeps + gfInfAttack + gfPlaceHog +gfPerHogAmmo
+	Delay = 10
 	HealthCaseProb = 100
 end
 
 function onGameStart()
 
-        CreateTeam()
+	CreateTeam()
 
-        ShowMission     (
+	ShowMission     (
                                 loc("THE SPECIALISTS"),
                                 loc("a Hedgewars mini-game"),
 
@@ -247,25 +211,23 @@ end
 
 
 function onNewTurn()
-        currName = GetHogName(CurrentHedgehog)
-        lastName = GetHogName(CurrentHedgehog)
-        AssignAmmo()
-        started = true
-        switchStage = 0
+	currName = GetHogName(CurrentHedgehog)
+	lastName = GetHogName(CurrentHedgehog)
+	started = true
+	switchStage = 0
 end
 
-function onGameTick()
+function onGameTick20()
 
 	if (CurrentHedgehog ~= nil) then
 
 		currName = GetHogName(CurrentHedgehog)
 
-		if (currName ~= lastName) and (switchStage > 100) then
+		if (currName ~= lastName) and (switchStage > 5) then
 			AddCaption(loc("Switched to ") .. currName .. "!")
-			AssignAmmo()
 		end
 
-		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) and (switchStage < 100) then
+		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) and (switchStage < 5) then
 
 			AddCaption(loc("Prepare yourself") .. ", " .. currName .. "!")
 
@@ -284,12 +246,12 @@ function onGameTick()
 				elseif switchStage == 3 then
 					SetGearMessage(CurrentHedgehog,gmAttack)
 				elseif switchStage == 4 then
-					switchStage = 110
+					switchStage = 6
 					AddAmmo(CurrentHedgehog, amSwitch, 0)
 				end
 
 			else
-				switchStage = 110
+				switchStage = 6
 			end
 
 
@@ -303,10 +265,10 @@ end
 
 function onGearAdd(gear)
 
-        if GetGearType(gear) == gtHedgehog then
-                hhs[numhhs] = gear
-                numhhs = numhhs + 1
-        elseif (GetGearType(gear) == gtMine) and (started == true) then
+    if GetGearType(gear) == gtHedgehog then
+		hhs[numhhs] = gear
+		numhhs = numhhs + 1
+	elseif (GetGearType(gear) == gtMine) and (started == true) then
 		SetTimer(gear,5000)
 	end
 
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.cfg
old mode 100755
new mode 100644
similarity index 100%
copy from share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.cfg
copy to share/hedgewars/Data/Scripts/Multiplayer/Tunnels.cfg
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua
new file mode 100644
index 0000000..c52fba3
--- /dev/null
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Tunnels.lua
@@ -0,0 +1,98 @@
+ PointsBuffer = ''  -- A string to accumulate points in
+ function AddPoint(x, y, width, erase)
+     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
+     if width then
+         width = bor(width,0x80)
+         if erase then
+             width = bor(width,0x40)
+         end
+         PointsBuffer = PointsBuffer .. string.char(width)
+     else
+         PointsBuffer = PointsBuffer .. string.char(0)
+     end
+     if #PointsBuffer > 245 then
+         ParseCommand('draw '..PointsBuffer)
+         PointsBuffer = ''
+     end
+ end
+ function FlushPoints()
+     if #PointsBuffer > 0 then
+         ParseCommand('draw '..PointsBuffer)
+         PointsBuffer = ''
+     end
+ end
+
+
+function onGameInit()
+    MapGen = 2
+    TemplateFilter = 0
+    for i = 200,2000,600 do
+        AddPoint(1,i,63)
+        AddPoint(4000,i)
+    end
+
+    side = 0
+    for i = 0,GetRandom(15)+25 do
+        if side > 3 then 
+            size = GetRandom(4)+4
+        else
+            size = GetRandom(12)+4
+        end
+        --side = GetRandom(4)
+        dx = div(size,4)
+        maxshift = dx
+        dy = dx
+        if side == 0 then
+            x = 0
+            y = GetRandom(2048-size*4)+size*2
+            dy = 0
+        elseif side == 1 then
+            x = GetRandom(4096-size*4)+size*2
+            y = 0
+            dx = 0
+        elseif side == 2 then
+            x = 4096
+            y = GetRandom(2048-size*4)+size*2
+            dx = -dx
+            dy = 0
+        elseif side == 3 then
+            x = GetRandom(4096-size*4)+size*2
+            y = 2048
+            dx = 0
+            dy = -dy
+        elseif side > 3 then
+            x = GetRandom(2500)+500
+            y = GetRandom(1250)+250
+            dx = GetRandom(maxshift*2)-maxshift
+            dy = GetRandom(maxshift*2)-maxshift
+        end
+        length = GetRandom(500-size*25)+600
+        while (length > 0) and (x > -300) and (y > -300) and (x < 4400) and (y < 2400) do
+            length = length - 1
+            AddPoint(x,y,size,true)
+            x = x + dx
+            y = y + dy
+            if GetRandom(8) == 0 then
+                shift = GetRandom(10)-5
+                if (shift > 0) and (dx < maxshift) then
+                    dx = dx + shift
+                elseif (shift < 0) and (dx > -maxshift) then
+                    dx = dx + shift
+                end
+                shift = GetRandom(10)-5
+                if (shift > 0) and (dy < maxshift) then
+                    dy = dy + shift
+                elseif (shift < 0) and (dy > -maxshift) then
+                    dy = dy + shift
+                end
+            end
+        end
+        if side < 6 then
+            side = side + 1
+        else 
+            side = 0
+        end
+    end
+
+    FlushPoints()
+end 
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/Racer.cfg b/share/hedgewars/Data/Scripts/Multiplayer/WxW.cfg
similarity index 100%
copy from share/hedgewars/Data/Scripts/Multiplayer/Racer.cfg
copy to share/hedgewars/Data/Scripts/Multiplayer/WxW.cfg
diff --git a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
new file mode 100644
index 0000000..ee43962
--- /dev/null
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
@@ -0,0 +1,751 @@
+
+----------------------
+-- WALL TO WALL 0.4
+----------------------
+-- a shoppa minigame
+-- by mikade
+
+-- feel free to add map specific walls to LoadConfig, or post additional
+-- wall suggestions on our forum at: http://www.hedgewars.org/forum
+
+----------------
+--0.1
+----------------
+-- concept test
+
+----------------
+--0.2
+----------------
+-- unhardcoded turntimeleft, now uses shoppa default of 45s
+-- changed some things behind the scenes
+-- fixed oooooold radar bug
+-- added radar / script support for multiple crates
+-- tweaked weapons tables
+-- added surfing and changed crate spawn requirements a bit
+
+----------------
+--0.3
+----------------
+-- stuffed dirty clothes into cupboard
+-- improved user feedback
+-- added/improved experimental config system, input masks included :D
+
+----------------
+--0.4
+----------------
+-- for version 0.9.18, now detects border in correct location
+-- fix 0.3 config constraint
+-- remove unnecessary vars
+-- oops, remove hardcoding of minesnum,explosives
+-- ... and unhardcode turntime (again)... man, 30s is hard :(
+-- move some initialisations around
+-- numerous improvements to user feedback
+-- walls disappear after being touched
+-- added backwards compatibility with 0.9.17
+
+----------------
+--TO DO
+----------------
+-- achievements / try detect shoppa moves? :|
+-- maybe add ability for the user to place zones like in Racer?
+-- add more hard-coded values for specific maps
+
+-----------------------------
+-- GO PONIES, GO PONIES, GO!
+-----------------------------
+
+loadfile(GetDataPath() .. "Scripts/Locale.lua")()
+loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
+loadfile(GetDataPath() .. "Scripts/Utils.lua")()
+
+-- experimental menu stuff
+local menuIndex = 1
+local menu = {}
+local preMenuCfg
+local postMenuCfg
+local roundN = 0
+
+-- config and wall variables
+local AFR = false
+local allowCrazyWeps = false
+local requireSurfer = true
+local wX = {}
+local wY = {}
+local wWidth = {}
+local wHeight = {}
+local wTouched = {}
+--local margin
+local wallsLeft = 0
+
+local highestY = 0
+local surferTimer = 0
+local hasSurfed = false
+local allWallsHit = false
+
+local gTimer = 1
+local effectTimer = 1
+
+local ropeG = nil
+local crateG = nil
+local allowCrate = true
+
+-- crate radar vars
+local rCirc = {}
+local rAlpha = 255
+local rPingTimer = 0
+local m2Count = 0
+
+local weapons = {}
+
+--[[local unlisted = {amTardis, amLandGun,amExtraTime,amExtraDamage,
+				amVampiric, amSwitch, amInvulnerable, amGirder, amJetpack,
+				amPortalGun, amTeleport, amResurrector, amLaserSight, amLowGravity,
+				amAirAttack, amNapalm, amMineStrike, amDrillStrike,
+				amKamikaze, amSnowball, amSeduction}]]
+
+local crazyWeps = {amWatermelon, amHellishBomb, amBallgun, amRCPlane}
+
+local groundWeps = 	{amBee, amShotgun,amDEagle,amFirePunch, amWhip,
+				amPickHammer, amBaseballBat, amCake,amBallgun,
+				amRCPlane, amSniperRifle, amBirdy, amBlowTorch, amGasBomb,
+				amFlamethrower, amSMine, amMortar, amHammer}
+
+local ropeWeps = {amGrenade, amClusterBomb, amBazooka, amMine, amDynamite,
+				amWatermelon, amHellishBomb, amDrill, amMolotov}
+
+-- 0.9.18+ extra custom data for preset maps
+local MapList =
+	{
+	--name,      						surfer, roof, 	LRwalls
+	{"Atlantis Shoppa", 			    true, 	false, true},
+	{"BambooPlinko", 				    true,	false, true},
+	{"BrickShoppa", 				    false, 	false, true},
+	{"BubbleFlow",   					true, 	false, true},
+	{"Cave",       						false, 	false, true},
+	{"Glass Shoppa",      				true, 	false, true},
+	{"HardIce",      					false, 	false, true},
+	{"Industrial",       				false,	false, true},
+	{"Islands",       					true, 	false, true},
+	{"Hedgelove",       				true, 	false, true},
+	{"NeonStyle",       				false, 	false, true},
+	{"Octorama",       					false, 	false, true},
+	{"red vs blue - Castle",     		true, 	false, true},
+	{"red vs blue - castle2",     		true, 	false, true},
+	{"red vs blue - True Shoppa Sky",   true, 	false, true},
+	{"Ropes",       					false, 	false, true},
+	{"Ropes Rearranged",      			false, 	false, true},
+	{"RopesRevenge Flipped",    		true, 	false, true},
+	{"Ropes Three",      				false, 	false, true},
+	{"RopesTwo",      					false, 	false, true},
+	{"ShapeShoppa1.0",     				true, 	false, true},
+	{"ShappeShoppa Darkhow",      		true, 	false, true},
+	{"ShoppaCave2",      				true, 	false, true},
+	{"ShoppaFun",      					true, 	false, true},
+	{"ShoppaGolf",      				false, 	false,  true},
+	{"ShoppaHell",      				false, 	true,  false},
+	{"ShoppaKing",       				false, 	false, false},
+	{"ShoppaNeon",       				false, 	false, true},
+	{"ShoppaSky",       				false, 	false, true},
+	{"Shoppawall",       				false, 	false, true},
+	{"SkatePark",       				false, 	false, true},
+	{"SloppyShoppa",      				false, 	false, true},
+	{"Sticks",       					true, 	false, true},
+	{"Symmetrical Ropes ",       		false, 	false, true},
+	{"Tetris",       					false, 	false, true},
+	{"TransRopes2",      				false, 	false, true},
+	{"Wildmap",      					false, 	false, true},
+	{"Winter Shoppa",      				false, 	false, true},
+	{"2Cshoppa",      					true, 	false, true}
+	}
+
+function BoolToCfgTxt(p)
+	if p == false then
+		return("Disabled")
+	else
+		return("Enabled")
+	end
+end
+
+function LoadConfig(p)
+
+	margin = 20
+	mapID = nil
+
+	-- 0.9.17
+	if Map == "CHANGE_ME" then
+		AddCaption(loc("For improved features/stability, play 0.9.18+"))
+		--AddWall(10,10,4085,margin)
+		AddWall(10,10,margin,2025)
+		AddWall(4085-margin,10,margin,2025)
+	end
+
+	--0.9.18+
+	for i = 1, #MapList do
+		if Map == MapList[i][1] then
+			mapID = i
+			--AddCaption(MapList[i][1] .. " found. reqSurf is " .. BoolToCfgTxt(MapList[i][2]))
+		end
+	end
+
+	if (p == 1) and (mapID ~= nil) then
+		requireSurfer = MapList[mapID][2]
+	end
+
+	if mapID ~= nil then
+
+		-- add a wall to the roof
+		if MapList[mapID][3] == true then
+			AddWall(LeftX+10,TopY+10,RightX-LeftX-20,margin)
+		end
+
+		-- add walls on the left and right border
+		if MapList[mapID][4] == true then
+			AddWall(LeftX+10,TopY+10,margin,WaterLine)
+			AddWall(RightX-10-margin,TopY+10,margin,WaterLine)
+		end
+
+		-- add map specific walls
+		if Map == "Ropes" then
+			AddWall(1092,934,54,262)
+			AddWall(2822,323,33,137)
+		elseif Map == "ShoppaKing" then
+			AddWall(3777,1520,50,196)
+			AddWall(1658,338,46,670)
+		elseif Map == "ShoppaHell" then
+			AddWall(2035,831,30,263)
+			AddWall(3968,1668,31,383)
+		elseif Map == "ShoppaNeon" then
+			AddWall(980,400,20,300)
+			AddWall(1940,400,20,300)
+			AddWall(3088,565,26,284)
+			AddWall(187,270,28,266)
+		end
+
+	-- if map is unrecognized, add two walls on the side borders
+	-- also, if version of hw is not 0.9.17 or lower
+	elseif Map ~= "CHANGE_ME" then
+		AddWall(LeftX+10,TopY+10,margin,WaterLine)
+		AddWall(RightX-10-margin,TopY+10,margin,WaterLine)
+	end
+
+
+end
+
+function AddWall(zXMin,zYMin, zWidth, zHeight)
+
+	table.insert(wX, zXMin)
+	table.insert(wY, zYMin)
+	table.insert(wWidth, zWidth)
+	table.insert(wHeight, zHeight)
+	table.insert(wTouched, false)
+
+end
+
+function DrawBlip(gear)
+	SetVisualGearValues(getGearValue(gear,"CIRC"), getGearValue(gear,"RX"), getGearValue(gear,"RY"), 100, 255, 1, 10, 0, 40, 3, GetClanColor(GetHogClan(CurrentHedgehog))-rAlpha)
+end
+
+function TrackRadarBlip(gear)
+
+	-- work out the distance to the target
+	g1X, g1Y = GetGearPosition(CurrentHedgehog)
+	g2X, g2Y = GetX(gear), GetY(gear)
+	q = g1X - g2X
+	w = g1Y - g2Y
+	r = math.sqrt( (q*q) + (w*w) )	--alternate
+
+	RCX = getGearValue(gear,"RX")
+	RCY = getGearValue(gear,"RY")
+
+	rCircDistance = r -- distance to circle
+
+	opp = w
+	if opp < 0 then
+		opp = opp*-1
+	end
+
+	-- work out the angle (theta) to the target
+	t = math.deg ( math.asin(opp / r) )
+
+	-- based on the radius of the radar, calculate what x/y displacement should be
+	NR = 150 -- radius at which to draw circs
+	NX = math.cos( math.rad(t) ) * NR
+	NY = math.sin( math.rad(t) ) * NR
+
+	if rCircDistance < NR then
+		RCX = g2X
+	elseif q > 0 then
+		RCX = g1X - NX
+	else
+		RCX = g1X + NX
+	end
+
+	if rCircDistance < NR then
+		RCY = g2Y
+	elseif w > 0 then
+		RCY = g1Y - NY
+	else
+		RCY = g1Y + NY
+	end
+
+	setGearValue(gear, "RX", RCX)
+	setGearValue(gear, "RY", RCY)
+
+end
+
+
+function HandleCircles()
+
+	-- enable this if you want the radar to only show for a few seconds
+	-- after you spawn the crate
+	--[[if rAlpha ~= 255 then
+
+		rPingTimer = rPingTimer + 1
+		if rPingTimer == 100 then
+			rPingTimer = 0
+
+			rAlpha = rAlpha + 5
+			if rAlpha >= 255 then
+				rAlpha = 255
+			end
+		end
+
+	end]]
+
+	runOnGears(DrawBlip)
+
+	m2Count = m2Count + 1
+	if m2Count == 25 then
+		m2Count = 0
+
+		if (CurrentHedgehog ~= nil) and (rAlpha ~= 255) then
+			runOnGears(TrackRadarBlip)
+		end
+
+	end
+
+end
+
+
+function CheckCrateConditions()
+
+	crateSpawn = true
+
+	if requireSurfer == true then
+		if hasSurfed == false then
+			crateSpawn = false
+		end
+	end
+
+	if #wTouched > 0 then
+		if allWallsHit == false then
+			crateSpawn = false
+		end
+	end
+
+	if crateSpawn == true then
+		if allowCrate == true then
+		--if (crateG == nil) and (allowCrate == true) then
+			--AddCaption("")
+			SpawnAmmoCrate(0, 0, weapons[1+GetRandom(#weapons)] )
+			rPingTimer = 0
+			rAlpha = 0
+			PlaySound(sndWarp)
+		end
+	end
+
+end
+
+function CheckSurfer()
+
+	if GetY(CurrentHedgehog) > highestY then
+		highestY = GetY(CurrentHedgehog)
+	end
+
+	if (highestY == (WaterLine-8)) and (hasSurfed == false)  then
+
+		surferTimer = surferTimer +1
+		if (surferTimer == 40) then
+			hasSurfed = true
+			AddCaption(loc("Surfer!"),0xffba00ff,capgrpMessage2)
+		end
+	end
+
+end
+
+
+
+function WallHit(id, zXMin,zYMin, zWidth, zHeight)
+
+	if wTouched[id] == false then
+		tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
+		PlaySound(sndExplosion)
+		wallsLeft = wallsLeft - 1
+
+		if wallsLeft == 0 then
+			AddCaption(loc("All walls touched!"))
+			allWallsHit = true
+			if (requireSurfer == true) and (hasSurfed == false) then
+				AddCaption(loc("Go surf!"),0xffba00ff,capgrpMessage2)
+			end
+		else
+			AddCaption(loc("Walls Left") .. ": " .. wallsLeft)
+		end
+
+	end
+
+	wTouched[id] = true
+	tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
+	--PlaySound(sndVaporize) -- yeah, this is just annoying as shit
+
+end
+
+function CheckForWallCollision()
+
+	for i = 1, #wTouched do
+		if gearIsInBox(CurrentHedgehog, wX[i],wY[i],wWidth[i],wHeight[i]) then
+			WallHit(i, wX[i],wY[i],wWidth[i],wHeight[i])
+		end
+	end
+
+end
+
+function BorderSpark(zXMin,zYMin, zWidth, zHeight, bCol)
+
+	eX = zXMin + GetRandom(zWidth+10)
+	eY = zYMin + GetRandom(zHeight+10)
+
+	tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
+	if tempE ~= 0 then
+		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
+		SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, 1, g9, bCol )
+	end
+
+end
+
+
+function HandleBorderEffects()
+
+	effectTimer = effectTimer + 1
+	if effectTimer > 15 then --25
+
+		effectTimer = 1
+
+		for i = 1, #wTouched do
+			if wTouched[i] == true then
+				--bCol = GetClanColor(GetHogClan(CurrentHedgehog))
+			else
+				--bCol = 0xFFFFFFFF
+				bCol = GetClanColor(GetHogClan(CurrentHedgehog))
+				BorderSpark(wX[i],wY[i],wWidth[i],wHeight[i], bCol)
+			end
+			--BorderSpark(wX[i],wY[i],wWidth[i],wHeight[i], bCol)
+		end
+
+	end
+
+end
+
+function onLJump()
+	if roundN < 2 then
+		roundN = 100
+		SetInputMask(0xFFFFFFFF)
+		TurnTimeLeft = 1
+		AddCaption(loc("Configuration accepted."),0xffba00ff,capgrpMessage)
+		HideMission()
+	end
+end
+
+function onAttack()
+
+	if roundN < 2 then
+
+		if menuIndex == 1 then
+
+			if #wTouched > 0 then
+				for i = 1, #wTouched do
+					wTouched[i] = nil
+					wX[i] = nil
+					wY[i] = nil
+					wWidth[i] = nil
+					wHeight[i] = nil
+				end
+			else
+				LoadConfig(2)
+			end
+
+		elseif menuIndex == 2 then
+			requireSurfer = not(requireSurfer)
+		elseif menuIndex == 3 then
+			AFR = not(AFR)
+		elseif menuIndex == 4 then
+			allowCrazyWeps = not(allowCrazyWeps)
+		end
+
+		UpdateMenu()
+		configureWeapons()
+		HandleStartingStage()
+
+	elseif (AFR == true) then
+
+		if (GetCurAmmoType() ~= amRope) and
+			(GetCurAmmoType() ~= amSkip) and
+			(GetCurAmmoType() ~= amNothing)
+		then
+			AddCaption(loc("You may only attack from a rope!"),0xffba00ff,capgrpMessage2)
+		end
+
+	end
+
+end
+
+function onDown()
+	if roundN < 2 then
+		menuIndex = menuIndex +1
+		if menuIndex > #menu then
+			menuIndex = 1
+		end
+		HandleStartingStage()
+	end
+end
+
+function onUp()
+	if roundN < 2 then
+		menuIndex = menuIndex -1
+		if 	menuIndex == 0 then
+			menuIndex = #menu
+		end
+		HandleStartingStage()
+	end
+end
+
+function onGameInit()
+
+	GameFlags = gfRandomOrder + gfBorder + gfSolidLand --+ gfInfAttack
+	HealthCaseProb = 0
+	CaseFreq = 0
+
+end
+
+function configureWeapons()
+
+	-- reset wep array
+	for i = 1, #weapons do
+		weapons[i] = nil
+	end
+
+	-- add rope weps
+	for i, w in pairs(ropeWeps) do
+        table.insert(weapons, w)
+	end
+
+	-- add ground weps
+	for i, w in pairs(groundWeps) do
+        table.insert(weapons, w)
+	end
+
+	-- remove ground weps if attacking from rope is mandatory
+	if AFR == true then
+		for i = 1, #weapons do
+			for w = 1, #groundWeps do
+				if groundWeps[w] == weapons[i] then
+					table.remove(weapons, i)
+				end
+			end
+		end
+	end
+
+	-- remove crazy weps is crazy weps aren't allowed
+	if allowCrazyWeps == false then
+		for i = 1, #weapons do
+			for w = 1, #crazyWeps do
+				if crazyWeps[w] == weapons[i] then
+					table.remove(weapons, i)
+				end
+			end
+		end
+	end
+
+end
+
+function onGameStart()
+
+	LoadConfig(1)
+	configureWeapons()
+	UpdateMenu()
+	HandleStartingStage()
+
+end
+
+function onNewTurn()
+
+	wallsLeft = #wTouched
+
+	for i = 1, #wTouched do
+		wTouched[i] = false
+	end
+
+	allowCrate = true
+
+	surferTimer = 0
+	hasSurfed = false
+	allWallsHit = false
+	highestY = 0
+
+	crateG = nil
+
+	-- new config stuff
+	roundN = roundN + 1
+	if roundN < 2 then
+		TurnTimeLeft = -1
+		SetInputMask(0)
+		allowCrate = false
+		HandleStartingStage() -- new
+	end
+
+end
+
+function UpdateMenu()
+
+	preMenuCfg = loc("Spawn the crate, and attack!") .. "|"
+	postMenuCfg = loc("Press [Enter] to accept this configuration.")
+
+	menu = 	{
+			loc("Walls Required") .. ": " .. #wTouched .. "|",
+			loc("Surf Before Crate") .. ": " .. BoolToCfgTxt(requireSurfer) .. "|",
+			loc("Attack From Rope") .. ": " .. BoolToCfgTxt(AFR) .. "|",
+			loc("Super Weapons") .. ": " .. BoolToCfgTxt(allowCrazyWeps) .. "|"
+			}
+end
+
+function HandleStartingStage()
+
+	temp = menu[menuIndex]
+	menu[menuIndex] = "--> " .. menu[menuIndex]
+
+	missionComment = ""
+	for i = 1, #menu do
+		missionComment = missionComment .. menu[i]
+	end
+
+	ShowMission	(
+				loc("WALL TO WALL") .. " 0.4",
+				loc("a shoppa minigame"),
+				preMenuCfg..
+				missionComment ..
+				postMenuCfg ..
+				--" " .. "|" ..
+				"", 4, 300000
+				)
+
+	menu[menuIndex] = temp
+
+end
+
+function onGameTick()
+
+	if CurrentHedgehog ~= nil then
+
+		--AddCaption(Map)
+		--AddCaption(RightX ..";" .. GetX(CurrentHedgehog))
+
+		CheckSurfer()
+
+		gTimer = gTimer + 1
+		if gTimer == 25 then
+			gTimer = 1
+
+			CheckForWallCollision()
+			CheckCrateConditions()
+
+			if (crateG == GetFollowGear()) and (crateG ~= nil) then
+				FollowGear(CurrentHedgehog)
+			end
+
+			-- if attackfromrope is set, forbid firing unless using rope
+			if (AFR == true) and (roundN >= 2) then
+				if (GetCurAmmoType() == amRope) or
+					(GetCurAmmoType() == amSkip) or
+					(GetCurAmmoType() == amNothing)
+				then
+					SetInputMask(0xFFFFFFFF)
+				elseif ropeG == nil then
+					SetInputMask(bnot(gmAttack))
+				end
+			end
+
+		end
+
+		HandleBorderEffects()
+		HandleCircles()
+
+	end
+
+end
+
+function onGearAdd(gear)
+
+	if GetGearType(gear) == gtRope then
+		ropeG = gear
+	elseif GetGearType(gear) == gtCase then
+
+		crateG = gear
+		trackGear(gear)
+
+		table.insert(rCirc, AddVisualGear(0,0,vgtCircle,0,true) )
+		setGearValue(gear,"CIRC",rCirc[#rCirc])
+		setGearValue(gear,"RX",0)
+		setGearValue(gear,"RY",0)
+		SetVisualGearValues(rCirc[#rCirc], 0, 0, 100, 255, 1, 10, 0, 40, 3, 0xff00ffff)
+
+		allowCrate = false
+
+		rPingTimer = 0
+		rAlpha = 0
+
+	end
+
+end
+
+function onGearDelete(gear)
+
+	if gear == ropeG then
+		ropeG = nil
+	elseif GetGearType(gear) == gtCase then
+
+		if gear == crateG then
+			crateG = nil
+		--	rAlpha = 255
+		end
+
+		for i = 1, #rCirc do
+			if rCirc[i] == getGearValue(gear,"CIRC") then
+				DeleteVisualGear(rCirc[i])
+				table.remove(rCirc, i)
+			end
+		end
+
+		trackDeletion(gear)
+
+	end
+
+end
+
+function onAmmoStoreInit()
+
+	for i, w in pairs(ropeWeps) do
+        SetAmmo(w, 0, 0, 0, 1)
+    end
+
+    for i, w in pairs(groundWeps) do
+        SetAmmo(w, 0, 0, 0, 1)
+    end
+
+    for i, w in pairs(crazyWeps) do
+        SetAmmo(w, 0, 0, 0, 1)
+    end
+
+	SetAmmo(amRope, 9, 0, 0, 0)
+	SetAmmo(amSkip, 9, 0, 0, 0)
+
+end
diff --git a/share/hedgewars/Data/Scripts/Tracker.lua b/share/hedgewars/Data/Scripts/Tracker.lua
index 90f55bd..167491e 100644
--- a/share/hedgewars/Data/Scripts/Tracker.lua
+++ b/share/hedgewars/Data/Scripts/Tracker.lua
@@ -32,19 +32,17 @@ function trackDeletion(gear)
         end
     end
     if trackingTeams and GetGearType(gear) == gtHedgehog then
-        for team, hogs in pairs(teams) do
-            if team == GetHogTeamName(gear) then
-                if table.maxn(hogs) == 1 then
-                    hogs = nil
-                else
-                    for k, hog in ipairs(hogs) do
-                        if hog == gear then
-                            table.remove(hogs, k)
-                            break
-                        end
+    	hogs = teams[GetHogTeamName(gear)]
+        if hogs ~= nil then
+            if table.maxn(hogs) == 1 then
+                hogs = nil
+            else
+				for k, hog in ipairs(hogs) do
+                    if hog == gear then
+                        table.remove(hogs, k)
+                        break
                     end
                 end
-                break
             end
         end
     elseif resurrecting and GetGearType(gear) == gtResurrector then
@@ -60,25 +58,6 @@ function trackDeletion(gear)
     end
 end
 
--- Not needed?
--- Registers when a gear is resurrected
---function trackResurrection(gear)
---    if trackingTeams then
---        if GetGearType(gear) == gtHedgehog then
---            found = false
---            for team, hogs in pairs(teams) do
---                if team == GetHogTeamName(gear) then
---                    table.insert(hogs, gear)
---                    found = true
---                end
---            end
---            if not found then
---                teams[GetHogTeamName(gear)] = { gear }
---            end
---        end
---    end
---end
-
 -- Start to keep track of teams
 function trackTeams()
     if not trackingTeams then
@@ -97,6 +76,46 @@ function trackTeams()
     end
 end
 
+-- Registers when a hog is hidden
+function trackHiding(gear)
+    for k, g in ipairs(gears) do
+        if g == gear then
+            table.remove(gears, k)
+            break
+        end
+    end
+	
+    if trackingTeams then
+    	hogs = teams[GetHogTeamName(gear)]
+    	
+        if hogs ~= nil then
+            if table.maxn(hogs) == 1 then
+                hogs = nil
+            else
+                for k, hog in ipairs(hogs) do
+                    if hog == gear then
+                        table.remove(hogs, k)
+                        break
+                    end
+                end
+            end
+        end
+    end
+end
+
+-- Registers when a hog is restored
+function trackRestoring(gear)
+	table.insert(gears, gear)
+
+    if trackingTeams then
+        team = GetHogTeamName(gear)
+        if teams[team] == nil then
+            teams[team] = {}
+        end
+        table.insert(teams[team], gear)
+    end
+end
+
 -- Get a value for a specific gear
 function getGearValue(gear, key)
     if gearValues[gear] ~= nil then
diff --git a/share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist b/share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist
deleted file mode 100644
index 3f64c6c..0000000
--- a/share/hedgewars/Data/Scripts/plist/Balanced Random Weapon.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/Balanced_Random_Weapon.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string></string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Capture the Flag.plist b/share/hedgewars/Data/Scripts/plist/Capture the Flag.plist
deleted file mode 100644
index 46bd5eb..0000000
--- a/share/hedgewars/Data/Scripts/plist/Capture the Flag.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/Capture_the_Flag.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Gaudy Racer.plist b/share/hedgewars/Data/Scripts/plist/Gaudy Racer.plist
deleted file mode 100644
index 8bbe05c..0000000
--- a/share/hedgewars/Data/Scripts/plist/Gaudy Racer.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/GaudyRacer.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/No Jumping.plist b/share/hedgewars/Data/Scripts/plist/No Jumping.plist
deleted file mode 100644
index 38ee266..0000000
--- a/share/hedgewars/Data/Scripts/plist/No Jumping.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/No_Jumping.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Normal.plist b/share/hedgewars/Data/Scripts/plist/Normal.plist
deleted file mode 100644
index a6916cd..0000000
--- a/share/hedgewars/Data/Scripts/plist/Normal.plist
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string></string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Random Weapon.plist b/share/hedgewars/Data/Scripts/plist/Random Weapon.plist
deleted file mode 100644
index 3f64c6c..0000000
--- a/share/hedgewars/Data/Scripts/plist/Random Weapon.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/Balanced_Random_Weapon.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string></string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Space Invasion.plist b/share/hedgewars/Data/Scripts/plist/Space Invasion.plist
deleted file mode 100644
index b5feceb..0000000
--- a/share/hedgewars/Data/Scripts/plist/Space Invasion.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/Space_Invasion.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/The Specialists.plist b/share/hedgewars/Data/Scripts/plist/The Specialists.plist
deleted file mode 100644
index 62797f0..0000000
--- a/share/hedgewars/Data/Scripts/plist/The Specialists.plist	
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/The_Specialists.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string></string>
-	<key>weapon</key>
-	<string></string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Scripts/plist/Tumbler.plist b/share/hedgewars/Data/Scripts/plist/Tumbler.plist
deleted file mode 100644
index 6eef8c5..0000000
--- a/share/hedgewars/Data/Scripts/plist/Tumbler.plist
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>command</key>
-	<string>escript Scripts/Multiplayer/Tumbler.lua</string>
-	<key>description</key>
-	<string></string>
-	<key>scheme</key>
-	<string>Default.plist</string>
-	<key>weapon</key>
-	<string>Default.plist</string>
-</dict>
-</plist>
diff --git a/share/hedgewars/Data/Sounds/voices/CMakeLists.txt b/share/hedgewars/Data/Sounds/voices/CMakeLists.txt
index 39a0e1c..51f56dc 100644
--- a/share/hedgewars/Data/Sounds/voices/CMakeLists.txt
+++ b/share/hedgewars/Data/Sounds/voices/CMakeLists.txt
@@ -9,6 +9,7 @@ foreach(dir
 	Singer
 	Surfer
 	Default_uk
+	Default_es
 	HillBilly
 	)
 	add_subdirectory(${dir})
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Boring.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Boring.ogg
new file mode 100644
index 0000000..b9a31d7
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Boring.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Byebye.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Byebye.ogg
new file mode 100644
index 0000000..16daeba
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Byebye.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/CMakeLists.txt b/share/hedgewars/Data/Sounds/voices/Default_es/CMakeLists.txt
new file mode 100644
index 0000000..43a8412
--- /dev/null
+++ b/share/hedgewars/Data/Sounds/voices/Default_es/CMakeLists.txt
@@ -0,0 +1,41 @@
+file(GLOB VoiceSounds
+Boring.ogg
+Byebye.ogg
+Comeonthen.ogg
+Coward.ogg
+Enemydown.ogg
+Firstblood.ogg
+Firepunch*.ogg
+Flawless.ogg
+Hello.ogg
+Hurry.ogg
+Illgetyou.ogg
+Incoming.ogg
+Jump*.ogg
+JustYouwait.ogg
+Kamikaze.ogg
+Laugh.ogg
+Melon.ogg
+Missed.ogg
+Nooo.ogg
+Nutter.ogg
+Ooff*.ogg
+Oops.ogg
+Ow*.ogg
+PoisonCough.ogg
+PoisonMoan.ogg
+Reinforcements.ogg
+Sameteam.ogg
+Stupid.ogg
+Takecover.ogg
+Traitor.ogg
+Uh-oh.ogg
+Victory.ogg
+Watchit.ogg
+Yessir.ogg
+Youllregretthat.ogg
+)
+
+install(FILES
+	${VoiceSounds}
+	DESTINATION ${SHAREPATH}Data/Sounds/voices/Default_es)
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Comeonthen.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Comeonthen.ogg
new file mode 100644
index 0000000..e17a0cf
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Comeonthen.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Coward.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Coward.ogg
new file mode 100644
index 0000000..91a5cb5
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Coward.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Enemydown.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Enemydown.ogg
new file mode 100644
index 0000000..0975254
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Enemydown.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Firstblood.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Firstblood.ogg
new file mode 100644
index 0000000..4ec4779
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Firstblood.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Flawless.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Flawless.ogg
new file mode 100644
index 0000000..510d049
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Flawless.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Hello.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Hello.ogg
new file mode 100644
index 0000000..0ff5dba
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Hello.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Hurry.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Hurry.ogg
new file mode 100644
index 0000000..f9369da
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Hurry.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Illgetyou.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Illgetyou.ogg
new file mode 100644
index 0000000..f05388c
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Illgetyou.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Incoming.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Incoming.ogg
new file mode 100644
index 0000000..3fc1889
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Incoming.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Jump1.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Jump1.ogg
new file mode 100644
index 0000000..2cb0678
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Jump1.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Jump2.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Jump2.ogg
new file mode 100644
index 0000000..93708e6
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Jump2.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Jump3.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Jump3.ogg
new file mode 100644
index 0000000..61798ea
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Jump3.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Kamikaze.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Kamikaze.ogg
new file mode 100644
index 0000000..84f879c
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Kamikaze.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Laugh.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Laugh.ogg
new file mode 100644
index 0000000..9fbc171
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Laugh.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Missed.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Missed.ogg
new file mode 100644
index 0000000..a5a24d2
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Missed.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Nooo.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Nooo.ogg
new file mode 100644
index 0000000..446b678
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Nooo.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Nutter.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Nutter.ogg
new file mode 100644
index 0000000..a0470d3
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Nutter.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ooff1.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff1.ogg
new file mode 100644
index 0000000..9abd4ef
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff1.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ooff2.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff2.ogg
new file mode 100644
index 0000000..6deeb53
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff2.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ooff3.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff3.ogg
new file mode 100644
index 0000000..86e6940
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ooff3.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Oops.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Oops.ogg
new file mode 100644
index 0000000..aaab84c
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Oops.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ow1.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ow1.ogg
new file mode 100644
index 0000000..03c84b4
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ow1.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ow2.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ow2.ogg
new file mode 100644
index 0000000..f83fb41
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ow2.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ow3.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ow3.ogg
new file mode 100644
index 0000000..642eb47
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ow3.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Ow4.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Ow4.ogg
new file mode 100644
index 0000000..d6b5889
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Ow4.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/PoisonCough.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/PoisonCough.ogg
new file mode 100644
index 0000000..ca8daf0
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/PoisonCough.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/PoisonMoan.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/PoisonMoan.ogg
new file mode 100644
index 0000000..d232432
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/PoisonMoan.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Reinforcements.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Reinforcements.ogg
new file mode 100644
index 0000000..8034073
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Reinforcements.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Sameteam.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Sameteam.ogg
new file mode 100644
index 0000000..234092a
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Sameteam.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Stupid.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Stupid.ogg
new file mode 100644
index 0000000..933454a
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Stupid.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Takecover.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Takecover.ogg
new file mode 100644
index 0000000..be609cd
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Takecover.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Traitor.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Traitor.ogg
new file mode 100644
index 0000000..59d33bd
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Traitor.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Uh-oh.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Uh-oh.ogg
new file mode 100644
index 0000000..81561fb
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Uh-oh.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Victory.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Victory.ogg
new file mode 100644
index 0000000..30a3997
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Victory.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Watchit.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Watchit.ogg
new file mode 100644
index 0000000..9a07236
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Watchit.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Yessir.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Yessir.ogg
new file mode 100644
index 0000000..5d780b5
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Yessir.ogg differ
diff --git a/share/hedgewars/Data/Sounds/voices/Default_es/Youllregretthat.ogg b/share/hedgewars/Data/Sounds/voices/Default_es/Youllregretthat.ogg
new file mode 100644
index 0000000..3cb41ed
Binary files /dev/null and b/share/hedgewars/Data/Sounds/voices/Default_es/Youllregretthat.ogg differ
diff --git a/share/hedgewars/Data/Themes/Art/LandBackTex.png b/share/hedgewars/Data/Themes/Art/LandBackTex.png
index c7452e2..6d25052 100644
Binary files a/share/hedgewars/Data/Themes/Art/LandBackTex.png and b/share/hedgewars/Data/Themes/Art/LandBackTex.png differ
diff --git a/share/hedgewars/Data/Themes/Bamboo/Flake.png b/share/hedgewars/Data/Themes/Bamboo/Flake.png
index a2e4681..3455a98 100644
Binary files a/share/hedgewars/Data/Themes/Bamboo/Flake.png and b/share/hedgewars/Data/Themes/Bamboo/Flake.png differ
diff --git a/share/hedgewars/Data/Themes/Bath/Girder.png b/share/hedgewars/Data/Themes/Bath/Girder.png
index fc442d1..d291d46 100644
Binary files a/share/hedgewars/Data/Themes/Bath/Girder.png and b/share/hedgewars/Data/Themes/Bath/Girder.png differ
diff --git a/share/hedgewars/Data/Themes/Island/SkyL.png b/share/hedgewars/Data/Themes/Island/SkyL.png
new file mode 100644
index 0000000..b04da05
Binary files /dev/null and b/share/hedgewars/Data/Themes/Island/SkyL.png differ
diff --git a/share/hedgewars/Data/Themes/Jungle/LandBackTex.png b/share/hedgewars/Data/Themes/Jungle/LandBackTex.png
index 3eb03dc..be69cf9 100644
Binary files a/share/hedgewars/Data/Themes/Jungle/LandBackTex.png and b/share/hedgewars/Data/Themes/Jungle/LandBackTex.png differ
diff --git a/share/hedgewars/Data/Themes/Sheep/SkyL.png b/share/hedgewars/Data/Themes/Sheep/SkyL.png
index f7b2516..5941500 100644
Binary files a/share/hedgewars/Data/Themes/Sheep/SkyL.png and b/share/hedgewars/Data/Themes/Sheep/SkyL.png differ
diff --git a/share/hedgewars/Data/Themes/Stage/horizont.png b/share/hedgewars/Data/Themes/Stage/horizont.png
index d484770..2932e81 100644
Binary files a/share/hedgewars/Data/Themes/Stage/horizont.png and b/share/hedgewars/Data/Themes/Stage/horizont.png differ
diff --git a/share/hedgewars/Data/misc/CMakeLists.txt b/share/hedgewars/Data/misc/CMakeLists.txt
index 0b71976..7ea7db5 100644
--- a/share/hedgewars/Data/misc/CMakeLists.txt
+++ b/share/hedgewars/Data/misc/CMakeLists.txt
@@ -1,9 +1,13 @@
-if(DEFINED DATA_INSTALL_DIR)                                                                                                            
-    set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR})                                                                                          
-else()                                                                                                                                  
-    set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/)                                                                               
+if(DEFINED DATA_INSTALL_DIR)
+    set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR}
+)
+else()
+    set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/)
 endif()  
+
+if(UNIX AND NOT APPLE)
 configure_file(hwengine.desktop.in hwengine.desktop)
+endif()
 
 file(GLOB miscfiles *.xml *.desktop)
 
diff --git a/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml b/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml
index daf7fe0..391ad0f 100644
--- a/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml
+++ b/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml
@@ -11,12 +11,13 @@
     <comment xml:lang="es">Demo de Hedgewars</comment>
     <comment xml:lang="fr">Démonstration d'Hedgewars</comment>
     <comment xml:lang="it">Demo di Hedgewars</comment>
-	<comment xml:lang="ko">헤즈와스 데모</comment>
+    <comment xml:lang="ko">헤즈와스 데모</comment>
     <comment xml:lang="pl">Demo gry Hedgewars</comment>
-	<comment xml:lang="pt">Hedgewars Demo</comment>
+    <comment xml:lang="pt">Hedgewars Demo</comment>
     <comment xml:lang="sk">Demo hry Hedgewars</comment>
     <comment xml:lang="cs">Ukázka hry Hedgewars</comment>
     <comment xml:lang="sv">Demo för Hedgewars</comment>
+    <comment xml:lang="da">Hedgewars-demo</comment>
     <magic priority="50">
       <match required="yes" type="byte" offset="0" value="2"/>
       <match required="yes" type="big16" offset="1" value="21572"/>
@@ -30,13 +31,14 @@
     <comment xml:lang="de">Hedgewars gespeichertes Spiel</comment>
     <comment xml:lang="es">Partida guardada de Hedgewars</comment>
     <comment xml:lang="fr">Parties enregistrées d'Hedgewars</comment>
-	<comment xml:lang="ko">헤즈와스 저장된 게임</comment>
+    <comment xml:lang="ko">헤즈와스 저장된 게임</comment>
     <comment xml:lang="it">Partita salvata di Hedgewars</comment>
     <comment xml:lang="pl">Zapis gry Hedgewars</comment>
-	<comment xml:lang="pt">Partida guardada de Hedgewars</comment>
+    <comment xml:lang="pt">Partida guardada de Hedgewars</comment>
     <comment xml:lang="sk">Uložená hra Hedgewars</comment>
     <comment xml:lang="cs">Uložená hra Hedgewars</comment>
     <comment xml:lang="sv">Sparfil för Hedgewars</comment>
+    <comment xml:lang="da">Gemt Hedgewars-spil</comment>
     <magic priority="50">
       <match required="yes" type="byte" offset="0" value="2"/>
       <match required="yes" type="big16" offset="1" value="21587"/>
diff --git a/share/hedgewars/Data/misc/hwengine.desktop.in b/share/hedgewars/Data/misc/hwengine.desktop.in
index 0841c98..5a4e366 100644
--- a/share/hedgewars/Data/misc/hwengine.desktop.in
+++ b/share/hedgewars/Data/misc/hwengine.desktop.in
@@ -15,6 +15,7 @@ GenericName[ru]=Движок Hedgewars для проигрывания сохр
 GenericName[sk]=Engine hry Hedgewars, pre prehrávanie uložených hier a demo súborov
 GenericName[cs]=Engine hry Hedgewars pro přehrávání uložených her a ukázkových souborů
 GenericName[sv]=Hedgewarsmotorn, för att öppna demo- och sparfiler
+GenericName[da]=Kæmpende Pindsvin
 Icon=hedgewars.png
 Exec=${CMAKE_INSTALL_PREFIX}/bin/hwengine ${HEDGEWARS_DATADIR}/hedgewars/Data %f
 Path=/tmp
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index c8a59cd..0c7d499 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,48 +1,54 @@
 if (NOT APPLE)
-	configure_file(	"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
-			"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
-			IMMEDIATE @ONLY)
+    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+                   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+                    IMMEDIATE @ONLY)
 
-	add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+    add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
 endif()
 
 if (APPLE)
-	find_package(Qt4 REQUIRED)
-	find_package(SDL REQUIRED)
-	find_package(SDL_image REQUIRED)
-	find_package(SDL_net REQUIRED)
-	find_package(SDL_ttf REQUIRED)
-	find_package(SDL_mixer REQUIRED)
-	find_package(OGGVORBIS REQUIRED)
-        if(NOT NOAUTOUPDATE)
-		#needed for SPARKLE_FOUND variable
-		find_package(Sparkle QUIET)
-		#needed because the 'if' clause in the script prints silly policy warnings
-		if(${SPARKLE_FOUND})
-			set(SPARKLE_FOUND 1)
-		else()
-			set(SPARKLE_FOUND 0)
-		endif()
-	endif()
-
-	#use the associated tool from the libraries we've selected
-	string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}")
-
-	#remove the ";-framework Cocoa" from the SDL_LIBRARY variable
-	string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
-
-	#this tool is present in qt 4.5 but only if you compile from sources; from qt 4.6 is present also in the binary version
-	find_program(macdeployqt_EXE NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin)
-	if(NOT macdeployqt_EXE)
-		message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})")
-	else()
-		message(STATUS "macdeployqt found in ${macdeployqt_EXE}")
-	endif()
-
-	#dummy target, we're interested in the postscript file
-	add_custom_target(bundle)
-	set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
-
-	configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
+    find_package(Qt4 REQUIRED QUIET)
+    find_package(SDL REQUIRED)
+    find_package(SDL_image REQUIRED)
+    find_package(SDL_net REQUIRED)
+    find_package(SDL_ttf REQUIRED)
+    find_package(SDL_mixer REQUIRED)
+    find_package(OGGVORBIS REQUIRED)
+    if(NOT NOAUTOUPDATE)
+        #needed for SPARKLE_FOUND variable
+        find_package(Sparkle QUIET)
+        #needed because the 'if' clause in the script prints silly policy warnings
+        if(${SPARKLE_FOUND})
+            set(SPARKLE_FOUND 1)
+        else()
+            set(SPARKLE_FOUND 0)
+        endif()
+    endif()
+
+    #use the associated tool from the libraries we've selected
+    string(REGEX REPLACE "(.*)/include.*" "\\1" qt_base_dir "${QT_INCLUDE_DIR}")
+
+    #remove the ";-framework Cocoa" from the SDL_LIBRARY variable
+    string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
+
+    if(NOT NOPNG)
+        #get the neme of the library (harmelss if it is static)
+        string(REGEX REPLACE ".*/(.*)$" "\\1" PNG_LIBNAME "${PNG_LIBRARY}")
+    endif()
+
+    #this tool is present in qt 4.5 but only if you compile from sources
+    #from qt 4.6 is present also in the binary version
+    find_program(macdeployqt_executable NAMES macdeployqt macdeployqt-mac PATHS ${qt_base_dir}/bin)
+    if(NOT macdeployqt_executable)
+        message(FATAL_ERROR "The utility macdeployqt is required to create the bundle (seached: ${qt_base_dir})")
+    else()
+        message(STATUS "Found macdeployqt: ${macdeployqt_executable}")
+    endif()
+
+    #dummy target, we're interested in the postscript file
+    add_custom_target(bundle)
+    set_target_properties(bundle PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
+
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
 endif()
 
diff --git a/tools/CreateMacBundle.cmake.in b/tools/CreateMacBundle.cmake.in
index 842f754..af2b58c 100644
--- a/tools/CreateMacBundle.cmake.in
+++ b/tools/CreateMacBundle.cmake.in
@@ -1,9 +1,22 @@
 message(STATUS "Performing standalone bundle creation...")
 
 execute_process(COMMAND ls ${frameworks_dir} RESULT_VARIABLE doBundle OUTPUT_QUIET ERROR_QUIET)
-
 execute_process(COMMAND mkdir -p ${frameworks_dir})
-execute_process(COMMAND ${macdeployqt_EXE} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET)
+# macdeployqt will convert safely any absolute path library for 'hedgewars'
+execute_process(COMMAND ${macdeployqt_executable} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET)
+
+if(NOT ${NOVIDEOREC})
+    # but macdeployqt will not work for 'hwengine'; luckily the dylibs were already updated before
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVCODEC} @executable_path/../Frameworks/libavcodec.dylib ${CMAKE_BINARY_DIR}/${bundle_name}/Contents/MacOS/hwengine)
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVFORMAT} @executable_path/../Frameworks/libavformat.dylib ${CMAKE_BINARY_DIR}/${bundle_name}/Contents/MacOS/hwengine)
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVUTIL} @executable_path/../Frameworks/libavutil.dylib ${CMAKE_BINARY_DIR}/${bundle_name}/Contents/MacOS/hwengine)
+endif()
+
+if(NOT ${NOPNG})
+    #same here, for libpng and hwengine, let's assume the version pulled by macdeployqt is the same
+    #(yes libpng is pulled by macdeployqt even when NOVIDEOREC is active)
+    execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${CMAKE_BINARY_DIR}/${bundle_name}/Contents/MacOS/hwengine)
+endif()
 
 if(doBundle EQUAL 1)
     execute_process(COMMAND cp -pPR ${sdl_dir}          ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL.framework)
diff --git a/tools/PascalBasics.hs b/tools/PascalBasics.hs
new file mode 100644
index 0000000..3b94c28
--- /dev/null
+++ b/tools/PascalBasics.hs
@@ -0,0 +1,70 @@
+{-# LANGUAGE FlexibleContexts #-}
+module PascalBasics where
+
+import Text.Parsec.Combinator
+import Text.Parsec.Char
+import Text.Parsec.Prim
+import Text.Parsec.Token
+import Text.Parsec.Language
+import Data.Char
+
+builtin = ["succ", "pred", "low", "high", "ord", "inc", "dec", "exit", "break", "continue", "length"]
+
+pascalLanguageDef
+    = emptyDef
+    { commentStart   = "(*"
+    , commentEnd     = "*)"
+    , commentLine    = "//"
+    , nestedComments = False
+    , identStart     = letter <|> oneOf "_"
+    , identLetter    = alphaNum <|> oneOf "_"
+    , reservedNames  = [
+            "begin", "end", "program", "unit", "interface"
+            , "implementation", "and", "or", "xor", "shl"
+            , "shr", "while", "do", "repeat", "until", "case", "of"
+            , "type", "var", "const", "out", "array", "packed"
+            , "procedure", "function", "with", "for", "to"
+            , "downto", "div", "mod", "record", "set", "nil"
+            , "cdecl", "external", "if", "then", "else"
+            ] -- ++ builtin
+    , reservedOpNames= []
+    , caseSensitive  = False
+    }
+
+preprocessorSwitch :: Stream s m Char => ParsecT s u m String
+preprocessorSwitch = do
+    try $ string "{$"
+    s <- manyTill (noneOf "\n") $ char '}'
+    return s
+
+caseInsensitiveString s = do
+    mapM_ (\a -> satisfy (\b -> toUpper a == toUpper b)) s <?> s
+    return s
+
+pas = patch $ makeTokenParser pascalLanguageDef
+    where
+    patch tp = tp {stringLiteral = stringL}
+
+comment = choice [
+        char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}')
+        , (try $ string "(*") >> manyTill anyChar (try $ string "*)")
+        , (try $ string "//") >> manyTill anyChar (try newline)
+        ]
+
+comments = do
+    spaces
+    skipMany $ do
+        preprocessorSwitch <|> comment
+        spaces
+
+stringL = do
+    (char '\'')
+    s <- (many $ noneOf "'")
+    (char '\'')
+    ss <- many $ do
+        (char '\'')
+        s' <- (many $ noneOf "'")
+        (char '\'')
+        return $ '\'' : s'
+    comments
+    return $ concat (s:ss)
diff --git a/tools/PascalParser.hs b/tools/PascalParser.hs
index b433e6c..b10fcad 100644
--- a/tools/PascalParser.hs
+++ b/tools/PascalParser.hs
@@ -1,159 +1,33 @@
 module PascalParser where
 
-import Text.Parsec.Expr
+import Text.Parsec
 import Text.Parsec.Char
 import Text.Parsec.Token
 import Text.Parsec.Language
+import Text.Parsec.Expr
 import Text.Parsec.Prim
 import Text.Parsec.Combinator
 import Text.Parsec.String
 import Control.Monad
+import Data.Maybe
 import Data.Char
 
-data PascalUnit =
-    Program Identifier Implementation
-    | Unit Identifier Interface Implementation (Maybe Initialize) (Maybe Finalize)
-    deriving Show
-data Interface = Interface Uses TypesAndVars
-    deriving Show
-data Implementation = Implementation Uses TypesAndVars
-    deriving Show
-data Identifier = Identifier String
-    deriving Show
-data TypesAndVars = TypesAndVars [TypeVarDeclaration]
-    deriving Show
-data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl
-    | VarDeclaration Bool ([Identifier], TypeDecl) (Maybe InitExpression)
-    | FunctionDeclaration Identifier TypeDecl (Maybe Phrase)
-    deriving Show
-data TypeDecl = SimpleType Identifier
-    | RangeType Range
-    | Sequence [Identifier]
-    | ArrayDecl Range TypeDecl
-    | RecordType [TypeVarDeclaration]
-    | PointerTo TypeDecl
-    | String
-    | UnknownType
-    deriving Show
-data Range = Range Identifier
-           | RangeFromTo InitExpression InitExpression
-    deriving Show
-data Initialize = Initialize String
-    deriving Show
-data Finalize = Finalize String
-    deriving Show
-data Uses = Uses [Identifier]
-    deriving Show
-data Phrase = ProcCall Identifier [Expression]
-        | IfThenElse Expression Phrase (Maybe Phrase)
-        | WhileCycle Expression Phrase
-        | RepeatCycle Expression [Phrase]
-        | ForCycle Identifier Expression Expression Phrase
-        | WithBlock Reference Phrase
-        | Phrases [Phrase]
-        | SwitchCase Expression [(Expression, Phrase)] (Maybe Phrase)
-        | Assignment Reference Expression
-    deriving Show
-data Expression = Expression String
-    | BuiltInFunCall [Expression] Reference
-    | PrefixOp String Expression
-    | PostfixOp String Expression
-    | BinOp String Expression Expression
-    | StringLiteral String
-    | CharCode String
-    | NumberLiteral String
-    | FloatLiteral String
-    | HexNumber String
-    | Reference Reference
-    | Null
-    deriving Show
-data Reference = ArrayElement [Expression] Reference
-    | FunCall [Expression] Reference
-    | SimpleReference Identifier
-    | Dereference Reference
-    | RecordField Reference Reference
-    | Address Reference
-    deriving Show
-data InitExpression = InitBinOp String InitExpression InitExpression
-    | InitPrefixOp String InitExpression
-    | InitReference Identifier
-    | InitArray [InitExpression]
-    | InitRecord [(Identifier, InitExpression)]
-    | InitFloat String
-    | InitNumber String
-    | InitHexNumber String
-    | InitString String
-    | InitChar String
-    | BuiltInFunction String [InitExpression]
-    | InitSet [Identifier]
-    | InitNull
-    deriving Show
-
-builtin = ["succ", "pred", "low", "high"]
-    
-pascalLanguageDef
-    = emptyDef
-    { commentStart   = "(*"
-    , commentEnd     = "*)"
-    , commentLine    = "//"
-    , nestedComments = False
-    , identStart     = letter <|> oneOf "_"
-    , identLetter    = alphaNum <|> oneOf "_."
-    , reservedNames  = [
-            "begin", "end", "program", "unit", "interface"
-            , "implementation", "and", "or", "xor", "shl"
-            , "shr", "while", "do", "repeat", "until", "case", "of"
-            , "type", "var", "const", "out", "array", "packed"
-            , "procedure", "function", "with", "for", "to"
-            , "downto", "div", "mod", "record", "set", "nil"
-            , "string", "shortstring"
-            ] ++ builtin
-    , reservedOpNames= [] 
-    , caseSensitive  = False   
-    }
-    
-caseInsensitiveString s = do
-    mapM_ (\a -> satisfy (\b -> toUpper a == toUpper b)) s <?> s
-    return s
-    
-pas = patch $ makeTokenParser pascalLanguageDef
-    where
-    patch tp = tp {stringLiteral = sl}
-    sl = do
-        (char '\'')
-        s <- (many $ noneOf "'")
-        (char '\'')
-        ss <- many $ do
-            (char '\'')
-            s' <- (many $ noneOf "'")
-            (char '\'')
-            return $ '\'' : s'
-        comments    
-        return $ concat (s:ss)
-    
-comments = do
-    spaces
-    skipMany $ do
-        comment
-        spaces
+import PascalBasics
+import PascalUnitSyntaxTree
+
+knownTypes = ["shortstring", "ansistring", "char", "byte"]
 
 pascalUnit = do
     comments
-    u <- choice [program, unit]
+    u <- choice [program, unit, systemUnit, redoUnit]
     comments
     return u
 
-comment = choice [
-        char '{' >> manyTill anyChar (try $ char '}')
-        , (try $ string "(*") >> manyTill anyChar (try $ string "*)")
-        , (try $ string "//") >> manyTill anyChar (try newline)
-        ]
-
 iD = do
-    i <- liftM Identifier (identifier pas)
+    i <- liftM (flip Identifier BTUnknown) (identifier pas)
     comments
     return i
-        
+
 unit = do
     string "unit" >> comments
     name <- iD
@@ -164,41 +38,49 @@ unit = do
     comments
     return $ Unit name int impl Nothing Nothing
 
-    
+
 reference = buildExpressionParser table term <?> "reference"
     where
     term = comments >> choice [
-        parens pas (reference >>= postfixes) >>= postfixes
-        , char '@' >> reference >>= postfixes >>= return . Address
+        parens pas (liftM RefExpression expression >>= postfixes) >>= postfixes
+        , try $ typeCast >>= postfixes
+        , char '@' >> liftM Address reference >>= postfixes
         , liftM SimpleReference iD >>= postfixes 
         ] <?> "simple reference"
 
-    table = [ 
-            [Infix (try (char '.' >> notFollowedBy (char '.')) >> return RecordField) AssocLeft]
+    table = [
         ]
-    
-    postfixes r = many postfix >>= return . foldl fp r
+
+    postfixes r = many postfix >>= return . foldl (flip ($)) r
     postfix = choice [
             parens pas (option [] parameters) >>= return . FunCall
           , char '^' >> return Dereference
           , (brackets pas) (commaSep1 pas $ expression) >>= return . ArrayElement
+          , (char '.' >> notFollowedBy (char '.')) >> liftM (flip RecordField) reference
         ]
-    fp r f = f r
 
-    
-varsDecl1 = varsParser sepEndBy1    
+    typeCast = do
+        t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes
+        e <- parens pas expression
+        comments
+        return $ TypeCast (Identifier t BTUnknown) e
+
+varsDecl1 = varsParser sepEndBy1
 varsDecl = varsParser sepEndBy
 varsParser m endsWithSemi = do
     vs <- m (aVarDecl endsWithSemi) (semi pas)
     return vs
 
 aVarDecl endsWithSemi = do
-    when (not endsWithSemi) $
-        optional $ choice [
-            try $ string "var"
-            , try $ string "const"
-            , try $ string "out"
-            ]
+    isVar <- liftM (== Just "var") $
+        if not endsWithSemi then
+            optionMaybe $ choice [
+                try $ string "var"
+                , try $ string "const"
+                , try $ string "out"
+                ]
+            else
+                return Nothing
     comments
     ids <- do
         i <- (commaSep1 pas) $ (try iD <?> "variable declaration")
@@ -213,7 +95,7 @@ aVarDecl endsWithSemi = do
         e <- initExpression
         comments
         return (Just e)
-    return $ VarDeclaration False (ids, t) init
+    return $ VarDeclaration isVar False (ids, t) init
 
 
 constsDecl = do
@@ -223,47 +105,98 @@ constsDecl = do
     where
     aConstDecl = do
         comments
-        i <- iD <?> "const declaration"
-        optional $ do
+        i <- iD
+        t <- optionMaybe $ do
             char ':'
             comments
             t <- typeDecl
-            return ()
+            comments
+            return t
         char '='
         comments
         e <- initExpression
         comments
-        return $ VarDeclaration False ([i], UnknownType) (Just e)
-        
+        return $ VarDeclaration False (isNothing t) ([i], fromMaybe (DeriveType e) t) (Just e)
+
 typeDecl = choice [
     char '^' >> typeDecl >>= return . PointerTo
-    , try (string "shortstring") >> return String
+    , try (string "shortstring") >> return (String 255)
+    , try (string "string") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255
+    , try (string "ansistring") >> optionMaybe (brackets pas $ integer pas) >>= return . String . fromMaybe 255
     , arrayDecl
     , recordDecl
+    , setDecl
+    , functionType
     , sequenceDecl >>= return . Sequence
-    , try (identifier pas) >>= return . SimpleType . Identifier
+    , try iD >>= return . SimpleType
     , rangeDecl >>= return . RangeType
     ] <?> "type declaration"
     where
     arrayDecl = do
-        try $ string "array"
-        comments
-        char '['
-        r <- rangeDecl
-        char ']'
-        comments
+        try $ do
+            optional $ (try $ string "packed") >> comments
+            string "array"
+        comments
+        r <- option [] $ do
+            char '['
+            r <- commaSep pas rangeDecl
+            char ']'
+            comments
+            return r
         string "of"
         comments
         t <- typeDecl
-        return $ ArrayDecl r t
+        if null r then
+            return $ ArrayDecl Nothing t
+            else
+            return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) 
     recordDecl = do
-        optional $ (try $ string "packed") >> comments
-        try $ string "record"
+        try $ do
+            optional $ (try $ string "packed") >> comments
+            string "record"
         comments
         vs <- varsDecl True
+        union <- optionMaybe $ do
+            string "case"
+            comments
+            iD
+            comments
+            string "of"
+            comments
+            many unionCase
         string "end"
-        return $ RecordType vs
-    sequenceDecl = (parens pas) $ (commaSep pas) iD
+        return $ RecordType vs union
+    setDecl = do
+        try $ string "set" >> space
+        comments
+        string "of"
+        comments
+        liftM Set typeDecl
+    unionCase = do
+        try $ commaSep pas $ (iD >> return ()) <|> (integer pas >> return ())
+        char ':'
+        comments
+        u <- parens pas $ varsDecl True
+        char ';'
+        comments
+        return u
+    sequenceDecl = (parens pas) $ (commaSep pas) (iD >>= \i -> optional (spaces >> char '=' >> spaces >> integer pas) >> return i)
+    functionType = do
+        fp <- try (string "function") <|> try (string "procedure")
+        comments
+        vs <- option [] $ parens pas $ varsDecl False
+        comments
+        ret <- if (fp == "function") then do
+            char ':'
+            comments
+            ret <- typeDecl
+            comments
+            return ret
+            else
+            return VoidType
+        optional $ try $ char ';' >> comments >> string "cdecl"
+        comments
+        return $ FunctionType ret vs
 
 typesDecl = many (aTypeDecl >>= \t -> comments >> return t)
     where
@@ -279,7 +212,7 @@ typesDecl = many (aTypeDecl >>= \t -> comments >> return t)
         semi pas
         comments
         return $ TypeDeclaration i t
-        
+
 rangeDecl = choice [
     try $ rangeft
     , iD >>= return . Range
@@ -290,80 +223,97 @@ rangeDecl = choice [
     string ".."
     e2 <- initExpression
     return $ RangeFromTo e1 e2
-    
+
 typeVarDeclaration isImpl = (liftM concat . many . choice) [
     varSection,
     constSection,
     typeSection,
     funcDecl,
-    procDecl
+    operatorDecl
     ]
     where
     varSection = do
         try $ string "var"
         comments
-        v <- varsDecl1 True
+        v <- varsDecl1 True <?> "variable declaration"
         comments
         return v
 
     constSection = do
         try $ string "const"
         comments
-        c <- constsDecl
+        c <- constsDecl <?> "const declaration"
         comments
         return c
 
     typeSection = do
         try $ string "type"
         comments
-        t <- typesDecl
+        t <- typesDecl <?> "type declaration"
         comments
         return t
-        
-    procDecl = do
-        try $ string "procedure"
+
+    operatorDecl = do
+        try $ string "operator"
         comments
-        i <- iD
-        optional $ do
-            char '('
-            varsDecl False
-            char ')'
+        i <- manyTill anyChar space
+        comments
+        vs <- parens pas $ varsDecl False
+        comments
+        rid <- iD
+        comments
+        char ':'
+        comments
+        ret <- typeDecl
         comments
+        return ret
         char ';'
-        b <- if isImpl then
-                do
-                comments
-                optional $ typeVarDeclaration True
-                comments
+        comments
+        forward <- liftM isJust $ optionMaybe (try (string "forward;") >> comments)
+        inline <- liftM (any (== "inline;")) $ many functionDecorator
+        b <- if isImpl && (not forward) then
                 liftM Just functionBody
                 else
                 return Nothing
-        comments
-        return $ [FunctionDeclaration i UnknownType b]
-        
+        return $ [OperatorDeclaration i rid inline ret vs b]
+
+
     funcDecl = do
-        try $ string "function"
+        fp <- try (string "function") <|> try (string "procedure")
         comments
         i <- iD
-        optional $ do
-            char '('
-            varsDecl False
-            char ')'
-        comments
-        char ':'
-        comments
-        ret <- typeDecl
+        vs <- option [] $ parens pas $ varsDecl False
         comments
+        ret <- if (fp == "function") then do
+            char ':'
+            comments
+            ret <- typeDecl
+            comments
+            return ret
+            else
+            return VoidType
         char ';'
         comments
-        b <- if isImpl then
-                do
-                optional $ typeVarDeclaration True
-                comments
+        forward <- liftM isJust $ optionMaybe (try (string "forward;") >> comments)
+        inline <- liftM (any (== "inline;")) $ many functionDecorator
+        b <- if isImpl && (not forward) then
                 liftM Just functionBody
                 else
                 return Nothing
-        return $ [FunctionDeclaration i ret b]
+        return $ [FunctionDeclaration i inline ret vs b]
+
+    functionDecorator = do
+        d <- choice [
+            try $ string "inline;"
+            , try $ caseInsensitiveString "cdecl;"
+            , try $ string "overload;"
+            , try $ string "export;"
+            , try $ string "varargs;"
+            , try (string "external") >> comments >> iD >> optional (string "name" >> comments >> stringLiteral pas)>> string ";"
+            ]
+        comments
+        return d
+
 
 program = do
     string "program"
@@ -371,9 +321,16 @@ program = do
     name <- iD
     (char ';')
     comments
-    impl <- implementation
     comments
-    return $ Program name impl
+    u <- uses
+    comments
+    tv <- typeVarDeclaration True
+    comments
+    p <- phrase
+    comments
+    char '.'
+    comments
+    return $ Program name (Implementation u (TypesAndVars tv)) p
 
 interface = do
     string "interface"
@@ -394,55 +351,74 @@ implementation = do
     comments
     return $ Implementation u (TypesAndVars tv)
 
-expression = buildExpressionParser table term <?> "expression"
+expression = do
+    buildExpressionParser table term <?> "expression"
     where
     term = comments >> choice [
-        builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n))
-        , parens pas $ expression 
+        builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n BTUnknown))
+        , try (parens pas $ expression >>= \e -> notFollowedBy (comments >> char '.') >> return e)
+        , brackets pas (commaSep pas iD) >>= return . SetExpression
         , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . NumberLiteral . show) i
-        , try $ float pas >>= return . FloatLiteral . show
+        , float pas >>= return . FloatLiteral . show
         , try $ integer pas >>= return . NumberLiteral . show
-        , stringLiteral pas >>= return . StringLiteral
-        , char '#' >> many digit >>= return . CharCode
-        , char '$' >> many hexDigit >>= return . HexNumber
+        , try (string "_S" >> stringLiteral pas) >>= return . StringLiteral
+        , try (string "_P" >> stringLiteral pas) >>= return . PCharLiteral
+        , stringLiteral pas >>= return . strOrChar
+        , try (string "#$") >> many hexDigit >>= \c -> comments >> return (HexCharCode c)
+        , char '#' >> many digit >>= \c -> comments >> return (CharCode c)
+        , char '$' >> many hexDigit >>=  \h -> comments >> return (HexNumber h)
+        --, char '-' >> expression >>= return . PrefixOp "-"
+        , char '-' >> reference >>= return . PrefixOp "-" . Reference
+        , (try $ string "not" >> notFollowedBy comments) >> unexpected "'not'"
         , try $ string "nil" >> return Null
         , reference >>= return . Reference
         ] <?> "simple expression"
 
-    table = [ 
+    table = [
+          [  Prefix (try (string "not") >> return (PrefixOp "not"))
+           , Prefix (try (char '-') >> return (PrefixOp "-"))]
+        ,
           [  Infix (char '*' >> return (BinOp "*")) AssocLeft
            , Infix (char '/' >> return (BinOp "/")) AssocLeft
            , Infix (try (string "div") >> return (BinOp "div")) AssocLeft
            , Infix (try (string "mod") >> return (BinOp "mod")) AssocLeft
+           , Infix (try (string "in") >> return (BinOp "in")) AssocNone
+           , Infix (try $ string "and" >> return (BinOp "and")) AssocLeft
+           , Infix (try $ string "shl" >> return (BinOp "shl")) AssocLeft
+           , Infix (try $ string "shr" >> return (BinOp "shr")) AssocLeft
           ]
         , [  Infix (char '+' >> return (BinOp "+")) AssocLeft
            , Infix (char '-' >> return (BinOp "-")) AssocLeft
-           , Prefix (char '-' >> return (PrefixOp "-"))
+           , Infix (try $ string "or" >> return (BinOp "or")) AssocLeft
+           , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft
           ]
         , [  Infix (try (string "<>") >> return (BinOp "<>")) AssocNone
            , Infix (try (string "<=") >> return (BinOp "<=")) AssocNone
            , Infix (try (string ">=") >> return (BinOp ">=")) AssocNone
            , Infix (char '<' >> return (BinOp "<")) AssocNone
            , Infix (char '>' >> return (BinOp ">")) AssocNone
-           , Infix (char '=' >> return (BinOp "=")) AssocNone
           ]
-        , [  Infix (try $ string "and" >> return (BinOp "and")) AssocLeft
-           , Infix (try $ string "or" >> return (BinOp "or")) AssocLeft
-           , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft
+        {-, [  Infix (try $ string "shl" >> return (BinOp "shl")) AssocNone
+             , Infix (try $ string "shr" >> return (BinOp "shr")) AssocNone
           ]
-        , [  Infix (try $ string "shl" >> return (BinOp "shl")) AssocNone
-           , Infix (try $ string "shr" >> return (BinOp "shr")) AssocNone
+        , [ 
+             Infix (try $ string "or" >> return (BinOp "or")) AssocLeft
+           , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft
+          ]-}
+        , [
+             Infix (char '=' >> return (BinOp "=")) AssocNone
           ]
-        , [Prefix (try (string "not") >> return (PrefixOp "not"))]
         ]
-    
+    strOrChar [a] = CharCode . show . ord $ a
+    strOrChar a = StringLiteral a
+
 phrasesBlock = do
     try $ string "begin"
     comments
-    p <- manyTill phrase (try $ string "end")
+    p <- manyTill phrase (try $ string "end" >> notFollowedBy alphaNum)
     comments
     return $ Phrases p
-    
+
 phrase = do
     o <- choice [
         phrasesBlock
@@ -452,15 +428,17 @@ phrase = do
         , switchCase
         , withBlock
         , forCycle
-        , (try $ reference >>= \r -> string ":=" >> return r) >>= \r -> expression >>= return . Assignment r
+        , (try $ reference >>= \r -> string ":=" >> return r) >>= \r -> comments >> expression >>= return . Assignment r
+        , builtInFunction expression >>= \(n, e) -> return $ BuiltInFunctionCall e (SimpleReference (Identifier n BTUnknown))
         , procCall
+        , char ';' >> comments >> return NOP
         ]
     optional $ char ';'
     comments
     return o
 
 ifBlock = do
-    try $ string "if"
+    try $ string "if" >> notFollowedBy (alphaNum <|> char '_')
     comments
     e <- expression
     comments
@@ -469,9 +447,9 @@ ifBlock = do
     o1 <- phrase
     comments
     o2 <- optionMaybe $ do
-        try $ string "else"
+        try $ string "else" >> space
         comments
-        o <- phrase
+        o <- option NOP phrase
         comments
         return o
     return $ IfThenElse e o1 o2
@@ -487,7 +465,7 @@ whileCycle = do
     return $ WhileCycle e o
 
 withBlock = do
-    try $ string "with"
+    try $ string "with" >> space
     comments
     rs <- (commaSep1 pas) reference
     comments
@@ -495,9 +473,9 @@ withBlock = do
     comments
     o <- phrase
     return $ foldr WithBlock o rs
-    
+
 repeatCycle = do
-    try $ string "repeat"
+    try $ string "repeat" >> space
     comments
     o <- many phrase
     string "until"
@@ -507,7 +485,7 @@ repeatCycle = do
     return $ RepeatCycle e o
 
 forCycle = do
-    try $ string "for"
+    try $ string "for" >> space
     comments
     i <- iD
     comments
@@ -515,7 +493,12 @@ forCycle = do
     comments
     e1 <- expression
     comments
-    choice [string "to", string "downto"]
+    up <- liftM (== Just "to") $
+            optionMaybe $ choice [
+                try $ string "to"
+                , try $ string "downto"
+                ]   
+    --choice [string "to", string "downto"]
     comments
     e2 <- expression
     comments
@@ -523,8 +506,8 @@ forCycle = do
     comments
     p <- phrase
     comments
-    return $ ForCycle i e1 e2 p
-    
+    return $ ForCycle i e1 e2 p up
+
 switchCase = do
     try $ string "case"
     comments
@@ -534,35 +517,38 @@ switchCase = do
     comments
     cs <- many1 aCase
     o2 <- optionMaybe $ do
-        try $ string "else"
+        try $ string "else" >> notFollowedBy alphaNum
         comments
-        o <- phrase
+        o <- many phrase
         comments
         return o
     string "end"
+    comments
     return $ SwitchCase e cs o2
     where
     aCase = do
-        e <- expression
+        e <- (commaSep pas) $ (liftM InitRange rangeDecl <|> initExpression)
         comments
         char ':'
         comments
         p <- phrase
         comments
         return (e, p)
-    
+
 procCall = do
-    i <- iD
+    r <- reference
     p <- option [] $ (parens pas) parameters
-    return $ ProcCall i p
+    return $ ProcCall r p
 
 parameters = (commaSep pas) expression <?> "parameters"
-        
+
 functionBody = do
+    tv <- typeVarDeclaration True
+    comments
     p <- phrasesBlock
     char ';'
     comments
-    return p
+    return (TypesAndVars tv, p)
 
 uses = liftM Uses (option [] u)
     where
@@ -578,19 +564,22 @@ initExpression = buildExpressionParser table term <?> "initialization expression
     where
     term = comments >> choice [
         liftM (uncurry BuiltInFunction) $ builtInFunction initExpression 
-        , try $ brackets pas (commaSep pas $ iD) >>= return . InitSet
-        , try $ parens pas (commaSep pas $ initExpression) >>= return . InitArray
-        , parens pas (semiSep pas $ recField) >>= return . InitRecord
+        , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet
+        , try $ parens pas (commaSep pas $ initExpression) >>= \ia -> when (null $ tail ia) mzero >> return (InitArray ia)
+        , try $ parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord
+        , parens pas initExpression
         , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . InitNumber . show) i
         , try $ float pas >>= return . InitFloat . show
         , try $ integer pas >>= return . InitNumber . show
         , stringLiteral pas >>= return . InitString
-        , char '#' >> many digit >>= return . InitChar
-        , char '$' >> many hexDigit >>= return . InitHexNumber
+        , char '#' >> many digit >>= \c -> comments >> return (InitChar c)
+        , char '$' >> many hexDigit >>= \h -> comments >> return (InitHexNumber h)
+        , char '@' >> initExpression >>= \c -> comments >> return (InitAddress c)
         , try $ string "nil" >> return InitNull
+        , itypeCast
         , iD >>= return . InitReference
         ]
-        
+
     recField = do
         i <- iD
         spaces
@@ -600,15 +589,23 @@ initExpression = buildExpressionParser table term <?> "initialization expression
         spaces
         return (i ,e)
 
-    table = [ 
-          [  Infix (char '*' >> return (InitBinOp "*")) AssocLeft
+    table = [
+          [
+             Prefix (char '-' >> return (InitPrefixOp "-"))
+            ,Prefix (try (string "not") >> return (InitPrefixOp "not"))
+          ]
+        , [  Infix (char '*' >> return (InitBinOp "*")) AssocLeft
            , Infix (char '/' >> return (InitBinOp "/")) AssocLeft
            , Infix (try (string "div") >> return (InitBinOp "div")) AssocLeft
            , Infix (try (string "mod") >> return (InitBinOp "mod")) AssocLeft
+           , Infix (try $ string "and" >> return (InitBinOp "and")) AssocLeft
+           , Infix (try $ string "shl" >> return (InitBinOp "shl")) AssocNone
+           , Infix (try $ string "shr" >> return (InitBinOp "shr")) AssocNone
           ]
         , [  Infix (char '+' >> return (InitBinOp "+")) AssocLeft
            , Infix (char '-' >> return (InitBinOp "-")) AssocLeft
-           , Prefix (char '-' >> return (InitPrefixOp "-"))
+           , Infix (try $ string "or" >> return (InitBinOp "or")) AssocLeft
+           , Infix (try $ string "xor" >> return (InitBinOp "xor")) AssocLeft
           ]
         , [  Infix (try (string "<>") >> return (InitBinOp "<>")) AssocNone
            , Infix (try (string "<=") >> return (InitBinOp "<=")) AssocNone
@@ -617,19 +614,46 @@ initExpression = buildExpressionParser table term <?> "initialization expression
            , Infix (char '>' >> return (InitBinOp ">")) AssocNone
            , Infix (char '=' >> return (InitBinOp "=")) AssocNone
           ]
-        , [  Infix (try $ string "and" >> return (InitBinOp "and")) AssocLeft
+        {--, [  Infix (try $ string "and" >> return (InitBinOp "and")) AssocLeft
            , Infix (try $ string "or" >> return (InitBinOp "or")) AssocLeft
            , Infix (try $ string "xor" >> return (InitBinOp "xor")) AssocLeft
           ]
-        , [  Infix (try $ string "shl" >> return (InitBinOp "and")) AssocNone
-           , Infix (try $ string "shr" >> return (InitBinOp "or")) AssocNone
-          ]
-        , [Prefix (try (string "not") >> return (InitPrefixOp "not"))]
+        , [  Infix (try $ string "shl" >> return (InitBinOp "shl")) AssocNone
+           , Infix (try $ string "shr" >> return (InitBinOp "shr")) AssocNone
+          ]--}
+        --, [Prefix (try (string "not") >> return (InitPrefixOp "not"))]
         ]
 
+    itypeCast = do
+        t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes
+        i <- parens pas initExpression
+        comments
+        return $ InitTypeCast (Identifier t BTUnknown) i
+
 builtInFunction e = do
     name <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) builtin
     spaces
-    exprs <- parens pas $ commaSep1 pas $ e
+    exprs <- option [] $ parens pas $ option [] $ commaSep1 pas $ e
     spaces
     return (name, exprs)
+
+systemUnit = do
+    string "system;"
+    comments
+    string "type"
+    comments
+    t <- typesDecl
+    string "var"
+    v <- varsDecl True
+    return $ System (t ++ v)
+
+redoUnit = do
+    string "redo;"
+    comments
+    string "type"
+    comments
+    t <- typesDecl
+    string "var"
+    v <- varsDecl True
+    return $ Redo (t ++ v)
+
diff --git a/tools/PascalPreprocessor.hs b/tools/PascalPreprocessor.hs
new file mode 100644
index 0000000..8c98980
--- /dev/null
+++ b/tools/PascalPreprocessor.hs
@@ -0,0 +1,135 @@
+module PascalPreprocessor where
+
+import Text.Parsec
+import Control.Monad.IO.Class
+import Control.Monad
+import System.IO
+import qualified Data.Map as Map
+import Data.Char
+
+
+-- comments are removed
+comment = choice [
+        char '{' >> notFollowedBy (char '$') >> manyTill anyChar (try $ char '}') >> return ""
+        , (try $ string "(*") >> manyTill anyChar (try $ string "*)") >> return ""
+        , (try $ string "//") >> manyTill anyChar (try newline) >> return "\n"
+        ]
+
+initDefines = Map.fromList [
+    ("FPC", "")
+    , ("PAS2C", "")
+    , ("ENDIAN_LITTLE", "")
+    , ("S3D_DISABLED", "")
+    ]
+
+preprocess :: String -> IO String
+preprocess fn = do
+    r <- runParserT (preprocessFile fn) (initDefines, [True]) "" ""
+    case r of
+         (Left a) -> do
+             hPutStrLn stderr (show a)
+             return ""
+         (Right a) -> return a
+
+    where
+    preprocessFile fn = do
+        f <- liftIO (readFile fn)
+        setInput f
+        preprocessor
+
+    preprocessor, codeBlock, switch :: ParsecT String (Map.Map String String, [Bool]) IO String
+
+    preprocessor = chainr codeBlock (return (++)) ""
+
+    codeBlock = do
+        s <- choice [
+            switch
+            , comment
+            , char '\'' >> many (noneOf "'\n") >>= \s -> char '\'' >> return ('\'' : s ++ "'")
+            , identifier >>= replace
+            , noneOf "{" >>= \a -> return [a]
+            ]
+        (_, ok) <- getState
+        return $ if and ok then s else ""
+
+    --otherChar c = c `notElem` "{/('_" && not (isAlphaNum c)
+    identifier = do
+        c <- letter <|> oneOf "_"
+        s <- many (alphaNum <|> oneOf "_")
+        return $ c:s
+
+    switch = do
+        try $ string "{$"
+        s <- choice [
+            include
+            , ifdef
+            , if'
+            , elseSwitch
+            , endIf
+            , define
+            , unknown
+            ]
+        return s
+
+    include = do
+        try $ string "INCLUDE"
+        spaces
+        (char '"')
+        fn <- many1 $ noneOf "\"\n"
+        char '"'
+        spaces
+        char '}'
+        f <- liftIO (readFile fn `catch` error ("File not found: " ++ fn))
+        c <- getInput
+        setInput $ f ++ c
+        return ""
+
+    ifdef = do
+        s <- try (string "IFDEF") <|> try (string "IFNDEF")
+        let f = if s == "IFNDEF" then not else id
+
+        spaces
+        d <- identifier
+        spaces
+        char '}'
+
+        updateState $ \(m, b) ->
+            (m, (f $ d `Map.member` m) : b)
+
+        return ""
+
+    if' = do
+        s <- try (string "IF" >> notFollowedBy alphaNum)
+
+        manyTill anyChar (char '}')
+        --char '}'
+
+        updateState $ \(m, b) ->
+            (m, False : b)
+
+        return ""
+
+    elseSwitch = do
+        try $ string "ELSE}"
+        updateState $ \(m, b:bs) -> (m, (not b):bs)
+        return ""
+    endIf = do
+        try $ string "ENDIF}"
+        updateState $ \(m, b:bs) -> (m, bs)
+        return ""
+    define = do
+        try $ string "DEFINE"
+        spaces
+        i <- identifier
+        d <- ((string ":=" >> return ()) <|> spaces) >> many (noneOf "}")
+        char '}'
+        updateState $ \(m, b) -> (if (and b) && (head i /= '_') then Map.insert i d m else m, b)
+        return ""
+    replace s = do
+        (m, _) <- getState
+        return $ Map.findWithDefault s s m
+
+    unknown = do
+        fn <- many1 $ noneOf "}\n"
+        char '}'
+        return $ "{$" ++ fn ++ "}"
diff --git a/tools/PascalUnitSyntaxTree.hs b/tools/PascalUnitSyntaxTree.hs
new file mode 100644
index 0000000..8123e6a
--- /dev/null
+++ b/tools/PascalUnitSyntaxTree.hs
@@ -0,0 +1,119 @@
+module PascalUnitSyntaxTree where
+
+import Data.Maybe
+import Data.Char
+
+data PascalUnit =
+    Program Identifier Implementation Phrase
+    | Unit Identifier Interface Implementation (Maybe Initialize) (Maybe Finalize)
+    | System [TypeVarDeclaration]
+    | Redo [TypeVarDeclaration]
+    deriving Show
+data Interface = Interface Uses TypesAndVars
+    deriving Show
+data Implementation = Implementation Uses TypesAndVars
+    deriving Show
+data Identifier = Identifier String BaseType
+    deriving Show
+data TypesAndVars = TypesAndVars [TypeVarDeclaration]
+    deriving Show
+data TypeVarDeclaration = TypeDeclaration Identifier TypeDecl
+    | VarDeclaration Bool Bool ([Identifier], TypeDecl) (Maybe InitExpression)
+    | FunctionDeclaration Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
+    | OperatorDeclaration String Identifier Bool TypeDecl [TypeVarDeclaration] (Maybe (TypesAndVars, Phrase))
+    deriving Show
+data TypeDecl = SimpleType Identifier
+    | RangeType Range
+    | Sequence [Identifier]
+    | ArrayDecl (Maybe Range) TypeDecl
+    | RecordType [TypeVarDeclaration] (Maybe [[TypeVarDeclaration]])
+    | PointerTo TypeDecl
+    | String Integer
+    | Set TypeDecl
+    | FunctionType TypeDecl [TypeVarDeclaration]
+    | DeriveType InitExpression
+    | VoidType
+    | VarParamType TypeDecl -- this is a hack
+    deriving Show
+data Range = Range Identifier
+           | RangeFromTo InitExpression InitExpression
+           | RangeInfinite
+    deriving Show
+data Initialize = Initialize String
+    deriving Show
+data Finalize = Finalize String
+    deriving Show
+data Uses = Uses [Identifier]
+    deriving Show
+data Phrase = ProcCall Reference [Expression]
+        | IfThenElse Expression Phrase (Maybe Phrase)
+        | WhileCycle Expression Phrase
+        | RepeatCycle Expression [Phrase]
+        | ForCycle Identifier Expression Expression Phrase Bool -- The last Boolean indicates wether it's up or down counting
+        | WithBlock Reference Phrase
+        | Phrases [Phrase]
+        | SwitchCase Expression [([InitExpression], Phrase)] (Maybe [Phrase])
+        | Assignment Reference Expression
+        | BuiltInFunctionCall [Expression] Reference
+        | NOP
+    deriving Show
+data Expression = Expression String
+    | BuiltInFunCall [Expression] Reference
+    | PrefixOp String Expression
+    | PostfixOp String Expression
+    | BinOp String Expression Expression
+    | StringLiteral String
+    | PCharLiteral String
+    | CharCode String
+    | HexCharCode String
+    | NumberLiteral String
+    | FloatLiteral String
+    | HexNumber String
+    | Reference Reference
+    | SetExpression [Identifier]
+    | Null
+    deriving Show
+data Reference = ArrayElement [Expression] Reference
+    | FunCall [Expression] Reference
+    | TypeCast Identifier Expression
+    | SimpleReference Identifier
+    | Dereference Reference
+    | RecordField Reference Reference
+    | Address Reference
+    | RefExpression Expression
+    deriving Show
+data InitExpression = InitBinOp String InitExpression InitExpression
+    | InitPrefixOp String InitExpression
+    | InitReference Identifier
+    | InitArray [InitExpression]
+    | InitRecord [(Identifier, InitExpression)]
+    | InitFloat String
+    | InitNumber String
+    | InitHexNumber String
+    | InitString String
+    | InitChar String
+    | BuiltInFunction String [InitExpression]
+    | InitSet [InitExpression]
+    | InitAddress InitExpression
+    | InitNull
+    | InitRange Range
+    | InitTypeCast Identifier InitExpression
+    deriving Show
+
+data BaseType = BTUnknown
+    | BTChar
+    | BTString
+    | BTInt
+    | BTBool
+    | BTFloat
+    | BTRecord String [(String, BaseType)]
+    | BTArray Range BaseType BaseType
+    | BTFunction Bool Int BaseType
+    | BTPointerTo BaseType
+    | BTUnresolved String
+    | BTSet BaseType
+    | BTEnum [String]
+    | BTVoid
+    | BTUnit
+    | BTVarParam BaseType
+    deriving Show
diff --git a/tools/build_windows.bat b/tools/build_windows.bat
new file mode 100644
index 0000000..59f6d26
--- /dev/null
+++ b/tools/build_windows.bat
@@ -0,0 +1,63 @@
+ at echo off
+::edit these variables if you need
+set PASCAL=C:\FPC\2.4.4\bin\i386-win32\
+set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
+set PATH=%PATH%;%PASCAL%
+set BUILD_TYPE="Debug"
+
+:setup
+set CURRDIR="%CD%"
+cd ..
+
+echo Fetching all DLLs...
+if %BUILD_TYPE%=="Debug" (
+    for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
+)
+for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do (
+    xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
+)
+
+if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\
+if not exist %CD%\misc\winutils\bin\SDL.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/release/SDL-1.2.15-win32.zip %CD%\misc\winutils\bin
+if not exist %CD%\misc\winutils\bin\SDL_image.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip %CD%\misc\winutils\bin
+if not exist %CD%\misc\winutils\bin\SDL_net.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8-win32.zip %CD%\misc\winutils\bin
+if not exist %CD%\misc\winutils\bin\SDL_mixer.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12-win32.zip %CD%\misc\winutils\bin
+if not exist %CD%\misc\winutils\bin\SDL_ttf.dll cscript %CD%\tools\w32DownloadUnzip.vbs  http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11-win32.zip %CD%\misc\winutils\bin
+
+::for video recording
+if not exist %CD%\misc\winutils\bin\avformat-54.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://hedgewars.googlecode.com/files/libav-win32-20121022-dll.zip %CD%\misc\winutils\bin
+if not exist %CD%\misc\winutils\bin\glut32.dll cscript %CD%\tools\w32DownloadUnzip.vbs https://user.xmission.com/~nate/glut/glut-3.7.6-bin.zip %CD%\misc\winutils\bin
+copy /y %CD%\misc\winutils\bin\glut-3.7.6-bin\glut32.dll %CD%\misc\winutils\bin\glut32.dll
+
+::this is needed because fpc png unit hardcodes libpng-1.2.12
+if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll
+
+xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\
+
+::setting up the environment...
+call %QTDIR%\qtenv2.bat
+
+echo Running cmake...
+set ERRORLEVEL=
+cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\misc\winutils\lib" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" . -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
+
+if %ERRORLEVEL% NEQ 0 goto exitpoint
+
+echo Running make...
+set ERRORLEVEL=
+mingw32-make
+if %ERRORLEVEL% NEQ 0 goto exitpoint
+
+echo Installing...
+set ERRORLEVEL=
+mingw32-make install > nul
+if %ERRORLEVEL% NEQ 0 goto exitpoint
+
+echo Creating commodity shortcut...
+copy /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
+
+echo ALL DONE, Hedgewars has been successfully compiled and installed
+
+:exitpoint
+cd %CURRDIR%
+pause
diff --git a/tools/cmake_uninstall.cmake b/tools/cmake_uninstall.cmake
index 4364c22..824df61 100644
--- a/tools/cmake_uninstall.cmake
+++ b/tools/cmake_uninstall.cmake
@@ -1,14 +1,14 @@
-IF(NOT EXISTS "/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-Clone/tools/../install_manifest.txt")
-  MESSAGE(FATAL_ERROR "Cannot find install manifest: \"/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-Clone/tools/../install_manifest.txt\"")
-ENDIF(NOT EXISTS "/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-Clone/tools/../install_manifest.txt")
+IF(NOT EXISTS "/home/nemo/hg/hedgewars/0.9.18/tools/../install_manifest.txt")
+  MESSAGE(FATAL_ERROR "Cannot find install manifest: \"/home/nemo/hg/hedgewars/0.9.18/tools/../install_manifest.txt\"")
+ENDIF(NOT EXISTS "/home/nemo/hg/hedgewars/0.9.18/tools/../install_manifest.txt")
 
-FILE(READ "/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-Clone/tools/../install_manifest.txt" files)
+FILE(READ "/home/nemo/hg/hedgewars/0.9.18/tools/../install_manifest.txt" files)
 STRING(REGEX REPLACE "\n" ";" files "${files}")
 FOREACH(file ${files})
   MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
   IF(EXISTS "$ENV{DESTDIR}${file}")
     EXEC_PROGRAM(
-      "/usr/local/bin/cmake" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      "/usr/bin/cmake" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
       OUTPUT_VARIABLE rm_out
       RETURN_VALUE rm_retval
       )
diff --git a/tools/pas2c.hs b/tools/pas2c.hs
index 5c409c6..981ab9d 100644
--- a/tools/pas2c.hs
+++ b/tools/pas2c.hs
@@ -1,141 +1,1086 @@
+{-# LANGUAGE ScopedTypeVariables #-}
 module Pas2C where
 
-import PascalParser
 import Text.PrettyPrint.HughesPJ
 import Data.Maybe
 import Data.Char
-import Text.Parsec.String
-
-
-pas2C :: String -> IO String
-pas2C fileName = do
-    ptree <- parseFromFile pascalUnit fileName
-    case ptree of
-         (Left a) -> return (show a)
-         (Right a) -> (return . render . pascal2C) a
-
-pascal2C :: PascalUnit -> Doc
-pascal2C (Unit unitName interface implementation init fin) = 
-    interface2C interface
-    $+$ 
-    implementation2C implementation
-
-interface2C :: Interface -> Doc
-interface2C (Interface uses tvars) = typesAndVars2C tvars
-
-implementation2C :: Implementation -> Doc
-implementation2C (Implementation uses tvars) = typesAndVars2C tvars
-
-
-typesAndVars2C :: TypesAndVars -> Doc
-typesAndVars2C (TypesAndVars ts) = vcat $ map tvar2C ts
-
-
-tvar2C :: TypeVarDeclaration -> Doc
-tvar2C (FunctionDeclaration (Identifier name) returnType Nothing) = 
-    type2C returnType <+> text (name ++ "();")
-tvar2C (FunctionDeclaration (Identifier name) returnType (Just phrase)) = 
-    type2C returnType <+> text (name ++ "()") 
-    $$
-    phrase2C phrase
-tvar2C (TypeDeclaration (Identifier i) t) = text "type" <+> text i <+> type2C t <> text ";"
-tvar2C (VarDeclaration isConst (ids, t) mInitExpr) = 
-    if isConst then text "const" else empty
-    <+>
-    type2C t
-    <+>
-    (hsep . punctuate (char ',') . map (\(Identifier i) -> text i) $ ids)
-    <+>
-    initExpr mInitExpr
-    <>
-    text ";"
-    where
-    initExpr Nothing = empty
-    initExpr (Just e) = text "=" <+> initExpr2C e
-
-initExpr2C :: InitExpression -> Doc
-initExpr2C (InitBinOp op expr1 expr2) = parens $ (initExpr2C expr1) <+> op2C op <+> (initExpr2C expr2)
-initExpr2C (InitNumber s) = text s
-initExpr2C (InitFloat s) = text s
-initExpr2C (InitHexNumber s) = text "0x" <> (text . map toLower $ s)
-initExpr2C (InitString s) = doubleQuotes $ text s 
-initExpr2C (InitReference (Identifier i)) = text i
-
-
-initExpr2C _ = text "<<expression>>"
-
-type2C :: TypeDecl -> Doc
-type2C UnknownType = text "void"
-type2C String = text "string"
-type2C (SimpleType (Identifier i)) = text i
-type2C (PointerTo t) = type2C t <> text "*"
-type2C (RecordType tvs) = text "{" $+$ (nest 4 . vcat . map tvar2C $ tvs) $+$ text "}"
-type2C (RangeType r) = text "<<range type>>"
-type2C (Sequence ids) = text "<<sequence type>>"
-type2C (ArrayDecl r t) = text "<<array type>>"
-
-
-phrase2C :: Phrase -> Doc
-phrase2C (Phrases p) = text "{" $+$ (nest 4 . vcat . map phrase2C $ p) $+$ text "}"
-phrase2C (ProcCall (Identifier name) params) = text name <> parens (hsep . punctuate (char ',') . map expr2C $ params) <> semi
-phrase2C (IfThenElse (expr) phrase1 mphrase2) = text "if" <> parens (expr2C expr) $+$ (phrase2C . wrapPhrase) phrase1 $+$ elsePart
-    where
-    elsePart | isNothing mphrase2 = empty
-             | otherwise = text "else" $$ (phrase2C . wrapPhrase) (fromJust mphrase2)
-phrase2C (Assignment ref expr) = ref2C ref <> text " = " <> expr2C expr <> semi
-phrase2C (WhileCycle expr phrase) = text "while" <> parens (expr2C expr) $$ (phrase2C $ wrapPhrase phrase)
-phrase2C (SwitchCase expr cases mphrase) = text "switch" <> parens (expr2C expr) <> text "of" $+$ (nest 4 . vcat . map case2C) cases
-    where
-    case2C :: (Expression, Phrase) -> Doc
-    case2C (e, p) = text "case" <+> parens (expr2C e) <> char ':' <> nest 4 (phrase2C p $+$ text "break;")
-phrase2C (WithBlock ref p) = text "namespace" <> parens (ref2C ref) $$ (phrase2C $ wrapPhrase p)
-phrase2C (ForCycle (Identifier i) e1 e2 p) = 
-    text "for" <> (parens . hsep . punctuate (char ';') $ [text i <+> text "=" <+> expr2C e1, text i <+> text "<=" <+> expr2C e2, text "++" <> text i])
-    $$
-    phrase2C (wrapPhrase p)
-phrase2C (RepeatCycle e p) = text "do" <+> phrase2C (Phrases p) <+> text "while" <> parens (text "!" <> parens (expr2C e))
+import Text.Parsec.Prim hiding (State)
+import Control.Monad.State
+import System.IO
+import System.Directory
+import Control.Monad.IO.Class
+import PascalPreprocessor
+import Control.Exception
+import System.IO.Error
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import Data.List (find)
+import Numeric
 
+import PascalParser(pascalUnit)
+import PascalUnitSyntaxTree
+
+
+data InsertOption =
+    IOInsert
+    | IOInsertWithType Doc
+    | IOLookup
+    | IOLookupLast
+    | IOLookupFunction Int
+    | IODeferred
+
+data Record = Record
+    {
+        lcaseId :: String,
+        baseType :: BaseType,
+        typeDecl :: Doc
+    }
+    deriving Show
+type Records = Map.Map String [Record]
+data RenderState = RenderState
+    {
+        currentScope :: Records,
+        lastIdentifier :: String,
+        lastType :: BaseType,
+        lastIdTypeDecl :: Doc,
+        stringConsts :: [(String, String)],
+        uniqCounter :: Int,
+        toMangle :: Set.Set String,
+        currentUnit :: String,
+        currentFunctionResult :: String,
+        namespaces :: Map.Map String Records
+    }
+
+rec2Records = map (\(a, b) -> Record a b empty)
+
+emptyState = RenderState Map.empty "" BTUnknown empty [] 0 Set.empty "" ""
+
+getUniq :: State RenderState Int
+getUniq = do
+    i <- gets uniqCounter
+    modify(\s -> s{uniqCounter = uniqCounter s + 1})
+    return i
+
+addStringConst :: String -> State RenderState Doc
+addStringConst str = do
+    strs <- gets stringConsts
+    let a = find ((==) str . snd) strs
+    if isJust a then
+        do
+        modify (\s -> s{lastType = BTString})
+        return . text . fst . fromJust $ a
+    else
+        do
+        i <- getUniq
+        let sn = "__str" ++ show i
+        modify (\s -> s{lastType = BTString, stringConsts = (sn, str) : strs})
+        return $ text sn
+
+escapeStr :: String -> String
+escapeStr = foldr escapeChar []
+
+escapeChar :: Char -> ShowS
+escapeChar '"' s = "\\\"" ++ s
+escapeChar '\\' s = "\\\\" ++ s
+escapeChar a s = a : s
+
+strInit :: String -> Doc
+strInit a = text "STRINIT" <> parens (doubleQuotes (text $ escapeStr a))
+
+renderStringConsts :: State RenderState Doc
+renderStringConsts = liftM (vcat . map (\(a, b) -> text "static const string255" <+> (text a) <+> text "=" <+> strInit b <> semi))
+    $ gets stringConsts
+
+docToLower :: Doc -> Doc
+docToLower = text . map toLower . render
+
+pas2C :: String -> IO ()
+pas2C fn = do
+    setCurrentDirectory "../hedgewars/"
+    s <- flip execStateT initState $ f fn
+    renderCFiles s
+    where
+    printLn = liftIO . hPutStrLn stdout
+    print = liftIO . hPutStr stdout
+    initState = Map.empty
+    f :: String -> StateT (Map.Map String PascalUnit) IO ()
+    f fileName = do
+        processed <- gets $ Map.member fileName
+        unless processed $ do
+            print ("Preprocessing '" ++ fileName ++ ".pas'... ")
+            fc' <- liftIO
+                $ tryJust (guard . isDoesNotExistError)
+                $ preprocess (fileName ++ ".pas")
+            case fc' of
+                (Left a) -> do
+                    modify (Map.insert fileName (System []))
+                    printLn "doesn't exist"
+                (Right fc) -> do
+                    print "ok, parsing... "
+                    let ptree = parse pascalUnit fileName fc
+                    case ptree of
+                         (Left a) -> do
+                            liftIO $ writeFile "preprocess.out" fc
+                            printLn $ show a ++ "\nsee preprocess.out for preprocessed source"
+                            fail "stop"
+                         (Right a) -> do
+                            printLn "ok"
+                            modify (Map.insert fileName a)
+                            mapM_ f (usesFiles a)
+
+
+renderCFiles :: Map.Map String PascalUnit -> IO ()
+renderCFiles units = do
+    let u = Map.toList units
+    let nss = Map.map (toNamespace nss) units
+    --hPutStrLn stderr $ "Units: " ++ (show . Map.keys . Map.filter (not . Map.null) $ nss)
+    --writeFile "pas2c.log" $ unlines . map (\t -> show (fst t) ++ "\n" ++ (unlines . map ((:) '\t' . show) . snd $ t)) . Map.toList $ nss
+    mapM_ (toCFiles nss) u
+    where
+    toNamespace :: Map.Map String Records -> PascalUnit -> Records
+    toNamespace nss (System tvs) =
+        currentScope $ execState f (emptyState nss)
+        where
+        f = do
+            checkDuplicateFunDecls tvs
+            mapM_ (tvar2C True False True False) tvs
+    toNamespace nss (Redo tvs) = -- functions that are re-implemented, add prefix to all of them
+        currentScope $ execState f (emptyState nss){currentUnit = "fpcrtl_"}
+        where
+        f = do
+            checkDuplicateFunDecls tvs
+            mapM_ (tvar2C True False True False) tvs
+    toNamespace _ (Program {}) = Map.empty
+    toNamespace nss (Unit (Identifier i _) interface _ _ _) =
+        currentScope $ execState (interface2C interface True) (emptyState nss){currentUnit = map toLower i ++ "_"}
+
+
+withState' :: (RenderState -> RenderState) -> State RenderState a -> State RenderState a
+withState' f sf = do
+    st <- liftM f get
+    let (a, s) = runState sf st
+    modify(\st -> st{
+        lastType = lastType s
+        , uniqCounter = uniqCounter s
+        , stringConsts = stringConsts s
+        })
+    return a
+
+withLastIdNamespace f = do
+    li <- gets lastIdentifier
+    nss <- gets namespaces
+    withState' (\st -> st{currentScope = fromMaybe Map.empty $ Map.lookup li (namespaces st)}) f
+
+withRecordNamespace :: String -> [Record] -> State RenderState Doc -> State RenderState Doc
+withRecordNamespace _ [] = error "withRecordNamespace: empty record"
+withRecordNamespace prefix recs = withState' f
+    where
+        f st = st{currentScope = Map.unionWith un records (currentScope st), currentUnit = ""}
+        records = Map.fromList $ map (\(Record a b d) -> (map toLower a, [Record (prefix ++ a) b d])) recs
+        un [a] b = a : b
+
+toCFiles :: Map.Map String Records -> (String, PascalUnit) -> IO ()
+toCFiles _ (_, System _) = return ()
+toCFiles _ (_, Redo _) = return ()
+toCFiles ns p@(fn, pu) = do
+    hPutStrLn stdout $ "Rendering '" ++ fn ++ "'..."
+    toCFiles' p
+    where
+    toCFiles' (fn, p@(Program {})) = writeFile (fn ++ ".c") $ "#include \"fpcrtl.h\"\n" ++ (render2C initialState . pascal2C) p
+    toCFiles' (fn, (Unit unitId@(Identifier i _) interface implementation _ _)) = do
+        let (a, s) = runState (id2C IOInsert (setBaseType BTUnit unitId) >> interface2C interface True) initialState{currentUnit = map toLower i ++ "_"}
+            (a', s') = runState (id2C IOInsert (setBaseType BTUnit unitId) >> interface2C interface False) initialState{currentUnit = map toLower i ++ "_"}
+        writeFile (fn ++ ".h") $ "#pragma once\n\n#include \"pas2c.h\"\n\n" ++ (render (a $+$ text ""))
+        writeFile (fn ++ ".c") $ "#include \"fpcrtl.h\"\n\n#include \"" ++ fn ++ ".h\"\n" ++ render (a' $+$ text "") ++ (render2C s . implementation2C) implementation
+    initialState = emptyState ns
+
+    render2C :: RenderState -> State RenderState Doc -> String
+    render2C a = render . ($+$ empty) . flip evalState a
+
+
+usesFiles :: PascalUnit -> [String]
+usesFiles (Program _ (Implementation uses _) _) = ["pas2cSystem", "pas2cRedo"] ++ uses2List uses
+usesFiles (Unit _ (Interface uses1 _) (Implementation uses2 _) _ _) = ["pas2cSystem", "pas2cRedo"] ++ uses2List uses1 ++ uses2List uses2
+usesFiles (System {}) = []
+usesFiles (Redo {}) = []
+
+pascal2C :: PascalUnit -> State RenderState Doc
+pascal2C (Unit _ interface implementation init fin) =
+    liftM2 ($+$) (interface2C interface True) (implementation2C implementation)
+
+pascal2C (Program _ implementation mainFunction) = do
+    impl <- implementation2C implementation
+    [main] <- tvar2C True False True True (FunctionDeclaration (Identifier "main" BTInt) False (SimpleType $ Identifier "int" BTInt) [VarDeclaration False False ([Identifier "argc" BTInt], SimpleType (Identifier "Integer" BTInt)) Nothing, VarDeclaration False False ([Identifier "argv" BTUnknown], SimpleType (Identifier "PPChar" BTUnknown)) Nothing] (Just (TypesAndVars [], mainFunction)))
+    return $ impl $+$ main
+
+
+-- the second bool indicates whether do normal interface translation or generate variable declarations
+-- that will be inserted into implementation files
+interface2C :: Interface -> Bool -> State RenderState Doc
+interface2C (Interface uses tvars) True = do
+    u <- uses2C uses
+    tv <- typesAndVars2C True True True tvars
+    r <- renderStringConsts
+    return (u $+$ r $+$ tv)
+interface2C (Interface uses tvars) False = do
+    u <- uses2C uses
+    tv <- typesAndVars2C True False False tvars
+    r <- renderStringConsts
+    return tv
+
+implementation2C :: Implementation -> State RenderState Doc
+implementation2C (Implementation uses tvars) = do
+    u <- uses2C uses
+    tv <- typesAndVars2C True False True tvars
+    r <- renderStringConsts
+    return (u $+$ r $+$ tv)
+
+checkDuplicateFunDecls :: [TypeVarDeclaration] -> State RenderState ()
+checkDuplicateFunDecls tvs =
+    modify $ \s -> s{toMangle = Map.keysSet . Map.filter (> 1) . foldr ins initMap $ tvs}
+    where
+        initMap = Map.empty
+        --initMap = Map.fromList [("reset", 2)]
+        ins (FunctionDeclaration (Identifier i _) _ _ _ _) m = Map.insertWith (+) (map toLower i) 1 m
+        ins _ m = m
+
+-- the second bool indicates whether declare variable as extern or not
+-- the third bool indicates whether include types or not
+
+typesAndVars2C :: Bool -> Bool -> Bool -> TypesAndVars -> State RenderState Doc
+typesAndVars2C b externVar includeType(TypesAndVars ts) = do
+    checkDuplicateFunDecls ts
+    liftM (vcat . map (<> semi) . concat) $ mapM (tvar2C b externVar includeType False) ts
+
+setBaseType :: BaseType -> Identifier -> Identifier
+setBaseType bt (Identifier i _) = Identifier i bt
+
+uses2C :: Uses -> State RenderState Doc
+uses2C uses@(Uses unitIds) = do
+
+    mapM_ injectNamespace (Identifier "pas2cSystem" undefined : unitIds)
+    mapM_ injectNamespace (Identifier "pas2cRedo" undefined : unitIds)
+    mapM_ (id2C IOInsert . setBaseType BTUnit) unitIds
+    return $ vcat . map (\i -> text $ "#include \"" ++ i ++ ".h\"") $ uses2List uses
+    where
+    injectNamespace (Identifier i _) = do
+        getNS <- gets (flip Map.lookup . namespaces)
+        modify (\s -> s{currentScope = Map.unionWith (++) (fromMaybe Map.empty (getNS i)) $ currentScope s})
+
+uses2List :: Uses -> [String]
+uses2List (Uses ids) = map (\(Identifier i _) -> i) ids
+
+
+setLastIdValues vv = (\s -> s{lastType = baseType vv, lastIdentifier = lcaseId vv, lastIdTypeDecl = typeDecl vv})
+
+id2C :: InsertOption -> Identifier -> State RenderState Doc
+id2C IOInsert i = id2C (IOInsertWithType empty) i
+id2C (IOInsertWithType d) (Identifier i t) = do
+    ns <- gets currentScope
+    tom <- gets (Set.member n . toMangle)
+    cu <- gets currentUnit
+    let (i', t') = case (t, tom) of
+            (BTFunction _ p _, True) -> (cu ++ i ++ ('_' : show p), t)
+            (BTFunction _ _ _, _) -> (cu ++ i, t)
+            (BTVarParam t', _) -> ('(' : '*' : i ++ ")" , t')
+            _ -> (i, t)
+    modify (\s -> s{currentScope = Map.insertWith (++) n [Record i' t' d] (currentScope s), lastIdentifier = n})
+    return $ text i'
+    where
+        n = map toLower i
+
+id2C IOLookup i = id2CLookup head i
+id2C IOLookupLast i = id2CLookup last i
+id2C (IOLookupFunction params) (Identifier i t) = do
+    let i' = map toLower i
+    v <- gets $ Map.lookup i' . currentScope
+    lt <- gets lastType
+    if isNothing v then
+        error $ "Not defined: '" ++ i' ++ "'\n" ++ show lt ++ "\nwith num of params = " ++ show params ++ "\n" ++ show v
+        else
+        let vv = fromMaybe (head $ fromJust v) . find checkParam $ fromJust v in
+            modify (setLastIdValues vv) >> (return . text . lcaseId $ vv)
+    where
+        checkParam (Record _ (BTFunction _ p _) _) = p == params
+        checkParam _ = False
+id2C IODeferred (Identifier i t) = do
+    let i' = map toLower i
+    v <- gets $ Map.lookup i' . currentScope
+    if (isNothing v) then
+        modify (\s -> s{lastType = BTUnknown, lastIdentifier = i}) >> return (text i)
+        else
+        let vv = head $ fromJust v in modify (setLastIdValues vv) >> (return . text . lcaseId $ vv)
+
+id2CLookup :: ([Record] -> Record) -> Identifier -> State RenderState Doc
+id2CLookup f (Identifier i t) = do
+    let i' = map toLower i
+    v <- gets $ Map.lookup i' . currentScope
+    lt <- gets lastType
+    if isNothing v then
+        error $ "Not defined: '" ++ i' ++ "'\n" ++ show lt
+        else
+        let vv = f $ fromJust v in modify (setLastIdValues vv) >> (return . text . lcaseId $ vv)
+
+
+id2CTyped :: TypeDecl -> Identifier -> State RenderState Doc
+id2CTyped = id2CTyped2 Nothing
+
+id2CTyped2 :: Maybe Doc -> TypeDecl -> Identifier -> State RenderState Doc
+id2CTyped2 md t (Identifier i _) = do
+    tb <- resolveType t
+    case (t, tb) of
+        (_, BTUnknown) -> do
+            error $ "id2CTyped: type BTUnknown for " ++ show i ++ "\ntype: " ++ show t
+        (SimpleType {}, BTRecord _ r) -> do
+            ts <- type2C t
+            id2C (IOInsertWithType $ ts empty) (Identifier i (BTRecord (render $ ts empty) r))
+        (_, BTRecord _ r) -> do
+            ts <- type2C t
+            id2C (IOInsertWithType $ ts empty) (Identifier i (BTRecord i r))
+        _ -> case md of
+                Nothing -> id2C IOInsert (Identifier i tb)
+                Just ts -> id2C (IOInsertWithType ts) (Identifier i tb)
+
+
+resolveType :: TypeDecl -> State RenderState BaseType
+resolveType st@(SimpleType (Identifier i _)) = do
+    let i' = map toLower i
+    v <- gets $ Map.lookup i' . currentScope
+    if isJust v then return . baseType . head $ fromJust v else return $ f i'
+    where
+    f "integer" = BTInt
+    f "pointer" = BTPointerTo BTVoid
+    f "boolean" = BTBool
+    f "float" = BTFloat
+    f "char" = BTChar
+    f "string" = BTString
+    f _ = error $ "Unknown system type: " ++ show st
+resolveType (PointerTo (SimpleType (Identifier i _))) = return . BTPointerTo $ BTUnresolved (map toLower i)
+resolveType (PointerTo t) = liftM BTPointerTo $ resolveType t
+resolveType (RecordType tv mtvs) = do
+    tvs <- mapM f (concat $ tv : fromMaybe [] mtvs)
+    return . BTRecord "" . concat $ tvs
+    where
+        f :: TypeVarDeclaration -> State RenderState [(String, BaseType)]
+        f (VarDeclaration _ _ (ids, td) _) = mapM (\(Identifier i _) -> liftM ((,) i) $ resolveType td) ids
+resolveType (ArrayDecl (Just i) t) = do
+    t' <- resolveType t
+    return $ BTArray i BTInt t'
+resolveType (ArrayDecl Nothing t) = liftM (BTArray RangeInfinite BTInt) $ resolveType t
+resolveType (FunctionType t a) = liftM (BTFunction False (length a)) $ resolveType t
+resolveType (DeriveType (InitHexNumber _)) = return BTInt
+resolveType (DeriveType (InitNumber _)) = return BTInt
+resolveType (DeriveType (InitFloat _)) = return BTFloat
+resolveType (DeriveType (InitString _)) = return BTString
+resolveType (DeriveType (InitBinOp {})) = return BTInt
+resolveType (DeriveType (InitPrefixOp _ e)) = initExpr2C e >> gets lastType
+resolveType (DeriveType (BuiltInFunction{})) = return BTInt
+resolveType (DeriveType (InitReference (Identifier{}))) = return BTBool -- TODO: derive from actual type
+resolveType (DeriveType _) = return BTUnknown
+resolveType (String _) = return BTString
+resolveType VoidType = return BTVoid
+resolveType (Sequence ids) = return $ BTEnum $ map (\(Identifier i _) -> map toLower i) ids
+resolveType (RangeType _) = return $ BTVoid
+resolveType (Set t) = liftM BTSet $ resolveType t
+resolveType (VarParamType t) = liftM BTVarParam $ resolveType t
+
+
+resolve :: String -> BaseType -> State RenderState BaseType
+resolve s (BTUnresolved t) = do
+    v <- gets $ Map.lookup t . currentScope
+    if isJust v then
+        resolve s . baseType . head . fromJust $ v
+        else
+        error $ "Unknown type " ++ show t ++ "\n" ++ s
+resolve _ t = return t
+
+fromPointer :: String -> BaseType -> State RenderState BaseType
+fromPointer s (BTPointerTo t) = resolve s t
+fromPointer s t = do
+    error $ "Dereferencing from non-pointer type " ++ show t ++ "\n" ++ s
+
+
+functionParams2C params = liftM (hcat . punctuate comma . concat) $ mapM (tvar2C False False True True) params
+
+numberOfDeclarations :: [TypeVarDeclaration] -> Int
+numberOfDeclarations = sum . map cnt
+    where
+        cnt (VarDeclaration _ _ (ids, _) _) = length ids
+        cnt _ = 1
+
+hasPassByReference :: [TypeVarDeclaration] -> Bool
+hasPassByReference = or . map isVar
+    where
+        isVar (VarDeclaration v _ (_, _) _) = v
+        isVar _ = error $ "hasPassByReference called not on function parameters"
+
+toIsVarList :: [TypeVarDeclaration] -> [Bool]
+toIsVarList = concatMap isVar
+    where
+        isVar (VarDeclaration v _ (p, _) _) = replicate (length p) v
+        isVar _ = error $ "toIsVarList called not on function parameters"
+
+
+funWithVarsToDefine :: String -> [TypeVarDeclaration] -> Doc
+funWithVarsToDefine n params = text "#define" <+> text n <> parens abc <+> text (n ++ "__vars") <> parens cparams
+    where
+        abc = hcat . punctuate comma . map (char . fst) $ ps
+        cparams = hcat . punctuate comma . map (\(c, v) -> if v then char '&' <> parens (char c) else char c) $ ps
+        ps = zip ['a'..] (toIsVarList params)
+
+fun2C :: Bool -> String -> TypeVarDeclaration -> State RenderState [Doc]
+fun2C _ _ (FunctionDeclaration name inline returnType params Nothing) = do
+    t <- type2C returnType
+    t'<- gets lastType
+    p <- withState' id $ functionParams2C params
+    n <- liftM render . id2C IOInsert $ setBaseType (BTFunction hasVars (numberOfDeclarations params) t') name
+    let decor = if inline then text "inline" else empty
+    if hasVars then
+        return [funWithVarsToDefine n params $+$ decor <+> t empty <+> text (n ++ "__vars") <> parens p]
+        else
+        return [decor <+> t empty <+> text n <> parens p]
+    where
+        hasVars = hasPassByReference params
+
+
+fun2C True rv (FunctionDeclaration name@(Identifier i _) inline returnType params (Just (tvars, phrase))) = do
+    let res = docToLower $ text rv <> text "_result"
+    t <- type2C returnType
+    t'<- gets lastType
+
+    notDeclared <- liftM isNothing . gets $ Map.lookup (map toLower i) . currentScope
+
+    n <- liftM render . id2C IOInsert $ setBaseType (BTFunction hasVars (numberOfDeclarations params) t') name
+
+    let isVoid = case returnType of
+            VoidType -> True
+            _ -> False
+
+    (p, ph) <- withState' (\st -> st{currentScope = Map.insertWith un (map toLower rv) [Record (render res) t' empty] $ currentScope st
+            , currentFunctionResult = if isVoid then [] else render res}) $ do
+        p <- functionParams2C params
+        ph <- liftM2 ($+$) (typesAndVars2C False False True tvars) (phrase2C' phrase)
+        return (p, ph)
+
+    let phrasesBlock = if isVoid then ph else t empty <+> res <> semi $+$ ph $+$ text "return" <+> res <> semi
+    let define = if hasVars then text "#ifndef" <+> text n $+$ funWithVarsToDefine n params $+$ text "#endif" else empty
+    let decor = if inline then text "inline" else empty
+    return [
+        define
+        $+$
+        --(if notDeclared && hasVars then funWithVarsToDefine n params else empty) $+$
+        decor <+> t empty <+> text (if hasVars then n ++ "__vars" else n) <> parens p
+        $+$
+        text "{"
+        $+$
+        nest 4 phrasesBlock
+        $+$
+        text "}"]
+    where
+    phrase2C' (Phrases p) = liftM vcat $ mapM phrase2C p
+    phrase2C' p = phrase2C p
+    un [a] b = a : b
+    hasVars = hasPassByReference params
+
+fun2C False _ (FunctionDeclaration (Identifier name _) _ _ _ _) = error $ "nested functions not allowed: " ++ name
+fun2C _ tv _ = error $ "fun2C: I don't render " ++ show tv
+
+-- the second bool indicates whether declare variable as extern or not
+-- the third bool indicates whether include types or not
+-- the fourth bool indicates whether ignore initialization or not (basically for dynamic arrays since we cannot do initialization in function params)
+tvar2C :: Bool -> Bool -> Bool -> Bool -> TypeVarDeclaration -> State RenderState [Doc]
+tvar2C b _ includeType _ f@(FunctionDeclaration (Identifier name _) _ _ _ _) = do
+    t <- fun2C b name f
+    if includeType then return t else return []
+tvar2C _ _ includeType _ td@(TypeDeclaration i' t) = do
+    i <- id2CTyped t i'
+    tp <- type2C t
+    return $ if includeType then [text "typedef" <+> tp i] else []
+
+tvar2C _ _ _ _ (VarDeclaration True _ (ids, t) Nothing) = do
+    t' <- liftM ((empty <+>) . ) $ type2C t
+    liftM (map(\i -> t' i)) $ mapM (id2CTyped2 (Just $ t' empty) (VarParamType t)) ids
+
+tvar2C _ externVar includeType ignoreInit (VarDeclaration _ isConst (ids, t) mInitExpr) = do
+    t' <- liftM (((if isConst then text "static const" else if externVar 
+                                                                then text "extern"
+                                                                else empty)
+                   <+>) . ) $ type2C t
+    ie <- initExpr mInitExpr
+    lt <- gets lastType
+    case (isConst, lt, ids, mInitExpr) of
+         (True, BTInt, [i], Just _) -> do
+             i' <- id2CTyped t i
+             return $ if includeType then [text "enum" <> braces (i' <+> ie)] else []
+         (True, BTFloat, [i], Just e) -> do
+             i' <- id2CTyped t i
+             ie <- initExpr2C e
+             return $ if includeType then [text "#define" <+> i' <+> parens ie <> text "\n"] else []
+         (_, BTFunction{}, _, Nothing) -> liftM (map(\i -> t' i)) $ mapM (id2CTyped t) ids
+         (_, BTArray r _ _, [i], _) -> do
+            i' <- id2CTyped t i
+            ie' <- return $ case (r, mInitExpr, ignoreInit) of
+                (RangeInfinite, Nothing, False) -> text "= NULL" -- force dynamic array to be initialized as NULL if not initialized at all
+                (_, _, _) -> ie
+            result <- liftM (map(\i -> varDeclDecision isConst includeType (t' i) ie')) $ mapM (id2CTyped t) ids           
+            case (r, ignoreInit) of
+                (RangeInfinite, False) -> 
+                    -- if the array is dynamic, add dimension info to it
+                    return $ [dimDecl] ++ result
+                    where 
+                        arrayDimStr = show $ arrayDimension t
+                        arrayDimInitExp = text ("={" ++ ".dim = " ++ arrayDimStr ++ ", .a = {0, 0, 0, 0}}")
+                        dimDecl = varDeclDecision isConst includeType (text "fpcrtl_dimension_t" <+>  i' <> text "_dimension_info") arrayDimInitExp
+                    
+                (_, _) -> return result
+            
+         _ -> liftM (map(\i -> varDeclDecision isConst includeType (t' i) ie)) $ mapM (id2CTyped2 (Just $ t' empty) t) ids
+    where
+    initExpr Nothing = return $ empty
+    initExpr (Just e) = liftM (text "=" <+>) (initExpr2C e)
+    varDeclDecision True True varStr expStr = varStr <+> expStr
+    varDeclDecision False True varStr expStr = if externVar then varStr else varStr <+> expStr
+    varDeclDecision False False varStr expStr = varStr <+> expStr
+    varDeclDecision True False varStr expStr = empty
+    arrayDimension a = case a of
+        ArrayDecl Nothing t -> let a = arrayDimension t in if a > 3 then error "Dynamic array with dimension > 4 is not supported." else 1 + arrayDimension t
+        ArrayDecl _ _ -> error "Mixed dynamic array and static array are not supported."
+        _ -> 0
+
+tvar2C f _ _ _ (OperatorDeclaration op (Identifier i _) inline ret params body) = do
+    r <- op2CTyped op (extractTypes params)
+    fun2C f i (FunctionDeclaration r inline ret params body)
+
+
+op2CTyped :: String -> [TypeDecl] -> State RenderState Identifier
+op2CTyped op t = do
+    t' <- liftM (render . hcat . punctuate (char '_') . map (\t -> t empty)) $ mapM type2C t
+    bt <- gets lastType
+    return $ Identifier (t' ++ "_op_" ++ opStr) bt
+    where
+    opStr = case op of
+                    "+" -> "add"
+                    "-" -> "sub"
+                    "*" -> "mul"
+                    "/" -> "div"
+                    "/(float)" -> "div"
+                    "=" -> "eq"
+                    "<" -> "lt"
+                    ">" -> "gt"
+                    "<>" -> "neq"
+                    _ -> error $ "op2CTyped: unknown op '" ++ op ++ "'"
+
+extractTypes :: [TypeVarDeclaration] -> [TypeDecl]
+extractTypes = concatMap f
+    where
+        f (VarDeclaration _ _ (ids, t) _) = replicate (length ids) t
+        f a = error $ "extractTypes: can't extract from " ++ show a
+
+initExpr2C, initExpr2C' :: InitExpression -> State RenderState Doc
+initExpr2C (InitArray values) = liftM (braces . vcat . punctuate comma) $ mapM initExpr2C values
+initExpr2C a = initExpr2C' a
+initExpr2C' InitNull = return $ text "NULL"
+initExpr2C' (InitAddress expr) = do
+    ie <- initExpr2C' expr
+    lt <- gets lastType
+    case lt of
+        BTFunction True _ _ -> return $ text "&" <> ie <> text "__vars"
+        _ -> return $ text "&" <> ie
+initExpr2C' (InitPrefixOp op expr) = liftM (text (op2C op) <>) (initExpr2C' expr)
+initExpr2C' (InitBinOp op expr1 expr2) = do
+    e1 <- initExpr2C' expr1
+    e2 <- initExpr2C' expr2
+    return $ parens $ e1 <+> text (op2C op) <+> e2
+initExpr2C' (InitNumber s) = return $ text s
+initExpr2C' (InitFloat s) = return $ text s
+initExpr2C' (InitHexNumber s) = return $ text "0x" <> (text . map toLower $ s)
+initExpr2C' (InitString [a]) = return . quotes $ text [a]
+initExpr2C' (InitString s) = return $ strInit s
+initExpr2C' (InitChar a) = return $ quotes $ text "\\x" <> text (showHex (read a) "")
+initExpr2C' (InitReference i) = id2C IOLookup i
+initExpr2C' (InitRecord fields) = do
+    (fs :: [Doc]) <- mapM (\(Identifier a _, b) -> liftM (text "." <> text a <+> equals <+>) $ initExpr2C b) fields
+    return $ lbrace $+$ (nest 4 . vcat . punctuate comma $ fs) $+$ rbrace
+initExpr2C' (InitArray [value]) = initExpr2C value
+initExpr2C' r@(InitRange (Range i@(Identifier i' _))) = do
+    id2C IOLookup i
+    t <- gets lastType
+    case t of
+         BTEnum s -> return . int $ length s
+         BTInt -> case i' of
+                       "byte" -> return $ int 256
+                       _ -> error $ "InitRange identifier: " ++ i'
+         _ -> error $ "InitRange: " ++ show r
+initExpr2C' (InitRange (RangeFromTo (InitNumber "0") r)) = initExpr2C $ BuiltInFunction "succ" [r]
+initExpr2C' (InitRange (RangeFromTo (InitChar "0") (InitChar r))) = initExpr2C $ BuiltInFunction "succ" [InitNumber r]
+initExpr2C' (InitRange a) = error $ show a --return $ text "<<range>>"
+initExpr2C' (InitSet []) = return $ text "0"
+initExpr2C' (InitSet a) = return $ text "<<set>>"
+initExpr2C' (BuiltInFunction "low" [InitReference e]) = return $
+    case e of
+         (Identifier "LongInt" _) -> int (-2^31)
+         (Identifier "SmallInt" _) -> int (-2^15)
+         _ -> error $ "BuiltInFunction 'low': " ++ show e
+initExpr2C' (BuiltInFunction "high" [e]) = do
+    initExpr2C e
+    t <- gets lastType
+    case t of
+         (BTArray i _ _) -> initExpr2C' $ BuiltInFunction "pred" [InitRange i]
+         a -> error $ "BuiltInFunction 'high': " ++ show a
+initExpr2C' (BuiltInFunction "succ" [BuiltInFunction "pred" [e]]) = initExpr2C' e
+initExpr2C' (BuiltInFunction "pred" [BuiltInFunction "succ" [e]]) = initExpr2C' e
+initExpr2C' (BuiltInFunction "succ" [e]) = liftM (<> text " + 1") $ initExpr2C' e
+initExpr2C' (BuiltInFunction "pred" [e]) = liftM (<> text " - 1") $ initExpr2C' e
+initExpr2C' b@(BuiltInFunction _ _) = error $ show b
+initExpr2C' a = error $ "initExpr2C: don't know how to render " ++ show a
+
+
+range2C :: InitExpression -> State RenderState [Doc]
+range2C (InitString [a]) = return [quotes $ text [a]]
+range2C (InitRange (Range i)) = liftM (flip (:) []) $ id2C IOLookup i
+range2C (InitRange (RangeFromTo (InitString [a]) (InitString [b]))) = return $ map (\i -> quotes $ text [i]) [a..b]
+range2C a = liftM (flip (:) []) $ initExpr2C a
+
+baseType2C :: String -> BaseType -> Doc
+baseType2C _ BTFloat = text "float"
+baseType2C _ BTBool = text "bool"
+baseType2C _ BTString = text "string255"
+baseType2C s a = error $ "baseType2C: " ++ show a ++ "\n" ++ s
+
+type2C :: TypeDecl -> State RenderState (Doc -> Doc)
+type2C (SimpleType i) = liftM (\i a -> i <+> a) $ id2C IOLookup i
+type2C t = do
+    r <- type2C' t
+    rt <- resolveType t
+    modify (\st -> st{lastType = rt})
+    return r
+    where
+    type2C' VoidType = return (text "void" <+>)
+    type2C' (String l) = return (text "string255" <+>)--return (text ("string" ++ show l) <+>)
+    type2C' (PointerTo (SimpleType i)) = do
+        i' <- id2C IODeferred i
+        lt <- gets lastType
+        case lt of
+             BTRecord _ _ -> return $ \a -> text "struct __" <> i' <+> text "*" <+> a
+             BTUnknown -> return $ \a -> text "struct __" <> i' <+> text "*" <+> a
+             _ -> return $ \a -> i' <+> text "*" <+> a
+    type2C' (PointerTo t) = liftM (\t a -> t (parens $ text "*" <> a)) $ type2C t
+    type2C' (RecordType tvs union) = do
+        t <- withState' f $ mapM (tvar2C False False True False) tvs
+        u <- unions
+        return $ \i -> text "struct __" <> i <+> lbrace $+$ nest 4 ((vcat . map (<> semi) . concat $ t) $$ u) $+$ rbrace <+> i
+        where
+            f s = s{currentUnit = ""}
+            unions = case union of
+                     Nothing -> return empty
+                     Just a -> do
+                         structs <- mapM struct2C a
+                         return $ text "union" $+$ braces (nest 4 $ vcat structs) <> semi
+            struct2C tvs = do
+                t <- withState' f $ mapM (tvar2C False False True False) tvs
+                return $ text "struct" $+$ braces (nest 4 (vcat . map (<> semi) . concat $ t)) <> semi
+    type2C' (RangeType r) = return (text "int" <+>)
+    type2C' (Sequence ids) = do
+        is <- mapM (id2C IOInsert . setBaseType bt) ids
+        return (text "enum" <+> (braces . vcat . punctuate comma . map (\(a, b) -> a <+> equals <+> text "0x" <> text (showHex b "")) $ zip is [0..]) <+>)
+        where
+            bt = BTEnum $ map (\(Identifier i _) -> map toLower i) ids
+    type2C' (ArrayDecl Nothing t) = type2C (PointerTo t)
+    type2C' (ArrayDecl (Just r) t) = do
+        t' <- type2C t
+        lt <- gets lastType
+        ft <- case lt of
+                -- BTFunction {} -> type2C (PointerTo t)
+                _ -> return t'
+        r' <- initExpr2C (InitRange r)
+        return $ \i -> ft i <> brackets r'
+    type2C' (Set t) = return (text "<<set>>" <+>)
+    type2C' (FunctionType returnType params) = do
+        t <- type2C returnType
+        p <- withState' id $ functionParams2C params
+        return (\i -> (t empty <> (parens $ text "*" <> i) <> parens p))
+    type2C' (DeriveType (InitBinOp _ _ i)) = type2C' (DeriveType i)
+    type2C' (DeriveType (InitPrefixOp _ i)) = type2C' (DeriveType i)
+    type2C' (DeriveType (InitNumber _)) = return (text "int" <+>)
+    type2C' (DeriveType (InitHexNumber _)) = return (text "int" <+>)
+    type2C' (DeriveType (InitFloat _)) = return (text "float" <+>)
+    type2C' (DeriveType (BuiltInFunction {})) = return (text "int" <+>)
+    type2C' (DeriveType (InitString {})) = return (text "string255" <+>)
+    type2C' (DeriveType r@(InitReference {})) = do
+        initExpr2C r
+        t <- gets lastType
+        return (baseType2C (show r) t <+>)
+    type2C' (DeriveType a) = error $ "Can't derive type from " ++ show a
+
+phrase2C :: Phrase -> State RenderState Doc
+phrase2C (Phrases p) = do
+    ps <- mapM phrase2C p
+    return $ text "{" $+$ (nest 4 . vcat $ ps) $+$ text "}"
+phrase2C (ProcCall f@(FunCall {}) []) = liftM (<> semi) $ ref2C f
+phrase2C (ProcCall ref []) = liftM (<> semi) $ ref2CF ref
+phrase2C (ProcCall ref params) = error $ "ProcCall"{-do
+    r <- ref2C ref
+    ps <- mapM expr2C params
+    return $ r <> parens (hsep . punctuate (char ',') $ ps) <> semi -}
+phrase2C (IfThenElse (expr) phrase1 mphrase2) = do
+    e <- expr2C expr
+    p1 <- (phrase2C . wrapPhrase) phrase1
+    el <- elsePart
+    return $
+        text "if" <> parens e $+$ p1 $+$ el
+    where
+    elsePart | isNothing mphrase2 = return $ empty
+             | otherwise = liftM (text "else" $$) $ (phrase2C . wrapPhrase) (fromJust mphrase2)
+phrase2C (Assignment ref expr) = do
+    r <- ref2C ref
+    t <- gets lastType
+    case (t, expr) of
+        (BTFunction {}, (Reference r')) -> do
+            e <- ref2C r'
+            return $ r <+> text "=" <+> e <> semi
+        (BTString, _) -> do
+            e <- expr2C expr
+            lt <- gets lastType
+            case lt of
+                -- assume pointer to char for simplicity
+                BTPointerTo _ -> do
+                    e <- expr2C $ Reference $ FunCall [Reference $ RefExpression expr] (SimpleReference (Identifier "pchar2str" BTUnknown))
+                    return $ r <+> text "=" <+> e <> semi
+                BTString -> do
+                    e <- expr2C expr
+                    return $ r <+> text "=" <+> e <> semi
+                _ -> error $ "Assignment to string from " ++ show lt
+        (BTArray _ _ _, _) -> do
+            case expr of
+                Reference er -> do
+                    exprRef <- ref2C er
+                    exprT <- gets lastType
+                    case exprT of
+                        BTArray RangeInfinite _ _ ->
+                            return $ text "FIXME: assign a dynamic array to an array"
+                        BTArray _ _ _ -> phrase2C $
+                                ProcCall (FunCall
+                                    [
+                                    Reference $ ref
+                                    , Reference $ RefExpression expr
+                                    , Reference $ FunCall [expr] (SimpleReference (Identifier "sizeof" BTUnknown))
+                                    ]
+                                    (SimpleReference (Identifier "memcpy" BTUnknown))
+                                    ) []
+                        _ -> return $ text "FIXME: assign a non-specific value to an array"
+
+                _ -> return $ text "FIXME: dynamic array assignment 2"
+        _ -> do
+            e <- expr2C expr
+            return $ r <+> text "=" <+> e <> semi
+phrase2C (WhileCycle expr phrase) = do
+    e <- expr2C expr
+    p <- phrase2C $ wrapPhrase phrase
+    return $ text "while" <> parens e $$ p
+phrase2C (SwitchCase expr cases mphrase) = do
+    e <- expr2C expr
+    cs <- mapM case2C cases
+    d <- dflt
+    return $
+        text "switch" <> parens e $+$ braces (nest 4 . vcat $ cs ++ d)
+    where
+    case2C :: ([InitExpression], Phrase) -> State RenderState Doc
+    case2C (e, p) = do
+        ies <- mapM range2C e
+        ph <- phrase2C p
+        return $
+             vcat (map (\i -> text "case" <+> i <> colon) . concat $ ies) <> nest 4 (ph $+$ text "break;")
+    dflt | isNothing mphrase = return [text "default: break;"] -- avoid compiler warning
+         | otherwise = do
+             ph <- mapM phrase2C $ fromJust mphrase
+             return [text "default:" <+> nest 4 (vcat ph)]
+
+phrase2C wb@(WithBlock ref p) = do
+    r <- ref2C ref
+    t <- gets lastType
+    case t of
+        (BTRecord _ rs) -> withRecordNamespace (render r ++ ".") (rec2Records rs) $ phrase2C $ wrapPhrase p
+        a -> do
+            error $ "'with' block referencing non-record type " ++ show a ++ "\n" ++ show wb
+phrase2C (ForCycle i' e1' e2' p up) = do
+    i <- id2C IOLookup i'
+    iType <- gets lastIdTypeDecl
+    e1 <- expr2C e1'
+    e2 <- expr2C e2'
+    let inc = if up then "inc" else "dec"
+    let add = if up then "+ 1" else "- 1"
+    let iEnd = i <> text "__end__"
+    ph <- phrase2C . appendPhrase (BuiltInFunctionCall [Reference $ SimpleReference i'] (SimpleReference (Identifier inc BTUnknown))) $ wrapPhrase p
+    return . braces $
+        i <+> text "=" <+> e1 <> semi
+        $$
+        iType <+> iEnd <+> text "=" <+> e2 <> semi
+        $$ 
+        text "if" <+> (parens $ i <+> text "<=" <+> iEnd) <+> text "do" <+> ph <+>
+        text "while" <> parens (i <+> text "!=" <+> iEnd <+> text add) <> semi
+    where
+        appendPhrase p (Phrases ps) = Phrases $ ps ++ [p]
+phrase2C (RepeatCycle e' p') = do
+    e <- expr2C e'
+    p <- phrase2C (Phrases p')
+    return $ text "do" <+> p <+> text "while" <> parens (text "!" <> parens e) <> semi
+phrase2C NOP = return $ text ";"
+
+phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "exit" BTUnknown))) = do
+    f <- gets currentFunctionResult
+    if null f then
+        return $ text "return" <> semi
+        else
+        return $ text "return" <+> text f <> semi
+phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "break" BTUnknown))) = return $ text "break" <> semi
+phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "continue" BTUnknown))) = return $ text "continue" <> semi
+phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "exit" BTUnknown))) = liftM (\e -> text "return" <+> e <> semi) $ expr2C e
+phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "dec" BTUnknown))) = liftM (\e -> text "--" <> e <> semi) $ expr2C e
+phrase2C (BuiltInFunctionCall [e1, e2] (SimpleReference (Identifier "dec" BTUnknown))) = liftM2 (\a b -> a <> text " -= " <> b <> semi) (expr2C e1) (expr2C e2)
+phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "inc" BTUnknown))) = liftM (\e -> text "++" <> e <> semi) $ expr2C e
+phrase2C (BuiltInFunctionCall [e1, e2] (SimpleReference (Identifier "inc" BTUnknown))) = liftM2 (\a b -> a <+> text "+=" <+> b <> semi) (expr2C e1) (expr2C e2)
+phrase2C a = error $ "phrase2C: " ++ show a
 
 wrapPhrase p@(Phrases _) = p
 wrapPhrase p = Phrases [p]
 
+expr2C :: Expression -> State RenderState Doc
+expr2C (Expression s) = return $ text s
+expr2C b@(BinOp op expr1 expr2) = do
+    e1 <- expr2C expr1
+    t1 <- gets lastType
+    e2 <- expr2C expr2
+    t2 <- gets lastType
+    case (op2C op, t1, t2) of
+        ("+", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strconcat" (BTFunction False 2 BTString))
+        ("+", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strappend" (BTFunction False 2 BTString))
+        ("+", BTChar, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strprepend" (BTFunction False 2 BTString))
+        ("+", BTChar, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_chrconcat" (BTFunction False 2 BTString))
+        ("==", BTString, BTChar) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcomparec" (BTFunction False 2 BTBool))
+        ("==", BTString, BTString) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strcompare" (BTFunction False 2 BTBool))
+        ("!=", BTString, _) -> expr2C $ BuiltInFunCall [expr1, expr2] (SimpleReference $ Identifier "_strncompare" (BTFunction False 2 BTBool))
+        ("&", BTBool, _) -> return $ parens e1 <+> text "&&" <+> parens e2
+        ("|", BTBool, _) -> return $ parens e1 <+> text "||" <+> parens e2
+        (_, BTRecord t1 _, BTRecord t2 _) -> do
+            i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier t2 undefined)]
+            ref2C $ FunCall [expr1, expr2] (SimpleReference i)
+        (_, BTRecord t1 _, BTInt) -> do
+            -- aw, "LongInt" here is hwengine-specific hack
+            i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier "LongInt" undefined)]
+            ref2C $ FunCall [expr1, expr2] (SimpleReference i)
+        ("in", _, _) ->
+            case expr2 of
+                 SetExpression set -> do
+                     ids <- mapM (id2C IOLookup) set
+                     modify(\s -> s{lastType = BTBool})
+                     return . parens . hcat . punctuate (text " || ") . map (\i -> parens $ e1 <+> text "==" <+> i) $ ids
+                 _ -> error "'in' against not set expression"
+        (o, _, _) | o `elem` boolOps -> do
+                        modify(\s -> s{lastType = BTBool})
+                        return $ parens e1 <+> text o <+> parens e2
+                  | otherwise -> do
+                        o' <- return $ case o of
+                            "/(float)" -> text "/(float)" -- pascal returns real value
+                            _ -> text o
+                        e1' <- return $ case (o, t1, t2) of
+                                ("-", BTInt, BTInt) -> parens $ text "(int64_t)" <+> parens e1
+                                _ -> parens e1
+                        e2' <- return $ case (o, t1, t2) of
+                                ("-", BTInt, BTInt) -> parens $ text "(int64_t)" <+> parens e2
+                                _ -> parens e2
+                        return $ e1' <+> o' <+> e2'
+    where
+        boolOps = ["==", "!=", "<", ">", "<=", ">="]
+expr2C (NumberLiteral s) = do
+    modify(\s -> s{lastType = BTInt})
+    return $ text s
+expr2C (FloatLiteral s) = return $ text s
+expr2C (HexNumber s) = return $ text "0x" <> (text . map toLower $ s)
+{-expr2C (StringLiteral [a]) = do
+    modify(\s -> s{lastType = BTChar})
+    return . quotes . text $ escape a
+    where
+        escape '\'' = "\\\'"
+        escape a = [a]-}
+expr2C (StringLiteral s) = addStringConst s
+expr2C (PCharLiteral s) = return . doubleQuotes $ text s
+expr2C (Reference ref) = ref2CF ref
+expr2C (PrefixOp op expr) = do
+    e <- expr2C expr
+    lt <- gets lastType
+    case lt of
+        BTRecord t _ -> do
+            i <- op2CTyped op [SimpleType (Identifier t undefined)]
+            ref2C $ FunCall [expr] (SimpleReference i)
+        BTBool -> do
+            o <- return $ case op of
+                     "not" -> text "!"
+                     _ -> text (op2C op)
+            return $ o <> parens e
+        _ -> return $ text (op2C op) <> parens e
+expr2C Null = return $ text "NULL"
+expr2C (CharCode a) = do
+    modify(\s -> s{lastType = BTChar})
+    return $ quotes $ text "\\x" <> text (showHex (read a) "")
+expr2C (HexCharCode a) = if length a <= 2 then return $ quotes $ text "\\x" <> text (map toLower a) else expr2C $ HexNumber a
+expr2C (SetExpression ids) = mapM (id2C IOLookup) ids >>= return . parens . hcat . punctuate (text " | ")
+
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "low" _))) = do
+    e' <- liftM (map toLower . render) $ expr2C e
+    lt <- gets lastType
+    case lt of
+         BTEnum a -> return $ int 0
+         BTInt -> case e' of
+                  "longint" -> return $ int (-2147483648)
+         BTArray {} -> return $ int 0
+         _ -> error $ "BuiltInFunCall 'low' from " ++ show e ++ "\ntype: " ++ show lt
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "high" _))) = do
+    e' <- liftM (map toLower . render) $ expr2C e
+    lt <- gets lastType
+    case lt of
+         BTEnum a -> return . int $ length a - 1
+         BTInt -> case e' of
+                  "longint" -> return $ int (2147483647)
+         BTString -> return $ int 255
+         BTArray (RangeFromTo _ n) _ _ -> initExpr2C n
+         _ -> error $ "BuiltInFunCall 'high' from " ++ show e ++ "\ntype: " ++ show lt
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "ord" _))) = liftM parens $ expr2C e
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "succ" _))) = liftM (<> text " + 1") $ expr2C e
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "pred" _))) = liftM (<> text " - (int64_t)1") $ expr2C e
+expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "length" _))) = do
+    e' <- expr2C e
+    lt <- gets lastType
+    modify (\s -> s{lastType = BTInt})
+    case lt of
+         BTString -> return $ text "fpcrtl_Length" <> parens e'
+         BTArray RangeInfinite _ _ -> error $ "length() called on variable size array " ++ show e'
+         BTArray (RangeFromTo _ n) _ _ -> initExpr2C (BuiltInFunction "succ" [n])
+         _ -> error $ "length() called on " ++ show lt
+expr2C (BuiltInFunCall params ref) = do
+    r <- ref2C ref
+    t <- gets lastType
+    ps <- mapM expr2C params
+    case t of
+        BTFunction _ _ t' -> do
+            modify (\s -> s{lastType = t'})
+        _ -> error $ "BuiltInFunCall lastType: " ++ show t
+    return $
+        r <> parens (hsep . punctuate (char ',') $ ps)
+expr2C a = error $ "Don't know how to render " ++ show a
+
+ref2CF :: Reference -> State RenderState Doc
+ref2CF (SimpleReference name) = do
+    i <- id2C IOLookup name
+    t <- gets lastType
+    case t of
+         BTFunction _ _ rt -> do
+             modify(\s -> s{lastType = rt})
+             return $ i <> parens empty --xymeng: removed parens
+         _ -> return $ i
+ref2CF r@(RecordField (SimpleReference _) (SimpleReference _)) = do
+    i <- ref2C r
+    t <- gets lastType
+    case t of
+         BTFunction _ _ rt -> do
+             modify(\s -> s{lastType = rt})
+             return $ i <> parens empty
+         _ -> return $ i
+ref2CF r = ref2C r
+
+ref2C :: Reference -> State RenderState Doc
+-- rewrite into proper form
+ref2C (RecordField ref1 (ArrayElement exprs ref2)) = ref2C $ ArrayElement exprs (RecordField ref1 ref2)
+ref2C (RecordField ref1 (Dereference ref2)) = ref2C $ Dereference (RecordField ref1 ref2)
+ref2C (RecordField ref1 (RecordField ref2 ref3)) = ref2C $ RecordField (RecordField ref1 ref2) ref3
+ref2C (RecordField ref1 (FunCall params ref2)) = ref2C $ FunCall params (RecordField ref1 ref2)
+ref2C (ArrayElement (a:b:xs) ref) = ref2C $ ArrayElement (b:xs) (ArrayElement [a] ref)
+-- conversion routines
+ref2C ae@(ArrayElement [expr] ref) = do
+    e <- expr2C expr
+    r <- ref2C ref
+    t <- gets lastType
+    case t of
+         (BTArray _ _ t') -> modify (\st -> st{lastType = t'})
+--         (BTFunctionReturn _ (BTArray _ _ t')) -> modify (\st -> st{lastType = t'})
+--         (BTFunctionReturn _ (BTString)) -> modify (\st -> st{lastType = BTChar})
+         (BTString) -> modify (\st -> st{lastType = BTChar})
+         (BTPointerTo t) -> do
+                t'' <- fromPointer (show t) =<< gets lastType
+                case t'' of
+                     BTChar -> modify (\st -> st{lastType = BTChar})
+                     a -> error $ "Getting element of " ++ show a ++ "\nReference: " ++ show ae
+         a -> error $ "Getting element of " ++ show a ++ "\nReference: " ++ show ae
+    case t of
+         BTString ->  return $ r <> text ".s" <> brackets e
+         _ -> return $ r <> brackets e
+ref2C (SimpleReference name) = id2C IOLookup name
+ref2C rf@(RecordField (Dereference ref1) ref2) = do
+    r1 <- ref2C ref1
+    t <- fromPointer (show ref1) =<< gets lastType
+    r2 <- case t of
+        BTRecord _ rs -> withRecordNamespace "" (rec2Records rs) $ ref2C ref2
+        BTUnit -> error "What??"
+        a -> error $ "dereferencing from " ++ show a ++ "\n" ++ show rf
+    return $
+        r1 <> text "->" <> r2
+ref2C rf@(RecordField ref1 ref2) = do
+    r1 <- ref2C ref1
+    t <- gets lastType
+    case t of
+        BTRecord _ rs -> do
+            r2 <- withRecordNamespace "" (rec2Records rs) $ ref2C ref2
+            return $ r1 <> text "." <> r2
+        BTUnit -> withLastIdNamespace $ ref2C ref2
+        a -> error $ "dereferencing from " ++ show a ++ "\n" ++ show rf
+ref2C d@(Dereference ref) = do
+    r <- ref2C ref
+    t <- fromPointer (show d) =<< gets lastType
+    modify (\st -> st{lastType = t})
+    return $ (parens $ text "*" <> r)
+ref2C f@(FunCall params ref) = do
+    r <- fref2C ref
+    t <- gets lastType
+    case t of
+        BTFunction _ _ t' -> do
+            ps <- liftM (parens . hsep . punctuate (char ',')) $ mapM expr2C params
+            modify (\s -> s{lastType = t'})
+            return $ r <> ps
+        _ -> case (ref, params) of
+                  (SimpleReference i, [p]) -> ref2C $ TypeCast i p
+                  _ -> error $ "ref2C FunCall erroneous type cast detected: " ++ show f ++ "\nType detected: " ++ show t
+    where
+    fref2C (SimpleReference name) = id2C (IOLookupFunction $ length params) name
+    fref2C a = ref2C a
+
+ref2C (Address ref) = do
+    r <- ref2C ref
+    lt <- gets lastType
+    case lt of
+        BTFunction True _ _ -> return $ text "&" <> parens (r <> text "__vars")
+        _ -> return $ text "&" <> parens r
+ref2C (TypeCast t'@(Identifier i _) expr) = do
+    lt <- expr2C expr >> gets lastType
+    case (map toLower i, lt) of
+        ("pchar", BTString) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "_pchar" $ BTPointerTo BTChar))
+        ("shortstring", BTPointerTo _) -> ref2C $ FunCall [expr] (SimpleReference (Identifier "pchar2str" $ BTString))
+        (a, _) -> do
+            e <- expr2C expr
+            t <- id2C IOLookup t'
+            return . parens $ parens t <> e
+ref2C (RefExpression expr) = expr2C expr
+
+
+op2C :: String -> String
+op2C "or" = "|"
+op2C "and" = "&"
+op2C "not" = "~"
+op2C "xor" = "^"
+op2C "div" = "/"
+op2C "mod" = "%"
+op2C "shl" = "<<"
+op2C "shr" = ">>"
+op2C "<>" = "!="
+op2C "=" = "=="
+op2C "/" = "/(float)"
+op2C a = a
 
-expr2C :: Expression -> Doc
-expr2C (Expression s) = text s
-expr2C (BinOp op expr1 expr2) = parens $ (expr2C expr1) <+> op2C op <+> (expr2C expr2)
-expr2C (NumberLiteral s) = text s
-expr2C (HexNumber s) = text "0x" <> (text . map toLower $ s)
-expr2C (StringLiteral s) = doubleQuotes $ text s 
-expr2C (Reference ref) = ref2C ref
-expr2C (PrefixOp op expr) = op2C op <+> expr2C expr
-    {-
-    | PostfixOp String Expression
-    | CharCode String
-    -}            
-expr2C _ = empty
-
-
-ref2C :: Reference -> Doc
-ref2C (ArrayElement exprs ref) = ref2C ref <> (brackets . hcat) (punctuate comma $ map expr2C exprs)
-ref2C (SimpleReference (Identifier name)) = text name
-ref2C (RecordField (Dereference ref1) ref2) = ref2C ref1 <> text "->" <> ref2C ref2
-ref2C (RecordField ref1 ref2) = ref2C ref1 <> text "." <> ref2C ref2
-ref2C (Dereference ref) = parens $ text "*" <> ref2C ref
-ref2C (FunCall params ref) = ref2C ref <> parens (hsep . punctuate (char ',') . map expr2C $ params)
-ref2C (Address ref) = text "&" <> ref2C ref
-
-
-op2C "or" = text "|"
-op2C "and" = text "&"
-op2C "not" = text "!"
-op2C "xor" = text "^"
-op2C "div" = text "/"
-op2C "mod" = text "%"
-op2C "shl" = text "<<"
-op2C "shr" = text ">>"
-op2C "<>" = text "!="
-op2C "=" = text "=="
-op2C a = text a
-
-maybeVoid "" = "void"
-maybeVoid a = a
diff --git a/tools/w32DownloadUnzip.vbs b/tools/w32DownloadUnzip.vbs
new file mode 100644
index 0000000..cf3e9f2
--- /dev/null
+++ b/tools/w32DownloadUnzip.vbs
@@ -0,0 +1,64 @@
+' w32DownloadUnzip.vbs
+'   Download a zipfile and uncompress it with no external tools in Windows
+'
+' Copyright (c) 2012, Vittorio Giovara, <vittorio.giovara at gmail.com>
+' Redistribution and use is allowed according to the terms of the BSD license.
+'
+' References
+'   http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line
+'   http://stackoverflow.com/questions/1021557/how-to-unzip-a-file-using-the-command-line
+
+Set ArgObj = WScript.Arguments
+
+If (Wscript.Arguments.Count = 1) Then
+    strFileURL = ArgObj(0)
+    strOutputPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
+Else
+    If (Wscript.Arguments.Count = 2) Then
+        strFileURL = ArgObj(0)
+        strOutputPath = ArgObj(1)
+    Else
+        WScript.Echo ("Usage: csript.exe w32DownloadUnzip.vbs url output")
+        WScript.Quit
+    End if
+End if
+
+strHDLocation = "C:\Windows\Temp\temp.zip"
+
+' Fetch the file
+WScript.Echo ( "Trying to download from " & strFileURL)
+Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
+objXMLHTTP.open "GET", strFileURL, false
+objXMLHTTP.send()
+
+If objXMLHTTP.Status = 200 Then
+    Set objADOStream = CreateObject("ADODB.Stream")
+    objADOStream.Open
+    objADOStream.Type = 1 'adTypeBinary
+
+    objADOStream.Write objXMLHTTP.ResponseBody
+    objADOStream.Position = 0    'Set the stream position to the start
+
+    Set objFSO = Createobject("Scripting.FileSystemObject")
+    If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
+    Set objFSO = Nothing
+
+    objADOStream.SaveToFile strHDLocation
+    objADOStream.Close
+    Set objADOStream = Nothing
+Else
+    WScript.Echo ("Error downloading file (error code: " & objXMLHTTP.Status & ")")
+    Set objXMLHTTP = Nothing
+    WScript.Quit
+End if
+Set objXMLHTTP = Nothing
+
+WScript.Echo ( "Extracting file to " & strOutputPath)
+Set objShell = CreateObject( "Shell.Application" )
+Set objSource = objShell.NameSpace(strHDLocation).Items()
+Set objTarget = objShell.NameSpace(strOutputPath)
+intOptions = 16 'no user prompt
+objTarget.CopyHere objSource, intOptions
+
+WScript.Echo ( "Success!" )
+Set objShell = Nothing

-- 
Worms style game



More information about the Pkg-games-commits mailing list